Skip to content

v0.20.0 — M016: agent memory + context passing + self-recycling evolution

Choose a tag to compare

@overdrive-dev overdrive-dev released this 24 Apr 02:21
· 362 commits to main since this release
969651a

v0.20.0 — M016: agent memory + context passing + self-recycling evolution

This is the milestone that operationalizes M013's substrate. M013 shipped the contractual scaffolding (writer ownership, advisory completion gate, three new agents). M016 wires it end-to-end across two coupled planes — and uses its own mid-milestone gate to catch two BLOCKERs in flight that would otherwise have shipped.

Highlights

  • Memory now scores. New composite-score.sh helper computes recency × frequency × citation deterministically; relevance comes from the curator's opus pass at completion. Weights 0.4/0.2/0.2/0.2 LOCKED in ADR-M016-A; decay_rate=0.0 until M018 calibrates from real telemetry.
  • Recurrence is fuzzy by design. S03's noise-floor pre-check returned 100% on synthetic-paraphrase fixture — exact-hash composition was always going to under-count. New warning-recurrence.sh ships Jaccard-similarity clustering (5-gram tokens, 0.8 threshold) as the primary grouping; hash composition is the M017 real-data-recheck fallback.
  • Context injection has budgets, overrides, and a cache. Per-cohort token budgets locked from PRD §8 (:planner-binding=4000, :planner=3000, :doer=2500, :verifier=1500, :adversarial-scout=3000, :adversarial-review=3000); per-agent overrides via .aihaus/.context-budgets user-owned sidecar; 5-min memoization cache mirrors the learning-advisor pattern.
  • Files now evolve. Two new EVOLVING contracts: project.md (nested inside MANUAL — sacred outside) and CLAUDE.md (appended at EOF — sacred outside). The curator can rewrite content INSIDE the EVOLVING markers; everything outside stays user-owned.
  • Per-agent memory is a pattern. New .aihaus/memory/agents/<agent-name>.md accumulating files. Each of the 46 agents gained an opt-in emission contract — agents return an aihaus:agent-memory fenced block when their work produced a finding/decision/gotcha worth remembering for the next invocation of their role. Orchestrator applies via Edit at the new completion-protocol Step 4.7b. Single-writer per ADR-001.
  • Skill evolution joins agent evolution. New SKILL-EVOLUTION.md per-milestone ledger paralleling the existing AGENT-EVOLUTION.md. Pre-apply gate validates skill edits stay ≤200 lines + retain valid frontmatter before any apply lands.
  • Curator now fires every milestone. Removes the silent-skip class from M013-B by making the spawn unconditional. Empty inputs emit explicit <!-- no-signal-this-milestone --> markers (telemetry awk filters these out of length-capped rotation).
  • Scaffolding is hook-enforced. New scaffold-assert.sh hook wires into phase-advance.sh on planning→running transition. Exit 13 if AGENT-EVOLUTION.md or SKILL-EVOLUTION.md is absent or empty. Closes the M014 silent-skip class as a hook gate (not prose).

Downstream-install impact

  • .gitignore injection. install.sh + install.ps1 now inject .aihaus/audit/ and .claude/audit/ paths into the target repo's .gitignore with a guard-comment block (# AIHAUS:GITIGNORE-START / # AIHAUS:GITIGNORE-END). Idempotent across re-runs. Prevents downstream users from silently committing audit JSONLs into their git history (closes contrarian F2 from the M016 brainstorm).
  • update.sh backfill for existing installs. update.sh gained a --no-gitignore flag and explicit user-prompt gate for one-shot backfill. Net-new scope carve-out (update.sh previously only touched skills/agents/hooks/templates). R3 mitigation: non-destructive, behind [y/N] prompt, --no-gitignore bypass available.

Contract amendments

  • ADR-001 single-writer: preserved. Every new file gets exactly one named writer; ADR-M016-A and ADR-M016-B writer tables are explicit. Cluster A reconciliation (3 shared rows between ADR-M016-B and the row-additive amendment to ADR-M013-A) verified byte-identical 3 times across architecture, ADR, and story spec.
  • ADR-004 RUN-MANIFEST + exit-13: ADR-M016-B amends ADR-004 to recognize scaffold-assert.sh as a Step E2 gate. Inherits exit-13 semantic.
  • ADR-M013-A: row-additive amendment (3 new writer-table rows) via S13. Existing rows unchanged.
  • ADR-M013-B: advisory-first completion gate preserved. S15b's unconditional curator cadence keeps gate condition B semantics intact.
  • project.md MANUAL contract: nested EVOLVING block introduced. Content OUTSIDE the EVOLVING block remains "yours, never touched" per the original contract.

Mid-flight saves (mid-milestone gate caught these)

The new mid-milestone adversarial gate primitive (Step E5.5, this milestone's own design — first ever invocation) caught two execution-blocking issues before file-plane work began:

  1. ADR-M015-A ID collision — local .aihaus/decisions.md had a freshly-drafted "ADR-M015-A: Memory scoring" while pkg/.aihaus/decisions.md:1415 already had "ADR-M015-A: Drop Cursor support" shipped in v0.19.0. Renumbered everything M015→M016 (single atomic commit 9a75840 — 12 files in pkg//tools/, plus all local artifacts).
  2. ADR-M013-A single-writer violation — S08's tools/telemetry-collect.sh was writing .aihaus/memory/global/architecture.md directly. Refactored stdout-only; orchestrator now captures + applies via Edit at completion-protocol Step 6.7 (commit 6c41847).

The final adversarial pass caught a chicken-and-egg bootstrap defect (M016's own SKILL-EVOLUTION.md scaffold missing because scaffold-assert.sh didn't exist when M016 transitioned planning→running). Trivial fix; future milestones (M017+) are gated correctly.

Stories

22 stories total. Branch milestone/M016-260422-agent-memory-context-evolution carries 19 commits (S01, S09, S10, S17 are review/no-commit stories).

Plane Stories
Data-plane S00, S02, S03, S04, S04.5, S04.6, S05, S06, S07, S08, S09, S09.5, S10
File-plane S11a, S11b, S12, S13, S14, S15a, S15b
ADR S16
Reviews S01, S10, S17

Deferred to M017+

  • Closed-loop "auto reciclável" reading (~20 LOC retrieval-pattern reinforcement) — user-accepted M017 candidate
  • Decay-rate calibration (decay_rate > 0.0) — M018 after M017 pre-prune snapshot per RESEARCH §R6 survivor-bias mitigation
  • Regression-detection for applied agent-body edits — M017; S11b audit trail makes this tractable
  • Adversarial-signal telemetry parity for downstream installs — tools/telemetry-collect.sh is maintainer-only today; ship-vs-defer is M016+ observation decision
  • M017 real-data noise-floor recheck — kill-switch clause in ADR-M016-A: if real recurrence noise <30%, supersedes this ADR with schema_version: 1-pre-revision retro-mark
  • Supersession blocks ship as committed contract (aihaus:knowledge-supersede, aihaus:evolution-supersede); first FIRE at M017+ when ledgers accumulate

Upgrade

cd ~/tools/aihaus
git pull
bash pkg/scripts/update.sh --target /path/to/your/repo
# When prompted, accept the .gitignore backfill (or pass --no-gitignore to skip)

Footnotes

  • Renumbering scar: commits 17a8268-7deab6a carry M015-S0X subjects in their messages (historical record of when the M015→M016 collision was discovered mid-flight). All commits from 9a75840 onward use M016-S0X correctly.
  • Verification: Step E7 verifier=PASS (10/10 PRD acceptance criteria), integration-checker=PASS (15/15 e2e chains).

🤖 Generated with Claude Code