Commit 00d5494
feat(scripts): gate
npm renders `repository.directory` as a package page's "source" deep link, so a
value naming a directory this repo does not have publishes a 404 on the one link
a consumer follows to read the code. Nothing in this repo read the field:
measured over the tracked tree, zero reads of `.directory` in any `.mjs`/`.mts`,
and `check-published-files.mjs` — which has exactly the right population and
already parses every manifest — mentions `repository` not once. The notch is a
category rather than an off-by-one: this repo gated published package CONTENTS
and did not gate published package PROVENANCE METADATA.
The new gate is a state check over every tracked manifest that DECLARES the
field: the value must be well-formed, must name a directory that is IN the
repository (read off `git ls-files`, because the deep link is served from the
repository and not from the author's working tree), and must be the manifest's
own directory. Stateless over the population on purpose — one of the three
commits behind the known residue moved nothing at all, it edited
`repository.url` in the same JSON object with the stale `directory` line as
visible hunk context, so a rule that fired only on directory MOVES would have
missed it exactly as the reviewers did.
⛔ It judges only manifests that declare the field. Whether declaring is
mandatory for a publishable package is an open policy question and a
maintainer's to answer, so silence is counted, listed and never a finding.
Anti-vacuity, because this population is `git ls-files` plus a field predicate
and empties silently from either side: two control probes drive the same
tracked-directory predicate the invariants use in BOTH directions (a directory
derived from the population must report EXISTS, an assembled impossible one must
report MISSING) and no verdict prints unless both fire; MEASURED pins the census
on a named commit with floors under it; and the `--self-test` carries a battery
roster whose names and per-battery case floors red when a battery stops
registering cases.
Claude-Session: https://claude.ai/code/session_01XpTx2tbq3pZRYAdoGt6E6Y
Co-authored-by: Claude <noreply@anthropic.com>repository.directory against the manifest's own directory (#16446)1 parent ce21963 commit 00d5494
3 files changed
Lines changed: 1028 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3597 | 3597 | | |
3598 | 3598 | | |
3599 | 3599 | | |
| 3600 | + | |
| 3601 | + | |
| 3602 | + | |
| 3603 | + | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
| 3609 | + | |
| 3610 | + | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
| 3619 | + | |
| 3620 | + | |
| 3621 | + | |
| 3622 | + | |
3600 | 3623 | | |
3601 | 3624 | | |
3602 | 3625 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
0 commit comments