arreio 1.0.0-dev.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 +81 -0
- package/package.json +42 -0
- package/scripts/postinstall.js +50 -0
- package/skills/arreio-init/SKILL.md +214 -0
- package/skills/arreio-init/references/architecture-template.md +85 -0
- package/skills/arreio-init/references/learn-index-template.md +15 -0
- package/skills/arreio-init/references/plan-index-template.md +29 -0
- package/skills/arreio-init/references/tasks-index-template.md +15 -0
- package/skills/learn/SKILL.md +151 -0
- package/skills/learn/modules/capture.md +108 -0
- package/skills/learn/modules/index.md +94 -0
- package/skills/learn/modules/maintain.md +116 -0
- package/skills/learn/modules/refine.md +104 -0
- package/skills/learn/references/dedup-rules.md +129 -0
- package/skills/learn/references/entry-schema.md +152 -0
- package/skills/learn/references/error-handling.md +178 -0
- package/skills/learn/references/id-generation.md +114 -0
- package/skills/learn/references/index-format.md +140 -0
- package/skills/learn/references/interaction-mode-propagation.md +89 -0
- package/skills/learn/references/migration-bootstrap.md +142 -0
- package/skills/learn/references/templates/artifacts/captured-entry.md +172 -0
- package/skills/learn/references/templates/artifacts/index-update.md +135 -0
- package/skills/learn/references/templates/artifacts/learn-input.md +100 -0
- package/skills/learn/references/templates/artifacts/maintain-log.md +142 -0
- package/skills/learn/references/templates/artifacts/refined-entry.md +168 -0
- package/skills/plan/SKILL.md +129 -0
- package/skills/plan/modules/design.md +140 -0
- package/skills/plan/modules/generate.md +156 -0
- package/skills/plan/modules/research.md +122 -0
- package/skills/plan/modules/scope.md +121 -0
- package/skills/plan/modules/tasks.md +190 -0
- package/skills/plan/references/design-complexity-assessment.md +118 -0
- package/skills/plan/references/error-handling.md +155 -0
- package/skills/plan/references/external-research-guidance.md +61 -0
- package/skills/plan/references/high-risk-detection.md +111 -0
- package/skills/plan/references/id-generation.md +55 -0
- package/skills/plan/references/interaction-mode-propagation.md +75 -0
- package/skills/plan/references/learnings-gate-logic.md +93 -0
- package/skills/plan/references/plan-tier-selection.md +174 -0
- package/skills/plan/references/task-slicing-rules.md +220 -0
- package/skills/plan/references/templates/artifacts/design.md +134 -0
- package/skills/plan/references/templates/artifacts/final-plan.md +265 -0
- package/skills/plan/references/templates/artifacts/research-findings.md +50 -0
- package/skills/plan/references/templates/artifacts/scoped-context.md +53 -0
- package/skills/plan/references/templates/artifacts/task.md +192 -0
- package/skills/plan/references/templates/artifacts/user-input.md +112 -0
- package/skills/review/SKILL.md +163 -0
- package/skills/review/modules/analyze.md +104 -0
- package/skills/review/modules/prepare.md +103 -0
- package/skills/review/modules/report.md +109 -0
- package/skills/review/modules/scope.md +126 -0
- package/skills/review/references/approval-criteria.md +101 -0
- package/skills/review/references/change-set-resolution.md +126 -0
- package/skills/review/references/error-handling.md +172 -0
- package/skills/review/references/id-generation.md +80 -0
- package/skills/review/references/interaction-mode-propagation.md +80 -0
- package/skills/review/references/review-categories.md +124 -0
- package/skills/review/references/scope-creep-detection.md +120 -0
- package/skills/review/references/severity-rubric.md +107 -0
- package/skills/review/references/templates/artifacts/findings.md +161 -0
- package/skills/review/references/templates/artifacts/review-input.md +116 -0
- package/skills/review/references/templates/artifacts/review-kit.md +135 -0
- package/skills/review/references/templates/artifacts/review-report.md +175 -0
- package/skills/review/references/templates/artifacts/review-scope.md +146 -0
- package/skills/work/SKILL.md +163 -0
- package/skills/work/modules/execute.md +109 -0
- package/skills/work/modules/prepare.md +140 -0
- package/skills/work/modules/review.md +164 -0
- package/skills/work/modules/triage.md +181 -0
- package/skills/work/references/ad-hoc-input-resolution.md +122 -0
- package/skills/work/references/error-handling.md +183 -0
- package/skills/work/references/execution-mode-selection.md +95 -0
- package/skills/work/references/id-generation.md +85 -0
- package/skills/work/references/interaction-mode-propagation.md +80 -0
- package/skills/work/references/review-checklist.md +94 -0
- package/skills/work/references/task-execution-rules.md +116 -0
- package/skills/work/references/templates/artifacts/execution-log.md +123 -0
- package/skills/work/references/templates/artifacts/execution-plan.md +111 -0
- package/skills/work/references/templates/artifacts/work-input.md +78 -0
- package/skills/work/references/templates/artifacts/work-manifest.md +119 -0
- package/skills/work/references/templates/artifacts/work-report.md +143 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Error Handling & Recovery
|
|
3
|
+
description: Reference for all Work Skill phases (Triage, Prepare, Execute, Review). Defines the Step 0 artifact verification procedure, per-type required fields, error categories, recovery workflow, retry limits, and cross-phase consistency checks.
|
|
4
|
+
type: reference
|
|
5
|
+
version: 1.0
|
|
6
|
+
timestamp: "2026-08-07"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Error Handling & Recovery
|
|
10
|
+
|
|
11
|
+
This file documents the error handling and recovery strategies shared across all Work Skill phases (Triage, Prepare, Execute, Review). Each phase begins with a **Step 0: Verification** that validates the incoming artifact; this reference defines the validation rules, recovery actions, and termination conditions.
|
|
12
|
+
|
|
13
|
+
## Core Principle
|
|
14
|
+
|
|
15
|
+
**Fail explicitly, never silently.** When an artifact is missing, malformed, or inconsistent, the phase must surface a clear error with a recovery suggestion rather than guessing or proceeding with bad data. Silent failures cascade downstream and produce invalid work runs. The one recognized exception is a *missing learnings index* (Triage Step 5), which logs a single explicit warning rather than failing — but this is a deliberate non-block, not a silent no-op.
|
|
16
|
+
|
|
17
|
+
## Step 0: Artifact Verification
|
|
18
|
+
|
|
19
|
+
Every phase receives an artifact from the previous phase (or the Orchestrator, for Triage). Step 0 validates the artifact before any work begins.
|
|
20
|
+
|
|
21
|
+
### Verification Procedure
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
1. Confirm the artifact exists and is non-empty
|
|
25
|
+
2. Confirm the required frontmatter fields are present and well-formed
|
|
26
|
+
3. Confirm the artifact type matches the expected phase input
|
|
27
|
+
4. Confirm interactionMode is present and valid (default to "smart" if missing)
|
|
28
|
+
5. Confirm cross-phase IDs match the upstream artifacts
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Required Fields by Artifact Type
|
|
32
|
+
|
|
33
|
+
| Artifact Type | Required Fields | Produced By |
|
|
34
|
+
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
|
35
|
+
| `work-input` | `type`, `timestamp`, `source`, `status`, input shape (`plan-id` **or** `task-file` **or** `ad-hoc` description), `interactionMode` | Orchestrator |
|
|
36
|
+
| `work-manifest` | `triage-id`, `work-id`, `work-branch`, `input-shape`, `status`, `interactionMode`, resolved task list, `ready-tasks` | Triage |
|
|
37
|
+
| `execution-plan`| `prepare-id`, `triage-id`, `work-id`, `work-branch`, `input-shape`, `status`, `interactionMode`, `executionMode`, `execution-list`, `runner`, `baseline`, `applicable-gates` | Prepare |
|
|
38
|
+
| `execution-log` | `execute-id`, `prepare-id`, `triage-id`, `work-id`, `work-branch`, `input-shape`, `status`, `interactionMode`, `executionMode`, per-task result table, aggregator counts | Execute |
|
|
39
|
+
| `work-report` | `review-id`, `execute-id`, `prepare-id`, `triage-id`, `work-id`, `work-branch`, `input-shape`, `status`, `interactionMode`, `executionMode`, task-outcome rollup, `regression-check`, `scope-creep` | Review |
|
|
40
|
+
|
|
41
|
+
## Error Categories
|
|
42
|
+
|
|
43
|
+
### Category 1: Missing Artifact
|
|
44
|
+
|
|
45
|
+
The expected input artifact was not provided by the Orchestrator or previous phase.
|
|
46
|
+
|
|
47
|
+
| Trigger | Recovery Action | Terminate? |
|
|
48
|
+
| --------------------------------- | ------------------------------------------------------------- | ------------------ |
|
|
49
|
+
| Artifact object is null/undefined | Ask Orchestrator to re-run previous phase | Yes, after 1 retry |
|
|
50
|
+
| Artifact file path does not exist | Log warning; ask user to locate file or re-run previous phase | No |
|
|
51
|
+
| Artifact file is empty (0 bytes) | Re-run previous phase from its saved context | Yes, after 1 retry |
|
|
52
|
+
|
|
53
|
+
### Category 2: Malformed Artifact
|
|
54
|
+
|
|
55
|
+
The artifact exists but is missing required fields or has invalid structure.
|
|
56
|
+
|
|
57
|
+
| Trigger | Recovery Action | Terminate? |
|
|
58
|
+
| --------------------------------------------- | ----------------------------------------------------------- | ---------- |
|
|
59
|
+
| Missing required frontmatter field | Re-run previous phase to regenerate artifact | No |
|
|
60
|
+
| `interactionMode` missing or invalid | Default to `smart`; log warning; continue | No |
|
|
61
|
+
| `executionMode` missing or invalid (Prepare+)| Default per execution-mode-selection.md; log warning | No |
|
|
62
|
+
| `status` field is `failed` or `pending` | Reject; ask Orchestrator to re-run previous phase | Yes |
|
|
63
|
+
| Artifact `type` does not match expected input | Reject; ask Orchestrator to check phase ordering | Yes |
|
|
64
|
+
| YAML frontmatter has syntax errors | Log error with line number; ask user to fix or re-run phase | No |
|
|
65
|
+
|
|
66
|
+
### Category 3: Invalid Work Input
|
|
67
|
+
|
|
68
|
+
Only applies to the Triage phase (Step 0) when resolving a Work Input Artifact.
|
|
69
|
+
|
|
70
|
+
| Trigger | Recovery Action | Terminate? |
|
|
71
|
+
| ---------------------------------------------------- | --------------------------------------------------------- | ---------- |
|
|
72
|
+
| All three input shapes empty or ambiguous | Ask: "What would you like to work on? plan-id, task file, or describe." | No |
|
|
73
|
+
| Plan-based `plan-id` with no `docs/tasks/<id>/index.md` | Ask to run `/plan <id>` first, or switch to ad-hoc | No |
|
|
74
|
+
| Task-file path does not resolve to exactly one file | Ask user to disambiguate or supply the task-id | No |
|
|
75
|
+
| Ad-hoc description empty or unobservable | Ask: "What should happen after this is done?" | No |
|
|
76
|
+
|
|
77
|
+
### Category 4: File System Errors
|
|
78
|
+
|
|
79
|
+
Errors encountered while saving or reading artifact files.
|
|
80
|
+
|
|
81
|
+
| Trigger | Recovery Action | Terminate? |
|
|
82
|
+
| ------------------------------------------------ | ----------------------------------------------------------------- | ------------------ |
|
|
83
|
+
| Target directory does not exist | Create directory (`mkdir -p`); treat counter as 0; start from 001 | No |
|
|
84
|
+
| Counter directory exists but no files match date | Start counter at 001 | No |
|
|
85
|
+
| File write permission denied | Log error; ask user to check permissions; retry once | Yes, after 1 retry |
|
|
86
|
+
| Task directory `docs/tasks/<work-id>/` missing | Create it (ad-hoc); for plan-based, ask to run `/plan` first | No |
|
|
87
|
+
| Index `docs/tasks/<work-id>/index.md` missing | Create empty index; append the section (idempotent on `review-id`) | No |
|
|
88
|
+
|
|
89
|
+
### Category 5: Interaction Mode Errors
|
|
90
|
+
|
|
91
|
+
Errors related to `interactionMode` propagation.
|
|
92
|
+
|
|
93
|
+
| Trigger | Recovery Action | Terminate? |
|
|
94
|
+
| ---------------------------------------- | ---------------------------------------------------------- | ---------- |
|
|
95
|
+
| Mode missing from incoming artifact | Default to "smart"; log warning; continue | No |
|
|
96
|
+
| Mode value is not in enum | Reject; re-prompt Orchestrator to set valid mode | Yes |
|
|
97
|
+
| User selects "Abort" during confirmation | Stop immediately; inform Orchestrator of abort with reason | Yes |
|
|
98
|
+
| User does not respond (timeout) | Pause; ask user to retry or abort | No |
|
|
99
|
+
|
|
100
|
+
### Category 6: Execution Errors (Execute phase)
|
|
101
|
+
|
|
102
|
+
| Trigger | Recovery Action | Terminate? |
|
|
103
|
+
| ---------------------------------------------------- | ------------------------------------------------------------------ | ---------- |
|
|
104
|
+
| Task's Green gate not reached within retry-limit | Mark task `blocked` with reason + assertion snapshot; pause per mode | No |
|
|
105
|
+
| Test runner command fails to execute (not an assertion failure) | Ask user to verify runner/packageManager; category-2 recovery | No |
|
|
106
|
+
| Dependency install fails during a Green step | Log error; retry once; then mark task `blocked` | No |
|
|
107
|
+
| New regression beyond baseline snapshot on a completed task | Surface as Review Smart pause trigger; do not auto-mark blocked | No |
|
|
108
|
+
|
|
109
|
+
Initial values: a task starts `not-started`; Execute sets `in-progress` mid-task, then transitions to `completed`, `blocked`, or `skipped`. Only `completed` ticks the index checkbox.
|
|
110
|
+
|
|
111
|
+
### Category 7: Git / Branch Errors
|
|
112
|
+
|
|
113
|
+
Errors from Work Branch Creation (Triage Step 2d).
|
|
114
|
+
|
|
115
|
+
| Trigger | Recovery Action | Terminate? |
|
|
116
|
+
| ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- | ------------------------- |
|
|
117
|
+
| Working directory is not a git repository | Log one explicit warning; record `work-branch: null`, `work-branch-state: not-a-git-repo`; continue without a branch | No |
|
|
118
|
+
| Dirty working tree (uncommitted changes) | Fail branch creation with an explicit error; ask the user: commit/stash & retry, proceed without a work branch, or abort | Yes (unless user picks proceed) |
|
|
119
|
+
| Branch slug cannot be derived (vague ad-hoc description) | Ask the user for a short kebab-case slug for `work/<slug>` | No |
|
|
120
|
+
| Current HEAD is not the default branch at creation | Smart pause; ask which base to branch from (default branch / current HEAD / abort); autopilot: default branch + warning | No |
|
|
121
|
+
| Branch checkout/create fails (permissions, lock, etc.) | Log error; retry once; then terminate with a suggestion | Yes, after 1 retry |
|
|
122
|
+
|
|
123
|
+
## Recovery Workflow
|
|
124
|
+
|
|
125
|
+
When a verification failure is detected in Step 0, apply this workflow:
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
1. Identify the error category (1-7) from the tables above
|
|
129
|
+
2. Look up the specific trigger to find the recovery action
|
|
130
|
+
3. Execute the recovery action:
|
|
131
|
+
- If recovery is "ask user": ask one question with clear options (2-4 concrete choices)
|
|
132
|
+
- If recovery is "re-run previous phase": return to Orchestrator with error context
|
|
133
|
+
- If recovery is "default and continue": apply default, log warning, proceed
|
|
134
|
+
4. If terminate = Yes: stop and inform Orchestrator with:
|
|
135
|
+
- Error category and trigger
|
|
136
|
+
- Recovery action attempted
|
|
137
|
+
- Reason for termination
|
|
138
|
+
5. If terminate = No: after recovery, continue to Step 1 of the phase
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Retry Limits
|
|
142
|
+
|
|
143
|
+
- **Maximum retries per error:** 1
|
|
144
|
+
- **Maximum total retries per phase:** 2
|
|
145
|
+
- **Per-task Green-gate retry-limit:** defined in [task-execution-rules.md](task-execution-rules.md) (authoritative); reaching it transitions the task to `blocked`, not a phase termination.
|
|
146
|
+
- After exhausting phase retries, terminate with a clear error suggesting the user re-run the work workflow from the start or resume from the last complete phase.
|
|
147
|
+
|
|
148
|
+
## Error Reporting Format
|
|
149
|
+
|
|
150
|
+
When reporting an error to the Orchestrator or user, use this format:
|
|
151
|
+
|
|
152
|
+
```yaml
|
|
153
|
+
error:
|
|
154
|
+
phase: triage | prepare | execute | review
|
|
155
|
+
step: 0 | 1 | 2 | ...
|
|
156
|
+
category: 1 | 2 | 3 | 4 | 5 | 6
|
|
157
|
+
trigger: "[specific trigger description]"
|
|
158
|
+
recovery_attempted: "[action taken]"
|
|
159
|
+
outcome: recovered | terminated
|
|
160
|
+
suggestion: "[next step for the user or Orchestrator]"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Cross-Phase Consistency Checks
|
|
164
|
+
|
|
165
|
+
The Orchestrator should verify consistency between phases:
|
|
166
|
+
|
|
167
|
+
| Check | Action on Failure |
|
|
168
|
+
| --------------------------------------------------------------------- | ------------------------------------------- |
|
|
169
|
+
| `work-id` in downstream artifact matches the Triage output | Reject; re-run from Triage |
|
|
170
|
+
| `triage-id` in Prepare+ matches Triage output | Reject Prepare; re-run from Triage |
|
|
171
|
+
| `prepare-id` in Execute+ matches Prepare output | Reject Execute; re-run from Prepare |
|
|
172
|
+
| `execute-id` in Review matches Execute output | Reject Review; re-run from Execute |
|
|
173
|
+
| `interactionMode` is identical across all artifacts | Log warning; use earliest non-default value |
|
|
174
|
+
| `executionMode` is identical across Prepare/Execute/Review artifacts | Log warning; re-run Prepare |
|
|
175
|
+
| `work-branch` in downstream artifacts matches the Triage manifest | Reject; re-run from Triage |
|
|
176
|
+
|
|
177
|
+
## Notes
|
|
178
|
+
|
|
179
|
+
- All errors and warnings should be logged with a timestamp for debugging.
|
|
180
|
+
- When a phase terminates, its saved artifact (if any) should be marked `status: failed`.
|
|
181
|
+
- The Orchestrator is responsible for deciding whether to retry the entire workflow or resume from the last successful phase.
|
|
182
|
+
- ID assignment and re-use (including recycle-on-edit) is defined in [id-generation.md](id-generation.md); this reference covers only verification and recovery.
|
|
183
|
+
- This reference is shared by all four phases; phase-specific handling is documented inline in the respective module.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Execution Mode Selection
|
|
3
|
+
description: Authoritative reference for the Prepare phase. Defines the three execution modes (inline/serial/parallel), their selection defaults, the risk floor (HIGH-risk forces inline, non-downgradable), and the per-mode flows Execute follows.
|
|
4
|
+
type: reference
|
|
5
|
+
version: 1.0
|
|
6
|
+
timestamp: "2026-08-07"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Execution Mode Selection
|
|
10
|
+
|
|
11
|
+
Authoritative reference for the **Prepare** phase (Step 3). Defines the three execution modes, their selection defaults, the **risk floor**, and the per-mode flows the Execute phase follows. Prepare looks these up; Execute follows them; neither re-derives them.
|
|
12
|
+
|
|
13
|
+
> `executionMode` governs **how multiple tasks are run**. It is distinct from `interactionMode` (when to pause), which is set at the Orchestrator (see [interaction-mode-propagation.md](interaction-mode-propagation.md)). Both are carried independently through every artifact.
|
|
14
|
+
|
|
15
|
+
## Modes
|
|
16
|
+
|
|
17
|
+
| Mode | Behavior | Select when (default) |
|
|
18
|
+
| ---------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------- |
|
|
19
|
+
| `inline` | One task at a time; pause between tasks; re-confirm the user before each destructive (Red) step. | `interactionMode: detailed`, **or** any task in the list is HIGH-risk or `P0` |
|
|
20
|
+
| `serial` | Run the ordered list sequentially; no per-task pause; stop only on a `blocked` task. | Default fallback — most task lists |
|
|
21
|
+
| `parallel` | Run each wave's independent tasks concurrently; waves run in order (Wave N starts after Wave N-1 settles). | `execution-list` has 2+ independent waves **and** no task is HIGH-risk |
|
|
22
|
+
|
|
23
|
+
## Selection Algorithm (authoritative)
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
1. Read from the Work Manifest each task's priority (P0/P1/P2) and any HIGH-risk flag.
|
|
27
|
+
2. default_mode =
|
|
28
|
+
inline if interactionMode == detailed OR any task is HIGH-risk OR any P0 task present
|
|
29
|
+
parallel if execution-list has >= 2 independent waves AND no task is HIGH-risk
|
|
30
|
+
serial otherwise (fallback)
|
|
31
|
+
3. Apply the risk floor (below): any HIGH-risk task is forced to inline
|
|
32
|
+
treatment — record per-task inline-override for that task.
|
|
33
|
+
4. In Detailed mode: ask the user, presenting the recommendation.
|
|
34
|
+
In Smart mode: auto-select unless a Smart pause trigger fires.
|
|
35
|
+
In Autopilot mode: auto-select; never ask.
|
|
36
|
+
5. Honor user preference unless it violates the risk floor; on violation, ask the
|
|
37
|
+
user to accept inline instead.
|
|
38
|
+
6. Record executionMode + per-mode flow:
|
|
39
|
+
inline -> single-task-pause: true
|
|
40
|
+
serial -> stop-on-blocked: true
|
|
41
|
+
parallel -> waves: [Wave0, Wave1, ...]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Risk Floor (authoritative, non-downgradable)
|
|
45
|
+
|
|
46
|
+
- **Any HIGH-risk task forces `inline` treatment for that task**, regardless of the selected `executionMode`.
|
|
47
|
+
- If the list-level `executionMode` is `serial`/`parallel` but an individual task is HIGH-risk, that task runs inline (pause + re-confirm before its Red step) while independent non-HIGH-risk tasks may keep the list mode elsewhere.
|
|
48
|
+
- The user may not downgrade a HIGH-risk task below `inline`. A preference that violates this is rejected; the user is asked to accept `inline`.
|
|
49
|
+
- HIGH-risk is carried from the Work Manifest (Triage preserved the per-task risk flag from the `/plan` design/research artifacts or inferred it for ad-hoc tasks).
|
|
50
|
+
|
|
51
|
+
## Per-Mode Flow (authoritative; Execute follows these)
|
|
52
|
+
|
|
53
|
+
### inline
|
|
54
|
+
- Run one task at a time.
|
|
55
|
+
- After each task completes or blocks, pause for the user (the `single-task-pause: true` flag) and re-confirm before the next task's Red (destructive) step.
|
|
56
|
+
- Best when `interactionMode: detailed` or any task is HIGH-risk; it is the only mode allowed for a HIGH-risk task.
|
|
57
|
+
|
|
58
|
+
### serial
|
|
59
|
+
- Run the flat ordered list sequentially.
|
|
60
|
+
- Do **not** pause between tasks.
|
|
61
|
+
- Stop only when a task becomes `blocked` (`stop-on-blocked: true`).
|
|
62
|
+
- On a block: surface the reason and ask the user whether to (a) continue with remaining independent tasks, (b) retry, or (c) abort.
|
|
63
|
+
|
|
64
|
+
### parallel
|
|
65
|
+
- Group `execution-list` into waves:
|
|
66
|
+
- **Wave 0** — tasks with all dependencies already `completed`.
|
|
67
|
+
- **Wave N** — tasks all of whose dependencies are in Waves `< N`; each wave is independent internally and runs concurrently.
|
|
68
|
+
- Within a wave, stable order by original unit number.
|
|
69
|
+
- Waves run in order: Wave N starts only after Wave N-1 fully settles (all its tasks completed/blocked/skipped).
|
|
70
|
+
- A `blocked` task in an earlier wave blocks only its dependents in later waves, not the whole current wave.
|
|
71
|
+
- A HIGH-risk task in any wave is, per the risk floor, pulled to inline treatment (pause + re-confirm) even though surrounding tasks run concurrently.
|
|
72
|
+
|
|
73
|
+
## Resume Behavior
|
|
74
|
+
|
|
75
|
+
On re-entry (re-running Work), Prepare recomputes `executionMode` the same way, but Execute skips any task already `completed` (per the resume policy in [task-execution-rules.md](task-execution-rules.md)) and runs from the first non-completed task. The execution mode does not change on resume.
|
|
76
|
+
|
|
77
|
+
## Smart Pause Triggers (Prepare)
|
|
78
|
+
|
|
79
|
+
Prepare pauses in Smart mode when:
|
|
80
|
+
- `baseline: red` and the user has not yet chosen a baseline policy, or
|
|
81
|
+
- `executionMode: parallel` on an execution list of > 5 tasks (concurrency risk), or
|
|
82
|
+
- A HIGH-risk task is present but the selected `executionMode` would not give it `inline` treatment (risk-floor conflict pre-override).
|
|
83
|
+
|
|
84
|
+
## Failure Conditions
|
|
85
|
+
|
|
86
|
+
| Trigger | Recovery |
|
|
87
|
+
| ------------------------------------------------------- | ------------------------------------------------------------------ |
|
|
88
|
+
| `executionMode` missing from the Execution Plan | Category 2 default per error-handling.md; re-run Prepare |
|
|
89
|
+
| A cycle in wave grouping (no wave can start) | Surface to the user; ask to break (remove a dependency) or abort |
|
|
90
|
+
| User preference violates the risk floor | Ask the user to accept `inline` instead; do not silently downgrade |
|
|
91
|
+
|
|
92
|
+
## Notes
|
|
93
|
+
|
|
94
|
+
- This reference is the single source of truth for mode definitions, defaults, the risk floor, and per-mode flows. Prepare records the selection; Execute follows the flow; Review verifies they match (orchestrator quality gate #2).
|
|
95
|
+
- The mode is independent from `interactionMode`: a Detailed run may use parallel execution, and an Autopilot run still gives HIGH-risk tasks inline treatment.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Artifact ID Generation
|
|
3
|
+
description: Reference for Triage, Prepare, Execute, and Review phases. Defines the daily-counter algorithm for unique artifact IDs, the work-id allocation, the recycle-on-edit rule, and the shared counter layout under docs/plans/.work/.
|
|
4
|
+
type: reference
|
|
5
|
+
version: 1.0
|
|
6
|
+
timestamp: "2026-08-07"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Artifact ID Generation
|
|
10
|
+
|
|
11
|
+
Shared ID algorithm for the `triage`, `prepare`, `execute`, and `review` phases, plus `work-id` allocation for ad-hoc input. Each phase assigns exactly one ID per newly produced artifact; the ID is reused (never re-incremented) when the user picks **Edit & Retry** at the phase confirmation.
|
|
12
|
+
|
|
13
|
+
## ID Format by Phase
|
|
14
|
+
|
|
15
|
+
| Phase | ID format | Saved to |
|
|
16
|
+
| -------- | ----------------------------------- | -------------------------------- |
|
|
17
|
+
| Triage | `YYYY-MM-DD-NNN-triage` | `docs/plans/.work/.triage/<id>.md` |
|
|
18
|
+
| Prepare | `YYYY-MM-DD-NNN-prepare` | `docs/plans/.work/.prepare/<id>.md` |
|
|
19
|
+
| Execute | `YYYY-MM-DD-NNN-execute` | `docs/plans/.work/.execute/<id>.md` |
|
|
20
|
+
| Review | `YYYY-MM-DD-NNN-review` | `docs/plans/.work/.review/<id>.md` |
|
|
21
|
+
|
|
22
|
+
`work-id` (see below) is shared across all four artifacts of a single run.
|
|
23
|
+
|
|
24
|
+
## work-id
|
|
25
|
+
|
|
26
|
+
The `work-id` is the key that ties all four phase artifacts together and locates the task directory. It reuses the `/plan` `plan-id` format so the `docs/tasks/<id>/` convention holds uniformly:
|
|
27
|
+
|
|
28
|
+
| Input shape | work-id value |
|
|
29
|
+
| ----------- | --------------------------------------------------------- |
|
|
30
|
+
| plan-based | `plan-id` (inherited from `docs/tasks/<plan-id>/index.md`) |
|
|
31
|
+
| task-file | `plan-id` inferred from the task file's folder |
|
|
32
|
+
| ad-hoc | a fresh `YYYY-MM-DD-NNN` (allocated below) |
|
|
33
|
+
|
|
34
|
+
**Format:** `YYYY-MM-DD-NNN` (date + zero-padded 3-digit daily counter), identical to the `/plan` `plan-id`.
|
|
35
|
+
|
|
36
|
+
> **Work branch name:** the git branch for a run is `work/<short-description>` — a kebab-case slug derived from the plan name or work description (Triage Step 2d), **not** the `work-id` itself. The Work Manifest records the `work-branch` ↔ `work-id` pairing; see `skills/work/modules/triage.md` Step 2d.
|
|
37
|
+
|
|
38
|
+
## Algorithm (new phase artifact)
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
1. Get the current date in UTC (e.g., 2026-08-07)
|
|
42
|
+
2. List existing files for today in the phase's save directory:
|
|
43
|
+
- triage -> docs/plans/.work/.triage/ matching YYYY-MM-DD-*-triage.md
|
|
44
|
+
- prepare -> docs/plans/.work/.prepare/ matching YYYY-MM-DD-*-prepare.md
|
|
45
|
+
- execute -> docs/plans/.work/.execute/ matching YYYY-MM-DD-*-execute.md
|
|
46
|
+
- review -> docs/plans/.work/.review/ matching YYYY-MM-DD-*-review.md
|
|
47
|
+
3. NNN = (count + 1), zero-padded to 3 digits (001, 002, ..., 010, ...)
|
|
48
|
+
4. id = "<date>-<NNN>-<phase>"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If two triage artifacts were created today, the next one is `2026-08-07-003-triage`. Counters are independent per phase; each phase counts only its own files.
|
|
52
|
+
|
|
53
|
+
## Algorithm (ad-hoc work-id allocation)
|
|
54
|
+
|
|
55
|
+
Allocated only in Triage for ad-hoc input:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
1. Get the current date in UTC
|
|
59
|
+
2. List existing folders under docs/tasks/ matching YYYY-MM-DD-NNN for that date
|
|
60
|
+
3. NNN = (highest existing NNN for that date) + 1, zero-padded to 3 digits
|
|
61
|
+
- if none exist for that date, start at 001
|
|
62
|
+
4. work-id = "<date>-<NNN>"
|
|
63
|
+
5. Create docs/tasks/<work-id>/ and its index.md (Triage Step 2c)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
> This deliberately mirrors the `/plan` Generate-phase `plan-id` counting (per `skills/plan/references/id-generation.md`), so a `/plan`-produced `docs/tasks/<plan-id>/` and an ad-hoc `/work`-produced `docs/tasks/<work-id>/` share one numbering space per date and never collide.
|
|
67
|
+
|
|
68
|
+
## Recycle on Edit & Retry
|
|
69
|
+
|
|
70
|
+
When the user picks **Edit & Retry** at a phase confirmation, **reuse the original ID** and overwrite the existing artifact file. Do **not** increment the counter. This keeps IDs stable across iterations and prevents orphaned artifacts. The Review phase's `## Work Report — <review-id>` block in the task index is likewise idempotent on `review-id` (overwritten, never duplicated).
|
|
71
|
+
|
|
72
|
+
## Error Handling
|
|
73
|
+
|
|
74
|
+
| Trigger | Action |
|
|
75
|
+
| ----------------------------------------------- | -------------------------------------------- |
|
|
76
|
+
| Phase save directory does not exist | Create it; treat count as 0; start from 001 |
|
|
77
|
+
| Directory exists but no files match today's date | Start counter at 001 |
|
|
78
|
+
| `docs/tasks/` missing | Create it (ad-hoc work-id allocation) |
|
|
79
|
+
| Write permission denied | Log error; ask the user; retry once |
|
|
80
|
+
|
|
81
|
+
## Notes
|
|
82
|
+
|
|
83
|
+
- IDs reuse the `/plan` daily-counter algorithm for cross-skill consistency; the Work skill's counters are independent from Plan's (separate save directories).
|
|
84
|
+
- `work-id` carries through every artifact (`triage-id` artifacts record it; Prepare/Execute/Review inherit it), so cross-phase chaining is `triage-id → prepare-id → execute-id → review-id`, all sharing one `work-id` (see [error-handling.md](error-handling.md) "Cross-Phase Consistency Checks").
|
|
85
|
+
- Counter collisions are impossible within a date because each phase writes to its own directory and recomputes the count from the directory listing.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Interaction Mode Propagation
|
|
3
|
+
description: Reference for how `interactionMode` propagates through the Work pipeline (Triage -> Prepare -> Execute -> Review). Set at the Orchestrator; each phase reads and applies mode-specific behavior.
|
|
4
|
+
type: reference
|
|
5
|
+
version: 1.0
|
|
6
|
+
timestamp: "2026-08-07"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Interaction Mode Propagation
|
|
10
|
+
|
|
11
|
+
Reference for how `interactionMode` propagates through the Work pipeline (`Triage → Prepare → Execute → Review`). Set at the Orchestrator; each phase reads and applies mode-specific behavior.
|
|
12
|
+
|
|
13
|
+
> `interactionMode` governs **when to pause for the user**. It is distinct from **execution mode** (`inline` / `serial` / `parallel`), which governs **how multiple tasks are run** and is selected in Prepare (see [execution-mode-selection.md](execution-mode-selection.md)). Both are carried independently through every artifact.
|
|
14
|
+
|
|
15
|
+
## Modes
|
|
16
|
+
|
|
17
|
+
| Mode | Behavior | Use Case |
|
|
18
|
+
| ------------- | ----------------------------------------------------- | ------------------------------------ |
|
|
19
|
+
| **Detailed** | Pause at each phase; present artifacts; require approval | Complex/high-risk work, unfamiliar codebases |
|
|
20
|
+
| **Smart** | Auto-proceed; pause only on HIGH-risk flags | Familiar codebases with guardrails |
|
|
21
|
+
| **Autopilot** | Run all phases auto (Review still reports) | Straightforward, well-planned task lists |
|
|
22
|
+
|
|
23
|
+
## Phase Behavior by Mode
|
|
24
|
+
|
|
25
|
+
| Phase | Detailed | Smart | Autopilot |
|
|
26
|
+
| ------------ | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- | --------------------------------- |
|
|
27
|
+
| **Triage** | Present manifest; ask Proceed/Edit/Abort | Auto-proceed; pause if ad-hoc inferred list, unmet upstream dep (task-file), or task-artifact validation recovery | Auto-proceed |
|
|
28
|
+
| **Prepare** | Present execution plan; ask Proceed/Edit/Abort | Auto-proceed; pause if red-baseline open, parallel > 5 tasks, or HIGH-risk risk-floor conflict | Auto-proceed |
|
|
29
|
+
| **Execute** | Per-task pause (inline) + ask Proceed/Edit/Abort | Auto-proceed; pause if blocked-at-retry-limit, new regression on Refactor, or parallel dependent-blocked | Auto-proceed (inline mode still pauses for HIGH-risk tasks) |
|
|
30
|
+
| **Review** | Present work report; ask Finalize/Edit/Abort | Auto-proceed; pause if regressions-found, scope-creep, or learnings-to-capture non-empty | Auto-proceed (strips to Smart triggers) |
|
|
31
|
+
|
|
32
|
+
**Smart mode pauses only on each phase's documented triggers above** (the canonical list lives in each module's confirmation step; this table is a summary).
|
|
33
|
+
|
|
34
|
+
## Artifact Schema
|
|
35
|
+
|
|
36
|
+
All phase artifacts include `interactionMode`:
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
interactionMode: detailed | smart | autopilot # Passed from previous phase
|
|
40
|
+
status: pending | complete | failed
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Implementation
|
|
44
|
+
|
|
45
|
+
**Each phase must:**
|
|
46
|
+
|
|
47
|
+
1. Read `interactionMode` from the incoming artifact (or context, for Triage).
|
|
48
|
+
2. Apply mode-specific behavior per the table above.
|
|
49
|
+
3. Include `interactionMode` in the output artifact.
|
|
50
|
+
|
|
51
|
+
## Example
|
|
52
|
+
|
|
53
|
+
**SMART mode on a plan-based run:**
|
|
54
|
+
|
|
55
|
+
- Triage reads a plan-based index (no inferred list) → auto-proceeds
|
|
56
|
+
- Prepare detects a GREEN baseline, serial mode → auto-proceeds
|
|
57
|
+
- Execute runs serially; one task hits the retry-limit → pauses (blocked-at-retry-limit)
|
|
58
|
+
- User reviews the block reason and chooses to continue with remaining independent tasks → execute resumes
|
|
59
|
+
- Review finds no regressions, no scope-creep, empty learnings → auto-proceeds
|
|
60
|
+
|
|
61
|
+
**Result:** Paused only for the genuine blocker; faster than Detailed with safety guardrails.
|
|
62
|
+
|
|
63
|
+
## Execution Mode Independence
|
|
64
|
+
|
|
65
|
+
`executionMode` is chosen in Prepare and propagated alongside `interactionMode`:
|
|
66
|
+
|
|
67
|
+
- A **Detailed** run may still use **parallel** execution (every independent task runs concurrently, but Review still confirms).
|
|
68
|
+
- An **Autopilot** run still gives HIGH-risk tasks **inline** treatment (per the execution-mode-selection risk floor), even though no confirmation prompt is shown.
|
|
69
|
+
|
|
70
|
+
The two never override one another; the orchestrator's quality gate #2 cross-checks both are identical across artifacts.
|
|
71
|
+
|
|
72
|
+
## Error Handling
|
|
73
|
+
|
|
74
|
+
| Scenario | Recovery |
|
|
75
|
+
| --------------------------- | ------------------------------------- |
|
|
76
|
+
| Mode missing | Default to "smart"; log warning |
|
|
77
|
+
| Invalid mode value | Reject; re-prompt Orchestrator |
|
|
78
|
+
| Artifact missing mode field | Assume "smart"; log warning; continue |
|
|
79
|
+
| User selects "Abort" | Stop immediately; inform Orchestrator |
|
|
80
|
+
| Timeout/connection lost | Pause; ask user to retry or abort |
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Review Checklist
|
|
3
|
+
description: Authoritative reference for the Review phase. Defines the simplification, consolidation, scope-creep, regression, and learnings-capture checks Review applies across the completed tasks' changed files. Review applies the checklist; it does not re-encode it.
|
|
4
|
+
type: reference
|
|
5
|
+
version: 1.0
|
|
6
|
+
timestamp: "2026-08-07"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Review Checklist
|
|
10
|
+
|
|
11
|
+
Authoritative reference for the **Review** phase. Defines the checks Review applies across the `completed` tasks' changed files (`files.create` / `files.modify`). Review applies the checklist; it does not re-encode it. Each check is run as a **refactor** — the relevant tasks' AC tests must stay green; any check that would change behavior is routed to scope-creep handling, not applied here.
|
|
12
|
+
|
|
13
|
+
## Simplification Checks
|
|
14
|
+
|
|
15
|
+
Run across the union of completed tasks' `files.create` / `files.modify`:
|
|
16
|
+
|
|
17
|
+
| Check | Criteria (authoritative) | Apply as |
|
|
18
|
+
| -------------------- | ---------------------------------------------------------------------------------- | --------------- |
|
|
19
|
+
| Dead code | Code made unreachable by the run (unused exports, unreachable branches, vestigial helpers) is removed. | refactor |
|
|
20
|
+
| Duplication (DRY) | Repeated logic across the changed files is extracted into one shared helper/abstraction. | refactor |
|
|
21
|
+
| Naming | Identifiers are intention-revealing; no cryptic or misnamed symbols introduced. | refactor |
|
|
22
|
+
| Function/class size | Functions/classes do one thing; overlarge units are collapsed to single responsibility. | refactor |
|
|
23
|
+
| Speculative generality | No added abstractions/parameters with no current consumer. | refactor (remove) |
|
|
24
|
+
| Commented-out code | No commented-out code or dead scaffolding left behind. | refactor (remove) |
|
|
25
|
+
|
|
26
|
+
Record `simplification-summary` (what was simplified/clipped) and `consolidations` (any merged logic / extracted abstractions) in the Work Report.
|
|
27
|
+
|
|
28
|
+
## Consolidation Checks
|
|
29
|
+
|
|
30
|
+
| Check | Criteria | Apply as |
|
|
31
|
+
| ------------------------ | --------------------------------------------------------------------------------- | ---------- |
|
|
32
|
+
| Shared logic extraction | Two+ completed tasks introduced parallel logic; extract to a shared, tested unit. | refactor |
|
|
33
|
+
| Public-API minimization | Public surface area is minimal; depend on abstractions, not concretions. | refactor |
|
|
34
|
+
| Import boundary hygiene | Side effects isolated at boundaries; inner functions kept pure where the change permits. | refactor |
|
|
35
|
+
|
|
36
|
+
A consolidation that would change behavior is **not** applied here — it becomes a scope-creep finding (the user decides whether to accept it as a follow-up task).
|
|
37
|
+
|
|
38
|
+
## Regression Check (authoritative for the suite comparison)
|
|
39
|
+
|
|
40
|
+
Run the full affected-scope suite (union of completed tasks' test paths + any modified files covered elsewhere) using the Execute-resolved command. Compare against the Prepare baseline:
|
|
41
|
+
|
|
42
|
+
| baseline | Clean condition | Regression condition |
|
|
43
|
+
| ---------------------- | --------------------------------------------------------------- | ------------------------------ |
|
|
44
|
+
| `green` | Suite is still green | Any failure is a regression |
|
|
45
|
+
| `snapshot-and-continue`| Failures are a **subset** of the recorded known-failing snapshot | Any **new** failure is a regression |
|
|
46
|
+
|
|
47
|
+
Record `regression-check: clean | regressions-found` with the failing-test list if any. A regression on a `completed` task is a Review Smart pause trigger.
|
|
48
|
+
|
|
49
|
+
## Scope-Creep Checks (authoritative)
|
|
50
|
+
|
|
51
|
+
| Check | Criteria (authoritative) | Outcome |
|
|
52
|
+
| -------------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------- |
|
|
53
|
+
| Per-task scope | A `completed` task's `files.create`/`files.modify` edits are bounded by **that task's single AC**. Edits beyond the AC (extra files, behavior not asserted by `files.test`) are scope creep. | Record per task: file path + why it exceeds the AC |
|
|
54
|
+
| Manifest scope | No task was added, removed, or silently expanded beyond what Triage resolved. (`dependency-warning: expanded-to-upstream` from the task-file shape is expected, not creep.) | Record any deviation |
|
|
55
|
+
|
|
56
|
+
Record `scope-creep: none` or the per-task findings. Surface creep to the user — never fold it silently into a task.
|
|
57
|
+
|
|
58
|
+
## Learnings-Capture Checks
|
|
59
|
+
|
|
60
|
+
For each notable finding, record a learning candidate:
|
|
61
|
+
|
|
62
|
+
| Finding type | When to capture | Fields |
|
|
63
|
+
| ------------------ | ------------------------------------------------------------ | ------------------------------------------------- |
|
|
64
|
+
| Confirmed pattern | A codebase pattern was confirmed during execution | title, domain, source (task-id + gate), summary |
|
|
65
|
+
| Refuted assumption | An assumption from Triage/Prepare was contradicted | title, domain, source, summary |
|
|
66
|
+
| Gotcha hit | A recurring trap was encountered (e.g., a flaky test class) | title, domain, source, summary |
|
|
67
|
+
| Forced decision | The run forced a non-obvious decision | title, domain, source, summary |
|
|
68
|
+
|
|
69
|
+
Also carry forward the Work Manifest's `Learning Gaps` and add any gaps the run revealed (e.g., a missing test pattern that forced a workaround) to `learning-gaps`.
|
|
70
|
+
|
|
71
|
+
Record `learnings-to-capture` (candidates, handed to `/learn` — Work does not write `docs/learn/` directly) and the updated `learning-gaps` in the Work Report.
|
|
72
|
+
|
|
73
|
+
## Final work-state (Review derives from the Execution Log)
|
|
74
|
+
|
|
75
|
+
| work-state | Condition |
|
|
76
|
+
| ------------- | ----------------------------------------------------------------------------- |
|
|
77
|
+
| `complete` | All tasks `completed` **and** regression-check `clean` |
|
|
78
|
+
| `partial` | Some tasks `blocked`/`skipped` but progress was made |
|
|
79
|
+
| `nothing-done`| Empty run (`work-state: nothing-ready` carried through) or all tasks blocked early |
|
|
80
|
+
|
|
81
|
+
## Failure Conditions
|
|
82
|
+
|
|
83
|
+
| Trigger | Recovery |
|
|
84
|
+
| ---------------------------------------------- | --------------------------------------------------------- |
|
|
85
|
+
| A simplification check would change behavior | Route to scope-creep; do not apply as a refactor |
|
|
86
|
+
| Regression found on a `completed` task | Smart pause trigger; user decides accept or roll back |
|
|
87
|
+
| Scope creep detected | Surface to user; do not fold silently into a task |
|
|
88
|
+
| Task-status incoherent at Review Step 0 | Category 2 recovery per [error-handling.md](error-handling.md) — re-run Execute |
|
|
89
|
+
|
|
90
|
+
## Notes
|
|
91
|
+
|
|
92
|
+
- This reference is the single source of truth for the simplification/consolidation/scope-creep/regression/learnings checks. Review applies it; Prepare and Execute do not re-encode it.
|
|
93
|
+
- Every applied change here is a **refactor**: AC tests stay green, no behavior change. Behavior-changing ideas become scope-creep findings for the user to accept as a follow-up.
|
|
94
|
+
- Learnings are surfaced for `/learn` to persist; Work never writes `docs/learn/` directly.
|