chore(memory): G3 fixed, contract and plan, journal
This commit is contained in:
1 parent
8c284f76a3
commit
b3bc4e0c76
3 files changed
+66
No files matched your search
@@ -711,3 +711,4 @@ rules:
|
||||
- 2026-11-09: BDR-125 residual measured: 30.2k→40k = Skills +6.2k (budget paid claude.ai-synced skills) + System tools (unattributable). /feat claude-ai-skills-off: global skillOverrides 19 off, 47438f4 + 07406ce; GATE 0 MET, verifier ECARTS(1)→CONFORME, security PASS. User removed claude.ai connectors. BDR-141, LRN-270/271. Merge on signal; next: dead deniedMcpServers cleanup.
|
||||
- 2026-11-09: /ship-feature connector-deny-cleanup (chore): dead higgsfield deniedMcpServers + census rule + prose citers removed, 12 files, T13 deny-set test; challenge 3x SOLID, verifier ECARTS x2 (revert hint) -> CONFORME, security PASS x3, opus review fixes. BDR-134 amended, LRN-272/273. Merge on signal.
|
||||
- 2026-11-09: /code-clean BDR-125 obsolescence pass: phases 0/1/2 clean, 4a-4d code clean, 5 all declared artifacts gone; 2 dead sources + 5 stale comments fixed; challenge FATAL x3 on r1 (A2 bench importer, B9 unique security rules, prompt edits = behavior) -> r2; bugs G1-G5 logged, D1-D6 queued in TODO.
|
||||
- 2026-11-09: /hotfix G3 digest journal: _digest_journal awk skips <!-- --> blocks (opener anchored line start, END guard), SD18 3 checks; challenge MAJOR x2 (unanchored opener) folded; template untouched; security PASS.
|
||||
@@ -0,0 +1,22 @@
|
||||
# CONTRACT — digest-journal-comment
|
||||
- date: 2026-11-09 | flow: hotfix | branch: bugfix/digest-journal-comment
|
||||
- status: active
|
||||
|
||||
## REQUEST (verbatim — IMMUTABLE)
|
||||
G3 from .claude/audits/BUGS-FOUND.md (code-clean 2026-11-09): hooks/session-start.sh:404-408 `_digest_journal` greps `^- ` without skipping HTML comments; templates/memory/journal.md:19-21 holds `- <line …>` bullets inside `<!-- -->`, so a project born from the template prints "- journal: <line 3-5 max>" in the session digest until its first journal write. Fix in the digest (skip lines inside `<!-- … -->` blocks) so the template stays byte-identical (it is copied by onboarder/init-project and memory.sh upgrade). Regression test in lib/tests/session-digest.test.sh with a fixture journal built from templates/memory/journal.md: digest prints no journal line (or the real last entry once one exists). Mark the BUGS-FOUND entry FIXED. make test needs GATES_TIMEOUT=600 + PATH=$HOME/.bun/bin:$PATH.
|
||||
|
||||
## CLARIFICATIONS
|
||||
Q: oracle 2 "shellcheck clean"? / A: corrected to `shellcheck -S warning` (orchestrator, 2026-11-09): develop already exits 1 on info notes (SC1091); the new SC2016 info is the intended literal backticks of SD18-inline-marker.
|
||||
|
||||
## ACCEPTANCE CRITERIA
|
||||
1. Symptom gone: a project whose journal.md is a byte copy of templates/memory/journal.md gets no `- journal:` line in the digest; once a real entry is appended after the comment, the digest shows that entry; the template is unchanged.
|
||||
CHECK: cd /home/bchanot/Documents/claude && git diff --quiet develop -- templates/memory/journal.md && make test suite=lib/tests/session-digest.test.sh 2>&1 | tail -1 | grep -q 'all suites green' && grep -q 'SD18' lib/tests/session-digest.test.sh && echo SYMPTOM-GONE
|
||||
EXPECT: SYMPTOM-GONE
|
||||
EVIDENCE: MET exit=0 marker-found :: SYMPTOM-GONE
|
||||
2. Build/tests green (full suite, GATES_TIMEOUT=600, bun on PATH); shellcheck clean on hooks/session-start.sh and lib/tests/session-digest.test.sh.
|
||||
CHECK: cd /home/bchanot/Documents/claude && shellcheck -S warning hooks/session-start.sh lib/tests/session-digest.test.sh && make test 2>&1 | tail -1 | grep -q 'all suites green' && echo GREEN
|
||||
EXPECT: GREEN
|
||||
EVIDENCE: MET exit=0 marker-found :: GREEN
|
||||
|
||||
## FILE SCOPE
|
||||
hooks/session-start.sh (`_digest_journal` only), lib/tests/session-digest.test.sh (new SD18 case); bookkeeping: .claude/audits/BUGS-FOUND.md (FIXED line)
|
||||
@@ -0,0 +1,43 @@
|
||||
# FIX — digest-journal-comment (/hotfix, 2026-11-09)
|
||||
|
||||
Contract: .claude/tasks/contracts/2026-11-09-digest-journal-comment-1810.md
|
||||
|
||||
## Root cause
|
||||
hooks/session-start.sh `_digest_journal`:
|
||||
```bash
|
||||
last=$(grep '^- ' "$1/.claude/memory/journal.md" | tail -1)
|
||||
```
|
||||
picks the last `- ` line of the file, including the example bullets inside the template's HTML comment (templates/memory/journal.md:14-22: `<!-- Append new date-heading entries below. Template:` … `- <line 1>` `- <line 2>` `- <line 3-5 max>` … `-->`). `memory.sh journal` appends real entries AFTER that comment, so the bug shows only until the first write.
|
||||
|
||||
## Edit 1 — hooks/session-start.sh `_digest_journal`
|
||||
Replace the grep line with an awk that tracks HTML comment BLOCKS (r2 after challenge: opener anchored to line start, CommonMark rule; an inline `<!--` inside a bullet is text, not a block):
|
||||
```bash
|
||||
last=$(awk '/^[ \t]*<!--/ { c = 1 } !c && /^- / { l = $0 } /-->/ { c = 0 }
|
||||
END { if (!c) print l }' "$1/.claude/memory/journal.md")
|
||||
```
|
||||
A block opens only on a line that starts with `<!--` (after optional blanks); bullets start with `- ` so they never open one. A single-line `<!-- x -->` opens and closes on the same line. An unclosed block at EOF prints nothing (END guard). `[ -n "$last" ] && echo …` unchanged: empty → no journal line. Missing file: awk prints an error to stderr and nothing to stdout, same as grep did (the hook runs with stderr not shown in the digest; unchanged behavior).
|
||||
|
||||
## Edit 2 — lib/tests/session-digest.test.sh new case SD18 (before SD15, which must stay last)
|
||||
```bash
|
||||
# SD18: a journal born from the template prints no journal line (the
|
||||
# example bullets sit in an HTML comment); a real entry appended after the
|
||||
# comment is the one shown (G3, code-clean 2026-11-09)
|
||||
p=$(mkproj sd18)
|
||||
cp "$ROOT/templates/memory/journal.md" "$p/.claude/memory/journal.md"
|
||||
check SD18-template-no-journal "$(run "$p" "$WORK/startup.json" | digest | grep -c '^- journal:')" 0
|
||||
printf '\n## 2026-11-09\n\n- real entry\n' >> "$p/.claude/memory/journal.md"
|
||||
check SD18-real-entry "$(run "$p" "$WORK/startup.json" | digest | grep '^- journal:')" '- journal: real entry'
|
||||
printf -- '- note on `<!--` parser\n- newest\n' >> "$p/.claude/memory/journal.md"
|
||||
check SD18-inline-marker "$(run "$p" "$WORK/startup.json" | digest | grep '^- journal:')" '- journal: newest'
|
||||
```
|
||||
Red before the fix: SD18-template-no-journal gets 1 (prints `- journal: <line 3-5 max>`).
|
||||
Note: with no BLK, no TODO and no journal line, the digest block may be absent entirely; `grep -c` then prints 0 (exit 1 ignored inside $()), which is the wanted result.
|
||||
|
||||
## Edge cases
|
||||
- Comment block with no closing `-->`: everything after is comment and END prints nothing (no stale line).
|
||||
- Inline `<!--` inside a bullet (in backticks or not): not a block opener (anchored regex); covered by SD18-inline-marker.
|
||||
|
||||
## Edit 3 — bookkeeping (orchestrator, not the executor)
|
||||
.claude/audits/BUGS-FOUND.md, under the G3 entry ("hooks/session-start.sh:404-408 (`_digest_journal`)…"): add a continuation line ` FIXED 2026-11-09 (/hotfix, bugfix/digest-journal-comment): the digest skips HTML comment blocks (opener anchored at line start); the template stays byte-identical (copied by onboarder/init-project/memory.sh), so "fix template and digest together" was not needed.`
|
||||
- Real bullets before the comment (v1 journals that put entries above): still captured (c=0 before the comment).
|
||||
- Template unchanged (criterion 1 checks `git diff --quiet develop -- templates/memory/journal.md`).
|
||||
Reference in new issue
Block a user