@oscaner-skills/cdd-engine 3.0.0 → 3.0.1
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/{src-next/bin.ts → dist/bin.js} +18 -21
- package/dist/contract/declare.js +998 -0
- package/dist/contract/doc.js +565 -0
- package/dist/contract/frontmatter.js +209 -0
- package/dist/contract/home-extractors.js +379 -0
- package/dist/contract/invariants.js +1030 -0
- package/dist/contract/judge.js +109 -0
- package/dist/contract/lint.js +206 -0
- package/dist/contract/project.js +371 -0
- package/dist/contract/skill-anatomy.js +156 -0
- package/dist/contract/translate.js +85 -0
- package/dist/face/artifacts.js +189 -0
- package/dist/face/board-view.js +522 -0
- package/dist/face/capsule.js +141 -0
- package/dist/face/cli.js +891 -0
- package/dist/face/declare.js +241 -0
- package/dist/face/gate.js +158 -0
- package/dist/face/graph-view.js +66 -0
- package/dist/face/host.js +211 -0
- package/dist/face/lifecycle.js +603 -0
- package/dist/face/preview.js +136 -0
- package/dist/face/projection.js +259 -0
- package/dist/face/route-render.js +162 -0
- package/dist/face/termination.js +482 -0
- package/dist/face/words.js +220 -0
- package/{src-next/infra/config.ts → dist/infra/config.js} +19 -24
- package/{src-next/infra/doc-roots.ts → dist/infra/doc-roots.js} +3 -13
- package/dist/infra/git.js +37 -0
- package/dist/infra/process.js +22 -0
- package/{src-next/infra/root.ts → dist/infra/root.js} +25 -36
- package/dist/infra/runtime.js +85 -0
- package/dist/infra/workspace.js +276 -0
- package/dist/render/brief.js +82 -0
- package/dist/render/issue-body.js +129 -0
- package/dist/render/skeleton.js +434 -0
- package/dist/render/templates.js +520 -0
- package/dist/session/faces.js +38 -0
- package/dist/session/graph.js +309 -0
- package/dist/session/handoff-schema.js +295 -0
- package/dist/session/ledger.js +762 -0
- package/dist/session/next.js +211 -0
- package/dist/session/preflight.js +194 -0
- package/dist/session/round-naming.js +73 -0
- package/dist/session/run.js +441 -0
- package/dist/session/state.js +8 -0
- package/dist/session/wave.js +92 -0
- package/package.json +5 -5
- package/src-next/__tests__/bin.test.ts +0 -128
- package/src-next/__tests__/dead-decl.guard.test.ts +0 -39
- package/src-next/__tests__/floor.guard.test.ts +0 -69
- package/src-next/__tests__/issue-body.guard.test.ts +0 -66
- package/src-next/__tests__/phase-suffix.guard.test.ts +0 -72
- package/src-next/__tests__/smoke.integration.test.ts +0 -185
- package/src-next/__tests__/support/strip-comments.ts +0 -99
- package/src-next/__tests__/zero-dep.test.ts +0 -94
- package/src-next/contract/__tests__/__snapshots__/project.schema.overall-spec.snap +0 -256
- package/src-next/contract/__tests__/__snapshots__/project.schema.phase-spec.snap +0 -165
- package/src-next/contract/__tests__/__snapshots__/project.schema.plan.snap +0 -190
- package/src-next/contract/__tests__/__snapshots__/project.schema.single-spec.snap +0 -106
- package/src-next/contract/__tests__/__snapshots__/project.shape.overall-spec.snap +0 -240
- package/src-next/contract/__tests__/__snapshots__/project.shape.phase-spec.snap +0 -165
- package/src-next/contract/__tests__/__snapshots__/project.shape.plan.snap +0 -190
- package/src-next/contract/__tests__/__snapshots__/project.shape.single-spec.snap +0 -100
- package/src-next/contract/__tests__/declare.test.ts +0 -481
- package/src-next/contract/__tests__/doc.test.ts +0 -527
- package/src-next/contract/__tests__/dockey.guard.test.ts +0 -58
- package/src-next/contract/__tests__/edge-conditions.guard.test.ts +0 -81
- package/src-next/contract/__tests__/frontmatter.test.ts +0 -164
- package/src-next/contract/__tests__/judge.test.ts +0 -1111
- package/src-next/contract/__tests__/lint.test.ts +0 -324
- package/src-next/contract/__tests__/project.test.ts +0 -460
- package/src-next/contract/__tests__/structure-pin.test.ts +0 -186
- package/src-next/contract/__tests__/translate.test.ts +0 -96
- package/src-next/contract/declare.ts +0 -1071
- package/src-next/contract/doc.ts +0 -816
- package/src-next/contract/frontmatter.ts +0 -233
- package/src-next/contract/home-extractors.ts +0 -397
- package/src-next/contract/invariants.ts +0 -1413
- package/src-next/contract/judge.ts +0 -151
- package/src-next/contract/lint.ts +0 -239
- package/src-next/contract/project.ts +0 -656
- package/src-next/contract/skill-anatomy.ts +0 -301
- package/src-next/contract/translate.ts +0 -113
- package/src-next/face/__tests__/board-view.test.ts +0 -1151
- package/src-next/face/__tests__/capsule.test.ts +0 -300
- package/src-next/face/__tests__/channel-closure.guard.test.ts +0 -129
- package/src-next/face/__tests__/cli.test.ts +0 -4897
- package/src-next/face/__tests__/face.test.ts +0 -289
- package/src-next/face/__tests__/graph-view.test.ts +0 -61
- package/src-next/face/__tests__/host.test.ts +0 -24
- package/src-next/face/__tests__/install-rows.guard.test.ts +0 -58
- package/src-next/face/__tests__/negation.ts +0 -6
- package/src-next/face/__tests__/preview.test.ts +0 -374
- package/src-next/face/__tests__/projection.test.ts +0 -303
- package/src-next/face/__tests__/repo-root.guard.test.ts +0 -120
- package/src-next/face/__tests__/termination.test.ts +0 -650
- package/src-next/face/__tests__/words.guard.test.ts +0 -93
- package/src-next/face/artifacts.ts +0 -248
- package/src-next/face/board-view.ts +0 -652
- package/src-next/face/capsule.ts +0 -163
- package/src-next/face/cli.ts +0 -1028
- package/src-next/face/declare.ts +0 -323
- package/src-next/face/gate.ts +0 -171
- package/src-next/face/graph-view.ts +0 -74
- package/src-next/face/host.ts +0 -302
- package/src-next/face/lifecycle.ts +0 -725
- package/src-next/face/preview.ts +0 -151
- package/src-next/face/projection.ts +0 -285
- package/src-next/face/route-render.ts +0 -185
- package/src-next/face/termination.ts +0 -573
- package/src-next/face/words.ts +0 -314
- package/src-next/infra/__tests__/infra.test.ts +0 -333
- package/src-next/infra/__tests__/root.test.ts +0 -56
- package/src-next/infra/git.ts +0 -39
- package/src-next/infra/process.ts +0 -34
- package/src-next/infra/runtime.ts +0 -132
- package/src-next/infra/workspace.ts +0 -322
- package/src-next/render/__tests__/render.test.ts +0 -550
- package/src-next/render/__tests__/skeleton.test.ts +0 -684
- package/src-next/render/brief.ts +0 -121
- package/src-next/render/issue-body.ts +0 -162
- package/src-next/render/skeleton.ts +0 -502
- package/src-next/render/templates.ts +0 -645
- package/src-next/session/__tests__/graph.test.ts +0 -277
- package/src-next/session/__tests__/handoff-plane.guard.test.ts +0 -48
- package/src-next/session/__tests__/handoff-schema.test.ts +0 -310
- package/src-next/session/__tests__/ledger.test.ts +0 -745
- package/src-next/session/__tests__/next.test.ts +0 -460
- package/src-next/session/__tests__/preflight.test.ts +0 -545
- package/src-next/session/__tests__/round-naming.test.ts +0 -142
- package/src-next/session/__tests__/run.test.ts +0 -1026
- package/src-next/session/__tests__/wave-line-phase.guard.test.ts +0 -49
- package/src-next/session/__tests__/wave.test.ts +0 -476
- package/src-next/session/faces.ts +0 -110
- package/src-next/session/graph.ts +0 -411
- package/src-next/session/handoff-schema.ts +0 -373
- package/src-next/session/ledger.ts +0 -1076
- package/src-next/session/next.ts +0 -293
- package/src-next/session/preflight.ts +0 -271
- package/src-next/session/round-naming.ts +0 -84
- package/src-next/session/run.ts +0 -610
- package/src-next/session/state.ts +0 -30
- package/src-next/session/wave.ts +0 -139
package/src-next/face/capsule.ts
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
// packages/cdd-engine/src-next/face/capsule.ts
|
|
2
|
-
// T10 — the single capsule face (design spec §3.2: the `status · blocker · handoff
|
|
3
|
-
// · next:` word-face steady state). Capsule#emit renders the ALL-OP single stdout
|
|
4
|
-
// face — the capsule the orchestrator greps / routes on without opening the handoff:
|
|
5
|
-
//
|
|
6
|
-
// status: <status> · blocker: <blocker> · handoff: <handoff>
|
|
7
|
-
// next: <suggestion> (optional — the C5 route / a caller-rendered text)
|
|
8
|
-
//
|
|
9
|
-
// The byte face is v1-pinned: the key words (status · blocker · handoff) are
|
|
10
|
-
// pin-enforced by the CapsuleKey type and the emit signature — a data-only change
|
|
11
|
-
// cannot reshape them. What rides the injected Words table (the single word-table
|
|
12
|
-
// instance) is the `·` separator, the `next:` station anchor and the route/status
|
|
13
|
-
// vocabulary — a second table is excluded by construction. The `next:` value is
|
|
14
|
-
// either a caller-rendered string or the C5 Route rendered through the route-word
|
|
15
|
-
// table as a COMPLETE EXECUTABLE command (P4.1 T4 — the v1.39 semantic-literal
|
|
16
|
-
// reversal): `implement --plan <path> --tasks 17` · `review --type spec --spec
|
|
17
|
-
// <path>` · `fix --type spec --spec <path> --reviews <handoff> (read file back to
|
|
18
|
-
// confirm)` · `done` (the bare terminal word) · the soft-cap message verbatim.
|
|
19
|
-
// The argv is composed from the frame facts (the RouteTarget's type + id + plan)
|
|
20
|
-
// through the argv-channel flag spellings (the same channel the CLI parse reads —
|
|
21
|
-
// the render source is the declared channel, never a second hard-coded format
|
|
22
|
-
// string); the type flag renders ONLY where the verb's type discriminates
|
|
23
|
-
// (review/fix multi-type — implement is the single-type wave verb, so its literal
|
|
24
|
-
// never carries `--type` — the declaration's `parsed.args.type ?? "wave"` default
|
|
25
|
-
// semantics unchanged). The route-borne prose — the readback suffix · the soft-cap
|
|
26
|
-
// message — rides declared constants from session/next.ts, rendered by reference,
|
|
27
|
-
// never restated.
|
|
28
|
-
//
|
|
29
|
-
// D40 — the render delegates to the shared `RouteRenderer` (the ONE route →
|
|
30
|
-
// `next:` literal face, also consumed by the board); the capsule adds only the
|
|
31
|
-
// `done` face's doc-class discrimination (a spec doc's declared class decides the
|
|
32
|
-
// pipeline entry — or the BLOCKED face when the declaration is absent, spec §12).
|
|
33
|
-
//
|
|
34
|
-
// The class satisfies the session/run.ts CapsuleFace seam (T8's interaction point) —
|
|
35
|
-
// the capsule plugs into the lifecycle's attachCapsule contact, byte-identically.
|
|
36
|
-
// Module-level exports are the class — zero behavior-carrying bare functions.
|
|
37
|
-
|
|
38
|
-
import { type RepoPath, RepoRoot } from "../infra/root.ts";
|
|
39
|
-
import type { RouteTarget } from "../session/faces.ts";
|
|
40
|
-
import { NextStepRouter, type PipelineKey, type Route } from "../session/next.ts";
|
|
41
|
-
import { BoardView } from "./board-view.ts";
|
|
42
|
-
import { type RouteChannelRow, RouteRenderer } from "./route-render.ts";
|
|
43
|
-
import type { CapsuleKey, Words } from "./words.ts";
|
|
44
|
-
|
|
45
|
-
/** The argv-channel flag row the capsule's render reads — re-exported from the
|
|
46
|
-
* shared renderer's row type (the capsule renders through the ONE RouteRenderer). */
|
|
47
|
-
export type CapsuleChannelRow = RouteChannelRow;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Capsule — the single capsule output face. emit(status, blocker, handoff, next)
|
|
51
|
-
* renders one round's facts into the byte-pinned `status · blocker · handoff` line
|
|
52
|
-
* plus the optional `next:` line. The key words are the CapsuleKey literals the
|
|
53
|
-
* kind loop renders (pin-enforced by the emit signature); the separator, station
|
|
54
|
-
* and route/status words ride the injected Words instance. The complete executable
|
|
55
|
-
* `next:` literal composes its full argv from the route + the additive optional
|
|
56
|
-
* RouteTarget (the frame's own facts) through the argv-channel flag spellings
|
|
57
|
-
* (P4.1 T4; same channel source parse reads — the 4-param signature stays
|
|
58
|
-
* byte-pinned, the target is an optional 5th, the channel an optional 2nd).
|
|
59
|
-
*/
|
|
60
|
-
export class Capsule {
|
|
61
|
-
/** The single word table — the capsule's whole vocabulary source. */
|
|
62
|
-
readonly #words: Words;
|
|
63
|
-
/** The ONE route → `next:` literal renderer (D40 — shared with the board). */
|
|
64
|
-
readonly #route: RouteRenderer;
|
|
65
|
-
/** The repo-basis value object the doc-target ids + the `handoff:` cell resolve
|
|
66
|
-
* through (T1 `RepoRoot` · D47 — the ONE conversion exit; `null` keeps a relative
|
|
67
|
-
* id relative · the hermetic-test default). */
|
|
68
|
-
readonly #root: RepoRoot | null;
|
|
69
|
-
|
|
70
|
-
constructor(
|
|
71
|
-
words: Words,
|
|
72
|
-
channels: Readonly<Record<string, CapsuleChannelRow>> = {},
|
|
73
|
-
host = "",
|
|
74
|
-
root: RepoRoot | null = null,
|
|
75
|
-
) {
|
|
76
|
-
this.#words = words;
|
|
77
|
-
this.#root = root;
|
|
78
|
-
this.#route = new RouteRenderer(words, channels, host, root);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** emit(status, blocker, handoff, next, target) → the capsule stdout lines: the
|
|
82
|
-
* pinned `status · blocker · handoff` capsule line, then the optional `next:`
|
|
83
|
-
* line (a caller-rendered text, a C5 Route rendered as the complete executable
|
|
84
|
-
* command, or null/absent → no line). The additive optional RouteTarget supplies
|
|
85
|
-
* the frame's own type + id + plan for the executable literal (P4.1 T4); without
|
|
86
|
-
* it the route renders its bare classifier fallbacks (the 4-param signature stays
|
|
87
|
-
* byte-pinned). */
|
|
88
|
-
emit(
|
|
89
|
-
status: string,
|
|
90
|
-
blocker: string,
|
|
91
|
-
handoff: string,
|
|
92
|
-
next?: Route | string | null,
|
|
93
|
-
target?: RouteTarget | null,
|
|
94
|
-
): string[] {
|
|
95
|
-
const words = this.#words;
|
|
96
|
-
// The `handoff:` cell is a path value — normalized to the repoRoot-relative
|
|
97
|
-
// shape through the ONE value object (D47 · the ONE basis; `handoffPath` sources
|
|
98
|
-
// it absolute).
|
|
99
|
-
const cells: Record<CapsuleKey, string> = {
|
|
100
|
-
status,
|
|
101
|
-
blocker,
|
|
102
|
-
handoff: this.#rel(handoff),
|
|
103
|
-
};
|
|
104
|
-
const capsuleLine = words
|
|
105
|
-
.capsuleKeys()
|
|
106
|
-
.map((kind) => `${kind}: ${cells[kind]}`)
|
|
107
|
-
.join(words.capsuleSeparator());
|
|
108
|
-
const lines = [capsuleLine];
|
|
109
|
-
if (next !== undefined && next !== null) {
|
|
110
|
-
const text = typeof next === "string" ? next : this.#routeText(next, target);
|
|
111
|
-
lines.push(`${words.station("next")} ${text}`);
|
|
112
|
-
}
|
|
113
|
-
return lines;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/** The route → `next:` text render — the shared RouteRenderer (D40) unless the
|
|
117
|
-
* `done` face's doc-class discrimination fires (a spec doc's declared class decides
|
|
118
|
-
* the pipeline entry — or the BLOCKED face when the declaration is absent, spec
|
|
119
|
-
* §12 · D34). The capsule resolves the doc-class, then hands the resulting Route
|
|
120
|
-
* (a `handoff` carrying the entry, or the bare `done`) to the same renderer. */
|
|
121
|
-
#routeText(route: Route, target?: RouteTarget | null): string {
|
|
122
|
-
if (route.kind === "done" && target != null) {
|
|
123
|
-
const verdict = this.#docClassOf(target);
|
|
124
|
-
if (verdict === "blocked") {
|
|
125
|
-
return `${this.#words.station("blocked")} ${this.#words.routeWord("docType")}`;
|
|
126
|
-
}
|
|
127
|
-
// The declared doc-class (or a bare terminal) picks the pipeline entry — the
|
|
128
|
-
// same resolver + renderer the board consumes.
|
|
129
|
-
const key = verdict === "terminal" ? null : verdict;
|
|
130
|
-
return this.#route.render(NextStepRouter.resolve({ kind: "done" }, key), target);
|
|
131
|
-
}
|
|
132
|
-
return this.#route.render(route, target);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/** The target → doc-class verdict of the unified next face — the doc-class
|
|
136
|
-
* discrimination face (D33): the spec doc's class reads its DECLARED type (the
|
|
137
|
-
* front-matter `doc-type:` key, spec §12 · D34 — BoardView.readDocType,
|
|
138
|
-
* the one declaration reading face), never the filename suffix; the task-face
|
|
139
|
-
* targets key by type. `blocked` — the key is missing (the caller
|
|
140
|
-
* renders the BLOCKED face); `terminal` — no pipeline seam carries the declared
|
|
141
|
-
* class (`single-spec`, the table's five keys exclude it — the bare word). */
|
|
142
|
-
#docClassOf(target: RouteTarget): "blocked" | "terminal" | PipelineKey {
|
|
143
|
-
if (target.type === "spec") {
|
|
144
|
-
// The read face takes the value object + the repoRoot-relative id (T4 §2.2);
|
|
145
|
-
// a `null` root (the hermetic default) keeps the value as its own basis. The
|
|
146
|
-
// `#rel` branded return needs no cast here (F3).
|
|
147
|
-
const declared = BoardView.readDocType(this.#root ?? new RepoRoot(""), this.#rel(target.id));
|
|
148
|
-
return declared === null ? "blocked" : declared === "single-spec" ? "terminal" : declared;
|
|
149
|
-
}
|
|
150
|
-
if (target.type === "plan") return "plan";
|
|
151
|
-
if (target.type === "wave") return "wave";
|
|
152
|
-
return "branch";
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/** One path value normalized to the branded repoRoot-relative `RepoPath` through
|
|
156
|
-
* the ONE value object (D47); a `null` root (the hermetic default) passes the
|
|
157
|
-
* value through as its own basis. The branded return type carries the §2.2 brand
|
|
158
|
-
* to the read face (`BoardView.readDocType`) with NO call-site cast (branch-
|
|
159
|
-
* review-1 F3). */
|
|
160
|
-
#rel(value: string): RepoPath {
|
|
161
|
-
return this.#root === null ? (value as RepoPath) : this.#root.relativize(value);
|
|
162
|
-
}
|
|
163
|
-
}
|