feat(autofix): add incident repair mode for CLI command-level fixes#863
Closed
feat(autofix): add incident repair mode for CLI command-level fixes#863
Conversation
AutoFix currently only detects repo-level issues (build/test/browse-DOM). This adds a new "incident mode" that can detect and repair CLI command failures caused by site changes, selector updates, etc. Changes: - fix.ts: --mode repo|incident --spec <name> parameter - eval-cli.ts: new command-level runner with failure taxonomy - command-specs.json: 3 initial specs (weibo hot, xiaohongshu search, twitter reply) - config.ts: CommandIncidentSpec type definitions - twitter/reply.ts: OPENCLI_DRY_RUN support for safe fill-only testing - designs/autofix-incident-repair.md: full design document
…ipeline 1. Rebase on main picks up #860/#862 (all replies use dedicated composer), so dry-run no longer regresses the text-reply fix. 2. Switch incident mode metric from pass_count (higher) to regression_count (lower). eval-cli.ts now outputs REGRESSIONS=N alongside SCORE=X/Y. fix.ts incident mode greps for REGRESSIONS= so infra/precondition failures don't pollute the metric. 3. Add pre-flight check in incident mode: detects infra/precondition failures and bails early with a clear message instead of entering the engine loop. 4. Pass prompt via stdin (not shell-escaped string) in incident mode modify callback, matching the convention from main.
569d1f5 to
d508226
Compare
1. Fix inverted success condition in incident mode — 0 regressions
now correctly prints "all regressions fixed" instead of "still failing"
2. Add post-hoc auth failure classification: when a spec declares
prerequisites.auth, command output is scanned for auth-related
patterns ("are you logged in", "unauthorized", etc.) and classified
as failed_precondition instead of failed_regression.
3. Pre-flight bridge check: auth-required specs verify browser bridge
is reachable before executing, bail as failed_precondition if not.
3 tasks
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
fix.ts --mode incident --spec <name>) for detecting and fixing CLI command failures caused by site changeseval-cli.tsrunner with failure taxonomy (regression / precondition / infrastructure / skipped) — metric only counts regressionscommand-specs.jsonwith 3 initial specs:weibo-hot-smoke(read_only),xiaohongshu-search-smoke(read_only),twitter-reply-fill-smoke(fill_only)read_only/fill_only/publishclassification per spec,fill_onlyinjectsOPENCLI_DRY_RUN=1OPENCLI_DRY_RUN— fills composer without clicking submit, returns{ status: "dry_run", filled: true, submitted: false }designs/autofix-incident-repair.mdCloses discussion from #855 review thread about AutoFix not being able to detect CLI command-level failures.
Design
See
designs/autofix-incident-repair.mdfor the full design document, co-authored with @codex-mini0.Key decisions:
fix.tshandles both repo repair (existing) and incident repair (new) via--modeflagnpm run build && npm test(must not break repo health)publishspecs require explicit--allow-side-effectsTest plan
npm run build)npx tsx autoresearch/eval-cli.tsruns all 3 specsnpx tsx autoresearch/eval-cli.ts --spec weibo-hot-smokeruns single spec