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.
- package/README.md +16 -41
- package/dist/ahead_wasm.wasm +0 -0
- package/generated/reference/CONSTITUTION.md +2 -0
- package/generated/reference/docs/evidence/README.md +17 -0
- package/generated/reference/docs/evidence/evidence-standard.md +2 -0
- package/generated/reference/docs/evidence/research-map.md +2 -0
- package/generated/reference/docs/{references → evidence/sources}/pragmatic-programmer-page-index.md +3 -1
- package/generated/reference/docs/{references → evidence/sources}/submitted-engineering-notes.md +3 -1
- package/generated/reference/docs/guide/README.md +28 -0
- package/generated/reference/docs/{acceptable-ai-use.md → guide/acceptable-ai-use.md} +4 -2
- package/generated/reference/docs/{engineering-practice.md → guide/engineering-practice.md} +5 -3
- package/generated/reference/docs/{rationale.md → guide/rationale.md} +3 -1
- package/generated/reference/docs/{recommended-skills.md → guide/recommended-skills.md} +2 -0
- package/generated/reference/docs/{workflows → guide/workflows}/README.md +3 -1
- package/generated/reference/docs/{workflows → guide/workflows}/corrective-debugging.md +2 -0
- package/generated/reference/docs/{workflows → guide/workflows}/decision.md +2 -0
- package/generated/reference/docs/{workflows → guide/workflows}/internal-improvement.md +2 -0
- package/generated/reference/docs/{workflows → guide/workflows}/investigation.md +2 -0
- package/generated/reference/docs/{workflows → guide/workflows}/operational-stabilization.md +2 -0
- package/generated/reference/docs/{workflows → guide/workflows}/product-change.md +2 -0
- package/generated/reference/index.json +127 -132
- package/package.json +1 -1
- package/src/engine.ts +1 -1
- package/src/guidance.ts +3 -7
- package/src/index.ts +255 -20
- package/src/reference.ts +12 -1
- package/src/storage.ts +63 -3
- package/generated/reference/docs/design/adapted-skill-guidance.md +0 -27
- package/generated/reference/docs/design/debugging-and-operations.md +0 -119
- package/generated/reference/docs/design/executable-workflows.md +0 -122
- package/generated/reference/docs/design/instruction-authoring.md +0 -28
- package/generated/reference/docs/design/process-taxonomy.md +0 -144
- package/generated/reference/docs/design/review-workbench.md +0 -37
- package/generated/reference/docs/releasing-pi.md +0 -89
|
@@ -1,119 +0,0 @@
|
|
|
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.
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
# Executable AHEAD Workflows
|
|
2
|
-
|
|
3
|
-
Status: six-flow executable dogfood 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 executable layer implements all six pilot workflows. They share a versioned event model and enforcement engine while retaining workflow-specific phases, artifacts, gates, returns, AI capabilities, and generated instructions.
|
|
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 flows | `docs/workflows/*.md` |
|
|
44
|
-
| Current executable phases, artifacts, gates, transitions, and capabilities | `spec/workflows/*.json` |
|
|
45
|
-
| Published historical workflow definitions retained for replay | `spec/workflows/legacy/*.json` |
|
|
46
|
-
| Compact binding agent profile and shared AI behavior | `policy/common.md` |
|
|
47
|
-
| Phase AI behavior | `policy/<workflow>/*.md` with shared engineering-tail fragments in `policy/shared/*.md` |
|
|
48
|
-
| Reusable phase practices | `policy/methods/*.md`, selected by `policy/methods/index.json` |
|
|
49
|
-
| Reviewed optional skills | `recommendations/skills-v0.1.json` |
|
|
50
|
-
| State transition enforcement | `crates/ahead-core` |
|
|
51
|
-
| Host mapping, storage, and UI | `integrations/pi` |
|
|
52
|
-
|
|
53
|
-
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.
|
|
54
|
-
|
|
55
|
-
The engine retains published historical workflow definitions for replay while new runs use the current definition. Product Change `0.1.0` remains embedded for existing runs; the review and audit disposition contract is Product Change `0.2.0`. A run is always replayed against the version recorded when it started rather than silently reinterpreted under the newest workflow.
|
|
56
|
-
|
|
57
|
-
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.
|
|
58
|
-
|
|
59
|
-
## State and evidence
|
|
60
|
-
|
|
61
|
-
A run is an append-only event log. Events record an actor kind and identity, host-supplied timestamp, sequence, and one action:
|
|
62
|
-
|
|
63
|
-
- start the run;
|
|
64
|
-
- record an artifact;
|
|
65
|
-
- accept a human gate;
|
|
66
|
-
- advance or return between phases;
|
|
67
|
-
- close the run.
|
|
68
|
-
|
|
69
|
-
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.
|
|
70
|
-
|
|
71
|
-
Pi stores state under the work's Git root:
|
|
72
|
-
|
|
73
|
-
```text
|
|
74
|
-
.ahead/
|
|
75
|
-
├── current.json
|
|
76
|
-
└── runs/
|
|
77
|
-
└── <run-id>/
|
|
78
|
-
├── run.json
|
|
79
|
-
└── artifacts/
|
|
80
|
-
└── <sequence>-<phase>-<kind>.md
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
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.
|
|
84
|
-
|
|
85
|
-
## Enforced boundaries in v0.1
|
|
86
|
-
|
|
87
|
-
- Only a human actor can start a run, accept a gate, transition a phase, return work, or close a run.
|
|
88
|
-
- Artifact definitions state whether a human, AI, or either may record them.
|
|
89
|
-
- Workflow-specific human-first artifacts unlock AI assistance only after the human's initial model, option, plan, baseline, or other required reasoning exists.
|
|
90
|
-
- Required current-visit artifacts must exist before gate acceptance.
|
|
91
|
-
- Advancement requires the current human gate.
|
|
92
|
-
- Independent human review must be recorded by an identity other than the latest changeset implementer, and that reviewer must accept the review gate.
|
|
93
|
-
- Lasting-change flows distinguish implementation, AI review, independent human review, deployment, observation, audit, and human outcome.
|
|
94
|
-
- AI review is bound to a fingerprint of the exact current engineering changeset. The implementing human records a separate disposition for every material AI finding before independent human review.
|
|
95
|
-
- AI-audit findings and their human disposition are separate required records, and the human disposer personally accepts the audit gate.
|
|
96
|
-
- Operational Stabilization permits investigation and recovery work to proceed without proven root cause, but never grants AI the `execute` capability for the intervention or its execution phase.
|
|
97
|
-
- Decision and Investigation close with human-owned records and do not silently authorize downstream implementation.
|
|
98
|
-
- Model-invoked host tools require an explicit adapter mapping to an allowed canonical capability.
|
|
99
|
-
|
|
100
|
-
Instructions explain these boundaries to the model. The Rust core enforces the transition, actor, artifact, identity, and capability decisions even if instructions are ignored.
|
|
101
|
-
|
|
102
|
-
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.
|
|
103
|
-
|
|
104
|
-
## Trust boundaries and limits
|
|
105
|
-
|
|
106
|
-
The Pi adapter is an engineering workflow control, not a security sandbox.
|
|
107
|
-
|
|
108
|
-
- 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.
|
|
109
|
-
- Pi's direct `!` shell is a human action and is not intercepted. Model-invoked `bash` is intercepted.
|
|
110
|
-
- Unknown model tools are denied until the adapter classifies them. This prevents a newly installed effectful tool from silently acquiring authority.
|
|
111
|
-
- Artifact and run writes are atomic, but v0.1 has no multi-process lock. One writer should operate a run at a time.
|
|
112
|
-
- Workflow files can prove that a named action was recorded, not that a person genuinely understood it. Human review and organizational accountability remain necessary.
|
|
113
|
-
- No GitHub checks, PR gates, migration engine, signature scheme, or backwards-compatible workflow upgrade exists yet.
|
|
114
|
-
- Local review fingerprints detect changes but are not signatures. A future GitHub adapter must add remote identity and protected-branch evidence rather than treating the local record as cryptographic proof.
|
|
115
|
-
|
|
116
|
-
## Reuse path
|
|
117
|
-
|
|
118
|
-
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.
|
|
119
|
-
|
|
120
|
-
Review presentation follows the same rule. The core requires snapshot-bound findings, dispositions, and review gates; a host maps portable paths and locations to a terminal viewer, VS Code diff/comment UI, or GitHub review API. See `docs/design/review-workbench.md`.
|
|
121
|
-
|
|
122
|
-
Dogfooding should test whether the six encoded flows route real work correctly, whether their records and gates earn their cost, and whether phase visits, returns, capability vocabulary, and identity rules generalize across integrations.
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# Instruction Authoring
|
|
2
|
-
|
|
3
|
-
Status: initial authoring standard v0.1
|
|
4
|
-
|
|
5
|
-
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.
|
|
6
|
-
|
|
7
|
-
## Progressive disclosure
|
|
8
|
-
|
|
9
|
-
Use three layers:
|
|
10
|
-
|
|
11
|
-
1. The active profile supplies the binding human/AI authority boundary and live workflow state.
|
|
12
|
-
2. The generator adds the workflow phase fragment and only the method overlays mapped to that phase in `policy/methods/index.json`.
|
|
13
|
-
3. Humans and AI retrieve full framework Markdown on demand through the host integration.
|
|
14
|
-
|
|
15
|
-
The canonical workflow spec owns phases, artifacts, gates, transitions, and capabilities. Phase policies own local AI behavior. Method overlays own reusable practices such as evidence handling or debugging. Full documents explain why. Do not restate one rule in every layer.
|
|
16
|
-
|
|
17
|
-
## Authoring rules
|
|
18
|
-
|
|
19
|
-
- State the desired observable behavior in direct, positive language.
|
|
20
|
-
- Put human ownership and prohibited transfers of authority where a model cannot mistake them for suggestions.
|
|
21
|
-
- Give checkable completion criteria: an exact artifact, observation, identifier, or gate condition.
|
|
22
|
-
- Point to the canonical source instead of copying large passages.
|
|
23
|
-
- Keep host-specific UI out of core workflow semantics.
|
|
24
|
-
- Do not cache repository facts that tools can discover cheaply and reliably.
|
|
25
|
-
- Use examples to clarify a schema, not to narrow judgment to the example.
|
|
26
|
-
- Treat generated instructions as build artifacts and test the generated output for required boundaries.
|
|
27
|
-
|
|
28
|
-
The build fails when a method overlay names an unknown workflow or phase. Adding a method therefore requires its source fragment, an explicit mapping, generated-output coverage, and documentation when it changes user-visible expectations.
|
|
@@ -1,144 +0,0 @@
|
|
|
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.
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# Review Workbench
|
|
2
|
-
|
|
3
|
-
Status: Pi host v0.1; editor-neutral contract v0.1
|
|
4
|
-
|
|
5
|
-
## Purpose
|
|
6
|
-
|
|
7
|
-
The review workbench makes the handoff from implementation to independent human review explicit and inspectable:
|
|
8
|
-
|
|
9
|
-
```text
|
|
10
|
-
HUMAN IMPLEMENTS AND SELF-CHECKS
|
|
11
|
-
│
|
|
12
|
-
▼
|
|
13
|
-
CAPTURE EXACT CHANGESET FINGERPRINT
|
|
14
|
-
│
|
|
15
|
-
▼
|
|
16
|
-
AI REVIEWS WITHOUT MODIFYING
|
|
17
|
-
│
|
|
18
|
-
▼
|
|
19
|
-
HUMAN DISPOSITIONS EACH MATERIAL FINDING
|
|
20
|
-
│
|
|
21
|
-
▼
|
|
22
|
-
INDEPENDENT HUMAN REVIEWS CURRENT SNAPSHOT
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
The adapter computes a fingerprint from the selected base and merge base, HEAD, engineering working-tree status, tracked diff, and hashes of untracked files. `.ahead/**` records are excluded so recording the review does not invalidate the engineering snapshot. AI and human review artifacts must carry `AHEAD-Review-Snapshot: <fingerprint>`. If the engineering changeset changes, the fingerprint changes and the review must be repeated.
|
|
26
|
-
|
|
27
|
-
## Portable contract
|
|
28
|
-
|
|
29
|
-
`integrations/pi/src/review.ts` defines host-neutral snapshot and source-location data plus a small `ReviewHost` boundary. Core workflow semantics require the AI findings, implementing-human disposition, and independent-human review; they do not require a terminal, VS Code, GitHub, or a particular comment API.
|
|
30
|
-
|
|
31
|
-
Pi is the first host. `/ahead-review` can show the snapshot and diff in the terminal, open a changed path in detected VS Code or `AHEAD_EDITOR=vscode`, request the AI review, and open the correct human record. A future VS Code adapter can map the same locations to native diffs and comments. A GitHub adapter can publish selected findings and verify protected-branch identities without changing the workflow contract.
|
|
32
|
-
|
|
33
|
-
## Finding and disposition shape
|
|
34
|
-
|
|
35
|
-
AI findings use stable `AR-001` identifiers and include severity, category, precise location, evidence, impact, and a falsifiable explanation. They are hypotheses. The implementing human separately marks every material finding `fixed`, `invalid`, `accepted-risk`, or `follow-up` and records rationale and evidence. An independent human then reviews the current snapshot and makes the final engineering judgment.
|
|
36
|
-
|
|
37
|
-
The workbench does not post comments, push branches, mark a pull request ready, or approve a pull request automatically. Those are explicit future host effects governed by human authorization and stronger remote identity.
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# Releasing the Pi Extension
|
|
2
|
-
|
|
3
|
-
Status: publishing path v0.1
|
|
4
|
-
|
|
5
|
-
## Contract
|
|
6
|
-
|
|
7
|
-
- npm package: `ahead-pi`
|
|
8
|
-
- package source: `integrations/pi`
|
|
9
|
-
- release workflow: `.github/workflows/publish-pi.yml`
|
|
10
|
-
- release tag: `pi-v<package-version>`
|
|
11
|
-
- stable npm dist-tag: `latest`
|
|
12
|
-
- prerelease npm dist-tag: `next`
|
|
13
|
-
- registry: `https://registry.npmjs.org`
|
|
14
|
-
|
|
15
|
-
The package name was unclaimed when this path was created. Availability is not ownership until the first version is published.
|
|
16
|
-
|
|
17
|
-
## Human release gate
|
|
18
|
-
|
|
19
|
-
Publishing is triggered only by publishing a GitHub Release whose tag starts with `pi-v`. The workflow rejects a tag that does not exactly match `integrations/pi/package.json`, rejects a release commit that is not contained in `main`, rebuilds from source, runs the complete test and packed-install smoke suite, and then publishes with npm provenance.
|
|
20
|
-
|
|
21
|
-
The job uses the GitHub `npm` environment. Configure that environment with a required reviewer if releases need an explicit second confirmation.
|
|
22
|
-
|
|
23
|
-
AHEAD is released under the MIT License. The repository license file and each published package must declare the same license.
|
|
24
|
-
|
|
25
|
-
## Prepare a version
|
|
26
|
-
|
|
27
|
-
From `integrations/pi`:
|
|
28
|
-
|
|
29
|
-
```sh
|
|
30
|
-
npm version --no-git-tag-version <version>
|
|
31
|
-
npm test
|
|
32
|
-
node ./scripts/check-release.mjs pi-v<version>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Commit the version change, merge it to `main`, and confirm CI. Do not create the release from an unmerged commit.
|
|
36
|
-
|
|
37
|
-
## Bootstrap the first npm release
|
|
38
|
-
|
|
39
|
-
This machine was not authenticated to npm when the workflow was created, and npm trusted publishing is configured from an existing package's settings. The first publication therefore needs a short-lived bootstrap credential:
|
|
40
|
-
|
|
41
|
-
1. Create or select an npm account with 2FA enabled.
|
|
42
|
-
2. Create a granular npm access token that can publish the new public package and is permitted to bypass 2FA for automation.
|
|
43
|
-
3. Store it as `NPM_TOKEN` in the GitHub `npm` environment. Do not put it in repository files, shell history, workflow logs, or release notes.
|
|
44
|
-
4. On GitHub, create and publish a release with tag `pi-v0.1.0` at the corresponding `main` commit.
|
|
45
|
-
5. Verify the workflow, npm package page, provenance, and a clean `pi -e npm:ahead-pi@0.1.0` install.
|
|
46
|
-
|
|
47
|
-
The workflow has `id-token: write` and publishes with `--provenance`. Before trusted publishing exists, npm uses the bootstrap token and GitHub OIDC supplies the provenance attestation.
|
|
48
|
-
|
|
49
|
-
## Move to tokenless trusted publishing
|
|
50
|
-
|
|
51
|
-
The `ahead-pi` package uses this trusted publisher:
|
|
52
|
-
|
|
53
|
-
| npm field | Value |
|
|
54
|
-
|---|---|
|
|
55
|
-
| Provider | GitHub Actions |
|
|
56
|
-
| Organization or user | `Kade-Powell` |
|
|
57
|
-
| Repository | `ahead` |
|
|
58
|
-
| Workflow filename | `publish-pi.yml` |
|
|
59
|
-
| Environment | `npm` |
|
|
60
|
-
| Allowed action | `npm publish` |
|
|
61
|
-
|
|
62
|
-
The GitHub `npm` environment must not contain an `NPM_TOKEN` secret. npm publishing access requires 2FA, disallows bypass-2FA tokens, and keeps the trusted publisher. Each release verifies tokenless OIDC authentication and automatic provenance.
|
|
63
|
-
|
|
64
|
-
## Publish and verify
|
|
65
|
-
|
|
66
|
-
1. Publish a GitHub Release with tag `pi-v<version>` at the version commit.
|
|
67
|
-
2. Watch the `Publish Pi extension` workflow.
|
|
68
|
-
3. Confirm `npm view ahead-pi@<version> version` returns the release.
|
|
69
|
-
4. Confirm the package page links to this repository and shows provenance.
|
|
70
|
-
5. Test the registry artifact:
|
|
71
|
-
|
|
72
|
-
```sh
|
|
73
|
-
pi -e npm:ahead-pi@<version>
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
6. For stable releases, confirm `npm view ahead-pi dist-tags.latest`; for prereleases, confirm `dist-tags.next`.
|
|
77
|
-
|
|
78
|
-
## Failure and rollback
|
|
79
|
-
|
|
80
|
-
An npm version is immutable. Do not reuse a version after any publish attempt.
|
|
81
|
-
|
|
82
|
-
- If validation fails before `npm publish`, fix the source, increment the version if a registry publish may have occurred, and publish a new GitHub Release.
|
|
83
|
-
- If publication succeeds but post-publish verification fails, do not rerun the same version blindly. Inspect the registry first.
|
|
84
|
-
- Correct a bad release with a new patch version. Use npm deprecation for a discoverable warning; reserve unpublishing for the narrow cases allowed by npm policy.
|
|
85
|
-
- Moving a dist-tag is a human release decision and does not alter the immutable tarball.
|
|
86
|
-
|
|
87
|
-
## Why npm and OIDC
|
|
88
|
-
|
|
89
|
-
Pi natively installs `npm:ahead-pi`, pinned npm versions, Git sources, and local paths. npm provides the simplest cross-machine install path. GitHub-hosted OIDC avoids a long-lived release secret after bootstrap, and npm provenance links the public tarball to this repository and workflow. Neither provenance nor a passing workflow proves the package is safe; they make origin and build history auditable.
|