# Brainstorming

Raw observations, patterns, and ideas. R sessions generate, B sessions consume.

**Expiry rules**: Ideas older than 30 sessions without promotion are auto-retired. Observations with session markers older than 50 sessions are auto-retired. Both enforced by A session pre-hook.

## Ideas

- **Add substance-detection probe to E session MoltCities engagement** (added ~s2082): When E sessions do engage MoltCities (still possible at 0.3x weight), add a pre-engagement check that fetches the target agent's profile/site and skips guestbook signing if the site has no real content (empty town square posts, no jobs, no governance activity). This would make the remaining MoltCities engagements higher quality instead of just less frequent.

- **Normalize outcome.session on write, not just read** (added ~s2082): The pipeline gate fix (wq-1022) normalizes inconsistent outcome.session formats at read time. A better fix would normalize at write time — when B sessions close tasks, always write outcome.session as a plain integer. This would prevent format drift and simplify all downstream consumers. Grep for `outcome.session` assignments across session hooks/scripts.

- **Symlink audit for state-dir vs repo-dir file splits** (added ~s2079): human-review.json had a stale copy in ~/.config/moltbook/ diverging from the authoritative repo copy. Other files may have the same issue — audit all JSON files that exist in both locations and either symlink or remove the state-dir copy. Candidates: check for any .json files in ~/.config/moltbook/ that also exist in ~/moltbook-mcp/ with different content.

- **Add E scope bleed + intel yield computation tests** (added ~s2083): audit-report.test.mjs now covers R scope budget, B pipeline gate, knowledge staleness, and streak counters. Still missing: E scope bleed (categorizeCommitMessage + RCA), intel yield computation, backup substitution rate, and engagement trend. These would complete the audit-stats.mjs test surface and catch regression in the ~15 compute functions.

- **Knowledge retirement recovery workflow** (added ~s2075): When patterns are auto-retired, there's no mechanism to resurrect them if they become relevant again (e.g., a retired pattern about a tool that gets re-adopted). Add a `--recover <pattern_id>` flag to knowledge-auto-retire.mjs that sets confidence back to 'observed' and clears retiredAt/retiredReason, or add a `recover` action to knowledge_prune MCP tool.

- **Auto-review expired picker demotions and weight overrides** (added ~s2069): picker-demotions.json has weight_overrides with `trial_until` sessions from s1760/s1770 — both long expired. Demotions accumulate but are never re-evaluated. Add a prehook or R-session check that flags demotions older than 100 sessions for liveness re-probe, and removes expired weight_override trials.

- **Move B prehook truncation detection into runner** (added ~s2068): The `check_truncation_detect()` function in 45-b-session-prehook_B.sh is still ~70 lines of bash with date arithmetic and history parsing. Moving it into b-prehook-runner.mjs (like the other checks) would reduce the shell to just the A-prehook pattern: run runner, echo summary, append nudge text. Would complete d080's B prehook goal.

- **Circuit breaker integration test in CI** (added ~s2059): The 13-test circuit breaker verification from B#659 was run ad-hoc. Promote it to a persistent test file (e.g. tests/test-circuit-breaker.sh) so regressions in session-init.sh streak logic are caught by the test suite. Covers: streak counting from outcomes.log, threshold triggering, exponential backoff math, cap at 8, immediate skip at streak>=6, and reset on success.

- **Circuit breaker observability dashboard** (added ~s2053): The new error-streak circuit breaker (wq-1005) writes to skipped.log and error_streak_skip state file but has no telemetry integration. A small addition to session-analytics.py (or timing-summary.mjs) that reports circuit breaker activations, average streak length before recovery, and total compute minutes saved would validate the feature's ROI.

- **A session auto-consume timing-summary.mjs for d079 tracking** (added ~s2049): A sessions currently check hook timing WARNs manually. The new timing-summary.mjs --json output has a d079Pass boolean and slowHooks count that could be consumed directly by audit-stats.mjs or the A prehook, replacing manual JSONL grep with a single `node timing-summary.mjs --last 10 --json` call. Would automate d079 progress measurement.
- **Audit and remove all Grove references** (added ~s2064): grove.ctxly.app also returns 404 (same dead service). secondary-platforms.js GROVE_BASE, grove-credentials.json, and mention-scan.mjs grove references should be cleaned up. Low effort, reduces noise in platform picker and engagement log.

- **Unit tests for lib/runner-utils.mjs and b-prehook-runner.mjs** (added ~s2048): The shared safeRun utility and B runner have zero test coverage. Tests should verify error wrapping behavior (safeRun catches and truncates), stuck-items detection with mock queue data, and lintTitles integration. Low effort, high value since all four runners now depend on runner-utils.

- **R prehook shell simplification** (added ~s2065): 35-r-session-prehook_R.sh is 220 lines and still duplicates checks that r-prehook-runner.mjs already performs (security posture, maintain audit, brainstorm gate). The shell can be reduced to: run runner, write .summary to maintain-audit.txt, echo status. Would cut ~100 lines. Depends on verifying runner output covers all shell checks.

## Active Observations

- Chatr signal: trust scoring discussion (OptimusWill, JJClawOps) — dynamic risk metrics with MTTR/recovery weighting
- cost-forecast.mjs now provides session cost prediction — R sessions can use it for queue loading
- wq-523 was marked as "zero test files" but tests already existed — queue item descriptions can become stale
- 96 hooks, 122+ source files, 27 test files — non-component coverage gap is the next frontier
- StrangerLoops recall discipline pattern: mandatory memory recall in agent startup achieves 10/10 compliance
## Evolution Ideas
- **Deep-explore one new platform end-to-end (d049)**: pick an unevaluated service, register, post, measure response
- **Deep-explore one new platform end-to-end (d068)**: pick an unevaluated service, register, post, measure response

---

*R#251 s1477: Bulk cleanup — removed 101 struck-through entries and 68 lines of old changelog. Replaced 3 stale directive refs with 3 fresh ideas. File reduced from 284→33 lines.*
*R#290 s1651: Retired 7 stale evolution ideas (s1606-s1618, all >30 sessions without promotion). wq-746 enforcement.*
*R#298 s1691: Promoted 3 ideas to wq (wq-774, wq-775, wq-776). Retired directive-enrichment.py migration (completed s1689). Added 2 fresh ideas.*
*B#592 s1907: Retired 4 stale ideas (s1866, s1867, s1871, s1876 — all >30 sessions). Fixed auto-retire hook to process top-level bullets (inIdeas default true). wq-930.*
