Skip to content

fix: bring back three behaviors that only ever existed downstream - #25

Merged
DottytheHomeless merged 1 commit into
mainfrom
fix/lost-downstream-behaviors
Aug 3, 2026
Merged

DottytheHomeless merged 1 commit into
mainfrom
fix/lost-downstream-behaviors

Conversation

@MXAntian

@MXAntian MXAntian commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

How these were found

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.

The diff that actually worked was mechanical: every hasFlag('--x') branch, old vs new.

1. --record-conversation CLI 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 the conversations table.

This branch has been lost to a refactor twice. The first loss ran 17 days before anyone connected the ~150 daily engram_failed warnings 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.local value 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

full suite            280 passed / 0 failed
--record-conversation recorded: 1  → row lands, non-ASCII content intact

🤖 Generated with Claude Code

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>
@MXAntian
MXAntian marked this pull request as ready for review August 3, 2026 06:24
@DottytheHomeless
DottytheHomeless merged commit 85cfbcc into main Aug 3, 2026
2 checks passed
@DottytheHomeless
DottytheHomeless deleted the fix/lost-downstream-behaviors branch August 3, 2026 06:37
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.

2 participants