Repository navigation
Expose attach-negotiated daemon session capability proof #17
Description
Purpose
Expose a public, generation-scoped proof of attach-negotiated daemon client capabilities. This is required before Comet can use correlated_prompt_lifecycle_v1, and it should repair Pylon's current server-offer shortcut at the same shared SDK seam.
Coordination:
- Prime fork umbrella: Track Pylon fork parity and upstream overlap #1
- Pylon consumer umbrella: Prime provider parity: tasks, automation, and upstream watch pylon#114
- Comet consumer umbrella: Prime Agent integration: coordinate Comet, Pylon, and fork contracts rynfar/comet#1
- Comet session owner merged from feat(harness): own bounded native Prime sessions rynfar/comet#6
Current gap at 7238ac8cff25962ada9ffe4530b7d4d1cddc1b47
DaemonClient.supportsServerCapability("correlated_prompt_lifecycle_v1")proves only thedaemon_hellooffer.DaemonAgentConnection.attach()conditionally advertises the matching client capability.DaemonAttachResult.client.capabilitiescontains the daemon-established attach-side set, but the public connection does not expose it.DaemonAgentConnection.supportsCorrelatedPromptLifecycle()currently delegates to the server offer.- Pylon computes
correlatedPromptLifecycleAvailablefrom the same offer before attach.
A server offer is not a negotiated intersection. Method presence, package version, ignored options, or a successful attach without validating its returned client capability are not substitutes.
Proposed contract
- Add frozen public-root
PRIME_AGENT_SDK_FEATUREStokennegotiated_daemon_session_capabilities_v1. - Add public
DaemonAgentConnection.supportsNegotiatedCapability(capability: DaemonClientCapability): boolean. - Return
trueonly after the current attached generation has:- the matching validated server offer;
- the capability in the exact attach/reattach request; and
- the same capability in the validated
DaemonAttachResult.client.capabilitiesfor this connection/client/generation.
- Return
falsebefore attach, during invalidation/replacement, after dispose, and after any failed or ambiguous reattach until the new generation is proved. - Reject malformed, duplicate-conflicting, unsupported, wrong-client, or wrong-generation attach capability data rather than treating it as proof.
- Keep
supportsCorrelatedPromptLifecycle()as server-offer evidence because the SDK currently uses it before attach to construct the advertised capability list. Document that it is not a negotiated proof; consumers must use the new accessor after attach. Do not make the pre-attach method false or negotiation would never start. - Commit the negotiated set only after attach identity and snapshot validation succeeds, not merely when the raw attach response arrives.
- Return a boolean only. Do not expose client IDs, session IDs, paths, raw attach results, or mutable capability collections.
The exact public name is proposed for review. If a different generic accessor is chosen, it must preserve these semantics and the frozen feature token.
Compatibility
- Protocol v7 foundation behavior stays compatible.
- Stock Prime and older fork artifacts omit the new SDK token/accessor and remain detectable before prompt construction.
- Existing attach capability lists and server offers do not become mandatory globally.
- Pylon must enable correlated lifecycle only from the post-attach proof. Its ordinary-prompt fallback may remain Pylon-local.
- Comet will fail its prompt feature gate and cleanly close the fresh owned session when proof is unavailable. It will not fall back to an uncorrelated prompt.
Deterministic tests
- token exported and public root frozen;
- offer without attach request/response proof => false;
- method/options presence without token => incompatible consumer gate;
- attach request plus missing/invalid/wrong-client response capability => fail/false;
- exact offer + advertised + echoed capability after successful attach => true;
- attach failure/cancellation, dispose, replacement, reattach failure, and stale old-generation result => false;
- reattach can re-establish proof only for the new exact generation;
- concurrent event-before-attach-response cannot use correlated behavior early;
- stock/current compatibility matrix;
- no native client/session identity appears in public errors or logs.
Upstream overlap decision
Current upstream/main@a903d4b6768f484bd6d459b7b0aa7dee38e461e2 has no correlated prompt lifecycle or negotiated-capability accessor. Decision: retain this small fork-boundary proof and record the evidence in .pylon/features.yaml and .pylon/upstream-review.md.
Merge bar
Update the fork ownership ledgers, run exact stock/current compatibility tests, build a reproducibly hashed artifact, and review the Prime/Pylon/Comet consumer assumptions together. No consumer may infer this proof from versions, method presence, server offers, or attach success alone.
Activity
rynfar commentedon Aug 30, 2026
Consumer issues are now explicit:
Merge order is Prime #17 API/artifact, Pylon PrimeIntellect-ai#190 compatibility update, then Comet #7. The existing
supportsCorrelatedPromptLifecycle()must remain offer evidence for pre-attach request construction; only the new accessor is the post-attach proof.rynfar commentedon Aug 30, 2026
Claimed for implementation.
feat/negotiated-session-capabilities/Users/rynfar/.prime/worktrees/prime-negotiated-session-capabilitiesorigin/pylon@7238ac8cff25962ada9ffe4530b7d4d1cddc1b47Declared owned files before edits:
packages/coding-agent/src/modes/agent-connection/daemon-agent-connection.tspackages/coding-agent/src/modes/agent-connection/types.tsonly if the public interface needs the accessorpackages/coding-agent/src/sdk-features.tsand public export tests.pylon/features.yaml.pylon/upstream-review.mdNo Pylon or Comet consumer code is owned by this branch. I will not push or open a PR until exact-head tests and independent P0/P1 reviews approve.
rynfar commentedon Aug 30, 2026
Pre-commit security review found that the proof also needs a transport-generation and shared-client invalidation seam. I am expanding the declared owned area before edits to include:
packages/coding-agent/src/modes/daemon/daemon-client.tsReason:
resetTransportForReconnect()can replace the physical socket without notifying connection close listeners, and multiple logicalDaemonAgentConnections may share oneDaemonClient. The proof must bind to the physical transport generation and fail closed when another same-session logical attachment mutates or detaches the shared server state. This remains within Prime #17; no wire capability or consumer code is added.rynfar commentedon Aug 30, 2026
Ownership update after exact-head review findings.
The repair remains isolated on
feat/negotiated-session-capabilities//Users/rynfar/.prime/worktrees/prime-negotiated-session-capabilities. The exact owned candidate scope is now:.pylon/features.yaml.pylon/upstream-review.mdpackages/coding-agent/.changes/negotiated-daemon-capability-proof.mdpackages/coding-agent/docs/agent-connection.mdpackages/coding-agent/docs/sdk.mdpackages/coding-agent/src/modes/agent-connection/daemon-agent-connection.tspackages/coding-agent/src/modes/daemon/daemon-client.tspackages/coding-agent/src/sdk-features.tspackages/coding-agent/test/agent-connection-daemon.test.tspackages/coding-agent/test/daemon-client.test.tsThe first committed candidate
7c68a7ab4is retired after exact review withheld approval. The active repair adds synchronous pending invalidation, permanent fail-closed admission, attach-proof fencing for correlated runtime frames, negotiated rather than offered resync shaping, docs, and the required changelog fragment. No Pylon or Comet consumer code is owned here. I will freeze a new commit only after renewed local validation, then require new exact-head P0/P1 approvals before push/PR.rynfar commentedon Aug 30, 2026
New frozen local candidate after the first exact-head review repairs:
a0233b09cb18d6b0ec53e0f1514144f0564e2223779b5fabe8e0e637c485ee2e6db86d881df2df2b7238ac8cff25962ada9ffe4530b7d4d1cddc1b47b3e6d4716efcfea6897edfdb24179675955e0e578dfd248e94fdf72454233943c84858519b6c8cf9715feb180babadde7f9fc709a3929a6a2e3a9905a812f3c3Renewed validation at this exact head:
npm run check: passedgit diff --check: passedThis candidate adds the review-requested same-stack invalidation, permanent fail-closed admission/proof fence, bounded correlated runtime-frame hold/release/discard behavior, committed-echo resync shaping, shared-client retained-shaping invalidation, SDK docs, and changelog fragment. Three independent exact-head reviews are in progress. The branch remains unpushed and no PR will open until every P0/P1 gate approves.
rynfar commentedon Aug 30, 2026
Third frozen exact candidate (local; not pushed)
The two blockers on retired
a0233b09are repaired in a new clean candidate:6a4e19f974390e2051010461bd28a609420ffdf39a4138f13a4164f0c164bfa31bfd6835677497047238ac8cff25962ada9ffe4530b7d4d1cddc1b47e914158d80a2fca5d2d8ad99d900bd6c26740a3272f9476a6b2089daff4beb4fa3c33f9f631b14f6d747b891499f15e2207a6cda6867227a09262357d6c560212c1cf52037ac2995e7faf108397548b2f32f98a61800af6485c3d70ef9ec65b27c68a7ab4anda0233b09remain retired and withheld.Repairs
DaemonClient.close()is terminal owner disposal: laterconnect()rejects and a live connection emits one fixed close instead of invoking recovery.Exact-tree validation
git diff --check: passed;c5dffcd16a401551986023134fbc05457775e1eeed618a5a6ae0d0cee1772d5f);[bounded_daemon_ingress_v1, negotiated_daemon_session_capabilities_v1]plus accessor;Fresh exact-head API, security/resource, and test/repro reviews are running. I will not push or open a PR unless all P0/P1 gates approve this exact head without modification.
rynfar commentedon Aug 30, 2026
Candidate
6a4e19f97retiredExact-head test review found a same-connection replacement race before approval:
session_replacedhandler waits ingetPromptLifecyclesFor();The second-connection stale-shaping test did not cover this same-connection proof/route divergence.
6a4e19f97is withheld and will not be pushed. The next candidate will discard the entire old handler when its exact same-connection attachment admission, epoch, transport, or route identity changes, while still allowing a peer-only shared-client capability overwrite to commit unshaped A state. A deterministic gated A-query → committed B-reattach test will prove the route and proof stay aligned.rynfar commentedon Aug 30, 2026
Fourth frozen exact candidate (local; not pushed)
The accepted blockers on retired
6a4e19f97are repaired in a new clean candidate:192d9be71eb04375f181bad53ab8f746ca9053a7916c18de386830f11b635cb1d08644b853f2a5b17238ac8cff25962ada9ffe4530b7d4d1cddc1b470a3ca5e16bb4d52e29a5a8dd0e7c7b99632f0207bc93efab34a400e8b15bdbe346ddfe0a0bf0efc7dac558e5cfd281f8374ede84af23529d22ecacd073fe0682436f520eb728a2c612c5c18138b886d97a94ac61631645f7510c84b1f7dddc0fAll three earlier candidates remain retired and withheld.
Additional repairs
DaemonClient.close()transition now notifies listeners even when a prior natural transport loss already removed the socket. Repeated close stays idempotent and later connect stays rejected.Exact-tree validation
git diff --check: passed;Fresh API, security/resource, and test/repro review is running against this exact head. It remains local and unpushed pending unanimous P0/P1 approval.
rynfar commentedon Aug 30, 2026
Candidate
192d9be71retiredAPI and test review independently confirmed a chunked-replacement fence P1:
session_replaced { snapshotFollows: true }but no snapshot begin/chunks.pendingChunkedReplacementstill owns the dispatch fence.session_closed.192d9be71is WITHHELD and will not be pushed. The repair will synchronously retire/discard the old header and queued frames on attachment admission and physical transport loss, before any new proof can publish. Deterministic header-only A → B reattach and A → socket recovery tests will require B runtime events and close invalidation to flow immediately.rynfar commentedon Aug 30, 2026
Fifth frozen exact candidate (local; not pushed)
The stale chunked-replacement blocker on retired
192d9be71is repaired:63c946d3064b2b262bb0ed727da9d5b363cf3daff4ff15eb6067dd62a6b3670ceb28705c0bb1ae817238ac8cff25962ada9ffe4530b7d4d1cddc1b472992dc6707698732f6d176819193234b02176f5efbbdf8e39dd74d5da0836482e6d0d95ecda43945591907940bf5df7af3da98b48b0aed34436382f30a1d02e406e713064fd17211583cb690f3971a2563fedbb73d89824947a43fe20925ff35All four earlier candidates remain retired and withheld.
Additional repair
session_closedalso retire the old fence.New deterministic coverage
session_closedimmediately invalidates B proof;Exact-tree validation
Fresh exact-head API, security/resource, and test/repro review is running. The candidate remains local and unpushed pending unanimous P0/P1 approval.
rynfar commentedon Aug 30, 2026
Candidate
63c946d30retiredAPI review found one remaining delayed-transfer P1. The retirement mode ignored a delayed old
session_snapshot_begin, but a pre-beginsession_snapshot_failed { purpose: "replacement" }with a fresh ID could still create an assembly and start internal A snapshot recovery. That internal A attach becomes a newer admission and can supersede the already-admitted gated B reattach.63c946d30is WITHHELD and will not be pushed. The next candidate will:rynfar commentedon Aug 30, 2026
Sixth frozen exact candidate (local; not pushed)
The delayed failure-before-begin blocker on retired
63c946d30is repaired:a62f1dd01b363531f7a2768f702901b911fd62283ddcef77d306bf934a84e9638f699d06249ef7a47238ac8cff25962ada9ffe4530b7d4d1cddc1b47223f60510341d174397bb7b087525367211be8e77732a6458f040d3583f6e5af510c09dd74204023c74e0a210f7d760f2adffdab9a57f713c51ebc732a8dd864bd6b5dab53d84ff3e2beeb04ee64389079374b61d21c032d545135943fbafba0All five earlier candidates remain retired and withheld.
Additional repair
session_snapshot_failedis ignored unless it belongs to the exact current requesting/receiving attach attempt.Exact-tree validation
One inherited nonblocker remains explicit: aggregate runtime snapshot-attempt IDs and attach assembly/chunk storage retain the pre-existing snapshot-transfer behavior. Consumers still block arbitrary saved-session attach pending a cumulative snapshot budget; this candidate adds no broader saved-session acceptance.
Fresh exact-head API, security/resource, and test/repro review is running. The candidate remains local and unpushed pending unanimous P0/P1 approval.
rynfar commentedon Aug 30, 2026
Candidate
a62f1dd01retiredThe final exact-head reviewer found the general form of the delayed failure race. Even without a retired chunked-replacement header, a gated same-connection B admission leaves route identity temporarily at A. A fresh explicit-purpose A
session_snapshot_failedwith no current A request attempt could start runtime A recovery, create a newer admission, and supersede B.a62f1dd01is WITHHELD and will not be pushed. The next candidate will add one synchronous latest-admission-in-flight fence for every attach/reattach. While it is active, unsolicited snapshot begin/failure frames are ignored unless bound to the exact current requesting/receiving attempt. Coverage will include no-header Aresyncfailure during gated B admission, in addition to the retired-header cases.rynfar commentedon Aug 30, 2026
Seventh frozen exact candidate (local; not pushed)
All six earlier candidates are retired. A new clean candidate incorporates the general same-connection admission fence plus replay, terminal/update tail, bounded tombstone, and socket-first close-order repairs:
d6ca9b1a314e0ae362b4067d64ed5dfad420dea7f629b3d9d1672ca0ee9ed86ec6d7e9ebf8b60ae77238ac8cff25962ada9ffe4530b7d4d1cddc1b47b09a94e7c90d1c3455a11d824c410d9872adab87e248b8300ed4f5cde707b8a06718413661fd2817a728d70c0edb07ab11ead2fbe7ef803d0204ce5f9cfcb87d3c998cc3372c70acf3e1277b277624078f59d50ed91712a54047fe578a6ccd3fAdditional closed races
Validation
npm run check, commit hook, YAML, and cumulative diff check: passed;The inherited aggregate snapshot-attempt ID/assembly/chunk storage caveat remains separately recorded. This candidate neither expands arbitrary saved-session attach nor removes the consumer-side cumulative-budget block.
Fresh exact-head API, security/resource, and test/reproduction reviews are running. The branch remains local and unpushed pending unanimous P0/P1 approval.
rynfar commentedon Aug 30, 2026
Candidate
d6ca9b1a3retiredThe exact test reviewer found a message-first close-order gap at the full tombstone budget.
dispatchDaemonMessage()retired a matching pending chunked replacement beforehandleDaemonMessage()marked terminal/update ownership. The retirement's new ID therefore triggered generic permanent fail-close at capacity, and the same message then emitted the authoritative close, producing two terminal events.d6ca9b1a3is WITHHELD and will not be pushed. The next candidate will classify a matchingsession_closedsynchronously before pending-fence retirement and will add full-budget message-first killed, shutdown, and update coverage with exactly one authoritative lifecycle outcome.rynfar commentedon Aug 30, 2026
Eighth frozen exact candidate (local; not pushed)
All seven earlier candidates are retired. The new clean head closes the full-budget message-first pending-fence ordering, duplicate lifecycle ownership, and direct post-close publication gaps:
c27e1b6ea329aabe19ec70f768bcbf37c79a6bef45af0b9ce0199c3be5bffdde9c787eec06f82dd87238ac8cff25962ada9ffe4530b7d4d1cddc1b47f90ba348f023e64394526f4b72856201c842630c19a3073d12889a007628ed89120f4d048a0cfbc56b5ac2ddfd676b5425723966fec8fb5b50cd624de16f946a9980023b70a6d70bf146bd077dcbe97209819a20443df05f0f032de1015b14baAdditional repair
session_closeduses a short retirement-only bracket before a pending chunk fence can touch the full tombstone budget.session_replacedandsession_resyncedframes use the complete lifecycle fence after exact target-invalidation checks. They cannot publish after terminal close, during update recovery, during disposal, or from old A while inline/streamed B admission is pending.Validation
npm run check, commit hook, YAML, and cumulative diff check: passed;The inherited aggregate snapshot-attempt ID/assembly/chunk storage caveat remains separately recorded. Arbitrary saved-session attach remains consumer-blocked pending its cumulative snapshot budget.
Fresh exact-head API, security/resource, and test/reproduction reviews are running. This head remains local and unpushed pending unanimous P0/P1 approval.
rynfar commentedon Aug 30, 2026
Exact-head review gate passed: ready for hosted CI
The unchanged eighth candidate has unanimous independent approval:
c27e1b6ea329aabe19ec70f768bcbf37c79a6bef45af0b9ce0199c3be5bffdde9c787eec06f82dd8f90ba348f023e64394526f4b72856201c842630c19a3073d12889a007628ed89120f4d048a0cfbc56b5ac2ddfd676b5425723966fec8fb5b50cd624de16f946a9980023b70a6d70bf146bd077dcbe97209819a20443df05f0f032de1015b14baFormal results:
The worktree is clean and the exact identities were rechecked immediately before push. All seven earlier candidates remain retired. The branch may now be pushed and a PR opened for trusted hosted CI. Merge remains gated on green exact-SHA CI and unchanged review scope.
rynfar commentedon Aug 30, 2026
Candidate
c27e1b6ea3retired after hosted CIPR #18's trusted exact-SHA run
33310987448passed build/check, agent-core, AI, TUI, kernel, runtime Python, coding-agent shards 2/3 and 3/3, and process smoke. Shard 1/3 failed two ENG-4656 tests because its castResumeDaemonClientfixture did not implement the newly required concretegetTransportGeneration()method. After that first error, local reproduction also showed that the same fake returned a stale fixed client ID/capability list rather than the exact attach request echo now required by the negotiated-proof contract.This is a deterministic test-fixture gap, not a production failure, but the exact reviewed head is retired and will not merge.
The dirty test-only repair:
clientIdandcapabilities;Local validation now passes ENG-4656 3/3, focused proof suites 219/219, and complete shard 1/3 1,466/1,466, plus
npm run checkand diff check. The dirty combined patch SHA-256 is019a3fe952660303e1e69449d0a5c9479b521f5ecb993093576ce65c69bafb69. Independent pre-freeze review is running before a replacement commit is created.rynfar commentedon Aug 30, 2026
Ninth frozen exact candidate (local replacement after hosted fixture failure)
Candidate
c27e1b6ea3is retired. The replacement changes only the incomplete ENG-4656 cast fake and governance evidence; production source bytes are identical to the previously approved candidate.d3323e38d7f3d93416819c7f509c67540c14dbcca07b06e3882d51ede94c4335ac5c6ae81a08b6457238ac8cff25962ada9ffe4530b7d4d1cddc1b47124ee0fefcdd85c42cf557ab12f5c3cf25573a079d5af411b5f753a5095a4e90019a3fe952660303e1e69449d0a5c9479b521f5ecb993093576ce65c69bafb699b574b0e4dd9f4bffd84194257d6a8eca6615380670f82b3407e26eb938257fbd59b9f4e265398cccfb25835e29628b40208dfd273b159b8146f654e2174aa10(byte-identical to retired candidatec27e1b6ea3)The fixture now supplies one stable generation for its single non-reconnecting fake transport and returns the exact attach/reattach request's client ID and capabilities. It does not add a production fallback or claim an optional server capability.
Renewed validation:
npm run check, commit hook, cumulative diff check, YAML parse: passed;33310987448.Two independent pre-freeze reviews approved the exact repair bytes with no P0/P1/P2. Fresh exact-head API, security/resource, and test/reproduction reviews are running. The replacement remains local and unpushed until all three approve.
rynfar commentedon Aug 30, 2026
Replacement exact-head review gate passed
The clean hosted-CI repair candidate has unanimous exact-head approval:
d3323e38d7f3d93416819c7f509c67540c14dbcca07b06e3882d51ede94c4335ac5c6ae81a08b645124ee0fefcdd85c42cf557ab12f5c3cf25573a079d5af411b5f753a5095a4e90019a3fe952660303e1e69449d0a5c9479b521f5ecb993093576ce65c69bafb699b574b0e4dd9f4bffd84194257d6a8eca6615380670f82b3407e26eb938257fbAPI/contract, security/resource, and exact test/reproduction reviews all APPROVE with no P0/P1; the exact test review also found no P2. Production source bytes remain identical to the previously approved candidate. The branch may be updated for a new trusted hosted run; merge remains gated on every required check passing the new exact SHA.
rynfar commentedon Aug 30, 2026
Merged artifact approved for downstream consumers
Prime #17 merged as
91e13b6798343995291ccca6f523fba81ff96cd6with treea07b06e3882d51ede94c4335ac5c6ae81a08b645, exactly matching the reviewed candidate tree.Reproducible public artifact:
prime-agent-0.8.1.tgzc46497e2870618bb2caa9d59d161fc5abfad27472eec7deff39cfb1380ebe70c9846977bytesd19206b34b87e001ba5964fecd48e154d78c5d5032901faad0f92dd3fff432b8Both independent artifact reviewers approved with no P0/P1/P2. Two additional repacks reproduced all four package hashes exactly. The isolated install matches the public archive 1,436/1,436 files and exports the frozen
negotiated_daemon_session_capabilities_v1token,supportsNegotiatedCapability, andgetTransportGeneration.This artifact is the pinned input for pylon-code/pylon#190. It supersedes the earlier
d6065af7...artifact, which remains suitable only for the pre-proof Comet session-owner milestone.rynfar commentedon Aug 30, 2026
Downstream Pylon consumer PR is open: pylon-code/pylon#191
It consumes the merged post-attach proof API from Prime #18 and is frozen at exact reviewed head
f34744ac774b0570c0608ccc8def509d3ae88ece. Hosted exact-SHA CI is running.rynfar commentedon Aug 30, 2026
Downstream proof consumer pylon-code/pylon#191 merged as
879d3692bfbabefe6aae26417100f035bf759ef1after all exact-SHA hosted checks passed.