Skip to content

fix(security): date-shaped evidence reads, ownership-checked merges, redact-before-crop capture (#130 #131 #132) - #135

Merged
abogartz merged 7 commits into
abogartz:mainfrom
WhollyMindless:fix/security-130-132
Oct 28, 2026
Merged

abogartz merged 7 commits into
abogartz:mainfrom
WhollyMindless:fix/security-130-132

Conversation

@WhollyMindless

@WhollyMindless WhollyMindless commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #133

The three mediums sit on top of #133's branch (semantically, too: the #131 fix authorizes rows against #127's entry-resolved Reader, and its tests use #133's toolIds/harness seams). Until #133 merges, this PR's diff includes its commits — this PR's own commits are bc9eebd (the three fixes), 9802cf0 + 156e887 (follow-up review round), aab5537 (platform-hardening of the probe-5 fixture), 152d613 (binding the evidence-path control's session under #133's private-evidence rule), on top of #133's 9a7c674. The whole stack rebased onto main 0.14.11 (#145+#146) on 2026-10-27; earlier commit SHAs quoted below are the pre-rebase history preserved in the review threads. After #133 merges I will rebase this branch onto main and force-push, at which point the diff becomes exactly these commits; the checks below run on the full branch either way.

Closes #130, closes #131, closes #132.

What changed

#130 — memory_evidence date is a date, not a path

Two doors, per the issue:

  • EvidenceArgs.date (schema boundary): ^\d{4}-\d{2}-\d{2}$, so ../../outside, ..\..\outside and ../YYYY-MM-DD are refused as invalid arguments … nothing was done before any filesystem call.
  • evidenceFileFor() (second door, src/evidence.ts): impossible dates (2026-02-30) refused rather than rolled by Date onto another day; containment checked after resolve(); a day file symlinked out of the evidence dir is not followed. The forced .logfmt suffix remains the primitive's residual bound either way.

boundaries.test.ts's wire pin records the (intentional, now host-visible) date pattern. The ~standard key visible in that pin's failure diff is a non-enumerable zod standard-schema annotation present on every tool's wire output (verified against MergeReviewArgs), unrelated to this change.

#131 — a row id is a pointer, not authority

memory_merge_review resolves and authorizes BOTH seats through the caller's Reader (captured at entry, never re-read after an await, #127), and the whole resolve/check/mutate runs under the same update-order lock memory_update serializes on (#125) — acquisition order is always update-order then store-file locks, never the reverse, so it cannot deadlock against a plain writer; on timeout it fails closed with nothing written.

The contract, now in the tool description: a session may merge exactly the rows it may read. Global rows (explicit or legacy-unstamped) are mergeable from anywhere; a row belonging to another repository is refused in either seat — retiring it as loser or promoting/reviving it as survivor — before any mutation, no partial apply, no evidence line. Success now records merge_resolved naming the session the merge ran FOR.

The follow-up review's probe 2 (an UNBOUND session merging under the last setup's module scope, defeating the ownership check) is closed by #133's entry binding at this head: the caller resolves to its own instance's workspace before the seats are authorized. Pinned by a committed regression (284166a; red at c9791ed, green here).

#132 — redact the COMPLETE transcript, THEN crop

captureSession mined transcript.slice(-8000) and let buildCapturePrompt's scrub handle the WINDOW. The PEM regex needs both BEGIN and END markers, and the prefix families (ghp_, sk-, …) need the prefix — a credential the crop cut in half matched nothing and rode to the configured capture model as a fragment (the issue's proof: key-body fragments + END marker verbatim in the prompt). Now: redactSecrets(transcript).slice(-8000); the window scrub stays as defense in depth.

Review probe 5 — merge_review reports a post-mutation failure as PARTIAL (8490534)

The catch at the bottom of memory_merge_review was written for the lock-timeout contract ("nothing was done"), but the evidence record() sits inside the same try: when it failed AFTER markSuperseded succeeded, the loser was retired on disk while the tool told the caller nothing happened. The catch now tracks the mutation: pre-mutation throws keep the documented no-op contract verbatim; post-mutation throws return a PARTIAL report naming the retirement that stands, carrying the failure reason, and pointing at memory_undo (re-running is idempotent).

Test evidence

Ten new regression tests (4 + 4 + 2) plus the two follow-up probes. The ten split into 7 vulnerability regressions (path traversal, impossible date, symlink-not-followed, cross-repo loser, cross-repo survivor, token-straddle, PEM-straddle) and 3 behavior-preservation controls (today's evidence readable; global rows mergeable from anywhere; same-repo merge resolves with evidence). The seven are red on cf9b73c (upstream main, 0.14.9 — verified by running these exact files in a throwaway checkout of that revision) and green here; the three controls are green on BOTH revisions. Caveat: the symlink case early-returns on Windows, so only six of the seven execute red there — on a platform that runs it, all seven do. Probe 2 is red at c9791ed / green here; probe 5 red at 03d009f / green at 8490534.

Here: 554 pass / 5 skip (bun test, Bun 1.3.10), tsc --noEmit clean, biome lint 0 errors. (This machine additionally shows the service-host stamp e2e failing for a sandbox reason — no git for the spawned service — identical on the reviewed base; green in CI.) The crop tests drive the real session.compaction hook and assert on the prompt actually handed to the capture model; their straddle guards derive from the same flattenTranscript output the capture path mines, so the guards hold on any revision and only the behavior assertions flip.

The second re-review round's two unresolved-server-session probes (test/security-evidence-unbound-server.test.ts, #133's 65812bc → a909685) pass on this head too — 7/7 probes across the stack. One adaptation here was required: the evidence-path readability control wrote its marker for an UNBOUND ses-130, which #133's new private-to-session rule correctly hides; it now binds that session to the workspace (4beccfa) instead of exploiting the missing-stamp path. And #133's 203240f scopes the foreign-stamp probe assertion to A's own evidence line: main's 0.14.10 (#142) plugin_load boot record legitimately stamps B's repository in the shared day file, which a whole-file scan mistook for the leak — A's line was correctly unstamped on CI too.

Not in this PR

Nothing deferred: #128's evidence-READ repo scoping, previously noted here as a possible follow-up, landed on the #133 side (d56956e, completed by a909685) — evidence lines stamp their repository, a missing stamp is not the global marker, and memory_evidence filters by the caller's reader and sid.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Follow-up review of this PR at c9791ed7efc48eb200fefc3593f03dcb07d8b6d9, including #133 at a8c5b7a4864476dcfceca0d9232ab000792e6589: please address the remaining cases below before marking the stack ready. The date-traversal and capture-crop fixes address the reproduced bugs in #130 and #132; #131 remains incomplete.

  1. P1 — merge authorization inherits the unbound-session identity flaw (security: concurrent and unbound sessions can inject another repository's private memories (high) #127 / security: memory_merge_review can supersede another repository's rows (medium) #131). Load plugin A, then plugin B, without binding A's session in the session map. Call A's real memory_merge_review with a ToolContext naming that unbound session and two B-owned row IDs. The call reports success and retires B's loser. readerForSession() uses sessionScope(sid) ?? repoScope(), so the most recent setup's shared repository becomes the caller's authority. The ownership checks work for correctly bound callers, but the fallback defeats them. Resolve the caller's own identity or restrict unresolved sessions to global rows; add the multi-setup/unbound regression. Reader fallback, authorization.

  2. P2 — merge reasons still persist recognized credentials in daily memory rows (security: tool-output evidence stores recognized credentials without redaction (high) #128 follow-up). A same-repo merge with a synthetic ghp_ token in reason produces scrubbed evidence, but the loser’s daily .logfmt row contains the token verbatim because markSuperseded() receives the raw reason. This is a residual write-path gap, not a claim that the ordinary tool-output scrub regressed. Scrub/reject credentials at the supersession write boundary and retain a regression covering both the daily row and the evidence line. Raw reason write.

  3. P2 — the new catch reports a completed mutation as “nothing was done.” With a synthetic filesystem fault preventing evidence writes, markSuperseded() succeeds before record() throws. The catch reports “the store was busy past the lock budget — nothing was done. Retry.” even though the loser is already superseded. Catch lock-acquisition timeouts separately and report post-mutation failures accurately, or provide rollback; do not promise a no-op after mutation. Catch.

The stack also retains #128's acknowledged evidence-read gap: a bound A session calling memory_evidence receives B's ordinary tool-output summary. Please resolve that in #133 or explicitly split the outstanding requirement before closing #128. Similarly, please keep #131 open and adjust the automatic closure claim until the unbound-caller probe passes.

Validation on Windows / Bun 1.3.10 at this combined head: bun test ./test/ → 537 pass, 5 skip, 0 fail; typecheck passes; lint reports no errors. The five additional probes below all fail on the reviewed head and exercise the actual registered hooks/tools through the fake-host harness, using temporary stores and synthetic credentials. They are not real-host end-to-end exploit tests. The shipped symlink regression returns early on Windows, so this local run does not verify that case.

Please commit regressions based on these probes, make them pass, and rerun the existing suite. Probe 5 first confirms the current partial mutation as diagnostic evidence; if the fix chooses rollback instead, update that setup assertion to the intended rollback contract.

Reproducible five-probe file for the combined PR #135 head

Save this as review-probes.test.ts at the repository root of the reviewed head, install the locked dependencies, and run bun test ./review-probes.test.ts. These assertions deliberately expect the corrected behavior; failures demonstrate the remaining gaps.

import { afterEach, beforeEach, expect, test } from "bun:test";
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { basename, dirname, join, resolve } from "node:path";
import { loadPlugin, type LoadedPlugin } from "./test/harness.ts";
import { appendMemory, isActive, loadAll } from "./src/memory.ts";
import { rememberSessionDir, resetSessionScopes, resolveRepo, setRepoScope } from "./src/repokey.ts";
import { resetState } from "./src/state.ts";
import { dateStr, evidenceDir, memoryRoot } from "./src/config.ts";
import { redactSecrets } from "./src/secrets.ts";

let root: string, a: string, b: string;
let plugins: LoadedPlugin[];
beforeEach(() => {
  root = mkdtempSync(join(tmpdir(), "osi-review-proof-"));
  a = join(root, "repo-a"); b = join(root, "repo-b");
  mkdirSync(a); mkdirSync(b);
  process.env.OPENCODE_MEMORY_DIR = join(root, "memory");
  process.env.OPENCODE_COMMANDS_DIR = join(root, "commands");
  resetState(); resetSessionScopes(); setRepoScope(null); plugins = [];
});
afterEach(async () => {
  for (const p of plugins) await p.cleanup();
  resetState(); resetSessionScopes(); setRepoScope(null);
  delete process.env.OPENCODE_MEMORY_DIR; delete process.env.OPENCODE_COMMANDS_DIR;
  if (dirname(resolve(root)) !== resolve(tmpdir()) || !basename(root).startsWith("osi-review-proof-")) {
    throw new Error("Unexpected fixture cleanup path");
  }
  rmSync(root, { recursive: true, force: true, maxRetries: 5, retryDelay: 20 });
});
async function plugin(dir: string | null) {
  const p = await loadPlugin(dir); plugins.push(p); return p;
}
async function seed(dir: string, content: string) {
  const scope = resolveRepo(dir);
  return appendMemory({ type: "context", scope: "planning", content, status: "open", repo: scope.key, repoPath: scope.path });
}

test("review #127: an unbound A session must not inherit the later B setup", async () => {
  const pa = await plugin(a);
  await plugin(b);
  await seed(b, "B_PRIVATE_UNBOUND_SETUP_MARKER");
  const event = { sessionID: "ses-a-unbound", system: [] as Array<{ type: string; text: string }> };
  await pa.sessionHooks.context(event);
  expect(event.system.map(p => p.text).join("\n")).not.toContain("B_PRIVATE_UNBOUND_SETUP_MARKER");
});

test("review #131: an unbound A caller must not retire B rows through the fallback Reader", async () => {
  const pa = await plugin(a);
  await plugin(b);
  const loser = await seed(b, "B_FOREIGN_LOSER");
  const survivor = await seed(b, "B_FOREIGN_SURVIVOR");
  const result = await pa.tools.memory_merge_review.execute(
    { loser, survivor, reason: "unbound ownership check" }, { sessionID: "ses-a-unbound", id: "merge-a" });
  expect(isActive((await loadAll()).find(m => m.ts === loser)!)).toBe(true);
  expect(result.content).not.toContain("is canonical");
});

test("review #128: A must not read B's ordinary tool output through evidence", async () => {
  const p = await plugin(a);
  rememberSessionDir("ses-a", a); rememberSessionDir("ses-b", b);
  await p.toolHooks["execute.after"]({ sessionID: "ses-b", id: "read-b", tool: "read", input: {},
    result: { content: "B_CONFIDENTIAL_CUSTOMER_MIGRATION_MARKER" } });
  const result = await p.tools.memory_evidence.execute({ ev: "tool_result" }, { sessionID: "ses-a", id: "evidence-a" });
  expect(result.content).not.toContain("B_CONFIDENTIAL_CUSTOMER_MIGRATION_MARKER");
});

test("review #128: merge reasons must not persist recognized credentials in daily rows", async () => {
  const p = await plugin(a); rememberSessionDir("ses-a", a);
  const loser = await seed(a, "A_LOSER"); const survivor = await seed(a, "A_SURVIVOR");
  const token = "ghp_" + "AbCdEfGhIjKlMnOpQrStUvWxYz0123456789";
  expect(redactSecrets(token)).toBe("[redacted]");
  const result = await p.tools.memory_merge_review.execute({ loser, survivor, reason: `rotated ${token}` }, { sessionID: "ses-a" });
  expect(result.content).toContain("is canonical");
  expect(readFileSync(join(evidenceDir(), `${dateStr()}.logfmt`), "utf8")).not.toContain(token);
  expect(readFileSync(join(memoryRoot(), `${dateStr()}.logfmt`), "utf8")).not.toContain(token);
});

test("review PR135: an audit write failure must not claim nothing changed after a successful mutation", async () => {
  const p = await plugin(a); rememberSessionDir("ses-a", a);
  const loser = await seed(a, "A_LOSER"); const survivor = await seed(a, "A_SURVIVOR");
  // Synthetic filesystem fault: evidence cannot be created as a directory.
  writeFileSync(evidenceDir(), "fixture blocks evidence directory");
  const result = await p.tools.memory_merge_review.execute({ loser, survivor, reason: "same repo" }, { sessionID: "ses-a" });
  expect(isActive((await loadAll()).find(m => m.ts === loser)!)).toBe(false);
  expect(result.content).not.toContain("nothing was done");
});

@abogartz abogartz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — verified empirically; approve (one body correction)

Method: detached worktrees of this branch, #133, and cf9b73c; claims re-run, not read.

Verified against the tree:

  • Stacking exact: this branch = #133 + c9791ed and nothing else.
  • Full suite: 0 fail (530 pass / 12 skip here; total 542 = your 537 + 5). tsc --noEmit clean; biome lint 0 errors; no new unused-import warnings beyond #133's.
  • #130 held up under a direct probe battery against evidenceFileFor: traversal, ../<dayfile> (raw-store read), 2026-02-30, month-13, fullwidth unicode digits, newline-suffix, null byte, double-slash, and a symlinked day file — all refused; legit dates resolve inside evidence/. (JS $ is strict end-of-string — no Perl-style trailing-newline hole.)
  • #131: both seats authorize through the entry-resolved Reader; the lock-order claim checks out — update-order → file-locks everywhere (prune/undo/decay/viewer take file locks only, never update-order, so no inversion exists); onTimeout:"fail" genuinely throws (src/lock.ts:251), so the fail-closed contract is real.
  • #132: redact-then-crop in place; buildCapturePrompt's own scrub retained as defense in depth (src/capture.ts:73); the crop tests drive the real compaction hook and were red on base with the exact markers quoted.

Body correction (under-claim, not over-claim): the red-on-base list says 6 of 10; I measured 7 — "a day file symlinked out of the evidence dir is not followed" is also red on cf9b73c (it returned SYMLINKED_DAYFILE_MARKER verbatim). The "6 + 4 controls = 10" arithmetic misclassifies it as a green control. Worth fixing the evidence section so the pin list matches the tree.

Nit: the outer catch {} in merge_review maps any error (disk full, latent bug) to "the store was busy past the lock budget — retry". Fail-closed, but diagnostically misleading; consider narrowing or recording the error.

LGTM otherwise. Not merging per maintainer.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Investigated both failed checks for head b2f7ac2a753bc559aa4de16e13e885aab0f1c59c: both failures are the same test-fixture collision with current main's startup heartbeat, before the merge tool is called.

CI checks out merge commit 603110fbd5a0f34b69d0e55e34f728a78c5d7d6d (this head merged into main 61e01b0), not the branch head alone. Main's new plugin_load heartbeat writes evidence during loadPlugin(a). The test then tries to replace the existing memory/evidence/ directory with a regular file using writeFileSync, so it fails during setup rather than testing partial-merge reporting. This reproduces locally on the exact CI merge commit with Bun 1.3.10 as well; it is not specific to CI's Bun 1.4.4.

A small fixture fix is to install the intentionally invalid evidence path before loading the plugin. The heartbeat failure is guarded, and the merge can then reach the intended post-mutation evidence-write failure. I tested the following change locally against the CI merge commit: the previously failing test passes (1 pass, 0 fail; 4 other tests filtered out). This is a suggested patch, not a pushed change or a claim that the full CI suite has been rerun.

diff --git a/test/security-unbound-identity.test.ts b/test/security-unbound-identity.test.ts
index 5873cfe..3b9692b 100644
--- a/test/security-unbound-identity.test.ts
+++ b/test/security-unbound-identity.test.ts
@@ -200,11 +200,12 @@ test("an unbound session cannot retire another repository's rows through merge",
 // response must describe what actually happened — "nothing was done" is true
 // only for the lock-acquisition failure it was written for.
 test("a merge whose evidence write fails reports the retirement it actually made", async () => {
-  const p = await loadPlugin(a);
-  plugins = [p];
-  // Poison the evidence path: the merge's mutation runs, its record() throws.
+  // Install the fault before setup: the startup heartbeat now creates evidence/.
+  // Its guarded write may fail too; the merge must still report its mutation.
   mkdirSync(memoryRoot(), { recursive: true });
   writeFileSync(join(memoryRoot(), "evidence"), "not a directory");
+  const p = await loadPlugin(a);
+  plugins = [p];
   await appendMemory({
     type: "decision",
     scope: "design/probe5",

Progress on the review findings: all five original review probes now pass on b2f7ac2, including unbound merge authorization and accurate post-mutation failure reporting. However, the two newer unresolved-session evidence probes still fail on both the branch head and CI merge commit. Remaining #128 blocker, exact reproduction, and requested fix.

Please fix the fixture, rerun both checks on the merged tree, and carry forward the unresolved-session evidence fix from #133 before treating the stack as ready. The PR body's statement that nothing remains deferred does not account for these new-write isolation cases.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Follow-up round pushed. The branch is rebased onto #133's d56956e (own commits now ea6cad7 → e754708 regressions → b2f7ac2 fix), and all five of your probes pass on this head — committed as test/security-unbound-identity.test.ts (probes 1/3/4 pinned on the #133 side, 2/5 here).

1 — merge authorization for unbound callers (#127/#131). Fixed at the shared root: readerForSession's module-scope fallback is gone and every plugin entry binds an unknown caller explicitly to its own instance's workspace (provisional — a firm event/API identity still replaces it). Your exact scenario (A loaded, B loaded, A's real memory_merge_review for a never-bound session with two B-owned ids) is the committed probe: the caller resolves to A's repository, the ownership check refuses both seats, B's loser stays active, no evidence line. Was red at c9791ed, green here (e754708).

2 — merge reason in the daily row (#128 follow-up). Fixed on the #133 side: markManySuperseded — the path markSuperseded routes through — now scrubs every string field through redactSecrets before rewriting the loser's line, so the daily row and the evidence line scrub at the same boundary. Committed here as a probe asserting both sides (ghp_ payload, red at a8c5b7a/c9791ed, green).

3 — the catch reporting a completed mutation as a no-op. Fixed in b2f7ac2: the handler tracks whether markSuperseded succeeded. Lock-acquisition failure keeps the documented contract verbatim ("the store was busy past the lock budget — nothing was done"); a post-mutation throw now returns merge_review PARTIAL: <loser> IS retired on disk (superseded_by <survivor>; recoverable via memory_undo) but a post-mutation step failed: <reason>. No rollback — the rows on disk are the source of truth and a re-run reports "already superseded", so the honest report is the repair pointer. Your fixture (evidence path poisoned after the rows land) is the committed regression: red at ea6cad7 with exactly your dishonest message, green at b2f7ac2.

Evidence-read gap and closure claims. Resolved in #133 rather than split: record() stamps repo/repoPath per line and memory_evidence filters via evidenceVisibleTo, so the bound-A-sees-B's-tool_result probe passes there. Nothing hangs under the Fixes #128 claim now. #131 stays open until merge (PR is draft), and the body's claim is stated conditionally on the unbound-caller probe, which passes.

Validation. Rebased stack: 552 pass / 5 skip / 0 fail (bun test, Bun 1.3.10; this machine additionally shows the known service-host e2e stamp sandbox failure, identical at the reviewed base), tsc --noEmit clean, biome lint 0 errors. The five probes: red on the reviewed head, green at b2f7ac2 (probe 5 also red at ea6cad7 pre-fix). On your symlink note — the early return is why the linux CI leg matters; it runs the symlink scenario there. Keeping both PRs draft pending your re-check.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

@abogartz Thanks for checking the symlink case on Linux. The original ten-test accounting should distinguish 7 vulnerability regressions and 3 behavior-preservation tests on a platform that executes the symlink test. Its current Windows early return must not be counted as evidence that the old behavior was safe. Please correct that section of the PR body.

A revision clarification before this approval is used as a readiness signal: the review is attached to b2f7ac2, but the text saying “#133 + c9791ed and nothing else” and describing the old catch is from the pre-follow-up stack. The current branch is based on #133's d56956e, with own commits ea6cad7 → e754708 → b2f7ac2; the post-mutation PARTIAL report is already implemented. I independently verified all five original review probes pass on that head, consistent with the author's follow-up.

Two remaining items are documented in the CI investigation and verified fixture-fix suggestion:

  • Both current required test jobs failed on CI merge commit 603110f, where main's startup heartbeat creates evidence/ before the new fault-injection fixture tries to write a file there. The suggested fixture ordering passes locally on that exact merge tree; the full merged-tree CI still needs to pass after a committed fix.
  • The two newer unresolved-server-session evidence probes still fail on d56956e, b2f7ac2, and 603110f. They concern fresh writes with unresolved repository identity, not the now-fixed bound-A/bound-B case.

The review was submitted before those follow-up comments landed. Please include the merged-tree checks and the two new isolation cases in the final re-check. My recommendation remains to keep the stack in draft until they are resolved.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Rechecked 70abfecbea9d6ebd39601e5fe72fbbf6c2256a9a: this commit changes only the probe-5 fault-injection fixture. The five tests in test/security-unbound-identity.test.ts now pass locally, including the partial-merge case. Linux test, lint, and smoke have passed in run 40426076402; test-windows was still running at the time of this check.

The security blocker is unchanged: I reran recheck-133-evidence.test.ts on this exact head and both unresolved-server-session evidence probes still fail. Fresh evidence either lacks a repo stamp and becomes globally readable, or borrows the other instance's repository stamp; session B receives session A's output in both cases. This is the already documented #128 follow-up with runnable probes, not a regression introduced by the fixture change.

The fixture fix addresses the prior CI setup failure. It does not change the evidence writer/filter, so I still recommend keeping the stack in draft until the two isolation cases are fixed. Local recheck: Windows / Bun 1.3.10, 5 committed follow-up tests passed and 2 additional evidence probes failed.

@abogartz abogartz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dismissing my approval of c9791ed — the branch has been rebased to 70abfec and the stack carries an open blocker:

  • The two unresolved-session evidence probes (see #133's re-review) fail on this head too — inherited via d56956e.
  • The rebased stack also fails bun test ./test/ on macOS/Bun 1.4.3: the two negative-eval.test.ts "scope crossing" tests, from the injection-framing re-bind leaking rememberSessionDir("fr-cap") + unreset ambient state into the next test file. Minimal repro: bun test ./test/injection-framing.test.ts ./test/negative-eval.test.ts. CI (Linux/Windows) is green — order-dependent, still a gate-command failure on a supported host.

Your own two new commits here (b2f7ac2 partial-failure reporting on merge_review — which also addresses my catch {} nit's misleading-message half, and 70abfec platform-deterministic poison fixture) reviewed clean; 533 pass / 12 skip here apart from the inherited two. Will re-review the whole stack once #133's isolation fix lands.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Checked b5962ae and both failed jobs. This stack now includes #133's a909685 security and test-state fixes. The failure is the same whole-log assertion already diagnosed on #133, not a new failure of the evidence isolation behavior.

  • Linux job: 549 pass / 12 skip / 1 fail.
  • Windows job: 556 pass / 5 skip / 1 fail.
  • Both tested merge 6d2db58 and fail only at security-evidence-unbound-server.test.ts:104. Repo B's legitimate plugin_load heartbeat has B's stamp; A's tool_result line does not. The assertion incorrectly scans both.

Please carry the verified event-specific assertion correction from #133 into this stack, preserving the check that B cannot read A's marker, then rerun CI.

Locally at unmodified b5962ae (Windows/Bun 1.3.10), both unresolved-session probes and all five original follow-up cases pass. The new bound-session evidence readability control also passes. I reviewed the rebase: the prior merge ownership, partial-failure reporting, and poison-fixture changes are preserved. The Windows symlink test still returns early on this host, so that nominal pass is not additional symlink validation.

The previously reported security probes are now green on the branch; final sign-off still awaits the test correction and green CI on the merged tree.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Rebased onto #133's a909685 — own commits are now 15129c1 → e80d7d4 → 017e9ad → bdb2dd3 → b5962ae. Both unresolved-server-session probes pass on this head alongside the five originals (7/7 across the stack), so the blocker is cleared here too; force-pushed with lease.

One adaptation was required and is the only content change: security-evidence-path.test.ts's readability control wrote its marker for an UNBOUND ses-130, which #133's new private-to-session rule correctly hides. The control now BINDS ses-130 to the workspace — the shape every session that reaches a plugin instance has — rather than exploiting the missing-stamp path (b5962ae). The traversal, calendar, and symlink doors are untouched.

Test accounting corrected as requested: 7 vulnerability regressions + 3 behavior-preservation controls, with the note that the symlink case early-returns on Windows so only six of the seven execute red on this platform. The body's stacked-diff paragraph now reflects the rebased head. Full suite 554 pass / 5 skip (tsc clean, lint 0 errors; the one local e2e sandbox failure is unchanged, green in CI). PR stays draft.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Rebased again onto #133's 203240f — own commits are now 03d009f → 284166a → 8490534 → cbd765b → 4beccfa (force-pushed with lease). Probes 11/11 here (5 identity + 2 unresolved-server + 4 evidence-path), tsc clean.

Why the new push: both jobs went red on the previous heads at the foreign-stamp probe only, because CI tests the merge commit and main's new ev=plugin_load boot record (#142, 0.14.10) legitimately stamps B's repository in the shared day file — the probe's whole-file scan read that legitimate stamp as the leak, while the actual tool_result line was correctly unstamped (the read-side assertions and the other six probes passed on both jobs). #133's 203240f scopes the scan to the leaking line itself; no product-code change. Bodies updated with the renumbered commits.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

@abogartz Final recheck at 4beccfa857e0f68d6b5ab31f85c8b681f6501fc2: my previously reported blockers for #135 are cleared. This stacked head is ready from my review.

One non-blocking test-harness observation: the local crop tests emitted background ENOENT messages for their temporary evidence files during teardown, after the capture-prompt assertions. Their assertions passed; waiting for the background capture to finish before deleting those fixtures would remove that noise.

The unresolved-session evidence isolation, merge ownership and post-mutation reporting, evidence-path restrictions, and redact-before-crop regressions are now green. Together with the #133 sign-off, this clears my reported blockers across the stack. Please complete the maintainer re-review/update the outstanding changes-requested reviews and draft status when satisfied. Normal stack order is #133, then #135; keep #127–#132 open until their fixes are merged.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

@abogartz Your changes-requested review (attached to 70abfec) listed two inherited blockers plus a clean bill for the branch's own commits. Both blockers are now closed in this stack, and CI is green at 4beccfa (run 40430246861: test, test-windows, lint, smoke):

As offered, this is ready for the whole-stack re-review; the changes-requested state on both PRs is the only remaining blocker, and both stay draft until you sign off. #130–#132 stay open until merge.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

@abogartz Confirmed the new conflict at 4beccfa against main 2bdf024: it is the same src/portable.ts import-block conflict affecting #133, introduced by main's #145 export/import containment changes.

I posted the exact combined imports and verification on #133. Please update #133 first, then replay this PR's five commits on that updated base, preserving both the containment checks and the session-scoped reader.

The locally resolved full stack type-checks. Its full Windows/Bun 1.3.10 run reports 576 pass / 10 skip / 16 fail; all 16 failure names also reproduce on unmodified main in the affected files (export EINVAL / host symlink permissions), with no security-suite failures in the resolved stack. No branch changes were pushed.

The earlier green checks cover the old integration. Fresh Linux and Windows CI are needed after the branch update before merging.

…redact-before-crop capture

The three mediums from the 2026-10-26 security review (abogartz#130, abogartz#131, abogartz#132),
each pinned by regression tests that are red on the reviewed revision
(cf9b73c, 0.14.9) and green on this commit.

- memory_evidence (abogartz#130): `date` is a date, not a path. A regex at the
  schema boundary plus evidenceFileFor() — real calendar dates only,
  resolved INSIDE the evidence dir, impossible dates refused rather than
  rolled, symlinked day files not followed — so neither `../../outside`
  nor `../YYYY-MM-DD` (the raw daily store, visibility filters and all)
  can be read. The wire pin in boundaries.test.ts records the (intentional)
  date pattern; the `~standard` key in that diff is a non-enumerable zod
  annotation present on every tool, as before.

- memory_merge_review (abogartz#131): a row id is a pointer, not authority. Both
  seats resolve through the caller's Reader — captured at entry, never
  re-read after an await (abogartz#127) — and the resolve/check/mutate runs under
  the update-order lock memory_update serializes on (abogartz#125), so
  authorization is revalidated under the mutation lock. A foreign repo's
  row is refused in either seat (including superseded-survivor revival)
  with nothing mutated and no evidence written; global rows stay
  mergeable from anywhere, stated in the tool description instead of
  granted implicitly by store-wide reach. Success now also records the
  session the merge ran FOR.

- auto-capture (abogartz#132): redact the COMPLETE transcript, THEN crop to the
  8,000-char budget. Cropping first could start the window inside a
  credential — a PEM body whose BEGIN marker fell off, a token whose
  prefix fell off — and buildCapturePrompt's own scrub (kept, defense in
  depth) cannot recognize a fragment. The tests drive the real compaction
  hook and assert on the prompt actually handed to the capture model.

Full suite: 537 pass / 5 skip / 0 fail; typecheck clean; `biome lint`
0 errors.
Probe 2 (unbound session retiring another repository's rows through
memory_merge_review) is GREEN already at this head: the identity fix
from the abogartz#133 side (entry binding, readerForSession without the
module-scope fallback) resolves the caller to its own instance's
repository, and the abogartz#131 ownership check then refuses both seats.
Committed as the pinned acceptance case.

Probe 5 is RED here: with the evidence directory poisoned, the merge
retires the loser, its record() throws, and the catch — written for the
lock-acquisition case — reports "nothing was done" while the row IS
superseded on disk. The next commit makes the catch tell the truth
about where the failure landed.
The single catch at the bottom of memory_merge_review was written for one
thrower — the fail-closed lock-budget timeout, where nothing is written
and "nothing was done" is exactly true. The evidence write below the
mutation reaches that same catch: when record() fails AFTER markSuperseded
succeeded the loser is retired on disk, yet the tool told the caller
nothing happened (review probe 5).

Track the mutation and split the report: no mutation keeps the documented
no-op contract verbatim; a mutation followed by a failed follow-up
(evidence, survivor revive) is reported PARTIAL, names the retirement
that stands, carries the failure reason, and points at memory_undo. The
rows on disk stay the source of truth either way; re-running is
idempotent ("already superseded").
CI (Bun 1.4.4, linux) reached the fixture with the evidence path under a
fresh store root already occupied by a DIRECTORY, so the file-write
poison threw EISDIR before the scenario ran; locally (Bun 1.3.10,
windows) the path was absent at that instant and the test passed. The
poison now clears whatever occupies the path inside the same
synchronous block before writing, so nothing that created it earlier —
host timing differs per platform — can win the race. Verified the
fixture still demonstrates the bug: with the pre-fix merge handler
restored (ea6cad7 src/index.ts) the probe fails on the exact dishonest
"nothing was done" message and the other four pass.
…w private rule

abogartz#133's a909685 made a NAMED-but-unresolved session's fresh evidence
private to that session (the re-review's isolation contract). The
readability control here wrote its line for an unbound ses-130 and read
it context-less, so the private branch — working as designed — hid it.
The control now binds ses-130 to the workspace, the shape every session
that reaches a plugin instance has; the traversal, calendar and symlink
doors are untouched. Full suite 554 pass / 1 fail (the known
service-host e2e sandbox case, green in CI).
@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Conflicted with main when #145 (export/import containment) + #146 landed as 0.14.11 — rebased the whole stack. Own commits are now bc9eebd → 9802cf0 → 156e887 → aab5537 → 152d613 on top of #133's 9a7c674; both PRs MERGEABLE again, force-pushed with lease. The single conflict (in #133's src/portable.ts import block — their containment machinery ∪ our reader threading) is documented on #133.

Verification at 152d613: probes 15/15 (5 identity + 2 unresolved-server + 4 evidence-path + 4 merge-ownership), tsc clean, full suite 586 pass / 10 skip / 17 fail — the 17 being the pristine-main baseline on this machine, confirmed by running the full suite in a throwaway 0.14.11 checkout (#145's export/symlink cluster under Windows/Bun 1.3.10 + the known service-host e2e case; green in CI). Nothing here changes any behavior under review; the fixes and probes stand exactly as signed off.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

@abogartz Rechecked 152d613d8db652ecfccdad30942f479d4a90e91c on current main 2bdf024: my #135 sign-off carries forward to this exact head.

The conflict is resolved and fresh CI is green. Together with the renewed #133 sign-off, no blocker remains from my review of this stack. Both PRs remain draft pending the maintainer's final review/state update.

@WhollyMindless
WhollyMindless marked this pull request as ready for review October 27, 2026 22:12
@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Consolidated record, keyed to the current head: the 00:30 changes-requested review (attached to pre-rebase 70abfec) listed two inherited blockers — the unresolved-session evidence probes and the injection-framing/negative-eval reset hygiene — plus a clean bill for this branch's own commits. Both blockers are closed on 152d613 via #133's bf2bbf7 + 9a7c674 in the base (probes 15/15 here: 5 identity + 2 unresolved-server + 4 evidence-path + 4 merge-ownership), and the author-side commits are patch-identical to the reviewed ones (8490534/cbd765b → 156e887/aab5537). The one adaptation the new private-evidence rule required (4beccfa → 152d613: binding the evidence-path control's session) is a test-fixture alignment, not a behavior change.

State: MERGEABLE on main 0.14.11, CI green (run 40574894053: test, test-windows, lint, smoke), tsc clean, range-diff clean vs the signed-off stack, re-reviewer sign-off carried forward to this head. Local Windows/Bun 1.3.10 runs show the same 17 environment reds as pristine main (#145's export machinery, not this stack); green on CI.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Erratum to the local-test notes above — same three root-caused reasons a Windows full-suite run shows reds unrelated to this stack (now filed upstream as #147/#148 rather than waved at as "environment"), plus the invocation distinction that made the numbers confusing:

  1. Bun version skew (16 of 17) — fix(security): confine export/import paths to the store (#24) #145's export machinery needs the CI-pinned 1.4.4; on 1.3.x it EINVALs on Windows. Under 1.4.4 locally: all 16 green.
  2. test/containment.test.ts: 2 of 7 symlink tests miss the file's win32 skip guard and EPERM on unprivileged Windows #147 — two symlink-fixture tests in containment.test.ts miss the skipIf(win32) guard the file applies to its other five; they EPERM in test setup on unprivileged Windows before touching product code.
  3. e2e/stamp.test.ts gives the service a POSIX-only PATH — service-hosted stamp test can never pass on Windows (and no CI job runs e2e there) #148 — the service-host e2e (e2e/stamp.test.ts:103) hands the spawned service a POSIX-only PATH, so it can never pass on any Windows machine, and no CI job runs e2e on Windows (smoke is ubuntu-only; test-windows excludes ./e2e/). The underlying Session repo identity never binds on host 2.1.4 — recall silently partitions writes under the server cwd #90 contract is verified intact — it's the fixture's sandbox, not the code.

Invocation note: the "17 local reds" quoted here was a bare bun test number (Bun's default pattern includes e2e/); CI's lanes (bun run test on Linux + Windows, bun run test:e2e on Linux, run 40574894053) are separately green, as is this stack's own probe set (15/15 at 152d613).

Posting the fuller breakdown on #133 for the stack-level record.

@abogartz abogartz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final pass — APPROVED (supersedes my CHANGES_REQUESTED, which was purely inherited)

My blocker on this branch was the stack, not your code: the two unresolved-session evidence probes and the macOS order-dependent negative-eval break, both inherited from #133. Both are closed on #133's head, which this branch carries. Re-verified here on 152d613, macOS / Bun 1.4.3.

Stack structure matches the body exactly

git merge-base --is-ancestor pr133 pr135 → yes. git log pr133..pr135 returns precisely the five commits you list: bc9eebd, 9802cf0, 156e887, aab5537, 152d613. No undeclared commits.

Red-on-base reproduced independently

Copying this PR's three new suites onto pristine cf9b73c src: 7 fail / 3 pass — the 7 vulnerability regressions (path traversal, impossible date, symlink-not-followed, cross-repo loser, cross-repo survivor, token-straddle, PEM-straddle) red, the 3 behavior-preservation controls green on both revisions. Exactly as claimed, including the caveat about the symlink case.

#130 — the date is a date

evidenceFileFor() (src/evidence.ts:20-42) is wired as the single read path (src/index.ts:723) with the schema pattern as the first door. I ran my own bypass set against the primitive (19 hostile inputs): refused — ../../outside, ..\..\outside, ../2026-01-01, 2026-02-30, 2026-13-01, 2026-00-10, 2026-10-32, 2026-10-00, 0000-01-01 (the Date.UTC 2-digit-year folding to 1900 is caught by the round-trip check), 2026-10-28\n ($ without /m), 2026-10-28.logfmt, 2026-10-28\0.evil, full-width digits, non-padded, empty. Accepted: 2026-10-28, 2024-02-29, 1999-12-31. A day file symlinked out of the evidence dir is refused via realpath containment.

#131 — a row id is not authority

Both seats authorize through the entry-captured Reader (readerFromSid(sid) before any await, src/index.ts:762) and the whole resolve/check/mutate runs inside the update-order lock. Lock ordering verified independently: update-order is acquired at exactly two sites, both top-level tool handlers (src/index.ts:582 memory_update, :782 merge_review); store-file locks are only ever taken deeper (markManySuperseded, stampRow). Nothing inside a file-locked region reaches for update-order, so the order is strictly one-way and cannot deadlock against a plain writer. onTimeout: "fail" throws before the callback runs (src/lock.ts:251), so the timeout really is a no-op.

Probe 5's contract is right: mutated flips only after markSuperseded returns true, so pre-mutation throws keep the verbatim "nothing was done" wording and post-mutation throws report PARTIAL naming the retirement that stands.

#132 — redact then crop

buildCapturePrompt(redactSecrets(transcript).slice(-8000), …) (src/index.ts:1462) — ordering correct, window scrub retained as defense in depth.

Independent probes

I added 30 throwaway adversarial cases against the two fixed primitives (not committed): all pass. Notable edge confirmations — repo: "" with a named sid falls to the private branch rather than global-by-stamp; an unstamped line naming ? or "" keeps legacy-global; admin still sees private lines; unparseable evidence lines are dropped, not passed.

Gates

bun run gate on this head: 590 pass / 12 skip / 0 fail + e2e 11 pass / 0 fail, tsc clean, biome 0 errors, exit 0. I also simulated the landing order: origin/main → merge #133 → merge #135 is conflict-free and the merged result gates green (590 pass / 12 skip / 0 fail, e2e 11/0).

Non-blocking

The same record() field-spread note I left on #133 applies here for the new merge_resolved line (unreachable today — no call site passes a reserved key). aab5537's platform-deterministic poison fixture and 152d613's session binding under #133's private-evidence rule are both correct adaptations, not assertion weakenings; test/boundaries.test.ts is a wire-pin update recording the new pattern deliberately.

Approving — merging #133 first, then this.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

#133 landed (main is 0.14.12), which unwinds this stack on its own: the merge-base of this branch against main is now exactly 9a7c674, so this PR's true diff is precisely its own five commits — bc9eebd → 9802cf0 → 156e887 → aab5537 → 152d613, nine files (the three fixes, their probes, the platform-determinism follow-up, and the fixture alignment). The 0.14.12 release commit only bumps package.json, so the conflict surface is nil and GitHub reports the branch MERGEABLE with all four checks green at 152d613.

I am deliberately not force-pushing the final rebase promised in the PR description: it existed to collapse the review diff, which has now collapsed naturally via the merge-base, and a cosmetic re-land right after your final-pass approval could only perturb that approval or the green runs. If linear history matters more than that, say the word and I'll rebase onto 0.14.12 on request.

Merged, this closes #130, #131 and #132 — completing the #127–#132 batch (the first three auto-closed with #133). Thanks for the final pass and the precise framing of the inherited blocker; the whole stack's audit trail — regression-first SHAs, the rebase records, and the #147/#148 environment errata — is on these two threads if anyone greps this later.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

@abogartz The new Linux failure on da64f63 is reproducible test-state leakage, not something to dismiss with an unchanged rerun.

Failed job 122916024088: 588 pass / 12 skip / 2 fail, both in repokey-path.test.ts (lines 58 and 101). The other three jobs, including Windows, passed.

CI runs update-targeting.test.ts immediately before repokey-path.test.ts. The former leaves ambient session upd and its provisional session-to-repo binding behind; its teardown only removes environment variables/files. The latter resets only the module repo scope. Consequently its write is stamped with /tmp/osi-upd-…/repo (visible verbatim in the failure), and its ambient reader misses its own legacy row.

Deterministic reproducer, also red locally on Windows/Bun 1.3.10 at this exact head:

bun test ./test/update-targeting.test.ts ./test/repokey-path.test.ts

Before: 19 pass / 2 fail, matching both CI failures. With the test-only reset patch below: 21 pass / 0 fail, and type-checking passes. Resetting the producer's session map before each test also stops the reused upd id retaining a previous test's temp workspace; the consumer explicitly starts and ends without ambient session state.

diff --git a/test/repokey-path.test.ts b/test/repokey-path.test.ts
index c856c70..c9dd123 100644
--- a/test/repokey-path.test.ts
+++ b/test/repokey-path.test.ts
@@ -10,7 +10,8 @@ import { createHash } from "node:crypto";
 import { mkdtempSync, readFileSync, rmSync, symlinkSync } from "node:fs";
 import { tmpdir } from "node:os";
 import { join } from "node:path";
-import { normalizeDirPath, resolveRepo, setRepoScope } from "../src/repokey.ts";
+import { normalizeDirPath, resetSessionScopes, resolveRepo, setRepoScope } from "../src/repokey.ts";
+import { resetState } from "../src/state.ts";
 import { appendMemory } from "../src/memory.ts";
 import { relevantKnowledge } from "../src/inject.ts";
 
@@ -29,12 +30,16 @@ const sha1 = (s: string) => createHash("sha1").update(s).digest("hex").slice(0,
 let root: string;
 let memDir: string;
 beforeEach(() => {
+  resetState();
+  resetSessionScopes();
   root = mkdtempSync(join(tmpdir(), "osi-repokey-"));
   memDir = join(root, "memory");
   process.env.OPENCODE_MEMORY_DIR = memDir;
   setRepoScope(null);
 });
 afterEach(() => {
+  resetState();
+  resetSessionScopes();
   setRepoScope(null);
   delete process.env.OPENCODE_MEMORY_DIR;
   rmSync(root, { recursive: true, force: true, maxRetries: 5, retryDelay: 20 });
diff --git a/test/update-targeting.test.ts b/test/update-targeting.test.ts
index e156a9f..c3a1b8f 100644
--- a/test/update-targeting.test.ts
+++ b/test/update-targeting.test.ts
@@ -24,13 +24,14 @@ import {
   type Memory,
 } from "../src/memory.ts";
 import { resetState, setCurrent } from "../src/state.ts";
-import { setRepoScope } from "../src/repokey.ts";
+import { resetSessionScopes, setRepoScope } from "../src/repokey.ts";
 import { loadPlugin } from "./harness.ts";
 
 let root: string;
 let liveRoot: string;
 
 beforeEach(() => {
+  resetSessionScopes();
   root = mkdtempSync(join(tmpdir(), "osi-upd-"));
   // Tests seed rows via appendMemory BEFORE loading the plugin; null scope
   // keeps those seeds unstamped (legacy = global visibility) so each test's
@@ -44,6 +45,9 @@ beforeEach(() => {
 });
 
 afterEach(() => {
+  resetState();
+  resetSessionScopes();
+  setRepoScope(null);
   delete process.env.OPENCODE_MEMORY_DIR;
   delete process.env.OPENCODE_COMMANDS_DIR;
   rmSync(root, { recursive: true, force: true, maxRetries: 5, retryDelay: 20 });

No product-code change or assertion weakening is needed. Please apply the cleanup (or equivalent hermetic setup/teardown) and rerun CI before merging. This is separate from the Windows/Bun export and symlink issues already tracked elsewhere.

Verification was local only; the review worktree's tracked files were restored afterward, and I have not pushed to the PR.

@abogartz

Copy link
Copy Markdown
Owner

Holding the merge — your head is red, but the defect is inherited from main, not yours

I approved this branch after the full pass (see my review above: red-on-base reproduced 7/3, my own 30 adversarial probes against evidenceFileFor/evidenceVisibleTo all pass, lock ordering verified, gates green locally). Then gh pr update-branch moved the head onto post-#133 main and the required test check went red:

(fail) non-git repo keys are bare tokens (#92) > a session dir containing a space stamps repo= as an unquoted hash, repoPath stays raw
(fail) non-git repo keys are bare tokens (#92) > rows written before the hash (repo= was the path) stay visible through repoPath
 588 pass / 2 fail

Neither test is from this stack. I isolated it:

Full diagnosis, the two-line fix I verified, and two design questions are in #149.

Nothing to change in your code. Your 152d613 binding of the evidence-path control was the right call for the same underlying stickiness. Practical path forward, whichever you prefer:

  1. Wait for Test-suite isolation: #127 entry binding leaks a provisional session scope across test files (repokey-path #92 red in some orders) #149's hygiene fix to land on main, then rebase this branch onto main (as you already offered) and force-push — the diff becomes exactly your five commits and the check goes green; or
  2. If you would rather not wait, include the update-targeting/repokey-path reset in this branch and reference Test-suite isolation: #127 entry binding leaks a provisional session scope across test files (repokey-path #92 red in some orders) #149 — I will re-review just that delta.

For what it is worth, the durable version of this fix is a shared reset in the test setup rather than a third per-file patch: this is the third instance of the same module-global leak (injection-framing, negative-eval, now update-targeting), and each one only shows up when file ordering happens to cooperate.

I will not merge while a required check is red. Re-run ping me and I will re-verify and land #133→#135 in one pass.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

That red test job is not this branch's content — the full picture, so nobody has to re-derive it:

I'm deliberately not pushing anything — a no-op commit to re-trigger would perturb your approval on da64f63 for zero content change. A rerun of the failed test job (I lack admin rights to do it from the fork) should go green; if the flake bites twice in a row, #150's one-line-per-file teardown fix makes the pair deterministic and can ride any future commit.

@abogartz
abogartz merged commit 01faa4b into abogartz:main Oct 28, 2026
4 checks passed
@WhollyMindless

Copy link
Copy Markdown
Contributor Author

@abogartz Recheck requested after #149: the blocker is cleared at 424867e1e560f0ad3c21f99b518e791b2dbd188b.

The branch now includes main's #151 fix (74da922): shared test preload resets, the explicit two-file cleanup, and the deterministic re-ingested-row timestamp test. The delta from da64f63 contains only test/configuration changes; the reviewed product code is unchanged.

Independent local verification on Windows/Bun 1.3.10:

  • bun test ./test/update-targeting.test.ts ./test/repokey-path.test.ts ./test/hits.test.ts: 34 pass / 0 fail, including the exact ordering that previously failed.
  • Security suites: 29 reported passes / 0 failures; the previously noted Windows symlink early return and background capture-fixture teardown warnings remain.
  • Type-checking: passed.

CI run 40725811231 is fully green: test, test-windows, lint, smoke. GitHub reports the PR mergeable/clean.

My review sign-off carries forward to this head. #133 is already merged; #135 is ready for your final landing decision.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Green board, 424867e — taking you up on the re-verify-and-land ping.

State after your hygiene fix landed:

  • All four checks pass on the current head (run 40725811231); the #92 pair that was red now runs under preload-isolation.ts and your per-file resets from test: release session identity between tests (#149) #151, which arrived via the "update branch" merge — option 1 from your hold comment, resolved without a rebase from my side.
  • git range-diff against the approved da64f63 side: our five commits are byte-identical (bc9eebd, 9802cf0, 156e887, aab5537, 152d613) — nothing here changed except the inherited base.
  • One flag for you: the head move cleared the 15:27 approval (reviewDecision is empty again), so the branch needs your fresh approval on 424867e to satisfy the ruleset — exactly the re-verify you offered.

And a correction I owe the thread: my #150 described this as a timing lottery — that was wrong, your bindSessionProvisional → bySession["upd"] diagnosis is the accurate one (deterministic under file ordering; my Windows/1.4.4 pair-runs were green, which misled me, while you reproduced it on 0.14.12 and macOS/Bun 1.4.3). #150 is closed as a duplicate of #149 — filed minutes before your hold comment surfaced, without seeing it. Your shared-preload reset is also the right durable answer to the "third instance" point my errata raised; injection-framing/negative-eval can shed their per-file patches whenever you want that cleanup.

Nothing to push from here. Ready to land on your approval.

@abogartz-opencode-self-improvement

Copy link
Copy Markdown

🎉 This PR is included in version 0.14.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

2 participants