Repository navigation
evals: spec boundary ratchet; coverage default is zero new test files - #4398
Merged
Merged
Conversation
…w files New files in evals/specs must observe the product through a boundary (app(), chrome(), server(), spec.world(), or a world import) and may not import product source; files with no boundary are also flagged for node:fs and node:child_process. 116 legacy files are grandfathered in boundary-ratchet.baseline.json, which can only shrink. Orchestrator, write-a-spec, and AGENTS.md now say: decide covered / journey gap / pure function before planning a test; default is zero new test files; unit tests are not proof and never live in evals/specs.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (39a5cbba8503c6fc32c894cf86a8264cb0c4060b). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
benjaminshafii
pushed a commit
that referenced
this pull request
Sep 4, 2026
… module (#4404) #4390 added evals/specs/dashboard-element-identity.test.ts, which imports den-web source; #4398 landed minutes later with the spec boundary ratchet whose baseline predates that file, so dev's openwork-tests-unit went red on the combination. Unit tests belong beside the module they test: run it in den-web's bun suite and drop it from evals/specs.
2 of 3 tasks
This branch was successfully deployed
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.
Why
In the last 30 days agents added 563 test files. Of the 124 PR-lane files in
evals/specs, 102 import product source, read the repo withnode:fs, or spawn another test runner; only 6 cross a product boundary. Examples: a spec that regex-parses Tailwind classes out ofsession-page.tsxto "prove" a badge fits, and one that spawns den-web's bun tests and asserts they reported N passes.The rules caused this. "The only proof path is
evals/specswith testkittest" plus "every runtime-observable change needs a spec verdict" taught agents to wrap anything intestfrom@openwork/testkitand drop it inevals/specs. The orchestrator's "every 'test X' request starts with a spec plan" assumed the answer was always a new file.What
Boundary ratchet (
evals/scripts/spec-boundary-ratchet.mjs, wired intopnpm --dir evals test, which CI already runs astest:eval-runner)evals/specs/fails CI if it imports../../apps|packages|ee, or never crosses a product boundary (app(),chrome(),server(),inviteMember(),faultProxy(),spec.world(), or aworlds/import). A file with no boundary is additionally called out fornode:fs/node:child_process; real e2e specs may still usefs/promisesfor temp dirs and fault injection.evals/specs/boundary-ratchet.baseline.json. The baseline only shrinks: a stale entry is an error, a now-clean entry is a warning. Zero.e2e.test.tsfiles are in it.--write-baselineregenerates it.Coverage default flipped to zero new files (inert agent config)
orchestrator.md: "Test scenarios (strict)" → "Coverage decision": before planning a test decide covered (run the journey spec) / journey gap (extend it; new file only for a new journey) / pure function (colocated unit test, not evidence). "No spec covers this" is a finding, not a license.write-a-spec: new "Do not write one when…" section first; one spec per user journey, not per PR; bug fixes add an assertion to the journey they escaped from.AGENTS.md: proof is a journey spec; unit tests are not proof and never live inevals/specs.evals/README.md: documents the ratchet and the cleanup intent.Not in this PR: the cleanup of the 116 baselined files (delete / move next to module / fold into a journey spec). That is a separate PR with a reviewed list.
Verification
pnpm --dir evals test— exit 0; 232 pass,spec-boundary-ratchet: 169 specs checked, 0 errors.node --test evals/scripts/spec-boundary-ratchet.test.mjs— 10 pass (each detector ± , world import counts as boundary, fs allowed with a boundary, grandfathered/stale/clean baseline paths).evals/specs/zz-probe.test.tsimporting../../apps/app/src/foowith no boundary call → exit 1 with exactly two errors; removed.node:testfile above, not anevals/specsspec, consistent with the rule it enforces.