How Albi builds.

The discipline behind every commit. Borrowed from m566 (METH-ITER-001), m8201 (night autonomy + three-zero), m562 (independent audit), and m610-624 (evidence anchor). The point is not the names — it is that every iteration ends with a verifiable audit trail.

Seven-phase iteration

Every batch goes through seven phases, every phase produces one markdown document under _logs/batch_NNN/. No phase can be skipped. No phase pauses unless one of the seven stops fires.

Phase 1

Plan

Targets, materials touched, projects touched, risk pre-read (which Charter clauses might fire).

Phase 2

Plan-audit

Three-zero self-check + seven-stop-things check + fork-or-rewrite verdict.

Phase 3

Execute

Real-time log of file create/modify; drift events get their own drift_NNN.md.

Phase 4

Execute-audit

Actual vs plan diff · 15-law grep · Charter §3 grep · three-zero re-check.

Phase 5

Test

Five-tier verification: T1 STATIC · T2 TYPECHECK · T3 LINT · T4 LAW · T5 BUILD.

Phase 6

Milestone

Real delivery list · cumulative progress against milestones · GROUND_TRUTH.md update.

Phase 7

Version

Local commit + tag. No push to remote unless owner ACK.

Three-zero audit

At the end of every batch we check three invariants:

  • Zero pollution. Did we modify any ecosystem main repo? If so, revert.
  • Zero boundary. Did the iteration touch any of the seven stops without an owner ACK? If so, stop.
  • Zero residue. Are there any in-progress loose files? If so, sediment or remove.

Failure on any of the three triggers an audit document under _audits/self_audit_NNN.mdand a degradation (see below). It never triggers silence.

Drift protocol — DRIFT-001

When our mental model of the system and the actual state of the system disagree:

  • Step 1. Do not panic, do not assume.
  • Step 2. Call the m556 MCP to read ground truth.
  • Step 3. Diff plan assumption vs ground truth.
  • Step 4. Decide by source:
    • Drift in our own code → self-correct, continue.
    • Drift in m566 fork base → re-fork from latest m566.
    • Drift in a peer project (m590, m554, m200, m602…) → fix our adapter, do not touch the peer.
    • Drift in a Charter clause → stop, write OWNER_ACTION_REQUIRED.md.
  • Step 5. Record the drift in _logs/batch_NNN/03_drift_NNN.md.
  • Step 6. Continue.

The seven stops

Any of the following pauses the iteration until owner ACK lands:

  1. git push to any remote
  2. sudo any command
  3. crontab / systemctl / docker start-stop a production container or DNS change
  4. rm -rf anything
  5. Modify any main repo (m566 / m602 / m604 / m590 / m554 / m200 / m495 / m8201)
  6. Modify any clause of CHARTER.md
  7. Send any outbound message (email / SMS / WeChat) to a real student

Everything else is in-bounds for autonomous decision-making, by Charter §10 and CLAUDE.md.

Degradation ladder

When in doubt, drop one step down — never jump up:

real execute → dry-run → write to _drafts/ → write to _reports/ → read-only observe → OWNER_ACTION_REQUIRED.md

Five-tier verification

Test phase runs five layers:

  • T1 STATIC. Files exist where the plan said they would.
  • T2 TYPECHECK. tsc --noEmit passes.
  • T3 LINT. next lint passes.
  • T4 LAW. Charter §3 + 15-LAW grep passes against app/ and out/.
  • T5 BUILD. next build produces a usable static export.

Higher tiers (T6 runtime browser · T7 integration DB · T8 visual · T9 a11y · T10 V5.7 style) run when the relevant fixtures are available. We never claim a higher tier when only the lower ones ran.

Fork or rewrite

The first rule: do not reinvent what already exists in the ecosystem.

  • m566 MyWorld is the fork base (22 Prisma models, 47 API routes, 36 UI primitives, 11 LAWs).
  • m8201 supplies seven OS skills (redline grep, claude router, RLS, export-delete, WeChat, evidence drawer, expert audit trail).
  • m590 supplies the knowledge graph (claims, experts, evidence rows).
  • m554 supplies the L0-L3 anchor methodology.
  • m200 supplies the N-role engine for path tryouts.
  • m602/m604 supply the millennium-figure reference library (KFC framework, NCNU five-prohibitions).
  • m624 / m516 / m610-612 supply real, scoped, monthly task quotas.

Any new module larger than ~100 lines that is not in MASTER_BLUEPRINT.md gets a draft RFC first. Owner ACK before a single line is written.