Repository navigation
Conversation
A non-English refusal from the NDC compression call passed the reject gate unfiltered, since DEFAULT_REJECT_PATTERN is anchored to English refusal stems and #593 put the reply in the conversation's own language into that path for the first time. It was written into today-*.md as a day summary and now.md was then truncated over the entries it was meant to compress -- gone, with no copy anywhere. scripts/save-session.sh's NDC branch now also rejects any reply whose first line does not open with a "## " header -- the one thing every genuine compression shares (a single entry, a merged time-blocked range, or a whole-day header) that no refusal produces in any language -- and handles it exactly like the existing IS_REJECTED branch. Deliberately not ENTRY_HEADER_ERE itself: that shape requires a single HH:MM time and would reject the merged-range header compress-ndc.prompt.txt explicitly asks the model to produce. tests/test_ndc_non_english_reject_gate_597.py drives both the missed-gate case (Chinese and French refusals, IS_REJECTED left false as the real gate does today) and its required positive control (a genuine non-English summary must still stage and still truncate now.md). Co-Authored-By: Max <noreply>
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.
Closes #597.
The defect
On the release audit's
destroysranking: a non-English refusal from the NDC compression call passed the reject gate unfiltered.DEFAULT_REJECT_PATTERN(pipeline/haiku.py) is anchored to English refusal stems ("i cannot", "could you", "i'm sorry", ...), and #593 put the model's reply in the conversation's own language intonow.mdin ordinary use for the first time.IS_REJECTEDwas the NDC branch's only content gate -- the summarize path already had a second one (ENTRY_HEADER_ERE), the NDC branch did not. A missed refusal was appended totoday-*.mdas though it were a genuine day summary, andnow.mdwas then truncated over the entries that were supposed to have been compressed: gone, with no copy anywhere, sincekeep_rejected_textwas never called on that branch.The fix
scripts/save-session.sh's NDC branch now also rejects any reply whose first line does not open with a"## "header, and handles it exactly like the existingIS_REJECTEDbranch (kept attmp/rejected-*.md,now.mdleft intact so the next round retries).Deliberately not
ENTRY_HEADER_EREitself -- the shape the issue suggested reusing. That pattern requires a singleHH:MMtime, andcompress-ndc.prompt.txtexplicitly instructs the model to merge same-subject entries into one time-blocked entry with a RANGE (e.g.## 08:48-09:22 | branch), whichENTRY_HEADER_ERErejects on sight. Confirmed against the existing NDC test suite's own shared stub default (`"## 2026-07-25"
), which also failsENTRY_HEADER_ERE(a date, no pipe) and would have broken under the naive fix. The plain"## "` check is the one invariant every legitimate NDC output shares (single entry, merged range, or whole-day header) that no refusal shares, in any language.Reasoned vs observed
Observed: the missing gate, the shape mismatch between
ENTRY_HEADER_EREand the NDC prompt's own contract, and the fix closing both the negative case (Chinese/French refusal) and its positive control (genuine non-English summary still stages and still truncatesnow.md) in a real end-to-end shell test.Reasoned, not observed (per the issue's own framing, unchanged by this fix): whether a real model handed non-English
now.mdcontent genuinely refuses in that language. This PR does not attempt to settle that half.Testing
tests/test_ndc_non_english_reject_gate_597.py, new: red (4 failed / 2 passed) before the fix, green (6 passed) after. Full local run of all touched/adjacent NDC and reject-gate modules: 73 passed..oss/assemble_changelog.py --checkpassed with the new fragment. Full repopytestwas deliberately NOT run locally (CI is the gate); see the report for the narrowed-suite rationale.Review
The developer subagent's own session lacked an Agent/Task spawn capability (Bash/Skill only) and could not run the mandated two-reviewer self-review directly. The dispatching session, which does hold Agent/Task, ran it afterward against this same committed diff:
Explorereturned NO FINDINGS after tracing the gate logic, theENTRY_HEADER_ERErejection, the truncation gating, and reverting the script to pre-fix to confirm the new test module is genuinely red on old code.oss:auditorreturned one finding (below). Both final messages were classified viascripts/review_return.pyrather than read by eye, and the worktree was confirmed clean before/after viascripts/tree_snapshot.py.report-for-filing: pre-existing log-injection shape, now at one more call site
oss:auditorflagged that the new gate's reject-log line writes the Haiku reply's first 80 bytes into the log with no newline-stripping. Haiku reply text is untrusted (arbitrary now.md content per #593) and could contain an embedded newline within its first 80 bytes, forging what looks like a second log entry to anyone or anything reading the log file. This is not new to this diff -- the identical shape already exists unchanged one branch above (the existingIS_REJECTEDlog line) and again atsave-session.sh:788. A real fix means sanitizinglog()'s message handling once for every call site, inscripts/log.sh, which is a wider change than this issue's own diff and a design decision (escape, strip, or reject embedded newlines) this PR does not make unbriefed. Filing this for a maintainer decision on scope and on whether it ranksforgesormisreportsper the manager skill's ranking table.Below-bar note
While reading the NDC branch, the comment at (pre-fix)
save-session.sh:893-898was found to describe this exact failure and its own last clause -- "now.md is left intact so the next round retries" -- claimed a property that was true of the siblingIS_REJECTEDarm and NOT of theelifarm it sits above. That stale comment is now folded into the new comment block this fix adds at the same location, so it is fixed in-diff rather than filed separately.[AI-generated]