Repository navigation
v0.20.0 — M016: agent memory + context passing + self-recycling evolution
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.shhelper computes recency × frequency × citation deterministically; relevance comes from the curator's opus pass at completion. Weights0.4/0.2/0.2/0.2LOCKED in ADR-M016-A;decay_rate=0.0until 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.shships 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-budgetsuser-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) andCLAUDE.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>.mdaccumulating files. Each of the 46 agents gained an opt-in emission contract — agents return anaihaus:agent-memoryfenced 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.mdper-milestone ledger paralleling the existingAGENT-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.shhook wires intophase-advance.shonplanning→runningtransition. Exit 13 ifAGENT-EVOLUTION.mdorSKILL-EVOLUTION.mdis absent or empty. Closes the M014 silent-skip class as a hook gate (not prose).
Downstream-install impact
.gitignoreinjection.install.sh+install.ps1now inject.aihaus/audit/and.claude/audit/paths into the target repo's.gitignorewith 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.shbackfill for existing installs.update.shgained a--no-gitignoreflag and explicit user-prompt gate for one-shot backfill. Net-new scope carve-out (update.shpreviously only touchedskills/agents/hooks/templates). R3 mitigation: non-destructive, behind[y/N]prompt,--no-gitignorebypass 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.shas 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.mdMANUAL 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:
- ADR-M015-A ID collision — local
.aihaus/decisions.mdhad a freshly-drafted "ADR-M015-A: Memory scoring" whilepkg/.aihaus/decisions.md:1415already had "ADR-M015-A: Drop Cursor support" shipped in v0.19.0. Renumbered everything M015→M016 (single atomic commit9a75840— 12 files inpkg//tools/, plus all local artifacts). - ADR-M013-A single-writer violation — S08's
tools/telemetry-collect.shwas writing.aihaus/memory/global/architecture.mddirectly. Refactored stdout-only; orchestrator now captures + applies via Edit at completion-protocol Step 6.7 (commit6c41847).
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.shis 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-revisionretro-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-7deab6acarryM015-S0Xsubjects in their messages (historical record of when the M015→M016 collision was discovered mid-flight). All commits from9a75840onward useM016-S0Xcorrectly. - Verification: Step E7 verifier=PASS (10/10 PRD acceptance criteria), integration-checker=PASS (15/15 e2e chains).
🤖 Generated with Claude Code