@oscaner-skills/cdd-engine 2.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/README.md +2 -2
- package/README.zh-CN.md +2 -2
- 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/dist/infra/doc-roots.js +19 -0
- package/dist/infra/git.js +37 -0
- package/dist/infra/process.js +22 -0
- package/dist/infra/root.js +62 -0
- 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 +8 -7
- package/templates/report/issue-body.json +0 -46
- package/src-next/__tests__/bin.test.ts +0 -128
- package/src-next/__tests__/smoke.integration.test.ts +0 -202
- package/src-next/__tests__/zero-dep.test.ts +0 -134
- package/src-next/contract/__tests__/__snapshots__/project.schema.overall-spec.snap +0 -238
- package/src-next/contract/__tests__/__snapshots__/project.schema.phase-spec.snap +0 -153
- package/src-next/contract/__tests__/__snapshots__/project.schema.plan.snap +0 -173
- package/src-next/contract/__tests__/__snapshots__/project.schema.single-spec.snap +0 -89
- package/src-next/contract/__tests__/__snapshots__/project.shape.overall-spec.snap +0 -225
- package/src-next/contract/__tests__/__snapshots__/project.shape.phase-spec.snap +0 -155
- package/src-next/contract/__tests__/__snapshots__/project.shape.plan.snap +0 -175
- package/src-next/contract/__tests__/__snapshots__/project.shape.single-spec.snap +0 -85
- package/src-next/contract/__tests__/declare.test.ts +0 -242
- package/src-next/contract/__tests__/doc.test.ts +0 -358
- package/src-next/contract/__tests__/judge.test.ts +0 -873
- package/src-next/contract/__tests__/lint.test.ts +0 -314
- package/src-next/contract/__tests__/project.test.ts +0 -419
- package/src-next/contract/__tests__/translate.test.ts +0 -96
- package/src-next/contract/declare.ts +0 -983
- package/src-next/contract/doc.ts +0 -753
- package/src-next/contract/invariants.ts +0 -1268
- package/src-next/contract/judge.ts +0 -142
- package/src-next/contract/lint.ts +0 -275
- package/src-next/contract/project.ts +0 -596
- package/src-next/contract/skill-anatomy.ts +0 -273
- package/src-next/contract/translate.ts +0 -113
- package/src-next/face/__tests__/board-view.test.ts +0 -948
- package/src-next/face/__tests__/capsule.test.ts +0 -276
- package/src-next/face/__tests__/channel-closure.guard.test.ts +0 -102
- package/src-next/face/__tests__/cli.test.ts +0 -4643
- 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__/negation.ts +0 -6
- package/src-next/face/__tests__/projection.test.ts +0 -301
- package/src-next/face/__tests__/sync-runner.test.ts +0 -70
- package/src-next/face/__tests__/words.guard.test.ts +0 -93
- package/src-next/face/artifacts.ts +0 -195
- package/src-next/face/board-view.ts +0 -662
- package/src-next/face/capsule.ts +0 -149
- package/src-next/face/cli.ts +0 -819
- package/src-next/face/declare.ts +0 -326
- package/src-next/face/gate.ts +0 -170
- package/src-next/face/graph-view.ts +0 -74
- package/src-next/face/host.ts +0 -326
- package/src-next/face/lifecycle.ts +0 -700
- package/src-next/face/projection.ts +0 -282
- package/src-next/face/route-render.ts +0 -160
- package/src-next/face/words.ts +0 -296
- package/src-next/infra/__tests__/infra.test.ts +0 -287
- package/src-next/infra/git.ts +0 -39
- package/src-next/infra/process.ts +0 -34
- package/src-next/infra/runtime.ts +0 -185
- package/src-next/infra/workspace.ts +0 -232
- package/src-next/render/__tests__/render.test.ts +0 -499
- package/src-next/render/__tests__/skeleton.test.ts +0 -466
- package/src-next/render/brief.ts +0 -121
- package/src-next/render/issue-body.ts +0 -159
- package/src-next/render/skeleton.ts +0 -437
- package/src-next/render/templates.ts +0 -650
- package/src-next/session/__tests__/graph.test.ts +0 -270
- 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 -744
- package/src-next/session/__tests__/next.test.ts +0 -368
- package/src-next/session/__tests__/preflight.test.ts +0 -491
- package/src-next/session/__tests__/run.test.ts +0 -1014
- package/src-next/session/__tests__/wave-line-phase.guard.test.ts +0 -49
- package/src-next/session/__tests__/wave.test.ts +0 -469
- 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 -1004
- package/src-next/session/next.ts +0 -192
- package/src-next/session/preflight.ts +0 -240
- package/src-next/session/run.ts +0 -606
- package/src-next/session/state.ts +0 -30
- package/src-next/session/wave.ts +0 -139
package/src-next/session/wave.ts
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
// packages/cdd-engine/src-next/session/wave.ts
|
|
2
|
-
// T24 (v1.21 — the three-verb unified wave gate) — the task-face dispatch
|
|
3
|
-
// pre-flight as ONE gate method. The retired split check (the implement-only
|
|
4
|
-
// strict-wave check + the phase lock) converges into `WaveGate.vet(requested,
|
|
5
|
-
// verb)`: implement / review / fix share the same single wave gate — a
|
|
6
|
-
// half-wave review or a half-wave fix is structurally blocked exactly like a
|
|
7
|
-
// half-wave implement.
|
|
8
|
-
//
|
|
9
|
-
// The gate's only read face is `open = frontier(closedWaves())` — the derived
|
|
10
|
-
// wave over the ledger's C5 closure set (ledger.ts, the same closure predicate as
|
|
11
|
-
// the lifecycle's #markTerminal). The two judgments:
|
|
12
|
-
// 1. requested ≠ open → the split/subset BLOCK (dispatch the full derived wave,
|
|
13
|
-
// with the wave-board hint);
|
|
14
|
-
// 2. the open wave's phase ≠ verb → the wrong-phase BLOCK (run the matching phase).
|
|
15
|
-
// (v1.28 — the heterogeneous-phase row RETIRED: the wave-unitary ledger has ONE row
|
|
16
|
-
// per wave, so mixed per-task phases are structurally impossible — a per-task phase
|
|
17
|
-
// read was the T26 regression {16,22,24} exposed (the row key `16` never matched
|
|
18
|
-
// `{wave:"16,22,24"}`), not a mixed-phase anomaly.)
|
|
19
|
-
// The verdict wording renders the wave-gate vocabulary rows (face/words.ts — the
|
|
20
|
-
// gate's prompt wording rides the word table, never a literal restate). BLOCK
|
|
21
|
-
// messages and the verdict shape are data here; the CLI face renders them.
|
|
22
|
-
//
|
|
23
|
-
// Module-level exports are types / the class — zero behavior-carrying bare
|
|
24
|
-
// functions (the plan's zero-bare-function discipline).
|
|
25
|
-
|
|
26
|
-
import type { Words } from "../face/words.ts";
|
|
27
|
-
import type { DispatchPhase } from "./faces.ts";
|
|
28
|
-
import type { TaskGraph } from "./graph.ts";
|
|
29
|
-
import type { Ledger } from "./ledger.ts";
|
|
30
|
-
|
|
31
|
-
/** The verdict kinds — the named gate rows (the BLOCK reason each carries). */
|
|
32
|
-
export type WaveGateReason = "split" | "wrong-phase";
|
|
33
|
-
|
|
34
|
-
/** One open-wave task's phase row — every member carries the WAVE's single phase
|
|
35
|
-
* (the wave-unitary read: one ledger row per wave; a per-task read would miss the
|
|
36
|
-
* wave row — `16` ≠ `16,22,24` — the T26 migration regression). */
|
|
37
|
-
export interface WavePhaseRow {
|
|
38
|
-
/** The task id. */
|
|
39
|
-
task: number;
|
|
40
|
-
/** The wave's open phase (null = a closed/held wave — no open round on record). */
|
|
41
|
-
phase: DispatchPhase | null;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** The wave-gate verdict — approved or one of the three named BLOCK rows. */
|
|
45
|
-
export interface WaveVerdict {
|
|
46
|
-
/** Whether the gate approves the dispatch (the requested wave = the open wave,
|
|
47
|
-
* the wave's phase = the requested verb). */
|
|
48
|
-
ok: boolean;
|
|
49
|
-
/** The BLOCK reason kind (present when ok is false). */
|
|
50
|
-
reason?: WaveGateReason;
|
|
51
|
-
/** The rendered BLOCK message (the vocabulary row, verbatim-filled). */
|
|
52
|
-
message?: string;
|
|
53
|
-
/** The derived open wave — frontier(closedWaves), ascending (both the split hint
|
|
54
|
-
* and the CLI's progress-marking read this). */
|
|
55
|
-
open: readonly number[];
|
|
56
|
-
/** The open wave's member phases — every task carries the WAVE's single phase
|
|
57
|
-
* (the wave-unitary display: one ledger row per wave, never a per-task read). */
|
|
58
|
-
phases?: readonly WavePhaseRow[];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* WaveGate — the three-verb unified wave gate (implement / review / fix share the
|
|
63
|
-
* single gate). One OOP method: vet(requested, verb) judges the request against
|
|
64
|
-
* the derived open wave + the ledger's per-task phases; the CLI calls it before
|
|
65
|
-
* ANY task-face dispatch, never a variant gate per verb.
|
|
66
|
-
*/
|
|
67
|
-
export class WaveGate {
|
|
68
|
-
/** vet(requested, verb, graph, ledger, words) — the three-verb gate: the verdict
|
|
69
|
-
* row the CLI renders (ok → dispatch; a reason + message → the BLOCK face). */
|
|
70
|
-
vet(
|
|
71
|
-
requested: ReadonlySet<number>,
|
|
72
|
-
verb: "implement" | "review" | "fix",
|
|
73
|
-
graph: TaskGraph,
|
|
74
|
-
ledger: Ledger,
|
|
75
|
-
words: Words,
|
|
76
|
-
): WaveVerdict {
|
|
77
|
-
const closed = ledger.closedWaves();
|
|
78
|
-
const open = [...graph.frontier(closed)].sort((a, b) => a - b);
|
|
79
|
-
const asked = [...requested].sort((a, b) => a - b);
|
|
80
|
-
const requestedKey = asked.join(",");
|
|
81
|
-
const openKey = open.join(",");
|
|
82
|
-
const wordsGate = words.waveGateWords();
|
|
83
|
-
const exact = asked.length === open.length && asked.every((id, index) => id === open[index]);
|
|
84
|
-
|
|
85
|
-
// 1. The split/subset BLOCK — requested ≠ open: a `--tasks` set that splits or
|
|
86
|
-
// mismatches the derived wave is refused for ANY verb (a subset never reorders
|
|
87
|
-
// the wave, never half-approves it). The full-wave hint rides the message.
|
|
88
|
-
if (!exact) {
|
|
89
|
-
return {
|
|
90
|
-
ok: false,
|
|
91
|
-
reason: "split",
|
|
92
|
-
message: this.#fill(wordsGate.split, { requested: requestedKey, open: openKey }),
|
|
93
|
-
open,
|
|
94
|
-
phases: this.#phasesOf(ledger, open),
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// 2. The open wave's phase — the single phase of the wave's own row (wave-unitary:
|
|
99
|
-
// one ledger row per wave, so every member shares the phase; a per-task read
|
|
100
|
-
// never matches the wave row — the T26 migration regression).
|
|
101
|
-
const phases = this.#phasesOf(ledger, open);
|
|
102
|
-
const phase = phases[0]?.phase ?? null;
|
|
103
|
-
if (phase !== verb) {
|
|
104
|
-
return {
|
|
105
|
-
ok: false,
|
|
106
|
-
reason: "wrong-phase",
|
|
107
|
-
message: this.#fill(wordsGate.wrongPhase, { phase: phase ?? "held" }),
|
|
108
|
-
open,
|
|
109
|
-
phases,
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
return { ok: true, open, phases };
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/** The open wave's per-task phases — every member resolves the WAVE row's single
|
|
116
|
-
* phase (implement → review → fix → re-review → closure; null = no open round). */
|
|
117
|
-
#phasesOf(ledger: Ledger, open: readonly number[]): readonly WavePhaseRow[] {
|
|
118
|
-
const waveKey = open.join(",");
|
|
119
|
-
const phase = this.#phaseOf(ledger, waveKey);
|
|
120
|
-
return open.map((task) => ({ task, phase }));
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/** The ledger-derived open phase of ONE wave row — the SINGLE source (D26): the
|
|
124
|
-
* wave gate and the lifecycle's frame frontier both read this one method
|
|
125
|
-
* (`Ledger#waveLinePhase`), never a per-consumer copy. The wave-unitary read: the
|
|
126
|
-
* same C5 round-pair derivation over the wave's own row key (the per-task read
|
|
127
|
-
* never matched a `{wave:"16,22,24"}` row — the fix). The D16/T11 revision
|
|
128
|
-
* precheck lives in the ledger method (a drifted BRIEF reopens at review; same +
|
|
129
|
-
* pending fix stays at fix). */
|
|
130
|
-
#phaseOf(ledger: Ledger, waveKey: string): DispatchPhase | null {
|
|
131
|
-
return ledger.waveLinePhase(waveKey);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/** The raw fill of one placeholder template — the noun-slot substitution
|
|
135
|
-
* ({requested} / {open} / {phase} / {map}); every slot defined, unknown braces kept. */
|
|
136
|
-
#fill(template: string, slots: Record<string, string>): string {
|
|
137
|
-
return template.replace(/\{(\w+)\}/g, (whole, name: string) => slots[name] ?? whole);
|
|
138
|
-
}
|
|
139
|
-
}
|