Commit 412a703
fix(governance): scan a clean caller tree (don't scan the .standards-checkout tooling) (#466)
## Summary
Third and final piece of the `validate-hypatia-baseline` fix (after #455
wired the filter and #464 made it run). The gate checks out standards'
`scripts/` into `.standards-checkout/` to get `apply-baseline.sh` — but
that directory sits **inside the caller's working tree**, so
`hypatia-cli.sh scan .` scanned it too and reported **standards' own
files as the caller's findings**.
Caught on neurophone#172, where 4 of the 8 "unfiltered" findings were
pure tooling pollution:
```
.standards-checkout/scripts/check-ts-allowlist.ts banned_language (critical)
.standards-checkout/neurosym-a2ml/scripts/bootstrap.sh shell_download (high)
.standards-checkout/agentic-a2ml/scripts/bootstrap.sh shell_download (high)
.standards-checkout/.../rsr-deployer/scripts/bootstrap.sh shell_download (high)
```
None is the caller's code. **Every** adopting repo would inherit these.
## The fix
```bash
cp .standards-checkout/scripts/apply-baseline.sh "$RUNNER_TEMP/apply-baseline.sh"
rm -rf .standards-checkout # <- before the scan
HYPATIA_FORMAT=json … scan . … # now only sees the caller's own tree
…
bash "$RUNNER_TEMP/apply-baseline.sh" …
```
Copy the filter out to `$RUNNER_TEMP` (outside the workspace), delete
`.standards-checkout/`, then scan. hypatia only ever sees the repo under
audit; the tooling can't pollute the finding set.
## Net effect
With **#455** (baseline actually consulted) + **#464** (filter actually
runs) + **this** (clean scan tree), the estate gate finally behaves as
intended: suppress a repo's acknowledged baseline entries, fail on
genuinely-new findings, and never conflate the tooling with the repo.
Opt-in per repo via SHA-pin as before.
Draft pending CI + your review. (As with #455/#464, this job **skips**
on standards' own CI — no baseline here — so it was reasoned through
against neurophone#172's real output.)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_0172RBMz3qYjb1ttzD2i7RNh
---
_Generated by [Claude
Code](https://claude.ai/code/session_0172RBMz3qYjb1ttzD2i7RNh)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 830b0f6 commit 412a703
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
| |||
160 | 168 | | |
161 | 169 | | |
162 | 170 | | |
163 | | - | |
| 171 | + | |
164 | 172 | | |
165 | 173 | | |
166 | 174 | | |
| |||
0 commit comments