Step 3 · Planning·Three chords fusion ENPT
Alembic · Blind Planning

Three chords

Mission (Droid) + Workflow (Claude) + Swarm (Kimi) — mechanics extracted, UIs not copied — unified in alembic.plan.ts under Loop Engineering.

1

The big idea


Blind planning Phase 1 requires three independent REs (RE-A Missions, RE-B Workflows, RE-C AgentSwarm). Phase 2 fuses them into Alembic verbs — not Frankenstein UIs.

Mission chord (Factory Droid): validation-contract before run; programmatic runner; one fresh session per unit; milestone validators; handoff JSON.

Workflow chord (Claude Code): deterministic alembic.plan.ts with phase(), agent(), parallel(); resume cache; no Date.now() in script body.

Swarm chord (Kimi CLI): prompt_template + items[]; ramp 5+700ms; exclusive-deny per turn; wire.jsonl per subagent.

Think of it like… three cover bands whose sheet music you transcribe — not their stage lighting. Alembic writes a new score (alembic.plan.ts) that can call all three movements in one performance.

RE-A → outputs/.../reverse/droid/ ≥500 lines · RE-B ≥800 lines · RE-C ≥700 lines. Each behavioral claim: binary string + disk path or brightdata scrape line.

2

Fusion table


mission() agent() phase() swarm() Alembic Conductor · HarnessCore
Three chords → unified hooks API. Source: PROMPT-BLIND-PLANNING.md § Fase 2 + docs/alembic/03-three-chords-spec.md
PrimitiveMissionsWorkflowsSwarmAlembic
Atomic unitFeatureagent()items[]Unit / task
ParallelismMilestone validationparallel() cap 16ramp 5+700msconfigurable
State~/.factory/missions/script + cachewire.jsonl~/.alembic/runs/
Sequenceordered featuresscript definessequential swarmsslices + deps
3

alembic.plan.ts


Unified script shape (from blind prompt)
export const meta = { name: '...', phases: ['discover','build','prove'] } as const;

export async function run(h: AlembicHooks) {
  await h.phase('discover', () => h.swarm({
    promptTemplate: 'Audit {{item}} read-only',
    items: ['api','ui','tests']
  }));
  if (await h.council({ board: 'tech-council', question: '...' }) === 'NO_GO') return;
  await h.phase('build', () => h.mission({
    units: [{ id: 'schema', proof: ['pnpm test'] }]
  }));
  await h.phase('prove', () => h.parallel([
    () => h.agent({ profile: 'validator', prompt: '...' })
  ]));
}
Fusion rules R1–R10 (03-three-chords-spec.md)
R1 validation-contract before runner    (Missions)
R2 deterministic script body            (Workflows)
R3 swarm exclusive per turn             (Kimi)
R4 Council NO_GO → zero workers         (Alembic core)
R5 Validator ≠ builder                  (Loop Engineering)
4

Try it: pick a chord


DNA: validation-contract.md first · propose → approve → runner · scrutiny + user-testing at milestones · ~/.factory/missions/<uuid>/
DNA: export const meta · phase(name, fn) · resumeFromRunId cache · cap 16 parallel · no Date.now() in body
DNA: prompt_template + {{item}} · min 2 items · ramp 5+700ms · agent-swarm-exclusive-deny · wire.jsonl per agent