Repository navigation
fix(training-agent): inventory get_products rejects an account it never provisioned - #9149
Merged
Merged
Conversation
…er provisioned
The inventory tenants resolved any account reference, so get_products with a
natural key no one had synced answered with products. The accounts overview
("Account references before provisioning") says a seller that exposes
sync_accounts MUST answer ACCOUNT_NOT_FOUND instead: falling back to the
public card claims rate-card pricing for an account that does not exist.
Apply the sales tenant's check (assertDiscoveryAccountProvisioned) to
get_products, the one discovery task these tenants serve. A synced key prices
as before, a call without an account still gets the public card, and every
other task keeps resolving any reference.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean fix with no blocking or medium findings.
Scope: 3 files (app code + non-normative docs/building/** + a new unit test). No protocol surface, schema, or dist artifact changes, so no changeset required (repo rule: app/operational PR out of scope).
Checked:
InventoryPlatform.accounts.resolvenow gatesassertDiscoveryAccountProvisionedtoget_productsonly, mirroring the established sales/v6 pattern (ctx.toolNameconfirmed populated by the SDK). account_id refs and no-account calls are unaffected; other tasks keep the lenient synthetic-account posture.- New test uses a distinct token and never-synced domain to genuinely exercise the unprovisioned path, asserts no-provision on read, and confirms account-scoped pricing after sync plus public card with no account.
- Docs anchor
#error-code-account-not-foundresolves and matches get_products.mdx wording.
No critical/high/medium findings. high_risk=false, gated_paths=false, no no-auto-approve team match. review_decision is REVIEW_REQUIRED but gated_paths is false, so row 2 does not apply. Falls through to row 9.
4 of 5 tasks
KonstantinMirin
added a commit
to KonstantinMirin/adcp
that referenced
this pull request
Nov 21, 2026
…count (adcontextprotocol#9149) No conflicts. server/tests/unit/training-agent-inventory-tenants.test.ts changed on both sides, and git's merge keeps both: - this branch's top-level router import, loopback listener and per-test clock reset; - main's per-describe account provisioning and its ACCOUNT_NOT_FOUND test. That test reads PUBLIC_TEST_AGENT_TOKEN, which this branch sets once per worker in server/tests/setup/revenue-tracking-env.ts. Resolution ledger: - mechanical: none - semantic: none; the auto-merged test file was read and run (25 passed), including the clock tests, whose per-test reset_state keeps main's provisioned account Check: typecheck passes, and the full server unit suite passes (867 files, 14,705 tests, 31 skipped; main adds 1 test).
bokelley
added a commit
that referenced
this pull request
Nov 21, 2026
…'s principal The inventory controller had no input schema, so the SDK stripped the router-stamped __training_principal and seed_account provisioned the fixture account for "anonymous". Since #9149 get_products requires a provisioned natural key, every seeded storyboard's get_products then failed ACCOUNT_NOT_FOUND (about 30 storyboards in #9150's first CI run). Use the sales controller's input schema, which keeps that field. Co-Authored-By: Claude Opus 5.5 <[email protected]>
bokelley
added a commit
that referenced
this pull request
Nov 21, 2026
…enants, sharded storyboard CI (#9150) * feat(training-agent): comply_test_controller seeds on the inventory tenants The inventory tenants served only reset_state and sandbox_clock, so every storyboard that seeds fixtures skipped as fixture_seed_unsupported. They now serve seed_account, seed_product and seed_pricing_option. - seed_account provisions through the shared account store, as on /sales. - seed_product sells the fixture in the caller's market on the tenant called, on the season's own placements (video, audio or display; the nearest installment placement where the season has no such channel), so the engine forecasts, books and delivers it. Its wire shape is the fixture's own. - seed_pricing_option prices a seeded product: floor_price is the auction bid floor, fixed_price the guaranteed rate. Seeds live in the caller's market document, so reset_state discards them and a caller that never seeds sees exactly the season's catalogue. The engine sells extra products through a SeasonTraffic view that shares every cell and day table. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(training-agent): a seeded product whose channel the season lacks still gets placements An audio fixture on the ad server found neither an audio channel nor an installment channel, so it got no placements and seed_product failed (media_buy_seller/metric_container_subsumption). Fall back to display, then pre-roll, then any placement the season has. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(storyboards): split each inventory tenant across two isolated orchestrators One inventory row ran 34-54 minutes against its 60-minute limit. Run each tenant as two orchestrator jobs, the way /sales runs its eight: each runs alternate shards of eight (--shard-group/--shard-groups on the isolated shard coordinator), four at a time, and an aggregate job per tenant sums the halves and enforces the floors under the existing "Storyboards (current /<tenant>)" check. Each aggregate reads its own orchestrators' status, so one tenant's failure never fails the other's check. The rows leave the storyboards matrix, which returns to main's form (30-minute limit, creative-builder the only isolated row), and the release check expects the four orchestrator jobs. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(changeset): inventory storyboard orchestrators Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(training-agent): inventory seed_account provisions for the bearer's principal The inventory controller had no input schema, so the SDK stripped the router-stamped __training_principal and seed_account provisioned the fixture account for "anonymous". Since #9149 get_products requires a provisioned natural key, every seeded storyboard's get_products then failed ACCOUNT_NOT_FOUND (about 30 storyboards in #9150's first CI run). Use the sales controller's input schema, which keeps that field. Co-Authored-By: Claude Opus 5.5 <[email protected]> * ci(storyboards): set the inventory floors from the seeded run Run 44917374199 on a3d2006: /inventory-adserver 163/179 clean, 235 passed steps; /inventory-content 163/178 clean, 217 passed steps. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(training-agent): the inventory public card never carries a caller's seeded products get_products without an account built its forecast simulation with the caller's seeded products, so the public card (cache_scope "public") listed products only that caller had seeded. The public card is now the season's products against an empty market, the same for every caller; seeded products appear on account-scoped reads only. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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
On the inventory tenants (
/inventory-adserver,/inventory-content),get_productswith an account reference the seller never provisioned answered with products. It now fails withACCOUNT_NOT_FOUND.The accounts overview ("Account references before provisioning") requires this. A seller that exposes
sync_accountsMUST reject a natural key it never provisioned and MUST NOT fall back to the public card. A public answer claims rate-card pricing for an account that does not exist.#9146 found this:
media_buy_seller/unprovisioned_account_referencefailed 1P / 3F on both tenants.Change
assertDiscoveryAccountProvisioned, onget_products, the one discovery task these tenants serve.cache_scope: "account".accountstill answers with the public card,cache_scope: "public".create_media_buy, the controller, creatives.sync_accountsbefore naming an account onget_products.Effect on callers. Anyone who names an unsynced account on
get_productsnow getsACCOUNT_NOT_FOUNDand must sync first. The Apostra storefront already runssync_accountsfirst.Tests
training-agent-inventory-tenants.test.ts), run as the public test token, the flow a storefront runs:ACCOUNT_NOT_FOUNDtwice, so the read did not provision it;sync_accounts, the same key getscache_scope: "account";get_productsanswers with products and the first assertion fails.media_buy_seller/unprovisioned_account_referenceon/inventory-adserver, locally: 3P / 1S clean, up from 1P / 3F.billing_gate_dispatchcapability_discoverymedia_buy_seller/stable_account_idnotification_config_event_scopenotification_config_lifecyclenotification_config_rejectionssecurity_baselinev3_envelope_integrityversion_negotiationnpm run typecheck, compliance symbol links current.ACCOUNT_NOT_FOUND; sync, thenget_products→ products.🤖 Generated with Claude Code