fix(stow): add opt-in pass horizon for memory decay - #2850
Conversation
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains within the eligible follow-up review scope. No blocking failure remains. Reviews (2): Last reviewed commit: "no-mistakes(review): Preserve frozen cou..." | Re-trigger Greptile |
|
Speaking as Kun's firstmate: Scheduled 3:10am PT 8/23 pass. Main reconfirmed VISION (inspected Class: default-behavior. NEVER auto-eligible. The 30-day clock never firing is the reported defect, but the chosen fix is a new default policy (N=10 aging / N=3 perishable), not restoration of the existing wall-clock contract. Issue #2410 ready-for-pr asked for a horizon that fires in daily-stow homes without dropping evidence-based restamp; that is a queue label, not a merge vote. Security: none. Skill policy text only. No Overlap / HOLD: none of the standing spawn/teardown/herdr holds. No CI / NM: HEAD Workflows: already approved (CI completed SUCCESS on this HEAD). Run IDs: 32629683320 (CI), 32629683354 (Require no-mistakes), 32630470746 (Require no-mistakes). No pending first-time-fork approval. Land-eligible rec: NO (default-behavior). Captain-flag NOW: yes — N=10/3 as a default archival cadence is a product call; firstmate already asked for a pass-count horizon on #2410, but that is not consent to land a new default. |
The tiered decay clocks were wall-clock only, while admission is per-pass: each /stow admits the findings that pass produced. In a home that stows daily those two rates diverge by the stow cadence, an entry the fleet keeps exercising never reaches 30 days unreinforced, and memory only grows while the pass reports decay evaluated. Give each dated marker an optional unreinforced-pass counter and make both tiers stale at whichever horizon comes first: 10 passes or 30 days for aging, 3 passes or 7 days for perishable. Reinforcement clears the counter and nothing else does, so the existing evidence-based restamp rule stays the only way an entry renews its lease. An absent /N means zero, so entries that stay exercised carry no extra marker bytes, and a rarely stowed home keeps its current behaviour through the unchanged date horizon.
The unreinforced-pass horizon shipped as a new default archival cadence, which is a product default rather than a restoration of the existing wall-clock contract. Keep the 30-day and 7-day horizons as the only default clock, and put the 10-pass and 3-pass horizons behind an explicit opt-in: config/stow-pass-horizon for the firstmate home, and the file's own header pointer for the public skill. With the opt-in absent no counter is written and no counter is read, so a home that does not ask for it decays exactly as it does today.
71eacbb to
a5a2425
Compare
|
Speaking as Kun's firstmate: Re-inspect after the 3:10am flag. Title and HEAD moved: now VISION (current main Matching Not land-eligible this pass. When CI is fully green this is auto-eligible as opt-in. Not waiting on a captain product call anymore. |
|
Amended per the triage: the unreinforced-pass horizon is now opt-in, and defaults are unchanged. The wall-clock contract is restored as the only default -
Still policy text only: no executable decay consumer, no new script or parser. On the "field incidents become coverage - cannot tell" rule, that is unchanged and for the same reason - nothing executable implements decay, and the coding guidelines forbid tests that assert instruction-source bytes, so the evidence stays a deterministic simulation rather than a repo test. It now leads with default-equivalence: with the opt-in absent, 60 daily passes are byte-identical to a separately written pre-change wall-clock-only model (40 -> 132 entries), against 40 -> 82 with the opt-in on, and a monthly-cadence home serializes identically either way. Two contract gaps surfaced during this round and are fixed here, both worth noting since they bear directly on "defaults unchanged":
|
|
Speaking as Kun's firstmate: Scheduled 7:10am PT 8/23 pass. VISION.md was read in full from then-main Newer activity since 3:10am and since the 14:23Z waiting-CI stamp: HEAD VISION (inspected Class: opt-in. Auto-eligible class. The previous default-behavior 10/3-on-every-/stow shape is gone. Security: none. Skill policy text, AGENTS.md layout line, and configuration docs only. No Overlap / HOLD: none of the standing spawn/teardown/herdr holds. No CI / NM: HEAD Workflows: already approved (CI completed SUCCESS on this HEAD). Run IDs: 32644793587 (CI), 32644793598 (Require no-mistakes), 32644837231 (Require no-mistakes, body edited). No pending first-time-fork approval. Land-eligible rec: YES (opt-in; default clocks unchanged; matching NM attestation; green CI; no hold overlap). Captain-flag NOW: no — the 3:10am product call was the default-on horizon; that default is now off. |
|
Speaking as Kun's firstmate: this is merged. Thank you @karotkriss — really appreciate you taking the time on this. |
Intent
Fix #2410: the
/stowskill's tiered memory-decay clock never fires in a home that stows daily, sodata/learnings.mdonly grows and the startup-memory budget never converges. The reporter measured eight consecutive passes going 12,325 -> 12,733 estimated tokens against a 7,500 budget, with all 40 entries carrying last-reinforced dates 0-3 days old, so no entry could ever age out.Root cause: admission and decay are not commensurable. A pass admits the findings that pass produced, so growth is a per-pass quantity, while the only decay horizon was wall-clock (30 days aging, 7 days perishable). In a home that stows daily those rates diverge by the stow cadence, an entry the fleet keeps exercising never sits unreinforced for 30 wall-clock days, and the date horizon is evaluated vacuously every pass.
This revision follows maintainer triage of the first attempt, which was ineligible because it made the pass horizon a new default archival cadence. New capability should arrive opt-in, so the wall-clock contract is preserved exactly as the only default and the pass horizon becomes something a home switches on.
Default, unchanged: an
agingentry is stale at >= 30 days since its last-reinforced date and aperishableentry at >= 7 days. While the opt-in is absent, no unreinforced-pass counter is ever written and no counter already present in a file is ever read.Opt-in: an
agingentry additionally becomes stale after 10 passes that evaluated it without reinforcing it, and aperishableentry after 3, whichever horizon it reaches first.The two skill surfaces are deliberately independent files with no shared code, so each opts in through its own existing convention:
.agents/skills/stow/SKILL.mdgates the horizon on the local, gitignoredconfig/stow-pass-horizonpresence flag, matching the shape ofconfig/trace-context. It is registered inAGENTS.md's layout and documented in a newdocs/configuration.mdsection. It is per home and not inherited by secondmate homes, because stow cadence is a property of the home doing the stowing.skills/stow/SKILL.mdis installer-facing and cannot see a Firstmate config directory, so it reuses the per-file header pointer that already optionally names a file's default tier:<!-- memory tiers: see the stow skill; pass horizon -->, one file at a time, and the skill never adds that opt-in on its own initiative.The optional marker spelling is
<!--a:YYYY-MM-DD/N-->, where an absent/Nreads as zero, so opting in needs no migration. Reinforcement refreshes the date and clears the counter, and nothing else clears it, so the pre-existing evidence-based restamp hard rule remains the only way an entry renews its lease. Removing the opt-in freezes any/Nalready written and preserves it byte-for-byte rather than normalizing it away. Archive provenance records the counter and the exactunreinforced <N>preason only when the pass horizon is what made the entry stale, and omits it when the wall clock or any other reason caused archival.Deliberately unchanged: the decay clocks live in skill policy text rather than in any executable, so this adds no script and no parser. No test is added because there is no executable decay consumer and the repo's guidelines forbid tests that assert instruction-source bytes, so the behavioral evidence is the deterministic simulation below. The last-reinforced date is retained because budget eviction is oldest-reinforced-first, and
docs/verification/stow-memory.mdis untouched because its guarantee is about git-excluded skill discovery.What Changed
config/stow-pass-horizon, or per public-skill memory file through its header pointer.Fixes #2410
Risk Assessment
✅ Low: The change cleanly preserves default wall-clock decay while adding the bounded pass horizon behind explicit opt-ins with correct counter freezing and archive provenance.
Testing
The supplied simulation was rerun, the corrected amended simulation exercised all eight acceptance scenarios plus archive provenance, its output matched the recorded evidence byte for byte, the PR body matched that evidence, and the overall targeted validation passed.
Evidence: Amended stow decay simulation transcript
Source: Amended stow decay simulation transcript
Evidence: Reproducible amended simulation source
Source: Reproducible amended simulation source
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed ✅
skills/stow/SKILL.md:97- The required opt-out invariant says “removing the opt-in freezes any /N already written rather than rewriting it,” but this changed text says an unopted file “never carries one,” and the only later rule says not to read or write it. Trace<!--a:2026-08-01/6-->after removing; pass horizon: an agent is expressly told the file cannot carry/6and may normalize it to the date-only marker, so the counter is not guaranteed to survive re-enabling. Replace “never carries one” with “never writes one” and explicitly require an existing/Nto remain byte-preserved while the header opt-in is absent, matching the internal skill’s removal rule..agents/skills/stow/SKILL.md:135- The required provenance contract says the counter andunreinforced <N>preason appear only when the pass horizon fired, but both skill surfaces currently include the counter whenever the marker carried one, and the public surface does not require the exactunreinforced <N>pspelling. For an opted-in monthly pass, a legacy marker at day 30 is incremented from 0 to 1 and then archives on the wall-clock horizon; this rule serializes counter 1, so opted-in and default monthly output differ despite the required identical serialization. Require both the counter and exact pass reason only for pass-horizon archival, and omit the counter when the date or another reason caused archival.🔧 Fix: Preserve frozen counters and correct archive provenance
✅ Re-checked - no issues remain.
🔧 **Test** - 2 issues found → auto-fixed (3) ✅
/tmp/fm-fm-2410-optin-amend/stow-decay-simulation.py:31- The amended simulation does not demonstrate byte-preserving opt-out.marker(entry, False)removes an existing/N; a focused assertion expected<!--a:2026-01-01/5-->but received<!--a:2026-01-01-->. The simulation only preserves the in-memory counter, so requirement (8) remains unproven and its serialization model contradicts the policy.config/stow-pass-horizonpresence flag or public per-file header opt-in.Fixes #2410is present, but the body must be amended to the accepted opt-in shape.Inspectedgit diff 505c8195122b6d3e3a04fa48c13cd184df0321ba..a5a242571fe7e232fc32b8c8f644b99290930b56.Ranpython3 /tmp/fm-fm-2410-optin-amend/stow-decay-simulation.pyand recorded its transcript.Ran a focused Python assertion againstmarker(entry, False)with an existing counter of 5 to verify byte-preserving opt-out serialization.Rangh-axi pr view 2850 --fullto verify the live PR description andFixes #2410.Rangit status --shortafter testing to confirm no worktree artifacts were introduced.🔧 Fix: Captain: preserve frozen counters in opt-out simulation
1 error still open:
config/stow-pass-horizonpresence flag or public per-file header opt-in, and its embedded model removes/Nduring opt-out instead of byte-preserving it. Update the body and evidence using the amended opt-in transcript.Fixes #2410is already present and must remain.Inspectedgit diff 505c8195122b6d3e3a04fa48c13cd184df0321ba..a5a242571fe7e232fc32b8c8f644b99290930b56for both stow skills, configuration documentation, and AGENTS.md.Ranpython3 /tmp/fm-fm-2410-optin-amend/stow-decay-simulation.py.Ranpython3 /home/cmckay/.no-mistakes/evidence/01M0QDY41DXAETXDHB4ABPK8XW/stow-decay-simulation-amended.py.Inspected the complete PR body withgh-axi pr view 2850 --full.Verifiedgit status --shortremained empty andgit rev-parse HEADremaineda5a242571fe7e232fc32b8c8f644b99290930b56.🔧 Fix: Update PR evidence for opt-in stow horizon
1 error still open:
/tmp/fm-fm-2410-optin-amend/stow-decay-simulation.py:31- The supplied amended simulation still contradicts required scenario 8. After a counter reaches/5,marker(entry, False)serializes<!--a:2026-01-01-->instead of byte-preserving<!--a:2026-01-01/5-->. The PR body claims the corrected scenario passed, so its recorded evidence is not reproducible from the named source.python3 /tmp/fm-fm-2410-optin-amend/stow-decay-simulation.pyFocused Python assertion ofmarker(Entry(..., unreinforced_passes=5), False) == '<!--a:2026-01-01/5-->'gh-axi pr view 2850 --fullManual comparison of the target diff against the eight behavioral acceptance scenarios🔧 Fix: Verify byte-preserving opt-out counter simulation
✅ Re-checked - no issues remain.
Inspectedgit diff 505c8195122b6d3e3a04fa48c13cd184df0321ba..a5a242571fe7e232fc32b8c8f644b99290930b56for the four changed policy and configuration filespython3 /tmp/fm-fm-2410-optin-amend/stow-decay-simulation.pypython3 /home/cmckay/.no-mistakes/evidence/01M0QDY41DXAETXDHB4ABPK8XW/stow-decay-simulation-amended.pydiff -u /home/cmckay/.no-mistakes/evidence/01M0QDY41DXAETXDHB4ABPK8XW/stow-decay-simulation-amended.txt <(python3 /home/cmckay/.no-mistakes/evidence/01M0QDY41DXAETXDHB4ABPK8XW/stow-decay-simulation-amended.py)Inspectedgh-axi pr view 2850 --fullto verify the PR body describes the accepted opt-in design, includes the reproducible transcript, and retainsFixes #2410✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.