Skip to content

fix(skills): the finish line rust-conventions names, and the two steps it forgot - #692

Merged
athvin merged 1 commit into
mainfrom
fix/rust-conventions-finish-line
Nov 6, 2026
Merged

athvin merged 1 commit into
mainfrom
fix/rust-conventions-finish-line

Conversation

@athvin

@athvin athvin commented Nov 6, 2026

Copy link
Copy Markdown
Owner

/skill-audit rust-conventions found two stale facts and three economy/routing
defects. This fixes all five and derives the two that drifted.

The finding that matters

make check is fmt + lint + doc + entities-check + skills-check + test. The
skill whose headline claim is that make check is the finish line said
fmt + lint + entities-check + test, then spent a body paragraph and a
numbered class in references/gates.md explaining that cargo doc is not in
make check and has to be run separately — and its eval gave a session credit
for repeating that. Nothing was red, because prose and a Makefile cannot
disagree loudly.

The step list is no longer prose. gen_rust_gates derives it from the check:
target's prerequisites and each recipe, and the same block carries the size of
the ER_TEST_PG_DSN tier, which the reference put at "roughly thirty" test
files while 52 read that variable.

Same treatment for the clippy allow-list

gen_crate_map now pairs every = "allow" in [workspace.lints.clippy] with
the comment above it, so the reason is Cargo.toml's own words and an allow
added without one shows up as a blank cell. That needed one comment in
rust/Cargo.toml: five style allows sat under the doc-lint comment and would
have inherited a reason that is not theirs. The body keeps only the two allows
that protect correctness rather than taste (float_cmp,
unreadable_literal) — the two that read like bugs to anyone meeting them cold.

Three smaller ones

  • Routing, one-way. ci-and-supply-chain already said "for local gates see
    rust-conventions"; this skill claimed "when adding a dependency" and named
    nobody, so it won the trigger on a bump that is red on an advisory and had
    nothing to say about it. Description tail added, plus eval scenario 6 posing
    exactly that prompt.
  • Duplication. The duckdb/arrow/datafusion pin reasoning was stated in
    the body and again in crate-map.md with neither canonical. The body keeps
    it; the reference points at it and adds only what the body cannot know
    (datafusion is in er-sql-check's manifest, so it is absent from the
    generated pin block).
  • Economy. errors.md dropped the anyhow-vs-thiserror table, which restated
    both crates' own documentation, and kept the repo-specific half.

Verification

  • bash scripts/skills-check.sh all → exit 0, 23 skills, 12 generated files
    current.
  • Observed failing before trusted: added a prerequisite to the check:
    target and the drift check went to exit 1 with
    FAIL generated skill references are stale, diffing the rust-gates block.
    Makefile restored, block regenerated.
  • bash scripts/ci/skills-check-test.sh → 5 passed, 0 failed.
  • make check was not run locally: the only non-skill change is one comment
    line in rust/Cargo.toml, and a cold worktree build costs an hour and ~33GB
    for it. The rust jobs on this PR are the gate for that line.

🤖 Generated with Claude Code

…s it forgot

`make check` has been `fmt + lint + doc + entities-check + skills-check + test`
for a while. The skill whose first claim is that `make check` is the finish line
said `fmt + lint + entities-check + test`, and then spent a paragraph in the
body and a numbered class in `references/gates.md` explaining that `cargo doc`
is *not* in `make check` and must be run separately. Its eval gave a session
credit for repeating that. Nothing went red, because prose and a Makefile cannot
disagree loudly.

So the step list is no longer prose. `gen_rust_gates` derives it from the
`check:` target's prerequisites and each one's recipe, and the same block carries
the size of the `ER_TEST_PG_DSN` tier — which the reference put at "roughly
thirty" test files while 52 of them read that variable.

The clippy allow-list gets the same treatment: `gen_crate_map` now pairs every
`= "allow"` in `[workspace.lints.clippy]` with the comment above it, so the
reason is Cargo.toml's own words and an allow added without a comment appears
here as a blank cell. That needed one comment in `rust/Cargo.toml`, where five
style allows were sitting under the doc-lint comment and would have inherited a
reason that is not theirs. The body keeps only the two allows that protect
correctness rather than taste (`float_cmp`, `unreadable_literal`), because those
read like bugs to anyone meeting them cold.

Three smaller things the same read turned up:

- The description now routes to `ci-and-supply-chain`. That skill already said
  "for local gates see rust-conventions"; this one claimed "when adding a
  dependency" and named nobody, so it won the trigger on a dependency bump that
  is red on an advisory and had nothing to say about it. New eval scenario 6 is
  that prompt.
- The `duckdb`/`arrow`/`datafusion` pin reasoning was stated twice, in the body
  and in `crate-map.md`, with neither marked canonical. The body keeps it; the
  reference points at it and adds only what the body cannot know.
- `errors.md` dropped the anyhow-vs-thiserror table, which restated both
  crates' own documentation, and keeps the repo-specific half: anything reaching
  an exit code or an HTTP status is a `thiserror` enum because `er-errors` is
  that taxonomy.

`crate-map.md` gains the `## Contents` a growing generated block needs before it
crosses 100 lines, and `gates.md` is registered in `generated_files` so the
drift check owns its new block.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@athvin
athvin force-pushed the fix/rust-conventions-finish-line branch from f5911c0 to 681525b Compare November 6, 2026 05:19
@athvin
athvin merged commit e7918ad into main Nov 6, 2026
39 checks passed
athvin added a commit that referenced this pull request Nov 6, 2026
…e deleted live work (#716)

* docs: entities/*.yaml matches nothing — the layout is entities/*/entity.yaml

Nine tracked files told the reader that `er-entity gen` and `er-entity verify`
work from `entities/*.yaml`. That glob expands to zero files: every declaration
is `entities/<name>/entity.yaml`, 49 of them. Anyone who trusted the literal got
an empty expansion and no error, in CLAUDE.md, CONTRIBUTING.md, the Makefile
comment, rust.yml's `entities` job comment, the design doc's layer diagram and
its CLI block, the eslint ignore comment, and the generated crate's manifest
header.

It was shorthand everywhere rather than a typo in one place, which is why it
survived: no single site looked wrong, and nothing executes a comment. The
decision to rewrite all nine rather than leave them is deliberate — a path in
prose that resolves to nothing is the same defect as a stale count, and this repo
does not keep those.

Each file was rewritten with its match count asserted before and after (9
replaced, 0 remaining) rather than by a blind pass over the tree.

Verified beyond the grep, because this touches four languages' worth of comment
syntax: `make -n entities-check` still prints its recipe, rust.yml still loads as
YAML with 16 jobs, `er-entities/Cargo.toml` still parses as TOML,
`frontend/eslint.config.mjs` passes `node --check`, the mermaid fences are still
balanced with the label intact, and `skills-check all` is green (CLAUDE.md is a
splice target, so an edit outside its generated block has to stay outside it).

One instance is deliberately left: `rust-conventions/evals.md` is fixed on the
branch for #703 and touching it here would conflict.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* fix(worktrees): the lsof guard misses most live sessions, and the disk claim was wrong

Two claims in the worktree procedure did not survive being measured against a
clone with 19 worktrees open.

**`lsof -a -p <pid> -d cwd` does not find a live session.** It is proof of
attachment when it hits and proves nothing when it misses, because the dominant
pattern here is a session whose cwd is the PRIMARY checkout driving its worktree
with `git -C <path>` — no descriptor in that directory, nothing for `lsof` to
see. Measured: 15 of 19 worktrees had a commit land in the previous 22 minutes
while only 7 were any process's cwd. One committed 12 seconds before the audit
evaluated it as unattached, and another moved its HEAD between two commands of
the same run. A session following the old procedure literally would have deleted
work in progress.

What catches those is local git activity — the per-worktree `index` and
`logs/HEAD` mtime — plus HEAD resampled at the end of the audit.

**"Each worktree carries its own rust/target, at tens of gigabytes" is false**
as a general claim, and it was the stated reason the prune is non-negotiable. A
worktree only grows a target once something in it compiles; a skills or docs
session that never runs `make check` stays near a gigabyte. Measured: 83GB
across all 19, concentrated in a single 24GB outlier, most carrying no target at
all — while the primary checkout's own target was 132GB, larger than every
worktree combined. The worktree count is a poor proxy for the disk problem.

`scripts/worktree-audit.sh` turns the four guards into one read-only command. It
prints KEEP with reasons or REMOVABLE with the removal line, and never removes
anything: a wrong removal costs another session's unpushed work, which is not a
cost a script should be allowed to pay alone.

Three things learned building it, each now a comment at the site:

- A plain `git status` REFRESHES THE INDEX, so the dirty check overwrote the
  mtime the activity check then read, stamping every worktree "active 0m ago".
  `git --no-optional-locks status` is the fix. The audit was perturbing exactly
  what it measured.
- The age of the commit HEAD points at is not liveness. A worktree cut from a
  week-old commit is brand new; one cut from a commit that landed a minute ago
  may be abandoned.
- `/usr/bin/env bash` on this machine is 3.2.57, where `mapfile`,
  `EPOCHSECONDS` and `declare -A` are runtime failures that `bash -n` does not
  catch. No other script here uses them either.

Verified by discrimination, not just by it running: a synthetic worktree at the
merged #692 squash commit — clean, backdated activity — is reported REMOVABLE
with its removal command, while all 19 live worktrees report KEEP with specific
reasons. Deriving the primary checkout from `--git-common-dir` rather than the
script's own location was needed for that: run from inside a worktree, the
earlier version excluded itself and offered the primary checkout for removal.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: bmoore813 <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[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