fix: bring back three behaviors that only ever existed downstream - #25
Merged
Merged
Conversation
Found by rebasing a downstream runtime onto main and diffing what the runtime had that main does not — not by grepping for the markers that were supposed to delimit the private parts. The marker grep said the port was complete. It was not, three times over. 1. index.mjs — the --record-conversation CLI branch. The per-turn counterpart to scripts/transcript-sweep.mjs: a hook pipes one turn in on stdin as it happens, instead of the sweep catching it later. recordConversationAsync() is exported; only the branch that reaches it was missing, so callers fell through to usage and exited 1. Turns then stop entering the conversations table silently. This branch has been lost to a refactor twice now, and the first loss ran 17 days before anyone connected the ~150 daily engram_failed warnings to it. 2. mcp-server.mjs — session host binding check. A session's host is bound at creation and every write on it is stamped with that host. If a later request on the same session presents a token mapping to a different host, the binding and the evidence disagree — exactly the case channel-derived provenance exists to prevent. Reject under enforce; keep the binding but log loudly otherwise. The silent version is provenance drifting with no signal at all. 3. mcp-server.mjs — an explicitly empty .env.local value now clears the var. `MNEME_QUARANTINE_HOSTS=` exists to turn quarantine back OFF. Under "existing env wins" an inherited value survives that line: the file says off, the env says on, and writes keep landing in a table recall never reads. That rule is right for supplying a value and wrong for withdrawing one. 280 passed / 0 failed. --record-conversation verified end to end against a temp DB (row lands, non-ASCII content intact). Co-authored-by: 千夏 <qianxia@clawgamers.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
How these were found
Rebasing a downstream runtime onto
mainand diffing what the runtime had thatmaindoes not — not by grepping for the markers that were supposed to delimit the private parts. The marker grep said the port was complete. It was not, three times over.The diff that actually worked was mechanical: every
hasFlag('--x')branch, old vs new.1.
--record-conversationCLI branch (index.mjs)The per-turn counterpart to
scripts/transcript-sweep.mjs— a hook pipes one turn in on stdin as it happens, instead of the sweep catching it later.recordConversationAsync()is exported; only the branch that reaches it was missing. Callers fall through to usage and exit 1, and turns silently stop entering theconversationstable.This branch has been lost to a refactor twice. The first loss ran 17 days before anyone connected the ~150 daily
engram_failedwarnings to it.2. Session host binding check (
mcp-server.mjs)A session's host is bound at creation and every write on it is stamped with that host. If a later request on the same session presents a token mapping to a different host, the binding and the evidence disagree — exactly the case channel-derived provenance exists to prevent.
Reject under
enforce; keep the binding but log loudly otherwise. The silent version is provenance drifting with no signal at all.3. An empty
.env.localvalue now clears the variable (mcp-server.mjs)MNEME_QUARANTINE_HOSTS=exists to turn quarantine back off. Under "existing env wins" an inherited value survives that line: the file says off, the env says on, and writes keep landing in a table recall never reads."Existing env wins" is right for supplying a value and wrong for withdrawing one.
Verification
🤖 Generated with Claude Code