Skip to content

feat(training-agent): comply_test_controller seeds on the inventory tenants, sharded storyboard CI - #9150

Merged
bokelley merged 7 commits into
mainfrom
feat/inventory-seed-scenarios
Nov 21, 2026
Merged

bokelley merged 7 commits into
mainfrom
feat/inventory-seed-scenarios

Conversation

@bokelley

@bokelley bokelley commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The inventory tenants (/inventory-adserver, /inventory-content) served only reset_state and sandbox_clock, so every storyboard that seeds fixtures skipped as fixture_seed_unsupported. They now serve three comply_test_controller seeds. Their storyboard CI is also split so it fits comfortably in its time limit.

Seeds

  • seed_account provisions through the shared account store, using the same adapter and controller input schema as /sales. The account belongs to the bearer's principal, so it counts as provisioned under fix(training-agent): inventory get_products rejects an account it never provisioned #9149's get_products check.
  • seed_product sells the fixture in the caller's market on the tenant called.
    • It uses the season's own placements, so the engine forecasts, books and delivers it.
    • Mapping: video fixtures go on video placements, audio on audio, anything else on display, narrowed by image size. A season without that channel uses its nearest installment placement (creator video, podcast, newsletter), then display, pre-roll, or any placement it has.
    • The product's wire name, description, channels, format_options and publisher_properties are the fixture's own.
    • A caller's seeded products are listed before the season's.
  • seed_pricing_option prices a seeded product. floor_price is the auction bid floor and fixed_price the guaranteed rate. A seeded product with no seeded option keeps the default <id>_cpm pricing.
  • Storage. Seeds live in the caller's market document, so reset_state discards them. They're per credential, like buys. SeasonTraffic.withProducts is a view sharing every cell and day table, so nothing is regenerated per caller.

Unseeded callers see no change. A caller that never seeds gets the season's catalogue exactly. A test reads an unseeded caller's get_products before and after another caller seeds; the two are deep-equal, ignoring only the moving generated_at and valid_until. That caller also can't buy the seeded product (PRODUCT_NOT_FOUND).

Fixes found on the way

  • Seeded accounts went to the wrong 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. Once fix(training-agent): inventory get_products rejects an account it never provisioned #9149 required provisioned keys on get_products, about 30 seeded storyboards failed ACCOUNT_NOT_FOUND. The controller now uses the sales input schema. Test: a seeded account prices on get_products without a sync; it fails without the fix.
  • A fixture whose channel the season lacks entirely got no placements (an audio fixture on the ad server, from metric_container_subsumption). It now falls back to display, pre-roll, then any placement. Test included; it fails without the fix.

Storyboard CI: two orchestrators per tenant

One inventory row ran 34–54 minutes against its 60-minute limit (#9146).

  • Each tenant now runs as two orchestrator jobs, like /sales's eight. Each job takes alternate shards of eight, four at a time, using new --shard-group / --shard-groups options on the isolated shard coordinator.
  • An aggregate job per tenant sums the halves and enforces the floors under the existing Storyboards (current /<tenant>) check.
  • Each aggregate reads only its own orchestrators' exit status, so one tenant's failure never fails the other's check.
  • The rows leave the storyboards matrix, which returns to main's form: a 30-minute limit, with creative-builder the only isolated row.
  • The release check (check-release-state.cjs) expects the four orchestrator jobs, and its tests expand them.

Run 44917374199 on a3d200668d:

Job Duration
/inventory-adserver group 0/2 12.2 min
/inventory-adserver group 1/2 9.2 min
/inventory-content group 0/2 12.2 min
/inventory-content group 1/2 13.3 min

Floors

The floors are run 44917374199's result:

Tenant Clean Passed steps Before seeding (#9146)
/inventory-adserver 163 / 179 235 178 clean / 28 passed
/inventory-content 163 / 178 217 177 clean / 28 passed

Clean counts drop because seeding runs storyboards that used to skip, and some fail on existing tenant gaps. Passing steps rise about eightfold. media_buy_seller is 10P / 6S, clean, on both tenants.

Still failing, all inspected. Each is a tenant gap, not a seeding fault:

Gap Storyboards Status
simulate_delivery / simulate_budget_spend not served deterministic_testing, billing_finality_delivery, delivery_reporting #9151, not scheduled
Creative formats outside the season creative_reception, declared_carousel_cta_values, declared_format_option_acceptance #9152, not scheduled
Past start_time accepted schema_validation #9154, parked
An exclusive per-day takeover booked as two packages on the same day collides with itself dependency_impairment_cardinality
Update response omits full creative-assignment state (adserver only) dependency_impairment
Seeded product's reporting_capabilities not projected metric_container_subsumption
Re-cancel answers INVALID_STATE, not NOT_CANCELLABLE invalid_transitions
TERMS_REJECTED not supported measurement_terms_rejected
Legacy format_ids probe (the storyboard calls it non-gating) inline_creatives_without_sync
Currency filter on pricing options pricing_currency_filter
Brief and exact targeting resolution targeting_aware_discovery
Total-budget redistribution total_budget_redistribution

Since the fork's local estimate, error_compliance, get_products_pagination_integrity and product_coverage_filters have become clean, through #9153 and #9155.

Test plan

  • Inventory suite: 33/33, including five seed tests, the unseeded-caller invariance test, and both fix tests
  • Workflow and release tests: run-storyboards-sharding 17/17 (with new --shard-group and inventory-job tests), release-workflow-immutability, release-publication-freshness 47/47, ci-runner-demand-workflows
  • npm run typecheck, compliance symbol links current, changeset scope check
  • CI run 44917374199: four orchestrators succeed in 9–13 min, and the floors are set from its aggregates
  • CI green on the final head

🤖 Generated with Claude Code

aao-secretariat[bot]
aao-secretariat Bot previously approved these changes Nov 21, 2026

@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 — inventory-sim product/pricing seeding feature in server/** training-agent code.

Scope check: No changes under static/schemas/source/**, task definitions, normative docs/reference/**, release scripts, or dist/** artifacts. The docs change is docs/building/** (non-normative). So no spec-drift, changeset, oneOf-discriminator, immutable-artifact, or 3.1.x patch-eligibility gates apply. No governance-precedent or breaking-class protocol question raised.

Engine mechanics verified sound: withProducts builds a prototype-view shadowing only the products map while slots/cells stay placement-derived; seeds validated fail-closed as INVALID_PARAMS; concurrency serialized through withCallerMarkets; reset_state discards seeds via the per-principal market. Well-tested (seeded buy/price/isolation/reset coverage).

Medium findings (1):

  • server/src/training-agent/inventory-sim/platform.ts:532 — Public card (cache_scope: 'public') now carries caller-private seeded products; caller-independence comment is now stale.

A single medium finding with no escalation trigger — not data-loss/schema/infra category, high_risk is false, gated_paths is false, no no-auto-approve team match, no prior escalation. Decision table rows 1–8 do not fire; falls through to row 9 → approve. Worth a follow-up on the cache-scope labeling, but it is non-blocking.

Medium findings

  • server/src/training-agent/inventory-sim/platform.ts:532 — Public card (cache_scope: 'public') now carries caller-private seeded products

bokelley and others added 4 commits November 21, 2026 14:42
…enants

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

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]>
@aao-secretariat aao-secretariat Bot added the ladon/needs-human-review Ladon has escalated this PR for human review. label Nov 21, 2026

@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: Escalate to human review

Escalate — gated path requires human/CODEOWNERS approval.

This PR modifies .github/workflows/training-agent-storyboards.yml, which matches the deterministic gated-path glob .github/workflows/**. gated_paths: true and review_decision is unknown/none (not APPROVED), so decision-table row 2 fires: the hard approval gate is not satisfied and the outcome must be escalate.

No blocking (critical/high) findings exist. The reviewer confirmed the CI reshaping is sound (timeouts present, fail-fast disabled, per-tenant isolation, fail-closed aggregate), the seeded-products engine validates at seed time and keeps seeds credential-private, and no schema/dist/oneOf changes occurred with an in-scope changeset present.

Medium findings

  • server/src/training-agent/inventory-sim/platform.ts:553 — Public card (cache_scope: 'public') carries caller-private seeded products (re-surfaced prior Medium; non-blocking)

Escalation reasons

  • .github/workflows/training-agent-storyboards.yml is under the hard approval gate (.github/workflows/**); human/CODEOWNERS review is required because review_decision is not APPROVED.

Medium findings

  • server/src/training-agent/inventory-sim/platform.ts:553 — Public card (cache_scope: 'public') carries caller-private seeded products

Why human review

  • .github/workflows/training-agent-storyboards.yml is under a hard approval gate (.github/workflows/**); requires human/CODEOWNERS review because review_decision is not APPROVED
  • This PR touches a path under a hard, non-overridable approval gate (.github/workflows/training-agent-storyboards.yml (modified) matches .github/workflows/**) and the current GitHub review decision is 'unknown', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

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

@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: Escalate to human review

Escalate — gated path requires human/CODEOWNERS review.

This PR modifies .github/workflows/training-agent-storyboards.yml, which matches the hard approval gate glob .github/workflows/** (gated_paths: true). The current review_decision is unknown/none, not APPROVED, so decision-table row 2 fires and Ladon cannot auto-approve regardless of how clean the diff is.

Findings: None in the current delta. The reviewer confirms a clean subsequent pass — the 61-line delta across 3 files exports and reuses the established SALES_COMPLY_INPUT_SCHEMA on the inventory tenant (consistent with the module convention and existing tests) and adds a test asserting ACCOUNT_NOT_FOUND → seed_account → cache_scope 'account'. No new Medium+ findings.

Prior Medium resolved from scope: The earlier platform.ts:553 Medium (public card carrying caller-private seeded products) is out of recheck scope — that file is absent from this delta.

Escalation reason:

  • .github/workflows/training-agent-storyboards.yml (modified) is under a hard, non-overridable approval gate (.github/workflows/**). A human/CODEOWNERS approval must be recorded (review_decision = APPROVED) before this can merge. The diff is otherwise clean.

Why human review

  • Modifies .github/workflows/training-agent-storyboards.yml — under a hard approval gate (.github/workflows/**); requires human/CODEOWNERS review because review_decision is not APPROVED
  • This PR touches a path under a hard, non-overridable approval gate (.github/workflows/training-agent-storyboards.yml (modified) matches .github/workflows/**) and the current GitHub review decision is 'unknown', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

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]>
@bokelley bokelley changed the title feat(training-agent): comply_test_controller seeds on the inventory tenants feat(training-agent): comply_test_controller seeds on the inventory tenants, sharded storyboard CI Nov 21, 2026

@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: Escalate to human review

Escalate — gated path requires human/CODEOWNERS approval.

This PR modifies .github/workflows/training-agent-storyboards.yml, which falls under a hard, non-overridable approval gate (.github/workflows/**). gated_paths is true and review_decision is not APPROVED (currently unknown/none), so Row 2 of the decision table forces escalation. Ladon cannot auto-approve a workflow-file change until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

No blocking findings: the single-file delta (L952-972) is a documented, deliberate CI floor reset — min_clean_storyboards drops ~15 while min_passing_steps rises ~8× because seed_* scenarios now run storyboards previously skipped as fixture_seed_unsupported, with remaining failures enumerated as tracked tenant gaps (#9151/#9152/schema_validation). The accompanying comment documents the rationale. No correctness defect; prior pass had no blockers. This escalation is purely the governance gate, not a code concern.

Escalation reasons

  • Modifies .github/workflows/training-agent-storyboards.yml — under a hard approval gate (.github/workflows/**); requires human/CODEOWNERS review because review_decision is not APPROVED.

Why human review

  • Modifies .github/workflows/training-agent-storyboards.yml — under a hard, non-overridable approval gate (.github/workflows/** ) and review_decision is not APPROVED; requires human/CODEOWNERS review before merge.
  • This PR touches a path under a hard, non-overridable approval gate (.github/workflows/training-agent-storyboards.yml (modified) matches .github/workflows/**) and the current GitHub review decision is 'unknown', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

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

@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: Escalate to human review

Escalate — gated workflow file touched and review is not APPROVED.

This PR modifies .github/workflows/training-agent-storyboards.yml, which matches the hard, non-overridable approval gate (.github/workflows/**). gated_paths is true and review_decision is REVIEW_REQUIRED (not APPROVED), so decision-table row 2 fires: Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

The code itself is clean. The reviewer found no blocking or medium findings: the load-bearing change (platform.ts:731 dropping seeded products from the unscoped InventorySimulation.create so the public get_products card no longer leaks seeder seeds) is correct, the scoped path preserves its seeded catalogue, and the behavior is pinned by the test at training-agent-inventory-tenants.test.ts:831-833. No critical/high/medium findings in this run or the prior pass.

Escalation reasons:

  • .github/workflows/training-agent-storyboards.yml (modified) matches gated path .github/workflows/** and review_decision is not APPROVED — human/CODEOWNERS review required before merge.

Why human review

  • Modifies .github/workflows/training-agent-storyboards.yml — matches the hard approval gate .github/workflows/** and review_decision is REVIEW_REQUIRED (not APPROVED). Requires human/CODEOWNERS approval before merge.
  • This PR touches a path under a hard, non-overridable approval gate (.github/workflows/training-agent-storyboards.yml (modified) matches .github/workflows/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

@bokelley

Copy link
Copy Markdown
Contributor Author

Admin merge at dfc3aab, authorized by @bokelley (PR author, who therefore can't supply the required approval). All 67 checks pass, no review threads are open, and Ladon reported no findings; it escalated only for the .github/workflows/** gate. Same route as #9146.

@bokelley
bokelley merged commit 1c41290 into main Nov 21, 2026
68 checks passed
@bokelley
bokelley deleted the feat/inventory-seed-scenarios branch November 21, 2026 16:17
KonstantinMirin added a commit to KonstantinMirin/adcp that referenced this pull request Nov 21, 2026
… snapshots

Brings in adcontextprotocol#9150 (comply_test_controller seeds on the inventory tenants,
two isolated orchestrators per inventory tenant in CI), adcontextprotocol#9049 (reporting
subscriptions name geography systems and carry geo codes), and the
v3.1.34 and v3.2.12 doc snapshots (adcontextprotocol#9131, adcontextprotocol#9139).

Resolution ledger:
- mechanical: none.
- semantic: none. git merged the five files both sides changed with no
  conflicts:
  - server/src/addie/mcp/schema-tools.ts: main bumps the 3.1 and 3.2
    docs releases; this branch's changes are elsewhere in the file.
  - server/tests/unit/training-agent-inventory-tenants.test.ts: main
    adds seed tests beside this branch's changes.
  - tests/release-publication-freshness.test.cjs,
    tests/release-workflow-immutability.test.cjs and
    tests/run-storyboards-sharding.test.cjs: main adds the inventory
    orchestrator jobs and the --shard-group option.
- The local pre-push matrix keeps its tenants: the inventory jobs and
  --shard-group are CI only, and the local queue runs isolated tenants
  through run-storyboards-isolated.mjs, not the shard script.

Checks on the merge result:
- npm run typecheck: pass.
- node --test on the three release and sharding test files: 69 pass,
  0 fail.
- node scripts/precommit-server-unit.cjs --full: 867 files, 14,714
  passed, 31 skipped. Before the merge: 14,708; adcontextprotocol#9150 adds six tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ladon/needs-human-review Ladon has escalated this PR for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant