Skip to content

Harness score: class-only tests are left out of the headline and must each have a passing successor - #3387

Merged
mattzcarey merged 4 commits into
mainfrom
slim/harness-class-only
Nov 27, 2026
Merged

mattzcarey merged 4 commits into
mainfrom
slim/harness-class-only

Conversation

@mattzcarey

@mattzcarey mattzcarey commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

The harness score can now leave class-only tests out of its headline and check that each has a successor. The list is empty in this PR, so the score does not change; each group adds its rows in the PR that writes the successors.

This follows arch's ruling for the harness gap: a Think test that reaches its behaviour through something private to the class (a row seeded in a private shape, a private method, a private timing seam) gets a successor through the public API that runs on both configs, is marked class-only, and is deleted with the class code.

What changes

  • packages/think/harness-class-only.json (new, []): a list of { file, test, reason, successor: { file, test } }. file is relative to src/tests, test is the full name as the score writes it (describe > … > name), and reason names the private row, method or seam.
  • scripts/harness-class-only.ts (new): reads the list, checks it against a run, and renders the table.
  • scripts/harness-compat.ts:
    • a listed test is left out of needThink and needThinkPassed; the per-file counts and passing in the json are unchanged, so per-file comparisons still work;
    • the json gains classOnly, the count;
    • the console line and harness-compat.md print the score as N of M (K class-only, each with a successor), and the md ends with the class-only table (old test, what it reaches, successor) when the list is not empty.
  • The list must hold, in pnpm test:harness and in --check. The run exits 1, and writes nothing, when:
    • an entry has no file, test, reason or successor;
    • a listed test no longer exists (its row should go);
    • a successor does not exist, is class-only itself, does not pass on the harness-backed Think in the same run, or passes when Think cannot be constructed (it would not exercise Think);
    • a listed test passes on the harness-backed Think (then it is not class-only, and its row should go; listed tests still run);
    • a successor stands for more than four listed tests (the counts are printed);
    • a test is listed twice.

A successor's pass on the class config is the ordinary suite's (pnpm test:workers, which CI runs); the md says so.

Checked

  • The list logic against a synthetic list and run (one-off script, not committed): each of the failures above is reported, a valid pair passes, and an empty or missing file is an empty list.
  • pnpm test:harness regenerated harness-compat.md and harness-compat.json with the empty list: 321 of 1299 (0 class-only, each with a successor) tests that construct Think pass (24%); 616 of all 1594. The recorded score was 294 of 1296; the difference is what has merged on main since it was last recorded, not this PR.

One test left the recorded baseline, and it is a real regression on main, not this PR: durable-admission.test.ts > … > runs however long it waited: its question is never dropped passed when the score was last recorded (#3349) and now fails on the harness-backed Think every time (3 of 3 alone: expected 'two' to be 'q0 q1 q2 '). test:harness:check is not run in CI, so nothing flagged it. I have reported it to the harness's owner; regenerating records what main does today.

There is no test suite for scripts/, so none is added.

For takers

Add your rows to harness-class-only.json in the PR that adds the successors, and state the class-only count before and after next to the score.

@changeset-bot

changeset-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 63c616b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@3387

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@3387

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@3387

hono-agents

npm i https://pkg.pr.new/hono-agents@3387

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@3387

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@3387

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@3387

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@3387

commit: 63c616b

devin-ai-integration[bot]

This comment was marked as resolved.

@agent-think

agent-think Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ agents import sizes: no significant changes (ab1a9f8d → 63c616b2, workflow run)

…is not class-only, and one successor stands for at most four
devin-ai-integration[bot]

This comment was marked as resolved.

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