Skip to content

Commit 900c487

Browse files
committed
fix(docs-audit): scope the dot-directory prune premise to the files the walk collects
`walkSourceFiles` prunes every dot-directory under `packages/**` as build residue, and `--self-test` re-measures the premise that makes that safe rather than quoting it. The premise was stated over ALL tracked files, but the walk collects `.ts` and nothing else, so it was strictly stronger than the property the prune rests on. The blank project template now commits `.github/workflows/ci.yml` — a template asset this audit has never had a reason to read — which reds the pin while the prune's actual safety is untouched. A false positive about a real premise is the shape most likely to get a good pin deleted, so the measurement is scoped to the extension the walk collects and stays armed for the first tracked `.ts` under a dot-directory, which is the case the comment describes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PbJ5Cy9KDAzeQHo8bsMadG
1 parent b2a4d6d commit 900c487

2 files changed

Lines changed: 44 additions & 14 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
"create-objectstack": minor
3+
---
4+
5+
Scaffolded projects now ship a CI workflow. The blank template carries
6+
`.github/workflows/ci.yml` — one job, on `push` and `pull_request`: checkout,
7+
pnpm, Node 22, `pnpm install --frozen-lockfile`, then `pnpm validate` and
8+
`pnpm typecheck`.
9+
10+
The scaffolder already created `.github/` at runtime for a single file
11+
(`copilot-instructions.md`) while the template's gates shipped as npm scripts
12+
nothing ever ran, so a fresh project started with no CI at all — and ObjectStack
13+
metadata mistakes fail silently at runtime, which makes `objectstack validate`
14+
the only place they surface early. That gate is now unskippable for a human and
15+
for an AI agent authoring metadata in the project, instead of advisory.
16+
17+
Existing projects are unaffected; copy the file from a fresh scaffold to adopt
18+
it.

scripts/docs-audit/affected-docs.mjs

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,12 +2115,16 @@ function walkSourceFiles(root, readDir = readdirSync) {
21152115
//
21162116
// Naming the two (three) directories would fix today and leave the next emitted
21172117
// tree to be discovered the same way, so the rule is the class. It is safe because
2118-
// it is MEASURED, not assumed: on `6b8c67778`,
2119-
// git ls-files 'packages/**' | grep -cE '(^|/)\.[^/]+/' → 0
2120-
// no TRACKED file under `packages/**` lives in a dot-directory at all, so this
2121-
// prunes residue and nothing else. That premise is not left to age quietly — the
2122-
// live pin in `--self-test` re-measures it on every run and reds the day a tracked
2123-
// source file appears under one.
2118+
// it is MEASURED, not assumed:
2119+
// git ls-files 'packages/**' | grep -E '(^|/)\.[^/]+/' | grep -c '\.ts$' → 0
2120+
// no TRACKED file this walk would COLLECT lives in a dot-directory, so this prunes
2121+
// residue and nothing else. The measurement is scoped to `.ts` because that is the
2122+
// only extension the walk collects: `packages/create-objectstack` commits a
2123+
// `.github/workflows/ci.yml` inside its bundled project template — a template asset
2124+
// this walk has never had a reason to read — and a premise stated over ALL tracked
2125+
// files reds on that while the prune's actual safety is untouched. That premise is
2126+
// not left to age quietly — the live pin in `--self-test` re-measures it on every
2127+
// run and reds the day a tracked SOURCE file appears under one.
21242128
//
21252129
// Applied to DIRECTORIES only: a dotfile that is somehow a `.ts` source is still
21262130
// the file arms' business, not this one's.
@@ -5708,16 +5712,24 @@ function selfTest() {
57085712
// (4) THE PREMISE OF THE DOT-DIRECTORY PRUNE (#15446 / #15457), RE-MEASURED rather
57095713
// than quoted. `walkSourceFiles` prunes every dot-directory under `packages/**` as
57105714
// build residue; that is a safe rule only while no TRACKED source lives in one —
5711-
// zero of them do, measured on `6b8c67778`. Written as a comment the measurement
5712-
// would age in silence and the walk would start dropping real source with nothing
5713-
// saying so. Asserted here it reds on the first tracked file under a dot-directory,
5714-
// and the remedy is then a choice made deliberately: move the file, or go back to
5715-
// pruning the residue trees by name.
5715+
// zero of them do. Written as a comment the measurement would age in silence and the
5716+
// walk would start dropping real source with nothing saying so. Asserted here it reds
5717+
// on the first tracked SOURCE file under a dot-directory, and the remedy is then a
5718+
// choice made deliberately: move the file, or go back to pruning the residue trees by
5719+
// name.
5720+
//
5721+
// Scoped to `.ts`, the only extension the walk collects, and NOT a weakening: the
5722+
// property the prune rests on is "nothing this walk would have collected is hidden by
5723+
// it", and a non-`.ts` file was never collectable. Stated over all tracked files the
5724+
// pin reds on a template asset — `packages/create-objectstack` commits
5725+
// `src/templates/blank/.github/workflows/ci.yml`, a file a scaffolded project needs
5726+
// and this audit has no interest in — which is a false positive about a real premise,
5727+
// the shape most likely to get a good pin deleted.
57165728
const trackedDotDirFiles = sh('git ls-files packages')
57175729
.split('\n')
5718-
.filter((f) => /(^|\/)\.[^/]+\//.test(f));
5719-
check('walkSourceFiles', 'no TRACKED file under packages/** lives in a dot-directory — the premise the prune rests on',
5720-
'git ls-files packages, filtered to dot-directories', 0, trackedDotDirFiles.length);
5730+
.filter((f) => /(^|\/)\.[^/]+\//.test(f) && f.endsWith('.ts'));
5731+
check('walkSourceFiles', 'no TRACKED .ts source under packages/** lives in a dot-directory — the premise the prune rests on',
5732+
'git ls-files packages, filtered to .ts under dot-directories', 0, trackedDotDirFiles.length);
57215733
}
57225734

57235735
// ── The floor: every declared battery RAN, and ran its cases (#13489) ───

0 commit comments

Comments
 (0)