feat(webapp): add session recording log parser package#1859
feat(webapp): add session recording log parser package#1859Krista House (kristahouse) merged 13 commits into
Conversation
Adds a reusable @devolutions/session-recording-log package for .slog NDJSON parsing, models, ordering, and bounded in-memory search.\n\nIncludes ADR-aligned warning codes and review-driven hardening for large sequence gaps, deep nesting, malformed-heavy input bounds, unknown field caps, and empty-log classification.\n\nUpdates package docs and workspace/publish wiring for consumption.\n\nIssue: DGW-405\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Implementation notes:
|
Let maintainers know that an action is required on their side
|
There was a problem hiding this comment.
Pull request overview
Adds a reusable framework-agnostic package for parsing, ordering, filtering, and searching .slog session recording artifacts.
Changes:
- Implements bounded NDJSON parsing with structured warnings and source metadata.
- Adds display ordering, visible-field search, and tests.
- Integrates package building, documentation, and publication.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/publish-libraries.yml |
Adds package publication. |
webapp/README.md |
Documents the package. |
webapp/pnpm-lock.yaml |
Locks new tooling dependencies. |
webapp/packages/session-recording-log/README.md |
Documents contracts and limits. |
webapp/packages/session-recording-log/build.ps1 |
Builds and packs the library. |
webapp/packages/session-recording-log/package.dist.json |
Defines published metadata. |
webapp/packages/session-recording-log/package.json |
Configures scripts and dependencies. |
webapp/packages/session-recording-log/vite.config.ts |
Configures library bundling. |
webapp/packages/session-recording-log/tsconfig.json |
Configures TypeScript checks. |
webapp/packages/session-recording-log/tsconfig.declaration.json |
Configures declaration output. |
webapp/packages/session-recording-log/src/index.ts |
Exposes the public API. |
webapp/packages/session-recording-log/src/model.ts |
Defines public models and options. |
webapp/packages/session-recording-log/src/parser.ts |
Implements bounded NDJSON parsing. |
webapp/packages/session-recording-log/src/search.ts |
Implements filtered field search. |
webapp/packages/session-recording-log/src/ordering.ts |
Implements non-mutating ordering. |
webapp/packages/session-recording-log/src/manifest.ts |
Detects .slog filenames. |
webapp/packages/session-recording-log/src/parser.test.ts |
Tests parser behavior and limits. |
webapp/packages/session-recording-log/src/helpers.test.ts |
Tests helper APIs. |
Files not reviewed (1)
- webapp/pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Harden parser handling for untrusted input and align package tooling versions:\n\n- reject non-safe integer sequence values\n- preserve __proto__ keys safely with null-prototype maps\n- parse lines lazily without pre-splitting the full file\n- align vite dependency to v6 peer ecosystem\n- add regression tests for unsafe seq and prototype-key preservation\n\nIssue: DGW-405\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Addresses latest Copilot review feedback by normalizing parser numeric limits, pre-indexing warning associations in search, and clarifying truncated missing-sequence wording.\n\nAlso adds regression coverage for invalid numeric option inputs.\n\nIssue: DGW-405\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Expand ADR references for first-time readers by spelling out Architecture Decision Record in README headings/text.\n\nIssue: DGW-405\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Implements the library-only MVP scope inside @devolutions/session-recording-log:\n\n- add centralized src/fixtures sample .slog files\n- add fixture-driven tests for parse/order/warnings/search flows\n- add noUncheckedSideEffectImports in package tsconfig\n- restructure README to sibling-style sections and runnable usage examples\n\nIssue: DGW-405\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Prevents CRLF regressions on Windows by tightening repository/editor line-ending configuration for webapp and common package file types.\n\nIssue: DGW-405\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Formats session-recording-log vite config to workspace Biome rules and updates package check/check:write scripts to include vite.config.ts so future formatting regressions are caught locally.\n\nIssue: DGW-405\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Addresses latest review findings in session-recording-log package:\n\n- make warning-linked search use sourceLine as authoritative and seq only as fallback\n- allow event-type filters to accept forward-compatible string events\n- add aggregate parser warning cap with truncation warning\n- replace TextEncoder line-size check with incremental UTF-8 byte counting\n- add regression tests for warning-association and warning-cap behavior\n\nIssue: DGW-405\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Address latest review feedback for @devolutions/session-recording-log:\n\n- treat non-empty logs with zero valid entries as ended unexpectedly\n- detect parameter-key collisions after truncation and keep first value\n- restore conservative default aggregate warning cap to 10,000\n- add regression tests for completion-state and truncation-collision behavior\n\nIssue: DGW-405\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Address latest review findings:\n\n- execute @devolutions/session-recording-log tests in webapp CI job\n- document maxWarnings option and default in package README\n- fix lifecycle classification note to match implemented completion-state behavior\n\nIssue: DGW-405\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Address latest review findings:\n\n- enforce maxScannedLines on all physical lines (including blank lines)\n- avoid pre-scanning full files for unterminated-final-line source metadata\n- detect missing sequence gaps from start-of-stream baseline\n- add @types/node dev dependency for isolated package type-check reliability\n- add regression tests for blank-line scan cap and leading missing-sequence detection\n\nIssue: DGW-405\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Address latest review feedback and proactive pre-push review:\n\n- mark non-empty truncated inputs as ended-unexpectedly even when scan limit is consumed by blank prefixes\n- classify lifecycle events from original event tokens and reject overlong event fields\n- preserve scan-limit safeguards while avoiding lifecycle misclassification via event truncation\n- extend regression coverage for scan-limit blank-prefix and overlong event semantics\n\nIssue: DGW-405\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Address final PR review and proactive follow-up:\n\n- add aggregate retained source-text byte budget (maxRetainedSourceTextBytes) with bounded default\n- emit �ntry-limit-exceeded warning when source-text retention budget is exceeded\n- ensure lifecycle completeness flags derive only from accepted entries (no dropped-end false complete)\n- restore threshold early-exit for UTF-8 line-size limit checks\n- add parser regression tests for source-text budget behavior and dropped-end completeness semantics\n- document new parser option/default in package README\n\nIssue: DGW-405\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Adds a reusable Session Recording Log package that lets host surfaces consume .slog artifacts consistently without coupling to a specific viewer implementation.
This introduces robust NDJSON parsing with structured warning codes, preserved source metadata, non-mutating display ordering, and bounded in-memory visible-field search for Phase 1 scenarios. It also hardens parser behavior for malformed/incomplete inputs so valid entries remain usable.
Issue: DGW-405