@pmelab/gtd 1.9.1 → 1.10.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 (3) hide show
  1. package/README.md +83 -3
  2. package/dist/gtd.bundle.mjs +1036 -935
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -218,7 +218,10 @@ The last commit subject is bucketed two ways:
218
218
  Review; uncommitted → Await Review (commits REVIEW.md and auto-advances to
219
219
  Done). 5a. **HEAD `gtd: done` + `squash` enabled + squash base present + no
220
220
  unrelated code dirty** (a lone untracked `SQUASH_MSG.md` is allowed) →
221
- Squashing; unrelated code dirty → New Feature.
221
+ Squashing; unrelated code dirty → New Feature. 8a. **Green health check + ≥1
222
+ `gtd: health-fix` + `squash` enabled** → Squashing (same agent-authored
223
+ conventional-commits path as the feature-cycle squash — no hardcoded
224
+ placeholder).
222
225
  6. **Boundary HEAD + pending changes** (and no `.gtd`/REVIEW/FEEDBACK), or HEAD
223
226
  `gtd: new task` + clean tree (regenerate a lost seed) → New Feature.
224
227
  7. **TODO.md present** → Grilling / Grilled.
@@ -254,7 +257,7 @@ flowchart TD
254
257
  P4 -->|"uncommitted"| Await["Await Review — commit gtd: awaiting review"]:::edge
255
258
  Await -.->|"re-resolve"| Done
256
259
  P4 -->|absent| P5{"boundary HEAD + dirty,<br/>or gtd: new task + clean?"}
257
- Done -->|"squash enabled"| Squashing["Squashing — reset --soft base, squash commit"]:::agent
260
+ Done -->|"squash enabled"| Squashing["Squashing — agent authors conventional-commits message, reset --soft base, squash commit"]:::agent
258
261
  Done -->|"squash disabled"| Idle
259
262
  Squashing --> Idle["Idle — nothing to do (STOP)"]:::gate
260
263
  P5 -->|yes| NewFeature["New Feature — gtd: new task, revert, seed TODO"]:::edge
@@ -756,6 +759,7 @@ Commands:
756
759
  (default) Run the gtd driver loop — detect state, emit next prompt
757
760
  format <file> Format a markdown file in place
758
761
  review <target> Ad-hoc human review against a git ref or branch
762
+ status Print current state, next state, and pending edge actions (no actions, no prompt)
759
763
 
760
764
  Options:
761
765
  --json Output structured JSON instead of plain text
@@ -770,7 +774,7 @@ repository-state work — they run outside a repo and in any repo state.
770
774
 
771
775
  ## Subcommands
772
776
 
773
- gtd ships two subcommands: `format` and `review`.
777
+ gtd ships three subcommands: `format`, `review`, and `status`.
774
778
 
775
779
  ## Review subcommand
776
780
 
@@ -809,6 +813,82 @@ All errors exit with **code 1** and write a message to **stderr**:
809
813
  (nothing to review):
810
814
  `gtd review: nothing to review (<target> diff is empty after filtering)`
811
815
 
816
+ ## Status subcommand
817
+
818
+ ```bash
819
+ gtd status
820
+ ```
821
+
822
+ Pure, read-only introspection. Prints the current machine state, the state the
823
+ next real `gtd` run would stop at, and a short summary of the edge actions the
824
+ next run would perform. Performs **nothing** (no commit, reset, or file write)
825
+ and prints **no prompt** — guaranteed side-effect free.
826
+
827
+ ### Fields
828
+
829
+ | Field | Description |
830
+ | ----------------- | ----------------------------------------------------------------- |
831
+ | `state` | Current machine state |
832
+ | `nextState` | State the next `gtd` run would stop at, or `null` for edge-only |
833
+ | `willAutoAdvance` | `true` when the current state is edge-only (auto-advances on run) |
834
+ | `edgeActions` | List of edge actions the next run would perform before prompting |
835
+
836
+ ### One-hop semantics
837
+
838
+ `status` runs the same read-only gather+resolve the driver's first iteration
839
+ does, then reports it without looping or performing.
840
+
841
+ - A **prompt-bearing / human / terminal** current state reports itself as
842
+ `nextState`. The next run performs any pending edge action, then prompts
843
+ there.
844
+ - An **edge-only** current state reports `nextState: null` and
845
+ `willAutoAdvance: true`, naming the immediate edge action. Because the landing
846
+ state after auto-advance depends on side effects (test pass/fail, commits)
847
+ that `status` refuses to run, it honestly reports the current state rather
848
+ than guessing a landing state. There is **no** multi-hop simulation.
849
+
850
+ ### Output
851
+
852
+ Default (human-readable) — `building` example:
853
+
854
+ ```
855
+ State: building
856
+ Next state: building (next run prompts here)
857
+ Edge actions:
858
+ - commit pending changes as "gtd: building"
859
+ ```
860
+
861
+ With `--json` — same example:
862
+
863
+ ```json
864
+ {
865
+ "state": "building",
866
+ "nextState": "building",
867
+ "willAutoAdvance": false,
868
+ "edgeActions": ["commit pending changes as \"gtd: building\""]
869
+ }
870
+ ```
871
+
872
+ Edge-only example (`testing` state):
873
+
874
+ ```json
875
+ {
876
+ "state": "testing",
877
+ "nextState": null,
878
+ "willAutoAdvance": true,
879
+ "edgeActions": ["run the test suite (attempt 1)"]
880
+ }
881
+ ```
882
+
883
+ The JSON envelope contains no `prompt` field — this distinguishes it from the
884
+ default `gtd` run and `gtd review` JSON output.
885
+
886
+ ### Requirements
887
+
888
+ - Must be run from the **repository root** (same cwd guard as other repo
889
+ commands).
890
+ - Takes **no arguments** — extra args are rejected with an error.
891
+
812
892
  ## Format subcommand
813
893
 
814
894
  `gtd format` formats a markdown file in place: