Repository navigation
Conversation
…ring it (fixes danielmiessler#2642) Writes go through MemorySystem.add, which uses fixed paths, so --memory-root (CLI) and runtime.memoryRoot (in-process adapter, unless memoryAdd is supplied) are now refused rather than silently ignored. Read commands keep --memory-root. Negative control and green run are in danielmiessler#2642 and the PR body.
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.
Fixes #2642.
rememberandproposeaccepted--memory-rootbut returned before reading it, andMemorySystem.add()always writes to the install's fixed memory paths. So--memory-root <test dir>exited 0 and wrote into the livePRINCIPAL_MEMORY.md. The in-process adapter had the same gap throughruntime.memoryRoot. This refuses both instead of ignoring them:Cortex.tsallowed sets:--memory-rootis removed fromrememberandpropose, so the existing parser refuses it with exit 4 ("Unknown option for remember: --memory-root"), asCortexContract.mdalready promises for inapplicable options ("rejected rather than ignored").Cortex.tswrite branch: refusesruntime.memoryRoot(exit 4) unless the caller also suppliesruntime.memoryAdd, the existing test seam for writes, so tests that inject a writer keep working.status,search,timeline,get,exportandrebuildstill accept--memory-root, andcreateCortexAdapter(name, { memoryRoot }).status()still works.Memory/CortexContract.md: says the write commands refuse a memory root, and states the memory-entry prefix rule thatCortex.ts rememberreturns ok:true and exit 0 for a memory entry it silently drops (bad prefix or over 256 chars) #2641 enforces.Why refuse rather than wire it (options and verdicts are in #2642):
add()resolves fixed USER-data paths behind the boundary and tier checks, and moving them per call is a much larger change. #1526 made the same call forpaths.memoryDir: "a config field that LOOKS live but isn't misleads every reader."Example
Testing
All runs use the standalone script in #2642 (Repro section): a synthetic throwaway install under
$TMPDIRwith fake memory, the realCortex.tsandCortexAdapter.tsfrom the tree under test, deleted on exit.upstream/mainf6ab5e0,LifeOS/install/LIFEOS):remember --memory-root <other dir>exits 0 and the entry lands in the install's own memory file (0 files in the other dir); the adapter with{ memoryRoot }does the same.RED: a memory root was accepted and ignored on a write.propose --memory-rootexits 4;status --memory-rootexits 0.GREEN: writes refuse a memory root (CLI and in-process).--memory-rootorruntime.memoryRootto a write (grep overLifeOS/at f6ab5e0: the only TypeScript users of--memory-root/memoryRootare the read paths inCortex.ts,CortexBenchmark.tsandCortexHealth.ts, and nothing outsideCortexAdapter.tsconstructs an adapter).Cortex.ts rememberreturns ok:true and exit 0 for a memory entry it silently drops (bad prefix or over 256 chars) #2641's branch: no conflicts, and both repro scripts are green on the combined tree.Notes
Cortex.ts rememberreturns ok:true and exit 0 for a memory entry it silently drops (bad prefix or over 256 chars) #2641 (single memory add refused when the writer would drop it). This PR'sCortexContract.mdchange documents that rule too.