Skip to content

Council Autofix Transition Table & Fixture Format

Statuses

  • AwaitingNativeReview: Two consecutive rounds completed with zero Open Major or Blocker keys.
  • Escalated: The loop stopped early or at the round cap with a deterministic Reason code.

Key States

  • Open: Raised this round and needing a fix.
  • Fixed: Previously Open, absent this round after a patch was applied. A Fixed key raised again always reopens to Open, even when the vote dismissed it this round, and sets reopenedFixedKey.
  • Dismissed: Dismissed by voter consensus (single-family seat findings only).
  • Superseded: Replaced by a successor key. A targeted key moves here — never to Fixed — when the next round raises a reworded version of it (same normalized path, same lens group, snippet did not exist before the last patch). The successor reuses the targeted key's integer Identity and is Open. Convergence checks compare identities, not keys, and a successor is never churn. Successors are strictly one-to-one: a target raised in the same round is never superseded, and when more than one new key matches a target there is no successor - each is a new key, and the target stays Open (it is never marked Fixed while reworded versions of it are still being raised). A Superseded key raised again restores an Open representative for that identity, with the same convergence checks as a reopened Fixed key.
  • Rank is sticky per identity: a downgrade (e.g. a Major later reported as Low) stays open at the old rank. Clean, sensitive, and successor checks all use the stored max rank.

Reason Codes

  • GateCannotRun: Baseline proof failed (Baseline(StartSha) == Red), a required voter seat was NotRun after retry, scanners neither ran nor were skipped (Ran == false, Skipped == false), a ref or path starting with - was supplied (it would parse as a git flag, so every GitArgv builder rejects it with GateCannotRunException), or any live git/policy/HEAD read failed operationally (timeout or unexpected nonzero exit; confirmed-missing paths return null instead). Never "empty = no risk" and never "no scanners".
  • ChairUnavailable: A required chair seat was NotRun after retry.
  • SeatDisagreementHighCritical: A single-family High or Critical finding received at least one Accept vote and at least one Reject vote.
  • SensitiveChange: IRiskPort.IsSensitive(sha) returned true, a finding key (scanner, seat, or manual) had lens group security with rank >= Major, or IRiskPort.IsSensitiveProposal(proposal) returned true.
  • UnsafePatch: IGuardPort.Check(proposal) failed twice in the same round, or a fixer was exhausted on a guard strike with no valid replacement allocation.
  • PoolExhausted: Pre-round AllocationPlanner.Plan could not find a valid chair, fixer, and at least one voter family. A fixer family never votes or chairs in that run, so former (excluded) fixers count against voter quorum too, and the chair is never an excluded former fixer. Dismissal of a High/Critical candidate still needs two rejecting families (see SeatDisagreementHighCritical).
  • NotConverging: After >= 2 completed fix rounds, either a previously Fixed identity was re-raised as Open or the round's Open Major/Blocker identity set was not a strict subset of the previous round's set.
  • Churn: Two consecutive fix rounds each introduced a new key where SnippetExistedBefore(key, shaBeforeLastPatch) was false. Keys introduced after a round with no applied patch never count, and successors never count.
  • RoundCap: Round 5 completed without achieving two consecutive clean rounds.
  • ProveFailed: A round exhausted all 3 fix attempts without committing, or a fixer accumulated 2 strikes ending on an apply/prove failure with no valid replacement allocation.
  • ProveUnavailable: Propose-only mode. Baseline(StartSha) == Unavailable means there is no baseline (the loop continues without one); when the guard passes, the proposal is not sensitive, and Prove returns Available == false, the run stops here with FixOutcome recorded as proposed:<proposalId> (no commit, no strike). EngineRequest.ProposeOnly defaults to true: a missing argument must never commit, and the first proposal that passes guard and risk ends the run here without calling Prove or Commit. The structured proposal id is also carried on RoundRecord.ProposalId and RunOutcome.ProposalId. A clean ledger with a skipped scanner also stops here without calling the fixer: the round is recorded Clean: false with FixOutcome skipped-scanners-need-execution:FLT-410 (scanners need execution).
  • CiUnverifiable: Reserved for later increments when remote CI status cannot be verified.
  • CiUnfixable: Reserved for later increments when remote CI fails outside autofix scope.
  • InternalError: An unhandled or unscripted port exception was caught at the top level of AutofixEngine.Run.

Exit Codes

  • 0: Reserved for future land command (also returned by explain <dir> on valid report inspection).
  • 1: Escalated with Reason.InternalError, or unimplemented run/land subcommands.
  • 2: Status.AwaitingNativeReview (converged after two consecutive clean rounds).
  • 3: Status.Escalated with any domain escalation reason other than InternalError (including ProveUnavailable).
  • 4: Invalid, unknown, or missing CLI arguments.

Not Built Here

  • Docker prove: IProvePort is still a scripted/stubbed port. Running real proof in a container is a follow-up ticket.
  • land and push: the land subcommand is not implemented (exit 1).
  • CI: remote CI status and unfixable-CI handling (CiUnverifiable, CiUnfixable) are reserved reasons only.
  • Resume: stopping mid-run and resuming from a report is a follow-up ticket.

Live run (increment 2, propose-only)

Live run is off by default: without --enable-live-adapters the command exits 4 before touching git, child processes, or the output directory. FLT-405 shipped with open High findings in the live adapters under Andrew's risk acceptance (2026-11-07), tracked in follow-up tickets; enable the flag only on trusted branches.

council-autofix run --repo <worktree> --base <ref> [--author-family <family> ...] [--manual-findings <json>] [--out <dir>]
  • Preconditions (each failure → exit 3 GateCannotRun with a report): git status --porcelain is empty; a FileStream/FileShare.None run lock is held on council-autofix-<worktree>.lock under git rev-parse --git-common-dir.
  • Default run dir %LOCALAPPDATA%\council-autofix\<repo-name>\<yyyyMMdd-HHmmss>-<nonce>, never inside the repo.
  • Authors = the --author-family values only. The orchestrator must pass every implementing family explicitly (e.g. --author-family Claude --author-family Muse). Co-Authored-By: trailers on base..HEAD (Claude/Opus/Fable/Clahadore → Claude; Codex/ChatGPT/Cedric/GPT → Codex; Gemini/Jenny → Gemini; Grok/Gronktayvius → Grok; Muse/Susie → Muse; case-insensitive) are recorded as report metadata only and never remove a seat.
  • Pace order = UsageGovernor.exe pace pools by largest pointsBehindToday first; on any failure the fixed order Gemini, Grok, Muse, Codex, Claude with paceSource: fallback.
  • Prove is Unavailable: nothing from the branch under review is ever built, run or committed. LiveProvePort.Baseline → Unavailable, Prove → Available: false. Configured scanners are NOT run either (they would execute branch code; needs the FLT-410 sandboxed prover): with scanners configured at base the port reports Skipped: true (shown as scanners: skipped). A skipped round is recorded Clean: false and never counts toward convergence, so it can never return AwaitingNativeReview; the run may still reach ProveUnavailable with a written proposal. No scanners configured at base still reports Ran: true with no findings.
  • On ProveUnavailable the run writes proposal-<id>.json (test/production edits, worker, targeted keys) and proposal-<id>.diff (unified diff rendered from HEAD content, no git).
  • Report extras: paceSource, authors (+ source), allocation, per-seat attempt verdicts and run-dir paths, scanners, proposal files.
  • No bypass or force flag is ever passed to a child process (--yolo, --dangerously-skip-permissions, --no-verify, --force, -f, --trusted-host); every argv list goes through the banned-flag guard, and all calls use argument lists, never shell strings.
  • Guard order per edited path: traversal/absolute (path-traversal:) → denylist (path-denied:) → allowlist (path-not-allowed:). The denylist is checked before and independently of the allowlist, so a finding file on a denied path is still refused. Symlink ancestors (symlink-ancestor:) are only checked for path components that exist on disk: a missing directory cannot be a live symlink (a dangling link still counts via LinkTarget). Path canonicalization lives in DeniedPaths (worktree-root-aware when available) and is shared by the guard and the risk port: empty / . / .. segments, trailing dots/spaces, :, 8.3 ~N names, and any segment starting with .git are rejected (.gitattributes can define filter, textconv and diff drivers, which execute code; same for .gitmodules, .gitignore, .gitconfig and any other .git* name in any position), plus .mailmap segments, and the denylist also covers scanner configs, package.json, .husky/.githooks, *.cmd/*.bat/*.psm1/*.sh, and stryker*.json. Weakening (weakening-test:) is file-level: [Fact]/[Theory]/Assert. counts on non-comment lines before vs after applying all of the file's edits - any decrease is a violation, and every non-comment HEAD assertion expression (from the first Assert. to end of line, whitespace-normalized) must still appear in the post-image. Suppression markers and secret shapes are also compared before vs after per file (suppression: / secret:): an increase is a violation even when the marker is split across hunks. Correctness/data findings require a real test edit on a tests/** path: a non-comment line whose trimmed text starts with [Fact or [Theory (comment lines and string-literal markers do not qualify). Votes bind on the full key (path, lens group, snippet hash); a vote matching more than one key is dropped, a supplied lens must equal the candidate group (an unknown lens drops the vote), and two different choices for one key from the same voter output drop both.

JSON Fixture Format

Each fixture file is a single JSON object consumed by council-autofix dry-run --fixture <file.json> --out <dir>:

Top-level fields:

  • baselineGreen (legacy): true maps to baseline Green, false to Red.
  • baseline (preferred): "Green", "Red", or "Unavailable". Takes precedence over baselineGreen when present. Unavailable means propose-only mode: there is no baseline and the loop continues without one.
  • manualFindings: optional array of findings merged into round 1 only. Same shape as seat/scanner findings. Their family defaults to Manual (which has no seats and never votes, chairs, or fixes), and their rank is max(Major, mapped rank). A manual finding with a security lens escalates as SensitiveChange like any other source.
  • Each fixAttempts[] entry accepts available (default true). When the guard passes, the proposal is not sensitive, and Prove returns Available == false, the run stops with ProveUnavailable and FixOutcome proposed:<proposalId>.
  • scanner accepts skipped (default false): scanners configured at base but not run in propose-only mode. A skipped round is recorded Clean: false and never counts toward convergence.
  • Top-level proposeOnly (default true): when true, the first proposal that passes guard and risk ends the run with ProveUnavailable without calling Prove or Commit. Fixtures and tests that need a commit or a Prove call set it to false explicitly; a missing argument must never commit.
{
  "name": "fixture-name",
  "authors": ["Claude"],
  "paceOrder": ["Gemini", "Muse", "Codex", "Grok"],
  "excludedFixers": [],
  "startSha": "sha-0",
  "baselineGreen": true,
  "manualFindings": [],
  "rounds": [
    {
      "round": 1,
      "changedFiles": ["src/App.cs"],
      "sensitiveDiff": false,
      "scanner": { "ran": true, "findings": [] },
      "seats": {
        "CedricFocus": [
          {
            "valid": true,
            "coverage": ["src/App.cs"],
            "findings": [
              {
                "id": "F1",
                "severity": "High",
                "lens": "Correctness",
                "path": "src/App.cs",
                "line": 10,
                "snippet": "return null;",
                "evidence": "Null dereference downstream",
                "suggestedFix": "Return empty collection"
              }
            ]
          }
        ]
      },
      "votes": {
        "GronktayviusGeneral": { "F1": "Reject" }
      },
      "snippetExistedBefore": { "F1": true },
      "fixAttempts": [
        {
          "id": "fix-1",
          "applies": true,
          "guardOk": true,
          "guardViolations": [],
          "sensitiveProposal": false,
          "redOk": true,
          "greenOk": true,
          "available": true,
          "receipt": "prove-ok",
          "newSha": "sha-1"
        }
      ]
    }
  ],
  "expected": {
    "status": "AwaitingNativeReview",
    "reason": null,
    "rounds": 2,
    "exitCode": 2
  }
}

Any port call not scripted in the fixture throws FixtureException, which AutofixEngine.Run maps to Status.Escalated with Reason.InternalError (exit code 1).