Repository navigation
fix(check-instructions): report missing bare and root-level paths (T801 t9, T863) - #197
Merged
Merged
Conversation
…01 t9, T863) A bare relative span was checked only when its first folder existed, so `docs/missing.md` with no docs/ and a root-level `MISSING.md` exited 0. Decide by shape instead: a known file extension or a known top-level folder. Add --ignore-ref and --ignore-ref-file for checked cross-repository references. Tests, the revert test and a corrections line guard it.
bketelsen
approved these changes
Nov 5, 2026
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.
Summary
Plan T801, task t9, repair after the whole-plan check (T863). core#191 merged, but acceptance line 2 failed:
scripts/check-instructions.mjsskipped a backticked span with no/, and skipped a bare relative path whose first folder did not exist. Sodocs/missing.md(with nodocs/) and a root-levelMISSING.mdexited 0.scripts/lib/instruction-hygiene.mjs: newisBarePathShaped(span). A bare span (no~/,/,./,../) is a path when every segment is a plain file name and either the last segment has a known file extension (md,mjs,json,yml,toml,go,mod,sh, … — a short closed list) or the first segment is a known top-level folder (docs,scripts,test,tests,.github,.agents,.memory). A dotted first segment before a/is a host name and is skipped;_test.go-style suffix patterns are skipped.scripts/check-instructions.mjs: a span with no/is checked when it is path-shaped; a bare relative span is checked when its first folder exists (as before) or it is path-shaped. Resolved against--rootand the file's folder, as before.--ignore-ref SPAN/--ignore-ref-file FILE: exact references not to check. The global instruction files name many files of other repositories (go.mod, core'sdocs/tenets.md); the monthly run records the checked ones once instead of exiting 1 every month..github/prompts/instruction-hygiene.prompt.mdstep 1: which spans are checked, and the ignore list.test/check-instructions.test.mjs: 5 new tests (25 in all). The fixture ofprose punctuation inside code spans stays in the sentencenow createsdocs/alpha.mdanddocs/beta.md: it referenced them with nodocs/, which is now (correctly) a dead reference..memory/corrections.jsonl: 1 line (blocker → guard, T801).Risk tier
Risk tier: 1 — a read-only local lint, its tests and a runbook. No workflow, authority, policy or risk path changes; the lint is not in
verify/check.Verification
node --test test/check-instructions.test.mjs: 25/25 pass.make cipasses, rebased onf1b62e0(current main).MISSING.md,mise.toml, from a subfolder) exits 1, and 0 once present;docs/missing.mdwith nodocs/exits 1, and 0 once present;test/e2e/and.github/workflows(no extension) exit 1; plain words and identifiers stay unreported (e.g.,i.e.,v1.2,v1.2.3,1.24,make ci,npm run check,gh,frostyard/core,owner/name#12,origin/main, URLs,github.com/…/x.go, globs,JSON.parse,process.env,.md,_test.go,.env, model names,@scope/pkg);--ignore-refand--ignore-ref-fileskip exact references only.f4fabc5):scripts/check-instructions.mjsandscripts/lib/instruction-hygiene.mjstaken from the basef1b62e0, plus a stubexport function isBarePathShaped() { return false; }so the test file imports; tests kept;node --test test/check-instructions.test.mjs. Result: 5 of 25 fail on assertions —dead docs/missing.md reference fails when docs does not exist (T863),a missing root-level file fails and passes once it exists (T863),a top-level folder name makes an extensionless span a path (T863),--ignore-ref and --ignore-ref-file skip exact references,library extracts spans and skips fenced blocks. The false-positive test passes on both, as it should. Worktree restored and removed.openai/gpt-6.1-sol, codergithub-copilot/claude-opus-5.5): initial review atf4fabc5(basef1b62e0, all 5 paths): Ready, Blocking: none; 1 low finding (the prompt overstated which spans are checked), accepted and fixed in3869bc9. Re-review 1 at3869bc9: Ready, Blocking: none. Budget used: 1 review + 1 re-review.3869bc9;node scripts/check-docs.mjspasses after the prompt fix.New findings on the real targets (data, not fixes)
Read-only runs; only the findings this change adds are listed (the 5 earlier errors in Odrade's plans stay as before).
--root ~/projects/pi-pocket-configonhome/.pi/agent/AGENTS.md,home/.config/pi-pocket-team/agents/,home/.pi/agent/skills/: 26 new errors, all references to files of another repository or of the repository an agent works in. None is dead where the text points:docs/tenets.md(lucilla.md:40),docs/design/quality-loop.md(AGENTS.md:22),docs/design/shared-skills.md(cross-review:27)..github/risk-paths.json(AGENTS.md:17, code-grooming:25, cross-review:91),.memory/corrections.jsonl(AGENTS.md:24, :27),AGENTS.md(code-grooming:29, repo-hygiene:15, :31, :135),go.mod,package.json,Cargo.toml(repo-hygiene:89-94).decisions/decided.md,decided.md(clerk.md:16, :18, the Clerk's home),docs/backups.md,docs/storage.md(moneo.md:48, homewiki),dune.ts(sheeana.md:36, pi-pocket-dune),desk.ts(cross-review:83, pi-pocket-team),docs/agents/skills/,src/data/extensions.json(tamalane.md:20, :27),halogen.service,selfie-halogen.yml(teg.md:34, :36).src/policies/improvement-identifier.md(code-grooming:10, frostyard/yeti).--root ~/agents/odradeonplans/night-muster.md,day-shift.md,schedules.md: 2 new errors,audit/daily.mjsandpackage.json(schedules.md:81, pi-pocket-team files).On core itself:
TEMPLATE.md(AGENTS.md:196, docs/README.md:123) and.svu.yml(docs/README.md:71) are generic names and are now reported; core's skills give many more (their paths are relative to the target repository, as the core#191 body said). Nothing runs the lint on core's files in CI.Suggestion for the monthly run (Odrade's call): keep an ignore file with the checked cross-repository references, or write such paths with their repository (
core:docs/tenets.mdis not checked).Docs housekeeping
.github/prompts/instruction-hygiene.prompt.md); no new doc.