@pmelab/gtd 6.7.0 → 6.9.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 +47 -33
- package/dist/gtd.bundle.mjs +210 -89
- package/docs/cli.md +24 -21
- package/docs/configuration.md +92 -61
- package/docs/design/state-file-association.md +3 -3
- package/docs/design/state-machine-validation.md +2 -2
- package/docs/design/steering-file-loops.md +1 -1
- package/docs/design/work-packages.md +6 -7
- package/docs/development.md +5 -7
- package/docs/upgrading.md +25 -25
- package/package.json +1 -1
- package/docs/examples/advanced-workflow.md +0 -481
package/docs/cli.md
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
Usage: gtd [command] [options]
|
|
5
5
|
|
|
6
6
|
Commands:
|
|
7
|
-
init
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
init Scaffold a .gtdrc.json for this repo with the bundled
|
|
8
|
+
unified workflow; its agent prompts are written as editable
|
|
9
|
+
Markdown under gtd-prompts/ and referenced from the config.
|
|
10
|
+
Takes no argument. Run once per repo; refuses if a gtd
|
|
11
|
+
config already exists. Leaves the files uncommitted for you
|
|
12
|
+
to review and commit
|
|
13
13
|
step <actor> Authenticate as <actor>, match the resolved rest's
|
|
14
14
|
declared patterns against the pending changes, and commit
|
|
15
15
|
(or squash) the one resulting transition. Pass
|
|
@@ -59,19 +59,22 @@ mistyped flag can never degrade a JSON caller to plain-text mode. A bare
|
|
|
59
59
|
`--model`, `--model` without `--cost`, or either flag on any command other than
|
|
60
60
|
`gtd step` are all usage errors.
|
|
61
61
|
|
|
62
|
-
## `gtd init
|
|
62
|
+
## `gtd init`
|
|
63
63
|
|
|
64
|
-
Scaffolds a `.gtdrc.json` at the repository root with
|
|
65
|
-
workflow
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
so this is the one-time setup step for a repo; a state command
|
|
69
|
-
fails with `gtd: no workflow configured — run \`gtd init
|
|
64
|
+
Scaffolds a `.gtdrc.json` at the repository root with the bundled **unified**
|
|
65
|
+
workflow template inline under a `workflow:` key, plus a `$schema` link. It
|
|
66
|
+
takes **no argument** — passing one is a usage error
|
|
67
|
+
(`gtd init: too many arguments — init takes no argument`). gtd ships **no**
|
|
68
|
+
default workflow, so this is the one-time setup step for a repo; a state command
|
|
69
|
+
run before it fails with `gtd: no workflow configured — run \`gtd init\` to
|
|
70
|
+
create .gtdrc.json`.
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
The unified template has three entry points into one shared review/squash tail
|
|
73
|
+
(see [STATES.md §10](../STATES.md#10-the-bundled-workflow-templates)): creating
|
|
74
|
+
`.gtd/TODO.md` starts the simple flow (grilling → building → checking), creating
|
|
75
|
+
`.gtd/REQUIREMENTS.md` starts the advanced flow (two-phase Q&A planning,
|
|
76
|
+
per-package parallel build, agentic spec-review), and `gtd review <commitish>`
|
|
77
|
+
enters review directly.
|
|
75
78
|
|
|
76
79
|
The file is written **uncommitted**; review and commit it before your first
|
|
77
80
|
`gtd step` (an uncommitted `.gtdrc.json` is a pending change the initial state
|
|
@@ -79,7 +82,7 @@ would otherwise capture). `gtd init` refuses if the repo root already has its
|
|
|
79
82
|
own gtd config (a global/ancestor config, e.g. `~/.gtdrc`, does not count),
|
|
80
83
|
requires the repository root, and — with `gtd lsp` — is one of the two commands
|
|
81
84
|
that run with no workflow configured. `--json` prints
|
|
82
|
-
`{"written":".gtdrc.json","workflow":"
|
|
85
|
+
`{"written":".gtdrc.json","workflow":"unified","prompts":[…]}`. See
|
|
83
86
|
[Configuration](configuration.md#gtd-init).
|
|
84
87
|
|
|
85
88
|
## `gtd step <actor> [--cost=<n>] [--model=<name>]`
|
|
@@ -325,9 +328,9 @@ Then:
|
|
|
325
328
|
approve), has nothing to validate and exits `0`
|
|
326
329
|
(`nothing to validate at "<state>"`). Nothing is formatted in that case.
|
|
327
330
|
|
|
328
|
-
This is how the
|
|
329
|
-
|
|
330
|
-
|
|
331
|
+
This is how the unified template keeps its steering files well-formed without an
|
|
332
|
+
in-machine validation state — and the check runs whoever last touched the file,
|
|
333
|
+
agent or human:
|
|
331
334
|
|
|
332
335
|
- **The producing agent self-validates.** Plain `gtd next` appends a "run
|
|
333
336
|
`gtd validate` and fix all violations" instruction to a `prompt` rest that
|
package/docs/configuration.md
CHANGED
|
@@ -40,7 +40,7 @@ Any other top-level key is **rejected** (`onExcessProperty: "error"`) — v3 has
|
|
|
40
40
|
no `testCommand`, `fixAttemptCap`, `reviewThreshold`, `agenticReview`, `squash`,
|
|
41
41
|
`learning`, `decisionLog`, or `models` keys; all of that machinery is gone (see
|
|
42
42
|
[Upgrading](upgrading.md)). The engine blesses no VARIABLE NAMES either —
|
|
43
|
-
`testCommand` (the bundled
|
|
43
|
+
`testCommand` (the bundled template's own var, see ["Variables"](#variables)) is
|
|
44
44
|
workflow-authored data like any other `it.vars` entry, not a special key gtd
|
|
45
45
|
interprets.
|
|
46
46
|
|
|
@@ -53,10 +53,9 @@ interprets.
|
|
|
53
53
|
> behind it.
|
|
54
54
|
|
|
55
55
|
The `workflow:` key is the **only** definition source — there is no `extends`,
|
|
56
|
-
no merge-over-a-built-in. The bundled
|
|
57
|
-
|
|
58
|
-
`
|
|
59
|
-
(`compileWorkflowConfig`); `gtd init` just writes one of them, inline, under
|
|
56
|
+
no merge-over-a-built-in. The bundled template `gtd init` scaffolds is itself a
|
|
57
|
+
YAML asset (`src/workflows/unified.yaml`) compiled through the exact same
|
|
58
|
+
compiler (`compileWorkflowConfig`); `gtd init` just writes it, inline, under
|
|
60
59
|
this key. Its shape:
|
|
61
60
|
|
|
62
61
|
```yaml
|
|
@@ -93,11 +92,23 @@ engine, and [§3](../STATES.md#3-pattern-grammar) for the pattern grammar.
|
|
|
93
92
|
### Content values: inline or a file reference
|
|
94
93
|
|
|
95
94
|
A `script`/`prompt`/`message`/`commit` value starting with `./` or `../` is a
|
|
96
|
-
**file reference** — resolved relative to the
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
**file reference** — resolved relative to **the directory of the `.gtdrc` that
|
|
96
|
+
declared it** (not the directory `gtd` runs from) and read at load time. A
|
|
97
|
+
missing or unreadable file reference is a **load error**, collected and thrown
|
|
98
|
+
with every other config problem — never silently treated as inline text. Any
|
|
99
|
+
other string (including one that merely contains a `/`, or an absolute path) is
|
|
100
|
+
inline Eta template source, used verbatim.
|
|
101
|
+
|
|
102
|
+
Because references anchor to the declaring file, a `.gtdrc` and its
|
|
103
|
+
`gtd-prompts/` (or `prompts/`) directory can live **outside** the repo — e.g. in
|
|
104
|
+
a parent directory shared across several repos. gtd still runs from the repo
|
|
105
|
+
root, discovers the parent `.gtdrc` by walking up the directory chain (see
|
|
106
|
+
["Lookup and precedence"](#lookup-and-precedence) — cwd→home), and inlines each
|
|
107
|
+
level's `./`-relative references against that level's own directory. When
|
|
108
|
+
workflows are layered across levels, every reference resolves against the file
|
|
109
|
+
that wrote it, so a parent's `./gtd-prompts/x.md` and a child's never collide.
|
|
110
|
+
You can scaffold such a shared config by running [`gtd init`](#gtd-init) from
|
|
111
|
+
that parent directory — it need not be a git repository.
|
|
101
112
|
|
|
102
113
|
```yaml
|
|
103
114
|
workflow:
|
|
@@ -230,9 +241,10 @@ Because `grilling` re-enters itself around the answer loop, every lap emits
|
|
|
230
241
|
`building` emits a different label (`build`), which is where the driver clears
|
|
231
242
|
memory for a fresh implementation turn. A loop of same-labelled turns retains; a
|
|
232
243
|
differently-labelled state at a phase boundary clears. This is exactly how the
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
the
|
|
244
|
+
unified template scopes its agent states across the four `plan`/`build`/`fix`/
|
|
245
|
+
`review` memory tiers (see
|
|
246
|
+
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates)), and how the
|
|
247
|
+
loop driver reads it is spelled out in `skills/loop/SKILL.md`.
|
|
236
248
|
|
|
237
249
|
Like `model`, `memory:` is rendered as an Eta template through the same context
|
|
238
250
|
as the state's content — a plain label (`plan`) passes through unchanged, while
|
|
@@ -250,8 +262,7 @@ A state may additionally declare `file:` — an Eta template naming THE steering
|
|
|
250
262
|
file this state is about: the file a human/editor should look at while the
|
|
251
263
|
machine rests here (rendered through the same `it.vars`-carrying context as
|
|
252
264
|
content/`model`; must render non-empty). Forbidden on a commit state (never at
|
|
253
|
-
rest). Multiple states may share one `file:` (and, in the
|
|
254
|
-
do):
|
|
265
|
+
rest). Multiple states may share one `file:` (and, in the unified template, do):
|
|
255
266
|
|
|
256
267
|
```yaml
|
|
257
268
|
workflow:
|
|
@@ -369,12 +380,11 @@ So for a state declaring `mode: qa`:
|
|
|
369
380
|
| both | its `format:` | its `validate:` |
|
|
370
381
|
|
|
371
382
|
That is what makes the built-in modes extensible rather than all-or-nothing —
|
|
372
|
-
and the top-level key means a project can plug its formatter into
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
in your `.gtdrc.json`:
|
|
383
|
+
and the top-level key means a project can plug its formatter into the workflow
|
|
384
|
+
it scaffolded (`gtd init`) without re-declaring a `modes:` block on the workflow
|
|
385
|
+
itself. **`gtd init` seeds exactly this block by default** (the Prettier
|
|
386
|
+
suggestion below), so a fresh repo already formats its steering files — edit or
|
|
387
|
+
drop it to taste. It sits alongside the `workflow:` key in your `.gtdrc.json`:
|
|
378
388
|
|
|
379
389
|
```jsonc
|
|
380
390
|
// .gtdrc.json — the workflow from `gtd init`, plus your own markdown formatter
|
|
@@ -429,10 +439,11 @@ workflow:
|
|
|
429
439
|
"* **": building
|
|
430
440
|
```
|
|
431
441
|
|
|
432
|
-
The
|
|
433
|
-
`
|
|
434
|
-
|
|
435
|
-
|
|
442
|
+
The unified template enables `reviewWindow: true` on `await-review` and marks
|
|
443
|
+
`review-deciding` `reviewBase: true`, so the first review covers the whole cycle
|
|
444
|
+
but each subsequent feedback round's window narrows to `last-review..HEAD`. The
|
|
445
|
+
pure engine never observes an open window — it is opened/closed entirely at the
|
|
446
|
+
edge; the real head is preserved under `refs/gtd/review-head` (the base under
|
|
436
447
|
`refs/gtd/review-base`) for the window's lifetime. See
|
|
437
448
|
[STATES.md §11](../STATES.md) for the full lifecycle.
|
|
438
449
|
|
|
@@ -546,15 +557,14 @@ Every template — `script`/`prompt`/`message`/`commit`, and `model`/`memory`/
|
|
|
546
557
|
layers, **later wins**:
|
|
547
558
|
|
|
548
559
|
1. **The workflow's own `vars:` key** (sibling to `states:`, shown above) — the
|
|
549
|
-
workflow author's declared defaults. The
|
|
560
|
+
workflow author's declared defaults. The unified template declares
|
|
550
561
|
`vars: { testCommand: "npm test" }`, read by `checking`'s script as
|
|
551
562
|
`<%~ it.vars.testCommand %>` (see
|
|
552
|
-
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates)).
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
tier at once.
|
|
563
|
+
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates)). The bundled
|
|
564
|
+
template also declares two model-tier vars — `plannerModel` (default `smart`)
|
|
565
|
+
and `coderModel` (default `base`) — that every agent state's `model:`
|
|
566
|
+
resolves through (`model: <%= it.vars.plannerModel %>`), so repointing one
|
|
567
|
+
var here (or via layer 2/3 below) changes every state on that tier at once.
|
|
558
568
|
2. **A top-level `.gtdrc` `vars:` key** (a sibling of `workflow:`, NOT nested
|
|
559
569
|
inside it) — per-repo tuning without redefining the whole workflow. Subject
|
|
560
570
|
to the same cwd→home deep merge as everything else in `.gtdrc` (innermost
|
|
@@ -572,7 +582,7 @@ alongside every other config-shape finding (see
|
|
|
572
582
|
already strings.
|
|
573
583
|
|
|
574
584
|
```yaml
|
|
575
|
-
# .gtdrc — overriding the
|
|
585
|
+
# .gtdrc — overriding the unified template's testCommand
|
|
576
586
|
vars:
|
|
577
587
|
testCommand: npm run test:ci
|
|
578
588
|
```
|
|
@@ -664,22 +674,34 @@ gtd ships **no** default workflow, so a repo must scaffold one before any state
|
|
|
664
674
|
command works:
|
|
665
675
|
|
|
666
676
|
```bash
|
|
667
|
-
gtd init
|
|
677
|
+
gtd init # takes no argument
|
|
668
678
|
```
|
|
669
679
|
|
|
670
|
-
`gtd init
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
is
|
|
674
|
-
|
|
680
|
+
`gtd init` writes a `.gtdrc.json` at the repository root with the bundled
|
|
681
|
+
unified template's workflow under a `workflow:` key, plus a `$schema` link (so
|
|
682
|
+
editors pick up completion/validation). It takes **no argument** — passing one
|
|
683
|
+
is a usage error (`gtd init: too many arguments — init takes no argument`). Each
|
|
684
|
+
**agent state's prompt** is written as a standalone Markdown file under
|
|
685
|
+
`gtd-prompts/<state>.md` and the config references it via a
|
|
686
|
+
`./gtd-prompts/<state>.md`
|
|
675
687
|
[file reference](#content-values-inline-or-a-file-reference) — gtd inlines it at
|
|
676
688
|
load time, so a prompt is editable Markdown and editing it changes the workflow
|
|
677
689
|
with no config edit. Human `message:` blocks and check `script:` bodies stay
|
|
678
690
|
inline in the config (they are workflow mechanics, not prompts).
|
|
679
691
|
|
|
692
|
+
`gtd init` writes only config — it derives no git state — so it need not run in
|
|
693
|
+
a git repository. It runs at a **repository root** or in a directory **outside
|
|
694
|
+
any repository** (scaffolding a shared config a nested repo picks up by walking
|
|
695
|
+
up — see the parent-dir note under
|
|
696
|
+
[file references](#content-values-inline-or-a-file-reference)); its guidance
|
|
697
|
+
adjusts to say there is nothing to commit when it is not in a repo. It refuses
|
|
698
|
+
only to write into a repository **subdirectory**, where the upward config walk
|
|
699
|
+
would never find the file. Either way, it will not overwrite an existing config
|
|
700
|
+
at that directory (remove it first to re-scaffold).
|
|
701
|
+
|
|
680
702
|
It also seeds a top-level [`modes:`](#modes--pluggable-steering-file-modes)
|
|
681
703
|
block as a ready-to-edit suggestion — a Prettier `format:` for each built-in
|
|
682
|
-
steering-file mode the
|
|
704
|
+
steering-file mode the template uses:
|
|
683
705
|
|
|
684
706
|
```jsonc
|
|
685
707
|
"modes": {
|
|
@@ -694,16 +716,22 @@ this is the one default it suggests: a fresh repo auto-formats its steering
|
|
|
694
716
|
files out of the box, and you edit or drop the block freely (swap Prettier for
|
|
695
717
|
dprint, point at a script, or delete the key).
|
|
696
718
|
|
|
697
|
-
The
|
|
719
|
+
The one bundled template has three entry points into a shared review/squash tail
|
|
720
|
+
(all walked through in
|
|
721
|
+
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates)):
|
|
722
|
+
|
|
723
|
+
- **the simple flow** — creating `.gtd/TODO.md` starts idle → grilling ⇄
|
|
724
|
+
grilling-answer → building → checking ⇄ fixing (→ escalate) → reviewing →
|
|
725
|
+
await-review.
|
|
726
|
+
- **the advanced flow** — creating `.gtd/REQUIREMENTS.md` starts the fuller
|
|
727
|
+
machine: two-phase Q&A planning (product then architecture), package
|
|
728
|
+
decomposition, a per-package parallel build queue with an agentic spec-review
|
|
729
|
+
gate, then the same shared tail.
|
|
730
|
+
- **`gtd review <commitish>`** — enters the shared `reviewing` state directly to
|
|
731
|
+
review a foreign branch.
|
|
698
732
|
|
|
699
|
-
-
|
|
700
|
-
|
|
701
|
-
grilling ⇄ grilling-answer → building → checking ⇄ fixing (→ escalate) →
|
|
702
|
-
reviewing → await-review, resting back at idle on approval (no squash).
|
|
703
|
-
- **`advanced`** — the fuller machine (two-phase Q&A planning, an architecture
|
|
704
|
-
phase, task decomposition, a per-task build queue, and a squash finale),
|
|
705
|
-
walked through at
|
|
706
|
-
[docs/examples/advanced-workflow.md](examples/advanced-workflow.md).
|
|
733
|
+
Both file-created flows converge on `reviewing` → `await-review`, and a full
|
|
734
|
+
sign-off squashes the whole cycle into one commit.
|
|
707
735
|
|
|
708
736
|
The files are written **uncommitted** — review them, then commit `.gtdrc.json`
|
|
709
737
|
and `gtd-prompts/` before your first `gtd step` (an uncommitted file is a
|
|
@@ -715,7 +743,7 @@ that run with no workflow configured. A state command run before `gtd init`
|
|
|
715
743
|
fails with:
|
|
716
744
|
|
|
717
745
|
```
|
|
718
|
-
gtd: no workflow configured — run `gtd init
|
|
746
|
+
gtd: no workflow configured — run `gtd init` to create .gtdrc.json
|
|
719
747
|
```
|
|
720
748
|
|
|
721
749
|
## A complete example
|
|
@@ -778,19 +806,22 @@ the file.
|
|
|
778
806
|
|
|
779
807
|
## Recipe: a per-task builder loop without a script state
|
|
780
808
|
|
|
781
|
-
A `picking`-style queue arbiter (
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
809
|
+
A `picking`-style queue arbiter (the bundled unified template's advanced flow
|
|
810
|
+
carries one — see
|
|
811
|
+
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates)) is a `script`
|
|
812
|
+
state that turns a task-queue glob into a diff patterns can see. A driver that
|
|
813
|
+
can't run scripts can get the same per-task loop out of pure prompt/`on`
|
|
814
|
+
declarations instead, at the cost of trusting the agent to honor a marker
|
|
815
|
+
protocol rather than a deterministic `ls`: see
|
|
787
816
|
[docs/design/work-packages.md §3](design/work-packages.md) ("Option B —
|
|
788
817
|
agent-encoded verdict") for the worked example.
|
|
789
818
|
|
|
790
819
|
## A fuller example: two-phase planning, task decomposition, agent-prepared review
|
|
791
820
|
|
|
792
|
-
The example above is deliberately small (it is close to the
|
|
793
|
-
For a heavier machine — Q&A planning loops, an
|
|
794
|
-
decomposition, the deterministic per-task `picking`
|
|
795
|
-
`.gtd/REVIEW.md` review —
|
|
796
|
-
|
|
821
|
+
The example above is deliberately small (it is close to the bundled unified
|
|
822
|
+
template's simple flow). For a heavier machine — Q&A planning loops, an
|
|
823
|
+
architecture phase, task decomposition, the deterministic per-task `picking`
|
|
824
|
+
arbiter, and agent-prepared `.gtd/REVIEW.md` review — the unified template's
|
|
825
|
+
**advanced flow** (started by creating `.gtd/REQUIREMENTS.md`) is exactly that,
|
|
826
|
+
walked through in
|
|
827
|
+
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates).
|
|
@@ -68,8 +68,8 @@ patterns desyncs the machine. The vars are a DRY mechanism inside templates and
|
|
|
68
68
|
the state↔file association, not a rename switch. (Making pattern keys var-aware
|
|
69
69
|
at compile time is noted as possible future work.)
|
|
70
70
|
|
|
71
|
-
The advanced
|
|
72
|
-
`file:`/`mode:` annotations (it is the LSP-heavy flow), including
|
|
71
|
+
The advanced flow of the bundled unified template (see STATES.md §10) gains the
|
|
72
|
+
same `file:`/`mode:` annotations (it is the LSP-heavy flow), including
|
|
73
73
|
`architectureFile` for its architecting phases (also `qa`-format).
|
|
74
74
|
|
|
75
75
|
## 3. The LSP becomes config-driven
|
|
@@ -105,7 +105,7 @@ The advanced example (`docs/examples/advanced-workflow.md`) gains the same
|
|
|
105
105
|
| `src/Edge.ts` / `src/program.ts` | Render `file:` at rest; `file`/`mode` in both `--json` payloads + plain `status` lines. |
|
|
106
106
|
| `src/Lsp.ts` | Config discovery, path→mode dispatch (with basename fallback), `gtd.openSteeringFile`. |
|
|
107
107
|
| `src/workflows/default.yaml` | §2's vars + per-state `file:`/`mode:`; templates switch to filename vars. |
|
|
108
|
-
| Docs | STATES.md property table + §10; configuration.md (`file:`/`mode:` section + mode vocabulary + the pattern-literal limitation); cli.md JSON contracts;
|
|
108
|
+
| Docs | STATES.md property table + §10; configuration.md (`file:`/`mode:` section + mode vocabulary + the pattern-literal limitation); cli.md JSON contracts; the bundled unified template's advanced-flow annotations (STATES.md §10); upgrading note (jump command is back, config-driven). |
|
|
109
109
|
| Tests | Unit: validation (mode vocabulary, mode-requires-file, commit-state prohibition, aggregation), compile, `file:` render + failure path; LSP path→mode dispatch, fallback, openSteeringFile (pure helpers). E2e: `driver-json-status.feature` file/mode emission (present + omitted); `lsp.feature` @live — documentSymbol served for a CUSTOM-named qa file mapped via a real `.gtdrc` (proving config-driven dispatch), and the jump command returning the rendered path at a known state. |
|
|
110
110
|
| Live verification | Scratch repo with a custom workflow whose `file:` uses a var: `gtd status` shows the rendered `File:`/`Mode:`; LSP smoke against the custom filename; default workflow spot-check (`grilling` → `File: .gtd/TODO.md`, `Mode: qa`). |
|
|
111
111
|
|
|
@@ -306,8 +306,8 @@ sub-millisecond — safe to run on every invocation, exactly like today's
|
|
|
306
306
|
- **The bundled default must stay finding-free** — findings 7 and 10 are
|
|
307
307
|
calibrated against it (`fixing`'s cap bounds the check loop; the literal
|
|
308
308
|
`.gtd/...` patterns match the declared default vars). Any new check must be
|
|
309
|
-
validated against
|
|
310
|
-
before landing.
|
|
309
|
+
validated against the bundled unified template (`src/workflows/unified.yaml`,
|
|
310
|
+
covering both its simple and advanced flows) before landing.
|
|
311
311
|
- **Warning channel is the only architectural change** — everything else slots
|
|
312
312
|
into the existing collect-and-merge flow in `compileWorkflowConfig`.
|
|
313
313
|
|
|
@@ -133,7 +133,7 @@ review-deciding branch condition. Findings go into `.gtd/FORMAT.md` verbatim
|
|
|
133
133
|
| `STATES.md` §10 | New table + walkthrough (both loops, the declaration-order subtleties, the hygiene invariant). |
|
|
134
134
|
| `tests/integration/features/default-workflow.feature` | Rewritten: malformed-TODO lap (simulate `todo-validating` by writing `.gtd/FORMAT.md` + `gtd step check` — @inmem never executes scripts), valid draft → answer lap → accept; malformed-REVIEW lap; tick-all approve → `idle` with empty `.gtd/`; partial-tick feedback → TODO.md extraction → `grilling`; delete-shortcut approve; retry/escalation kept. |
|
|
135
135
|
| `smoke.feature` | Hop updates (`grilling` now routes to `todo-validating`). |
|
|
136
|
-
| Docs | `configuration.md` / `README.md` walkthrough mentions;
|
|
136
|
+
| Docs | `configuration.md` / `README.md` walkthrough mentions; the advanced flow is now part of the bundled unified template (see STATES.md §10) rather than a standalone example. |
|
|
137
137
|
| Live verification | Real-script drive (`gtd run` at each validator) covering: agent writes malformed TODO → FORMAT.md → fixed lap; answers folded; malformed REVIEW lap; tick-all approve; partial-tick feedback extracting TODO.md; final tree `.gtd`-free at idle. |
|
|
138
138
|
|
|
139
139
|
## 5. The LSP server comes back (v3-shaped)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
# Design: the builder / work-packages flow as pure workflow configuration
|
|
2
2
|
|
|
3
|
-
> Status: LANDED
|
|
4
|
-
>
|
|
5
|
-
>
|
|
6
|
-
>
|
|
7
|
-
>
|
|
8
|
-
>
|
|
9
|
-
> over B/C/D, and the process-per-task topology (§6) remains a documented,
|
|
3
|
+
> Status: LANDED — Option A shipped in the bundled default workflow's `picking`
|
|
4
|
+
> state. It now lives in the bundled **unified** template's advanced flow (the
|
|
5
|
+
> `picking` state, reached by starting a cycle with `.gtd/REQUIREMENTS.md` — see
|
|
6
|
+
> [STATES.md §10](../../STATES.md#10-the-bundled-workflow-templates)). The rest
|
|
7
|
+
> of this document is kept as the decision record: why Option A was chosen over
|
|
8
|
+
> B/C/D, and the process-per-task topology (§6) remains a documented,
|
|
10
9
|
> unimplemented recipe.
|
|
11
10
|
>
|
|
12
11
|
> Context (as originally written): v2 had an engine-level package loop
|
package/docs/development.md
CHANGED
|
@@ -31,18 +31,16 @@ registry to keep in sync: a workflow's content strings are either inline in its
|
|
|
31
31
|
YAML/`.gtdrc` or a `./`-relative file reference auto-inlined at config load
|
|
32
32
|
(`src/PatternConfig.ts`) — see
|
|
33
33
|
[Configuration](configuration.md#content-values-inline-or-a-file-reference). The
|
|
34
|
-
bundled workflow
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
— no privileged code path.
|
|
34
|
+
bundled workflow template (`src/workflows/unified.yaml`) `gtd init` scaffolds is
|
|
35
|
+
imported as raw text via tsdown's `.yaml`-as-text loader (`tsdown.config.ts`)
|
|
36
|
+
and compiled through the same path a `.gtdrc` `workflow:` key goes through
|
|
37
|
+
(`src/workflows/templates.ts`) — no privileged code path.
|
|
39
38
|
|
|
40
39
|
`npm run dev` runs `src/main.ts` directly via Node's native TypeScript
|
|
41
40
|
type-stripping (requires Node 22.6+). It registers `dev/hooks.mjs`, which
|
|
42
41
|
resolves `./Foo.js` specifiers to the on-disk `./Foo.ts` and imports `*.yaml`
|
|
43
42
|
files as raw text, mirroring tsdown's `.yaml`-as-text loader — this is what lets
|
|
44
|
-
`src/workflows/
|
|
45
|
-
running from source.
|
|
43
|
+
`src/workflows/unified.yaml` resolve when running from source.
|
|
46
44
|
|
|
47
45
|
The decision core is pure and IO-free: the pattern machine's shape (states,
|
|
48
46
|
patterns, retry) is a plain-data `WorkflowDefinition` (`src/PatternMachine.ts`),
|
package/docs/upgrading.md
CHANGED
|
@@ -16,7 +16,7 @@ subject (or the bare `gtd(<actor>): <to>`) naming a state and an actor the
|
|
|
16
16
|
active workflow currently declares; everything else — a v1 `gtd: grilling`, a v2
|
|
17
17
|
`gtd(agent): building`, a plain `chore: …` commit, anything from a foreign repo
|
|
18
18
|
— parses as unrecognized and lands at the workflow's initial state (`idle` in
|
|
19
|
-
the
|
|
19
|
+
the unified template). There is no special-casing for "this looks like an old
|
|
20
20
|
gtd commit": the mechanism is exactly the same one that already made v1 history
|
|
21
21
|
inert to v2, and v2 history inert to a differently-configured workflow — v3 just
|
|
22
22
|
applies it uniformly to all prior history instead of drawing a v1/v2 line.
|
|
@@ -41,8 +41,8 @@ upgrading.
|
|
|
41
41
|
all gone — `workflow:` and `vars:` are the only two blessed keys (see
|
|
42
42
|
[Configuration](configuration.md)). A check's command now lives inline in its
|
|
43
43
|
own `script:` content, reading a workflow-declared `it.vars` entry (the
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
unified template's `testCommand`, overridable via the top-level `vars:` key or
|
|
45
|
+
a `GTD_VAR_testCommand` environment variable — see
|
|
46
46
|
[Configuration's "Variables"](configuration.md#variables)) rather than a
|
|
47
47
|
blessed `testCommand` config key; squashing is a `commit:` state instead of a
|
|
48
48
|
boolean flag; there is no learning phase, no decision log, and no model
|
|
@@ -53,17 +53,17 @@ upgrading.
|
|
|
53
53
|
v3.0 rewrite, then RE-INTRODUCED as the explicit state property it was always
|
|
54
54
|
meant to become: a state declaring `reviewWindow: true` opens the window while
|
|
55
55
|
the machine rests there (base = the process start, or a state marked
|
|
56
|
-
`reviewBase: true`). The
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
`reviewBase: true`). The unified template enables it on `await-review`. Unlike
|
|
57
|
+
v2's hardwired gate, it is pure workflow DATA and the engine stays oblivious —
|
|
58
|
+
see [STATES.md §11](../STATES.md) and the `file:`/`mode:` neighbours in
|
|
59
|
+
[configuration.md](configuration.md).
|
|
60
60
|
- **`forceApprove`, content-inspection verdicts.** FEEDBACK.md emptiness,
|
|
61
61
|
checkbox-only REVIEW.md diffs, and doc-structure validation are gone as ENGINE
|
|
62
62
|
mechanisms — verdicts are now expressed purely by which file a turn writes or
|
|
63
|
-
deletes, matched by an ordinary `on` pattern. The
|
|
63
|
+
deletes, matched by an ordinary `on` pattern. The unified template's own
|
|
64
64
|
checkbox-review verdict (`review-deciding`) is ordinary WORKFLOW data (an `on`
|
|
65
65
|
pattern), not an engine hook: `D REVIEW.md` = approve, `M REVIEW.md` = route
|
|
66
|
-
to the deterministic decider, in the
|
|
66
|
+
to the deterministic decider, in the unified template. Deterministic
|
|
67
67
|
format-checking of the steering files is likewise no longer a pair of
|
|
68
68
|
in-machine `check`/`script` states — the old `todo-validating`/
|
|
69
69
|
`review-validating` states and their `.gtd/FORMAT.md` steering file are gone,
|
|
@@ -87,7 +87,7 @@ upgrading.
|
|
|
87
87
|
formats anything on its own: a steering-file mode declares its own `format:`
|
|
88
88
|
SHELL COMMAND, so a project brings whatever formatter it already uses. Adding
|
|
89
89
|
four lines to `.gtdrc` restores (and improves on) the old auto-formatting for
|
|
90
|
-
the
|
|
90
|
+
the unified template:
|
|
91
91
|
|
|
92
92
|
```yaml
|
|
93
93
|
modes:
|
|
@@ -116,9 +116,9 @@ upgrading.
|
|
|
116
116
|
itself only understands the two built-ins), the LSP reads that same config the
|
|
117
117
|
CLI does to build its path→mode dispatch, and `gtd.openSteeringFile` resolves
|
|
118
118
|
the current state and shows its `file:`. No mapping declared at all (the
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
bundled template's predecessor shape, or any workflow with no `file:`/`mode:`)
|
|
120
|
+
falls back to basename dispatch (`TODO.md`/`REVIEW.md`), same as before this
|
|
121
|
+
addition.
|
|
122
122
|
|
|
123
123
|
## How to adopt
|
|
124
124
|
|
|
@@ -126,20 +126,20 @@ upgrading.
|
|
|
126
126
|
upgrading each repo must scaffold one **once**:
|
|
127
127
|
|
|
128
128
|
```bash
|
|
129
|
-
gtd init
|
|
129
|
+
gtd init # takes no argument
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
`gtd init
|
|
133
|
-
prompts extracted to editable `gtd-prompts/*.md`
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
[
|
|
132
|
+
`gtd init` (no argument) writes a `.gtdrc.json` for the single bundled
|
|
133
|
+
**unified** template (its agent prompts extracted to editable `gtd-prompts/*.md`
|
|
134
|
+
files the config references). The template forks on which steering file you
|
|
135
|
+
create: `.gtd/TODO.md` starts the **simple flow** (a single-shot `grilling`
|
|
136
|
+
plan, direct `building`, a `checking`/`fixing` loop), while
|
|
137
|
+
`.gtd/REQUIREMENTS.md` starts the **advanced flow** (two-phase grilling ⇄
|
|
138
|
+
grilling-answer / architecting ⇄ architecting-answer / decompose / picking /
|
|
139
|
+
per-package build with an agentic spec-review gate). Both converge on the same
|
|
140
|
+
`reviewing` → `await-review` tail, and a full sign-off squashes the whole cycle
|
|
141
|
+
into one commit (see
|
|
142
|
+
[STATES.md §10](../STATES.md#10-the-bundled-workflow-templates)). Review and
|
|
143
143
|
commit the generated `.gtdrc.json` (and its `gtd-prompts/` directory), then
|
|
144
144
|
continue from a settled `idle` boundary. **Note:** a repo relying on earlier
|
|
145
145
|
gtd's auto-created `.gtdrc.json` `$schema` stub (which carried no `workflow:`)
|