report: categorize parser refusals + show blocked command + add 'failsafe log' (closes #3, #4)#10
Merged
Merged
Conversation
…d subverb (#3) Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…t decisions (#4) Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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 #3. Closes #4.
#3 — refusals are no longer blank rows
Shell-parser refusals now carry a machine-readable kind, logged as
Tool=shell,Verb=unanalyzable,Subverb=<kind>(glob,heredoc,control-flow,dynamic-head,subshell, plusbackground/input-redirect/fd-redirect/env-prefix/assignment/binary-op/wrapper/parse/other).Extractnow returns a*Refusal{Kind, Message}.failsafe reportgains a Subverb column, so refusals break down per kind instead of rendering blank Tool/Verb.#4 — see which command, and inspect the log
failsafe reportscariest section now shows the command (already redacted at write time) and thetool/verb/subverbcategory, not just the reason.failsafe log [--tail N] [--since DUR] [--json]to inspect recent decisions (time, decision, category, cwd, reason, redacted command) without grepping the JSONL. Reuses report'sreadRecords/parseSince(no duplication). Empty/missing log → friendly message.Test Plan
go test ./...— 12/12 packages (new shellparser kind tests, report Subverb + command tests, 9 log tests)failsafe log --tailruns and renders categorized decisions--jsonemits valid JSON lines; missing log → friendly exit 0Note: the log path is resolved via
auditlog.DefaultLogger(main-era). When the config PR (#7) merges,reportandlogshould both sourcecfg.Log.Path— a one-liner each in main.go.🤖 Generated with Claude Code