Repository navigation
chore: fix local pre-commit/pre-push failures and share the duration-unit enum - #7480
Conversation
…unit enum Closes #7478. - server unit setup scrubs DEV_USER_*/ADMIN_* so the auth boundary tests behave the same in Conductor shells as in CI; live router scenarios are opt-in via ADDIE_ROUTER_LIVE_TESTS=1 and the fixture-backed opinion-poll case runs through the provider seam instead of a removed client field; the precommit server-unit budget follows the suite (612 files, ~1020s on an idle sandbox): 600s -> 1500s - get_products.mdx: Quick Start drops the unexported Zod schema import; three illustrative blocks are marked test=false with prose saying why - regenerate scripts/oneof-discriminators.baseline.json - enums/duration-unit.json is the single source for duration units; core/duration.json and get_adcp_capabilities supported_window_units reference it (lint allowlist for the intentional evidence-age narrowing; mcp-schema-analysis pinned counts re-pinned) - pre-push storyboard matrix is advisory: skipped on a dirty tree or with ADCP_SKIP_STORYBOARD_MATRIX=1; the matrix snapshots dist/schemas/latest so a concurrent build:schemas cannot abort a tenant mid-run - playbook documents the direct per-file doc checks and the local hooks Co-Authored-By: Claude Fable 5.1 <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Escalate to human review
Escalate — gated paths touched without required review approval.
This PR modifies files under a hard, non-overridable approval gate: .agents/playbook.md and multiple static/schemas/source/** files (core/duration.json, enums/duration-unit.json, index.json, protocol/get-adcp-capabilities-response.json). Per decision-table row 2, gated_paths: true while review_decision: REVIEW_REQUIRED (not APPROVED), so the gate is not satisfied and the outcome must be escalate.
The reviewer surfaced no Critical/High/Medium findings — the shared duration-unit enum extraction is clean (enum values unchanged, registered in index.json, matching mcp-schema-analysis count updates), the supported_window_units narrowing codifies an existing MUST so the patch changeset is correct, and the test-infra hardening is sound. The diff itself looks mergeable, but human/CODEOWNERS review is required to satisfy the schema-source and .agents/** approval gate before it can proceed.
Escalation reasons
- Touches gated paths (
static/schemas/source/**,.agents/playbook.md) withreview_decision: REVIEW_REQUIRED— human/CODEOWNERS approval required to lift the gate.
Why human review
- Gated paths touched (static/schemas/source/core/duration.json, static/schemas/source/enums/duration-unit.json, static/schemas/source/index.json, static/schemas/source/protocol/get-adcp-capabilities-response.json, .agents/playbook.md) with review_decision REVIEW_REQUIRED — human/CODEOWNERS approval required.
- This PR touches a path under a hard, non-overridable approval gate (.agents/playbook.md (modified) matches
.agents/**; static/schemas/source/core/duration.json (modified) matchesstatic/schemas/source/**; static/schemas/source/enums/duration-unit.json (added) matchesstatic/schemas/source/**; static/schemas/source/index.json (modified) matchesstatic/schemas/source/**; static/schemas/source/protocol/get-adcp-capabilities-response.json (modified) matchesstatic/schemas/source/**) 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.
The Python SDK hand-maintains `Unit as DurationUnit` from generated_poc.core.duration, so moving the enum into enums/duration-unit.json fails the "Generate Python SDK" bundle check until adcp-client-python updates its alias. Item 4 of #7478 moves to chore/duration-unit-enum-7478. The changeset stays: scripts/run-storyboards-matrix.sh is release tooling. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Closes #7478.
Summary
Cleans up the pre-existing local hook failures and stale artifacts collected in #7478 so a clean checkout of
maincan pass its own hooks. Nothing here touches the frequency-cap work onmesa-verde(#7438) orfrequency-cap-media-buy-scope(#7449).precommit:server-unitfailures were environment-shaped, not bugs. Conductor's.env.localexportsDEV_USER_EMAIL/DEV_USER_ID(andADMIN_API_KEY/ADMIN_EMAILS) into the shell;server/src/middleware/auth.tsreads them at module load, soDEV_MODE_ENABLEDflipped on and the WorkOS-session path the auth boundary tests exercise was bypassed (authorization-epoch-session,billing-admin-tenant-boundary). The shared vitest setup now scrubs those five variables before every file; tests that exercise the boundaries already set them explicitly invi.hoisted(). Theaddie-routerlive-LLM section ran wheneverANTHROPIC_API_KEYhappened to be set and asserted current model behaviour; it is now opt-in (ADDIE_ROUTER_LIVE_TESTS=1). Its one fixture-backed test spied onliveRouter['client'].messages, a field removed when the router moved to the provider seam; it now runs deterministically throughfakeRouterProvider.get_products.mdxsnippets. Quick Start importedGetProductsResponseSchema, which@adcp/sdkdoes not export; it now consumesresult.datadirectly (the SDK's real schema validator is not public, andvalidateAdCPResponseis a pre-3.x heuristic that would print bogus errors). The authentication comparison, SDK status handling, and continuation-resume blocks are pseudo-code (undefinedagent/helper stubs, TypeScript-only!, top-levelreturn, and a no-auth path the hosted test agent no longer serves); they carrytest=falsewith a sentence above each saying why.scripts/oneof-discriminators.baseline.jsonregenerated (update-rights-responsenote picked upgeneration_credentials/rights_constraint).enums/duration-unit.jsonchange is in draft PR fix(schema): define the duration unit vocabulary once in enums/duration-unit.json #7481. It failed this PR's "Generate Python SDK" bundle check:adcp-client-pythonhand-maintainsUnit as DurationUnitimported fromgenerated_poc.core.duration(src/adcp/types/aliases.py), and the shared enum generates that type asenums/duration_unitinstead, so the SDK alias has to move first. Splitting keeps this PR mergeable now.ADCP_SKIP_STORYBOARD_MATRIX=1, and says CI is authoritative.run-storyboards-matrix.shsnapshots the freshly builtdist/schemas/latestinto amktempdirectory (cleaned on exit) and uses that asADCP_SCHEMA_ROOT, so a concurrentnpm run build:schemascan no longer trip the SDK'sassertSchemaRootMatchesVersionmid-run.test=falseis acceptable, and the local-hook behaviour above.Acceptance (exact commands from the issue)
mainbash scripts/with-timeout.sh 600 npm run precommit:server-unit(three previously failing files)3 passed,109 passed / 28 skipped(live router scenarios skip with the opt-in named in the describe title)npm run test:server-unit612 files, 9363 passed / 31 skippedin 1018s on an idle sandbox. That is above the hook's 600swith-timeoutbudget, so a docs/schema/.agentscommit timed out even with every test green;precommitnow allows 1500s (the same move #6644 made from 240s to 600s). Judgment call, easy to revert.node tests/snippet-validation.test.cjs --file docs/media-buy/task-reference/get_products.mdxPassed: 21, Failed: 1, Skipped: 36. The one failure is Quick Start (line 31): the hosted test agent returnsMCP error -32603: PostgresTaskStore.getTask: database operation failedfor everyget_productscall right now (see below). The four failures named in the issue are gone.node scripts/audit-oneof.mjs --updatethengit status --porcelain scripts/oneof-discriminators.baseline.jsonadcp-client-pythonalias change)CHANGEDforced to a storyboard path: dirty tree → skip message;ADCP_SKIP_STORYBOARD_MATRIX=1→ skip message; SDKregisterExternalSchemaRoot('3.2.0-rc.1', <snapshot>)accepts the copied root.agents/playbook.md→ Schema Compliance and Local HooksAlso run: the other
precommitcomponents (check-image-quality.sh,test:unit70 files / 1059 tests,test:test-dynamic-imports,test:format-identity-boundaries,test:callapi-state-change) all pass;npm run typecheck,npm run lint:schema-links,node tests/docs-nav-validation.test.cjs,node scripts/check-testable-snippets.cjs,node scripts/check-changeset-protocol-scope.cjs origin/main,npx @changesets/cli status --since=origin/main(patch,adcontextprotocol, for the storyboard matrix script, which the scope check classifies as release tooling).Not fixed here (please read)
get_products.test-agent.adcontextprotocol.orgreturnsPostgresTaskStore.createTask/getTask: database operation failedfor every brief, with or withoutidempotency_key, andtestAgentNoAuthgetsAUTHENTICATION_REQUIRED. This is the real cause of the line-1644 failure the issue attributed to the snippet, and it is why Quick Start still fails. The other 21 snippets on the page only pass because they useif (result.success && result.data)and print nothing on failure. This needs an operator look at the training-agent deployment; nothing in this repo's tests can make it green.notification_config_event_scope did not emit a complete result envelope,inconsistent capability selection) were not reproduced; a full matrix run is ~40 minutes on a loaded sandbox. The schema-root snapshot removes one concurrent-rebuild path that can change a shard's capability selection mid-run; the envelope timeout (--timeout-ms 180000) is unchanged.should respond to dashboard link requestsandshould route agent testing requests to agent_qualityreturnedignorefrom the current model when I ran them live. They are now opt-in evals rather than a pre-commit gate; the routing prompt may need a look separately.🤖 Generated with Claude Code