Skip to content

fix(training-agent): inventory update_media_buy answers NOT_CANCELLABLE to a second cancel - #9163

Merged
bokelley merged 1 commit into
mainfrom
fix/inventory-recancel
Nov 21, 2026
Merged

bokelley merged 1 commit into
mainfrom
fix/inventory-recancel

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

On the inventory tenants (/inventory-adserver, /inventory-content), cancelling a media buy or package that's already canceled answered INVALID_STATE. media_buy_seller/invalid_transitions expects NOT_CANCELLABLE for a re-cancel.

  • A second canceled: true on a canceled buy now answers NOT_CANCELLABLE on canceled.
  • A second canceled: true on a canceled package answers NOT_CANCELLABLE on packages[N].canceled.
  • Any other change to a canceled buy or package still answers INVALID_STATE, such as pausing it or changing a budget.

This is one of the gaps #9150's seeded storyboard run exposed. invalid_transitions was failing on both inventory tenants.

Test plan

  • New test: re-cancelling a buy gets NOT_CANCELLABLE, and pausing it gets INVALID_STATE. Re-cancelling a package gets NOT_CANCELLABLE on packages[0].canceled, and changing its budget gets INVALID_STATE. It fails without the fix.
  • Inventory suite: 34/34.
  • media_buy_seller/invalid_transitions locally on /inventory-adserver: 8P, clean, up from 1 failed.
  • Inventory CI rows: at or above feat(training-agent): comply_test_controller seeds on the inventory tenants, sharded storyboard CI #9150's floors, which can be raised after merge.

🤖 Generated with Claude Code

…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]>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

@bokelley
bokelley enabled auto-merge (squash) November 21, 2026 17:40
@bokelley
bokelley merged commit f0a4c62 into main Nov 21, 2026
61 checks passed
@bokelley
bokelley deleted the fix/inventory-recancel branch November 21, 2026 17:48
KonstantinMirin added a commit to KonstantinMirin/adcp that referenced this pull request Nov 21, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant