feat(ceo): code-check gate -- vet proposals against the real code before filing #287
No reviewers
Labels
No labels
Agent
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
2 participants
Notifications
Total time spent: 1 minute 31 seconds
Due date
igor
1 minute 31 seconds
No due date set.
Dependencies
No dependencies set
Reference
joshtronic/igor!287
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/ceo-codecheck"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The CEO drafts proposals blind to the codebase — it sees the mandate, metrics, and tracker activity, never the actual code — so it proposed already-done work (porksicle #101: per-game SEO meta that was already unique). This gate is the sharp dev going "you know we already do that, right?"
ceo_codecheck_proposal, run beforeceo_file_proposal:claude_call)git grep origin/masterfor them (reads the ref, not a stale checkout; 8KB cap)claude_call): KEEP / DROPFail-open: DROP only on a confident "already implemented"; KEEP on any error or ambiguity (no clone, call fails, no terms, unparseable). A broken gate never wrongly kills a real proposal — the 5 new tests cover exactly these paths.
No-exfil by construction: both calls are tool-free
claude_call; the drop reason is logged locally only, never posted/emailed/returned. The code goes in, one bit (file-or-skip) comes out. That closes the #241 "read-only ≠ safe" concern structurally rather than by trust.Gates the digest + answer-path proposals (where the #101 class lives). The REVISE re-file in the reconsider path is left ungated and flagged for follow-up (rare + feedback-informed → low risk).
Verified:
bash -nclean,test-ceoall pass, check-sync green. Reviewed by hand independently of the build. No reviewer.🤖 Review —
COMMENT(automated)CI for
8b5eac6b: successAdds a fail-open "code-check" gate (
ceo_codecheck_proposal) that derives keywords via a tool-freeclaude_call, grepsorigin/master, and asks the model KEEP/DROP before filing a CEO proposal; wired into_ceo_file_outputsand covered by 5 tests. In scope (~85 lines), CI green, no CI-config touches, and the security story (tool-free calls, reason logged locally, only a one-bit decision leaves the function) holds up. My reservations are functional/unverifiable, not safety — every error path correctly fails open to KEEP, so a real proposal is never silently eaten.Reservations I'd want a human to weigh:
logoutput stream is unverifiable from the diff (lib/ceo.sh, DROP branch). The function's stdout contract is exactlyKEEP/DROP— tick.sh does[ "$(ceo_codecheck_proposal ...)" = "DROP" ]. The DROP branch callslog "..."beforeecho DROP. Iflogwrites to stdout (rather than stderr/a file), the captured value becomes"<log line>\nDROP", the= "DROP"test fails, and the gate silently never drops anything in production. The test attest-ceo.shstubslog() { :; }, so this exact production interaction is never exercised. Please confirmlogwrites to stderr/file (it almost certainly does, but I can't see its definition). If there's any doubt, route the log call's output to stderr explicitly or move it after the decision is captured.Hardcoded
origin/master(lib/ceo.sh,git grep ... origin/master). Repos whose default branch ismainwill havegit grep origin/mastererror →2>/dev/null→ empty grepout → KEEP. Fail-open is fine, but the gate becomes a silent no-op for any non-masterrepo. Worth deriving the default ref (e.g.git symbolic-ref refs/remotes/origin/HEAD) or at least documenting themasterassumption.Smaller notes (non-blocking):
git grep -e "$t"— safe from option/command injection because they're passed as-epattern args inside a quoted array and pre-filtered to[[:alnum:]_./-]. Good. The.in keywords does act as a regex wildcard (the prompt asks for "no regex" but doesn't enforce it); harmless, just slightly noisier matches.git fetch -q originmeans N fetches for N proposals — minor, acceptable.continueintegration or the reallogpath — which is exactly where the stdout-purity concern above lives. Consider one test that drives the gate with the reallogto lock the stdout contract.The REVISE re-file path being left ungated is acknowledged in the description and is reasonable to defer. Nothing here rises to a blocking defect, but the
logstdout question is a genuine gap between the tests and production behavior that I can't resolve from the diff alone — hence COMMENT rather than APPROVE.Independent review by the harness on
claude-opus-4-8. The human reviewer is requested once Igor has reviewed; a human still merges.ceo_codecheck_proposal(follow-up to #287) #292