Skip to content

feat(session): add durable model-facing session refs - #666

Merged
yyjeqhc merged 1 commit into
yyjeqhc:mainfrom
ITSGJY:feat/session-ref
Sep 25, 2026
Merged

yyjeqhc merged 1 commit into
yyjeqhc:mainfrom
ITSGJY:feat/session-ref

Conversation

@ITSGJY

@ITSGJY ITSGJY commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add typed model-facing references and durable principal-scoped session_ref selectors such as ~s1 for exact Workflow Session incarnations
  • issue Session refs from work_on_project, Session bootstrap/summary, authorized resume discovery, and explicit handoff surfaces
  • resolve session_ref back to the canonical wc_sess_* identity before the existing collaboration, authorization, lifecycle, guard, audit, and dispatch paths
  • keep canonical Session IDs authoritative for persistence, diagnostics, APIs, and internal joins, while preserving existing Project ref behavior

Behavior

A session_ref is a durable model-facing selector for one exact Workflow Session incarnation. References are scoped to the authenticated principal and carry no additional authority.

Dereferencing first recovers the pinned canonical Session, then reuses the existing Session and Project authorization path. Cross-principal reuse fails closed, and a reference whose pinned Session no longer exists or can no longer be proven does not recycle or retarget to another Session.

Existing canonical wc_sess_* selectors continue to work. Closed Sessions retain the same lifecycle semantics as canonical Session IDs: reference resolution identifies the Session, while the existing lifecycle and per-tool checks remain authoritative for what operations are allowed.

Bootstrap, discovery, and handoff projections can expose both the canonical Session identity and session_ref where continued model interaction benefits from the shorter selector. Ordinary hot-path results remain compact. Recorder provenance remains an explicit canonical Session context.

The model-reference storage layer reuses the established Project reference contract for Project refs and adds a dedicated durable Session-reference namespace, keeping existing Project reference storage, allocation, validation, and resolution semantics unchanged.

Validation

  • cargo fmt --all -- --check
  • cargo check --locked -p webcodex-core -p webcodex-store -p webcodex-tool-contracts
  • cargo check --locked -p webcodex
  • cargo test --locked -p webcodex-tool-contracts --lib — 234 passed
  • focused model-reference/store, Session-ref, schema, handoff, and workflow-resume discovery coverage passed
  • OpenAPI, MCP tools/list, tool-surface, and provider-discovery contract suites passed
  • git diff --check
  • full GitHub Actions validation passed: Linux server/Runner/workspace/tooling lanes, contract checks, MCP conformance, native aggregate checks, and applicable Windows/macOS validation

Implements the Workflow Session slice of #571.

Copilot AI lite review requested due to automatic review settings September 24, 2026 22:27

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.

@ITSGJY
ITSGJY requested a lite review from Copilot September 24, 2026 22:29

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 7a4981a into yyjeqhc:main Sep 25, 2026
18 checks passed
@ITSGJY
ITSGJY deleted the feat/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.

3 participants