Repository navigation
Memory maintenance: a read-only index guard reading the client's own limits; auto-dream detection; auto-memory row - #1149
Open
seathatflowsinourveins wants to merge 1 commit into
Conversation
…s to the auto-memory row tools/memory-index-guard/: a stdlib guard for python3 -I, run by a systemd user timer every 6 h with OnFailure=stack-alert@%n.service. It reads the MEMORY.md caps from the installed client binary (identifiers bound through the loader's user-visible warning, values through the declaration beside the MEMORY.md literal; unknown unless both bind), measures every auto-memory index as the client does (JavaScript trim, UTF-16 code units, UTF-8 bytes reported too), reports autoDreamEnabled and only the enabled and available fields of the tengu_onyx_plover flag, and when a .consolidate-lock mtime moves forward keeps a before and after tar of the memory directory with a names-and-counts diff in its 0700 state directory. Exit 1 on an index at 90% of a cap or a new consolidation; unknown caps or an unknown flag are reported and never alert. The auto-memory slot row (slots.json, native-clients.md, slots.md) gains notes on consolidation (inert while the server flag is off), the index limits, the guard, and the ai-memory 2.6.3 maintenance facts (no consolidate CLI; lint and forget-sweep are HTTP clients of the server; the server's built-in [maintenance] runs, so no extra timer). Its overturn condition names the flag and the paired check of the first dream run, and its repository-tracked rejection drops the stale inert claim (memory.md:516,526). The slot manifest's label, differs lists and note follow. Evidence with quoted lines, binary offsets and measurements: evidence/artifacts/memory-maintenance-20261015/. Tests: tests/test_memory_index_guard.py (44) and tests/test_native_practice_memory_maintenance.py (13); both fail at 0f4ee07. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
0f4ee075blane:foundationtools/memory-index-guard/(new: the guard, README, service and timer);tests/test_memory_index_guard.pyandtests/test_native_practice_memory_maintenance.py(new);slots.json,native-clients.mdandslots.md, plus the slot manifest;evidence/artifacts/memory-maintenance-20261015/(new);manifests/evidence.json.The guard (
tools/memory-index-guard/memory_index_guard.py, stdlib,python3 -I):"MEMORY.md",X=<int>,Y=<int>declaration, so nothing is hard-coded, and anything unbound is "unknown". Measured: 200 lines and 25,000 code units, on 2.1.296, 2.1.299 and 2.1.300.autoDreamEnabledand the server flag'senabledandavailablefields, reading only that key..consolidate-lockmtime; the client storeslastConsolidatedAtthere (2.1.300 binary offset insources.json).overturn_when.OnFailure=stack-alert@%n.service. 0 when limits or the flag are unknown (fail-open). 2 when the guard's own state is unusable.Slot row
auto-memory:autoDreamEnabled: truein user settings, applied by the command center 2026-10-15 00:45 ET after the owner asked. It is inert while the server flag is off (measured:enabledfalse, noavailable).consolidateCLI; consolidation is the MCPmemory_consolidate, dry run first.lint --dry-run --no-llmandforget-sweep --dry-runare HTTP clients of the running single-writer server.[maintenance]block, which this host already runs, so no extra timer is added.overturn_when: the flag becoming available triggers the paired check of the first dream run.autoMemoryDirectoryis inert. memory.md:516,526 says it is honoured from project settings once the folder is trusted.Measured on this host (06:25:55Z):
SOTA sources
CHANGELOG.md(sha256 8c6fdbbd…): L1392, L2555, L4098, L4139, L4580, L6619, L6844.evidence/artifacts/memory-maintenance-20261015/sources.json, with 59 quotes, each checked byte for byte against its source.docs/ARCHITECTURE.md:721-722, 828-833;docs/install.md:2457-2469;crates/ai-memory-cli/src/config.rs:37, 705;commands/lint.rs:1,10andcommands/forget_sweep.rs:1,10;crates/ai-memory-mcp/src/server.rs:320-329, 1160-1162.String.prototype.trimcode points, measured in Bun 1.4.2 and Node v24.21.0 (js-trim-set.json).Evidence-class table
native_provenextract-results.json(2.1.296, 2.1.299 and 2.1.300)native_provenindex-measurement.json(project names masked)source_reviewsyntheticLocal commands run
Notes for the reads
durable-memoryslot row exists; it is a foundation layer. The ai-memory facts sit in the auto-memory row next to its durable-memory route.sha256_when_labeled, so later ones need a manifest rebase.Checklist
🤖 Generated with Claude Code