Skip to content

fix: a crashed prompt test is not a leaking prompt filter - #348

Merged
chubes4 merged 1 commit into
mainfrom
effective-prompt-runtime
Aug 7, 2026
Merged

fix: a crashed prompt test is not a leaking prompt filter#348
chubes4 merged 1 commit into
mainfrom
effective-prompt-runtime

Conversation

@chubes4

@chubes4 chubes4 commented Aug 7, 2026

Copy link
Copy Markdown
Member

The alarm was always wrong

h44lacrosse.com has warned this on every upgrade:

effective-prompt test FAILED — dm-context-filter may be leaking banned phrases

It isn't. The filter is clean — verified on that host under bun:

baseline leaks: 0
filtered leaks: 0
OK — 2 scenario(s) passed

The harness imports dm-context-filter.ts directly, and node cannot load TypeScript:

ERR_UNKNOWN_FILE_EXTENSION: Unknown file extension ".ts"

It exits before rendering a single prompt. The runner is if node run.mjs; then ... else "may be leaking banned phrases", so a crash, a missing dependency, or a syntax error all get reported as a possible security leak.

Why this matters more than the bug

An alarm that is always wrong is worse than silence, because it teaches everyone to scroll past the one time it's right. I scrolled past this a dozen times today before actually reading it — on a live payments site, in a warning about the agent's prompt filter.

It's the same shape as the declare -F guard fixed in #343: a caller assuming it knows why the thing below it failed. There the error was silent; here it's loud and inaccurate. Both are worse than an honest "I could not tell."

The fix

Resolve a runtime that can actually import TypeScript — bun on PATH, then SERVICE_HOME, then root's. That last one matters: a service-identity migration leaves the toolchain behind while the upgrade still runs as root, which is exactly h44's shape (bun at /root/.bun, not on the upgrade's PATH).

When none exists:

effective-prompt test SKIPPED — needs a TypeScript-capable runtime (bun)
  the filter is UNVERIFIED on this host, not known to be leaking

Unverified, explicitly disclaiming a leak. Same principle as verify.sh: an invariant that could not be checked has not been shown to hold, and must not be reported as either passing or failing.

A genuine failure with a working runtime still reports as a possible leak — that's the case the message was written for.

Coverage

Added to tests/bridge-render.sh: prefers bun on PATH, falls back to the service home, returns nothing when no TS runtime exists, the skip path exists and disclaims a leak, and the harness is no longer invoked under node. The /root fallback got a test seam so a host with no bun anywhere can be modelled — this dev box really does have /root/.bun, which made the first version of that assertion pass for the wrong reason.

The effective-prompt harness imports dm-context-filter.ts directly. node
cannot load TypeScript — it exits ERR_UNKNOWN_FILE_EXTENSION before
rendering a single prompt — and the runner reported that crash as
"dm-context-filter may be leaking banned phrases".

So h44lacrosse.com warned about a possible prompt leak on every single
upgrade, for months, while the filter was clean. Verified under bun on that
host: OK — 2 scenarios passed, 0 leaks.

An alarm that is always wrong is worse than silence, because it teaches
everyone to scroll past the one time it is right. I scrolled past it a
dozen times today before reading it.

Same shape as the declare -F guard fixed in #343: a failure being reported
as something it is not. There the error was silent, here it is loud and
inaccurate. Both come from a caller assuming it knows why the thing below
it failed.

The runner now resolves a runtime that can actually import TypeScript —
bun on PATH, then the service home, then root's, because a service-identity
migration leaves the toolchain behind while the upgrade still runs as root,
which is precisely h44's shape. When none exists it says the filter is
UNVERIFIED and explicitly disclaims alleging a leak, rather than guessing.

A real failure with a working runtime still reports as a possible leak,
which is the case that message was written for.
@chubes4
chubes4 merged commit 8ce507a into main Aug 7, 2026
45 checks passed
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.

1 participant