@mjasnikovs/pi-task 0.13.17 → 0.13.18

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.
@@ -34,14 +34,20 @@ export declare function expandFeatureMentions(cwd: string, feature: string): Pro
34
34
  */
35
35
  export declare function readableMentions(cwd: string, feature: string): Promise<string[]>;
36
36
  /**
37
- * Thread the feature's spec references into every decomposed task title.
38
- * Decompose emits titles only, and a title is ALL a per-task pipeline ever sees
39
- * — so without this the design doc the feature pointed at is invisible
40
- * downstream and each task drifts to a generic reading of its one-line title
41
- * (this is how an "Implement @design.md" run built a generic `posts` table the
42
- * spec never mentioned). Appending the @refs makes the per-task refine/research
43
- * read the real spec and treat it as authoritative over the title. No readable
44
- * refs → titles unchanged, so a doc-less /task-auto behaves exactly as before.
37
+ * Thread the feature's spec references AND any per-task decisions into every
38
+ * decomposed task title. A title is ALL a per-task pipeline ever sees, so both
39
+ * the design doc the feature pointed at and the user's clarification choices have
40
+ * to ride along or they're invisible downstream this is how an "Implement
41
+ * @design.md" run built a generic `posts` table the spec never mentioned, and how
42
+ * a "do not use vite" clarification got silently overridden by the doc's own
43
+ * vite.config.ts.
44
+ *
45
+ * Precedence is the crux: a clarification is a CORRECTION to a (possibly stale)
46
+ * spec doc, so the decisions clause is marked as overriding the doc, while the doc
47
+ * stays authoritative for everything the decisions don't touch. Decompose scopes
48
+ * each decision to the task(s) it governs, so most titles carry none. No readable
49
+ * refs and no decisions → title unchanged, so a doc-less /task-auto behaves
50
+ * exactly as before.
45
51
  */
46
52
  export declare function attachSpecRefs(titles: string[], refs: string[]): string[];
47
53
  /** Plan phase: clarify → decompose → write AUTO file. Returns the new id, or null. */
@@ -75,22 +75,41 @@ export async function readableMentions(cwd, feature) {
75
75
  }
76
76
  return out;
77
77
  }
78
+ /** A trailing "[decisions: …]" clause decompose may attach to a task line. */
79
+ const DECISIONS_RE = /\s*\[decisions:\s*(.+?)\]\s*$/i;
78
80
  /**
79
- * Thread the feature's spec references into every decomposed task title.
80
- * Decompose emits titles only, and a title is ALL a per-task pipeline ever sees
81
- * — so without this the design doc the feature pointed at is invisible
82
- * downstream and each task drifts to a generic reading of its one-line title
83
- * (this is how an "Implement @design.md" run built a generic `posts` table the
84
- * spec never mentioned). Appending the @refs makes the per-task refine/research
85
- * read the real spec and treat it as authoritative over the title. No readable
86
- * refs → titles unchanged, so a doc-less /task-auto behaves exactly as before.
81
+ * Thread the feature's spec references AND any per-task decisions into every
82
+ * decomposed task title. A title is ALL a per-task pipeline ever sees, so both
83
+ * the design doc the feature pointed at and the user's clarification choices have
84
+ * to ride along or they're invisible downstream this is how an "Implement
85
+ * @design.md" run built a generic `posts` table the spec never mentioned, and how
86
+ * a "do not use vite" clarification got silently overridden by the doc's own
87
+ * vite.config.ts.
88
+ *
89
+ * Precedence is the crux: a clarification is a CORRECTION to a (possibly stale)
90
+ * spec doc, so the decisions clause is marked as overriding the doc, while the doc
91
+ * stays authoritative for everything the decisions don't touch. Decompose scopes
92
+ * each decision to the task(s) it governs, so most titles carry none. No readable
93
+ * refs and no decisions → title unchanged, so a doc-less /task-auto behaves
94
+ * exactly as before.
87
95
  */
88
96
  export function attachSpecRefs(titles, refs) {
89
- if (refs.length === 0)
90
- return titles;
91
97
  const list = refs.map(r => '@' + r).join(' ');
92
- const suffix = ` | spec: ${list} — authoritative; read it and follow it over this title wherever they differ`;
93
- return titles.map(t => (t.includes('| spec:') ? t : t + suffix));
98
+ return titles.map(t => {
99
+ if (t.includes('| spec:') || t.includes('| decisions'))
100
+ return t; // already threaded
101
+ const dm = DECISIONS_RE.exec(t);
102
+ const base = dm ? t.slice(0, dm.index).trimEnd() : t;
103
+ const decisions = dm ? dm[1].trim() : '';
104
+ let out = base;
105
+ if (decisions) {
106
+ out += ` | decisions (explicit user choices — these OVERRIDE the spec doc wherever they conflict; follow them exactly): ${decisions}`;
107
+ }
108
+ if (refs.length > 0) {
109
+ out += ` | spec: ${list} — otherwise authoritative; read it and follow it over this title wherever they differ`;
110
+ }
111
+ return out;
112
+ });
94
113
  }
95
114
  /** Plan phase: clarify → decompose → write AUTO file. Returns the new id, or null. */
96
115
  export async function planAuto(ctx, cwd, feature, deps) {
@@ -82,4 +82,10 @@ RULES:
82
82
  - Order tasks so earlier ones unblock later ones (foundations first).
83
83
  - Each task should be independently implementable as a single /task run.
84
84
  - Prefer a handful of substantial tasks over many trivial ones.
85
+ - When a CLARIFICATION decision governs a task, append it to that task's line as
86
+ "[decisions: <directive>]" — include ONLY the decisions that bear on that task,
87
+ and attach a cross-cutting decision to EACH task it governs. Most tasks carry
88
+ none. These are explicit user choices that may contradict the referenced spec
89
+ doc; phrase them as imperative directives (e.g. "use Bun's built-in bundler, do
90
+ not add vite"). Do NOT invent decisions — only restate ones from CLARIFICATIONS.
85
91
  - Output the checkbox list and NOTHING else (no preamble, no numbering).`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjasnikovs/pi-task",
3
- "version": "0.13.17",
3
+ "version": "0.13.18",
4
4
  "description": "Deterministic spec-orchestration for local models, with a bundled real-time remote web view and web/docs/fetch/worker subagent tools.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",