ahead-pi 0.3.0 → 0.3.1

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 (34) hide show
  1. package/README.md +16 -41
  2. package/dist/ahead_wasm.wasm +0 -0
  3. package/generated/reference/CONSTITUTION.md +2 -0
  4. package/generated/reference/docs/evidence/README.md +17 -0
  5. package/generated/reference/docs/evidence/evidence-standard.md +2 -0
  6. package/generated/reference/docs/evidence/research-map.md +2 -0
  7. package/generated/reference/docs/{references → evidence/sources}/pragmatic-programmer-page-index.md +3 -1
  8. package/generated/reference/docs/{references → evidence/sources}/submitted-engineering-notes.md +3 -1
  9. package/generated/reference/docs/guide/README.md +28 -0
  10. package/generated/reference/docs/{acceptable-ai-use.md → guide/acceptable-ai-use.md} +4 -2
  11. package/generated/reference/docs/{engineering-practice.md → guide/engineering-practice.md} +5 -3
  12. package/generated/reference/docs/{rationale.md → guide/rationale.md} +3 -1
  13. package/generated/reference/docs/{recommended-skills.md → guide/recommended-skills.md} +2 -0
  14. package/generated/reference/docs/{workflows → guide/workflows}/README.md +3 -1
  15. package/generated/reference/docs/{workflows → guide/workflows}/corrective-debugging.md +2 -0
  16. package/generated/reference/docs/{workflows → guide/workflows}/decision.md +2 -0
  17. package/generated/reference/docs/{workflows → guide/workflows}/internal-improvement.md +2 -0
  18. package/generated/reference/docs/{workflows → guide/workflows}/investigation.md +2 -0
  19. package/generated/reference/docs/{workflows → guide/workflows}/operational-stabilization.md +2 -0
  20. package/generated/reference/docs/{workflows → guide/workflows}/product-change.md +2 -0
  21. package/generated/reference/index.json +127 -132
  22. package/package.json +1 -1
  23. package/src/engine.ts +1 -1
  24. package/src/guidance.ts +3 -7
  25. package/src/index.ts +255 -20
  26. package/src/reference.ts +12 -1
  27. package/src/storage.ts +63 -3
  28. package/generated/reference/docs/design/adapted-skill-guidance.md +0 -27
  29. package/generated/reference/docs/design/debugging-and-operations.md +0 -119
  30. package/generated/reference/docs/design/executable-workflows.md +0 -122
  31. package/generated/reference/docs/design/instruction-authoring.md +0 -28
  32. package/generated/reference/docs/design/process-taxonomy.md +0 -144
  33. package/generated/reference/docs/design/review-workbench.md +0 -37
  34. package/generated/reference/docs/releasing-pi.md +0 -89
@@ -1,28 +1,24 @@
1
1
  {
2
+ "api_version": "ahead.references/v0.1",
2
3
  "generated_from": [
3
4
  "CONSTITUTION.md",
4
- "docs/acceptable-ai-use.md",
5
- "docs/design/adapted-skill-guidance.md",
6
- "docs/design/debugging-and-operations.md",
7
- "docs/design/executable-workflows.md",
8
- "docs/design/instruction-authoring.md",
9
- "docs/design/process-taxonomy.md",
10
- "docs/design/review-workbench.md",
11
- "docs/engineering-practice.md",
5
+ "docs/evidence/README.md",
12
6
  "docs/evidence/evidence-standard.md",
13
7
  "docs/evidence/research-map.md",
14
- "docs/rationale.md",
15
- "docs/recommended-skills.md",
16
- "docs/references/pragmatic-programmer-page-index.md",
17
- "docs/references/submitted-engineering-notes.md",
18
- "docs/releasing-pi.md",
19
- "docs/workflows/README.md",
20
- "docs/workflows/corrective-debugging.md",
21
- "docs/workflows/decision.md",
22
- "docs/workflows/internal-improvement.md",
23
- "docs/workflows/investigation.md",
24
- "docs/workflows/operational-stabilization.md",
25
- "docs/workflows/product-change.md"
8
+ "docs/evidence/sources/pragmatic-programmer-page-index.md",
9
+ "docs/evidence/sources/submitted-engineering-notes.md",
10
+ "docs/guide/README.md",
11
+ "docs/guide/acceptable-ai-use.md",
12
+ "docs/guide/engineering-practice.md",
13
+ "docs/guide/rationale.md",
14
+ "docs/guide/recommended-skills.md",
15
+ "docs/guide/workflows/README.md",
16
+ "docs/guide/workflows/corrective-debugging.md",
17
+ "docs/guide/workflows/decision.md",
18
+ "docs/guide/workflows/internal-improvement.md",
19
+ "docs/guide/workflows/investigation.md",
20
+ "docs/guide/workflows/operational-stabilization.md",
21
+ "docs/guide/workflows/product-change.md"
26
22
  ],
27
23
  "references": [
28
24
  {
@@ -30,6 +26,9 @@
30
26
  "path": "CONSTITUTION.md",
31
27
  "title": "AHEAD Constitution",
32
28
  "summary": "This constitution records the durable principles of **Assisted Human Engineering and Development**. Workflows and tools may evolve. These principles define what makes them AHEAD.",
29
+ "audience": "practitioner",
30
+ "authority": "binding",
31
+ "distribution": "agent-and-human",
33
32
  "phases": [
34
33
  "*"
35
34
  ],
@@ -38,89 +37,88 @@
38
37
  ]
39
38
  },
40
39
  {
41
- "id": "acceptable-ai-use",
42
- "path": "docs/acceptable-ai-use.md",
43
- "title": "Acceptable AI Use in AHEAD",
44
- "summary": "This policy is binding for AHEAD pilot workflows. The [AHEAD Constitution](../CONSTITUTION.md) is the highest authority; this policy interprets its human-ownership boundaries; workflow profiles apply both and may narrow AI permissions for a",
45
- "phases": [
46
- "*"
47
- ],
48
- "workflows": [
49
- "*"
50
- ]
51
- },
52
- {
53
- "id": "design:adapted-skill-guidance",
54
- "path": "docs/design/adapted-skill-guidance.md",
55
- "title": "Adapted Skill Guidance",
56
- "summary": "AHEAD reviewed the [Matt Pocock skills collection](https://www.skills.sh/mattpocock/skills), including the specifically discussed [grill-me](https://www.skills.sh/mattpocock/skills/grill-me), [prototype](https://www.skills.sh/mattpocock/ski",
57
- "phases": [],
58
- "workflows": [
59
- "*"
60
- ]
61
- },
62
- {
63
- "id": "design:debugging-and-operations",
64
- "path": "docs/design/debugging-and-operations.md",
65
- "title": "Debugging and Operational Investigation",
66
- "summary": "The minimal [corrective-debugging](../workflows/corrective-debugging.md) and [operational-stabilization](../workflows/operational-stabilization.md) profiles translate this discussion into pilotable flows. This document retains the reasoning",
40
+ "id": "evidence",
41
+ "path": "docs/evidence/README.md",
42
+ "title": "AHEAD Evidence and Provenance",
43
+ "summary": "This library records why AHEAD makes its process choices and how strong the support for those choices is. It is separate from the practitioner guide so source material and methodology governance do not become extra steps in ordinary enginee",
44
+ "audience": "evidence",
45
+ "authority": "supporting",
46
+ "distribution": "agent-and-human",
67
47
  "phases": [],
68
48
  "workflows": [
69
49
  "*"
70
50
  ]
71
51
  },
72
52
  {
73
- "id": "design:executable-workflows",
74
- "path": "docs/design/executable-workflows.md",
75
- "title": "Executable AHEAD Workflows",
76
- "summary": "The executable layer makes AHEAD workflow state durable and makes selected human/AI boundaries enforceable across integrations. It does not turn judgment into a checklist or make workflow artifacts proof of understanding.",
53
+ "id": "evidence:evidence-standard",
54
+ "path": "docs/evidence/evidence-standard.md",
55
+ "title": "AHEAD Evidence Standard",
56
+ "summary": "AHEAD should be supported by the best available evidence without claiming more certainty than software-engineering research can provide. A credible methodology must distinguish evidence for a descriptive claim from evidence that a particula",
57
+ "audience": "evidence",
58
+ "authority": "supporting",
59
+ "distribution": "agent-and-human",
77
60
  "phases": [
78
- "*"
61
+ "research",
62
+ "questions",
63
+ "decision",
64
+ "plan",
65
+ "ai-review",
66
+ "human-review",
67
+ "verify",
68
+ "ai-audit",
69
+ "outcome"
79
70
  ],
80
71
  "workflows": [
81
72
  "*"
82
73
  ]
83
74
  },
84
75
  {
85
- "id": "design:instruction-authoring",
86
- "path": "docs/design/instruction-authoring.md",
87
- "title": "Instruction Authoring",
88
- "summary": "AHEAD instructions are an executable interface to the framework. They should make the next valid behavior clear without duplicating the full Constitution, rationale, or workflow documentation into every model turn.",
76
+ "id": "evidence:research-map",
77
+ "path": "docs/evidence/research-map.md",
78
+ "title": "AHEAD Research Map",
79
+ "summary": "This document maps current AHEAD design claims to available evidence. It is not a bibliography of everything related to software engineering. It focuses on claims that materially shape the methodology.",
80
+ "audience": "evidence",
81
+ "authority": "supporting",
82
+ "distribution": "agent-and-human",
89
83
  "phases": [],
90
84
  "workflows": [
91
85
  "*"
92
86
  ]
93
87
  },
94
88
  {
95
- "id": "design:process-taxonomy",
96
- "path": "docs/design/process-taxonomy.md",
97
- "title": "AHEAD Process Taxonomy",
98
- "summary": "AHEAD should not create a workflow for every issue label. “Security,” “performance,” “data,” “incident,” and “technical debt” often describe risk, domain, urgency, or cause—not the kind of reasoning needed to complete the work.",
89
+ "id": "evidence:sources:pragmatic-programmer-page-index",
90
+ "path": "docs/evidence/sources/pragmatic-programmer-page-index.md",
91
+ "title": "*The Pragmatic Programmer* Page Index",
92
+ "summary": "This index preserves the page-level provenance from the original AHEAD engineering-practice notes for:",
93
+ "audience": "evidence",
94
+ "authority": "supporting",
95
+ "distribution": "agent-and-human",
99
96
  "phases": [],
100
97
  "workflows": [
101
98
  "*"
102
99
  ]
103
100
  },
104
101
  {
105
- "id": "design:review-workbench",
106
- "path": "docs/design/review-workbench.md",
107
- "title": "Review Workbench",
108
- "summary": "The review workbench makes the handoff from implementation to independent human review explicit and inspectable:",
109
- "phases": [
110
- "ai-review",
111
- "human-review"
112
- ],
102
+ "id": "evidence:sources:submitted-engineering-notes",
103
+ "path": "docs/evidence/sources/submitted-engineering-notes.md",
104
+ "title": "Submitted Engineering Notes",
105
+ "summary": "This document preserves submitted engineering tips, checklists, and practices that are intentionally condensed in the [AHEAD Engineering Practice](../../guide/engineering-practice.md) guide. It is a source record, not a claim that every ite",
106
+ "audience": "evidence",
107
+ "authority": "supporting",
108
+ "distribution": "agent-and-human",
109
+ "phases": [],
113
110
  "workflows": [
114
- "product-change",
115
- "corrective-debugging",
116
- "internal-improvement"
111
+ "*"
117
112
  ]
118
113
  },
119
114
  {
120
- "id": "engineering-practice",
121
- "path": "docs/engineering-practice.md",
122
- "title": "AHEAD Engineering Practice",
123
- "summary": "AHEAD is not only a sequence of AI gates. It is a way of practicing engineering. This guide distills general habits from the submitted starting list into a smaller set of principles that can be remembered, applied, and evaluated.",
115
+ "id": "guide",
116
+ "path": "docs/guide/README.md",
117
+ "title": "AHEAD Practitioner Guide",
118
+ "summary": "This is the starting point for people applying AHEAD to engineering work. These documents explain what practitioners are expected to understand, decide, record, and review. They do not describe how the Rust engine, Pi adapter, instruction g",
119
+ "audience": "practitioner",
120
+ "authority": "guidance",
121
+ "distribution": "agent-and-human",
124
122
  "phases": [
125
123
  "*"
126
124
  ],
@@ -129,40 +127,43 @@
129
127
  ]
130
128
  },
131
129
  {
132
- "id": "evidence:evidence-standard",
133
- "path": "docs/evidence/evidence-standard.md",
134
- "title": "AHEAD Evidence Standard",
135
- "summary": "AHEAD should be supported by the best available evidence without claiming more certainty than software-engineering research can provide. A credible methodology must distinguish evidence for a descriptive claim from evidence that a particula",
130
+ "id": "acceptable-ai-use",
131
+ "path": "docs/guide/acceptable-ai-use.md",
132
+ "title": "Acceptable AI Use in AHEAD",
133
+ "summary": "This policy is binding for AHEAD pilot workflows. The [AHEAD Constitution](../../CONSTITUTION.md) is the highest authority; this policy interprets its human-ownership boundaries; workflow profiles apply both and may narrow AI permissions fo",
134
+ "audience": "practitioner",
135
+ "authority": "binding",
136
+ "distribution": "agent-and-human",
136
137
  "phases": [
137
- "research",
138
- "questions",
139
- "decision",
140
- "plan",
141
- "ai-review",
142
- "human-review",
143
- "verify",
144
- "ai-audit",
145
- "outcome"
138
+ "*"
146
139
  ],
147
140
  "workflows": [
148
141
  "*"
149
142
  ]
150
143
  },
151
144
  {
152
- "id": "evidence:research-map",
153
- "path": "docs/evidence/research-map.md",
154
- "title": "AHEAD Research Map",
155
- "summary": "This document maps current AHEAD design claims to available evidence. It is not a bibliography of everything related to software engineering. It focuses on claims that materially shape the methodology.",
156
- "phases": [],
145
+ "id": "engineering-practice",
146
+ "path": "docs/guide/engineering-practice.md",
147
+ "title": "AHEAD Engineering Practice",
148
+ "summary": "AHEAD is not only a sequence of AI gates. It is a way of practicing engineering. This guide distills general habits from the submitted starting list into a smaller set of principles that can be remembered, applied, and evaluated.",
149
+ "audience": "practitioner",
150
+ "authority": "guidance",
151
+ "distribution": "agent-and-human",
152
+ "phases": [
153
+ "*"
154
+ ],
157
155
  "workflows": [
158
156
  "*"
159
157
  ]
160
158
  },
161
159
  {
162
160
  "id": "rationale",
163
- "path": "docs/rationale.md",
161
+ "path": "docs/guide/rationale.md",
164
162
  "title": "Why AHEAD",
165
163
  "summary": "AI can make software engineering faster. It can search broadly, synthesize information, identify omissions, generate alternatives, produce routine code, explain unfamiliar systems, and review more material than a person can inspect unaided.",
164
+ "audience": "practitioner",
165
+ "authority": "guidance",
166
+ "distribution": "agent-and-human",
166
167
  "phases": [
167
168
  "*"
168
169
  ],
@@ -172,49 +173,25 @@
172
173
  },
173
174
  {
174
175
  "id": "recommended-skills",
175
- "path": "docs/recommended-skills.md",
176
+ "path": "docs/guide/recommended-skills.md",
176
177
  "title": "Recommended Skills",
177
178
  "summary": "AHEAD may recommend independently maintained agent skills when they strengthen an active phase. Recommendations are references, not bundled code or silent dependencies. A human chooses whether to inspect and install one, and AHEAD's workflo",
179
+ "audience": "practitioner",
180
+ "authority": "guidance",
181
+ "distribution": "agent-and-human",
178
182
  "phases": [],
179
183
  "workflows": [
180
184
  "*"
181
185
  ]
182
186
  },
183
187
  {
184
- "id": "references:pragmatic-programmer-page-index",
185
- "path": "docs/references/pragmatic-programmer-page-index.md",
186
- "title": "*The Pragmatic Programmer* Page Index",
187
- "summary": "This index preserves the page-level provenance from the original AHEAD engineering-practice notes for:",
188
- "phases": [],
189
- "workflows": [
190
- "*"
191
- ]
192
- },
193
- {
194
- "id": "references:submitted-engineering-notes",
195
- "path": "docs/references/submitted-engineering-notes.md",
196
- "title": "Submitted Engineering Notes",
197
- "summary": "This document preserves submitted engineering tips, checklists, and practices that are intentionally condensed in the [AHEAD Engineering Practice](../engineering-practice.md) guide. It is a source record, not a claim that every item is an e",
198
- "phases": [],
199
- "workflows": [
200
- "*"
201
- ]
202
- },
203
- {
204
- "id": "releasing-pi",
205
- "path": "docs/releasing-pi.md",
206
- "title": "Releasing the Pi Extension",
207
- "summary": "- npm package: `ahead-pi` - package source: `integrations/pi` - release workflow: `.github/workflows/publish-pi.yml` - release tag: `pi-v<package-version>` - stable npm dist-tag: `latest` - prerelease npm dist-tag: `next` - registry: `https",
208
- "phases": [],
209
- "workflows": [
210
- "*"
211
- ]
212
- },
213
- {
214
- "id": "workflows:readme",
215
- "path": "docs/workflows/README.md",
188
+ "id": "workflows",
189
+ "path": "docs/guide/workflows/README.md",
216
190
  "title": "AHEAD Pilot Workflows",
217
191
  "summary": "These six minimal workflow profiles are meant to be used on real engineering work through the Pi adapter or a manual record. Their canonical executable contracts live in `spec/workflows`, while these documents explain the same boundaries an",
192
+ "audience": "practitioner",
193
+ "authority": "binding",
194
+ "distribution": "agent-and-human",
218
195
  "phases": [
219
196
  "*"
220
197
  ],
@@ -224,9 +201,12 @@
224
201
  },
225
202
  {
226
203
  "id": "workflows:corrective-debugging",
227
- "path": "docs/workflows/corrective-debugging.md",
204
+ "path": "docs/guide/workflows/corrective-debugging.md",
228
205
  "title": "Corrective Debugging Workflow",
229
206
  "summary": "Use this flow when observed behavior conflicts with intended behavior and the dominant work is causal diagnosis plus correction. It ends with a verified correction or an explicit human acceptance of remaining uncertainty.",
207
+ "audience": "practitioner",
208
+ "authority": "binding",
209
+ "distribution": "agent-and-human",
230
210
  "phases": [
231
211
  "*"
232
212
  ],
@@ -236,9 +216,12 @@
236
216
  },
237
217
  {
238
218
  "id": "workflows:decision",
239
- "path": "docs/workflows/decision.md",
219
+ "path": "docs/guide/workflows/decision.md",
240
220
  "title": "Decision Workflow",
241
221
  "summary": "Use this flow when the deliverable is an accountable human choice among alternatives: architecture, buy versus build, technology selection, platform direction, policy, or another consequential course.",
222
+ "audience": "practitioner",
223
+ "authority": "binding",
224
+ "distribution": "agent-and-human",
242
225
  "phases": [
243
226
  "*"
244
227
  ],
@@ -248,9 +231,12 @@
248
231
  },
249
232
  {
250
233
  "id": "workflows:internal-improvement",
251
- "path": "docs/workflows/internal-improvement.md",
234
+ "path": "docs/guide/workflows/internal-improvement.md",
252
235
  "title": "Internal Improvement Workflow",
253
236
  "summary": "Use this flow when externally required behavior should remain invariant while an internal quality improves: maintainability, comprehensibility, performance, reliability margin, operability, testability, cost, or preventive risk reduction.",
237
+ "audience": "practitioner",
238
+ "authority": "binding",
239
+ "distribution": "agent-and-human",
254
240
  "phases": [
255
241
  "*"
256
242
  ],
@@ -260,9 +246,12 @@
260
246
  },
261
247
  {
262
248
  "id": "workflows:investigation",
263
- "path": "docs/workflows/investigation.md",
249
+ "path": "docs/guide/workflows/investigation.md",
264
250
  "title": "Investigation Workflow",
265
251
  "summary": "Use this flow when the primary deliverable is knowledge or reduced uncertainty and no intervention has yet been selected. It may answer feasibility, causal, capacity, vendor, architectural, or technical questions.",
252
+ "audience": "practitioner",
253
+ "authority": "binding",
254
+ "distribution": "agent-and-human",
266
255
  "phases": [
267
256
  "*"
268
257
  ],
@@ -272,9 +261,12 @@
272
261
  },
273
262
  {
274
263
  "id": "workflows:operational-stabilization",
275
- "path": "docs/workflows/operational-stabilization.md",
264
+ "path": "docs/guide/workflows/operational-stabilization.md",
276
265
  "title": "Operational Stabilization Workflow",
277
266
  "summary": "Use this flow when a live system is outside an acceptable operating state and the immediate outcome is restoration, stabilization, or demonstrated convergence. It covers code and non-code causes such as reconciliation storms, configuration ",
267
+ "audience": "practitioner",
268
+ "authority": "binding",
269
+ "distribution": "agent-and-human",
278
270
  "phases": [
279
271
  "*"
280
272
  ],
@@ -284,9 +276,12 @@
284
276
  },
285
277
  {
286
278
  "id": "workflows:product-change",
287
- "path": "docs/workflows/product-change.md",
279
+ "path": "docs/guide/workflows/product-change.md",
288
280
  "title": "Product Change Workflow",
289
281
  "summary": "Use this flow when the dominant outcome is new, changed, adapted, migrated, or retired externally meaningful behavior. It ends with verified intended behavior and an accountable human outcome decision.",
282
+ "audience": "practitioner",
283
+ "authority": "binding",
284
+ "distribution": "agent-and-human",
290
285
  "phases": [
291
286
  "*"
292
287
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ahead-pi",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "AHEAD workflow enforcement and context for Pi",
5
5
  "keywords": [
6
6
  "ahead",
package/src/engine.ts CHANGED
@@ -60,7 +60,7 @@ export class AheadEngine {
60
60
  title: string;
61
61
  owner: Actor;
62
62
  timestamp: string;
63
- workflow_id?: string;
63
+ workflow_id: string;
64
64
  }): Run {
65
65
  return this.call("create_run", input);
66
66
  }
package/src/guidance.ts CHANGED
@@ -442,7 +442,7 @@ function nextPendingArtifact(state: RunState): ArtifactState | undefined {
442
442
  );
443
443
  }
444
444
 
445
- export function buildWidgetLines(
445
+ export function buildHeaderLines(
446
446
  run: Run,
447
447
  state: RunState,
448
448
  workflow: WorkflowDefinition,
@@ -464,14 +464,10 @@ export function buildWidgetLines(
464
464
  const action = nextAction(state, workflow);
465
465
 
466
466
  return [
467
- `AHEAD MODE · ${workflow.title.toUpperCase()} · ${position.current}/${position.total}`,
468
- `${guide.handoff ?? state.phase.title.toUpperCase()} · HUMAN LEADS · AI ASSISTS`,
467
+ `AHEAD · ${workflow.title} · ${position.current}/${position.total} · ${state.phase.title}`,
469
468
  `Goal: ${guide.objective}`,
470
- `You: ${guide.human}`,
471
- `AI: ${guide.ai}`,
472
469
  `Required: ${checklist}`,
473
- `Next (${action.actor === "human" ? "you" : "AI"}): ${action.label}`,
474
- "Run /ahead for the guided action · /ahead-guide for framework docs.",
470
+ `Next: ${action.actor === "human" ? "You" : "AI"} ${action.label}`,
475
471
  ];
476
472
  }
477
473