openplanr 1.6.0 → 1.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.
Files changed (48) hide show
  1. package/dist/ai/prompts/system-prompts.d.ts +1 -1
  2. package/dist/ai/prompts/system-prompts.d.ts.map +1 -1
  3. package/dist/ai/prompts/system-prompts.js +8 -9
  4. package/dist/ai/prompts/system-prompts.js.map +1 -1
  5. package/dist/ai/schemas/ai-response-schemas.d.ts +11 -1
  6. package/dist/ai/schemas/ai-response-schemas.d.ts.map +1 -1
  7. package/dist/ai/schemas/ai-response-schemas.js +15 -1
  8. package/dist/ai/schemas/ai-response-schemas.js.map +1 -1
  9. package/dist/cli/commands/refine.d.ts.map +1 -1
  10. package/dist/cli/commands/refine.js +46 -9
  11. package/dist/cli/commands/refine.js.map +1 -1
  12. package/dist/cli/commands/rules.d.ts.map +1 -1
  13. package/dist/cli/commands/rules.js +13 -3
  14. package/dist/cli/commands/rules.js.map +1 -1
  15. package/dist/generators/claude-generator.d.ts.map +1 -1
  16. package/dist/generators/claude-generator.js +3 -1
  17. package/dist/generators/claude-generator.js.map +1 -1
  18. package/dist/generators/codex-generator.d.ts.map +1 -1
  19. package/dist/generators/codex-generator.js +7 -15
  20. package/dist/generators/codex-generator.js.map +1 -1
  21. package/dist/models/types.d.ts +2 -0
  22. package/dist/models/types.d.ts.map +1 -1
  23. package/dist/services/artifact-service.d.ts +10 -1
  24. package/dist/services/artifact-service.d.ts.map +1 -1
  25. package/dist/services/artifact-service.js +17 -2
  26. package/dist/services/artifact-service.js.map +1 -1
  27. package/dist/services/artifact-validation.d.ts +24 -0
  28. package/dist/services/artifact-validation.d.ts.map +1 -0
  29. package/dist/services/artifact-validation.js +61 -0
  30. package/dist/services/artifact-validation.js.map +1 -0
  31. package/dist/services/delta-apply-service.d.ts +16 -0
  32. package/dist/services/delta-apply-service.d.ts.map +1 -0
  33. package/dist/services/delta-apply-service.js +74 -0
  34. package/dist/services/delta-apply-service.js.map +1 -0
  35. package/dist/services/linear-pull-service.d.ts.map +1 -1
  36. package/dist/services/linear-pull-service.js +3 -1
  37. package/dist/services/linear-pull-service.js.map +1 -1
  38. package/dist/services/revise-apply-service.d.ts.map +1 -1
  39. package/dist/services/revise-apply-service.js +10 -0
  40. package/dist/services/revise-apply-service.js.map +1 -1
  41. package/dist/templates/rules/codex/_pipeline-section.md.hbs +10 -6
  42. package/dist/templates/rules/cursor/planr-pipeline-plan.mdc.hbs +2 -0
  43. package/dist/templates/rules/cursor/planr-pipeline-ship.mdc.hbs +10 -6
  44. package/dist/utils/splice-managed-block.d.ts +11 -0
  45. package/dist/utils/splice-managed-block.d.ts.map +1 -0
  46. package/dist/utils/splice-managed-block.js +36 -0
  47. package/dist/utils/splice-managed-block.js.map +1 -0
  48. package/package.json +1 -1
@@ -82,21 +82,24 @@ the `storyId` frontmatter field.
82
82
  For each story, run its tasks:
83
83
 
84
84
  1. Read the US file to identify which tasks belong to it.
85
- 2. For each task:
86
- - Read frontmatter `Type` field.
85
+ 2. **Read project memory:** if `.planr/memory.md` exists, keyword-match relevant entries against the current task's file list. Include matched traps/decisions/corrections in the subagent's context.
86
+ 3. For each task:
87
+ - Read frontmatter `Type` and `status` fields.
88
+ - Skip tasks with `status: done`. Enqueue `pending`, `in-progress` (recover), `blocked` (retry).
87
89
  - If `Type: UI` → dispatch the **frontend** subagent
88
90
  (`{{cursorRulesRoot}}/agents/frontend-agent.md`).
89
91
  - If `Type: Tech` → dispatch the **backend** subagent
90
92
  (`{{cursorRulesRoot}}/agents/backend-agent.md`).
91
93
  - frontend and backend tasks within the SAME US may run in parallel
92
94
  (Cursor's Composer supports parallel subagent dispatch — use it).
93
- 3. Each subagent applies the **3-iteration correction loop** (R6):
95
+ 4. Each subagent applies the **3-iteration correction loop** (R6):
94
96
  - Iteration 1: direct fix on build/test failure.
95
97
  - Iteration 2: re-read task spec + design-spec/schema, fix holistically.
96
98
  - Iteration 3: minimal safe fix, flag remaining issues.
97
- - On 3rd failure: write `error-report.md` (default mode:
98
- `output/feats/feat-{feature}/us-{N}/tasks/error-report.md`; spec mode:
99
- `<SPEC_DIR>/tasks/error-report.md`). Then STOP that task.
99
+ - On entering iteration 2: append a trap entry to `.planr/memory.md` under `## Traps`.
100
+ - On 3rd failure: write `T-NNN-error-report.md` (default mode:
101
+ `output/feats/feat-{feature}/us-{N}/tasks/T-NNN-error-report.md`; spec mode:
102
+ `<SPEC_DIR>/tasks/T-NNN-error-report.md`). Then STOP that task.
100
103
  4. If a task fails after 3 iterations, ship continues with other independent
101
104
  tasks but flags the failed task in the final summary.
102
105
 
@@ -112,6 +115,7 @@ The qa subagent verifies, for each task:
112
115
  - All "Modify" files were updated (and only as described)
113
116
  - All "Preserve" files are unchanged (`git diff` vs base)
114
117
  - Tests pass (`BuildCommand` + `TestCommand` from `stack.md`)
118
+ - If task has `rationale:`, check implementation drift vs stated intent (non-blocking warning)
115
119
  - DoD checklist items satisfied
116
120
 
117
121
  If QA fails: flag in summary; **still proceed to Step 5 snapshot** so state
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Splice `newBlockContent` into `existing` between managed-block markers
3
+ * identified by `markerName`.
4
+ *
5
+ * - Markers exist → replace only the content between them (markers kept).
6
+ * - No markers (or orphan begin without end) → append at end with markers.
7
+ * - Content outside markers is never modified.
8
+ * - Idempotent: splicing the same content twice yields identical output.
9
+ */
10
+ export declare function spliceManagedBlock(existing: string, markerName: string, newBlockContent: string): string;
11
+ //# sourceMappingURL=splice-managed-block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splice-managed-block.d.ts","sourceRoot":"","sources":["../../src/utils/splice-managed-block.ts"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,MAAM,GACtB,MAAM,CAmBR"}
@@ -0,0 +1,36 @@
1
+ const BEGIN_RE = (name) => new RegExp(`^<!--\\s*##planr-${name}:begin##[^>]*-->\\s*$`, 'm');
2
+ const END_RE = (name) => new RegExp(`^<!--\\s*##planr-${name}:end##\\s*-->\\s*$`, 'm');
3
+ function beginMarker(name) {
4
+ return `<!-- ##planr-${name}:begin## (managed by planr CLI; preserve hand-edits outside this block) -->`;
5
+ }
6
+ function endMarker(name) {
7
+ return `<!-- ##planr-${name}:end## -->`;
8
+ }
9
+ /**
10
+ * Splice `newBlockContent` into `existing` between managed-block markers
11
+ * identified by `markerName`.
12
+ *
13
+ * - Markers exist → replace only the content between them (markers kept).
14
+ * - No markers (or orphan begin without end) → append at end with markers.
15
+ * - Content outside markers is never modified.
16
+ * - Idempotent: splicing the same content twice yields identical output.
17
+ */
18
+ export function spliceManagedBlock(existing, markerName, newBlockContent) {
19
+ const beginMatch = BEGIN_RE(markerName).exec(existing);
20
+ const endMatch = END_RE(markerName).exec(existing);
21
+ const wrappedBlock = [
22
+ beginMarker(markerName),
23
+ newBlockContent.trimEnd(),
24
+ endMarker(markerName),
25
+ ].join('\n');
26
+ if (beginMatch && endMatch && endMatch.index > beginMatch.index) {
27
+ const before = existing.slice(0, beginMatch.index);
28
+ const after = existing.slice(endMatch.index + endMatch[0].length);
29
+ return `${before}${wrappedBlock}${after}`;
30
+ }
31
+ const trimmed = existing.trimEnd();
32
+ if (trimmed.length === 0)
33
+ return `${wrappedBlock}\n`;
34
+ return `${trimmed}\n\n${wrappedBlock}\n`;
35
+ }
36
+ //# sourceMappingURL=splice-managed-block.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splice-managed-block.js","sourceRoot":"","sources":["../../src/utils/splice-managed-block.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,oBAAoB,IAAI,uBAAuB,EAAE,GAAG,CAAC,CAAC;AACpG,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,oBAAoB,IA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
1
  {
2
2
  "name": "openplanr",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "AI-powered planning CLI — backlog, sprints, task templates, estimation, GitHub and Linear sync, and AI agent rules for Cursor, Claude Code, and Codex",
5
5
  "type": "module",
6
6
  "main": "./dist/cli/index.js",