docs(agents): session model spec — the source-of-truth contract - #2337
Conversation
Phase 0 of the Agent-Session Single Source of Truth epic. The session model existed only in PR prose (#2258's container model, #2336's resource-addressed re-model); this makes it a durable spec in docs/: the shipped model and invariants, the product-locked authorization axioms, the epic's target source-of-truth contract (marked phase by phase), the sessionId vocabulary decoder, and the update discipline pinning this doc + the forthcoming Phase 1 contract tests as the normative sources. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XnzUuAixdTJ8xDpP5S92Ts
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
📝 WalkthroughWalkthroughChangesAgent Sessions architecture
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/2.0-architecture/agent-sessions.md`:
- Line 13: Update the fenced diagram block in agent-sessions.md to specify the
text language by changing its opening fence to use text, while preserving the
existing ASCII diagram content and closing fence.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8e5ac248-b814-42c2-8845-2891c4537b8a
📒 Files selected for processing (1)
docs/2.0-architecture/agent-sessions.md
|
|
||
| ## 1. The model | ||
|
|
||
| ``` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Specify a language for the diagram fence.
Line [13] opens a fenced block without a language. Add text to satisfy markdownlint MD040 and identify the ASCII diagram format.
Proposed fix
-```
+```text📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ``` |
🧰 Tools
🪛 markdownlint-cli2 (0.23.2)
[warning] 13-13: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/2.0-architecture/agent-sessions.md` at line 13, Update the fenced
diagram block in agent-sessions.md to specify the text language by changing its
opening fence to use text, while preserving the existing ASCII diagram content
and closing fence.
Source: Linters/SAST tools
…te-path accuracy 1. §2 axiom 1 no longer enshrines today's refusal collapse as an axiom: the rule is anti-enumeration for un-owned resources (kept), and for the caller's own rows the single collapsed message is marked as today's state with Phase 1's typed, distinct refusals as the target. 2. §1 pane-grid bullet now states the verified write topology: the review suggested citing open_page_pane/spawn placement as second server-side blob writers, but verification shows they do not write workspaceState (open_page_pane is a pure client-side reaction via useOpenPagePane; spawn placement mints conversations only) — the sole writer is the client debounced PUT via saveSessionWorkspace. The bullet now names that, the server-placement invisibility, and the localStorage third copy as Phase 3's actual motivation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XnzUuAixdTJ8xDpP5S92Ts
Phase 0 of the Agent-Session Single Source of Truth epic. The agent-session model has so far lived only in PR prose (#2258's container model, #2336's resource-addressed re-model) and schema doc comments. This lands it as a durable spec:
docs/2.0-architecture/agent-sessions.md.What the doc pins
conversations.sessionIdwith a single guarded claim path; ON DELETE SET NULL history preservation; global assistant = nulldriveId, owner-only by construction; ended sessions revivable viaplanSessionReopen(); sandbox status derived, never stored. Every invariant verified against current code (packages/db/src/schema/agent-sessions.ts,conversations.ts,decide-session-access.ts,plan-session-lifecycle.ts,session-tools.ts), not against the PR prose alone.workspaceId/conversationId/ frozen wiresessionId/spriteExecId/ auth sessions = unrelated).session-tools.tsheader documented a guard feat(agents): fully resource-addressed session orchestration — permission-gated, any surface, any workspace (#2335) #2336 deleted for a full release) and pins the normative-source order: contract tests (forthcoming, epic Phase 1 task "Tool contract pin and typed refusals") + this doc; PRs touching session semantics must update both.Verification
origin/master— includingclaimConversation,deriveSandboxStatus,planSessionReopen,canUserViewPage/checkAccessForSubjectin the minting path, and the/api/agent-sessions/[sessionId]route tree.lint/knip:checkare no-ops for this change by configuration: knip projects glob*.{ts,tsx,js}only and turbo lint runs eslint over app sources; a newdocs/*.mdis outside both.🤖 Generated with Claude Code
https://claude.ai/code/session_01XnzUuAixdTJ8xDpP5S92Ts
Summary by CodeRabbit