Repository navigation
fix(training-agent): inventory get_products filters by required_metrics; raise the inventory floors - #9169
Conversation
get_products on the inventory tenants ignored filters.required_metrics. Keep only products whose reporting_capabilities report every required metric, under the same container rule as the sales tenant (exported reportingMetricIsAvailable): a declared viewability container covers its numeric leaves, quartile_data its quartiles, and a leaf never covers a sibling. Filter, never fail. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — app-only change to the training-agent inventory simulator.
Ports the sales tenant's required_metrics filter into the inventory-sim platform, reusing the container-subsumption rule exported as reportingMetricIsAvailable from task-handlers.ts. The new reportsAllMetrics helper mirrors the inline sales-tenant logic (task-handlers.ts:12047-12052) verbatim and is fail-closed: a product with no reporting_capabilities yields an empty declared set and is excluded; an empty required_metrics array is a no-op, matching the sales path. Both new tests cover season and seeded products and exercise container-vs-sibling-leaf semantics.
No static/schemas/source/**, docs/reference/**, dist/**, or migration files touched — app-only (training-agent), so no changeset required. No high-risk paths, no gated paths, no author-team gate. No Critical/High/Medium findings.
Decision table: rows 1–8 do not fire (no findings, gated_paths false, high_risk false, no team gate, zero medium findings). Falls through to row 9 — approve.
Run 45014175480 on bff25f1: /inventory-adserver 164 clean, 238 passed steps; /inventory-content 164 clean, 220 passed steps. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
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 hard approval gate glob .github/workflows/** (gated_paths: true). The current review_decision is REVIEW_REQUIRED, not APPROVED, so the gate is not satisfied (decision table row 2). The outcome must be escalate until a real human/CODEOWNERS approval lands.
Escalation reasons:
.github/workflows/training-agent-storyboards.ymlis under a hard approval gate (.github/workflows/**) andreview_decisionisREVIEW_REQUIRED— human/CODEOWNERS review required.
Findings: None. The delta (CI floor bumps 163→164 / 235→238 / 217→220 plus an in-scope patch changeset) is clean and mechanically correct; the changeset is correctly required by the protocol-scope check and patch is the right bump for a non-breaking fail-closed floor raise. The prior pass was a clean approve with no blockers. There are no new critical/high/medium findings — this escalation is purely the deterministic gated-paths gate, not a code concern.
Why human review
- .github/workflows/training-agent-storyboards.yml is under a hard approval gate (.github/workflows/**) and review_decision is REVIEW_REQUIRED — human/CODEOWNERS review required 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.
…dcontextprotocol#9169, adcontextprotocol#9171) Brings in adcontextprotocol#9169 (inventory get_products filters by required_metrics; the inventory storyboard floors rise) and adcontextprotocol#9171 (accept_proposal and create_media_buy refuse a mismatched terms digest with PROPOSAL_TERMS_CHANGED; compact_product_lifecycle gains its 11th step). Resolution ledger: - mechanical: none. - semantic: none. git merged the four files both sides changed with no conflicts, and the hunks are disjoint: - scripts/run-storyboards-matrix.sh: main raises the compact_product_lifecycle exact count to 11 steps; this branch's changes are the queue and the build cache. - server/src/training-agent/task-handlers.ts: main changes the terms-digest checks and exports reportingMetricIsAvailable; this branch's changes are the imports and the lazy product-discovery input schemas. - server/src/training-agent/tenants/tenant-smoke.test.ts and server/tests/unit/training-agent-inventory-tenants.test.ts: main adds tests beside this branch's loopback-server and reset changes. - The CI-only inventory floors in training-agent-storyboards.yml come in unchanged; the local pre-push queue has no inventory floors. Checks on the merge result: - npm run typecheck: pass. - node --test tests/compact-product-lifecycle-storyboards.test.cjs tests/run-storyboards-sharding.test.cjs: pass. - node scripts/precommit-server-unit.cjs --full: 867 files, 14,718 tests, 31 skipped. Before the merge: 14,716; adcontextprotocol#9169 adds two tests. One test failed at load 112: the cold-worker exact-inference test, whose child hit that test's 25 s kill. Neither merged PR touches it, and main has the same 25 s kill.
Brings in 3 commits from main: adcontextprotocol#9123 (deprecates the single-value branch of 17 scalar-or-list unions and fixes the bundler so call-site keys beside a $ref stay at the call site), adcontextprotocol#9169 (training agent inventory floors) and adcontextprotocol#9171 (PROPOSAL_TERMS_CHANGED for a mismatched accept_proposal digest). Resolution ledger Mechanical files, resolved by rule: - package.json (conflicted): the test list keeps both sides' entries, test:schema-named-constraints from this branch and test:build-schemas-exit-status from main. 119 entries, each defined. - tests/mcp-schema-projection.test.cjs (auto-merged, failed the gate): the parity compile limit is the measured comply_test_controller projection rounded up to the next 1,000 bytes. Main's deprecation descriptions and the new error code bring main's controller from 1,350,376 to 1,351,064 bytes; this branch's named schemas still add 79,135, so the merged controller measures 1,430,199 and the limit moves from 1,430,000 to 1,431,000. Semantic files, union of both sides: - brand.json color_value, brand/get-brand-identity-response.json colors (5 sites), error-details/requote-required.json envelope_field: this branch's $ref to core/hex-color.json or #/definitions/envelope_field_path is kept, and main's deprecated, x-deprecated-in, x-removed-in and deprecation description sit beside it on the single-value branch. brand.json keeps x-removed-in 5.0.0; the others keep 4.0.0. The referenced definitions carry no deprecation, so the array branches and the other sites that reference them are not deprecated. - media-buy/accept-proposal-request.json proposal_terms_digest: this branch's $ref to core/proposal-terms-digest.json with main's longer description from adcontextprotocol#9171. Proof: - Schema equivalence, origin/main -> merge, with the delta manifest: 3,056 entries at 41 sites and 4,255 informational entries, the same as the branch against its previous merge base; the manifest matches, 41/41 witnesses pass, and no corpus instance changes verdict. - The annotation channel at source level is the union of both sides: each of main's 77 annotation changes (title, description, default, deprecated, x-*) lands at the same document and pointer in the merge, and each of this branch's 1,636 stays relative to main. - Bundles: the 81 single-value deprecation nodes in the bundled schemas sit at the same pointers with the same keys as main's build, and none moves onto a shared definition. - Inline pattern and enum counts stay at 83 and 471, and the $ref count is unchanged.
Brings in 6 commits from main: adcontextprotocol#9123 (deprecates the single-value form of the scalar-or-list unions), adcontextprotocol#9169 (training agent inventory floors), adcontextprotocol#9171 (PROPOSAL_TERMS_CHANGED), adcontextprotocol#9170 (not-guards that resolve 11 overlapping oneOf unions, with tests/oneof-overlap-resolution.test.cjs), adcontextprotocol#9141 (3.3.0-rc.3 version packages) and adcontextprotocol#9176 (rc.3 docs snapshot). Resolution ledger: - package.json (conflicted): test:schemas keeps both sides' entries, the two equivalence tests from this branch and tests/oneof-overlap-resolution.test.cjs from main, at main's position. Main's test:build-schemas-exit-status auto-merged. Every test file it names exists. The version (3.3.0-rc.3) is main's. - package-lock.json: main's (version field only). - Invariants: no code change needed. The oneof check at the merged tree reports 223 reachable oneOfs, P 219, W 4, U 0, the same as main at 14651cc; adcontextprotocol#9170 resolves 12 of the 16 witnessed overlaps (main at 2db59ba, after adcontextprotocol#9123, still has 16). The 4 left are the either/or unions adcontextprotocol#9170 leaves for adcontextprotocol#8191. The construct catalog still reports its 37 known false alarms and no misses, and tests/oneof-overlap-resolution.test.cjs passes (38 of 38). - Proof: schema equivalence of the merged tree against 14651cc: 1113 roots, 0 differ, class 1, no informational entries.
Brings in 6 commits from main: adcontextprotocol#9123 (deprecates the single-value form of the scalar-or-list unions), adcontextprotocol#9169 (training agent inventory floors), adcontextprotocol#9171 (PROPOSAL_TERMS_CHANGED), adcontextprotocol#9170 (not-guards that resolve 11 overlapping oneOf unions, with tests/oneof-overlap-resolution.test.cjs), adcontextprotocol#9141 (3.3.0-rc.3 version packages) and adcontextprotocol#9176 (rc.3 docs snapshot). Resolution ledger: - package.json (conflicted): test:schemas keeps both sides' entries, the five lint tests from this branch and tests/oneof-overlap-resolution.test.cjs from main, at main's position. Main's test:build-schemas-exit-status auto-merged. Every test file it names exists. The version (3.3.0-rc.3) is main's. - package-lock.json: main's (version field only). - Baseline: adcontextprotocol#9170's error-branch guards are local refs to #/oneOf/0, which the schema-path lint reports as ref-local-not-defs. They are main's schemas, so the seven findings are recorded in scripts/lint-schema-paths-baseline.json with --update-baseline rather than changed here: - adagents.json#/oneOf/1/not/$ref - content-standards/{calibrate-content,create-content-standards, get-content-standards,get-media-buy-artifacts, list-content-standards,validate-content-delivery}-response.json #/oneOf/1/not/$ref Schema paths go from 593 to 600. The other four lints are unchanged: enum values 58, property names 820, value lists 24, x-adcp-validation 337. - Proof: schema equivalence against 14651cc: 1113 roots, 0 differ, class 1; 158 informational x-adcp-validation entries at 18 sites, as before.
Summary
Two changes to the inventory tenants (
/inventory-adserver,/inventory-content):get_productsfilters byfilters.required_metrics. It keeps only products whosereporting_capabilities.available_metricscover every required metric. The rule is the sales tenant's own, now exported asreportingMetricIsAvailablefromtask-handlers.ts:viewabilitycontainer covers its numeric leaves (viewable_rate,viewable_impressions,measurable_impressions,viewed_seconds);quartile_datacovers its quartiles;Storyboard effect
media_buy_seller/metric_container_subsumptionon/inventory-adserver, locally: 7P / 1F / 2S, up from 5P / 1F. Bothrequired_metricsphases pass: the container satisfies[viewable_rate, viewed_seconds], and the leaf-only product is excluded.It still isn't clean. Its
requested_metricsphase drives delivery withsimulate_delivery, which the inventory tenants don't serve (#9151), and that step failsUNKNOWN_SCENARIO. It goes clean once #9151 lands.Test plan
required_metrics: [completed_views]keeps only the two pre-roll products;[viewable_rate]matches nothing, because the season declares theviewable_impressionsleaf, not the container;viewability-container product and aviewable_rate-only product both match[viewable_rate]; only the container matches[viewable_rate, viewed_seconds].npm run typecheck.🤖 Generated with Claude Code