Skip to content

feat: add private memory hygiene discipline - #17

Merged
ruby-dlee merged 1 commit into
mainfrom
fm/memory-hygiene-m8
Jul 22, 2026
Merged

feat: add private memory hygiene discipline#17
ruby-dlee merged 1 commit into
mainfrom
fm/memory-hygiene-m8

Conversation

@ruby-dlee

Copy link
Copy Markdown
Owner

Intent

Build Firstmate's memory-hygiene discipline so private data/captain.md and data/learnings.md stay lean and robust. Add a tight agent-only internal skill, roughly 60-80 lines, that owns per-entry rule-or-fact-only essence, strips emotional or dramatic incident narrative, permits at most a one-line example or pointer, deduplicates into one owner, and applies inspect-then-update with in-place pruning; include a concise before/after example. Sharpen only AGENTS.md section 6's two private-memory routing rows plus a one-line pointer, and add the matching section 13 load trigger. Keep routing, stow behavior, and repository-wide one-owner guidance with their existing owners, do not duplicate the full standard into AGENTS.md, do not touch the actual gitignored private memory files, and keep the diff single-concern. Ship a PR but do not merge it.

What Changed

  • Add an agent-only memory hygiene skill that keeps private memory entries concise, deduplicated, action-oriented, and free of incident drama.
  • Update knowledge-routing guidance and skill triggers for changes to data/captain.md and data/learnings.md.

Risk Assessment

✅ Low: The change is narrowly scoped and satisfies the source-verifiable intent: it adds a 67-line internal memory-hygiene skill, preserves existing ownership boundaries, updates only the permitted AGENTS.md locations, and does not touch private memory files.

Testing

The already-green full baseline was supplemented with the focused stow regression and an end-to-end trigger-to-curated-memory acceptance check; the 67-line internal skill, ownership boundaries, single-concern scope, and untouched private-memory files all passed, with Markdown evidence captured instead of a screenshot because this is a non-UI agent-instruction change.

Evidence: Memory-hygiene end-to-end evidence
# Memory-hygiene end-to-end evidence

Target: `5ea5640d9f03e660cf6ff87d8c7c63246a4cd015`

This artifact follows the actual operator path introduced by the change: the private-memory routing row points to the internal skill, section 13 declares the matching load trigger, and the loaded skill shows the final curated memory shape.

## Trigger surface seen by Firstmate

From `AGENTS.md` section 6:

> Load `memory-hygiene` before writing or leaning `data/captain.md` or `data/learnings.md`; it owns the per-entry leanness standard while this section owns routing.

From `AGENTS.md` section 13:

> `memory-hygiene` - load before writing, rewriting, pruning, deduplicating, or otherwise leaning `data/captain.md` or `data/learnings.md`.

## Curated result shown by the loaded skill

Input incident narrative:

> 2026-07-22: The captain was furious after an agent tried to deploy while checks were failing, and stated very firmly that this was completely unacceptable because the incident wasted hours and created a stressful rollback.

Resulting private-memory entry:

> Require green CI before deployment. `[[deploy-incident-2026-07-22]]`

The result is one actionable rule with one evidence pointer. It removes emotion, dramatic chronology, and commentary, matching the rule-or-fact-only standard.

## Executed acceptance output

`` `text
ok - stow skill task-note contract includes recoverable body archival
ok - AGENTS.md task-note contract includes recoverable body archival
skill_lines=67
changed_files=.agents/skills/memory-hygiene/SKILL.md,AGENTS.md
private_memory_changes=none
stow_owner=unchanged
one_owner_guidance=unchanged
trigger_chain=section-6-pointer,section-13-trigger,internal-skill
curated_example=Require green CI before deployment. [[deploy-incident-2026-07-22]]
`` `

The acceptance command inspected the committed target, verified the 60-80-line bound, internal/non-invocable metadata, rule/fact-only and anti-narrative constraints, one-line example-or-pointer limit, deduplication, in-place pruning, the section 6 pointer, the section 13 trigger, unchanged stow and repository-wide one-owner owners, no private-memory-file changes, and the two-file single-concern scope.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"
  • Harness-provided successful baseline: command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"
  • bash tests/fm-stow-contract.test.sh
  • Commit-level acceptance shell check for skill length/metadata, rule-or-fact essence, anti-narrative guidance, one-line example-or-pointer limit, deduplication, in-place pruning, section 6/13 triggers, unchanged stow and one-owner guidance, two-file scope, and absence of private-memory changes
  • Manual review of bf7c5ad167514cba879cb095c091fe1627549ccc..5ea5640d9f03e660cf6ff87d8c7c63246a4cd015 and the rendered trigger → skill → curated-result evidence
  • git status --short after testing
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@ruby-dlee
ruby-dlee force-pushed the fm/memory-hygiene-m8 branch from 5ea5640 to 5468e86 Compare July 22, 2026 15:33
@ruby-dlee
ruby-dlee merged commit 27b635c into main Jul 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant