Skip to content

feat(session): accept session refs for recorder provenance - #670

Merged
yyjeqhc merged 2 commits into
yyjeqhc:mainfrom
ITSGJY:feat/recorder-session-ref
Sep 25, 2026
Merged

yyjeqhc merged 2 commits into
yyjeqhc:mainfrom
ITSGJY:feat/recorder-session-ref

Conversation

@ITSGJY

@ITSGJY ITSGJY commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • allow explicit recording_session_id wrappers to reuse an already-issued principal-scoped session_ref such as ~s1
  • canonicalize recorder selectors to the exact wc_sess_* identity before existing recorder authorization, provenance, audit, and ledger handling
  • keep business session_id and recorder provenance as independently authorized semantic roles while reusing the same durable Session-reference resolver
  • apply the same selector behavior across ordinary Runtime dispatch and MCP Plugin/SSH specialized paths without introducing ambient or sticky recorder state

Behavior

session_ref remains a principal-scoped selector for one exact Workflow Session incarnation. When supplied as recording_session_id, Runtime resolves it to the pinned canonical Session before the existing recorder authorization path runs. Durable audit, provenance, correlation, and Session ledger state therefore continue to use wc_sess_* identities.

Recorder provenance does not provide business Session, Project, execution, or guard authority. Business session_id and recording_session_id may explicitly target different Sessions and continue through their independent authorization paths.

Closed Sessions preserve the existing recorder-provenance behavior. Missing, deleted, malformed, stale, and foreign-principal references fail closed. Omitting recording_session_id does not infer or retain a recorder from Window, credential, Project, transport, or recent-call state.

MCP Plugin and SSH specialized gateways use the same canonical Session-reference resolver. SSH fallback result projection preserves equivalent Project context for valid short and canonical recorder selectors while keeping existing business-error precedence. App-only tools that do not admit generic recorder metadata keep their existing discard behavior. Code Mode server-owned recorder context is unchanged.

Model-facing startup guidance now prefers the returned session_ref for recorder provenance while retaining canonical wc_sess_* compatibility.

Validation

  • cargo check --locked -p webcodex
  • cargo test --locked -p webcodex-tool-contracts --lib — 234 passed
  • recorder-related Runtime coverage — 24 passed
  • MCP tools/list contract coverage — 13 passed
  • focused coverage passed for ordinary MCP, Plugin, SSH, closed Session provenance, foreign/deleted/malformed refs, business/recorder separation, App-only wrapper discard, compact schema bounds, and size budgets
  • python3 scripts/check_markdown_links.py — 651 local links, 0 missing
  • independent read-only agy review: no blocker; abstraction ownership, authorization boundaries, and specialized-path parity judged clean
  • deterministic committed-range review: complete 15-file coverage, no warnings or truncation
  • full fork GitHub Actions passed on commit 4485fda12f9fb89cfe45b005f5dbf98d0a1e5060, including server, workspace crates, runner, tooling, contract, MCP conformance, Docker, Windows, macOS, and native aggregate lanes

Closes #574.

Copilot AI lite review requested due to automatic review settings September 25, 2026 04:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@yyjeqhc
yyjeqhc merged commit 5bc4a83 into yyjeqhc:main Sep 25, 2026
18 checks passed
@ITSGJY
ITSGJY deleted the feat/recorder-session-ref branch September 27, 2026 10:06
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.

Reduce direct-mode recording_session_id repetition with an explicit non-sticky recorder context

3 participants