git:20261030.d1f7102 to git:20261119.ce1f6a0

4 added, 1 removed. Audit A to A.

What this update changes in the checks

No check changed: every fixed check gives the same answer before and after this update.

A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.

# mac-agent-hygiene — notes for agents working on this plugin
## Architecture
- `scripts/hygiene.sh` is the only place that decides what is removable. `check_item <category> <path>`
is called by `plan` (labels candidates) and again by `apply` (re-validates every path in the plan
file before removing). Do not add a second code path that deletes.
- `server/index.js` frames stdio JSON-RPC for MCP with no dependencies. It keeps plans in memory for
30 minutes keyed by a hash of the remove-set; `hygiene_apply` requires a live `plan_id` and
`confirm: true`, writes the remove-set to a 0600 temp file and calls `hygiene.sh apply`.
- `scripts/install-launchd.sh` copies `hygiene.sh` to `~/.local/share/mac-agent-hygiene/` (stable path;
the plugin cache path moves on every update), renders `launchagent.plist.template` by bash
substitution (no sed — `&`/`#` in `$HOME` are safe), then `bootout` + `bootstrap` (retried) and
verifies the loaded job path. It adopts (unloads) the hand-rolled predecessor `com.opsagents.dev-cache-cleanup` if present.
## Invariants (do not relax)
- Browser profiles: cache-subfolder allowlist only; profile with `SingletonLock` or open files skipped.
- Worktrees: linked (`[ -f .git ]` AND git-dir ≠ common-dir), in scope (direct child matching
`HYG_WT_GLOB`, or ≤ `HYG_WT_DEPTH` deep under a `HYG_WT_NESTED` dir), untouched > age, nobody's cwd,
- clean, and pushed / merged-PR head / merged PR on the same branch whose commits cover every local-only
+ not locked, clean (or dirty ONLY with the fixed agent-scaffold shapes in `wt_scaffold_path`, whose
+ `docs/qa/<id>` must be an id the worktree declares, archived and verified before removal and restored
+ if the remove fails; card d9GJrXfc), and pushed / merged-PR head / merged PR on the same branch whose commits cover every local-only
commit subject. `gh` failure ⇒ keep. Never `--force`. macOS `/bin/bash` is 3.2: no `declare -A`;
per-repo gh results are cache files in `$TMPD`.
- DerivedData skipped while Xcode builds. Never sudo. Paths outside `$HOME` refused at apply.
- System binaries by absolute path; explicit PATH in the plist; `mktemp` with a `${TMPDIR:-/tmp}` template.
- Paths compared as fixed strings (never a grep pattern); `.`/`..` components refused at the apply gate; every
category checks `dirname`/`basename`, not a glob across `/`. Environment > config file > defaults.
## Testing
```bash
bash -n scripts/*.sh && node --check server/index.js
bash tests/hygiene-worktrees.test.sh # fixture git repos + stubbed gh; runs on Linux too
bash tests/hygiene-wt-scan-roots.test.sh # default scope incl. ~/code/_worktrees, keep rules, status count
+ bash tests/hygiene-wt-scaffold.test.sh # agent-scaffold-only dirt: archived, then removed; real dirt kept
bash tests/hygiene-keeps-logins.test.sh # macOS only
bash scripts/hygiene.sh status
bash scripts/hygiene.sh plan | awk -F'\t' '{print $1, $2, $4}' | sort | uniq -c
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05"}}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | node server/index.js
```
## Known issues
- The SingletonLock check is existence-only; a stale lock from a crashed browser makes that profile
skip forever (safe, silent). Classifying stale locks is a possible follow-up — never by deleting the lock.
- Merged-PR detection is GitHub-only (`gh`). Other forges fall back to pushed-only.