@pmelab/gtd 54.0.0 → 56.0.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.
Files changed (72) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +109 -104
  3. package/dist/chunks/{reserved-CQ7amcKG.mjs → reserved-B8EC-WE8.mjs} +124 -230
  4. package/dist/chunks/{review-CXzUXJHL.mjs → review-HdrX0FJ7.mjs} +30 -125
  5. package/dist/chunks/{steering-CLhu8C7q.mjs → steering-CCNvngSH.mjs} +256 -65
  6. package/dist/chunks/{tail-JZ9PAOwp.mjs → tail-BSLah2mA.mjs} +155 -63
  7. package/dist/gtd.bundle.mjs +259 -22
  8. package/dist/steering.mjs +2 -2
  9. package/dist/testkit.mjs +6 -6
  10. package/dist/web/main.css +1 -1
  11. package/dist/web/main.js +551 -66
  12. package/dist/workflow-kit.mjs +1 -1
  13. package/dist/workflows/cleanup.mjs +2 -2
  14. package/dist/workflows/feature.mjs +47 -102
  15. package/dist/workflows/fix.mjs +3 -3
  16. package/dist/workflows/review.mjs +3 -3
  17. package/dist/workflows/rollout.mjs +1 -1
  18. package/dist/workflows.mjs +614 -574
  19. package/package.json +1 -1
  20. package/skills/authoring/SKILL.md +3 -3
  21. package/src/cli/Cli.ts +5 -5
  22. package/src/edge/Edge.test.ts +1 -1
  23. package/src/steering/FORMATS.md +5 -1
  24. package/src/steering/SteeringFormats.test.ts +2 -2
  25. package/src/steering/contract.test.ts +1 -0
  26. package/src/steering/findings.test.ts +47 -0
  27. package/src/steering/findings.ts +350 -0
  28. package/src/steering/fixtures/findings/gate.md +34 -0
  29. package/src/steering/fixtures/findings/gate.read.json +87 -0
  30. package/src/steering/index.test.ts +2 -2
  31. package/src/steering/index.ts +4 -3
  32. package/src/steering/review.test.ts +1 -75
  33. package/src/steering/review.ts +1 -74
  34. package/src/workflow/compile.test.ts +1 -0
  35. package/src/workflows/feature/criteria-coverage.feature +104 -0
  36. package/src/workflows/feature/feature.test.ts +1 -1
  37. package/src/workflows/feature/feature.ts +17 -20
  38. package/src/workflows/feature/green.ts +2 -5
  39. package/src/workflows/feature/lens-review.feature +323 -171
  40. package/src/workflows/feature/naive-acceptance.feature +31 -32
  41. package/src/workflows/feature/prototype.ts +5 -8
  42. package/src/workflows/feature/refactor-absorbs.feature +1 -7
  43. package/src/workflows/feature/refactor-first.feature +2 -10
  44. package/src/workflows/feature/refactor-rebuild.feature +20 -36
  45. package/src/workflows/feature/refactor-review.feature +33 -117
  46. package/src/workflows/feature/refactor.test.ts +0 -2
  47. package/src/workflows/feature/refactor.ts +0 -1
  48. package/src/workflows/feature/review-gate.feature +6 -22
  49. package/src/workflows/feature/reviewer-walkthrough.feature +16 -103
  50. package/src/workflows/feature/seam.test.ts +19 -101
  51. package/src/workflows/feature/seam.ts +13 -89
  52. package/src/workflows/feature/standards.feature +75 -34
  53. package/src/workflows/fix/fix-lens-origin.feature +20 -7
  54. package/src/workflows/fix/fix-quality.feature +104 -23
  55. package/src/workflows/review/review-door.feature +62 -59
  56. package/src/workflows/shared/access.test.ts +1 -0
  57. package/src/workflows/shared/learn.test.ts +0 -14
  58. package/src/workflows/shared/learn.ts +1 -6
  59. package/src/workflows/shared/lenses.ts +149 -43
  60. package/src/workflows/shared/review.test.ts +30 -27
  61. package/src/workflows/shared/review.ts +29 -196
  62. package/src/workflows/shared/skills.test.ts +3 -1
  63. package/src/workflows/shared/steps.test.ts +9 -6
  64. package/src/workflows/shared/steps.ts +12 -3
  65. package/src/workflows/shared/tail.test.ts +20 -2
  66. package/src/workflows/shared/tail.ts +38 -16
  67. package/src/workflows/shared/text.test.ts +122 -294
  68. package/src/workflows/shared/text.ts +181 -358
  69. package/src/workflows/shared/vars.ts +1 -1
  70. package/src/workflows/feature/review-answers.feature +0 -324
  71. package/src/workflows/feature/severity-budget.feature +0 -116
  72. package/src/workflows/feature/severity-sorted-review.feature +0 -198
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtd",
3
- "version": "54.0.0",
3
+ "version": "56.0.0",
4
4
  "description": "Drive the gtd loop inside Claude Code: agent turns run as subagents, gtd decides every beat",
5
5
  "author": {
6
6
  "name": "Philipp Melab"
package/README.md CHANGED
@@ -474,24 +474,37 @@ noted in steps 3 and 4 below.
474
474
  and skip a gate unattended.**
475
475
 
476
476
  Once the change is built, the whole change goes through a qualitative review
477
- lap before you see anything: six lenses, one turn each, in order —
477
+ lap before you see anything: seven lenses, one turn each, in order —
478
478
  `correctness`, `owasp-security`, `ponytail-review`, `test-audit`,
479
- `conventions`, `spec-challenge`. `correctness`, `owasp-security` and
480
- `spec-challenge` run on the planner model (`smart`), the other three on the
481
- coder model (`base`); a `qualityReviews` entry `<lens>=<model>` picks a
482
- lens's own. Each traces the change from its own angle and records every
483
- finding, blocking or not, as its own `## ` chunk of `.gtd/QUALITY.md`. A
484
- clean turn means approval only when that lens found nothing at all. The
485
- lenses are the only agentic review: a judge (`build.quality.triage`) then
486
- classifies each finding — `mechanical` ones are fixed by the fix turn
487
- (`build.fix.quality.fixing`, up to three turns), `noise` is dropped with its
488
- `p` recorded as `Gtd-Mark: noise=<id> p=<p> <title>`, and `design` ones
489
- (questioning a criterion or the approach) become notes for your review. An
490
- unsure verdict (below `qualityTriageMinP`, `0.7`) is `design`; mechanical
491
- findings the fix turns leave become notes too. This lap is where code quality
492
- is looked at, and every round pays for it. It never replaces step 4 — your
479
+ `conventions`, `spec-challenge`, `criteria-coverage`. `correctness`,
480
+ `owasp-security`, `spec-challenge` and `criteria-coverage` run on the planner
481
+ model (`smart`), the other three on the coder model (`base`); a
482
+ `qualityReviews` entry `<lens>=<model>` picks a lens's own.
483
+ `criteria-coverage` reads the requirements and the change's tests and writes
484
+ one finding per acceptance criterion no test exercises; with no requirements
485
+ (the `review` and `fix` workflows) it runs no turn. Each traces the change
486
+ from its own angle and records every finding, blocking or not, as its own
487
+ `## ` chunk of `.gtd/QUALITY.md`. A clean turn means approval only when that
488
+ lens found nothing at all. The lenses are the only agentic review: a judge
489
+ (`build.quality.triage`) then classifies each finding — `mechanical` ones are
490
+ fixed by the fix turn (`build.fix.quality.fixing`, up to three turns),
491
+ `noise` is dropped with its `p` recorded as
492
+ `Gtd-Mark: noise=<id> p=<p> <title>`, and `design` ones (questioning a
493
+ criterion or the approach) become notes. An unsure verdict (below
494
+ `qualityTriageMinP`, `0.7`) is `design`; mechanical findings the fix turns
495
+ leave become notes too. **The finding gate** (`build.quality.gate`) then
496
+ stops for you: `.gtd/QUALITY.md` lists the notes, then the noise under
497
+ `# Dropped as noise` so you can overrule the judge, each with one `- [ ] fix`
498
+ box. Tick a finding to have it fixed, optionally with a line of guidance
499
+ below its box; leave it unticked to drop it — landing the file untouched
500
+ drops them all, and guidance under an unticked box is refused. The ticked
501
+ ones go to the same fix turns (up to three), then the suite is kept green;
502
+ what they leave is listed as unresolved, with no second gate. A ticked
503
+ finding is fixed, never re-planned: raise anything bigger in your review. A
504
+ lap with no notes and no noise has no gate. This lap is where code quality is
505
+ looked at, and every round pays for it. It never replaces step 4 — your
493
506
  review stays the final gate, and nothing here skips it. The `fix` and
494
- `cleanup` doors triage their lap too, and hand its notes to their own review.
507
+ `cleanup` doors run the same lap and gate before their own review.
495
508
 
496
509
  A red suite that keeps failing past a few fix attempts escalates instead of
497
510
  retrying forever: an agent turn reads the failing output and writes
@@ -509,46 +522,37 @@ noted in steps 3 and 4 below.
509
522
  4. **You review.** After the quality lap a reviewer turn
510
523
  (`build.review.reviewing`) walks you through the whole change: `## ` chunks
511
524
  grouped by concern, **every chunk pointing at its code**
512
- (`./path#start-end`), so the phone shows the diff beside each one. Every
513
- design note the lap left gets a chunk of its own, pointing at the code it
514
- cites; gtd adds the note's text and three tick boxes — **fix as suggested**,
515
- **won't fix**, or **your own answer** written over `_your answer_`
516
- (`build.review.carrying`) — then, for reference, no tick boxes, no answer
517
- needed — what was **fixed automatically** (with the fixing commit) and what
518
- was **dropped as noise**. A review with a chunk pointing at no code, or a
519
- note left out, is refused (`review-pointers`). A pointer note the reviewer
520
- opens with `Risk:` is fixed before you see the review
521
- (`build.review.fix.risks.fixing`), then the review is written again. **What
522
- matters most comes first:** a judge (`build.review.ranking`) rates every
523
- chunk on the four severity questions below, and the review lists `critical`
524
- chunks first (security, then one-way doors), then `should`, then `could`,
525
- each led by its tier and reason (`_critical: security, one-way door_`) — the
526
- phone shows it on the chunk's card. A chunk the judge is unsure of, or whose
527
- evidence the budget cut, is `critical`. On `refactor-first` the refactor gets
528
- a walkthrough of its own first, covering the whole refactor on every round,
529
- before the feature is built; see [the naive pass](#the-naive-pass). **Every
530
- note needs exactly one tick before `gtd land` accepts the review**
531
- (`answer-completeness`; an open `- H:` thread waiting on the agent is the one
532
- exception). Fix as suggested joins the nit batch below, unjudged; won't fix
533
- drops the note and records it as `Gtd-Mark: wontfix=<title>` on the gate's
534
- commit; your own answer is judged like a note. A note you answered is left
535
- out of the fresh review after a nit fix. Land with every note answered and
536
- nothing else changed to approve, or write what is wrong — disagreeing with a
537
- fix or a drop means writing a note of your own. Approving ends the process
538
- (at the refactor review, it moves on to the feature); feedback is judged note
539
- by note, each as `edit`, `question`, `nit` or `praise`. An `edit` sends the
540
- process back to step 2 for re-derived requirements — the built criteria keep
541
- their IDs (reworded in place when their behaviour changes) and new behaviour
542
- gets new ones — then the implementation is amended to meet them, with no new
543
- naive pass or seam judge, the hands-on test runs again, the quality lap runs,
544
- and you review again. At the refactor review an `edit` re-derives the
545
- refactor instead. A `question` is answered inline under your note and the
546
- process stops at the review again — no new plan. A `nit` is fixed in one
547
- batch, the suite must go green (a red one gets fix turns first), then a fresh
548
- review of the change stops at the review again. `praise` is dropped; a round
549
- of only praise signs off. When a round mixes them, questions are answered and
550
- nits fixed first, then the edits are planned — risk: the planning lap may
551
- redo nit fixes it touches.
525
+ (`./path#start-end`), so the phone shows the diff beside each one. gtd
526
+ appends one `## Quality lap` chunk (`build.review.carrying`) listing, for
527
+ reference, what the quality lap did with every finding: **fixed
528
+ automatically** and **fixed at the finding gate** (each with its fixing
529
+ commit), **dropped at the finding gate**, **dropped as noise**, and
530
+ **unresolved after the finding gate**. To reopen one, write a note under its
531
+ line. A review with a chunk pointing at no code is refused
532
+ (`review-pointers`). A pointer note the reviewer opens with `Risk:` is fixed
533
+ before you see the review (`build.review.fix.risks.fixing`), then the review
534
+ is written again over the reviewer's own draft. On `refactor-first` the
535
+ refactor gets a walkthrough of its own first, covering the whole refactor on
536
+ every round, before the feature is built; see
537
+ [the naive pass](#the-naive-pass). Land with nothing changed to approve, or
538
+ write what is wrong. A note added with its own `Tick exactly one:` boxes (as
539
+ `/gtd pr` imports a thread) is answered by its tick instead of judged: fix as
540
+ suggested joins the nit batch below, won't fix drops it and records
541
+ `Gtd-Mark: wontfix=<title>`, your own answer is judged like a note. Approving
542
+ ends the process (at the refactor review, it moves on to the feature);
543
+ feedback is judged note by note, each as `edit`, `question`, `nit` or
544
+ `praise`. An `edit` sends the process back to step 2 for re-derived
545
+ requirements — the built criteria keep their IDs (reworded in place when
546
+ their behaviour changes) and new behaviour gets new ones — then the
547
+ implementation is amended to meet them, with no new naive pass or seam judge,
548
+ the hands-on test runs again, the quality lap runs, and you review again. At
549
+ the refactor review an `edit` re-derives the refactor instead. A `question`
550
+ is answered inline under your note and the process stops at the review again
551
+ — no new plan. A `nit` is fixed in one batch, the suite must go green (a red
552
+ one gets fix turns first), then a fresh review of the change stops at the
553
+ review again. `praise` is dropped; a round of only praise signs off. When a
554
+ round mixes them, questions are answered and nits fixed first, then the edits
555
+ are planned — risk: the planning lap may redo nit fixes it touches.
552
556
 
553
557
  Each `edit` note also gets a severity tier from four judge questions
554
558
  (security, reversibility, blast radius, new concept). Every tier is
@@ -596,9 +600,10 @@ conversation under their block, question, chunk, or hunk, and one the agent
596
600
  answered last carries a "waiting on you" badge. Tap it to reply — your reply is
597
601
  added as a new `H:` entry; while the agent has yet to answer, reopening it edits
598
602
  your last entry instead. Tap an already-answered question to leave a note on it;
599
- the agent may overturn the answer. On a review, each finding takes its decision
600
- on the phone too — fix as suggested, won't fix, or your own answer — and Done
601
- stays disabled, saying how many are left, until every finding has one. See
603
+ the agent may overturn the answer. At the finding gate the phone lists the open
604
+ findings, then those dropped as noise, each with a fix checkbox and, once
605
+ ticked, an optional line of guidance; Done stays disabled while the file holds
606
+ anything the gate would refuse. See
602
607
  [Configuration](https://github.com/pmelab/gtd/blob/main/docs/configuration.md)
603
608
  for its `ui:` settings.
604
609
 
@@ -612,17 +617,15 @@ gtd door review <commitish>
612
617
 
613
618
  starts a review of everything from `<commitish>` to HEAD — the same review a
614
619
  `feature` process ends with, minus planning and building. A green gate, then the
615
- quality lenses: mechanical findings are fixed, noise is dropped, and the rest
616
- become notes under `## Findings` in `.gtd/REVIEW.md`, one tick box each, apart
617
- from the walkthrough of the code under `## Walkthrough`, which you only tick as
618
- read. Tick `fix as suggested` or write your own answer and the process fixes it
619
- in place — your own answers that ask for a change are collected into
620
- `.gtd/REQUIREMENTS.md` and built by one `feedback.fixing` turn, with no design
621
- phase and no criteria — under the health loop, then asks for your review again.
622
- Sign off (or tick `won't fix`) and it closes; nothing is left behind. A note
623
- asking for new behaviour belongs in a `feature` process: tick `won't fix` and
624
- start one. `gtd door fix` repairs a red baseline as its own reviewed commit; a
625
- note at its review is left in `.gtd/REVIEW.md` (beside the reviewer's original,
620
+ quality lenses: mechanical findings are fixed, the rest wait at the finding
621
+ gate, then a reviewer walks you through the change in `.gtd/REVIEW.md`, with the
622
+ lap's summary. A nit note is fixed in place; a note asking for a change is
623
+ collected into `.gtd/REQUIREMENTS.md` and built by one `feedback.fixing` turn,
624
+ with no design phase and no criteria — under the health loop, then it asks for
625
+ your review again. Sign off and it closes; nothing is left behind. A note asking
626
+ for new behaviour belongs in a `feature` process: sign off and start one.
627
+ `gtd door fix` repairs a red baseline as its own reviewed commit; a note at its
628
+ review is left in `.gtd/REVIEW.md` (beside the reviewer's original,
626
629
  `.gtd/REVIEW.orig.md`) for the next `gtd door fix`, and until that runs,
627
630
  starting `feature` or `review` is refused — remove both files to abandon the
628
631
  hand-off. `gtd doors` lists the doors of the workflows your `gtd.config.ts`
@@ -652,39 +655,41 @@ home directory — fails every command until you delete it. See
652
655
  #### The naive pass
653
656
 
654
657
  After design the agent first implements the requirements directly,
655
- breadth-first, with a behaviour-level acceptance test per criterion that names
656
- its ID (`[AC-3] …`) and reaches only code that existed before the pass. The pass
657
- is sent back while a criterion's ID is missing from its tests, a test imports a
658
- file it added, or the suite is red on it. A judge checks whether it changed
659
- anything outside the expected set (tests, steering files; see `seamAllow`).
660
- Incidental changes land: the pass itself is the implementation, with no rebuild,
661
- straight through the health loop and the quality lap. A needed seam change
662
- resets: the pass is never applied. An agent reads its whole diff and writes a
663
- refactor note (`.gtd/REFACTOR-NOTE.md`: which seams, which shape); the seam is
664
- refactored first, flag-free with the existing suite green, on its own with its
665
- own quality lap (`refactorQualityReviews`) and review; then the feature is
666
- rebuilt on the refactored base, behind a release flag, with the note and the
667
- naive diff as reference. The rebuild is refused until its tests carry every
668
- criterion ID the naive pass's tests named, and the suite must be green with
669
- them. A wrong approach is retried twice, then rests for you to steer or overrule
670
- it. A refactor that already carried the whole feature leaves the rebuild only
671
- the carried-over tests, and the feature's quality lap and review cover the whole
672
- change. Once the implementation is green, a judge asks, per acceptance
673
- criterion, whether a person can observe it by using the software; an agent then
674
- uses the change by hand for those — the real program in a scratch directory, the
675
- real page, guided by a project skill or a manual testing section in `AGENTS.md`,
676
- `CLAUDE.md` or `README.md` — and writes `.gtd/PROTOTYPE.md`: per criterion pass,
677
- fail or blocked, with the steps run and what it saw. A criterion the judge finds
678
- no one can observe (a refactor, something left unchanged, internal shape), or
679
- one design tagged `(no hands-on)`, is skipped; a change with none left skips
680
- this step. This is the one check that a criterion is met: with `prototypeRounds`
681
- set to `0` nothing checks the criteria beyond the green suite. Failures are
682
- fixed and re-tested before the quality lap, up to `prototypeRounds` (3) fix
683
- rounds; past them, with only blocked items, or with no way to test found, it
684
- rests for you. See [The hands-on test](docs/configuration.md#the-hands-on-test).
685
- Feedback at the feature review re-runs design and the implementation, never the
686
- naive pass; feedback at the refactor review re-runs the refactor, never design;
687
- a refactor-review change the refactor cannot build is refused, and the only way
658
+ breadth-first. It is asked to test the behaviour the criteria describe — one
659
+ test per behaviour, not per criterion, with no criterion ID in a test name —
660
+ through code that existed before the pass, but no test is required. The pass is
661
+ sent back while a test imports a file it added, or the suite is red on it. A
662
+ judge checks whether it changed anything outside the expected set (tests,
663
+ steering files; see `seamAllow`). Incidental changes land: the pass itself is
664
+ the implementation, with no rebuild, straight through the health loop and the
665
+ quality lap. A needed seam change resets: the pass is never applied. An agent
666
+ reads its whole diff and writes a refactor note (`.gtd/REFACTOR-NOTE.md`: which
667
+ seams, which shape); the seam is refactored first, flag-free with the existing
668
+ suite green, on its own with its own quality lap (`refactorQualityReviews`) and
669
+ review; then the feature is rebuilt on the refactored base, behind a release
670
+ flag, with the note and the naive diff as reference. The rebuild is asked to
671
+ carry over every test file the naive pass added or changed, and the suite must
672
+ be green; whether each criterion is still tested is the `criteria-coverage`
673
+ lens's call in the quality lap. A wrong approach is retried twice, then rests
674
+ for you to steer or overrule it. A refactor that already carried the whole
675
+ feature leaves the rebuild only the carried-over tests, and the feature's
676
+ quality lap and review cover the whole change. Once the implementation is green,
677
+ a judge asks, per acceptance criterion, whether a person can observe it by using
678
+ the software; an agent then uses the change by hand for those — the real program
679
+ in a scratch directory, the real page, guided by a project skill or a manual
680
+ testing section in `AGENTS.md`, `CLAUDE.md` or `README.md` — and writes
681
+ `.gtd/PROTOTYPE.md`: per criterion pass, fail or blocked, with the steps run and
682
+ what it saw. A criterion the judge finds no one can observe (a refactor,
683
+ something left unchanged, internal shape), or one design tagged `(no hands-on)`,
684
+ is skipped; a change with none left skips this step. This is the one check that
685
+ a criterion is met: with `prototypeRounds` set to `0` nothing checks the
686
+ criteria beyond the green suite. Failures are fixed and re-tested before the
687
+ quality lap, up to `prototypeRounds` (3) fix rounds; past them, with only
688
+ blocked items, or with no way to test found, it rests for you. See
689
+ [The hands-on test](docs/configuration.md#the-hands-on-test). Feedback at the
690
+ feature review re-runs design and the implementation, never the naive pass;
691
+ feedback at the refactor review re-runs the refactor, never design; a
692
+ refactor-review change the refactor cannot build is refused, and the only way
688
693
  out is `gtd abandon`. A process from 27.5.0 or later whose judge ruled
689
694
  `refactor-first` must `gtd abandon` too. Details in
690
695
  [the naive-pass path](docs/configuration.md#the-naive-pass-path).
@@ -878,7 +883,7 @@ gtd is one package, `@pmelab/gtd`, and every entrypoint shares its version and
878
883
  | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
879
884
  | `@pmelab/gtd/flows` | The flow API a workflow is written in: the steps (`agent`, `human`, `run`, …), `scope`, workflow factories, `defineConfig` and `FLOWS_PROTOCOL`. |
880
885
  | `@pmelab/gtd/wire` | The driver protocol: `WIRE_SCHEMA`, the exit codes and the types of every `--json` document. |
881
- | `@pmelab/gtd/steering` | The steering-file formats (`qa`, `review`) and the review-note readers. |
886
+ | `@pmelab/gtd/steering` | The steering-file formats (`qa`, `review`, `findings`) and the review-note readers. |
882
887
  | `@pmelab/gtd/workflow-kit` | Policy-free building blocks to compose a workflow from: health checks, quality laps, scenario freezing, review tails. |
883
888
  | `@pmelab/gtd/workflows` | Every shipped workflow and all its parts in one module; also resolvable as `@pmelab/gtd/workflow`. |
884
889
  | `@pmelab/gtd/workflows/feature`, `@pmelab/gtd/workflows/review`, `@pmelab/gtd/workflows/fix`, `@pmelab/gtd/workflows/rollout`, `@pmelab/gtd/workflows/cleanup` | One shipped workflow each: its factory as the default export, its parts, and the reserved exports (`defaults`, `envDefaults`, `summary`, `steering`, `skills`, `access`). `gtd install` imports these. |