@oscaner-skills/cdd-engine 4.1.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -9
- package/README.zh-CN.md +44 -9
- package/dist/contract/completion-criterion.js +351 -0
- package/dist/contract/declare.js +181 -43
- package/dist/contract/doc.js +84 -271
- package/dist/contract/frontmatter.js +2 -1
- package/dist/contract/home-extractors.js +49 -316
- package/dist/contract/invariants.js +400 -296
- package/dist/contract/judge.js +74 -49
- package/dist/contract/lint.js +3 -2
- package/dist/contract/liveness-signal.js +103 -0
- package/dist/contract/markdown-document.js +410 -0
- package/dist/contract/markdown-tree-types.js +6 -0
- package/dist/contract/markdown-tree.js +137 -0
- package/dist/contract/project.js +1 -1
- package/dist/contract/rules.js +106 -0
- package/dist/contract/selector-engine.js +332 -0
- package/dist/contract/selector-spec.js +74 -0
- package/dist/contract/skill-anatomy.js +29 -1
- package/dist/contract/task-block-grammar.js +285 -0
- package/dist/contract/task-blocks.js +65 -0
- package/dist/contract/translate.js +21 -0
- package/dist/contract/wave-width.js +15 -0
- package/dist/face/board-view.js +401 -131
- package/dist/face/capsule.js +66 -89
- package/dist/face/cli.js +174 -48
- package/dist/face/declare.js +59 -23
- package/dist/face/gate.js +117 -40
- package/dist/face/host.js +9 -35
- package/dist/face/init.js +108 -0
- package/dist/face/lifecycle.js +540 -123
- package/dist/face/plugins.js +73 -0
- package/dist/face/preview.js +43 -10
- package/dist/face/projection.js +3 -3
- package/dist/face/route-render.js +51 -21
- package/dist/face/termination.js +135 -261
- package/dist/face/words.js +134 -12
- package/dist/infra/atomic.js +15 -0
- package/dist/infra/git.js +25 -0
- package/dist/infra/proc.js +150 -0
- package/dist/infra/round-log.js +104 -0
- package/dist/infra/runtime.js +16 -4
- package/dist/infra/workspace.js +7 -2
- package/dist/render/brief.js +15 -17
- package/dist/render/skeleton.js +41 -28
- package/dist/render/templates.js +128 -84
- package/dist/session/faces.js +47 -20
- package/dist/session/graph.js +13 -37
- package/dist/session/handoff-schema.js +16 -8
- package/dist/session/inflight.js +282 -0
- package/dist/session/ledger.js +581 -136
- package/dist/session/line-identity.js +33 -0
- package/dist/session/next.js +138 -80
- package/dist/session/preflight.js +276 -68
- package/dist/session/round-naming.js +56 -8
- package/dist/session/run.js +317 -78
- package/dist/session/wave.js +94 -14
- package/package.json +13 -3
- package/dist/infra/process.js +0 -22
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// packages/cdd-engine/src-next/face/plugins.ts
|
|
2
|
+
// The plugin roster — the package-axis single table of "what gets installed into a
|
|
3
|
+
// harness". One row per package, one column per harness id, two command shapes per
|
|
4
|
+
// column (install / update). Everything the install face runs, and everything the
|
|
5
|
+
// consumer README table renders, is this data: the README is a rendering surface
|
|
6
|
+
// plus a gate, never a second source.
|
|
7
|
+
//
|
|
8
|
+
// Row order is a first-class fact — the array order IS the execution order and the
|
|
9
|
+
// README row order (upstream dependencies first, kairos last). Object key order
|
|
10
|
+
// would not carry that promise, so the roster is an array of rows, not an object.
|
|
11
|
+
//
|
|
12
|
+
// The host vocabulary stays single-sourced in `face/host.ts`: this module declares
|
|
13
|
+
// no host id list — the row's column set closes over `HostId` (a missing column, or
|
|
14
|
+
// a new host without its column, is a type error), and the `claude` / `pi` tokens
|
|
15
|
+
// inside the argv tuples are the command literals themselves (the README table
|
|
16
|
+
// hands them to humans to copy verbatim), not a vocabulary copy.
|
|
17
|
+
//
|
|
18
|
+
// Module-level exports are types and declared constant data — zero behavior-carrying
|
|
19
|
+
// bare functions (the zero-bare-function discipline).
|
|
20
|
+
/** The plugin roster — row order is execution order (upstream first, kairos last). */
|
|
21
|
+
export const PLUGINS = [
|
|
22
|
+
{
|
|
23
|
+
name: "superpowers",
|
|
24
|
+
claude: {
|
|
25
|
+
install: [
|
|
26
|
+
["claude", "plugin", "marketplace", "add", "obra/superpowers-marketplace"],
|
|
27
|
+
["claude", "plugin", "install", "superpowers@superpowers-marketplace"],
|
|
28
|
+
],
|
|
29
|
+
update: [
|
|
30
|
+
["claude", "plugin", "marketplace", "update", "superpowers-marketplace"],
|
|
31
|
+
["claude", "plugin", "update", "superpowers@superpowers-marketplace"],
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
pi: {
|
|
35
|
+
install: [["pi", "install", "git:github.com/obra/superpowers"]],
|
|
36
|
+
update: [["pi", "update", "git:github.com/obra/superpowers"]],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "mattpocock-skills",
|
|
41
|
+
claude: {
|
|
42
|
+
install: [
|
|
43
|
+
["claude", "plugin", "marketplace", "add", "mattpocock/skills"],
|
|
44
|
+
["claude", "plugin", "install", "mattpocock-skills@mattpocock"],
|
|
45
|
+
],
|
|
46
|
+
update: [
|
|
47
|
+
["claude", "plugin", "marketplace", "update", "mattpocock"],
|
|
48
|
+
["claude", "plugin", "update", "mattpocock-skills@mattpocock"],
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
pi: {
|
|
52
|
+
install: [["pi", "install", "git:github.com/mattpocock/skills"]],
|
|
53
|
+
update: [["pi", "update", "git:github.com/mattpocock/skills"]],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "kairos",
|
|
58
|
+
claude: {
|
|
59
|
+
install: [
|
|
60
|
+
["claude", "plugin", "marketplace", "add", "oscaner/skills"],
|
|
61
|
+
["claude", "plugin", "install", "kairos@oscaner-skills"],
|
|
62
|
+
],
|
|
63
|
+
update: [
|
|
64
|
+
["claude", "plugin", "marketplace", "update", "oscaner-skills"],
|
|
65
|
+
["claude", "plugin", "update", "kairos@oscaner-skills"],
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
pi: {
|
|
69
|
+
install: [["pi", "install", "npm:@oscaner-skills/kairos"]],
|
|
70
|
+
update: [["pi", "update", "npm:@oscaner-skills/kairos"]],
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
];
|
package/dist/face/preview.js
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
import process from "node:process";
|
|
20
20
|
import { RoundNaming } from "../session/round-naming.js";
|
|
21
21
|
import { HOSTS, HostDetect } from "./host.js";
|
|
22
|
+
import { Words } from "./words.js";
|
|
22
23
|
/** The preview row's label column width — ` ` + the label padded to this width +
|
|
23
24
|
* one space places every value at the same column (`would record:` — the longest
|
|
24
25
|
* label — overflows by its own one character, exactly as the §3.3 block reads). */
|
|
@@ -37,10 +38,14 @@ export class Preview {
|
|
|
37
38
|
/** The detected host id ("" when no harness marker matched) — read by the `child:`
|
|
38
39
|
* row only. */
|
|
39
40
|
#host;
|
|
41
|
+
/** The held-face wording rows (the lock row + the takeover hint) — the SAME rows
|
|
42
|
+
* the pre-flight gate and the board fill, never a preview-only paraphrase. */
|
|
43
|
+
#words;
|
|
40
44
|
constructor(opts) {
|
|
41
45
|
this.#scene = opts.scene;
|
|
42
46
|
this.#naming = new RoundNaming(opts.scene.workspace);
|
|
43
47
|
this.#host = HostDetect.detect(opts.env ?? process.env);
|
|
48
|
+
this.#words = opts.words ?? new Words();
|
|
44
49
|
}
|
|
45
50
|
/** The invocation's stdout block — the header plus the five rows (§3.3). Every
|
|
46
51
|
* path token is repoRoot-relative (D47's ONE shape — the same basis the round
|
|
@@ -60,6 +65,27 @@ export class Preview {
|
|
|
60
65
|
...rows.map(([label, value]) => ` ${label.padEnd(LABEL_WIDTH)} ${value}`),
|
|
61
66
|
];
|
|
62
67
|
}
|
|
68
|
+
/** The read-only held block — the in-flight gate REFUSED this dispatch: the preview
|
|
69
|
+
* renders the gate's own holder facts as a `lock:` row (the dead holder carries the
|
|
70
|
+
* takeover hint), exits 1 at the caller, and touches nothing: no acquire, no steal,
|
|
71
|
+
* no release. The `--steal-stale` flag has no write channel here. */
|
|
72
|
+
heldBlock(verb, state) {
|
|
73
|
+
const lines = [`cdd ${verb}: preview (no repo changes)`, ` lock: ${this.#lockValueOf(state)}`];
|
|
74
|
+
if (state.kind === "held" && !state.alive)
|
|
75
|
+
lines.push(this.#words.inFlightWords().stealable);
|
|
76
|
+
if (state.kind === "corrupt" && state.locked)
|
|
77
|
+
lines.push(this.#words.inFlightWords().corruptLocked);
|
|
78
|
+
return lines;
|
|
79
|
+
}
|
|
80
|
+
/** The `lock:` row's value — the holder's identity facts, the lock-without-record
|
|
81
|
+
* shape, or the free state (one row, three facts). */
|
|
82
|
+
#lockValueOf(state) {
|
|
83
|
+
if (state.kind === "held")
|
|
84
|
+
return this.#words.inFlightLock(state.record);
|
|
85
|
+
if (state.kind === "corrupt")
|
|
86
|
+
return this.#words.inFlightWords().lockOnly;
|
|
87
|
+
return this.#words.inFlightWords().free;
|
|
88
|
+
}
|
|
63
89
|
/** The next dispatch step's identity — `<phase> round <round> — <target>`, the
|
|
64
90
|
* target being the wave unit (`wave 1,2`) or the line's own type word. */
|
|
65
91
|
#stepOf(frame) {
|
|
@@ -75,13 +101,18 @@ export class Preview {
|
|
|
75
101
|
* it, so the row states what that render would produce) and the doc/branch faces'
|
|
76
102
|
* judged document. */
|
|
77
103
|
#readsOf(frame) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
104
|
+
const base = frame.target.kind === "wave"
|
|
105
|
+
? `${this.#rel(this.#naming.brief(frame.target.tasks.join(",")))} (would re-render from the current plan)`
|
|
106
|
+
: frame.target.kind === "plan" || frame.target.kind === "spec"
|
|
107
|
+
? this.#rel(frame.target.doc)
|
|
108
|
+
: this.#rel(this.#scene.planPath ?? "");
|
|
109
|
+
return `${base}${this.#orphanSuffix()}`;
|
|
110
|
+
}
|
|
111
|
+
/** The orphan handoff drafts the workspace carries — a draft no recorded round
|
|
112
|
+
* owns is listed on the `reads:` row (the preview reads it, never touches it). */
|
|
113
|
+
#orphanSuffix() {
|
|
114
|
+
const orphans = this.#scene.ledger.orphanHandoffs();
|
|
115
|
+
return orphans.length === 0 ? "" : ` · orphan drafts: ${orphans.join(" · ")}`;
|
|
85
116
|
}
|
|
86
117
|
/** The artifacts the round would write — the frame's prescribed output set (the
|
|
87
118
|
* handoff carrier, the round report and the evidence rounds' test evidence), named by
|
|
@@ -97,13 +128,15 @@ export class Preview {
|
|
|
97
128
|
.map((artifact) => this.#rel(artifact))
|
|
98
129
|
.join(" · ");
|
|
99
130
|
}
|
|
100
|
-
/** The ledger writes the round would record — the
|
|
101
|
-
*
|
|
131
|
+
/** The ledger writes the round would record — the round RECORD it would append
|
|
132
|
+
* (identity: op · cycle · attempt) plus, on a completed review, the
|
|
102
133
|
* reviewed-revision write-back. The three legs are `#bookkeep`'s own: the doc line
|
|
103
134
|
* binds its document's revision, the wave line its RENDERED brief's, and the
|
|
104
135
|
* branch line binds none (its review judges the live tree). */
|
|
105
136
|
#recordsOf(frame) {
|
|
106
|
-
const parts = [
|
|
137
|
+
const parts = [
|
|
138
|
+
`progress.waves["${frame.key}"].rounds += { op: ${this.#naming.op(frame)}, cycle: ${frame.round}, attempt: ${frame.attempt ?? 1} }`,
|
|
139
|
+
];
|
|
107
140
|
if (frame.phase === "review") {
|
|
108
141
|
if (frame.target.kind === "wave")
|
|
109
142
|
parts.push("reviewedRevision(brief)");
|
package/dist/face/projection.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// packages/cdd-engine/src-next/face/projection.ts
|
|
2
2
|
// §2.1 — the single projection class: the declare single surface (face/declare.ts
|
|
3
|
-
// — the argv channel + the
|
|
3
|
+
// — the argv channel + the eight-command rows + REQUIRED_GROUPS) assembles the
|
|
4
4
|
// commander command tree, ENTIRELY in the constructor (the constructor-is-the-
|
|
5
5
|
// assembly stance · §2.1/§2.3):
|
|
6
|
-
// the top-level `cdd` program · the
|
|
6
|
+
// the top-level `cdd` program · the eight commands with their descriptions · the
|
|
7
7
|
// nested leaves (base set|get · schema get|gen · issue render) · the binding rules
|
|
8
8
|
// (command keys → .option()/.requiredOption() · positionals → .argument() ·
|
|
9
9
|
// bool rows single-spelling · the program scope merged into every node · the help
|
|
@@ -55,7 +55,7 @@ export class CommandTreeBuilder {
|
|
|
55
55
|
// same thrown errors.
|
|
56
56
|
this.program.exitOverride();
|
|
57
57
|
this.program.description("the CDD engine's command line");
|
|
58
|
-
this.program.addHelpText("afterAll", "program flags (accepted at any position): --dry-run (implement/review/fix
|
|
58
|
+
this.program.addHelpText("afterAll", "program flags (accepted at any position): --dry-run (implement/review/fix/init)");
|
|
59
59
|
this.#bindProgramScopes(this.program);
|
|
60
60
|
this.#injectProgramExamples();
|
|
61
61
|
for (const spec of CLI_COMMANDS)
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
// complete executable argv composed from the frame facts (the RouteTarget's
|
|
10
10
|
// type + id + plan) through the argv-channel flag spellings — the same channel
|
|
11
11
|
// the CLI parse reads (never a second hard-coded format string);
|
|
12
|
-
// · the face-to-face `handoff` renders the pipeline entry: a `ref`
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
// terminal word;
|
|
12
|
+
// · the face-to-face `handoff` renders the pipeline entry: a `ref` fills the
|
|
13
|
+
// declared instruction phrase (`route to {ref} skill`) with REFS[ref][host]
|
|
14
|
+
// (the `""` host falls back to the claude form — never a bare plugin guess), a
|
|
15
|
+
// `literal` fills its `<plan>` slot, a `done` entry the bare terminal word;
|
|
16
16
|
// · the bare `done` is the terminal word (its no-target face).
|
|
17
17
|
//
|
|
18
18
|
// The route-borne prose (the fix readback suffix · the soft-cap message) rides
|
|
19
19
|
// declared constants from session/next.ts, rendered by reference, never restated.
|
|
20
20
|
// Module-level exports are the class — zero behavior-carrying bare functions.
|
|
21
|
-
import { FIX_READBACK_SUFFIX } from "../session/next.js";
|
|
21
|
+
import { FIX_READBACK_SUFFIX, NEXT_HOP_REASON } from "../session/next.js";
|
|
22
22
|
import { REFS } from "./host.js";
|
|
23
23
|
/**
|
|
24
24
|
* RouteRenderer — the single route → `next:` literal face (D40). One instance holds
|
|
@@ -53,6 +53,33 @@ export class RouteRenderer {
|
|
|
53
53
|
#rel(value) {
|
|
54
54
|
return this.#root === null ? value : this.#root.relativize(value);
|
|
55
55
|
}
|
|
56
|
+
/** renderHop(hop) → the `next:` VALUE of one derived NextHop (§5.2), or null when
|
|
57
|
+
* the hop is ABSENT (the failure face — a BLOCKED / TIMEOUT round holds no next
|
|
58
|
+
* object at all, so no `next:` line renders). The ONE hop face both read faces
|
|
59
|
+
* share: the capsule (a round's own line) and the board (the pipeline frontier)
|
|
60
|
+
* render the SAME object into the SAME bytes. The row order is the frozen table:
|
|
61
|
+
* · a `soft-cap` payload renders its declared suggestion verbatim;
|
|
62
|
+
* · an in-line hop renders the route through `render` (a `hop` is never null on
|
|
63
|
+
* a renderable payload route — the closure kinds carry no hop);
|
|
64
|
+
* · a face-to-face station renders the entry through the same `render`;
|
|
65
|
+
* · an unjudgeable doc class renders the BLOCKED face;
|
|
66
|
+
* · the residual (the bare `done` / `face-closed` row) renders the terminal word.
|
|
67
|
+
* A `null` hop is NOT the failure-face gate: `done` / `soft-cap` / the doc-class
|
|
68
|
+
* `terminal` row all carry `hop: null` yet still print their line. */
|
|
69
|
+
renderHop(hop) {
|
|
70
|
+
if (hop === null)
|
|
71
|
+
return null;
|
|
72
|
+
if (hop.route?.kind === "soft-cap")
|
|
73
|
+
return hop.route.message;
|
|
74
|
+
if (hop.hop !== null && hop.route !== null)
|
|
75
|
+
return this.render(hop.route, hop.target);
|
|
76
|
+
if (hop.to !== null)
|
|
77
|
+
return this.render({ kind: "handoff", entry: hop.to }, hop.target);
|
|
78
|
+
if (hop.reason === NEXT_HOP_REASON.docClassBlocked) {
|
|
79
|
+
return `${this.#words.station("blocked")} ${this.#words.routeWord("docType")}`;
|
|
80
|
+
}
|
|
81
|
+
return this.#words.routeWord("done");
|
|
82
|
+
}
|
|
56
83
|
/** render(route, target) → the `next:` value: the complete executable command (a
|
|
57
84
|
* C5 hop), the pipeline entry (a `handoff`), or the bare terminal word (`done`).
|
|
58
85
|
* The additive optional RouteTarget supplies the frame's own type + id + plan for
|
|
@@ -86,9 +113,10 @@ export class RouteRenderer {
|
|
|
86
113
|
#planOf(target) {
|
|
87
114
|
return target?.plan === undefined ? "<plan>" : this.#rel(target.plan);
|
|
88
115
|
}
|
|
89
|
-
/** The review hop's literal — `review --type <wave|spec|plan|
|
|
90
|
-
* (`--type` renders only where the verb's type discriminates — review/fix
|
|
91
|
-
* multi-type, so they always carry it; absent target → the bare verb).
|
|
116
|
+
/** The review hop's literal — `review --type <wave|branch|phase-spec|overall|plan|single-spec>
|
|
117
|
+
* <type-arg>` (`--type` renders only where the verb's type discriminates — review/fix
|
|
118
|
+
* are multi-type, so they always carry it; absent target → the bare verb). The four
|
|
119
|
+
* doc shapes ride the retained `--spec` flag (the document under review). */
|
|
92
120
|
#reviewText(target) {
|
|
93
121
|
const verb = this.#words.routeWord("review");
|
|
94
122
|
const type = target?.type ?? null;
|
|
@@ -98,9 +126,6 @@ export class RouteRenderer {
|
|
|
98
126
|
// parses green yet refuses the dispatch at run time).
|
|
99
127
|
return `${verb} ${this.#flag("type")} wave ${this.#flag("tasks")} ${target.id} ${this.#flag("plan")} ${this.#planOf(target)}`;
|
|
100
128
|
}
|
|
101
|
-
if (type === "spec") {
|
|
102
|
-
return `${verb} ${this.#flag("type")} spec ${this.#flag("spec")} ${this.#rel(target.id)}`;
|
|
103
|
-
}
|
|
104
129
|
if (type === "plan") {
|
|
105
130
|
return `${verb} ${this.#flag("type")} plan ${this.#flag("plan")} ${this.#rel(target.id)}`;
|
|
106
131
|
}
|
|
@@ -110,11 +135,14 @@ export class RouteRenderer {
|
|
|
110
135
|
// anchor BASE_BRANCH is engine-injected at dispatch).
|
|
111
136
|
return `${verb} ${this.#flag("type")} branch ${this.#flag("plan")} ${this.#planOf(target)}`;
|
|
112
137
|
}
|
|
113
|
-
|
|
138
|
+
if (type === null)
|
|
139
|
+
return verb;
|
|
140
|
+
// phase-spec · overall · single-spec — the declared shapes ride `--spec`.
|
|
141
|
+
return `${verb} ${this.#flag("type")} ${type} ${this.#flag("spec")} ${this.#rel(target.id)}`;
|
|
114
142
|
}
|
|
115
143
|
/** The one-way fix hop's literal — `fix --type <type> <type-arg> --reviews <path>
|
|
116
144
|
* <readback>` (the readback suffix the declared constant, rendered by reference).
|
|
117
|
-
* Every embedded path value (the doc-id for the
|
|
145
|
+
* Every embedded path value (the doc-id for the doc shapes · `--reviews`)
|
|
118
146
|
* is normalized to the repoRoot-relative shape (D47); the wave face's `<type-arg>`
|
|
119
147
|
* is a task key, not a path — passed through as-is. */
|
|
120
148
|
#fixText(route, target) {
|
|
@@ -127,9 +155,6 @@ export class RouteRenderer {
|
|
|
127
155
|
if (type === "wave") {
|
|
128
156
|
return `${verb} ${this.#flag("type")} wave ${this.#flag("tasks")} ${id} ${this.#flag("plan")} ${this.#planOf(target)} ${this.#flag("reviews")} ${reviews} ${FIX_READBACK_SUFFIX}`;
|
|
129
157
|
}
|
|
130
|
-
if (type === "spec") {
|
|
131
|
-
return `${verb} ${this.#flag("type")} spec ${this.#flag("spec")} ${this.#rel(id)} ${this.#flag("reviews")} ${reviews} ${FIX_READBACK_SUFFIX}`;
|
|
132
|
-
}
|
|
133
158
|
if (type === "plan") {
|
|
134
159
|
return `${verb} ${this.#flag("type")} plan ${this.#flag("plan")} ${this.#rel(id)} ${this.#flag("reviews")} ${reviews} ${FIX_READBACK_SUFFIX}`;
|
|
135
160
|
}
|
|
@@ -139,10 +164,14 @@ export class RouteRenderer {
|
|
|
139
164
|
// ref.short() directory, the workspace double identity).
|
|
140
165
|
return `${verb} ${this.#flag("type")} branch ${this.#flag("plan")} ${this.#planOf(target)} ${this.#flag("reviews")} ${reviews} ${FIX_READBACK_SUFFIX}`;
|
|
141
166
|
}
|
|
142
|
-
|
|
167
|
+
if (type === null)
|
|
168
|
+
return `${verb} ${this.#flag("reviews")} ${reviews} ${FIX_READBACK_SUFFIX}`;
|
|
169
|
+
// phase-spec · overall · single-spec — the declared shapes ride `--spec`.
|
|
170
|
+
return `${verb} ${this.#flag("type")} ${type} ${this.#flag("spec")} ${this.#rel(id)} ${this.#flag("reviews")} ${reviews} ${FIX_READBACK_SUFFIX}`;
|
|
143
171
|
}
|
|
144
|
-
/** The face-to-face handoff render — the pipeline entry: a `ref`
|
|
145
|
-
*
|
|
172
|
+
/** The face-to-face handoff render — the pipeline entry: a `ref` fills the declared
|
|
173
|
+
* instruction phrase (`route to {ref} skill`, the word table's `handoffRef` row)
|
|
174
|
+
* with REFS[ref][host] (the `""` host falls back to the claude form), a `literal`
|
|
146
175
|
* fills its `<plan>` slot with the frame's plan fact, a `done` entry renders the
|
|
147
176
|
* bare word. Never a hard-coded plugin spelling. */
|
|
148
177
|
#handoffText(route, target) {
|
|
@@ -155,8 +184,9 @@ export class RouteRenderer {
|
|
|
155
184
|
// form`) is the HostReferenceTable contract, so the lookup needs no key cast.
|
|
156
185
|
const table = REFS;
|
|
157
186
|
const row = table[entry.ref];
|
|
158
|
-
|
|
187
|
+
const form = row === undefined ? undefined : (row[this.#host] ?? row.claude);
|
|
188
|
+
if (form === undefined)
|
|
159
189
|
return this.#words.routeWord("done");
|
|
160
|
-
return
|
|
190
|
+
return this.#words.handoffRefWord(form);
|
|
161
191
|
}
|
|
162
192
|
}
|