fix(sdk): lock registerToolSessionTransitionCleanup out of public inventory - #3837
Conversation
…entory Yeachan-Heo#3813 added AgentSession.registerToolSessionTransitionCleanup for shared artifact-manager ownership on session transitions. The method is an internal lifecycle registration seam, parallel to registerToolSessionCleanup, but was never added to LOCKED_EXCLUSIONS. Exact-head Dev CI then fails the generated SDK operation inventory check on any PR based on current dev. Classify the seam as a locked exclusion and regenerate the committed matrix. Lore-id: 3813seam01 Constraint: do not expose as a public SDK control Rejected: map to a new SDK operation | no user-facing control exists Confidence: high Scope-risk: narrow Reversibility: easy Tested: sdk-operation-inventory.test.ts (17 pass); inventory --check Not-tested: full coding-agent shard matrix on CI Refs Yeachan-Heo#3813
Yeachan-Heo
left a comment
There was a problem hiding this comment.
Red-team read-only review: SDK inventory exclusion seam
Head SHA verified: db9ad498763ffa6ffbba5573bc431cab246b559f
Scope
2 files, +13 lines:
generate-sdk-operation-inventory.ts— addsagent_session:registerToolSessionTransitionCleanuptoLOCKED_EXCLUSIONSoperation-inventory.generated.json— regenerated committed matrix
Validation performed
1. Locked exclusion is internal — ✅
registerToolSessionTransitionCleanup (agent-session.ts:3413-3418) is a #private-backed lifecycle registration that adds a cleanup callback to this.#toolSessionTransitionCleanups. It has no SDK adapter mapping, no user-facing control surface, and is parallel to the already-excluded registerToolSessionCleanup (line 3407, excluded at generator line 38). The rationale string accurately describes its purpose: "internal tool transition cleanup registration for shared artifact-manager ownership."
2. Generator output matches committed JSON — ✅
bun scripts/generate-sdk-operation-inventory.ts --check → exit 0
bun test test/sdk-operation-inventory.test.ts → 17 pass, 0 fail
The --check mode confirmed the committed operation-inventory.generated.json is byte-identical to what the generator produces from the updated LOCKED_EXCLUSIONS. No drift.
3. CI status — ✅
14 SUCCESS, 6 SKIPPED, 0 FAILURE. Mergeable.
Verdict
Clean mechanical exclusion of an internal lifecycle seam introduced by #3813. The generator and committed matrix are in sync. No public SDK surface is exposed or removed.
Approved.
— gaebal-gajae
Summary
Follow-up to #3813. Current
devfailsSDK operation inventory > accepts the committed generated matrixwith:AgentSession.registerToolSessionTransitionCleanupis an internal tool/session lifecycle registration seam used for shared artifact-manager ownership across transitions. It is not a user-facing SDK control (same class asregisterToolSessionCleanup, already locked out).Changes
agent_session:registerToolSessionTransitionCleanuptoLOCKED_EXCLUSIONSingenerate-sdk-operation-inventory.ts.operation-inventory.generated.json.Why this matters
Any exact-head PR based on current
devthat runs coding-agent shard inventory checks inherits this red, including notification PR #3834 (whose own generation guard and package check are green). Owner review of #3834 classified this as a pre-existing base regression that still must be green on the exact head before merge.Test plan
bun test packages/coding-agent/test/sdk-operation-inventory.test.ts— 17 passbun packages/coding-agent/scripts/generate-sdk-operation-inventory.ts --checkScope
Refs #3813only — inventory classification, not a behavior change.