@oscaner-skills/cdd-engine 4.2.0 → 4.4.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 +38 -9
- package/README.zh-CN.md +44 -10
- 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 +382 -172
- package/dist/face/capsule.js +73 -88
- package/dist/face/cli.js +152 -38
- package/dist/face/declare.js +42 -19
- package/dist/face/gate.js +119 -40
- package/dist/face/init.js +84 -25
- package/dist/face/lifecycle.js +540 -123
- package/dist/face/plugins.js +70 -2
- package/dist/face/preview.js +69 -18
- package/dist/face/route-render.js +60 -21
- package/dist/face/termination.js +135 -261
- package/dist/face/words.js +139 -13
- 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 +603 -145
- package/dist/session/line-identity.js +33 -0
- package/dist/session/next.js +140 -80
- package/dist/session/pipeline.js +247 -0
- package/dist/session/preflight.js +276 -68
- package/dist/session/reviewed-identity.js +54 -0
- package/dist/session/round-naming.js +56 -8
- package/dist/session/run.js +364 -80
- package/dist/session/wave.js +94 -14
- package/package.json +13 -3
package/dist/face/plugins.js
CHANGED
|
@@ -6,8 +6,15 @@
|
|
|
6
6
|
// plus a gate, never a second source.
|
|
7
7
|
//
|
|
8
8
|
// Row order is a first-class fact — the array order IS the execution order and the
|
|
9
|
-
// README row order (upstream dependencies
|
|
10
|
-
//
|
|
9
|
+
// README row order (the core three first: upstream dependencies then kairos; the six
|
|
10
|
+
// recommended capability packages after them). Object key order would not carry that
|
|
11
|
+
// promise, so the roster is an array of rows, not an object.
|
|
12
|
+
//
|
|
13
|
+
// The `tier` field splits the same table in two without a second list: `core` rows
|
|
14
|
+
// are the install contract `cdd init` always runs, `recommended` rows are the pi
|
|
15
|
+
// capability packages the `--include-recommends` flag opts into. Claude Code carries
|
|
16
|
+
// those six capabilities natively, so a recommended row's claude column is an EMPTY
|
|
17
|
+
// array — an empty cell, never a missing column.
|
|
11
18
|
//
|
|
12
19
|
// The host vocabulary stays single-sourced in `face/host.ts`: this module declares
|
|
13
20
|
// no host id list — the row's column set closes over `HostId` (a missing column, or
|
|
@@ -21,6 +28,7 @@
|
|
|
21
28
|
export const PLUGINS = [
|
|
22
29
|
{
|
|
23
30
|
name: "superpowers",
|
|
31
|
+
tier: "core",
|
|
24
32
|
claude: {
|
|
25
33
|
install: [
|
|
26
34
|
["claude", "plugin", "marketplace", "add", "obra/superpowers-marketplace"],
|
|
@@ -38,6 +46,7 @@ export const PLUGINS = [
|
|
|
38
46
|
},
|
|
39
47
|
{
|
|
40
48
|
name: "mattpocock-skills",
|
|
49
|
+
tier: "core",
|
|
41
50
|
claude: {
|
|
42
51
|
install: [
|
|
43
52
|
["claude", "plugin", "marketplace", "add", "mattpocock/skills"],
|
|
@@ -55,6 +64,7 @@ export const PLUGINS = [
|
|
|
55
64
|
},
|
|
56
65
|
{
|
|
57
66
|
name: "kairos",
|
|
67
|
+
tier: "core",
|
|
58
68
|
claude: {
|
|
59
69
|
install: [
|
|
60
70
|
["claude", "plugin", "marketplace", "add", "oscaner/skills"],
|
|
@@ -70,4 +80,62 @@ export const PLUGINS = [
|
|
|
70
80
|
update: [["pi", "update", "npm:@oscaner-skills/kairos"]],
|
|
71
81
|
},
|
|
72
82
|
},
|
|
83
|
+
// The six recommended capability packages — pi-only rows. Claude Code carries file
|
|
84
|
+
// search, todo tracking, structured questioning, web access, background tasks and
|
|
85
|
+
// AGENTS.md injection natively, so the claude column stays EMPTY here: an empty
|
|
86
|
+
// array is the fact, never a placeholder to be filled for symmetry.
|
|
87
|
+
{
|
|
88
|
+
name: "pi-fff",
|
|
89
|
+
tier: "recommended",
|
|
90
|
+
claude: { install: [], update: [] },
|
|
91
|
+
pi: {
|
|
92
|
+
install: [["pi", "install", "npm:@ff-labs/pi-fff"]],
|
|
93
|
+
update: [["pi", "update", "npm:@ff-labs/pi-fff"]],
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "rpiv-todo",
|
|
98
|
+
tier: "recommended",
|
|
99
|
+
claude: { install: [], update: [] },
|
|
100
|
+
pi: {
|
|
101
|
+
install: [["pi", "install", "npm:@juicesharp/rpiv-todo"]],
|
|
102
|
+
update: [["pi", "update", "npm:@juicesharp/rpiv-todo"]],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "rpiv-ask-user-question",
|
|
107
|
+
tier: "recommended",
|
|
108
|
+
claude: { install: [], update: [] },
|
|
109
|
+
pi: {
|
|
110
|
+
install: [["pi", "install", "npm:@juicesharp/rpiv-ask-user-question"]],
|
|
111
|
+
update: [["pi", "update", "npm:@juicesharp/rpiv-ask-user-question"]],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "pi-web-access",
|
|
116
|
+
tier: "recommended",
|
|
117
|
+
claude: { install: [], update: [] },
|
|
118
|
+
pi: {
|
|
119
|
+
install: [["pi", "install", "npm:pi-web-access"]],
|
|
120
|
+
update: [["pi", "update", "npm:pi-web-access"]],
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "pi-background-tasks",
|
|
125
|
+
tier: "recommended",
|
|
126
|
+
claude: { install: [], update: [] },
|
|
127
|
+
pi: {
|
|
128
|
+
install: [["pi", "install", "npm:pi-background-tasks"]],
|
|
129
|
+
update: [["pi", "update", "npm:pi-background-tasks"]],
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "pi-agentsmd",
|
|
134
|
+
tier: "recommended",
|
|
135
|
+
claude: { install: [], update: [] },
|
|
136
|
+
pi: {
|
|
137
|
+
install: [["pi", "install", "npm:pi-agentsmd"]],
|
|
138
|
+
update: [["pi", "update", "npm:pi-agentsmd"]],
|
|
139
|
+
},
|
|
140
|
+
},
|
|
73
141
|
];
|
package/dist/face/preview.js
CHANGED
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
//
|
|
18
18
|
// Module-level exports are the class — zero behavior-carrying bare functions.
|
|
19
19
|
import process from "node:process";
|
|
20
|
+
import { ReviewedIdentity } from "../session/reviewed-identity.js";
|
|
20
21
|
import { RoundNaming } from "../session/round-naming.js";
|
|
21
22
|
import { HOSTS, HostDetect } from "./host.js";
|
|
23
|
+
import { Words } from "./words.js";
|
|
22
24
|
/** The preview row's label column width — ` ` + the label padded to this width +
|
|
23
25
|
* one space places every value at the same column (`would record:` — the longest
|
|
24
26
|
* label — overflows by its own one character, exactly as the §3.3 block reads). */
|
|
@@ -37,10 +39,14 @@ export class Preview {
|
|
|
37
39
|
/** The detected host id ("" when no harness marker matched) — read by the `child:`
|
|
38
40
|
* row only. */
|
|
39
41
|
#host;
|
|
42
|
+
/** The held-face wording rows (the lock row + the takeover hint) — the SAME rows
|
|
43
|
+
* the pre-flight gate and the board fill, never a preview-only paraphrase. */
|
|
44
|
+
#words;
|
|
40
45
|
constructor(opts) {
|
|
41
46
|
this.#scene = opts.scene;
|
|
42
47
|
this.#naming = new RoundNaming(opts.scene.workspace);
|
|
43
48
|
this.#host = HostDetect.detect(opts.env ?? process.env);
|
|
49
|
+
this.#words = opts.words ?? new Words();
|
|
44
50
|
}
|
|
45
51
|
/** The invocation's stdout block — the header plus the five rows (§3.3). Every
|
|
46
52
|
* path token is repoRoot-relative (D47's ONE shape — the same basis the round
|
|
@@ -60,6 +66,27 @@ export class Preview {
|
|
|
60
66
|
...rows.map(([label, value]) => ` ${label.padEnd(LABEL_WIDTH)} ${value}`),
|
|
61
67
|
];
|
|
62
68
|
}
|
|
69
|
+
/** The read-only held block — the in-flight gate REFUSED this dispatch: the preview
|
|
70
|
+
* renders the gate's own holder facts as a `lock:` row (the dead holder carries the
|
|
71
|
+
* takeover hint), exits 1 at the caller, and touches nothing: no acquire, no steal,
|
|
72
|
+
* no release. The `--steal-stale` flag has no write channel here. */
|
|
73
|
+
heldBlock(verb, state) {
|
|
74
|
+
const lines = [`cdd ${verb}: preview (no repo changes)`, ` lock: ${this.#lockValueOf(state)}`];
|
|
75
|
+
if (state.kind === "held" && !state.alive)
|
|
76
|
+
lines.push(this.#words.inFlightWords().stealable);
|
|
77
|
+
if (state.kind === "corrupt" && state.locked)
|
|
78
|
+
lines.push(this.#words.inFlightWords().corruptLocked);
|
|
79
|
+
return lines;
|
|
80
|
+
}
|
|
81
|
+
/** The `lock:` row's value — the holder's identity facts, the lock-without-record
|
|
82
|
+
* shape, or the free state (one row, three facts). */
|
|
83
|
+
#lockValueOf(state) {
|
|
84
|
+
if (state.kind === "held")
|
|
85
|
+
return this.#words.inFlightLock(state.record);
|
|
86
|
+
if (state.kind === "corrupt")
|
|
87
|
+
return this.#words.inFlightWords().lockOnly;
|
|
88
|
+
return this.#words.inFlightWords().free;
|
|
89
|
+
}
|
|
63
90
|
/** The next dispatch step's identity — `<phase> round <round> — <target>`, the
|
|
64
91
|
* target being the wave unit (`wave 1,2`) or the line's own type word. */
|
|
65
92
|
#stepOf(frame) {
|
|
@@ -75,13 +102,18 @@ export class Preview {
|
|
|
75
102
|
* it, so the row states what that render would produce) and the doc/branch faces'
|
|
76
103
|
* judged document. */
|
|
77
104
|
#readsOf(frame) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
105
|
+
const base = frame.target.kind === "wave"
|
|
106
|
+
? `${this.#rel(this.#naming.brief(frame.target.tasks.join(",")))} (would re-render from the current plan)`
|
|
107
|
+
: frame.target.kind === "plan" || frame.target.kind === "spec"
|
|
108
|
+
? this.#rel(frame.target.doc)
|
|
109
|
+
: this.#rel(this.#scene.planPath ?? "");
|
|
110
|
+
return `${base}${this.#orphanSuffix()}`;
|
|
111
|
+
}
|
|
112
|
+
/** The orphan handoff drafts the workspace carries — a draft no recorded round
|
|
113
|
+
* owns is listed on the `reads:` row (the preview reads it, never touches it). */
|
|
114
|
+
#orphanSuffix() {
|
|
115
|
+
const orphans = this.#scene.ledger.orphanHandoffs();
|
|
116
|
+
return orphans.length === 0 ? "" : ` · orphan drafts: ${orphans.join(" · ")}`;
|
|
85
117
|
}
|
|
86
118
|
/** The artifacts the round would write — the frame's prescribed output set (the
|
|
87
119
|
* handoff carrier, the round report and the evidence rounds' test evidence), named by
|
|
@@ -97,21 +129,40 @@ export class Preview {
|
|
|
97
129
|
.map((artifact) => this.#rel(artifact))
|
|
98
130
|
.join(" · ");
|
|
99
131
|
}
|
|
100
|
-
/** The ledger writes the round would record — the
|
|
101
|
-
*
|
|
102
|
-
* reviewed-revision write-back.
|
|
103
|
-
*
|
|
104
|
-
* branch
|
|
132
|
+
/** The ledger writes the round would record — the round RECORD it would append
|
|
133
|
+
* (identity: op · cycle · attempt) plus, when the round lands one, the
|
|
134
|
+
* reviewed-revision write-back. WHICH reviewed input the round binds is the ONE
|
|
135
|
+
* judgment both faces share (`ReviewedIdentity.legOf`): the same phases — review,
|
|
136
|
+
* branch-review, fix — and the same kind → leg mapping. The verdict's
|
|
137
|
+
* `targetAction` is the lifecycle's own input and never rides a dry run: the
|
|
138
|
+
* preview states the write-back a completed round WOULD record. */
|
|
105
139
|
#recordsOf(frame) {
|
|
106
|
-
const parts = [
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
140
|
+
const parts = [
|
|
141
|
+
`progress.waves["${frame.key}"].rounds += { op: ${this.#naming.op(frame)}, cycle: ${frame.round}, attempt: ${frame.attempt ?? 1} }`,
|
|
142
|
+
];
|
|
143
|
+
const leg = ReviewedIdentity.legOf(frame.phase, frame.target.kind);
|
|
144
|
+
if (leg !== null) {
|
|
145
|
+
const stated = this.#reviewedLegOf(leg);
|
|
146
|
+
if (stated !== null)
|
|
147
|
+
parts.push(stated);
|
|
112
148
|
}
|
|
113
149
|
return parts.join(" · ");
|
|
114
150
|
}
|
|
151
|
+
/** The rendered write-back leg of one judgment leg: the wave line states its
|
|
152
|
+
* RENDERED brief, the doc lines their judged document, the branch line its plan
|
|
153
|
+
* document. The branch leg's plan path is an INPUT, not part of the judgment —
|
|
154
|
+
* with no plan fact the preview states no leg rather than an empty identity (the
|
|
155
|
+
* same source the `reads:` row names, and what the real run records too). */
|
|
156
|
+
#reviewedLegOf(leg) {
|
|
157
|
+
switch (leg) {
|
|
158
|
+
case "doc":
|
|
159
|
+
return "reviewedRevision(doc)";
|
|
160
|
+
case "brief":
|
|
161
|
+
return "reviewedRevision(brief)";
|
|
162
|
+
case "branch":
|
|
163
|
+
return this.#scene.planPath === null ? null : "reviewedRevision(doc)";
|
|
164
|
+
}
|
|
165
|
+
}
|
|
115
166
|
/** The child invocation the real run would spawn — `<HostId> <invoke>`: the host
|
|
116
167
|
* id then the harness row's invoke argument string verbatim (the binary name is a
|
|
117
168
|
* separate row column and never rides the invoke value). With no host detected the
|
|
@@ -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,42 @@ 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
|
+
}
|
|
83
|
+
/** renderReason(hop) → the `reason:` VALUE of one derived NextHop — the named fact
|
|
84
|
+
* that selected the hop (one of the seven `NEXT_HOP_REASON` tokens), rendered as a
|
|
85
|
+
* row of its OWN so the dispatchable `next:` literal keeps its exact bytes. A
|
|
86
|
+
* hop-absent round renders no row at all: the caller gates on the SAME hop object
|
|
87
|
+
* its `next:` render reads, so the two rows can never disagree. The station word
|
|
88
|
+
* rides the word table, so the capsule's prefix and this face's value never fork. */
|
|
89
|
+
renderReason(hop) {
|
|
90
|
+
return `${this.#words.station("reason")} ${hop.reason}`;
|
|
91
|
+
}
|
|
56
92
|
/** render(route, target) → the `next:` value: the complete executable command (a
|
|
57
93
|
* C5 hop), the pipeline entry (a `handoff`), or the bare terminal word (`done`).
|
|
58
94
|
* The additive optional RouteTarget supplies the frame's own type + id + plan for
|
|
@@ -86,9 +122,10 @@ export class RouteRenderer {
|
|
|
86
122
|
#planOf(target) {
|
|
87
123
|
return target?.plan === undefined ? "<plan>" : this.#rel(target.plan);
|
|
88
124
|
}
|
|
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).
|
|
125
|
+
/** The review hop's literal — `review --type <wave|branch|phase-spec|overall|plan|single-spec>
|
|
126
|
+
* <type-arg>` (`--type` renders only where the verb's type discriminates — review/fix
|
|
127
|
+
* are multi-type, so they always carry it; absent target → the bare verb). The four
|
|
128
|
+
* doc shapes ride the retained `--spec` flag (the document under review). */
|
|
92
129
|
#reviewText(target) {
|
|
93
130
|
const verb = this.#words.routeWord("review");
|
|
94
131
|
const type = target?.type ?? null;
|
|
@@ -98,9 +135,6 @@ export class RouteRenderer {
|
|
|
98
135
|
// parses green yet refuses the dispatch at run time).
|
|
99
136
|
return `${verb} ${this.#flag("type")} wave ${this.#flag("tasks")} ${target.id} ${this.#flag("plan")} ${this.#planOf(target)}`;
|
|
100
137
|
}
|
|
101
|
-
if (type === "spec") {
|
|
102
|
-
return `${verb} ${this.#flag("type")} spec ${this.#flag("spec")} ${this.#rel(target.id)}`;
|
|
103
|
-
}
|
|
104
138
|
if (type === "plan") {
|
|
105
139
|
return `${verb} ${this.#flag("type")} plan ${this.#flag("plan")} ${this.#rel(target.id)}`;
|
|
106
140
|
}
|
|
@@ -110,11 +144,14 @@ export class RouteRenderer {
|
|
|
110
144
|
// anchor BASE_BRANCH is engine-injected at dispatch).
|
|
111
145
|
return `${verb} ${this.#flag("type")} branch ${this.#flag("plan")} ${this.#planOf(target)}`;
|
|
112
146
|
}
|
|
113
|
-
|
|
147
|
+
if (type === null)
|
|
148
|
+
return verb;
|
|
149
|
+
// phase-spec · overall · single-spec — the declared shapes ride `--spec`.
|
|
150
|
+
return `${verb} ${this.#flag("type")} ${type} ${this.#flag("spec")} ${this.#rel(target.id)}`;
|
|
114
151
|
}
|
|
115
152
|
/** The one-way fix hop's literal — `fix --type <type> <type-arg> --reviews <path>
|
|
116
153
|
* <readback>` (the readback suffix the declared constant, rendered by reference).
|
|
117
|
-
* Every embedded path value (the doc-id for the
|
|
154
|
+
* Every embedded path value (the doc-id for the doc shapes · `--reviews`)
|
|
118
155
|
* is normalized to the repoRoot-relative shape (D47); the wave face's `<type-arg>`
|
|
119
156
|
* is a task key, not a path — passed through as-is. */
|
|
120
157
|
#fixText(route, target) {
|
|
@@ -127,9 +164,6 @@ export class RouteRenderer {
|
|
|
127
164
|
if (type === "wave") {
|
|
128
165
|
return `${verb} ${this.#flag("type")} wave ${this.#flag("tasks")} ${id} ${this.#flag("plan")} ${this.#planOf(target)} ${this.#flag("reviews")} ${reviews} ${FIX_READBACK_SUFFIX}`;
|
|
129
166
|
}
|
|
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
167
|
if (type === "plan") {
|
|
134
168
|
return `${verb} ${this.#flag("type")} plan ${this.#flag("plan")} ${this.#rel(id)} ${this.#flag("reviews")} ${reviews} ${FIX_READBACK_SUFFIX}`;
|
|
135
169
|
}
|
|
@@ -139,10 +173,14 @@ export class RouteRenderer {
|
|
|
139
173
|
// ref.short() directory, the workspace double identity).
|
|
140
174
|
return `${verb} ${this.#flag("type")} branch ${this.#flag("plan")} ${this.#planOf(target)} ${this.#flag("reviews")} ${reviews} ${FIX_READBACK_SUFFIX}`;
|
|
141
175
|
}
|
|
142
|
-
|
|
176
|
+
if (type === null)
|
|
177
|
+
return `${verb} ${this.#flag("reviews")} ${reviews} ${FIX_READBACK_SUFFIX}`;
|
|
178
|
+
// phase-spec · overall · single-spec — the declared shapes ride `--spec`.
|
|
179
|
+
return `${verb} ${this.#flag("type")} ${type} ${this.#flag("spec")} ${this.#rel(id)} ${this.#flag("reviews")} ${reviews} ${FIX_READBACK_SUFFIX}`;
|
|
143
180
|
}
|
|
144
|
-
/** The face-to-face handoff render — the pipeline entry: a `ref`
|
|
145
|
-
*
|
|
181
|
+
/** The face-to-face handoff render — the pipeline entry: a `ref` fills the declared
|
|
182
|
+
* instruction phrase (`route to {ref} skill`, the word table's `handoffRef` row)
|
|
183
|
+
* with REFS[ref][host] (the `""` host falls back to the claude form), a `literal`
|
|
146
184
|
* fills its `<plan>` slot with the frame's plan fact, a `done` entry renders the
|
|
147
185
|
* bare word. Never a hard-coded plugin spelling. */
|
|
148
186
|
#handoffText(route, target) {
|
|
@@ -155,8 +193,9 @@ export class RouteRenderer {
|
|
|
155
193
|
// form`) is the HostReferenceTable contract, so the lookup needs no key cast.
|
|
156
194
|
const table = REFS;
|
|
157
195
|
const row = table[entry.ref];
|
|
158
|
-
|
|
196
|
+
const form = row === undefined ? undefined : (row[this.#host] ?? row.claude);
|
|
197
|
+
if (form === undefined)
|
|
159
198
|
return this.#words.routeWord("done");
|
|
160
|
-
return
|
|
199
|
+
return this.#words.handoffRefWord(form);
|
|
161
200
|
}
|
|
162
201
|
}
|