@pareto4/pp-core 1.19.0 → 1.20.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 (79) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/agents/pp-phase-researcher.md +10 -0
  3. package/agents/pp-planner.md +15 -0
  4. package/agents/pp-vault-reviewer.md +2 -0
  5. package/agents/pp-verifier.md +12 -8
  6. package/commands/pp-discovery.md +3 -2
  7. package/gemini-extension.json +1 -1
  8. package/package.json +6 -3
  9. package/pareto-skills/_shared/pp-claude-md-protocol.md +1 -1
  10. package/pareto-skills/pp-project-setup/SKILL.md +18 -343
  11. package/pp-core/bin/lib/capability-registry.cjs +1 -1
  12. package/pp-core/bin/lib/discovery-access.cjs +276 -0
  13. package/pp-core/bin/lib/discovery-charter.cjs +664 -0
  14. package/pp-core/bin/lib/discovery-deviations.cjs +264 -0
  15. package/pp-core/bin/lib/discovery-entities.cjs +323 -0
  16. package/pp-core/bin/lib/discovery-for-phase.cjs +628 -0
  17. package/pp-core/bin/lib/discovery-integrations.cjs +286 -0
  18. package/pp-core/bin/lib/discovery-migration.cjs +246 -0
  19. package/pp-core/bin/lib/discovery-phases.cjs +233 -0
  20. package/pp-core/bin/lib/discovery-processes.cjs +355 -0
  21. package/pp-core/bin/lib/discovery-research-track.cjs +5 -4
  22. package/pp-core/bin/lib/discovery-rollup.cjs +8 -7
  23. package/pp-core/bin/lib/discovery-rules.cjs +216 -0
  24. package/pp-core/bin/lib/discovery-screens.cjs +1 -1
  25. package/pp-core/bin/lib/discovery-session-check.cjs +264 -0
  26. package/pp-core/bin/lib/discovery-stories.cjs +273 -0
  27. package/pp-core/bin/lib/discovery-sweep.cjs +1 -1
  28. package/pp-core/bin/lib/discovery-table.cjs +55 -0
  29. package/pp-core/bin/lib/io.cjs +22 -0
  30. package/pp-core/bin/lib/vault-standards-review.cjs +50 -2
  31. package/pp-core/bin/pp-tools.cjs +143 -1
  32. package/pp-core/references/discovery-access.md +112 -0
  33. package/pp-core/references/discovery-build-consumption.md +256 -0
  34. package/pp-core/references/discovery-charter.md +127 -0
  35. package/pp-core/references/discovery-data-model.md +145 -0
  36. package/pp-core/references/discovery-id-conventions.md +50 -14
  37. package/pp-core/references/discovery-integrations.md +151 -0
  38. package/pp-core/references/discovery-processes.md +190 -0
  39. package/pp-core/references/discovery-rebaseline.md +2 -2
  40. package/pp-core/references/discovery-research-track.md +5 -6
  41. package/pp-core/references/discovery-session-output.md +70 -0
  42. package/pp-core/references/discovery-standards.md +107 -0
  43. package/pp-core/references/discovery-traceability.md +2 -2
  44. package/pp-core/references/planner-discovery-extract.md +35 -0
  45. package/pp-core/references/verifier-discovery-conformance.md +36 -0
  46. package/pp-core/templates/project-charter.md +161 -100
  47. package/pp-core/templates/project.md +3 -3
  48. package/pp-core/templates/requirements.md +18 -0
  49. package/pp-core/templates/verification-report.md +16 -0
  50. package/pp-core/workflows/discovery-sprint/charter.md +114 -0
  51. package/pp-core/workflows/discovery-sprint/prefill.md +1 -1
  52. package/pp-core/workflows/discovery-sprint/prototype.md +4 -4
  53. package/pp-core/workflows/discovery-sprint/session-13-gates.md +10 -0
  54. package/pp-core/workflows/discovery-sprint/sessions/01-kick-off.md +5 -2
  55. package/pp-core/workflows/discovery-sprint/sessions/02-as-is.md +27 -5
  56. package/pp-core/workflows/discovery-sprint/sessions/03-to-be.md +56 -31
  57. package/pp-core/workflows/discovery-sprint/sessions/04-ux-design.md +1 -1
  58. package/pp-core/workflows/discovery-sprint/sessions/05-architecture.md +42 -19
  59. package/pp-core/workflows/discovery-sprint/sessions/06-security.md +27 -12
  60. package/pp-core/workflows/discovery-sprint/sessions/07-identity.md +41 -23
  61. package/pp-core/workflows/discovery-sprint/sessions/08-integration.md +50 -23
  62. package/pp-core/workflows/discovery-sprint/sessions/09-qa.md +26 -11
  63. package/pp-core/workflows/discovery-sprint/sessions/10-infrastructure.md +28 -9
  64. package/pp-core/workflows/discovery-sprint/sessions/11-roadmap.md +21 -0
  65. package/pp-core/workflows/discovery-sprint/sessions/13-wrap-up.md +24 -9
  66. package/pp-core/workflows/discovery-sprint.md +12 -15
  67. package/pp-core/workflows/discovery-to-build/steps/architecture-deliverables.md +80 -29
  68. package/pp-core/workflows/discovery-to-build/steps/{screen-inventory-gate.md → handoff-gates.md} +111 -3
  69. package/pp-core/workflows/discovery-to-build/templates/discovery-references.md +12 -9
  70. package/pp-core/workflows/discovery-to-build/templates/pp-handoff.md +27 -26
  71. package/pp-core/workflows/discovery-to-build.md +70 -34
  72. package/pp-core/workflows/discuss-phase/discovery.md +83 -0
  73. package/pp-core/workflows/discuss-phase/templates/context.md +4 -0
  74. package/pp-core/workflows/discuss-phase.md +10 -7
  75. package/pp-core/workflows/new-project.md +3 -3
  76. package/pp-core/workflows/plan-phase/steps/discovery-extract.md +41 -0
  77. package/pp-core/workflows/plan-phase.md +15 -10
  78. package/pp-core/workflows/vault-review.md +5 -0
  79. package/pp-core/workflows/discovery-sprint/templates/context-template.md +0 -272
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pp-core",
3
3
  "displayName": "PP Core",
4
- "version": "1.19.0",
4
+ "version": "1.20.0",
5
5
  "description": "PP Core is a meta-prompting, context engineering, and spec-driven development system for AI coding agents.",
6
6
  "author": {
7
7
  "name": "pareto4",
@@ -61,6 +61,12 @@ Before researching, discover project context:
61
61
  | `## Deferred Ideas` | Out of scope — ignore completely |
62
62
 
63
63
  If CONTEXT.md exists, it constrains your research scope. Don't explore alternatives to locked decisions.
64
+
65
+ **`{padded}-DISCOVERY-EXTRACT.md`** (if listed in your files to read) — the Discovery registers' rows
66
+ that cite this phase's requirement IDs. Required reading; Read
67
+ `pp-core/references/planner-discovery-extract.md` § Researcher and follow it. **Never open
68
+ `.planning/discovery/session-NN.md`**: the session files are the facilitation record, not a
69
+ source. Absent file → nothing here applies.
64
70
  </upstream_input>
65
71
 
66
72
  <downstream_consumer>
@@ -548,6 +554,10 @@ cat "$phase_dir"/*-CONTEXT.md 2>/dev/null
548
554
  - User decided "simple UI, no animations" → don't research animation libraries
549
555
  - Marked as Claude's discretion → research options and recommend
550
556
 
557
+ Then read `$phase_dir`/*-DISCOVERY-EXTRACT.md if it exists (see `<upstream_input>`): list the
558
+ entities, integrations and rules it names under `## User Constraints` as "Discovery facts (by row
559
+ ID)" so the planner sees them beside the locked decisions. Do not open any `session-NN.md`.
560
+
551
561
  ## Step 1.3: Load Graph Context
552
562
 
553
563
  Check for knowledge graph:
@@ -362,6 +362,11 @@ Output: [Artifacts created]
362
362
  Its exact shape comes from `pp_run vault standards block`, per `pp-core/references/planner-vault-standards.md`.]
363
363
  </vault_standards>
364
364
 
365
+ <discovery_extract>
366
+ [Present ONLY when a `*-DISCOVERY-EXTRACT.md` is in your files to read — omitted entirely otherwise.
367
+ The file's content verbatim, `<!-- discovery:auto -->` markers included; see <discovery_mode>.]
368
+ </discovery_extract>
369
+
365
370
  <tasks>
366
371
 
367
372
  <task type="auto">
@@ -577,6 +582,13 @@ start of execution when the injected `plan:pre -> into: planner` fragment for
577
582
  the vault capability is present in your context.
578
583
  </vault_standards_mode>
579
584
 
585
+ <discovery_mode>
586
+ See `pp-core/references/planner-discovery-extract.md`. Load this file at the
587
+ start of execution when a `*-DISCOVERY-EXTRACT.md` is listed in your files to
588
+ read: it is required reading, embedded verbatim as `<discovery_extract>`, and
589
+ you never open a `.planning/discovery/session-NN.md`.
590
+ </discovery_mode>
591
+
580
592
  <execution_flow>
581
593
 
582
594
  <step name="load_project_state" priority="first">
@@ -604,6 +616,7 @@ Check the invocation mode and load the relevant reference file:
604
616
  - If `<revision_context>` provided by orchestrator: Read `pp-core/references/planner-revision.md`
605
617
  - If `--reviews` flag present or reviews mode active: Read `pp-core/references/planner-reviews.md`
606
618
  - If the vault capability's `plan:pre` fragment is present: Read `pp-core/references/planner-vault-standards.md`
619
+ - If a `*-DISCOVERY-EXTRACT.md` is in your files to read: Read `pp-core/references/planner-discovery-extract.md`
607
620
  - If task_breakdown identifies TDD candidates or TDD mode is active: Read `pp-core/references/planner-tdd.md`
608
621
  - Standard planning mode: no additional file to read
609
622
 
@@ -812,6 +825,8 @@ Use template structure for each PLAN.md.
812
825
 
813
826
  When the fragment IS present, follow `pp-core/references/planner-vault-standards.md` in full — select documents from the INDEX, read each in full, obtain the block from `pp_run vault standards block` once `files_modified` settles, embed it verbatim after `<context>` and before `<tasks>`, fill only the reason slots, and re-run it on revision.
814
827
 
828
+ **Discovery extract block (only when a `*-DISCOVERY-EXTRACT.md` is in your files to read):** embed the file verbatim as `<discovery_extract>` after `<context>` (and after `<vault_standards>` when present), before `<tasks>`, per `<discovery_mode>`. Absent file → write no block.
829
+
815
830
  **ALWAYS use the Write tool to create files** — never use `Bash(cat << 'EOF')` or heredoc commands for file creation.
816
831
 
817
832
  **Write contract (hard rules — must follow):**
@@ -56,6 +56,8 @@ Forbidden, without exception, even when a finding seems to demand it:
56
56
  **Counts, never a score.** Report counts by verdict in the exact counts line the template shows. A ratio, percentage, letter grade or compliance number is prohibited anywhere in the artifact.
57
57
 
58
58
  A document the executor marked `not read: …` is still judged against the code; record the executor's reason in the row's evidence, because a standard nobody read is worth a reader's attention.
59
+
60
+ **Deviations on file (`deviations[]` in the payload).** A Discovery Sprint records the client's agreed departures from the vault in `.planning/discovery/_deviations.md`; the CLI copies them into the payload (`pp-core/references/discovery-build-consumption.md` § `_deviations.md` read contract). Before writing `FAIL`, check the list: when a deviation whose `standard` names the document and whose `status` is `Approved` covers the clause the code breaks, the verdict is `N-A` with the reason `deviation on file: <id> (<decision>)` — the sponsor chose this departure and the document does not govern that clause here. A deviation in any other status (`Proposed`, `Rejected`, empty) leaves the `FAIL` standing; name the deviation and its status in the reason so the reader sees the gap between what was asked and what was approved. Never coin a verdict for it; `N-A` with that reason is the whole mechanism. An empty `deviations[]` changes nothing.
59
61
  </verdicts>
60
62
 
61
63
  <adversarial_stance>
@@ -188,7 +188,7 @@ For each truth, determine if codebase enables it.
188
188
  - ✗ FAILED: One or more artifacts missing, stub, or unwired
189
189
  - ? UNCERTAIN: Can't verify programmatically (needs human)
190
190
 
191
- **Behavior-dependent truths.** A truth is *behavior-dependent* when its correctness hinges on runtime behavior grep/presence checks cannot see — a **state transition** or a **cancellation / cleanup / ordering invariant** (e.g. "cancels the in-flight task and bumps the generation counter", "resets the busy flag on abort", "rolls back on failure"). For these, symbol presence + wiring is *necessary but not sufficient*: the code can be present and wired yet still leak state on the very path the invariant covers.
191
+ **Behavior-dependent truths.** A truth is *behavior-dependent* when its correctness hinges on runtime behavior grep/presence checks cannot see — a **state transition** or a **cancellation / cleanup / ordering invariant** (e.g. "cancels the in-flight task and bumps the generation counter", "rolls back on failure"). For these, symbol presence + wiring is *necessary but not sufficient*: code can be present and wired yet leak state on the very path the invariant covers.
192
192
 
193
193
  For each truth:
194
194
 
@@ -424,6 +424,8 @@ grep -E "Phase $PHASE_NUM" .planning/REQUIREMENTS.md 2>/dev/null
424
424
 
425
425
  If REQUIREMENTS.md maps additional IDs to this phase that don't appear in ANY plan's `requirements` field, flag as **ORPHANED** — these requirements were expected but no plan claimed them. ORPHANED requirements MUST appear in the verification report.
426
426
 
427
+ **6d. Discovery conformance (R3):** if `.planning/discovery/` exists, Read and follow `~/.claude/pp-core/references/verifier-discovery-conformance.md`; a `missed` row is a gap.
428
+
427
429
  ## Step 7: Scan for Anti-Patterns
428
430
 
429
431
  Identify files modified in this phase from SUMMARY.md key-files section, or extract commits and verify:
@@ -473,7 +475,7 @@ Anti-pattern scanning (Step 7) checks for code smells. Behavioral spot-checks go
473
475
 
474
476
  **When to run:** For phases that produce runnable code (APIs, CLI tools, build scripts, data pipelines). Skip for documentation-only or config-only phases.
475
477
 
476
- **Behavioral evidence for behavior-dependent truths (Step 3).** When a truth asserts a state transition or a cancellation/cleanup/ordering invariant, the single named test below is what upgrades it from ⚠️ PRESENT_BEHAVIOR_UNVERIFIED to ✓ VERIFIED. Run only the one named test that exercises the transition/invariant — never the full suite (per #25/#753). If no such test exists, leave the truth ⚠️ PRESENT_BEHAVIOR_UNVERIFIED and route it to human verification (Step 8); do not mark it VERIFIED on presence.
478
+ **Behavioral evidence for behavior-dependent truths (Step 3).** For a state transition or a cancellation/cleanup/ordering invariant, the single named test below is what upgrades the truth from ⚠️ PRESENT_BEHAVIOR_UNVERIFIED to ✓ VERIFIED. Run only that one test — never the full suite (per #25/#753). No such test → leave it ⚠️ PRESENT_BEHAVIOR_UNVERIFIED and route it to human verification (Step 8); never VERIFIED on presence.
477
479
 
478
480
  **How:**
479
481
 
@@ -567,7 +569,7 @@ done
567
569
 
568
570
  **Needs human if uncertain:** Complex wiring grep can't trace, dynamic state behavior, edge cases.
569
571
 
570
- **Behavior-unverified truths (Step 3):** Every truth left ⚠️ PRESENT_BEHAVIOR_UNVERIFIED is recorded in the `behavior_unverified_items` frontmatter list (emitted whenever the count > 0, regardless of overall status, so it survives a gaps_found phase) and surfaces for human verification; when the overall status is human_needed it also appears in the human_verification section. Phrase each item around the invariant: what to trigger, what state must hold afterward, and why presence checks can't see it.
572
+ **Behavior-unverified truths (Step 3):** every ⚠️ PRESENT_BEHAVIOR_UNVERIFIED truth is recorded in the `behavior_unverified_items` frontmatter list (emitted whenever the count > 0, regardless of overall status, so it survives a gaps_found phase) and surfaces for human verification — also in the human_verification section when the status is human_needed. Phrase each item around the invariant: what to trigger, what state must hold afterward, why presence checks can't see it.
571
573
 
572
574
  **Harvest deferred items from PLAN.md (#3309 / `workflow.human_verify_mode = end-of-phase`):** Scan every PLAN file in the phase for `<verify><human-check>` blocks on `auto` tasks. These are verification items the planner deliberately deferred from `checkpoint:human-verify` to end-of-phase to avoid the executor cold-start cost. Each block has the same shape used by the planner:
573
575
 
@@ -581,7 +583,7 @@ done
581
583
  </verify>
582
584
  ```
583
585
 
584
- Merge those harvested items into the same human verification list as your own analysis. Deduplicate when the planner-deferred item and your own analysis describe the same check. The downstream `human_needed` → `{phase_num}-UAT.md` path in `workflows/execute-phase.md` is the single sink — no separate file is created.
586
+ Merge the harvested items into your own human verification list, deduplicating items that describe the same check. The downstream `human_needed` → `{phase_num}-UAT.md` path in `workflows/execute-phase.md` is the single sink — no separate file is created.
585
587
 
586
588
  **Format:**
587
589
 
@@ -597,7 +599,7 @@ Merge those harvested items into the same human verification list as your own an
597
599
 
598
600
  Classify status using this decision tree IN ORDER (most restrictive first):
599
601
 
600
- 1. IF any truth FAILED, artifact MISSING/STUB, key link NOT_WIRED, or blocker anti-pattern found:
602
+ 1. IF any truth FAILED, artifact MISSING/STUB, key link NOT_WIRED, blocker anti-pattern found, or Discovery conformance row `missed` (Step 6d):
601
603
  → **status: gaps_found**
602
604
 
603
605
  2. IF Step 8 produced ANY human verification items (section is non-empty) — this includes every ⚠️ PRESENT_BEHAVIOR_UNVERIFIED truth from Step 3:
@@ -607,11 +609,11 @@ Classify status using this decision tree IN ORDER (most restrictive first):
607
609
  3. IF all truths VERIFIED, all artifacts pass, all links WIRED, no blockers, AND no human verification items:
608
610
  → **status: passed**
609
611
 
610
- **passed is ONLY valid when the human verification section is empty.** If Step 8 produced any items — including any truth left ⚠️ PRESENT_BEHAVIOR_UNVERIFIED — the status is not `passed`: it is `human_needed`, or `gaps_found` when rule 1 also fires (the ordered tree keeps gaps_found's precedence).
612
+ **passed is ONLY valid when the human verification section is empty.** If Step 8 produced any items — including any ⚠️ PRESENT_BEHAVIOR_UNVERIFIED truth — the status is not `passed`: it is `human_needed`, or `gaps_found` when rule 1 also fires (gaps_found keeps precedence).
611
613
 
612
- **A ⚠️ PRESENT_BEHAVIOR_UNVERIFIED truth is never FAILED and never VERIFIED.** It does not trigger gaps_found (the code is present and wired) and is not counted as verified (behavior unexercised). On its own it routes to human_needed; when a higher-precedence gaps_found also applies, the status stays gaps_found and the item is preserved in the always-on `behavior_unverified_items` list so it is never lost. Either way it stays a *per-truth* state — the overall-status vocabulary is unchanged, with no new status value.
614
+ **A ⚠️ PRESENT_BEHAVIOR_UNVERIFIED truth is never FAILED and never VERIFIED.** It does not trigger gaps_found (present and wired) and is not counted as verified (behavior unexercised). Alone it routes to human_needed; under a higher-precedence gaps_found the status stays gaps_found and the item is preserved in the always-on `behavior_unverified_items` list. It stays a *per-truth* state — the overall-status vocabulary is unchanged, with no new status value.
613
615
 
614
- > **Shared status seam**: the status vocabulary (`passed`, `gaps_found`, `human_needed`) and the per-status routing (next action and next command for each value) are owned by `src/verification.cts` via `pp-tools query verification.status`. This agent is the single emitter of the frontmatter status field; consumers (ship.md, execute-phase.md) read routing from that query instead of re-deriving it.
616
+ > **Shared status seam**: the status vocabulary (`passed`, `gaps_found`, `human_needed`) and the per-status routing are owned by `src/verification.cts` via `pp-tools query verification.status`. This agent is the single emitter of the frontmatter status field; consumers (ship.md, execute-phase.md) read routing from that query instead of re-deriving it.
615
617
 
616
618
  **Score (presence- vs behavior-verified split):**
617
619
 
@@ -829,6 +831,8 @@ Only include this section if deferred items exist (from Step 9b).
829
831
  | Requirement | Source Plan | Description | Status | Evidence |
830
832
  | ----------- | ---------- | ----------- | ------ | -------- |
831
833
 
834
+ {Step 6d block, when produced: `### Discovery conformance` + the filled `<!-- discovery:conformance -->` block}
835
+
832
836
  ### Anti-Patterns Found
833
837
 
834
838
  | File | Line | Pattern | Severity | Impact |
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: pp:discovery
3
3
  description: Run the Pareto Discovery Sprint — 13 guided sessions to define your product, users, and roadmap
4
- argument-hint: "[session number 1-13 | prototype]"
4
+ argument-hint: "[session number 1-13 | prototype | charter]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Write
@@ -17,8 +17,9 @@ Facilitate the 13-session Pareto Discovery Sprint. Flows:
17
17
  - (no arg) — show progress + recommend next session
18
18
  - (N) — facilitate session N
19
19
  - prototype — build the clickable prototype from Sessions 1–4
20
+ - charter — record signatures on, or redraft and re-export, the Project Charter
20
21
 
21
- Output: .planning/discovery/session-NN.md + _progress.md + _context.md
22
+ Output: .planning/discovery/session-NN.md + _progress.md + the registers; docs/discovery/PROJECT-CHARTER.md (+ .docx/.pdf) from Session 13
22
23
  </objective>
23
24
 
24
25
  <execution_context>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pp-core",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "description": "PP Core — a meta-prompting, context engineering, and spec-driven development system for AI coding agents. Loads pp-core's operating context into every Gemini CLI session.",
5
5
  "contextFileName": "GEMINI.md"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto4/pp-core",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "description": "Pareto pp-core — The Pareto Project's AI-assisted engineering framework: meta-prompting, context engineering, and spec-driven development for AI coding agents.",
5
5
  "bin": {
6
6
  "pp-core": "bin/install.js",
@@ -71,10 +71,13 @@
71
71
  },
72
72
  "overrides": {
73
73
  "qs": ">=6.16.0",
74
- "@hono/node-server": ">=2.0.5"
74
+ "@hono/node-server": ">=2.0.5",
75
+ "body-parser": "^2.4.0",
76
+ "fast-uri": "^3.1.9",
77
+ "zod": "^4.6.6"
75
78
  },
76
79
  "optionalDependencies": {
77
- "fallow": "^2.70.0"
80
+ "fallow": "^3.35.0"
78
81
  },
79
82
  "scripts": {
80
83
  "sync:launcher": "node scripts/sync-runtime-launcher.cjs",
@@ -17,7 +17,7 @@
17
17
  ## GitHub Board Sync
18
18
 
19
19
  Requirements are tracked as GitHub issues on a project board. The mapping
20
- between pp-core requirement IDs (EPIC-xxx, US-xxx, FR-xxx) and GitHub issue
20
+ between requirement IDs (`E-nn` EPICs, `US-nn` stories, `<PREFIX>-nn` requirements) and GitHub issue
21
21
  numbers lives in `.planning/github-issues.json`.
22
22
 
23
23
  **Status flow:**