Harness spec 1.1.0: one plan, prototypes and the library shared; the CLI implements it

The spec: plan_write and plan_update (new, shared, offered in every mode) and
plan_submit (now shared) keep one structured plan — findings, objectives,
phases of tasks — in place of the todo list, which lives on as a former name
of plan_write. The shared system text is one text for both projects, with
variables for what differs; the mode texts, a prototypes block and a library
block are shared. acp.md: the client hands the device what only it knows
(context, library, prototypes), the plan travels as a structure (plan_state),
library calls carry the chat's scope, and a client may rewind a session.
loop.json says its numbers as numbers. Four conformance areas: plan,
prototype, library_scope, toolcall_index.

The CLI: the plan is kept per session in the store and drawn above the prompt
and on the approval card; the prompt is assembled from the spec's texts with
their variables filled; the link reads the instance's instructions,
personalization, knowledge scope and prototype offer, sends the plan as a
structure and answers rewind; library calls to the instance carry the session
as scope; a prototype written in the terminal is saved as a file and named in
the transcript; a tool-call fragment without an index continues the last call;
the default theme is Moria; dead exports and Hermes leftovers removed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Fable 5.1 committed 2026-10-18 04:02:12 +02:00
1 parent 6e70ff46d0
commit 837f38c744
96 files changed
+3259 -527

No files matched your search

+5 -5
View File
@@ -2,8 +2,8 @@
// (so the answer can be piped), or everything as JSON lines with --json.
import { createInterface } from "node:readline/promises"
import type { Asker, AskReply, Bus, Event } from "./bus/index.ts"
import { unattendedReply, type Answer, type QuestionReply, type QuestionRequest } from "./tool/question.ts"
import type { PlanReply } from "./tool/plan_exit.ts"
import { unattendedReply, type Answer, type QuestionReply, type QuestionRequest } from "./tool/ask_user.ts"
import type { PlanReply, PlanRequest } from "./tool/plan_submit.ts"
import type { IconSet } from "./tui/icons.ts"
import { loadTheme, type Theme } from "./tui/palette.ts"
import { duration } from "./duration.ts"
@@ -92,13 +92,13 @@ export function renderJson(bus: Bus) {
export function terminalAsker(opts: { yes: boolean; unattended?: "recommended" | "first" | "fail"; theme?: string }): Asker {
const C = escapes(loadTheme(opts.theme).theme)
return {
// With nobody at a terminal there is no plan method at all: plan_exit then saves and stops.
// With nobody at a terminal there is no plan method at all: plan_submit then saves and stops.
...(process.stdin.isTTY && !opts.yes
? {
async plan(req: { path: string; text: string }): Promise<PlanReply> {
async plan(req: PlanRequest): Promise<PlanReply> {
const rl = createInterface({ input: process.stdin, output: process.stderr })
try {
process.stderr.write(`\n${C.label}── plan: ${req.path} ──${C.reset}\n${req.text}\n${C.label}──${C.reset}\n`)
process.stderr.write(`\n${C.label}── plan · ${req.plan.title}${req.path ? ` (${req.path})` : ""} ──${C.reset}\n${req.text}\n${C.label}──${C.reset}\n`)
const a = (await rl.question(" [a]pprove (edit mode) [m]anual mode [r]evise… [?] ask back… [enter] keep planning › ")).trim().toLowerCase()
if (a === "a") return { kind: "approve", mode: "edit" }
if (a === "m") return { kind: "approve", mode: "manual" }