Skip to content

feat(webapp): add session recording log parser package#1859

Merged
Krista House (kristahouse) merged 13 commits into
masterfrom
kristahouse-dgw-405-recording-log-parser
Jul 20, 2026
Merged

feat(webapp): add session recording log parser package#1859
Krista House (kristahouse) merged 13 commits into
masterfrom
kristahouse-dgw-405-recording-log-parser

Conversation

@kristahouse

Copy link
Copy Markdown
Contributor

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

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>
Copilot AI review requested due to automatic review settings July 17, 2026 17:37
@kristahouse

Krista House (kristahouse) commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Implementation notes:

  • Added new reusable package at webapp/packages/session-recording-log (@devolutions/session-recording-log) with parser, models, ordering helper, manifest helper, and bounded visible-field search helper.
  • Kept package host-agnostic: parser accepts decoded UTF-8 text and does not perform retrieval/download reconstruction logic.
  • Preserved parser output in source order with sourceLineNumber / sourceIndex metadata; display ordering remains a separate non-mutating helper.
  • Aligned warning taxonomy to ADR-style codes and added structured warnings for behavior branching in consumers.
  • Applied review-driven hardening:
    • bounded missing-sequence emission for large seq gaps
    • iterative object-depth checks (no recursive depth overflow path)
    • malformed-heavy input bounds via maxScannedLines and finite maxParsedEntries defaults
    • empty log classification fix
    • capped unknown top-level field retention
    • explicit unknown-event-type warning
  • Added regression coverage for large seq gaps, deep nesting, malformed-heavy files, empty input behavior, unknown event warnings, and unknown-field caps.
  • Updated publish and workspace wiring so the package is discoverable and publishable.
  • Ratified and documented v1 numeric defaults in docs following review.

@github-actions

Copy link
Copy Markdown

Let maintainers know that an action is required on their side

  • Add the label release-required Please cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module) when you request a maintainer to cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module)

  • Add the label release-blocker Follow-up is required before cutting a new release if a follow-up is required before cutting a new release

  • Add the label publish-required Please publish libraries (`Devolutions.Gateway.Utils`, OpenAPI clients, etc) when you request a maintainer to publish libraries (Devolutions.Gateway.Utils, OpenAPI clients, etc.)

  • Add the label publish-blocker Follow-up is required before publishing libraries if a follow-up is required before publishing libraries

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread webapp/packages/session-recording-log/src/parser.ts Outdated
Comment thread webapp/packages/session-recording-log/src/parser.ts Outdated
Comment thread webapp/packages/session-recording-log/src/parser.ts Outdated
Comment thread webapp/packages/session-recording-log/src/parser.ts Outdated
Comment thread webapp/packages/session-recording-log/package.json Outdated
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • webapp/pnpm-lock.yaml: Generated file

Comment thread webapp/packages/session-recording-log/src/parser.ts Outdated
Comment thread webapp/packages/session-recording-log/src/search.ts Outdated
Comment thread webapp/packages/session-recording-log/src/parser.ts Outdated
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • webapp/pnpm-lock.yaml: Generated file

@kristahouse
Krista House (kristahouse) marked this pull request as ready for review July 17, 2026 18:11
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 23 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • webapp/pnpm-lock.yaml: Generated file

Comment thread webapp/packages/session-recording-log/src/parser.test.ts
Comment thread webapp/packages/session-recording-log/src/helpers.test.ts
Comment thread webapp/packages/session-recording-log/src/helpers.test.ts
Comment thread webapp/packages/session-recording-log/vite.config.ts Outdated
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 23 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • webapp/pnpm-lock.yaml: Generated file

Comment thread webapp/packages/session-recording-log/src/search.ts
Comment thread webapp/packages/session-recording-log/src/model.ts Outdated
Comment thread webapp/packages/session-recording-log/src/parser.ts Outdated
Comment thread webapp/packages/session-recording-log/src/parser.ts Outdated
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • webapp/pnpm-lock.yaml: Generated file

Comment thread webapp/packages/session-recording-log/src/parser.ts Outdated
Comment thread webapp/packages/session-recording-log/src/parser.ts
Comment thread webapp/packages/session-recording-log/src/parser.ts Outdated
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • webapp/pnpm-lock.yaml: Generated file

Comment thread webapp/packages/session-recording-log/package.json
Comment thread webapp/packages/session-recording-log/README.md
Comment thread webapp/packages/session-recording-log/README.md Outdated
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • webapp/pnpm-lock.yaml: Generated file

Comment thread webapp/packages/session-recording-log/src/parser.ts Outdated
Comment thread webapp/packages/session-recording-log/src/parser.ts
Comment thread webapp/packages/session-recording-log/src/parser.ts Outdated
Comment thread webapp/packages/session-recording-log/package.json
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • webapp/pnpm-lock.yaml: Generated file

Comment thread webapp/packages/session-recording-log/src/parser.ts Outdated
Comment thread webapp/packages/session-recording-log/src/parser.ts Outdated
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • webapp/pnpm-lock.yaml: Generated file

Comment thread webapp/packages/session-recording-log/src/parser.ts
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • webapp/pnpm-lock.yaml: Generated file

@kristahouse
Krista House (kristahouse) merged commit c1d4e58 into master Jul 20, 2026
43 checks passed
@kristahouse
Krista House (kristahouse) deleted the kristahouse-dgw-405-recording-log-parser branch July 20, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants