Sitelet https://github.com/microsoft/TypeAgent/pull/3134
Skip to content

Normalize GHCP CLI session events and restore cumulative metadata - #3134

Open
George Ng (GeorgeNgMsft) wants to merge 2 commits into
georgengmsft-watcher-capture-and-resumefrom
georgengmsft-watcher-normalization-and-metadata
Open

George Ng (GeorgeNgMsft) wants to merge 2 commits into
georgengmsft-watcher-capture-and-resumefrom
georgengmsft-watcher-normalization-and-metadata

Conversation

@GeorgeNgMsft

Copy link
Copy Markdown
Contributor

Implements GHCP CLI event normalization and cumulative metadata for the Git Story Session Watcher on top of capture PR #3133. Capture envelopes, durable event IDs, and read-progress semantics remain unchanged; watcher lifecycle, privacy filtering, delivery, and story construction remain separate work.

  • Normalize messages, tool starts/completions, and supported session events while preserving native/generated IDs, agent roles, tool-call associations, source timestamps/models, detailed output, and reported diff evidence.
  • Return source-only diagnostics for unsupported or malformed records without blocking other usable events; explicitly ignore transient progress/delta records.
  • Accumulate registration-seeded client/model/parent/timestamp metadata in explicit generation-bound state, with no constructor or privacy-method changes.
  • Restore metadata by replaying an already-captured fixed boundary. Verify the prefix identity/digest during counting and the generation during replay, preserve durable IDs, exclude concurrent appends beyond the boundary, and isolate source resets without adding a metadata checkpoint.
  • Document API contracts, record dispositions, privacy requirements, and recovery usage; add synthetic fixtures covering normal shapes, missing fields, malformed records, cross-batch correlation, crash recovery, and source mutation races.

Validation: dependency-aware fluid-build git-story -t build --dep, all 149 Git Story tests (npm run jest-esm -- --runInBand), pinned changed-file Prettier, and all four repository PR gates (lint, complexity, circular dependencies, and test debt) passed against origin/georgengmsft-watcher-capture-and-resume at 4426393fe39d72cdd211e5daaf32d4c850150df5.

Integration: normalizeEvents now returns NormalizedSessionBatch; collectMetadata(request, batch, previousState?) returns SessionMetadataState. Use state.metadata in the outgoing update and surface diagnostics. restoreMetadata(request, throughCheckpoint, generation, options?) restores metadata only, not downstream delivery. Optional normalized agentId, detailedContent, and error fields must pass through the privacy boundary along with existing content. No native VS Code adapter or daemon/hook wiring is included.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant