Skip to content

evals: spec boundary ratchet; coverage default is zero new test files - #4398

Merged
benjaminshafii merged 1 commit into
devfrom
evals/spec-boundary-ratchet
Sep 4, 2026
Merged

benjaminshafii merged 1 commit into
devfrom
evals/spec-boundary-ratchet

Conversation

@benjaminshafii

Copy link
Copy Markdown
Member

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 with node:fs, or spawn another test runner; only 6 cross a product boundary. Examples: a spec that regex-parses Tailwind classes out of session-page.tsx to "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/specs with testkit test" plus "every runtime-observable change needs a spec verdict" taught agents to wrap anything in test from @openwork/testkit and drop it in evals/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 into pnpm --dir evals test, which CI already runs as test:eval-runner)

  • A new file in evals/specs/ fails CI if it imports ../../apps|packages|ee, or never crosses a product boundary (app(), chrome(), server(), inviteMember(), faultProxy(), spec.world(), or a worlds/ import). A file with no boundary is additionally called out for node:fs / node:child_process; real e2e specs may still use fs/promises for temp dirs and fault injection.
  • 116 legacy files are grandfathered in 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.ts files are in it. --write-baseline regenerates it.
  • Reason tally across the baseline: no boundary 112 · imports product source 69 · reads fs 58 · spawns processes 39.

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 in evals/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).
  • Probe: adding evals/specs/zz-probe.test.ts importing ../../apps/app/src/foo with no boundary call → exit 1 with exactly two errors; removed.
  • Prose changes are inert agent config — no runtime proof, by design. The ratchet is harness tooling covered by the node:test file above, not an evals/specs spec, consistent with the rule it enforces.

…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.
@vercel

vercel Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 4, 2026 6:31am UTC
openwork-den Ready Ready Preview Sep 4, 2026 6:31am UTC
openwork-diagnostics Ready Ready Preview Sep 4, 2026 6:31am UTC
openwork-landing Ready Ready Preview, v0 Sep 4, 2026 6:31am UTC

@diff-warden diff-warden 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.

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
benjaminshafii merged commit 13c282d into dev Sep 4, 2026
27 checks passed
@benjaminshafii
benjaminshafii deleted the evals/spec-boundary-ratchet branch September 4, 2026 06:38
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.
reachjalil added a commit that referenced this pull request Sep 4, 2026
evals/specs now only holds specs that cross a product boundary (#4398,
#4402). The den-web link → desktop parser → composer chip round trip is a
unit contract, so it moves beside chat-link-parse.test.ts as a bun test and
the boundary ratchet is clean again.
reachjalil added a commit that referenced this pull request Sep 4, 2026
evals/specs now only holds specs that cross a product boundary (#4398,
#4402). The den-web link → desktop parser → composer chip round trip is a
unit contract, so it moves beside chat-link-parse.test.ts as a bun test and
the boundary ratchet is clean again.
reachjalil added a commit that referenced this pull request Sep 6, 2026
evals/specs now only holds specs that cross a product boundary (#4398,
#4402). The den-web link → desktop parser → composer chip round trip is a
unit contract, so it moves beside chat-link-parse.test.ts as a bun test and
the boundary ratchet is clean again.

This branch was successfully deployed

4 active deployments
Preview – openwork-landing — 39a5cbba Deployed Sep 4, 2026 by vercel[bot]
Preview – openwork-app — 39a5cbba Deployed Sep 4, 2026 by vercel[bot]
Preview – openwork-den — 39a5cbba Deployed Sep 4, 2026 by vercel[bot]
Preview – openwork-diagnostics — 39a5cbba Deployed Sep 4, 2026 by vercel[bot]
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