Repository navigation
feat: record which actor decided an intercept approval - #165
Merged
Merged
Conversation
Add intercept_pending.decided_by (human | rule | model | system; empty while pending or for rows decided before the column existed). Approval semantics are unchanged: only the actor is recorded. - rule-matched and model-judged rows written by CreateDecidedIntercept record rule or model; - ResolveIntercept takes the actor explicitly and rejects any other value before touching the database; - Decide (human allow/deny) records human; timeouts and work-cancelled denials record system. Work-cancelled is a system refusal, not a human one. - decided_by is exposed on the pending and approval records and filterable with decided_by=human|rule|model|system (anything else is a 400). - Legacy rows show decision_source as their actor when decided_by is empty. The filter uses the stored column only, so decided_by=model cannot match older human decisions or timeouts. - Archive restore fills decided_by for archives that predate the column, and marks a restored pending row as system.
The approval list and detail return decided_by exactly as stored, and the decided_by filter matches that same value. Rows decided before the column existed show "Legacy" and match no decided_by filter; their decision_source stays in its own column and nothing is rewritten. UI: a "Decided by" column (Human, Rule, Model, System) and a matching filter beside the decision-source filter, including "AI-approved only" for model. Types and the API query carry decided_by the same way decision_source does.
The option filters decided_by = model, which includes denials the model judge made, so "AI-approved" was inaccurate. Approved-by-AI is the combination with status allowed.
Merged
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.
What
Records which actor settled an intercept approval (
human,rule,model,system) and shows it in the approval records. Approval semantics do not change.CreateDecidedIntercept), human allow/deny (Decide), timeouts and work-cancelled denials (system). Pending rows keep''.ResolveIntercepttakes the actor explicitly and rejects any other value before the database is touched.decided_byexactly as stored. Thedecided_byfilter matches that same value, so what a row displays is what the filter finds.decided_by = '') show "Legacy", match nodecided_byfilter, and keep theirdecision_sourcein its own column. Nothing is rewritten.model.Decisions to review
decided_by = modelonly. It includes model-judged denials, unlike a status filter. Renaming it is a one-line change.db/task_archives_restore.go: archives without the column get'', and a restored pending row becomessystem.DecideInterceptPendinghas no callers and does not writedecided_by; left as found.decided_by.Verification
go build ./...,go veton db, server, intercept: pass.db,intercept,serverpass.tsc --noEmit: pass.biome lintandbiome checkreport the same diagnostics asorigin/main: no new findings.Do not merge before
go,shellandwebare green on the exact head SHA.