Repository navigation
fix(training-agent): inventory update_media_buy answers NOT_CANCELLABLE to a second cancel - #9163
Conversation
…LE to a second cancel Cancelling a canceled buy, or a canceled package, answered INVALID_STATE. media_buy_seller/invalid_transitions expects NOT_CANCELLABLE for a re-cancel. Any other change to a canceled buy or package still answers INVALID_STATE. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean, well-scoped fix.
This PR mirrors the established double-cancel precedent (task-handlers.ts:19876) into the inventory-sim platform: a second canceled: true on an already-canceled buy or package now answers NOT_CANCELLABLE, while any other mutation still answers INVALID_STATE. The change is covered by new tests at both buy and package level (both branches exercised).
No protocol surface touched — no changes under static/schemas/source/**, docs/reference/**, dist/**, or task definitions — so no changeset is required, and its absence is correct. No schema↔docs coherence, oneOf-discriminator, artifact-immutability, or 3.1.x patch-eligibility concerns apply.
Decision table: no critical/high/medium findings; gated_paths is false; high_risk is false; author not on a no-auto-approve team; fewer than three medium findings. Falls through to row 9 → approve. (review_decision is REVIEW_REQUIRED, but with gated_paths false that does not force a different outcome.)
…tocol#9163, adcontextprotocol#9164) Brings in adcontextprotocol#9163 (a second cancel through inventory update_media_buy answers NOT_CANCELLABLE) and adcontextprotocol#9164 (a seeded inventory product reports its fixture's reporting_capabilities). Resolution ledger: - mechanical: none. - semantic: none. git merged server/tests/unit/training-agent-inventory-tenants.test.ts, which both sides changed, with no conflicts: main adds two tests beside this branch's changes. server/src/training-agent/inventory-sim/platform.ts changed only on main. Checks on the merge result: - npm run typecheck: pass. - server/tests/unit/training-agent-inventory-tenants.test.ts: 35 passed. - node scripts/precommit-server-unit.cjs --full: 867 files, 14,716 passed, 31 skipped. Before the merge: 14,714; main adds two tests.
Summary
On the inventory tenants (
/inventory-adserver,/inventory-content), cancelling a media buy or package that's already canceled answeredINVALID_STATE.media_buy_seller/invalid_transitionsexpectsNOT_CANCELLABLEfor a re-cancel.canceled: trueon a canceled buy now answersNOT_CANCELLABLEoncanceled.canceled: trueon a canceled package answersNOT_CANCELLABLEonpackages[N].canceled.INVALID_STATE, such as pausing it or changing a budget.This is one of the gaps #9150's seeded storyboard run exposed.
invalid_transitionswas failing on both inventory tenants.Test plan
NOT_CANCELLABLE, and pausing it getsINVALID_STATE. Re-cancelling a package getsNOT_CANCELLABLEonpackages[0].canceled, and changing its budget getsINVALID_STATE. It fails without the fix.media_buy_seller/invalid_transitionslocally on/inventory-adserver: 8P, clean, up from 1 failed.🤖 Generated with Claude Code