@pmelab/gtd 64.0.0 → 64.1.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/.claude-plugin/plugin.json +1 -1
- package/README.md +8 -8
- package/dist/chunks/{steering-DkA51qDa.mjs → steering-Cem5i6Xl.mjs} +421 -1
- package/dist/chunks/{testkit-zGjNeQNL.mjs → testkit-DfWZQCWQ.mjs} +63 -16
- package/dist/gtd.bundle.mjs +485 -19
- package/dist/gtd.core.mjs +117 -110
- package/dist/steering.mjs +2 -2
- package/dist/testkit/gherkin.mjs +1 -1
- package/dist/testkit.mjs +1 -1
- package/dist/web/main.css +1 -1
- package/dist/workflow-kit.mjs +1 -1
- package/package.json +1 -1
- package/src/cli/Cli.ts +13 -1
- package/src/cli/Program.ts +23 -4
- package/src/edge/Edge.ts +23 -9
- package/src/emit/SteeringMode.ts +21 -1
- package/src/flows/index.ts +1 -0
- package/src/flows/runtime.test.ts +2 -1
- package/src/flows/runtime.ts +8 -2
- package/src/steering/Declared.test.ts +218 -0
- package/src/steering/Declared.ts +607 -0
- package/src/steering/FORMATS.md +3 -0
- package/src/steering/index.ts +12 -0
- package/src/steering/internal.ts +1 -0
- package/src/twins/EmittedScriptRecognizer.ts +5 -3
- package/src/twins/EmittedScripts.test.ts +19 -0
- package/src/workflow/SteeringFormats.ts +4 -0
- package/src/workflow/Workflow.ts +2 -0
- package/src/workflow/index.ts +5 -1
|
@@ -16,6 +16,8 @@ import {
|
|
|
16
16
|
import { Effect } from "effect"
|
|
17
17
|
import { ScriptSurface } from "../emit/index.js"
|
|
18
18
|
import { GitService } from "../platform/index.js"
|
|
19
|
+
import { listFormat } from "../steering/index.js"
|
|
20
|
+
import { declaredValidateCommand } from "../workflow/index.js"
|
|
19
21
|
import { gitTiers, type GitTier, type ScriptedCommand } from "./index.js"
|
|
20
22
|
|
|
21
23
|
// Every case runs through real `sh` — with this build's `gtd` on PATH — and
|
|
@@ -158,6 +160,23 @@ for (const makeTier of gitTiers) {
|
|
|
158
160
|
),
|
|
159
161
|
)
|
|
160
162
|
})
|
|
163
|
+
|
|
164
|
+
it("checks a declared format from the spec on its command line", () => {
|
|
165
|
+
const ids = listFormat({
|
|
166
|
+
name: "ids",
|
|
167
|
+
item: { id: /^A-\d+$/, separator: ":", example: "A-1" },
|
|
168
|
+
ids: { unique: true },
|
|
169
|
+
})
|
|
170
|
+
const check = declaredValidateCommand("ids", ids.spec).replace('"$GTD_FILE"', `'${FILE}'`)
|
|
171
|
+
t.seed.writeFile(FILE, "- A-1: it's\n")
|
|
172
|
+
expect(run(script(check))).toEqual({ ok: true, status: 0, output: "" })
|
|
173
|
+
t.seed.writeFile(FILE, "- A-1: a\n- A-1: b\n")
|
|
174
|
+
const result = run(script(check))
|
|
175
|
+
expect(result).toMatchObject({ ok: false, status: 1 })
|
|
176
|
+
expect(result.output).toBe(
|
|
177
|
+
`gtd check: ${FILE} is not valid under mode "ids" (1 finding(s)):\n${FILE}:2: duplicate ID A-1 — first on line 1\n`,
|
|
178
|
+
)
|
|
179
|
+
})
|
|
161
180
|
})
|
|
162
181
|
|
|
163
182
|
it("gtd uncheck clears a review file's ticks", () => {
|
|
@@ -4,3 +4,7 @@ export const seededValidateCommand = (mode: string): string => `gtd check ${mode
|
|
|
4
4
|
/** True when `command` is exactly `mode`'s seeded template (compared literally, not rendered) — distinguishes gtd's own seeding from a user override. */
|
|
5
5
|
export const isSeededValidateCommand = (mode: string, command: string): boolean =>
|
|
6
6
|
command === seededValidateCommand(mode)
|
|
7
|
+
|
|
8
|
+
/** The `validate:` command for a declared format: its spec travels on the command line, so `gtd check` loads no workflow to find it. */
|
|
9
|
+
export const declaredValidateCommand = (mode: string, spec: string): string =>
|
|
10
|
+
`gtd check ${mode} "$GTD_FILE" --spec '${spec.replace(/'/g, "'\\''")}'`
|
package/src/workflow/Workflow.ts
CHANGED
|
@@ -32,6 +32,8 @@ export interface StepDef {
|
|
|
32
32
|
readonly label?: string
|
|
33
33
|
readonly file?: string
|
|
34
34
|
readonly mode?: StateMode
|
|
35
|
+
/** A declared format's spec, when `mode` names one rather than a built-in or `modes:` entry. */
|
|
36
|
+
readonly modeSpec?: string
|
|
35
37
|
readonly model?: string
|
|
36
38
|
readonly system?: string
|
|
37
39
|
readonly judge?: string
|
package/src/workflow/index.ts
CHANGED
|
@@ -23,7 +23,11 @@ export {
|
|
|
23
23
|
SETTING_NAME_RULE,
|
|
24
24
|
} from "./vars.js"
|
|
25
25
|
export { resolveScopeAccess, resolveScopeSkills } from "./skills.js"
|
|
26
|
-
export {
|
|
26
|
+
export {
|
|
27
|
+
declaredValidateCommand,
|
|
28
|
+
seededValidateCommand,
|
|
29
|
+
isSeededValidateCommand,
|
|
30
|
+
} from "./SteeringFormats.js"
|
|
27
31
|
export {
|
|
28
32
|
type ChangeStatus,
|
|
29
33
|
type PendingChange,
|