Skip to content

Epic: Preflight, the answer every AI agent wants before it edits #437

Backlog

Description

@stackbilt-admin

North star

Charter should be the governance standard for AI-assisted development. Every coding agent (Claude, Codex, Gemini, Copilot, Cursor and others) should see a Charter repo and think "I need this to code like a boss": it should want Charter's guideposts, not tolerate them because a pointer file says "call this first".

Where we are (2026-11 review, pinned 5412100)

Two independent reviews (Claude/Fable and Codex), plus a full day of real agent maintenance in this repo, reached the same finding. Agents reach for Git and search by default, and are right to, because Charter's first-contact answers repeat what Git knows and are sometimes wrong:

  • The snapshot reports "fresh" after a branch switch.
  • MCP drops a binding rule when the task ends with a period.
  • getProjectState reports green while the live gate is red.

Charter won in one place, the evidence gate. It knows exactly what CI will enforce, names the source file and the measured value against its ceiling, and verifies the repair in one call.

The opportunity is to give agents that same exact, decision-changing answer before they edit, combined with the rule that binds the file, whether it's a published contract, and the right test to run.

The answer we're building (#447)

$ charter adf context --files packages/cli/src/commands/adf-evidence.ts
Binds:     adf-dev.adf → "ADF package has zero runtime dependencies"  (.ai/adf-dev.adf:18)
Headroom:  adf_evidence_loc 274/313 → 39 lines left
Contract:  exit codes + --format json pinned by evidence-contracts.test.ts → breaking = major + migration note
Run first: pnpm exec vitest run packages/cli/src/__tests__/integration/evidence-contracts.test.ts
Fresh:     HEAD 5412100, tree clean, checked live

Each line prevents a real mistake:

  • writing into a full file
  • missing a rule
  • shipping a breaking change as a patch
  • running the wrong test
  • trusting stale state

How the pieces combine

Every issue ships value on its own. Combined, they form the preflight answer.

Trust floor: answers must be right before they can be loved

Parts of the preflight answer

The assembled answer

First contact: where agents meet it, across every vendor

Follow-on

Proof

Suggested order (two weeks)

Parallel tracks that don't block each other:

Principles

  • Cross-agent first. Same answer from the CLI, MCP, and every vendor pointer.
  • Additive only. Existing JSON keys and exit codes stay; new fields are added.
  • Local-first. No network, under 1 s.
  • Honest. Say unknown rather than guess. Say "nothing binds this file" so agents can skip Charter quickly when it has nothing to add.
  • Owner-controlled policy. Raising a ceiling is the maintainer's decision, never the default repair.

Relationship to existing issues

Deferred

What would change the plan

If #451 shows optional Charter within noise of flat compiled instructions on first-attempt success, or voluntary reuse under ~30% of eligible runs, move the answer to the gate-failure output only and narrow Charter to the evidence gate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic:preflightpriority:p0type:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions