CL-7274: document run-key-history's exclusive-allocation gap - #523
Merged
Merged
Conversation
… gap Traced every write to workflow_run.public_key (CL-7274). Vendor's own updateAnchorPublicKeyUnderAllocationLock (session-service.ts) stamps the key unconditionally for every exclusive-allocation deploy ack, with no allocated guard of its own -- but both hub-session-orchestrator.ts's listener and this package's listener explicitly skip that same ack because it carries `allocated`. The skip mirrors vendor's event-driven mirror, not vendor's actual write, so run-key-history never records a key for any exclusive-allocation-deployed run: not the first deploy, and not any post-replacement redeploy.
TheGreatAxios
force-pushed
the
cl-7274-run-key-history-gap
branch
from
August 31, 2026 03:12
ac18f8e to
97b1b3b
Compare
TheGreatAxios
marked this pull request as ready for review
August 31, 2026 03:12
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Investigation lane for CL-7274. Traced every write to
workflow_run.public_keyacrossvendor/intxand checked each against whetherpackages/run-key-history/src/listener.tsobserves a correspondingagent.deploy.ack.Confirmed live correctness gap, not just a boundary concern: every exclusive-allocation deploy rotates
workflow_run.public_keythrough a pathrun-key-historynever sees.vendor/intx/hub-sessions/src/ws/sidecar-handler.ts:3070-3094(handleDeployAck) stampsallocated: {...}onto everyagent.deploy.ackfor a connection whose identity is"allocated".vendor/intx/hub-sessions/src/session-service.ts:1812-1872(updateAnchorPublicKeyUnderAllocationLock) reads that ack'spublicKeyand writes it ontoworkflow_rununconditionally — it has noallocatedguard of its own.hub-session-orchestrator.ts:101andrun-key-history's ownlistener.ts:49skip recording that same ack because it carriesallocated— a guard whose own doc comment assumes vendor "skips its own workflow_run update for the same ack," which is not what the code does: vendor writes it through a separate, non-event-gated path.apps/hub/src/index.tsruns both listeners off the samesidecarRouter.eventsemitter, and its 1s allocation-reconciliation loop drivesworkflow-allocation-service.ts:387'sdeployReadyAllocation→deployPreparedCodeSourcedWorkflowfor every exclusive-allocation deploy and every post-failure allocation replacement (sidecar-allocation-store.ts:620-631'sbeginReplacementnulls the key first, then this re-stamps it).Net effect: run-key-history never records a key for any exclusive-allocation-deployed workflow run — not the first deploy, not any later rotation. This is the dedicated-capacity/"run this workbench on its own sidecar" product path, not dead vendor code.
Other rotation paths checked and found sound (observed correctly):
deployCodeSourcedWorkflow(shared capacity,session-service.ts:1030)deployAdoptedCodeSourcedWorkflow(shared capacity, used by folded runs,session-service.ts:1088)Changes
packages/run-key-history/test/listener.test.ts: added atest.failingthat models vendor's independent write toworkflow_run.public_keyalongside the listener, and asserts the listener should have recorded it. It fails today (as expected, keeping CI green viatest.failing) — flip it to a plaintestonce the fix or the upstream ruling lands.Not done here (out of scope for this lane)
Test plan
bun test packages/run-key-history/test/listener.test.ts— 4 pass (the new test passes viatest.failing)bunx tsc --noEmit -p packages/run-key-history/tsconfig.jsonprettier --check/eslinton the changed file