@tianhai/pi-workflow-kit 2.5.0 → 2.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tianhai/pi-workflow-kit",
3
- "version": "2.5.0",
3
+ "version": "2.7.0",
4
4
  "description": "Enforce structured design→execute→finalize workflow with TDD discipline in AI coding agents",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -179,8 +179,11 @@ key files capped `at 5`.
179
179
 
180
180
  ```markdown
181
181
  # Progress: <topic>
182
+
182
183
  Design: docs/plans/<date>-<topic>/<leaf>-design.md
184
+
183
185
  Feature phase: e2e-written
186
+
184
187
  ## Requirements
185
188
  | # | Done | Requirement | Per-req ceremony | Commit |
186
189
  ## Execution summary
@@ -2,16 +2,21 @@
2
2
 
3
3
  Read before creating or changing progress rows, or writing/re-presenting the code digest. This reference owns the unchanged progress artifact schema.
4
4
 
5
- 2. **Create the progress file** `docs/plans/<date>-<topic>/<leaf>-progress.md`, beside the design doc it belongs to (`<leaf>` is `<topic>` for a single-part topic; an umbrella part uses its roster slug), so `pwk-finalizing` finds it inside the topic folder:
5
+ 2. **Create the progress file** `docs/plans/<date>-<topic>/<leaf>-progress.md`, beside the design doc it belongs to (`<leaf>` is `<topic>` for a single-part topic; an umbrella part uses its roster slug), so `pwk-finalizing` finds it inside the topic folder. Keep the blank lines between the header fields: the blank lines are load-bearing, because CommonMark merges consecutive plain lines into one paragraph, so without them every preview renders the whole header as a single run-on line.
6
6
 
7
7
  ```markdown
8
8
  # Progress: <topic>
9
9
 
10
10
  Design: docs/plans/<date>-<topic>/<leaf>-design.md
11
+
11
12
  Branch: <branch>
13
+
12
14
  Setup: n/a
15
+
13
16
  Started: <ISO timestamp>
17
+
14
18
  Last updated: <ISO timestamp>
19
+
15
20
  Feature phase: e2e-written
16
21
 
17
22
  <!-- a trivial design doc (no `## Feature acceptance`) starts at `implementing (0/N)` instead — there is no E2E to write -->
@@ -36,25 +41,25 @@ Read before creating or changing progress rows, or writing/re-presenting the cod
36
41
 
37
42
  ### Summary
38
43
  ### Flow
39
- Spine
40
- <entry point> -> [R1] <step> -> [R2] <step> -> <outcome>
41
- Branches
42
- <condition> -> <outcome> [R2]
43
- <changed behavior> was: <previous behavior>
44
- Side effects
45
- reads: <what> writes: <what>
44
+ - **Spine** — `<entry point> -> [R1] <step> -> [R2] <step> -> <outcome>`
45
+ - **Branches**
46
+ - `<condition> -> <outcome>` [R2]
47
+ - `<changed behavior> — was: <previous behavior>`
48
+ - **Side effects** — reads: `<what>` · writes: `<what>`
46
49
  ### Gotchas
50
+ - <one real risk per bullet>
47
51
  ### Key files
52
+ - `<file>` — <what shifted inside it>
48
53
  ```
49
54
 
50
- The `## Code digest` is filled once, at the write point in the ship checkpoint — never per requirement. Fill rules: plain language, R# anchors where natural, no test names (the execution-summary rule). `### Summary` is 2–3 sentences: what the code now does differently, and why. `### Flow` uses `A -> B -> C` arrow chains. `### Gotchas` lifts real risks from the review findings — `[ALERT]` only for reviewer-confirmed issues, never invented; with no findings, write `none beyond review findings` and mean it. `### Key files` is capped at 5 pivotal files, one line each: what shifted inside them.
55
+ The `## Code digest` is filled once, at the write point in the ship checkpoint — never per requirement. Fill rules: plain language, R# anchors where natural, no test names (the execution-summary rule). `### Summary` is 2–3 sentences: what the code now does differently, and why. `### Flow` uses `A -> B -> C` arrow chains, one spine or branch per bullet line, so every renderer shows each hop chain on its own line — bare label lines would merge into one run-on paragraph. `### Gotchas` lifts real risks from the review findings, one bullet each — `[ALERT]` only for reviewer-confirmed issues, never invented; with no findings, write `none beyond review findings` and mean it. `### Key files` is capped at 5 pivotal files, one bullet each: what shifted inside them.
51
56
 
52
57
  **Flow shape** — this is the ship stop's navigable map, so it is the one digest section that carries structure, not just prose:
53
58
 
54
59
  - **Spine** — the happy path as `A -> B -> C` hops, each hop named by symbol or module, with no line numbers anywhere and no file paths: symbol names survive edits and stay greppable, so a stale anchor can never mislead. Tag each hop `[R<n>]` with the requirement it comes from — that is what lets the coverage table's verdict rows be traced into the code without opening the diff.
55
60
  - **Branches** — every alternative and error path as `condition -> outcome` (a linear spine with no branches reads as "there are no edge cases", which is rarely true). Put ⚠️ on the genuinely surprising ones. Add a `was: <previous behavior>` clause for each requirement whose behavior changed; skip it for purely additive requirements — honest-empty, never invented.
56
61
  - **Inline worked values** — where a mapping is non-obvious, show it concretely (`` `implementing (2/5)` -> `execute 2/5` ``), so a reader can falsify it without running anything.
57
- - **Side effects** — a line naming what is read and written, only when the feature performs I/O, network, or migrations; omit it entirely otherwise rather than filling a placeholder.
62
+ - **Side effects** — a bullet naming what is read and written, only when the feature performs I/O, network, or migrations; omit it entirely otherwise rather than filling a placeholder.
58
63
  - **Cap: roughly 15 lines.** If the change genuinely needs more, the ship checkpoint **offers `/skill:pwk-walkthrough`** as the deep read (it regenerates a `file:line`-anchored walkthrough on demand) instead of growing the digest — the digest is what the human reads at the one remaining stop, and an unbounded Flow recreates the digging it exists to prevent.
59
64
 
60
65
  `Feature phase` is one of: `e2e-written`, `implementing (k/N)`, `reviewing`, `ship-paused`, `done`.
@@ -266,7 +266,9 @@ def build(args):
266
266
  ('Diff', git(project, 'diff', '--no-ext-diff', '--no-textconv', '--no-color', span, *pathspec)),
267
267
  ]
268
268
  label = 'feature review' if args.scope == 'feature' else f'requirement R{args.requirement} review'
269
- packet = f'# Review packet: {design_path.parent.name} — {label}\n\nBase: {base}\nHead: {head}\n\n'
269
+ # The blank line between Base and Head is load-bearing: CommonMark merges
270
+ # consecutive plain lines into one paragraph in every preview.
271
+ packet = f'# Review packet: {design_path.parent.name} — {label}\n\nBase: {base}\n\nHead: {head}\n\n'
270
272
  for title, content in sections:
271
273
  packet += f'## {title}\n\n{content}\n'
272
274
  # All parsing and Git reads finish before a temporary file exists. A failure in
@@ -37,7 +37,7 @@ Five sections, always: Summary / How it works / Key flows / Gotchas & invariants
37
37
  One subsection per component: responsibility + mechanism.
38
38
 
39
39
  ## Key flows
40
- Execution/data movement as arrow chains (A -> B -> C), anchored per step.
40
+ Execution/data movement as arrow chains (A -> B -> C), anchored per step, one flow per bullet line.
41
41
 
42
42
  ## Gotchas & invariants
43
43
  Edge cases, implicit assumptions, ordering constraints.