Skip to content

Name the worker's own gate in the root instructions, and test that CI's gates stay named - #331

Merged
max-sixty merged 1 commit into
mainfrom
fix/claude-md-worker-gate
Sep 6, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/claude-md-worker-gate

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

worker/ arrived on main yesterday (#313) as a tracked top-level tree with its own TypeScript source, tsc --noEmit typecheck, and vitest suite. The root CLAUDE.md names neither the directory in its repository map nor the gate beside uv run pytest tests — so a session that edits worker/src/routing.ts, runs the documented suite, sees green and lands through wt merge has run no gate over its change at all. ci's website-worker job is the first thing to read it, and on that path it runs after main has already moved, which running-tend calls live.

This names both, and derives the check from ci.yaml rather than from a list, so the next job with a working-directory of its own cannot be added without the paragraph.

What is and is not gated today, measured

uv run pytest tests never reads worker/ — no test file references it:

$ grep -rn "worker/" tests/*.py
(no output)

pre-commit's two JavaScript hooks skip it too. prettier is declared types_or: [javascript, html], and eslint.config.mjs matches **/*.{js,mjs}:

$ uv tool run pre-commit run --files worker/src/routing.ts worker/src/index.ts
prettier.............................................(no files to check)Skipped
eslint...............................................(no files to check)Skipped
eslint (the runtime cycle)...........................(no files to check)Skipped
typos....................................................................Passed

Only ci.yaml's website-worker job runs npm run typecheck and npm test, both with working-directory: worker. A pull request gets that job; wt merge does not, since CLAUDE.md states it runs pre-commit and the everyday suite.

The commands in the new paragraph were run from the repo root before being written down: npm ci --prefix worker, then npm run typecheck --prefix worker (exit 0) and npm test --prefix worker (2 files, 9 tests passed).

The test, and its bug-back

tests/CLAUDE.md asks that a prose assertion derive one side from the machine, and test_the_skill_routes_every_reference_it_ships and test_the_python_instructions_name_every_module_they_own are the sibling shape. The new test reads ci.yaml's working-directory: values and requires each to be named in CLAUDE.md; adding a job with its own tools and no paragraph goes red rather than green.

Reverted to main's CLAUDE.md with the test in place:

AssertionError: unnamed in CLAUDE.md: ['worker']

uv run pytest tests is green on the branch: 891 passed, 6 skipped.

…'s gates stay named

`worker/` arrived as a tracked top-level tree with its own TypeScript, typecheck
and vitest suite. The root CLAUDE.md names neither the directory nor the gate:
`uv run pytest tests` never reads it, pre-commit's prettier and eslint hooks take
JavaScript and HTML rather than TypeScript, and `wt merge` runs only those two —
so a worker change lands unverified and `ci`'s website-worker job reddens main.

Name it in the repository map and beside the suite, and derive the check from
ci.yaml's own working-directory steps so the next such job cannot be added
without the paragraph.
@max-sixty
max-sixty merged commit bd38bb0 into main Sep 6, 2026
4 checks passed
@max-sixty
max-sixty deleted the fix/claude-md-worker-gate branch September 6, 2026 14:42
max-sixty pushed a commit that referenced this pull request Sep 7, 2026
The root instructions say the everyday suite and pre-commit never read
`worker/`, so a worker change is ungated until CI's `website-worker` job
runs. That is true of `worker/src/`, but not of `worker/server.py`,
which both gates already cover — and `worker/server.py` is where the
container adapter lives, including the website-agent turn and reply
endpoints added yesterday. A session that takes the paragraph literally
runs the npm gate, which never touches `server.py`, and skips the suite
that does.

This rewrites both passages to say which half is ungated. No behavior
changes, so there is no regression test to add; the claim is checked
below against the two gates it describes, and the existing
`test_the_root_instructions_name_every_directory_ci_gates_on_its_own`
still passes because `` `worker/` `` stays named in the repository map.

<details><summary>Evidence</summary>

`tests/test_website_server.py` loads the adapter directly rather than
importing a package, so a grep for `import` in the suite does not show
it:

```python
_spec = importlib.util.spec_from_file_location(
    "website_server", ROOT / "worker" / "server.py"
)
```

Both gates, run on this branch:

```
$ uv run pytest tests/test_website_server.py -q
4 passed in 2.09s

$ uv run pre-commit run ruff-check --files worker/server.py
ruff check...............................................................Passed
```

`.pre-commit-config.yaml`'s `exclude` does not name `worker/`, so every
Python hook takes `worker/server.py`. `ci.yaml`'s `website-worker` job
runs `npm ci`, `npm run typecheck`, `npm test`, and the wrangler dry run
— all under `working-directory: worker`, all against the TypeScript
project, none of which reads `server.py`.

The paragraph landed in #331 the day after
`tests/test_website_server.py` landed in #313, so it has been describing
the wrong half since it was written.

</details>

---------

Co-authored-by: leaf-agent <[email protected]>
max-sixty pushed a commit that referenced this pull request Sep 7, 2026
The root instructions say the everyday suite and pre-commit never read
`worker/`, so a worker change is ungated until CI's `website-worker` job
runs. That is true of `worker/src/`, but not of `worker/server.py`,
which both gates already cover — and `worker/server.py` is where the
container adapter lives, including the website-agent turn and reply
endpoints added yesterday. A session that takes the paragraph literally
runs the npm gate, which never touches `server.py`, and skips the suite
that does.

This rewrites both passages to say which half is ungated. No behavior
changes, so there is no regression test to add; the claim is checked
below against the two gates it describes, and the existing
`test_the_root_instructions_name_every_directory_ci_gates_on_its_own`
still passes because `` `worker/` `` stays named in the repository map.

<details><summary>Evidence</summary>

`tests/test_website_server.py` loads the adapter directly rather than
importing a package, so a grep for `import` in the suite does not show
it:

```python
_spec = importlib.util.spec_from_file_location(
    "website_server", ROOT / "worker" / "server.py"
)
```

Both gates, run on this branch:

```
$ uv run pytest tests/test_website_server.py -q
4 passed in 2.09s

$ uv run pre-commit run ruff-check --files worker/server.py
ruff check...............................................................Passed
```

`.pre-commit-config.yaml`'s `exclude` does not name `worker/`, so every
Python hook takes `worker/server.py`. `ci.yaml`'s `website-worker` job
runs `npm ci`, `npm run typecheck`, `npm test`, and the wrangler dry run
— all under `working-directory: worker`, all against the TypeScript
project, none of which reads `server.py`.

The paragraph landed in #331 the day after
`tests/test_website_server.py` landed in #313, so it has been describing
the wrong half since it was written.

</details>

---------

Co-authored-by: leaf-agent <[email protected]>
max-sixty pushed a commit that referenced this pull request Sep 10, 2026
…ule (#543)

`scripts/CLAUDE.md` tells a session that a clean `git status` after
`scripts/vendor.py <bundle>` is the check that a bundle still matches
the script, and that the check holds only where every fetched input is
pinned. It then sorts the bundles into those two classes — and two of
the seven are in neither, so a session rebuilding `floating-ui` or
`mcp-app` has no answer for whether a diff it sees is drift to fix or an
upstream patch to take.

Each belongs in a class the paragraph already describes:

- `floating-ui` reproduces. `@floating-ui/dom`, `@floating-ui/core`, and
`@floating-ui/utils` are all in `PINS`, and that closure is complete:
`dom` depends on `core` and `utils`, `core` on `utils`, `utils` on
nothing. Rebuilding it left `git status` clean.
- `mcp-app` fetches an input `PINS` does not name.
`@modelcontextprotocol/[email protected]` declares `@standard-schema/spec
^1.1.0`, which npm's resolver picks, so the bundle sits with `plot` and
`pierre`. It reproduced when I rebuilt it today — which is exactly the
reading the paragraph exists to keep a session from relying on.

This is drift rather than a deliberate omission. The paragraph dates
from `c7b37062` (2026-08-30); `mcp-app` landed in #188 on 2026-09-01 and
`floating-ui` in #537 last night, and #533 — the most recent commit to
touch the paragraph — added `jsdiff` to it, so it is meant to be kept
current.

The test follows the shape this repo already uses for instruction lists
(#93, #105, #331, #496): it reads the bundle names out of `vendor.py`'s
`BUILDS` and `COPIES` rather than restating them, and asserts each is
named in that one paragraph. On `main` it fails with `unplaced in
scripts/CLAUDE.md: ['floating-ui', 'mcp-app']`.

What it deliberately does not check is *which* class a bundle is placed
in — deciding that means resolving each package's dependency graph,
which is a network call this suite should not make. A name in the wrong
class still needs a reader to catch; a name that is absent no longer
does.

<details><summary>Verification</summary>

- `uv run pytest tests/test_interact_layer.py` — 167 passed, 6 skipped.
- The new case alone, with `scripts/CLAUDE.md` reverted to `main`'s
text: `AssertionError: unplaced in scripts/CLAUDE.md: ['floating-ui',
'mcp-app']`.
- `scripts/vendor.py floating-ui` and `scripts/vendor.py mcp-app` each
left `git status` clean.
- `npm view @floating-ui/[email protected] dependencies` → `{
'@floating-ui/core': '^1.8.0', '@floating-ui/utils': '^0.2.12' }`;
`@floating-ui/[email protected]` → `{ '@floating-ui/utils': '^0.2.12' }`;
`@floating-ui/[email protected]` → none;
`@modelcontextprotocol/[email protected]` → `{ '@standard-schema/spec':
'^1.1.0' }`.

</details>

Co-authored-by: leaf-agent <[email protected]>
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.

2 participants