feat(write-gate): reject machine output and session-notification noise (Gate 1b)#94
Open
RobertSigmundsson wants to merge 1 commit into
Conversation
Empiryczny denylist z gate_decision false-accepts: hard-reject dla struktur powiadomień/tagów które nigdy nie są wiedzą — <summary>/<status>/task-notification, tool-use-id, *-caveat>, Monitor event, Background command, oraz prefiksów Session activity:/ps -o/echo/curl. Zamyka lukę: enforce przepuszczał 89% szumu przy score=5 (monitor-events, task-notif, echa shell). Zwalidowane fixture: JUNK 8/8 reject, GOOD (z tagami/typem) 3/3 pass. + config auto_capture_min_score 5->6. (cherry picked from commit 2bb52f47da177ca077b2239cac2d0966fda7b3ba)
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.
Problem
Passive auto-capture stores a lot of harness output as if it were knowledge. Measured over one day of
gate_decisionfalse-accepts on a live brain: 180×"Session activity:", 30×<summary>,20×
"Background command", 19×<status>, 12×task-notification, plustool-use-id,*-caveat>and raw shell lines (ps -o …,echo …,curl -…). None of it is a memory. All of itpasses the length and quality-score gates because it is long, structured, and full of distinct tokens.
Change
A new
Gate 1binscore_memory, running before the scoring heuristics:A match returns
QualityResult(score=0, quality="low", rejected=True, rejection_reason="Machine-noise rejected: …")— same shape as the existing rejection gates.Why upstream benefits
The denylist is derived from measured false-accepts, not guesswork, and it targets exactly the content
this project's own hooks generate. Every entry is a structural marker (a tag or a fixed prefix), so the
false-positive surface on genuine prose is small.
Evidence
origin/mainimport surreal_memoryruff checkruff format --checkmypy src/ --ignore-missing-importspytest -m "not stress" -n autoRisks / notes for the reviewer
rejection gate with no test asserting either that the noise is rejected or that ordinary prose is not.
Recommend requiring a test before merge — happy to add one.
<system-reminder>,task-notification,tool-use-id). Reasonable for this project, but a reviewer may prefer itconfig-driven (
write_gate.noise_patterns) so other harnesses can extend it without a code change.rejected. Rare, and the rejection is explicit with the reason in the message, not silent.
ruff formatwhile preparing this branch (quote-style normalisation in_NOISE_TAG_RE); author preserved.