chore(memory): code-clean run, LRN-213/214/215, EVAL-046, BDR-117, journal, TODO, plan + audits
This commit is contained in:
1 parent
84446612ae
commit
8693fff1d8
8 files changed
+473
No files matched your search
@@ -1789,3 +1789,15 @@ Rule: when editing a doctrine file under structure locks, grep the test's lock s
|
||||
- **Context**: W3-A, 2026-10-10. Mid-run, `routing.json` gained decisions nobody expected (verifier → judge, feater → judge). First read: a kit test wrote the real file. Truth (feater, transcript timestamps = file mtimes to the second): the engine had reloaded `register.ts` from the working tree through the `skills/model-router` link, the live mod opened the T2 dialog on MY verifier/feater spawns, the user answered them in the terminal. The kit cannot write: an unmocked `fs.write` is refused ("no implementation"), a throwing mock lands on the same refusal; the real file's sha was stable across 10+ suite runs.
|
||||
- **Apply**: while a mod is under development in this repo, its working-tree code is LIVE in every session (no `/reload-plugins` needed): expect its side effects (dialogs, writes) during the gates; tell the user what dialogs will pop and what to answer; reset the data file deliberately at the gate. Blame the kit last: check mtimes against the transcript before assuming a test leak. Live answers = criterion evidence (record them `[gated]`). Links [[BDR-116]], [[LRN-206]], [[LRN-211]].
|
||||
|
||||
|
||||
## LRN-213 — grep-based dead-function census misses constructed-name callers
|
||||
- **Context**: code-clean 2026-10-12. `detect_gstack` / `detect_plugin_dev` (lib/detect-plugins.sh) had zero literal callers → flagged dead. Real caller: hooks/session-start.sh:80 `if "detect_$plugin"` over a name list. Deleting them = silent hook break on every session start.
|
||||
- **Apply**: before calling a function dead, grep its PREFIX in a quoted-expansion form (`"prefix_$`, `prefix_${`, `eval`, `declare -f`) and any name-list loop. Constructed dispatch = exclude + note in the plan so challengers do not re-raise. Links [[LRN-214]].
|
||||
|
||||
## LRN-214 — shellcheck directive after the first command scopes to that command only; file-wide disable goes BEFORE `set -u`
|
||||
- **Context**: code-clean r1 placed `# shellcheck disable=SC2015` after `set -u` in seo-data.test.sh → two lenses proved via stdin that 26 of 27 sites stay red. Precedent in repo: lib/tests/effort-routing.test.sh:8 (before any command) silences file-wide.
|
||||
- **Apply**: file-level directive = between the shebang and the first command. Prove with `shellcheck` exit 0 on the edited file, not by reading. Links [[LRN-213]], [[LRN-215]].
|
||||
|
||||
## LRN-215 — helper extracted from a `set -e` function must be called as a plain statement; `helper || …` / `if helper` switches errexit OFF inside it
|
||||
- **Context**: code-clean B5/B7/B9 split enable_tool / enable_skill / cmd_show out of `set -euo pipefail` scripts. r2 executor rule said `|| return $?`; confirmation lens: that form disables errexit inside the helper, so a failed `mv` (toggle-external.sh:273) would print `ok …` rc 0 instead of aborting — a path no golden capture sees. Plain call keeps `return 1` → errexit in caller → exit 1 as today.
|
||||
- **Apply**: split rule for -e scripts: plain calls only, never `||`, `&&`, `if`, `!` around an extracted helper. Golden capture (stdout + stderr + rc + fixture tree) before/after for every moved arm when the suite discards output. Links [[LRN-214]], [[EVAL-046]].
|
||||
Reference in new issue
Block a user