fix(localization): authenticate and replay terminal evidence#331
Open
zzet wants to merge 5 commits into
Open
Conversation
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.
Summary
answer_readyLOCALIZATIONtuple list soFILES,SYMBOLS, andEVIDENCEretain the same positional identitylocalizedcompletion for a strictly qualified single implementation result, telling the model that localization is complete while keeping coding, build, test, and navigation tools availableValidation
Current head:
go test -p=1 ./internal/... -count=1go test ./internal/mcp ./internal/hooks -count=1go test -race ./internal/mcp ./internal/hooks -run '(Localization|Terminal|Recovery|Refinement|AnswerReady|Digest|Localized)' -count=1go vet ./internal/mcp ./internal/hooksgolangci-lint rungit diff --checkAll commands passed. In particular, the event/hook tests that previously failed are green.
Measured N=1 benchmark
Run label:
terminal-replay-v14-restored-sweep-n1-055f35e2Measured executable SHA-256:
055f35e2db651f4f155ded051f11d5166598739a703ba9429a8a7b00c3ee5e2aCompared with the previous full PR measurement:
This table is the last completed benchmark, not a benchmark of the current head. The current head contains the measured implementation, behavior-neutral lint cleanups, and the behavioral follow-up described below. Its executable is therefore not byte-for-byte the measured binary.
Non-blocking single-result follow-up
The current head deliberately does not broaden
answer_ready. When the existing sufficiency check passes and the bounded direct result contains exactly one hydrated production callable, with no quoted-literal or artifact-terminal path involved,explorenow emits:localizedfalsefalsecontinue_taskThe instruction says that the indexed localization pass is complete for the request, that its bounded evidence contains exactly one supported primary production implementation candidate and no competing direct candidate, and that the model should continue the requested coding work with that result.
This state is never armed as a terminal session state, publishes no authentication receipt, creates no hook marker, and does not gate another tool. Search, read, relations, trace, analysis, edit, change, refactor, shell builds, and tests remain available. The session state also normalizes any attempted future
localizedarm back to open as defense in depth.Multiple candidates, uncertain/refinement results, quoted-literal recall, artifact terminality, and existing hard-terminal flows retain their prior behavior.
This follow-up is not benchmarked yet. It is intended to reduce unnecessary model distrust through truthful wording without blocking real coding sessions; no cost or acceptance improvement is claimed for the new head until another N=1 run is completed.
Remaining acceptance work
Based on the last measured binary, accuracy is one task short in both dimensions. The smallest general correction is to preserve the enclosing production constructor/initializer as the primary owner when a task-aligned compact literal appears in a registration call; this directly addresses the remaining
humanizer-1059miss without widening generic recovery.Cost remains the largest measured gap. The earlier projection based on broadening
answer_readyis intentionally superseded by the non-blocking design above because hard terminality is unsuitable for real coding sessions. The next benchmark must determine how often the wording alone avoids redundant localization calls and whether a further non-terminal confidence signal is needed.