🔧 Auto-commit from sysupdate on 2026-05-19 21:49

This commit is contained in:
David F Glidden
2026-05-19 21:49:14 +02:00
parent e9e772d69c
commit f83aae27c5
132 changed files with 14728 additions and 38 deletions
+419 -1
View File
@@ -284,4 +284,422 @@ reviewed by jurist, authorized by steward.
Both now filed as standalone constitutional
declarations completing the preamble triad
alongside CD-03 (Observer Condition).
**Status:** CLOSED
**Status:** CLOSED
---
## PENDING-18 — Fix H3: Temporal stats fallthrough on text queries
**Date:** 2026-05-14
**Tag:** [HARDENING]
**GH issue:** CapableMind-ai/betterMemories_app #166 (priority:high, OPEN, opened 2026-04-21)
**Summary:** `parseTemporalQueryParams` (`src/modules/temporal/queries.ts:309-372`) has two fallthrough routes that both default to `temporal_stats`: line 311 when `filters.type` is missing/null, and line 370-371 when `filters.type` is unrecognized. Both routes silently fire `getTemporalStats(db)` and return a graph-stats blob (`total_nodes`, `total_edges`) as content. Every text query that fans out to temporal receives this stats blob in its result set at confidence 0.5 (default fallback in `query-router.ts:551`).
**Rationale:** Per April 19 audit (`capablemind/docs/thinking/David/l1-reliability/l1-diagnostic-branch-addendum-2026-04-19.md` §3), this is one of four H-issues in the addendum's cross-cutting "read path lacks honest-degradation contract" pattern. Single-module, scoped, mechanical. Verified unchanged in current main `f0be2d8`. H1 already shipped (#163/#164); H2 (battery suppression) and H4 (hook recall pollution) are architectural design calls that warrant steward+Seb conversation, not executor PR. **H3 is the one mechanical-shape item left from the addendum that fits the L1 fix-plan's one-PR-per-H-issue-bring-Seb-relief discipline.**
**Reproduction (current main `f0be2d8`):** Calling `handleTemporalQuery` with a request whose `filters.type` is unset returns `[{nodes_total: ..., edges_total: ..., ...}]` as if it were content; monotonic counter growth confirms live stats execution per call. Test file `src/modules/temporal/__tests__/temporal-query-status.test.ts` exists with the right pattern (`handleTemporalQuery` invoked directly with crafted `ModuleQueryRequest`); H3 regression cases would extend it.
**Options:**
1. **Module-level guard at parseTemporalQueryParams (recommended).** ~6-line change. Both fallthrough routes return `null`; `handleTemporalQuery` checks for `null` and returns honest empty `{status: 'ok', results: [], total: 0}`. Preserves stats handler for explicit `filters.type === 'temporal_stats'`. Minimal blast radius; closes both fallthrough sites with one guard.
2. **Module-level guard in handleTemporalQuery before parse.** Symmetric to (1) but at the entry point. Slightly larger surface (entry-point catalogue of known types vs. delegating to the existing parse function which already enumerates them).
3. **Planner-level exclusion** (per addendum §3 design question). Drop temporal from text-query dispatch templates in `query-planner.ts:filterAndBuildDispatches`. Cleaner architecturally — temporal isn't relevantly answerable from free text — but larger scope, touches the dispatch matrix, more cross-module reasoning required, harder for Seb to review in 30 min.
4. **New handler `temporal_content_search`.** Out of scope; bigger lift; not needed to close the silent-fallthrough.
**Recommendation:** Option 1. Smallest fix; closes both fallthrough routes; honors honest-degradation per the addendum's structural framing; fits one-PR-per-H-issue per L1 plan discipline.
**Files affected:**
- `src/modules/temporal/queries.ts` — `parseTemporalQueryParams` returns nullable; `handleTemporalQuery` early-returns on null
- `src/modules/temporal/__tests__/temporal-query-status.test.ts` — extend with two new test cases (missing `filters.type`, unrecognized `filters.type`)
- Spec amendment (amendment-first per David CLAUDE.md): `capablemind/docs/thinking/David/l1-reliability/h3-temporal-fallthrough-amendment-2026-05-14.md`
**What this does NOT solve:**
- **H2** (battery silent-fail on query embed) — separate PENDING-N+1 for steward-Seb design call (default policy / visible degradation / CPU fallback / query-vs-ingestion asymmetry)
- **H4** (hook recall pollution + logchain accumulation) — separate PENDING for steward-Seb design call
- **Cross-cutting `[PROPOSAL]`**: read-path needs honest-degradation contract analogous to write-path's cursor + error_count + last_processed_at. Bigger architectural item; jurist territory before draft.
- The 218 silently-dropped vector notes from over-context embeds — separate concern (PR #126/#163 is closed; `ac1673f` "fix: survive over-context embed batches + drop char cap to 1000" addresses ingestion-side; the silent-drop reporting gap is part of cross-cutting)
**Connection to authorized work:** REVIEWED-19 (Epistemic Integrity, PENDING-17) authorized recall-correctness improvements as L0 readiness. H3 fix is a small concrete instance of that broader commitment — recall path stops returning a stats blob at confidence 0.5 dressed as content. Tag commit body with REVIEWED-19 reference where relevant.
**Risk surface:** Low. Bounded to one parse function + one handler entry guard. The two test cases reproduce the symptom; full ~2,300 test suite + `npm run check` + `npm run lint` per BMF CLAUDE.md before push. No schema change, no spec-version bump unless steward wants the temporal-module-spec amended for clarification of the empty-result contract on missing filter type.
**Awaiting:** Steward + jurist authorization. On AUTHORIZE: amendment first per David-CLAUDE.md amendment-then-spec-then-code workflow; branch `fix/h3-temporal-text-query-fallthrough` from main; failing tests red on main; minimal Option 1 fix to green; PR for Seb's review (designed to merge in <30 min of his attention).
**Status (2026-05-14):** AUTHORIZED via REVIEWED-20 (with v1.8 version-bump modification per jurist). Implementation completed same day. PR #172 opened against `CapableMind-ai/betterMemories_app` — closes #166. Spec amendment landed on `CapableMind-ai/capableMind_docs` main @ `1d19856`. Awaiting Seb's review of PR #172.
---
## PENDING-19 — H2: Battery-power suppression silently fails recall (design-call)
**Date:** 2026-05-14
**Tag:** [PROPOSAL]
**GH issue:** CapableMind-ai/betterMemories_app #165 (priority:**critical**, OPEN, opened 2026-04-23)
**Summary:** When on battery, query-time embed throws `"Embedding suppressed: running on battery power"` (`src/inference/ollama-embeddings.ts:204-206`) gated by `shouldSuppressInference()` (`src/core/lifecycle/power-monitor.ts:85-87`). The error propagates up through `vector/queries.ts:62` → vector module returns empty → query-router fan-out sees vector contribute nothing → recall returns empty (or near-empty) on vault-content queries. The user sees "no matching content"; the system silently returned empty because of power state.
**Verified unchanged in current main `cdc2f0e` (2026-05-14):** code at all three cited file:line locations is byte-identical to the addendum's transcription. No mitigation has shipped in the ~3 weeks since H2 was filed.
**Why this is [PROPOSAL] not [HARDENING]:** Per the April 19 audit addendum's classification (`l1-diagnostic-branch-addendum-2026-04-19.md` §2), H2 is a *"Design call — warrants a call with steward before picking a direction. Production blocker for laptop end-users."* Unlike H1 (mechanical fix → #163) and H3 (mechanical contract → PR #172), H2 has four design questions whose resolution is Seb's territory; choosing among them is policy, not localization. The executor's job here is to surface clearly, not to choose.
**The four design questions** (verbatim shape from addendum §2 for steward+jurist+Seb review):
1. **Default policy.** Should `shouldSuppressInference()` default to `false` (allow inference on battery, accepting battery cost) rather than `true` (suppress, accepting silent recall failure)? The current default protects battery life; suppresses recall as a side effect. Neither side is obviously correct. Existing `BM_BATTERY_ALLOW_INFERENCE=true` env var is a sysops workaround, not a user-facing solution.
2. **Visible degradation.** If suppression stays the default, the operator should see *why* recall returned empty. Currently the error is swallowed inside vector's module-error path; the recall response looks identical to "no matching content." Proposal shape: surface in `system_status` a state like `power_limited` that the health endpoint exposes and recall responses annotate in metadata.
3. **CPU-only fallback.** `mxbai-embed-large` runs on CPU in Ollama — slower but functional. Reasonable to fall back to CPU-only embedding when on battery rather than suppress entirely? Estimated ~5-10x latency hit on embed (unverified) but keeps recall functional.
4. **Query-time vs ingestion-time asymmetry.** Ingestion-time suppression is defensible (bulk work, defer-is-fine — that's what the existing battery-deferral path was designed for). Query-time suppression is the user-facing hit. Should the two be governed separately (suppress ingestion but not query)?
**Steward's framing (preserved verbatim from addendum):** *"For those future end-users who will use this on a laptop the need to be plugged into ac for recall is a no go..."* — H2 is a production blocker for the target use case.
**Honest-degradation invariant tie-in:** `bettermemories/CLAUDE.md` *"Honest degradation — the system must report its own limits. Silent failures are architectural violations."* Whatever direction Seb chooses, the principle points toward "surface the state, don't hide it." Even Option 1 alone (default to allow) without Option 2 (visible degradation) leaves a gap: when battery is genuinely critical and suppression *does* fire, the user still needs to see why. Options 1 and 2 may be additive rather than alternatives.
**Options for surfacing this to Seb:**
A. **Steward calls Seb directly** with these four questions for a sync conversation. Best signal-to-noise; worst latency-to-Seb-attention.
B. **Steward leaves a comment on #165** referencing PR #172 (which Seb is about to look at for H3). Asynchronous; record-on-issue; Seb engages at his pace. Surfaces while attention is high on the audit findings.
C. **Steward + jurist + executor draft a unified design proposal** (one of the four directions chosen first) and submit to Seb for ratification. More work upfront; risks the executor pre-deciding what is properly Seb's call.
D. **Defer** until next L1 reliability work session. Acceptable IF the steward isn't running BMF on battery in the meantime; otherwise H2 continues to silently degrade recall every time the laptop unplugs.
**Recommendation:** **B**, conditioned on *all four questions surfaced explicitly*. The risk in (B) is that Seb engages with whichever question is easiest and the others drift. Comment should ask Seb to address all four (or explicitly defer specific ones), not just opine on the easiest. Escalate to (A) if Seb's response is "let's talk."
**What this surfaces but does not decide:**
- The right default policy
- Whether `power_limited` should exist as a `system_status` state, and what its taxonomy is (degraded? new top-level?)
- Whether CPU fallback is worth the latency
- Whether ingestion and query embed share or diverge their suppression policy
**Connection to cross-cutting [PROPOSAL]:** H2 is one specific instance of the read-path-honest-degradation pattern the jurist authorized for parallel filing. Naming H2's specific shape (silent-on-battery) does not replace the cross-cutting; conversely, H2's resolution may inform the cross-cutting's concrete mechanism (a `power_limited` state would be one instance of a read-path-error signal that the cross-cutting calls for).
**Connection to authorized work:** REVIEWED-19 (Epistemic Integrity, PENDING-17) authorized recall-correctness improvements as L0 readiness. H2's silent-fail on battery is exactly the laundering-uncertainty pattern that work targets — but the resolution shape is policy, not a clobber-fix. The conversation IS the deliverable here, not a PR.
**Files affected (when conversation produces a direction):** Depends on direction.
- Default-policy change: `src/core/lifecycle/power-monitor.ts` (~1 line)
- `power_limited` state: `src/server/routes/health.ts`, `src/types/system-status.ts`, recall response shape (`src/server/routes/recall.ts`), spec touchpoints
- CPU fallback: `src/inference/ollama-embeddings.ts` (significant — embedding-provider abstraction)
- Query/ingestion split: `src/core/lifecycle/power-monitor.ts` (split into two gates) + call-sites
- Spec touchpoints: `vector-module-spec.md`, `keystone-spec.md`, possibly a new "power-aware inference" spec section
**Awaiting:** Steward authorization to coordinate the surfacing-to-Seb action (recommend Option B above). Direction selection is Seb's call after the four questions are surfaced; this PENDING entry does not propose code or amendment — it proposes the conversation.
**Status (2026-05-14):** AUTHORIZED via REVIEWED-21 (Option B; literal comment text awaiting steward review before posting).
---
## PENDING-20 — Cross-cutting: read path lacks honest-degradation contract
**Date:** 2026-05-14
**Tag:** [PROPOSAL]
**Origin:** Surfaced by April 19 audit addendum (`l1-diagnostic-branch-addendum-2026-04-19.md` TL;DR cross-cutting callout); jurist authorized parallel filing on 2026-05-14 (recorded under REVIEWED-20).
**Naming the pattern.** BMF's honest-degradation contract applies only to the *write path*. Write-path modules report `cursor`, `error_count`, `last_processed_at` — three first-class signals that an operator can read to know what the system is and isn't keeping up with. The *read path* — query-planner, query-router, hybridSearch, temporal handlers, working-memory injection — has **no equivalent scaffolding**. It silently produces empty results, junk results (stats blobs as content; working-memory pollution as memory; BM25 raw scores past 1.0 clamped without note), and partial results with no diagnostic surface. There is no counter, no error signal, no "why empty" breadcrumb. The slow-query log fires only at `searchMs > 200`, which is precisely the wrong threshold for the failure mode that matters most: fast 0-return queries.
**Four empirical confirmations** (from the April 19 audit; current state verified in main `cdc2f0e`):
| H-issue | Read-path subsystem | Silent failure mode | Status |
|---|---|---|---|
| H1 | query-router `normalizePerModule` | confidences silently zeroed when min==max | SHIPPED #163/#164 (mechanical) |
| H2 | vector embed gate (`shouldSuppressInference`) | empty result on battery, no operator-visible reason | OPEN #165 (PENDING-19, design call) |
| H3 | temporal `parseTemporalQueryParams` | stats blob returned as content on missing/unrecognized type | SHIPPED PR #172 (mechanical contract) |
| H4 | hook `cm-hook.mjs` + working-memory injection | hook events pollute recall; agent's own tool stream surfaces as memory | OPEN #167 (design call) |
H1 and H3 are individually closed but the pattern they confirm is not. H2 and H4 will resolve into specific mechanisms or specific behaviors, but the meta-finding — "the read path has no diagnostic discipline" — is not derivable from any single fix. The jurist's framing for filing now: *"if the [PROPOSAL] waits until all H-issues are closed, it will wait indefinitely. The pattern will be visible in retrospect but never formally entered."*
**Proposed design principle (the [PROPOSAL] itself):**
> Any read-path subsystem in BMF MUST expose a "why empty" breadcrumb analogous to the write path's `error_count`. Returning empty silently — when the cause is structural (battery suppression, type mismatch, dispatch exclusion, threshold filter, embedding failure) rather than substrate-truth (no matching content) — violates the honest-degradation invariant articulated in `bettermemories/CLAUDE.md`.
The breadcrumb's *form* is not specified in this proposal; that's Seb's architectural call. Candidates surfaced by the audit:
- A `system_status` extension distinguishing `recall_status: healthy | degraded | broken` (addendum §G in baseline doc)
- A per-response `metadata.degradation_reasons[]` annotation on recall responses
- Per-read-path-subsystem error counters mirroring the write-path `error_count` shape
- A new `system_status: power_limited` state (concrete instance from H2; would be one form of breadcrumb)
- A canary recall mechanism (insert known content → recall it back → confirm match) that runs at health-check time
These are not mutually exclusive. The [PROPOSAL] is the *naming event*, not the mechanism selection.
**What this [PROPOSAL] does NOT do:**
- Choose the mechanism
- Specify the API shape
- Block any individual H-issue PR (H3 already shipped without it)
- Replace the H2/H4 design calls (those resolve specific behaviors; this proposes a contract for the class)
**What this [PROPOSAL] does:**
- Enter the pattern formally into the governance record now, while the empirical confirmations are recent
- Frame future read-path work (any new subsystem; any modification of an existing one) as obligated to honor honest-degradation at the read-path level
- Give the H2/H4 conversations with Seb a contract they sit inside, not just instances they are
**Connection to authorized work:**
- **REVIEWED-19 (Epistemic Integrity, PENDING-17)** authorized the constitutional position *"the system does not grant epistemic authority to its own outputs without external grounding."* That position is structurally upstream of this proposal: a read path that silently launders empty/junk into authoritative-looking results violates that position at the infrastructure level.
- **`bettermemories/CLAUDE.md`** *"Honest degradation — the system must report its own limits. Silent failures are architectural violations."* This proposal extends the invariant from write-path observability to read-path observability.
- **REVIEWED-13 / DN-GOV-05 (Bounded Self-Repair Principle)** is upstream constitutional context: the system can act in bounded ways without steward presence *only when degradation is reversible, within parameters, and independently verifiable*. A read path with no diagnostic surface fails the *independently verifiable* condition by construction.
**Why this is jurist territory before code:**
Per CLAUDE.md authorization taxonomy, [PROPOSAL] requires explicit steward authorization via REVIEWED.md. But this one carries a stronger requirement: it is a candidate L2 invariant — a constitutional commitment about how the architecture must behave, not a one-off design choice. Jurist review for whether this is invariant-shaped or design-commitment-shaped (per the DN-GOV-08 framing — recognition-conditions vs recognition-content) is load-bearing before any mechanism work begins.
**Files affected (when mechanism is later proposed by Seb):** Depends on mechanism. Most candidates touch `src/server/routes/health.ts` + `src/server/routes/recall.ts` + `src/types/system-status.ts`; some touch per-module read paths individually. No code change at this stage.
**Spec touchpoints (when mechanism is later proposed):** `bettermemories/CLAUDE.md` (invariant statement); `keystone-spec.md` (query-router contract); per-module specs that articulate query interfaces.
**Awaiting:** Steward + jurist review for whether this is filed as:
- (a) a [PROPOSAL] in the L1 governance record (this PENDING entry), to inform Seb's design when he picks up H2/H4; OR
- (b) elevated to a candidate L2 invariant in `capablemind/docs/thinking/David/l2-constitution/`, with jurist drafting the registry entry per the I15/I16/I17 pattern; OR
- (c) both — file as PENDING here for engineering visibility AND elevate as L2 candidate for constitutional consideration.
The executor recommends **(c)**, but the L2 elevation is jurist territory and requires the cluster decision (Cluster A/B/C) the executor cannot make.
**Status (2026-05-14, corrected):** AUTHORIZED via REVIEWED-22 — Option **(a) only**: PENDING-20 stays as L1 governance entry. **L2 elevation work is DEFERRED to post-May 2026** per global CLAUDE.md parked-status: *"L2 PARKED through end of May 2026. No L2 governance advancement, no new invariant work, no constitutional proposals. L2-adjacent questions arising from L1 work: note, don't pursue."* Steward confirmed at session end: *"I won't be working on L2 until the end of May — that something was surfaced because of L1 work is both fantastic and coincidental."*
**Jurist's three governance calls** (RECORDED for post-May pickup; not actioned this session): **(1)** Not Cluster A; **Cluster B** is the right cluster (read-path observability is epistemically downstream of Cluster A; common genus with REVIEWED-18 + REVIEWED-19 is *conditions under which the system's epistemic behavior can be verified and governed*). **(2)** DN-GOV-08 fit confirmed: invariant-shaped, not design-commitment-shaped (stabilizes conditions, does not automate recognition). **(3)** l1_contamination_profile is distinct from Cluster A's monotonic-toward-interlocutor-satisfaction shape — it is the **competence-vulnerability paradox** from the Observer Problem: increasing capability masks decreasing observability of degraded paths. Profile candidate: *moderate, structural*. Saved as portable project memory at `~/.claude/projects/-Users-davidglidden/memory/project-competence-vulnerability-paradox.md`.
**Held until post-May 2026 (do NOT pursue):**
1. Steward declaration on Cluster B status.
2. Jurist drafting cluster framing note (if needed) and registry entry per I15/I16/I17 pattern.
3. Brief jurist↔steward exchange on l1_contamination_profile language.
4. Filing of registry entry in `capablemind/docs/thinking/David/l2-constitution/amendments/`.
**Executor's role going forward:** maintain this entry as engineering-visibility record; track Seb's response on #165 (PENDING-19) and how it informs the cross-cutting; do not produce L2 doctrine; do not initiate cluster declaration or registry-entry drafting before June 2026; if a future jurist message arrives on this topic before end of May, surface the parked status before responding substantively.
---
## PENDING-21 — H4: Hook events pollute recall + logchain (design-call)
**Date:** 2026-05-14
**Tag:** [PROPOSAL]
**GH issue:** CapableMind-ai/betterMemories_app #167 (priority:**high**, OPEN, opened 2026-04-21)
**Summary:** Two mechanisms in `hooks/cm-hook.mjs` (verified byte-identical to addendum's transcription in current main `cdc2f0e`; no commits to the hook surface since April 19):
**4a — Recall spam from UserPromptSubmit** (`hooks/cm-hook.mjs:340-362`, `handleUserPromptSubmit`): every UserPromptSubmit event fires `recall(prompt, { maxResults: 5 })` with the full prompt text. In Claude Code this includes real user prompts (expected) AND task-notification XML when background tasks fire (Monitor events, scheduled wakeups) AND auto-generated prompts from tool results. Each fire = one `embeddingProvider.embed(prompt)` (~300-1300 ms via Ollama) + one full query-router pass.
**4b — Logchain accumulation from observe** (same hook): every prompt is also `observe('hook.user_prompt', payload, ...)`'d, lands in the logchain, gets classified, and enters entity/vector/temporal storage. Over a session, hook-observed content fills the underlying stores and matches subsequent recalls for any query with overlapping tokens — *this is how earlier WM pollution manifested* per the addendum.
**§6 aggregate cost framing**: a steward working a full day with many tool calls, monitors, and scheduled triggers generates many hundreds of hook recalls. Each is silent CPU + embed cost. *"On battery, this ambient Ollama load is pure loss"* — directly couples to H2 (#165).
**Why this is [PROPOSAL] not [HARDENING]:** Per addendum classification, *"Architectural — Two mechanisms (recall spam + logchain noise). Design call — warrants a call with steward, likely coupled with session/hook integration work."* Three design questions whose resolution is Seb's territory; choosing among them is policy.
**The three design questions** (verbatim from addendum §4 for steward+jurist+Seb review):
1. **Prompt filtering at the hook.** Should the hook distinguish "substantive user prompt" from "system/tool-notification prompt"? A trivial shape: skip observe + recall when the prompt starts with `<` (XML/tag-shaped). Not robust to all cases but fast.
2. **Event classification at BMF.** Should `hook.user_prompt` events enter the same indices as vault content, or a segregated tier (e.g., session-scoped, not recallable)? This is the cleaner architectural shape but bigger lift.
3. **Recall-triggering policy.** Should every prompt trigger a full recall, or only when the operator asks for context (e.g., an explicit `/context` trigger)? The current default assumes recall is always wanted; measurement suggests it's also always costly.
**Options for surfacing this to Seb** (same shape as PENDING-19 Option B; recommend the same answer):
A. **Steward calls Seb directly** with these three questions for a sync conversation.
B. **Steward leaves a comment on #167** referencing PR #172 + the H2 comment on #165 (batches the audit's three open findings into one attention window for Seb). Asynchronous; record-on-issue.
C. **Steward + jurist + executor draft a unified design proposal.** Pre-decides what is properly Seb's call.
D. **Defer.** Acceptable if H4's ambient cost is tolerable; the steward is the empirical witness for whether it is.
**Recommendation:** **Option B**, conditioned on *all three questions surfaced explicitly* and the §6 ambient-cost framing included as fourth-question-in-effect. Same discipline as PENDING-19: ask Seb to address all three or explicitly defer specific ones. Escalate to (A) if response is "let's talk."
**Coupling note for the comment:** H4 and H2 share a substrate (both depend on Ollama embedding being available; H4's ambient cost is *pure loss* on battery per the addendum's §6 callout). If Seb resolves H2 toward CPU fallback or default-allow, that affects H4's cost analysis directly. Worth surfacing explicitly so Seb sees the H2/H4 coupling rather than treating them as independent.
**Connection to cross-cutting [PROPOSAL] (PENDING-20):** H4 is the fourth empirical confirmation of the read-path-honest-degradation pattern. Specifically: the working-memory pollution + hook-observed content surfacing on subsequent recalls is exactly the failure mode the cross-cutting `"why empty / why these results"` breadcrumb would surface. PENDING-21's resolution informs the cross-cutting's mechanism design, but does not replace the meta-finding (which is held until post-May 2026 per REVIEWED-22 correction).
**Connection to authorized work:** REVIEWED-19 (Epistemic Integrity, PENDING-17) authorized recall-correctness improvements as L0 readiness. H4's both mechanisms (spam + accumulation) launder the agent's own tool-stream into recall results — the laundering-uncertainty pattern that work targets. Resolution is policy, not a clobber-fix.
**Files affected (when conversation produces a direction):** Depends on direction.
- Prompt filtering at the hook: `hooks/cm-hook.mjs` (~5-10 lines)
- Event classification segregation: `src/core/keystone/orchestrator.ts`, `src/core/keystone/classification.ts`, `src/types/event.ts`, hook payload shape, possibly a new `hook_session_scoped` event domain
- Recall-triggering policy: `hooks/cm-hook.mjs` + Claude Code config conventions; user-facing trigger surface
- Spec touchpoints: `keystone-spec.md`, possibly a new "session-scoped events" spec, MCP/hook integration specs
**Awaiting:** Steward authorization to coordinate the surfacing-to-Seb action (recommend Option B above with the H2-coupling note). Direction selection is Seb's call after the three questions are surfaced; this PENDING entry does not propose code or amendment — it proposes the conversation.
**Status (2026-05-14):** AUTHORIZED via REVIEWED-23 (Option B; literal comment text reviewed by steward before posting). **Comment posted**: https://github.com/CapableMind-ai/betterMemories_app/issues/167#issuecomment-4449244331 — three questions surfaced verbatim, §6 ambient-cost framing included, H2/H4 coupling note included. Awaiting Seb's response.
---
# Continuity Skill Audit cluster (S0–S9)
The following ten entries (S0–S9) emerged from the 2026-05-18 audit of the wake-up / wrap-up / symmetria continuity skills, framed against Robert Pogue Harrison's *Dominion of the Dead* (the living session as ligature between the dead and the unborn). The audit's full architectural framing lives in three companion documents in `~/_Dev/CapableMind-AI/docs/thinking/David/methodology/`:
- `continuity-skill-audit-jurist-brief-2026-05-18.md` (executor's v2 brief)
- `continuity-skill-audit-jurist-shape-review-2026-05-18.md` (Jurist's shape-review)
- `prime-directive-elaboration-2026-05-18.md` (steward's authored Directive elaboration)
Cluster identity (S-prefix) is preserved per the OP- cluster precedent. PENDING.md entries here are operational trackers; the methodology documents carry the architectural reasoning.
The Jurist's six-phase authorization map governs sequencing. Cross-cutting success criterion (filed as feedback memory `feedback-skill-success-is-reexplanation-reduction.md`): the measure of any S-item implementation is whether the steward stops having to reexplain himself at the moment that change addresses — not whether the skill becomes more sophisticated.
---
## PENDING-S0 — Prime Directive elaboration (CLOSED 2026-05-18)
**Date:** 2026-05-18
**Tag:** [ESCALATE] [PROPOSAL]
**Status:** **CLOSED-by-commit.**
**Summary:** Make explicit, as a continuation of the μέτρον gloss, the principle that *τὸ πρόσφορον* — what is fitting — includes the time the task requires. Constitutional commitment at the Prime Directive level; operational carrier in Symmetria §0.
**Authoring sequence:** Executor surfaced the principle from three corrections-in-a-day during the audit (the lectio moment + the v1-brief hedging + the principle-elevation correction). Steward authored the final language; Jurist shape-reviewed and confirmed (clause within existing μέτρον gloss, not appended paragraph). Steward committed CLAUDE.md (line 12, between citation and decision-filter prose); executor committed Symmetria §0 (between gloss and §0 header).
**Files committed:** `~/CLAUDE.md` §"Prime Directive"; `~/.claude/skills/symmetria/SKILL.md` (between citation and §0).
**Acceptance test (per cross-cutting success criterion):** does the executor hold the time-the-task-requires principle without requiring steward intervention to apply it? Tested over the following weeks of work.
---
## PENDING-S1 — Wrap-up §8 output template: add pause statement + negative space as named fields (CLOSED 2026-05-18)
**Date:** 2026-05-18
**Tag:** [HARDENING]
**Status:** **CLOSED-by-implementation** via REVIEWED-24 (Class A bundle).
**Summary:** §8 output template in `~/.claude/skills/wrap-up/SKILL.md` adds two named fields: `**Pause statement:**` (parallel to pulling thread) and `**Decisions deferred (and why):**`. Both are currently required in §1 procedure but absent from §8 template.
**Rationale:** Audit ligature test A2 + A3. The pause and the negative space are procedurally required but structurally optional. Under context-pressure the procedural commitment is the one that drops — the post-Directive-elaboration view is that this is exactly the time-the-task-requires failure mode the new constitutional clause names. Q3 (the asymmetric pause) was elevated to constitutive by the Jurist on Harrison-grounded reasoning: *the ligature is laid at departure, not discovered at return.* Wrap-up must structurally enforce the pause statement.
**Files affected:** `~/.claude/skills/wrap-up/SKILL.md` §8.
**Implementation note:** New fields include explicit annotations naming the pause as constitutive and the negative space as required-for-unborn-session-to-know-scope. Acceptance test: the /wrap-up at the end of session 2026-05-18 is the first live run; future wrap-ups should not drop these fields under context pressure.
---
## PENDING-S3 — Wake-up §3: binary thread validity gate (CLOSED 2026-05-18)
**Date:** 2026-05-18
**Tag:** [HARDENING]
**Status:** **CLOSED-by-implementation** via REVIEWED-25 (Class A bundle).
**Summary:** Add an explicit named step in `~/.claude/skills/wake-up/SKILL.md` before §3 synthesis: thread validity gate with binary outcome (`confirmed / stale / superseded`) and a one-line reason. If stale, surface that before restoring anything else.
**Rationale:** Audit B1. Currently the staleness check lives in prose ("if situation has changed enough, say so") plus a 3-day heuristic. Compression risk: the check is silently skipped — exactly the pattern the Directive elaboration's *"when context pressure rises, pause before composing"* addresses.
**Files affected:** `~/.claude/skills/wake-up/SKILL.md` §3.
**Implementation note:** Gate is placed as the first step of §3 synthesis (not as a separate section, to avoid numbering cascade). On `stale` or `superseded`, the briefing structure reorders to lead with what changed, not with the inherited thread. Acceptance test: future wakes after a long pause or after substantive events should explicitly state the gate's outcome rather than implicitly restoring the prior thread.
---
## PENDING-S8 — Symmetria pulse lineage anchor + wake-up traversal tools prescribed (CLOSED 2026-05-18)
**Date:** 2026-05-18
**Tag:** [HARDENING]
**Status:** **CLOSED-by-implementation** via REVIEWED-26 (Class A bundle).
**Summary:** Two related drifts identified by the audit (D2 + B6):
1. **Symmetria pulse procedure** (§6 no-arg pulse) adds a step 0 — re-anchor craft / ethics / character to lineage (now including the *τὸ πρόσφορον*-includes-time elaboration just landed in §0).
2. **Wake-up procedure** (§2.b) prescribes `mempalace_find_tunnels` when the pulling thread crosses project boundaries, and `mempalace_kg_timeline` when steward asks about *when* a fact changed. Both tools mentioned in constraint notes but never prescribed in procedural steps.
**Rationale:** Two drifts where the framework named tools/lineage but did not reach for them in procedure — decoration without load-bearing use. With the lineage just extended (S0 landed), the Symmetria pulse not touching it is now an even larger gap.
**Files affected:** `~/.claude/skills/symmetria/SKILL.md` §6 pulse; `~/.claude/skills/wake-up/SKILL.md` §2.b.
**Implementation note:** Symmetria pulse step 0 re-anchors all three dimensions (craft / ethics / character) to lineage; pulse step 5 also gains a cross-reference to §3 for the self-flag on `aligned`-without-named-tension. Wake-up §2.b gains a new b.4 substep that prescribes the two tools with explicit conditions (cross-project thread → find_tunnels; *when*-question or prior-state-reference → kg_timeline). Acceptance test: future pulses begin with lineage re-anchor; future wakes with cross-project pulling threads (e.g., ARC ↔ chamber-library) reach for find_tunnels in standard procedure.
---
## PENDING-S2 — Hook-aware deposit detection in wake-up (awaiting Q1 hooks contract)
**Date:** 2026-05-18
**Tag:** [PROPOSAL]
**Phase 4 — awaits Jurist contract definition.**
**Summary:** Wake-up detects whether the previous session ended via wrap-up or via Stop hook alone. Surfaces a warning when hook-only: *"Previous session ended without wrap-up — pulling thread may be absent or incomplete."* Calibrates confidence accordingly.
**Rationale:** Audit A4 — the strongest single gap in the ligature. A hook-only deposit lacks pulling thread / literal question / pause statement, but currently looks identical to a wrap-up deposit from wake-up's perspective. Jurist (2026-05-18 shape-review): the hooks/skills contract is *doctrinal, not tooling*. It determines what the unborn session can trust about its inheritance.
**Files affected:** `~/.claude/skills/wake-up/SKILL.md` §2.b.1 + §3.
**Awaiting:** Jurist shape-review of contract language (candidate text in Jurist shape-review document: *"The authoritative deposit is a wrap-up deposit. A hook-only deposit is an emergency fallback, not a complete inheritance. Wake-up must detect which it received and calibrate accordingly."*). Then steward authorization.
---
## PENDING-S4 — Post-compression marker; cross-repo with mempalace (awaiting Q1)
**Date:** 2026-05-18
**Tag:** [PROPOSAL]
**Phase 4 — cross-repo coordination.**
**Summary:** PreCompact hook (`~/_Dev/mempalace/hooks/mempal_precompact_hook.sh`) writes a marker diary entry (topic: `session-compaction`) when it fires. Wake-up detects this marker; if present, warns that confidence claims in that session inherit a lossy view. Symmetria adds a post-compression contamination flag (paired with §3 application work in S6).
**Rationale:** Audit B4 + D4. The PreCompact event currently silent to all downstream consumers; this makes it observable.
**Files affected:** `~/.claude/skills/wake-up/SKILL.md`; `~/.claude/skills/symmetria/SKILL.md` §3; `~/_Dev/mempalace/hooks/mempal_precompact_hook.sh` (upstream PR or steward-coordinated change).
**Awaiting:** Jurist contract definition (Q1); steward authorization; mempalace upstream coordination.
---
## PENDING-S5 — Authoritative-diary marker; wrap-up ↔ Stop hook (awaiting Q1)
**Date:** 2026-05-18
**Tag:** [PROPOSAL]
**Phase 4 — cross-repo coordination.**
**Summary:** Wrap-up's diary write carries an explicit `authoritative: true` marker (or AAAK equivalent). Stop hook (`~/_Dev/mempalace/hooks/mempal_save_hook.sh`) checks for a recent authoritative entry and skips its block if present.
**Rationale:** Audit C3. Currently a wrap-up + subsequent hook fire may produce two diary entries from different AI states. The second one (post-wrap-up, depleted context) is silently mistaken for the canonical entry by future wake-ups.
**Files affected:** `~/.claude/skills/wrap-up/SKILL.md` §4.b; `~/_Dev/mempalace/hooks/mempal_save_hook.sh`.
**Awaiting:** Jurist contract definition (Q1); steward authorization; mempalace upstream coordination.
---
## PENDING-S6 — Symmetria §3 contamination flag applications of the Directive elaboration
**Date:** 2026-05-18
**Tag:** [HARDENING]
**Phase 3b — depends on S0 (now CLOSED).**
**Summary:** Extend `~/.claude/skills/symmetria/SKILL.md` §3 contamination flag list with applications of the now-constitutional time-the-task-requires principle, plus three other self-flags surfaced by the audit:
- **Lectio** (corpus reading): take the time the corpus asks for.
- **Diagnose-don't-fix** (debugging): trace the class of failure before patching the instance.
- **Dwell-on-composition** (writing): the recommendation gets the time it wants, not the time the executor wants the recommendation to take.
- **Alignment pulse returning `aligned` without naming a specific tension** — premature-closure (D1).
- **Search queries shaped by what the session wants to find** rather than what it needs to find (D5).
- **Post-compression confidence claims** — the working memory was trimmed; what's certain now may rest on what was lost (D4; pairs with S4).
**Rationale:** Audit D1/D4/D5 + the principle elevation. §3 currently flags external code and writing patterns; with the Directive elaboration in place, applications of it at the discipline level are coherent additions, not scope-creep.
**Files affected:** `~/.claude/skills/symmetria/SKILL.md` §3.
**Awaiting:** Steward authorization (S0 closure unblocks).
---
## PENDING-S7 — Symmetria `check` mode: add `suspend` outcome (awaiting Q5 + relates to Q4)
**Date:** 2026-05-18
**Tag:** [HARDENING]
**Phase 5.**
**Summary:** §6 `check` mode outcomes extend from `proceed / return-and-reframe / escalate` to `proceed / return-and-reframe / suspend / escalate`. `suspend` = hold for unhurried steward judgment without urgency.
**Rationale:** Audit D3 + Jurist confirmation. Today's audit was the missing-shape example: neither escalate (urgent) nor return-and-reframe (the audit is the right work) fit. With the Directive elaboration in place, `suspend` is the natural outcome — *the time the steward's judgment requires is task-time, not interruption-time.*
**Files affected:** `~/.claude/skills/symmetria/SKILL.md` §6 (check).
**Awaiting:** Steward authorization.
---
## PENDING-S9 — Wrap-up §8 output template enriched to match practice
**Date:** 2026-05-18
**Tag:** [HARDENING]
**Phase 5 — depends on Q2 + Q3 (Q3 confirmed by Jurist).**
**Summary:** §8 output template in wrap-up expanded to mirror the three-tense richness the steward already produces in session memory files: Past / Present / Future as named sections, with required fields under each. Subsumes S1 if implemented together; or S1 lands first as smaller increment and S9 follows as deeper revision.
**Rationale:** Audit C5 diagnostic — template under-specifies what good practice already does. With the Directive elaboration in place, an output template that drops the practice's load-bearing tenses under compression is itself an instance of the failure mode the principle catches.
**Files affected:** `~/.claude/skills/wrap-up/SKILL.md` §8.
**Awaiting:** Steward authorization. Optional relationship to S1: implement S1 first (minimal additive), then S9 as deeper revision; or fold S1 into S9 as single revision.
---
## SESSION-LOG-2026-05-18 — Continuity Skill Audit Phase 1+2 complete
**Date:** 2026-05-18
**Summary:**
- Three-phase audit of wake-up / wrap-up / symmetria triad executed per steward instruction.
- Audit revealed central architectural finding: *load-bearing items currently named in procedure but not enforced in structure*. Strongest single gap: hook-only deposits invisible to wake-up (PENDING-S2). Strongest working part: literal-question discipline.
- Two steward corrections during the audit elevated the work: lectio surfaced the principle's specific shape; principle-elevation correction surfaced that the audit's central finding is itself an application of a principle the Prime Directive implies but does not carry through to (*always take the time the task requires*).
- Jurist shape-reviewed five doctrinal questions (Q1–Q5); all five affirmed. Q3 (asymmetric pause) elevated to Phase 2 alongside Q4 (principle elevation) on Harrison-grounded reasoning: *the ligature is laid at departure, not discovered at return.*
- Phase 2 completed: steward authored the Directive elaboration; Jurist confirmed language as drafted + placement (Option 1: both CLAUDE.md and Symmetria §0); steward committed CLAUDE.md; executor committed Symmetria §0. PENDING-S0 closed.
- Phase 3 now unblocks: Class A items S1 + S3 + S8 ready for steward authorization (no doctrinal dependencies).
- Cross-cutting success criterion saved as feedback memory: *the measure of skill improvements is whether the steward stops having to reexplain himself; sophistication without reexplanation-reduction is decoration.*
**What works:** the literal-question discipline (structurally enforced; survives compression).
**What doesn't yet:** hook-aware deposit detection; pause-statement symmetry; thread validity gate; Symmetria lineage anchor in pulse; §3 self-contamination flags; suspend outcome.
**Artifacts:** three methodology documents in `~/_Dev/CapableMind-AI/docs/thinking/David/methodology/`; two feedback memories (`feedback-load-bearing-not-by-immediate-weight.md` + `feedback-skill-success-is-reexplanation-reduction.md`); one new KG drift-pattern (`under-valuing-small-discipline-marks-by-immediate-visible-weight`); session ledger entries.