Skip to content

fix(qa): stop the manual storyboard reporter crediting optional raw diagnostics - #8239

Draft
bokelley wants to merge 1 commit into
mainfrom
fix/storyboard-reporter-optional-grading
Draft

bokelley wants to merge 1 commit into
mainfrom
fix/storyboard-reporter-optional-grading

Conversation

@bokelley

@bokelley bokelley commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

server/tests/manual/run-storyboards.ts grades raw SDK step results. A phase authored optional can legitimately contain a red probe that the SDK aggregate treats as non-gating — but the reporter's raw step counter graded that red as a failure, so a conformant seller rendered NP / 1F.

Observed on media_buy_seller/inline_creatives_without_sync after #8235: all canonical execution steps pass, and the only red is the optional get_products_legacy_format probe whose own description says "EXPECTED AND NON-GATING". The SDK's modern aggregate grades that run clean; the manual reporter did not.

Behavior

A failed step is diverted out of the failure count into a bounded non-gating diagnostic list only when all of these hold:

  • its phase is authored optional — the same test applyStepSkipList already applies;
  • it carries no failed assertion;
  • and either the SDK supplied counts_toward_failure: false, or the untouched aggregate is authoritatively clean (overall_passed === true && failed_count === 0).

The raw step is never rewritten to passed or skipped. A diverted red is counted in no status bucket — it executed and it failed, so it is neither passing nor skip coverage. The enforced envelope invariant is totals == sum(summaries) with clean = failed === 0 && !has_error (scripts/run-storyboards-isolated.mjs), so this cannot inflate clean or passing coverage. Both pills render a (+N non-gating) suffix, so a clean run carrying diverted reds is never mistaken for an unqualified pass.

Fail-closed elsewhere. A failed assertion is never suppressed or waived. A detached onEnd assertion gates even with zero failed steps. An SDK rejection with no failed step sets summary.error unless known required-step waivers exactly account for it, a required step actually executed and passed, and no waived phase left a hard prerequisite skip behind. Optional waivers are never aggregate credit. Both pills require summary.error to be absent, so the required-exact grep cannot accept a rejected run.

Diagnostic text is control-stripped and length-bounded before printing. The direct workflow path tees runner stdout to CI without the isolator's safeLogLine, so unsanitised agent-derived text containing a newline could otherwise start a fresh line carrying a ::error:: workflow command or a forged ✓ pill. Correcting an earlier review claim repeated in this description: the required-clean and required-exact greps are line-start anchored (^[[:space:]]+<id>[[:space:]]+✓, workflow lines 410/433/461/478/496/535). Anchoring alone would not have closed the forgery path, since injecting a newline creates a line start — collapsing the text to one line is what closes it.

counts_toward_failure is published

Declared on the step result and honoured in the JUnit reporter in @adcp/sdk 15.9.3 (adcp-client#3301) and 16.0.0-beta.4 (#3303) — verified in the public 15.9.3 tarball at types.d.ts:2403. This repo pins 15.9.2, which predates it, so that arm is forward-compatible support rather than the live path. No SDK bump is needed here.

Validation

  • 37 tests in the existing registered tests/run-storyboards-isolation.test.cjs (registered via test:contracts) — 22 new, no package manifest churn. 20 grading cases extract the shipped functions from the runner source and exercise them directly; 2 isolator fixtures cover the pre-envelope passthrough and the envelope coherence validator. Those two do not invoke summarize() or the pill renderer — the grading cases cover those.
  • Non-vacuity spot-checked: removing the authored-optional guard fails the required-phase regression; removing the waiver flips the dependent case.
  • Full server unit suite + typecheck green through the normal pre-commit hook.

Local evidence (authoritative CI covers the other surfaces):

governance tenant, patched value floor
clean storyboards 53 / 59 ≥ 47
passing steps 183 ≥ 128

Both governance required-exact cases hold their counts (budget_periods 7P/0S, failed_outcome_audit_persistence 4P/0S). media_buy_seller/canonical_formats — a sales required-clean gate whose two waivers do not cascade — is unaffected at ✓ 23P/2S.

Six governance rows change. The causal evidence is the direct check_governance_drift trace — one waived step cascading 14 prerequisite_failed skips, execution the previous pill reported as complete — plus the controlled regression cases. It is deliberately not presented as a counter-only A/B: the separate baseline run selected a different corpus (58 vs 59 applicable), so the two runs are not the same captured results graded twice.

No floors were rebaselined, no waivers added or broadened, and no cascade or error guard relaxed.

Recorded separately, not changed here

static/compliance/source/protocols/creative/scenarios/evaluator_auth.yaml declares reject_off_list_evaluator and reject_off_list_feature_agent as optional: true, carrying error_code and upstream_traffic checks that guard an allowlist/SSRF boundary, with no invariants or contributes_to backstop. The SDK already grades those phases non-gating, so this is a protocol-fixture question — whether those checks should be mandatory — not a reporter regression. No per-check allowlist was invented and that contract is untouched by this PR.

Recorded as #8240.

This helper is not a dependency of the signed 3.1/3.2 corpus or of SDK adoption.

🤖 Generated with Claude Code

…iagnostics

The manual runner grades raw SDK step results. A phase authored `optional` can
legitimately contain a red probe that the SDK aggregate treats as non-gating,
but the reporter's raw step counter graded it as a failure, so a conformant
seller showed Nx/1F.

A failed step is now diverted out of the failure count into a bounded
non-gating diagnostic list, but ONLY when its phase is authored `optional` -
the same test applyStepSkipList already applies - and it carries no failed
assertion, and either the SDK supplied `counts_toward_failure: false` or the
untouched aggregate is authoritatively clean (overall_passed true AND
failed_count zero). Without the authored-optional scope an inconsistent input
could drop a required-phase red from every counter; a regression pins that.

The raw step is never rewritten to passed or skipped, and a diverted red is
counted in no status bucket: it executed and failed, so it is neither passing
nor skip coverage. The enforced envelope invariant is totals == sum(summaries)
with clean = failed === 0 && !has_error, so this cannot inflate either. Both
pills render a `(+N non-gating)` suffix so a clean run carrying diverted reds is
never mistaken for an unqualified pass.

`counts_toward_failure` is published - @adcp/sdk 15.9.3 (adcp-client#3301) and
16.0.0-beta.4 (#3303) declare it on the step result and honour it in the JUnit
reporter; verified in the public 15.9.3 tarball at types.d.ts:2403. This repo
pins 15.9.2, which predates it, so that arm is forward-compatible support
rather than the live path, and no SDK bump is needed here.

Fail-closed elsewhere. A failed assertion is never suppressed or waived. A
detached onEnd assertion gates even with zero failed steps. An SDK rejection
with no failed step sets summary.error unless known REQUIRED-step waivers
exactly account for it, a required step actually executed and passed, and no
waived phase left a hard prerequisite skip. Optional waivers are never
aggregate credit. Both pills require summary.error to be absent. Diagnostic
text is control-stripped and length-bounded before printing, because the direct
workflow path tees runner stdout to CI without the isolator's safeLogLine.

Coverage extends the existing registered runner-contract test rather than
adding manifest churn: 22 new cases (20 grading cases extracted from the
shipped functions, 2 isolator fixtures), 37 in the file. The two fixtures
exercise the isolator's pre-envelope passthrough and envelope coherence
validator - they do not invoke summarize() or the pill renderer. The JSON
projection is unchanged.

Local evidence: the patched governance tenant runs 53/59 clean with 183 passing
steps against floors of 47 and 128, and both governance required-exact cases
hold their counts. Six rows change; the causal evidence is the direct
check_governance_drift trace - one waived step cascading 14 prerequisite_failed
skips - plus the controlled regression cases, not a counter-only A/B, since the
separate baseline run selected a different corpus. media_buy_seller/
canonical_formats, a sales required-clean gate whose two waivers do not
cascade, is unaffected at 23P/2S. Authoritative CI covers the other surfaces.

Co-Authored-By: Claude Opus 5 (1M context) <[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 — test-only storyboard reporter fix with no blocking findings.

This PR touches only test/manual tooling (server/tests/manual/run-storyboards.ts, tests/fixtures/storyboard-isolation-runner.cjs, tests/run-storyboards-isolation.test.cjs). No published protocol surface (static/schemas/source/**, docs/reference/**, release scripts, dist/** artifacts) is touched, so no changeset is correctly required. high_risk is false; no high-risk globs, no deletions in sensitive paths.

The reviewer verified: the optional-raw-red diversion is fail-closed (only diverts AUTHORED-optional, non-failing, SDK-marked non-gating cases; diverted reds land in no status bucket so they inflate neither passing nor skipped coverage); the required-exact waiver path gates correctly; sanitizeDiagnostic closes the ::error::/✓-forgery vector on the un-isolated stdout path; and the 280 lines of added tests extract shipped functions via source slice with an fnEnd guard and cover non-vacuity on the optional-scope and waiver guards.

No critical, high, or medium findings. gated_paths is false (review_decision REVIEW_REQUIRED does not trigger row 2 when gated_paths is false). No no-auto-approve team match. Rows 1–8 do not fire; falls through to row 9 → approve.

@bokelley
bokelley marked this pull request as draft October 16, 2026 16:10

Copy link
Copy Markdown
Contributor Author

Causal diagnosis of the 3.0-compat failures

Reproduced locally against the exact CI corpus: dist/compliance/3.0.28 extracted from published commit 12f2d0d91ad47deefcff78fb21e8cef2b5e9ecd9, with scripts/patch-3-0-compat-bundle.cjs applied, ADCP_STORYBOARD_CANDIDATE_VERSION_MODE=0, TENANT_PATH=brand. Pills match the CI job exactly. (An earlier attempt used 3.0.27 as "close enough"; that was not good enough for causal work and is superseded.)

Running the three IDs with --verbose gives the raw skip reasons the CI job did not print. They have three different causes, so no single correction covers them:

Storyboard Pill Raw skip reasons Waiver evidence
idempotency 0P / 0F / 11S 11 × missing_test_controller None
brand_rights 4P / 0F / 2S 1 × known_failing + 1 × prerequisite_failed Exact match: brand_rights/acquire_rights
brand_rights/governance_denied 2P / 0F / 3S 2 × missing_tool + 1 × prerequisite_failed None

What each one is

idempotency — every step skipped because the brand agent does not advertise comply_test_controller. The SDK's own skip text reads: "Storyboard grades not_applicable — the buyer-side flow depends on pre-seeded state the agent has no way to accept." The storyboard is wholly inapplicable to this tenant; no waiver is involved and nothing executed.

brand_rights — the only one matching the waiver-cascade shape, with exactly the evidence required: one known_failing step (the existing brand_rights/acquire_rights waiver) plus one dependent prerequisite_failed skip.

brand_rights/governance_denied — driven by two missing_tool skips plus one dependent. No waiver matches; this is unmet tool advertisement, not a waived step.

Assessment

This confirms the earlier read that the helper exposes pre-existing false-clean reporting rather than changing agent, SDK or corpus behaviour: the prior summarize ignored SDK overall_passed / failed_count, so all three of these zero-F rejected summaries previously received clean credit.

It also confirms that the three are not all waived-prerequisite cascades. Only brand_rights has that evidence.

Why this stays draft

Two of the three are hard missing-state cases (missing_test_controller, missing_tool) with no waiver. Treating "all-skipped", "zero failed_count", or "3.0 surface" as licence to override an SDK rejection would be exactly the broad override that must not be taken from this evidence — and the no-executed-coverage guard is deliberately one of the protections. Deciding how a wholly-inapplicable storyboard should be graded is a policy question outside a helper-only PR.

So: no floor change, no new or widened waiver, no weakening of the aggregate or cascade guards, and no YAML change. PR left in draft; a separate concrete follow-up should carry the grading-policy question for missing_test_controller / missing_tool storyboards.

This helper is not a dependency of the four-issue delivery (#8235, merged) or of SDK adoption.

This branch has not been deployed

No deployments
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