fix(hook): reship SessionStart vault false-positive fix (BUG-022, BUG-023)#171
Merged
Merged
Conversation
…-023) PR #165 merged an empty commit, so both false-positives are still live on main. This reships the real fix plus a regression guard. - BUG-022: check_knowledge_health anchored '^## Last Crystallized:' but the marker is indented when MEMORY.md is embedded in a YAML `content: |` block (the knowledge vault stores it that way), so the date was never parsed and the hook falsely reported "crystallization never run". The anchor now tolerates leading whitespace. - BUG-023: check_vault_baseline required AGENTS.md as a vault critical file, but per ADR-010 AGENTS.md is single-SSOT in dotfiles (deployed, not duplicated to the vault). Removed from critical_files. Guard: tests/session-start-false-positives.bats (4 tests, hermetic — copies the script into a temp dir so the Obsidian-launching vault-health.sh sibling is skipped and the suite runs headless). Incident->guard: the empty merge of #165 meant no test ever proved the fix; there is one now.
mlorentedev
added a commit
that referenced
this pull request
May 30, 2026
…167) (#175) Defect 1 (the hang): the byte-equivalence test runs the full hook across CWDs incl. $HOME/Projects/knowledge. With the vault present, the hook -> vault-health.sh probes via the `obsidian` CLI (PATH), launching the real GUI that never returns headless (40+ min hang, orphaned process tree). Fix (issue option a): setup() shadows `obsidian` with a stub reporting GUI-down, so vault-health exits 2 (already handled by the hook) instead of launching. Now deterministic + hermetic for every test that runs the hook. Defect 2 (stale-baseline false DIFF): compare against origin/main when available (truer baseline than a possibly-stale local main), fallback to main. Verified: bats tests/session-start-config.bats -> 14/14 in ~2s with the vault present (previously hung). Hermetic regression tests for BUG-022/023 already landed in PR #171 (the issue's follow-up). Closes #167.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
PR #165 (same title) merged an empty commit —
git showon the squash shows zero files changed, andorigin/main'sclaude-session-start.shstill carries the un-anchored grep andAGENTS.mdincritical_files. So both false-positives are still live onmain. This reships the real fix that was never committed, plus the regression guard that was missing.What
check_knowledge_healthanchored^## Last Crystallized:, but the marker is indented whenMEMORY.mdis embedded in a YAMLcontent: |block (how the knowledge vault stores it). The date was never parsed → false "crystallization never run". The anchor now tolerates leading whitespace.check_vault_baselinelistedAGENTS.mdas a vault critical file, but per ADR-010AGENTS.mdis single-SSOT in dotfiles (deployed, not duplicated to the vault) → false "Vault baseline FAIL". Removed fromcritical_files.Guard (incident→guard)
tests/session-start-false-positives.bats— 4 hermetic tests:CRYSTALLIZE NEEDED, not "never run")AGENTS.md→ no baseline failureHermetic by copying the script into a temp dir so the Obsidian-launching
vault-health.shsibling is skipped — runs headless without the hang that affectssession-start-config.bats.Verification
bats tests/session-start-false-positives.bats→ 4/4 passshellcheckclean on changed lines;bash -nOK