feat: add internal Session CLI collaboration - #198
Conversation
…-cli # Conflicts: # packages/server/drizzle/meta/0019_snapshot.json # packages/server/drizzle/meta/_journal.json # packages/server/src/__tests__/integration/auth-migrations.test.ts # packages/server/src/runtime/runtime-domain-owner.ts # packages/shared/src/__tests__/runtime-protocol.test.ts # packages/shared/src/runtime-domain.ts
yuezengwu
left a comment
There was a problem hiding this comment.
Reviewed exact head d5820ca5232288c6e42dbd5738f308f6db36a589.
Blocking: the source Runtime binding is validated only at HTTP authentication / initial message recording, not at either final Runtime dispatch admission. SessionCliProofService.authenticate checks the source workspace placement generation and connection instance, but AuthorizedSessionMessageRoute retains only sourceSessionId. After runtime assembly or reconcile waits, withCollaborationDispatchAdmission rechecks that the source Session is unended while it validates only the target placement generation. Therefore a source placement move/generation advance or source connection replacement committed in that window does not fence the subsequent reconcile or SessionMessage frame.
That contradicts the collaboration proof contract (placement/connection changes invalidate the binding) and the shared runtime model that placement generations and current connection instances fence stale execution. Please carry the source workspace/generation/connection authority through the route and revalidate it at both ready and delivery admission boundaries. Add integration races for a source placement move and source connection replacement between initial authorization and each dispatch.
Current status also requires a fresh head before approval: this head is CONFLICTING/DIRTY against current main (971b7c3db073f9028c3f14f7ab50b74f1c228ca6), and GitHub CI is red from the IM-binding integration test. I could not reproduce that test failure locally: pnpm check, pnpm build, pnpm typecheck, pnpm test, agent-runtime coverage (100%), and the full 176-test server integration suite all passed.
…-cli # Conflicts: # packages/server/drizzle/meta/0020_snapshot.json # packages/server/drizzle/meta/_journal.json # packages/server/src/__tests__/integration/auth-migrations.test.ts
|
Addressed the exact-head blocker and merged current
Local validation on head |
yuezengwu
left a comment
There was a problem hiding this comment.
Reviewed exact head 4ca122feb49c656016661bf565c09c5a1ea84369.
The previous source-authority blocker is resolved: the authorized route now retains source workspace, placement generation, and connection instance, and both ready reconcile and SessionMessage delivery independently re-lock and revalidate source and target authority at the dispatch boundary. The four PostgreSQL race regressions cover source placement movement and connection replacement both before ready and between ready/message frames, and their frame assertions would fail without the new fences.
I also verified the merge resolution preserves current main migration 0020_large_jack_power and restacks collaboration storage as 0021_odd_liz_osborn; the journal, snapshots, schema, and migration tests agree. git diff --check is clean and all 6 exact-head CI checks pass.
Fresh local validation passed: pnpm check, pnpm build, pnpm typecheck, full pnpm test, Client Agent Runtime coverage (20 files / 288 tests, 100% statements, branches, functions, and lines), and Server integration (11 files / 194 tests).
…-cli # Conflicts: # packages/server/drizzle/meta/0021_snapshot.json # packages/server/drizzle/meta/_journal.json
Summary
opentag session create,send, and boundedlistcommandsBreaking behavior
create_internal_sessionandsend_session_messagehosted tools and the source collaboration protocol frames; clients and servers must negotiateruntime.sessionCollaborationv2endcommand; existing administrative lifecycle invalidation andsessions.ended_atstorage remainOPENTAG_SESSION_PROOF_FILE; there is no user-token or caller-identity fallbackValidation
pnpm checkpnpm buildpnpm typecheckpnpm test(all 7 tasks; Server 271, Client 472, CLI 126, and Web 325 tests)pnpm --filter @opentag/client test:agent-runtime:coverage(20 files, 288 tests; 100% statements, branches, functions, and lines)pnpm --filter @opentag/server test:integration(11 files, 194 tests)Non-goals