ahead-pi 0.2.0 → 0.2.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 (40) hide show
  1. package/README.md +13 -3
  2. package/generated/product-change/ai-audit.md +6 -3
  3. package/generated/product-change/ai-review.md +6 -3
  4. package/generated/product-change/decision.md +6 -3
  5. package/generated/product-change/define.md +6 -3
  6. package/generated/product-change/deploy.md +6 -3
  7. package/generated/product-change/human-review.md +6 -3
  8. package/generated/product-change/implement.md +11 -4
  9. package/generated/product-change/manifest.json +2 -2
  10. package/generated/product-change/options.md +6 -3
  11. package/generated/product-change/outcome.md +6 -3
  12. package/generated/product-change/plan.md +6 -3
  13. package/generated/product-change/questions.md +6 -3
  14. package/generated/product-change/research.md +6 -3
  15. package/generated/product-change/verify.md +6 -3
  16. package/generated/reference/CONSTITUTION.md +43 -0
  17. package/generated/reference/docs/acceptable-ai-use.md +217 -0
  18. package/generated/reference/docs/design/debugging-and-operations.md +119 -0
  19. package/generated/reference/docs/design/executable-workflows.md +110 -0
  20. package/generated/reference/docs/design/process-taxonomy.md +144 -0
  21. package/generated/reference/docs/engineering-practice.md +163 -0
  22. package/generated/reference/docs/evidence/evidence-standard.md +123 -0
  23. package/generated/reference/docs/evidence/research-map.md +98 -0
  24. package/generated/reference/docs/rationale.md +210 -0
  25. package/generated/reference/docs/references/pragmatic-programmer-page-index.md +113 -0
  26. package/generated/reference/docs/references/submitted-engineering-notes.md +306 -0
  27. package/generated/reference/docs/releasing-pi.md +89 -0
  28. package/generated/reference/docs/workflows/README.md +142 -0
  29. package/generated/reference/docs/workflows/corrective-debugging.md +203 -0
  30. package/generated/reference/docs/workflows/decision.md +149 -0
  31. package/generated/reference/docs/workflows/internal-improvement.md +207 -0
  32. package/generated/reference/docs/workflows/investigation.md +159 -0
  33. package/generated/reference/docs/workflows/operational-stabilization.md +185 -0
  34. package/generated/reference/docs/workflows/product-change.md +205 -0
  35. package/generated/reference/index.json +180 -0
  36. package/package.json +4 -2
  37. package/src/guidance.ts +6 -4
  38. package/src/index.ts +128 -0
  39. package/src/reference-viewer.ts +71 -0
  40. package/src/reference.ts +56 -0
@@ -0,0 +1,217 @@
1
+ # Acceptable AI Use in AHEAD
2
+
3
+ Status: binding pilot policy v0.1
4
+
5
+ ## Authority
6
+
7
+ 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 phase. A workflow phase, diagram, tool permission, or local convenience cannot broaden AI authority beyond this policy. Organization and repository policies may impose stricter controls.
8
+
9
+ If two rules appear to conflict, apply the more protective rule and record the ambiguity for correction. No exception may transfer human authorship, judgment, approval, accountability, or unscoped consequential authority to AI.
10
+
11
+ ## Purpose
12
+
13
+ AHEAD encourages substantial AI assistance while preserving human understanding, judgment, skill, and accountability. Acceptable use is determined by the role AI plays, the risk of the work, the information exposed, and the engineer's ability to verify and own the result—not simply by how many lines AI produced.
14
+
15
+ The default relationship is:
16
+
17
+ ```text
18
+ Human supplies intent, context, and an initial model
19
+ → AI retrieves, generates, compares, or challenges
20
+ → Human verifies, decides, and owns the result
21
+ ```
22
+
23
+ ## Conditions for acceptable use
24
+
25
+ An AI-assisted contribution is acceptable only when all applicable conditions hold:
26
+
27
+ 1. A human owns the problem, intended behavior, and consequences.
28
+ 2. The AI's task is bounded and appropriate to the active workflow phase.
29
+ 3. The model receives only information authorized for that provider, tool, and purpose.
30
+ 4. Claims, citations, commands, dependencies, and generated artifacts can be checked against authoritative evidence.
31
+ 5. The responsible engineer can explain, maintain, debug, test, and modify accepted code.
32
+ 6. Verification is proportionate to risk and does not rely solely on the same AI that produced the work.
33
+ 7. Material AI involvement remains visible when repository, organizational, legal, or review policy requires it.
34
+ 8. The AI has no implicit authority to approve, merge, deploy, communicate commitments, accept risk, or act in production.
35
+
36
+ ## Generally acceptable uses
37
+
38
+ ### Research and information gathering
39
+
40
+ AI may locate, organize, compare, and summarize approved internal and external sources. The engineer follows important claims to their sources and distinguishes retrieved evidence from AI synthesis.
41
+
42
+ Why: AI increases search and synthesis capacity, while NIST identifies confident false content as an inherent generative-AI risk. Summaries are navigation aids, not new authorities.
43
+
44
+ ### Boilerplate and repetitive structure
45
+
46
+ AI may generate scaffolding, serializers, routine handlers, adapters, setup code, repetitive mappings, and other bounded structure after the human identifies the intended pattern and integration boundary.
47
+
48
+ The engineer checks local conventions, error handling, dependencies, security posture, and whether generation introduced unnecessary abstraction. “Boilerplate” is not a label that makes risky code safe.
49
+
50
+ ### Disposable prototypes and full vibe coding
51
+
52
+ Full “vibe coding”-prompting AI to produce most or all of an implementation without first understanding every detail-is acceptable for a disposable prototype whose purpose is to learn quickly whether an idea is feasible or how an experience might turn out.
53
+
54
+ This exception applies only when all of these boundaries are explicit:
55
+
56
+ - the learning question and prototype status are stated before generation;
57
+ - the prototype is isolated from production systems, credentials, customer data, and consequential decisions;
58
+ - nobody relies on its correctness, security, scalability, accessibility, or maintainability;
59
+ - generated dependencies, licenses, and external content remain subject to inspection;
60
+ - the prototype has an owner, an expiration or disposal decision, and a conspicuous `PROTOTYPE — NOT FOR PRODUCTION` label;
61
+ - demonstrations disclose material limitations rather than presenting simulated behavior as validated capability;
62
+ - any code selected for retention leaves the prototype exception and enters the normal AHEAD process for human understanding, design, implementation, testing, security review, and approval.
63
+
64
+ Throwaway describes the artifact, not the evidence learned from it. Preserve useful observations, constraints, failed approaches, and decisions as durable artifacts, then discard the code. A prototype must not become production software through incremental cleanup or repeated deployment.
65
+
66
+ This is an AHEAD operating policy supported by established prototyping practice, not evidence that unrestricted vibe coding produces production-quality systems.
67
+
68
+ ### Candidate tests
69
+
70
+ AI may propose test cases, fixtures, mocks, generators, boundary values, and failure scenarios after a human defines the expected behavior, important invariants, and test oracle.
71
+
72
+ Tests are reviewed as production code. The engineer checks that they can fail, do not merely encode the current implementation, cover meaningful states and failure paths, and do not silently weaken or replace existing tests. Security-critical tests require independent human authorship or review.
73
+
74
+ Research has found that LLM support can increase generated tests and defect detection, but also test volume and false positives. Test-guided interaction can improve people's ability to evaluate generated code. These findings support AI-assisted testing with human-defined intent and independent verification—not treating passing AI-generated tests as proof.
75
+
76
+ ### First-pass review
77
+
78
+ AI may perform an additional early review for likely defects, security concerns, missing tests, plan divergence, unclear code, and relevant edge cases.
79
+
80
+ AI review never constitutes final approval. Findings are hypotheses until a human validates them. Human review remains required because empirical work links substantive review participation and expertise with quality, while current LLM reviewers exhibit systematic false-positive and conformance-judgment failures.
81
+
82
+ For a lasting engineering change, independent human review means review by a person other than the implementer. The implementer and reviewer must both understand the behavior, risks, and evidence relevant to their responsibilities. Implementer self-review and AI review do not satisfy this gate. An emergency policy may defer independent review to restore service, but the gate remains unsatisfied until a named human reviewer completes it after stabilization.
83
+
84
+ ### Refactoring proposals
85
+
86
+ AI may identify duplication, coupling, unclear names, complicated control flow, possible abstractions, or opportunities to isolate state. The human decides whether the proposed change makes the artifact simpler and verifies preserved behavior.
87
+
88
+ AI may not manufacture a justification for a refactor or substitute rearranged files for reduced conceptual complexity.
89
+
90
+ ### Documentation and communication assistance
91
+
92
+ AI may organize engineer-provided facts, edit for clarity, create an outline, derive reference documentation from verified interfaces, and draft routine sections that the named author reviews.
93
+
94
+ The human supplies and verifies the reasoning, status, decisions, commitments, uncertainty, and audience judgment. AI must not fabricate citations, test results, incident facts, user claims, approvals, or confidence. It must not make weak understanding sound authoritative.
95
+
96
+ ### Debugging support
97
+
98
+ AI may help organize evidence, explain unfamiliar mechanisms, generate competing hypotheses, identify contradicting evidence, and propose discriminating tests.
99
+
100
+ Before broad AI assistance in normal debugging, the human records at least the observed failure, evidence already checked, and an initial mental model or question. A team may use a timebox before asking AI, but the purpose is independent thought—not withholding useful tools. During incidents, AI may assist immediately once the current observation and safety constraints are established.
101
+
102
+ The human remains the investigator: selecting or authorizing tests, interpreting results, deciding whether evidence supports a conclusion, and choosing the intervention.
103
+
104
+ ### Design alternatives
105
+
106
+ After the human frames the problem and contributes an initial option, AI may broaden the option set, compare tradeoffs, find examples, expose assumptions, and argue against the favored approach.
107
+
108
+ The human-first sequence is an AHEAD policy and design hypothesis, not a proven universal optimum. Adjacent experimental evidence shows that generative-AI ideas can improve individual creative output while reducing collective diversity, giving AHEAD a reason to test this sequence rather than claim it is settled.
109
+
110
+ ### Learning and onboarding
111
+
112
+ AI may explain code, concepts, patterns, libraries, tools, and unfamiliar terminology. Prefer explanations, questions, small examples, critiques, and hints that require the learner to retrieve and apply knowledge.
113
+
114
+ When skill formation is the goal, avoid full-solution delegation. A randomized study of developers learning an unfamiliar Python library found lower mastery for the AI-assisted group overall; participants who used AI to ask conceptual questions and build comprehension did better than those who delegated the work.
115
+
116
+ ### Examples, mocks, and planning mechanics
117
+
118
+ AI may generate non-sensitive sample payloads, mock data, fixtures, command examples, ticket structure, acceptance-criteria candidates, and summaries of human-provided notes.
119
+
120
+ Generated examples are checked for realism, privacy, security, and accidental use of production identifiers. AI may organize a human first-pass plan; it may not create the reasoning and relabel it as human-authored.
121
+
122
+ ## Uses requiring heightened review
123
+
124
+ AI may assist in these areas, but it does not originate the governing policy or act without explicit human control:
125
+
126
+ - authentication, authorization, cryptography, privacy, and security controls;
127
+ - business rules, financial calculations, safety constraints, and regulated behavior;
128
+ - database schemas, migrations, destructive maintenance, and data correction;
129
+ - concurrency, distributed consistency, recovery, and idempotency;
130
+ - dependencies, generated build steps, package scripts, and supply-chain changes;
131
+ - infrastructure, CI/CD, identity, permissions, and secrets;
132
+ - production commands, remediation, deployment, rollback, or containment;
133
+ - legal, compliance, personnel, customer, or public communication;
134
+ - generated licenses, attribution, or content with unclear provenance.
135
+
136
+ These uses require a named human owner, authoritative requirements, explicit scope, risk-appropriate tests, relevant specialist review, and separately authorized effects. Critical code and its only validation should not come from one AI context.
137
+
138
+ ## Unacceptable uses
139
+
140
+ ### Submitting work the engineer does not understand
141
+
142
+ Do not accept long-lived code that its responsible engineer cannot explain, maintain, debug, test, and safely change. Passing current tests is not sufficient.
143
+
144
+ ### Outsourcing core business logic
145
+
146
+ AI may explain, challenge, review, or help test core business rules. Under AHEAD, the accountable engineer authors their implementation and traces it to human-approved requirements. This is a constitutional policy choice whose precise boundary must be refined by teams.
147
+
148
+ ### Letting AI define behavior or policy
149
+
150
+ AI is not the authority for business rules, authorization, privacy, data retention, workflow behavior, acceptable risk, or production semantics. It may retrieve an authoritative rule; it may not become that authority.
151
+
152
+ ### Blind copying or unverified execution
153
+
154
+ Do not copy generated code, commands, dependencies, citations, or configuration without inspecting their meaning and validating them in the relevant environment. Never treat confident explanation as evidence.
155
+
156
+ ### Bypassing learning
157
+
158
+ Do not use AI to avoid acquiring skills needed to oversee the resulting system. When learning is the objective, the workflow should favor explanation, retrieval, prediction, and modification over full answer generation.
159
+
160
+ ### AI-first debugging with no human observation
161
+
162
+ Do not reduce debugging to pasting an error into a model and following its first answer. Establish what was observed and what evidence exists. AI-generated hypotheses are candidates, not diagnoses.
163
+
164
+ ### Outsourcing judgment or approval
165
+
166
+ AI may not select the team's technical opinion, accept tradeoffs, waive a gate, approve a change, declare an incident recovered, or perform final engineering review.
167
+
168
+ ### Impersonating human communication
169
+
170
+ AI may help edit or structure communication, but it may not invent reasoning and present it as the named person's own understanding. Humans own PR rationales, incident updates, decisions, commitments, and explanations sent under their identity.
171
+
172
+ ### Polishing over uncertainty
173
+
174
+ Do not use AI to make incomplete evidence appear conclusive, conceal disagreement, erase caveats, or make a person sound as though they understand work they have not examined.
175
+
176
+ ### Unauthorized data or access
177
+
178
+ Do not expose secrets, credentials, personal data, confidential source, customer information, incident evidence, regulated data, or proprietary material to an unapproved model or provider. Do not assume `.gitignore` prevents an editor assistant from reading a file.
179
+
180
+ Do not give an AI agent broader filesystem, network, repository, CI, cloud, or production permissions than its bounded task requires. Repository text, issues, logs, web pages, and tool output are untrusted inputs that may attempt to redirect the agent.
181
+
182
+ ## Verification checklist
183
+
184
+ Before accepting material AI-assisted work, the responsible engineer answers:
185
+
186
+ - What did the human decide before AI involvement?
187
+ - What did the AI contribute?
188
+ - Can I explain the result without appealing to the AI's authority?
189
+ - Which facts, requirements, and sources did I independently verify?
190
+ - What tests could disprove the implementation or conclusion?
191
+ - Did the same AI create both the work and all evidence used to validate it?
192
+ - What sensitive context was shared, with which provider, under what policy?
193
+ - Did the AI introduce dependencies, licenses, commands, or external content?
194
+ - What could fail outside the examples the AI saw?
195
+ - Am I willing and authorized to own this result?
196
+
197
+ For a disposable prototype, also answer:
198
+
199
+ - What specific question is this prototype meant to answer?
200
+ - Where is it isolated, and what production access or sensitive data is excluded?
201
+ - When will it be discarded or deliberately re-enter the normal engineering workflow?
202
+
203
+ ## Evidence and sources
204
+
205
+ - [Cui et al., *The Effects of Generative AI on High-Skilled Work*](https://doi.org/10.1287/mnsc.2025.00535) — randomized field evidence that coding assistants can increase completed tasks in some organizational contexts.
206
+ - [Becker et al., *Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity*](https://arxiv.org/abs/2507.09089) — randomized evidence that the same broad category of tool can slow experienced developers in familiar repositories, despite perceived speedups.
207
+ - [Shen and Tamkin, *How AI Impacts Skill Formation*](https://arxiv.org/abs/2601.20245) — randomized study of AI assistance, code understanding, and learning an unfamiliar library.
208
+ - [Ramler et al., *Unit Testing Past vs. Present*](https://arxiv.org/abs/2502.09801) — experiment on LLM-supported unit testing, defect detection, and false positives.
209
+ - [Fakhoury et al., *LLM-Based Test-Driven Interactive Code Generation*](https://www.microsoft.com/en-us/research/publication/llm-based-test-driven-interactive-code-generation-user-study-and-empirical-evaluation/) — user study and evaluation of test-guided intent clarification.
210
+ - [Jin and Chen, *Are LLMs Reliable Code Reviewers?*](https://arxiv.org/abs/2603.00539) — evidence of systematic overcorrection in LLM requirement-conformance review.
211
+ - [Doshi and Hauser, *Generative AI enhances individual creativity but reduces the collective diversity of novel content*](https://doi.org/10.1126/sciadv.adn5290) — adjacent experimental evidence relevant to AI anchoring and option diversity.
212
+ - [Bjarnason, Lang, and Mjöberg, *An empirically based model of software prototyping*](https://doi.org/10.1007/s10664-023-10331-w) — a systematic mapping study and multi-company study of prototypes used to explore and validate feasibility, desirability, usability, and requirements.
213
+ - [NIST AI 600-1, *Generative Artificial Intelligence Profile*](https://doi.org/10.6028/NIST.AI.600-1) — authoritative risk guidance on confabulation, privacy, provenance, testing, and governance.
214
+ - [NIST DevSecOps reference model: Artificial Intelligence](https://pages.nist.gov/nccoe-devsecops/notational-reference-model.html#artificial-intelligence) — human validation and verifiable-process guidance for AI-augmented software development.
215
+ - [OWASP Secure Coding with AI Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Secure_Coding_with_AI_Cheat_Sheet.html) — practitioner security guidance for sensitive context, agent permissions, generated tests, supply chains, and CI/CD.
216
+
217
+ The [research map](evidence/research-map.md) classifies these sources and records their limitations. Exact boundaries such as “core business logic” and the human-first debugging checkpoint remain AHEAD policy choices that should be tested and refined.
@@ -0,0 +1,119 @@
1
+ # Debugging and Operational Investigation
2
+
3
+ Status: design discussion, not an approved workflow specification
4
+
5
+ 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 and unresolved questions behind them.
6
+
7
+ ## Human ownership
8
+
9
+ Debugging is human-owned. AI may help collect and organize evidence, suggest hypotheses and tests, identify contradictions, explain systems, and challenge conclusions. The human chooses what to investigate, performs or authorizes tests, interprets the evidence, selects interventions, and accepts the conclusion or remaining uncertainty.
10
+
11
+ There is no “AI investigation” phase. Investigation is a human engineering activity in which AI may participate.
12
+
13
+ ## Shared reasoning loop
14
+
15
+ ```text
16
+ Observation
17
+ → Characterize
18
+ → Build or update the mental model
19
+ → Generate hypotheses
20
+ → Human selects a discriminating test
21
+ → Predict expected results
22
+ → Run the test
23
+ → Record evidence
24
+ → Update or refute hypotheses
25
+ → Repeat
26
+ ```
27
+
28
+ The process distinguishes:
29
+
30
+ - **Fact:** directly observed and linked to evidence.
31
+ - **Inference:** an interpretation derived from facts.
32
+ - **Hypothesis:** a falsifiable proposed explanation.
33
+ - **Test:** an experiment or observation capable of changing confidence in a hypothesis.
34
+ - **Result:** what the test actually produced.
35
+ - **Conclusion:** a human-accepted explanation with confidence, limits, and remaining uncertainty.
36
+
37
+ Predictions should be recorded before a test when practical. This reduces hindsight interpretation of ambiguous results.
38
+
39
+ ## Bug debugging
40
+
41
+ A bug is a defect where observed software behavior conflicts with intended behavior.
42
+
43
+ ```text
44
+ Observe → Reproduce or establish
45
+ → Characterize
46
+ → Human-led investigation loop
47
+ → Human accepts diagnosis or uncertainty
48
+ → Choose fix → Plan → Implement → Validate locally
49
+ → AI review → Independent human review
50
+ → Human-authorized deploy or release when applicable
51
+ → Verify the original failure and observe the outcome
52
+ → Audit assumptions → Human outcome
53
+ ```
54
+
55
+ Reproduction is valuable but not universally required. A failure may be intermittent, historical, production-only, environment-specific, or already mitigated.
56
+
57
+ ## Operational investigation
58
+
59
+ An operational issue is undesirable system behavior that may not be a software defect. Examples include reconciliation storms, configuration drift, capacity exhaustion, cloud-provider behavior, dependency failures, identity or certificate failures, resource contention, bad rollout sequencing, and emergent controller interactions.
60
+
61
+ ```text
62
+ Observed condition
63
+ → Desired state versus actual state
64
+ → Impact and scope
65
+ → Timeline
66
+ → System and control-loop model
67
+ → Recent changes and external events
68
+ → Evidence/hypothesis/test loop
69
+ → Intervention decision
70
+ → Verify convergence and user-visible behavior
71
+ → Monitor recurrence
72
+ → Corrective actions
73
+ ```
74
+
75
+ The initial cause classification must remain tentative. Labeling an issue a code bug, configuration error, or provider failure before collecting evidence can bias the investigation.
76
+
77
+ ## Incident mode
78
+
79
+ “Incident” describes impact and urgency rather than cause. An incident may be caused by a bug, configuration, capacity, provider behavior, a security event, data, or an interaction that remains partially unexplained.
80
+
81
+ Incident mode adds parallel concerns:
82
+
83
+ ```text
84
+ Response: assess impact → contain → recover → monitor
85
+ Investigation: evidence → model → hypotheses → tests → conclusion
86
+ Coordination: ownership → decisions → communications → timeline
87
+ ```
88
+
89
+ Mitigation and recovery must not be blocked on completing a full diagnosis. Risky interventions still require explicit human authorization. After recovery, unresolved causal analysis and prevention work may continue as a linked bug, operational investigation, security issue, or technical-debt item.
90
+
91
+ ## Current design direction
92
+
93
+ - Treat bug debugging and operational investigation as separate work types.
94
+ - Treat incident mode as an overlay that may apply to several work types.
95
+ - Keep the evidence and hypothesis loop flexible rather than gating every iteration.
96
+ - Reserve hard gates for human accountability, risky tests, consequential interventions, accepted conclusions, implementation plans, reviews, and verified outcomes.
97
+ - Distinguish hypothesis testing, fix validation, and post-deployment outcome verification.
98
+ - Allow causal conclusions to include a failure mechanism, trigger, enabling conditions, and detection or containment gaps instead of insisting on one root cause.
99
+
100
+ ## Open questions
101
+
102
+ - What minimum evidence is needed before a human may accept a diagnosis?
103
+ - When may a team remediate while explicitly accepting that the cause is unknown?
104
+ - Which tests require approval based on environment, reversibility, or blast radius?
105
+ - How should AHEAD represent multiple interacting causes and confidence changes?
106
+ - When does an operational anomaly become incident mode?
107
+ - Which incident records must be produced during response, and which may be reconstructed afterward?
108
+ - How should follow-up work remain linked without keeping the incident itself permanently open?
109
+
110
+ ## Evidence basis
111
+
112
+ The current reasoning loop is supported by direct empirical software-engineering research, though the exact AHEAD recording requirements are not yet validated:
113
+
114
+ - [Li and Coblenz, *A Grounded Theory of Debugging in Professional Software Engineering Practice*](https://arxiv.org/abs/2602.11435) observed professional developers and describes debugging as iterative mental-model construction that guides information gathering.
115
+ - [Alaboudi and LaToza, *Using Hypotheses as a Debugging Aid*](https://doi.org/10.1109/VL/HCC50065.2020.9127273) found that early correct hypotheses predicted success and that supplying potential hypotheses helped more than supplying fault locations in their controlled experiment.
116
+ - [Sillito and Kutomi, *Failures and Fixes*](https://doi.org/10.1109/ICSME46990.2020.00027) analyzed 30 incidents and identified distinct investigative and mitigative strategies.
117
+ - [Ghosh et al., *How to Fight Production Incidents?*](https://doi.org/10.1145/3542929.3563482) studied hundreds of high-severity cloud incidents, including non-code causes, across detection, diagnosis, and mitigation.
118
+
119
+ These studies support the shape of the process. They do not prove that requiring engineers to record every fact, hypothesis, or test improves results. AHEAD must test the minimum useful structure and remove requirements that interrupt investigation without improving reasoning, handoff, or learning.
@@ -0,0 +1,110 @@
1
+ # Executable AHEAD Workflows
2
+
3
+ Status: initial vertical slice v0.1
4
+
5
+ ## Purpose
6
+
7
+ 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.
8
+
9
+ The first vertical slice implements the Product Change workflow. The other five pilot workflows remain manual profiles until dogfooding provides evidence about the reusable state model.
10
+
11
+ ## Architecture
12
+
13
+ ```text
14
+ CONSTITUTION / ACCEPTABLE-AI-USE
15
+
16
+
17
+ CANONICAL WORKFLOW SPEC + POLICY FRAGMENTS
18
+
19
+ ┌────────┴────────┐
20
+ ▼ ▼
21
+ RUST WORKFLOW CORE GENERATED INSTRUCTIONS
22
+ │ │
23
+ └────────┬────────┘
24
+
25
+ INTEGRATION ADAPTER
26
+ (Pi first; others later)
27
+
28
+ ┌────────┴─────────┐
29
+ ▼ ▼
30
+ HOST TOOLS / MODEL DURABLE RUN FILES
31
+ ```
32
+
33
+ The Rust core owns workflow semantics. It is deterministic and has no filesystem, network, clock, model-provider, or editor dependency. Hosts supply identity and timestamps, persist returned runs, and map their tools to canonical capabilities.
34
+
35
+ The initial WebAssembly boundary is a small versioned JSON ABI. This avoids coupling the core to one JavaScript binding generator and lets a later editor or CI integration load the same state machine.
36
+
37
+ ## Sources of truth
38
+
39
+ | Concern | Canonical source |
40
+ |---|---|
41
+ | Durable principles | `CONSTITUTION.md` |
42
+ | AI authority | `docs/acceptable-ai-use.md` |
43
+ | Human-readable Product Change flow | `docs/workflows/product-change.md` |
44
+ | Executable phases, artifacts, gates, transitions, and capabilities | `spec/workflows/product-change-v0.1.json` |
45
+ | Compact binding agent profile and shared AI behavior | `policy/common.md` |
46
+ | Phase AI behavior | `policy/product-change/*.md` |
47
+ | State transition enforcement | `crates/ahead-core` |
48
+ | Host mapping, storage, and UI | `integrations/pi` |
49
+
50
+ Generated integration instructions are build artifacts. They include the compact agent profile, active phase policy, enforced contract, workflow version, and a source hash and must not be edited directly.
51
+
52
+ The Pi package also copies the canonical Constitution and `docs/**/*.md` into a generated reference catalog. These full documents are not injected into every prompt. The adapter recommends references applicable to the active phase, lets humans read them through `/ahead-guide`, and lets AI retrieve a specific source through `ahead_get_reference`. This keeps the binding prompt small while making the framework, rationale, evidence, and original page-level provenance available on demand.
53
+
54
+ ## State and evidence
55
+
56
+ A run is an append-only event log. Events record an actor kind and identity, host-supplied timestamp, sequence, and one action:
57
+
58
+ - start the run;
59
+ - record an artifact;
60
+ - accept a human gate;
61
+ - advance or return between phases;
62
+ - close the run.
63
+
64
+ State is derived by replay. The core rejects invalid history rather than trusting a cached phase field. A return transition creates a new visit to the target phase. Earlier evidence remains in history, but only evidence recorded during the current visit satisfies its gate.
65
+
66
+ Pi stores state under the work's Git root:
67
+
68
+ ```text
69
+ .ahead/
70
+ ├── current.json
71
+ └── runs/
72
+ └── <run-id>/
73
+ ├── run.json
74
+ └── artifacts/
75
+ └── <sequence>-<phase>-<kind>.md
76
+ ```
77
+
78
+ These are intended to be inspectable, diffable repository artifacts. A team can decide which records belong in Git, while CI and GitHub enforcement are later adapters over the same run contract.
79
+
80
+ ## Enforced boundaries in v0.1
81
+
82
+ - Only a human actor can start a run, accept a gate, transition a phase, return work, or close a run.
83
+ - Artifact definitions state whether a human, AI, or either may record them.
84
+ - Human-first option and plan artifacts unlock AI assistance in those phases.
85
+ - Required current-visit artifacts must exist before gate acceptance.
86
+ - Advancement requires the current human gate.
87
+ - Independent human review must be recorded by an identity other than the latest changeset implementer, and that reviewer must accept the review gate.
88
+ - The Product Change flow distinguishes implementation, deployment, observation, audit, and human outcome.
89
+ - Model-invoked host tools require an explicit adapter mapping to an allowed canonical capability.
90
+
91
+ Instructions explain these boundaries to the model. The Rust core enforces the transition, actor, artifact, identity, and capability decisions even if instructions are ignored.
92
+
93
+ During implementation, instructions explicitly permit questions, explanation, debugging help, and bounded suggestions while keeping the engineer first. If the engineer has not supplied a current model, attempted approach, or intended behavior, AI asks for it before proposing a solution. A request for help does not authorize AI to take over the implementation.
94
+
95
+ ## Trust boundaries and limits
96
+
97
+ The Pi adapter is an engineering workflow control, not a security sandbox.
98
+
99
+ - Local human identity comes from `AHEAD_HUMAN_IDENTITY`, then Git email/name, then the local user. It is self-attested. GitHub review identity and protected-branch rules will provide a stronger boundary later.
100
+ - Pi's direct `!` shell is a human action and is not intercepted. Model-invoked `bash` is intercepted.
101
+ - Unknown model tools are denied until the adapter classifies them. This prevents a newly installed effectful tool from silently acquiring authority.
102
+ - Artifact and run writes are atomic, but v0.1 has no multi-process lock. One writer should operate a run at a time.
103
+ - Workflow files can prove that a named action was recorded, not that a person genuinely understood it. Human review and organizational accountability remain necessary.
104
+ - No GitHub checks, PR gates, migration engine, signature scheme, or backwards-compatible workflow upgrade exists yet.
105
+
106
+ ## Reuse path
107
+
108
+ The reusable boundary is the engine API, not a CLI. Pi is the first adapter. A VS Code extension, GitHub check, or future WASM-capable editor can reuse the same compiled core and canonical fragments while providing its own UI, storage transport, identity strength, and tool-capability map.
109
+
110
+ Dogfooding should test whether phase visits, artifacts, gates, returns, capability vocabulary, and identity rules generalize before the remaining five workflow profiles are encoded.
@@ -0,0 +1,144 @@
1
+ # AHEAD Process Taxonomy
2
+
3
+ Status: proposed design
4
+ Last reviewed: 2026-08-12
5
+
6
+ ## Why classify by outcome
7
+
8
+ 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.
9
+
10
+ The primary workflow should be selected by the **dominant outcome** the human is trying to produce. Variants and overlays then adapt that workflow to context.
11
+
12
+ This gives AHEAD six proposed process families. All six now have minimal [pilot workflow profiles](../workflows/README.md) for use and evaluation; that does not yet validate the taxonomy or justify automated enforcement.
13
+
14
+ ## The six process families
15
+
16
+ | Process family | Dominant question | Terminal outcome | Examples | Status |
17
+ |---|---|---|---|---|
18
+ | 1. [Product change](../workflows/product-change.md) | What behavior or capability should exist, and how should we deliver it? | Verified intended behavior | Feature, API change, integration, migration, dependency adaptation, decommission | Pilot v0.1 |
19
+ | 2. [Corrective debugging](../workflows/corrective-debugging.md) | Why does observed behavior differ from intended behavior, and how should we correct it? | Verified correction or explicitly accepted uncertainty | Deterministic bug, flaky failure, regression, incorrect data processing | Pilot v0.1 |
20
+ | 3. [Operational stabilization](../workflows/operational-stabilization.md) | Why is a live system outside an acceptable operating state, and how do we restore and stabilize it? | Demonstrated recovery/convergence and follow-up disposition | Reconciliation storm, capacity exhaustion, configuration drift, dependency outage | Pilot v0.1 |
21
+ | 4. [Decision](../workflows/decision.md) | Which course should humans choose, given goals, evidence, constraints, and tradeoffs? | Approved decision and rationale | Architecture decision, buy/build, technology selection, policy or platform choice | Pilot v0.1 |
22
+ | 5. [Investigation](../workflows/investigation.md) | What is true, feasible, or likely when no intervention has yet been selected? | Bounded conclusion, confidence, evidence, and remaining unknowns | Technical spike, feasibility study, causal follow-up, capacity study, vendor evaluation | Pilot v0.1 |
23
+ | 6. [Internal improvement](../workflows/internal-improvement.md) | How can we improve system qualities while preserving an explicit behavioral contract? | Verified invariants plus improved target qualities | Refactor, preventive maintenance, maintainability debt, performance optimization without semantic change | Pilot v0.1 |
24
+
25
+ Six is a working taxonomy, not a sacred number. The threshold for adding a seventh family is deliberately high.
26
+
27
+ ## Selection test
28
+
29
+ ```text
30
+ Is the primary outcome new or changed externally meaningful behavior?
31
+ → Product change
32
+
33
+ Is an observed behavior wrong and the main work is causal diagnosis plus correction?
34
+ → Corrective debugging
35
+
36
+ Is a live system unhealthy, unstable, or failing to converge, with restoration as the immediate outcome?
37
+ → Operational stabilization
38
+
39
+ Is the deliverable an accountable choice among alternatives?
40
+ → Decision
41
+
42
+ Is the deliverable knowledge or reduced uncertainty, without a predetermined change?
43
+ → Investigation
44
+
45
+ Must behavior remain invariant while internal qualities improve?
46
+ → Internal improvement
47
+ ```
48
+
49
+ A large effort may link several runs. An architecture decision can lead to a product change. An incident can create an operational investigation, a corrective bug, and an internal-improvement follow-up. A technical spike can end in a decision without pretending that knowledge production and option selection are the same activity.
50
+
51
+ ## Why the additional three differ
52
+
53
+ ### Decision
54
+
55
+ A feature includes decisions, but some engineering work ends with a decision rather than code. Its quality depends on framing, option coverage, evidence, tradeoffs, consequences, reversibility, and accountable approval. Forcing it through implementation and deployment creates meaningless states.
56
+
57
+ ### Investigation
58
+
59
+ An investigation begins with a question, not an assumed defect or desired change. It may conclude that no action is needed, evidence is insufficient, a vendor owns the behavior, or several interventions remain viable. Its terminal quality is epistemic: evidence, confidence, limitations, and unknowns.
60
+
61
+ ### Internal improvement
62
+
63
+ Refactoring and preventive work are judged differently from feature work. They begin by specifying invariants and target qualities. Success means that required behavior was preserved while maintainability, performance, safety, comprehensibility, or another quality improved. Treating this as a feature encourages invented product outcomes; treating it as a bug assumes a failure that may not exist.
64
+
65
+ ## Overlays, not primary processes
66
+
67
+ ### Incident mode
68
+
69
+ Incident mode represents urgency, impact, coordination, containment, communication, and recovery. It can overlay corrective debugging, operational stabilization, a security event, or a data issue. It relaxes nonessential documentation during response but strengthens action authorization and decision logging.
70
+
71
+ ### Security
72
+
73
+ Security adds confidentiality, evidence preservation, threat modeling, restricted AI access, disclosure, and security approval. A vulnerability may use corrective debugging; proactive hardening may use internal improvement; an active compromise may use incident-mode operational stabilization; a threat assessment may use investigation.
74
+
75
+ ### Safety, regulatory, and compliance
76
+
77
+ These overlays strengthen traceability, independence, evidence retention, required reviewers, and non-waivable gates. They do not change whether the underlying work is a change, correction, operation, decision, investigation, or improvement.
78
+
79
+ ### Emergency
80
+
81
+ Emergency handling changes sequencing and permits explicitly governed deferrals. It does not erase human accountability or evidence requirements; it moves some reconstruction and learning after stabilization.
82
+
83
+ ## Labels and modifiers
84
+
85
+ Context belongs in typed modifiers rather than new workflow definitions:
86
+
87
+ ```yaml
88
+ process: operational-stabilization
89
+ urgency: incident
90
+ domain: infrastructure
91
+ assurance: standard
92
+ failure_character: intermittent
93
+ environment: production
94
+ data_classification: internal
95
+ ```
96
+
97
+ Useful modifiers may include:
98
+
99
+ - urgency: normal, expedited, incident, emergency;
100
+ - assurance: standard, security, safety-critical, regulated;
101
+ - environment: local, test, staging, production, external provider;
102
+ - failure character: deterministic, intermittent, performance, data, distributed, unknown;
103
+ - change character: additive, adaptive, migration, retirement;
104
+ - reversibility and blast radius;
105
+ - evidence sensitivity.
106
+
107
+ ## Where common work maps
108
+
109
+ | Work label | Primary process or routing rule |
110
+ |---|---|
111
+ | Feature | Product change |
112
+ | Bug | Corrective debugging |
113
+ | Production reconciliation storm | Operational stabilization; add incident mode when impact/urgency warrants it |
114
+ | Architecture decision | Decision; link resulting implementation separately |
115
+ | Technical debt | Internal improvement when preserving behavior; product change when behavior changes; corrective debugging when it represents a known defect |
116
+ | Refactor | Internal improvement |
117
+ | Performance regression | Corrective debugging |
118
+ | Proactive performance optimization | Internal improvement or product change, depending on whether performance is a new product outcome |
119
+ | Security vulnerability | Corrective debugging plus security overlay |
120
+ | Active security compromise | Operational stabilization plus incident and security overlays |
121
+ | Security hardening | Internal improvement or product change plus security overlay |
122
+ | Research spike | Investigation |
123
+ | Compliance audit | Investigation plus compliance overlay; corrective or improvement runs handle findings |
124
+ | Dependency or platform upgrade | Product change with adaptive-change modifier |
125
+ | Service retirement | Product change with retirement and risk modifiers |
126
+
127
+ ## Test for adding another family
128
+
129
+ A new primary process family should be added only when all of these are true:
130
+
131
+ 1. It has a distinct terminal outcome.
132
+ 2. It has a distinct central reasoning loop.
133
+ 3. It requires materially different human decisions or gates.
134
+ 4. It cannot be represented clearly as a variant, overlay, modifier, or linked combination of existing families.
135
+ 5. Evidence or repeated practice shows that using an existing family creates confusion, unsafe behavior, or process theater.
136
+ 6. The additional cognitive and tooling cost is justified.
137
+
138
+ ## Evidence basis and limits
139
+
140
+ [ISO/IEC/IEEE 12207:2026](https://standards.ieee.org/ieee/12207/11416/) covers development, operation, maintenance, support, and retirement and allows processes to operate concurrently, iteratively, and recursively. [ISO/IEC/IEEE 14764:2022](https://www.iso.org/standard/80710.html) separately establishes software-maintenance types. These standards support broad coverage and composition, but they do not validate this six-family taxonomy.
141
+
142
+ Empirical debugging research supports a mental-model and hypothesis-testing process distinct from planned change. Empirical production-incident research distinguishes code and non-code causes and separates detection, investigation, and mitigation. Those findings support keeping corrective debugging and operational stabilization separate.
143
+
144
+ The proposed six-family classification itself remains an AHEAD design hypothesis. The pilot profiles should be tested against a diverse sample of real engineering work by asking whether teams can route work consistently, whether important states or gates differ, which records improve reasoning or handoff, and whether any family is rarely used or routinely misclassified.