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,172 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Error Handling & Recovery
|
|
3
|
+
description: Reference for all Review Skill phases (Scope, Prepare, Analyze, Report). 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-08"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Error Handling & Recovery
|
|
10
|
+
|
|
11
|
+
This file documents the error handling and recovery strategies shared across all Review Skill phases (Scope, Prepare, Analyze, Report). 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 reviews. The one recognized exception is a *missing learnings index* (Scope Step 5), which logs a single explicit warning rather than failing — but this is a deliberate non-block, not a silent no-op. A second deliberate non-block is a *missing requirements source* (`requirements-source: none`), which is a legitimate review input that skips the scope-creep category by design, not an error.
|
|
16
|
+
|
|
17
|
+
## Step 0: Artifact Verification
|
|
18
|
+
|
|
19
|
+
Every phase receives an artifact from the previous phase (or the Orchestrator, for Scope). 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
|
+
| `review-input` | `type`, `timestamp`, `source`, `status`, input shape (`change-set` **or** `work-id`/Work `review-id` **or** `ad-hoc`), `interactionMode` | Orchestrator |
|
|
36
|
+
| `review-scope` | `scope-id`, `review-id`, `input-shape`, `status`, `interactionMode`, `change-boundary` (`required` + `context` + `attribution`), `requirements-source`, `preliminary-scope-creep` | Scope |
|
|
37
|
+
| `review-kit` | `prepare-id`, `scope-id`, `review-id`, `input-shape`, `status`, `interactionMode`, `diffs`, `spec-content` (or `none`), `test-context`, `tool-inventory` | Prepare |
|
|
38
|
+
| `findings` | `analyze-id`, `prepare-id`, `scope-id`, `review-id`, `input-shape`, `status`, `interactionMode`, findings list, per-category tallies, per-severity tallies | Analyze |
|
|
39
|
+
| `review-report` | `report-id`, `analyze-id`, `prepare-id`, `scope-id`, `review-id`, `input-shape`, `status`, `interactionMode`, `approval-status`, findings rollup, `recommendations`, `scope-creep-summary` | Report |
|
|
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
|
+
| `status` field is `failed` or `pending` | Reject; ask Orchestrator to re-run previous phase | Yes |
|
|
62
|
+
| Artifact `type` does not match expected input | Reject; ask Orchestrator to check phase ordering | Yes |
|
|
63
|
+
| YAML frontmatter has syntax errors | Log error with line number; ask user to fix or re-run phase | No |
|
|
64
|
+
| Findings coherence violated (Step 0 of Report) | Re-run Analyze — a finding lacks severity/category/location/trace | No |
|
|
65
|
+
|
|
66
|
+
### Category 3: Invalid Review Input
|
|
67
|
+
|
|
68
|
+
Only applies to the Scope phase (Step 0) when resolving a Review Input Artifact.
|
|
69
|
+
|
|
70
|
+
| Trigger | Recovery Action | Terminate? |
|
|
71
|
+
| ---------------------------------------------------- | --------------------------------------------------------- | ---------- |
|
|
72
|
+
| All three input shapes empty or ambiguous | Ask: "What would you like to review? git ref/range, work-id, or describe." | No |
|
|
73
|
+
| Change-set spec parses but the repo is not a git working tree | Ask to switch to ad-hoc input | No |
|
|
74
|
+
| Change-set diff is empty (spec touches no files) | Record `change-boundary.empty: true`; continue (Report records nothing-to-review) | No |
|
|
75
|
+
| Work-linked `work-id` with no `docs/tasks/<id>/index.md` | Ask to run `/work <work-id>` first, or switch to change-set | No |
|
|
76
|
+
| Work-linked Work `review-id` file missing | Ask to switch to the `work-id` of that run | No |
|
|
77
|
+
| Ad-hoc description maps to no concrete files/commits | Ask the user to name a file, module, or path | No |
|
|
78
|
+
|
|
79
|
+
### Category 4: File System Errors
|
|
80
|
+
|
|
81
|
+
Errors encountered while saving or reading artifact files.
|
|
82
|
+
|
|
83
|
+
| Trigger | Recovery Action | Terminate? |
|
|
84
|
+
| ------------------------------------------------ | ----------------------------------------------------------------- | ------------------ |
|
|
85
|
+
| Target directory does not exist | Create directory (`mkdir -p`); treat counter as 0; start from 001 | No |
|
|
86
|
+
| Counter directory exists but no files match date | Start counter at 001 | No |
|
|
87
|
+
| File write permission denied | Log error; ask user to check permissions; retry once | Yes, after 1 retry |
|
|
88
|
+
| `docs/plans/.review/index.md` registry missing | Create it with a `# Reviews` header (Pre-Flight already creates; idempotent) | No |
|
|
89
|
+
| `docs/tasks/<work-id>/index.md` missing (Report cross-link) | Skip the cross-link; note the absence in the report (do not fabricate a work index) | No |
|
|
90
|
+
|
|
91
|
+
### Category 5: Interaction Mode Errors
|
|
92
|
+
|
|
93
|
+
Errors related to `interactionMode` propagation.
|
|
94
|
+
|
|
95
|
+
| Trigger | Recovery Action | Terminate? |
|
|
96
|
+
| ---------------------------------------- | ---------------------------------------------------------- | ---------- |
|
|
97
|
+
| Mode missing from incoming artifact | Default to "smart"; log warning; continue | No |
|
|
98
|
+
| Mode value is not in enum | Reject; re-prompt Orchestrator to set valid mode | Yes |
|
|
99
|
+
| User selects "Abort" during confirmation | Stop immediately; inform Orchestrator of abort with reason | Yes |
|
|
100
|
+
| User does not respond (timeout) | Pause; ask user to retry or abort | No |
|
|
101
|
+
|
|
102
|
+
### Category 6: Analysis Errors (Analyze phase)
|
|
103
|
+
|
|
104
|
+
| Trigger | Recovery Action | Terminate? |
|
|
105
|
+
| ---------------------------------------------------- | ------------------------------------------------------------------ | ---------- |
|
|
106
|
+
| No review categories produced (empty Findings unexpectedly) | Re-run Analyze Step 1; confirm the kit's diffs were non-empty | No |
|
|
107
|
+
| A finding lacks a `trace` or `scope-creep` flag (coherence) | Reject the findings set; re-run Analyze Steps 1–3 | No |
|
|
108
|
+
| Tool corroboration fails (tool unavailable/unconfigured) | Proceed without corroboration; note it on the finding (Prepare already warned) | No |
|
|
109
|
+
| Scope-creep category emitted findings with `spec-content: none` | Reject; re-run Analyze — scope-creep requires requirements | No |
|
|
110
|
+
|
|
111
|
+
## Recovery Workflow
|
|
112
|
+
|
|
113
|
+
When a verification failure is detected in Step 0, apply this workflow:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
1. Identify the error category (1-6) from the tables above
|
|
117
|
+
2. Look up the specific trigger to find the recovery action
|
|
118
|
+
3. Execute the recovery action:
|
|
119
|
+
- If recovery is "ask user": ask one question with clear options (2-4 concrete choices)
|
|
120
|
+
- If recovery is "re-run previous phase": return to Orchestrator with error context
|
|
121
|
+
- If recovery is "default and continue": apply default, log warning, proceed
|
|
122
|
+
4. If terminate = Yes: stop and inform Orchestrator with:
|
|
123
|
+
- Error category and trigger
|
|
124
|
+
- Recovery action attempted
|
|
125
|
+
- Reason for termination
|
|
126
|
+
5. If terminate = No: after recovery, continue to Step 1 of the phase
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Retry Limits
|
|
130
|
+
|
|
131
|
+
- **Maximum retries per error:** 1
|
|
132
|
+
- **Maximum total retries per phase:** 2
|
|
133
|
+
- After exhausting phase retries, terminate with a clear error suggesting the user re-run the review workflow from the start or resume from the last complete phase.
|
|
134
|
+
|
|
135
|
+
> Review is **not resume-safe** like Work execution: re-running Review re-derives findings fresh because the change set may have evolved. The retry limits above apply to within-phase recovery of a malformed/missing artifact, not to resuming an interrupted review run.
|
|
136
|
+
|
|
137
|
+
## Error Reporting Format
|
|
138
|
+
|
|
139
|
+
When reporting an error to the Orchestrator or user, use this format:
|
|
140
|
+
|
|
141
|
+
```yaml
|
|
142
|
+
error:
|
|
143
|
+
phase: scope | prepare | analyze | report
|
|
144
|
+
step: 0 | 1 | 2 | ...
|
|
145
|
+
category: 1 | 2 | 3 | 4 | 5 | 6
|
|
146
|
+
trigger: "[specific trigger description]"
|
|
147
|
+
recovery_attempted: "[action taken]"
|
|
148
|
+
outcome: recovered | terminated
|
|
149
|
+
suggestion: "[next step for the user or Orchestrator]"
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Cross-Phase Consistency Checks
|
|
153
|
+
|
|
154
|
+
The Orchestrator should verify consistency between phases:
|
|
155
|
+
|
|
156
|
+
| Check | Action on Failure |
|
|
157
|
+
| --------------------------------------------------------------------- | ------------------------------------------- |
|
|
158
|
+
| `review-id` in downstream artifact matches the Scope output | Reject; re-run from Scope |
|
|
159
|
+
| `scope-id` in Prepare+ matches Scope output | Reject; re-run from Scope |
|
|
160
|
+
| `prepare-id` in Analyze+ matches Prepare output | Reject; re-run from Prepare |
|
|
161
|
+
| `analyze-id` in Report matches Analyze output | Reject; re-run from Analyze |
|
|
162
|
+
| `interactionMode` is identical across all artifacts | Log warning; use earliest non-default value |
|
|
163
|
+
| `work-id` (work-linked only) carried consistently where present | Log warning; do not fabricate |
|
|
164
|
+
|
|
165
|
+
## Notes
|
|
166
|
+
|
|
167
|
+
- All errors and warnings should be logged with a timestamp for debugging.
|
|
168
|
+
- When a phase terminates, its saved artifact (if any) should be marked `status: failed`.
|
|
169
|
+
- The Orchestrator is responsible for deciding whether to retry the entire workflow or re-run from the last successful phase.
|
|
170
|
+
- 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.
|
|
171
|
+
- A `requirements-source: none` input is a **legitimate** review configuration (Category 3 handles empty/ambiguous input; `none` is the documented skip path for the scope-creep category), not an error.
|
|
172
|
+
- This reference is shared by all four phases; phase-specific handling is documented inline in the respective module.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Artifact ID Generation
|
|
3
|
+
description: Reference for Scope, Prepare, Analyze, and Report phases. Defines the daily-counter algorithm for unique artifact IDs, the review-id umbrella allocation (distinct from a Work review-id), the recycle-on-edit rule, and the shared counter layout under docs/plans/.review/.
|
|
4
|
+
type: reference
|
|
5
|
+
version: 1.0
|
|
6
|
+
timestamp: "2026-08-08"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Artifact ID Generation
|
|
10
|
+
|
|
11
|
+
Shared ID algorithm for the `scope`, `prepare`, `analyze`, and `report` phases, plus the `review-id` umbrella allocation in Scope. 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
|
+
| Scope | `YYYY-MM-DD-NNN-scope` | `docs/plans/.review/.scope/<id>.md` |
|
|
18
|
+
| Prepare | `YYYY-MM-DD-NNN-prepare` | `docs/plans/.review/.prepare/<id>.md` |
|
|
19
|
+
| Analyze | `YYYY-MM-DD-NNN-analyze` | `docs/plans/.review/.analyze/<id>.md` |
|
|
20
|
+
| Report | `YYYY-MM-DD-NNN-report` | `docs/plans/.review/.report/<id>.md` |
|
|
21
|
+
|
|
22
|
+
`review-id` (see below) is the umbrella shared across all four artifacts of a single review run.
|
|
23
|
+
|
|
24
|
+
## review-id
|
|
25
|
+
|
|
26
|
+
The `review-id` is the umbrella key that ties all four phase artifacts together and keys the registry row / work-index block. It is allocated **once** in Scope Step 2 (the allocating phase) and carried through Prepare/Analyze/Report unchanged.
|
|
27
|
+
|
|
28
|
+
**Format:** `YYYY-MM-DD-NNN` (date + zero-padded 3-digit daily counter), counting existing `docs/plans/.review/.scope/YYYY-MM-DD-NNN-scope.md` files for that date (the scope phase is the allocating phase, so its counter is the source of truth for the umbrella id).
|
|
29
|
+
|
|
30
|
+
> **Distinct from a Work `review-id`.** When Review is invoked over a `/work` run (`input-shape: work-linked`), the Work skill's own `review-id` (`docs/plans/.work/.review/...`) **already exists**. The Review skill allocates its **own** `review-id` (`docs/plans/.review/...`) — the two skills produce independent artifacts and never share an id. The `work-id` is carried alongside in the Review artifacts for traceability and the work-index cross-link, but `review-id` ≠ Work `review-id`.
|
|
31
|
+
|
|
32
|
+
## Algorithm (new phase artifact)
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
1. Get the current date in UTC (e.g., 2026-08-08)
|
|
36
|
+
2. List existing files for today in the phase's save directory:
|
|
37
|
+
- scope -> docs/plans/.review/.scope/ matching YYYY-MM-DD-*-scope.md
|
|
38
|
+
- prepare -> docs/plans/.review/.prepare/ matching YYYY-MM-DD-*-prepare.md
|
|
39
|
+
- analyze -> docs/plans/.review/.analyze/ matching YYYY-MM-DD-*-analyze.md
|
|
40
|
+
- report -> docs/plans/.review/.report/ matching YYYY-MM-DD-*-report.md
|
|
41
|
+
3. NNN = (count + 1), zero-padded to 3 digits (001, 002, ..., 010, ...)
|
|
42
|
+
4. id = "<date>-<NNN>-<phase>"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If two scope artifacts were created today, the next one is `2026-08-08-003-scope`. Counters are independent per phase; each phase counts only its own files.
|
|
46
|
+
|
|
47
|
+
## Algorithm (review-id umbrella allocation)
|
|
48
|
+
|
|
49
|
+
Allocated **only** in Scope Step 2:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
1. Get the current date in UTC
|
|
53
|
+
2. List existing files under docs/plans/.review/.scope/ matching YYYY-MM-DD-NNN-scope.md for that date
|
|
54
|
+
3. NNN = (highest existing NNN for that date), zero-padded to 3 digits
|
|
55
|
+
- if none exist for that date, start at 001
|
|
56
|
+
4. review-id = "<date>-<NNN>" (the same NNN as the scope-id being allocated)
|
|
57
|
+
5. Write the scope artifact with both review-id and scope-id
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Because `review-id` reuses the scope counter's NNN, the umbrella id and the `scope-id` share the same date+counter suffix (e.g., `review-id: 2026-08-08-001` → `scope-id: 2026-08-08-001-scope`). Subsequent phases (`prepare-id`, `analyze-id`, `report-id`) **reuse that same NNN** if available on the same date — they do **not** independently allocate a new NNN that could orphan from the umbrella id. If the NNN is taken by an unrelated artifact on the same date in a later phase directory (rare), the later phase appends and notes the divergence in its artifact (the umbrella `review-id` is still carried everywhere).
|
|
61
|
+
|
|
62
|
+
## Recycle on Edit & Retry
|
|
63
|
+
|
|
64
|
+
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 Report phase's registry row in `docs/plans/.review/index.md` and the `## Review Report — <report-id>` block in the work index are likewise idempotent on `report-id` (overwritten, never duplicated).
|
|
65
|
+
|
|
66
|
+
## Error Handling
|
|
67
|
+
|
|
68
|
+
| Trigger | Action |
|
|
69
|
+
| ----------------------------------------------- | -------------------------------------------- |
|
|
70
|
+
| Phase save directory does not exist | Create it; treat count as 0; start from 001 |
|
|
71
|
+
| Directory exists but no files match today's date | Start counter at 001 |
|
|
72
|
+
| `docs/plans/.review/` missing | Create it (Pre-Flight already creates; idempotent) |
|
|
73
|
+
| Write permission denied | Log error; ask the user; retry once |
|
|
74
|
+
|
|
75
|
+
## Notes
|
|
76
|
+
|
|
77
|
+
- IDs reuse the daily-counter algorithm for cross-skill consistency with `/plan` and `/work`; the Review skill's counters are independent from those skills (separate save directories under `docs/plans/.review/` vs `.work/`).
|
|
78
|
+
- `review-id` carries through every artifact (`scope-id` artifacts record it; Prepare/Analyze/Report inherit it), so cross-phase chaining is `scope-id → prepare-id → analyze-id → report-id`, all sharing one `review-id` (see [error-handling.md](error-handling.md) "Cross-Phase Consistency Checks").
|
|
79
|
+
- For work-linked input, `work-id` is **additionally** carried (inherited from the Review Input Artifact), distinct from `review-id`, for the registry cross-link only.
|
|
80
|
+
- 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 Review pipeline (Scope -> Prepare -> Analyze -> Report). Set at the Orchestrator; each phase reads and applies mode-specific behavior. Review has no execution mode — only interactionMode.
|
|
4
|
+
type: reference
|
|
5
|
+
version: 1.0
|
|
6
|
+
timestamp: "2026-08-08"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Interaction Mode Propagation
|
|
10
|
+
|
|
11
|
+
Reference for how `interactionMode` propagates through the Review pipeline (`Scope → Prepare → Analyze → Report`). Set at the Orchestrator; each phase reads and applies mode-specific behavior.
|
|
12
|
+
|
|
13
|
+
> `interactionMode` governs **when to pause for the user**. Unlike the Work skill, **Review has no execution mode** — analysis is a single forward pass over the diffs, not a multi-task run, so there is no `executionMode` selector. Only `interactionMode` is carried through every artifact.
|
|
14
|
+
|
|
15
|
+
## Modes
|
|
16
|
+
|
|
17
|
+
| Mode | Behavior | Use Case |
|
|
18
|
+
| ------------- | ----------------------------------------------------- | ------------------------------------ |
|
|
19
|
+
| **Detailed** | Pause at each phase; present artifacts; require approval | High-stakes or sensitive reviews, unfamiliar changes |
|
|
20
|
+
| **Smart** | Auto-proceed; pause only on HIGH-severity findings (blocker/major) or detected scope creep | Familiar changes with guardrails |
|
|
21
|
+
| **Autopilot** | Run all phases auto (Report still presented) | Routine reviews of well-understood changes |
|
|
22
|
+
|
|
23
|
+
## Phase Behavior by Mode
|
|
24
|
+
|
|
25
|
+
| Phase | Detailed | Smart | Autopilot |
|
|
26
|
+
| ------------ | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- | --------------------------------- |
|
|
27
|
+
| **Scope** | Present review scope; ask Proceed/Edit/Abort | Auto-proceed; pause if ad-hoc inferred boundary, ambiguous requirements, or preliminary scope-creep detected | Auto-proceed |
|
|
28
|
+
| **Prepare** | Present review kit; ask Proceed/Edit/Abort | Auto-proceed; pause if partial spec resolution, a no-coverage test gap, or no linter configured | Auto-proceed |
|
|
29
|
+
| **Analyze** | Present findings; ask Proceed/Edit/Abort | Auto-proceed; pause if any `blocker`/`major` finding, scope-creep confirmed, or creep tally differs from Scope's preliminary count | Auto-proceed |
|
|
30
|
+
| **Report** | Present review report; ask Finalize/Edit/Abort | Auto-proceed; pause if `changes-requested`/`rejected`, 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 Scope).
|
|
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 change-set review:**
|
|
54
|
+
|
|
55
|
+
- Scope parses a `<base>..<head>` diff (not inferred) → auto-proceeds
|
|
56
|
+
- Prepare resolves a present spec fully, finds test coverage and a configured linter → auto-proceeds
|
|
57
|
+
- Analyze finds one `major` quality finding and no scope-creep → pauses (major finding trigger)
|
|
58
|
+
- User reviews the major finding, confirms it's real (chooses Proceed to Report)
|
|
59
|
+
- Report derives `changes-requested`, learnings-to-capture non-empty → pauses (changes-requested + learnings triggers)
|
|
60
|
+
- User finalizes; the Report is saved and the registry row appended
|
|
61
|
+
|
|
62
|
+
**Result:** Paused only for the genuine major finding and the change-requested finalization; faster than Detailed with safety guardrails.
|
|
63
|
+
|
|
64
|
+
## No Execution Mode (contrast with Work)
|
|
65
|
+
|
|
66
|
+
Review deliberately has **no** `executionMode`:
|
|
67
|
+
|
|
68
|
+
- Work's `executionMode` (`inline`/`serial`/`parallel`) governs how multiple independent **tasks** run — Review has no multi-task concept; analysis is a single forward pass over the change boundary.
|
|
69
|
+
- The orchestrator's quality gate #2 for Review cross-checks **only** `interactionMode` (not `interactionMode` + `executionMode` as in Work).
|
|
70
|
+
- A `blocker`/`major` finding is the Review analog of Work's HIGH-risk flag: it triggers pause behavior, but via `interactionMode`'s Smart triggers, not a separate mode.
|
|
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,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Review Categories
|
|
3
|
+
description: Authoritative reference for the Analyze phase. Defines the six review categories (quality, security, tests, documentation, integration, scope-creep) and the per-category checks Analyze runs across the Review Kit's diffs. Analyze applies the categories; it does not re-encode them.
|
|
4
|
+
type: reference
|
|
5
|
+
version: 1.0
|
|
6
|
+
timestamp: "2026-08-08"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Review Categories
|
|
10
|
+
|
|
11
|
+
Authoritative reference for the **Analyze** phase (Step 1). Defines the six review categories and the per-category checks Analyze runs across the Review Kit's diffs. Each finding is tagged with exactly one `category` from this reference, a `severity` per [severity-rubric.md](severity-rubric.md), and a `location` (repository-relative `file:line` or `file:hunk`). Analyze applies the categories; it does not re-encode them.
|
|
12
|
+
|
|
13
|
+
## The Six Categories
|
|
14
|
+
|
|
15
|
+
| Category | What it reviews | Runs when |
|
|
16
|
+
| --------------- | ------------------------------------------------------------------------ | ------------------------------- |
|
|
17
|
+
| `quality` | Design, clarity, DRY, naming, error handling, structural soundness | Always |
|
|
18
|
+
| `security` | Input validation, authn/authz, secrets, injection, unsafe patterns | Always |
|
|
19
|
+
| `tests` | **Test the tests:** coverage, assertion correctness, flakiness, test smells, missing tests | Always |
|
|
20
|
+
| `documentation` | Public API docs, README, inline comments, changelog for changed behavior | Always |
|
|
21
|
+
| `integration` | Caller/contract impact, module boundaries, project conventions, consumer breakage | Always |
|
|
22
|
+
| `scope-creep` | Changes beyond the resolved requirements | Only when `spec-content` not `none` |
|
|
23
|
+
|
|
24
|
+
The scope-creep category is the only conditional one; the other five always run. Its detection logic is authoritative in [scope-creep-detection.md](scope-creep-detection.md); this reference lists it only as a category and points to that file for the algorithm.
|
|
25
|
+
|
|
26
|
+
## Per-Category Checks
|
|
27
|
+
|
|
28
|
+
### quality
|
|
29
|
+
|
|
30
|
+
Review the changed production code (and the non-test parts of touched files) for:
|
|
31
|
+
|
|
32
|
+
| Check | Criteria (authoritative) |
|
|
33
|
+
| ---------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
34
|
+
| Design & structure | The change fits the existing architecture; no gratuitous abstraction or premature layering |
|
|
35
|
+
| Clarity | Intent is readable; no cryptic or misnamed symbols; complex logic is commented where needed |
|
|
36
|
+
| DRY | No duplicated logic introduced by the change that belongs in a shared helper |
|
|
37
|
+
| Naming | Identifiers are intention-revealing (matches project conventions) |
|
|
38
|
+
| Error handling | Errors are propagated/handled explicitly, not swallowed; no silent `catch` that hides root causes |
|
|
39
|
+
| Structural soundness | Functions/classes do one thing; no overlarge units introduced; no speculative generality |
|
|
40
|
+
|
|
41
|
+
Trim, don't add: a quality finding is warranted when the change **introduces** a smell, not by a pre-existing condition outside the change boundary.
|
|
42
|
+
|
|
43
|
+
### security
|
|
44
|
+
|
|
45
|
+
Review the change for:
|
|
46
|
+
|
|
47
|
+
| Check | Criteria (authoritative) |
|
|
48
|
+
| ---------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
49
|
+
| Input validation | User/external input is validated at the boundary; no untrusted data flowing unchecked |
|
|
50
|
+
| Authn / authz | Authentication/authorization checks are present where the change touches a protected path |
|
|
51
|
+
| Secret leakage | No secrets (API keys, tokens, passwords) added to code/config/logs; no secret committed to disk |
|
|
52
|
+
| Injection | No SQL/OS/command/template injection introduced; parameterized queries used |
|
|
53
|
+
| Unsafe patterns | No `eval`/`exec`/`innerHTML`/deserialization-of-untrusted-data/path-traversal introduced |
|
|
54
|
+
| Dependency safety | No known-vulnerable dependency added (Analyze notes it; corroborate with a scanner if configured) |
|
|
55
|
+
|
|
56
|
+
A security finding is almost always at least `major`, often `blocker` per [severity-rubric.md](severity-rubric.md).
|
|
57
|
+
|
|
58
|
+
### tests
|
|
59
|
+
|
|
60
|
+
**Test the tests** — evaluate the tests that accompany the change, not just production code. Use the Review Kit's `test-context` (covering tests per changed file; whether the change ships its own tests):
|
|
61
|
+
|
|
62
|
+
| Check | Criteria (authoritative) |
|
|
63
|
+
| ---------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
64
|
+
| Coverage | Changed behavior is covered by a test; a production-code change with **no** accompanying test is a finding |
|
|
65
|
+
| Assertion correctness | Tests assert the **intended** behavior (the Acceptance Criterion / expected behavior), not incidental implementation details |
|
|
66
|
+
| Flakiness | No timing/order-dependent assertions, no shared mutable state, no reliance on external network/state |
|
|
67
|
+
| Test smells | No skipped/`.only`/commented-out assertions; no brittle string-matching where structural checks suffice |
|
|
68
|
+
| Boundary cases | Edge cases (empty, null, max, error paths) are covered where the behavior warrants it |
|
|
69
|
+
|
|
70
|
+
> A change that adds production code without any test is itself a `major` finding (or `blocker` if the changed behavior is security/core-flow). This is the **most important** tests-category signal.
|
|
71
|
+
|
|
72
|
+
### documentation
|
|
73
|
+
|
|
74
|
+
Review the change for:
|
|
75
|
+
|
|
76
|
+
| Check | Criteria (authoritative) |
|
|
77
|
+
| ---------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
78
|
+
| Public API docs | New/changed public exports are documented (JSDoc/docstrings/OpenAPI) where the project documents them |
|
|
79
|
+
| README / changelog | User-facing behavior changes are noted in README/CHANGELOG per project convention |
|
|
80
|
+
| Inline comments | Non-obvious logic is commented (intent, not mechanics); no commented-out code left |
|
|
81
|
+
| Removed docs | When behavior is removed/deprecated, the docs are updated to match (no stale references) |
|
|
82
|
+
|
|
83
|
+
Documentation findings are typically `minor`/`nit` unless the change silently alters a public/documented behavior (then `major`).
|
|
84
|
+
|
|
85
|
+
### integration
|
|
86
|
+
|
|
87
|
+
Review the change's impact on the surrounding system (use the Review Kit's `context` callers/importers):
|
|
88
|
+
|
|
89
|
+
| Check | Criteria (authoritative) |
|
|
90
|
+
| ---------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
91
|
+
| Caller / contract impact| Callers of changed public symbols still compile/behave; no silent contract break |
|
|
92
|
+
| Module boundaries | The change respects module boundaries; no cross-boundary coupling introduced |
|
|
93
|
+
| Project conventions | The change follows the project's conventions (naming, layering, import rules, error style) |
|
|
94
|
+
| Consumer breakage | No downstream consumer (internal or external) is broken by the change |
|
|
95
|
+
| Backward compatibility | Backward-incompatible changes are deliberate and surfaced (not silent) |
|
|
96
|
+
|
|
97
|
+
An integration finding that breaks consumers is typically `major`; a silent breaking change is `blocker`.
|
|
98
|
+
|
|
99
|
+
### scope-creep
|
|
100
|
+
|
|
101
|
+
**Only when `spec-content` is not `none`.** The detection algorithm is authoritative in [scope-creep-detection.md](scope-creep-detection.md). Each creep finding carries `scope-creep: true` (never a `trace`) and a `location`. When `spec-content: none`, Analyze records this category as `skipped (no requirements)` and emits no scope-creep findings.
|
|
102
|
+
|
|
103
|
+
## How to Use This Reference (Analyze)
|
|
104
|
+
|
|
105
|
+
1. For each changed file in the Review Kit's `diffs`, run the five always-on categories against the hunks.
|
|
106
|
+
2. Run the scope-creep category only when `spec-content` is present, per [scope-creep-detection.md](scope-creep-detection.md).
|
|
107
|
+
3. Tag each finding with exactly one `category` from the table above, a `severity` from [severity-rubric.md](severity-rubric.md), and a `location`.
|
|
108
|
+
4. Attach a `trace` **or** `scope-creep: true` flag per [scope-creep-detection.md](scope-creep-detection.md).
|
|
109
|
+
5. Optionally corroborate a finding with a configured tool (linter/type-checker/test run) — tools corroborate, they never create findings outside the change boundary.
|
|
110
|
+
|
|
111
|
+
## Failure-Condition Reference
|
|
112
|
+
|
|
113
|
+
| Trigger | Outcome per this reference |
|
|
114
|
+
| ------------------------------------------------------ | ----------------------------------------------------------- |
|
|
115
|
+
| Production-code change with no accompanying test | `tests` finding (signal severity per rubric) |
|
|
116
|
+
| Scope-creep category invoked with `spec-content: none` | Reject per [error-handling.md](error-handling.md) Category 6 |
|
|
117
|
+
| Finding with no `category` from this reference | Reject (Category 2 / Category 6 recovery) |
|
|
118
|
+
| A finding warranted only by a pre-existing repo condition (outside the change boundary) | Drop the finding — Review reviews the change, not the whole repo |
|
|
119
|
+
|
|
120
|
+
## Notes
|
|
121
|
+
|
|
122
|
+
- This reference is the single source of truth for the category set and per-category check criteria. Analyze applies it; Report aggregates by category and never re-defines the checks.
|
|
123
|
+
- Tools (linters/type-checkers/test runs) are **corroborative only** — a finding must be warranted by the change under review, never by a pre-existing condition elsewhere in the repo. This is the guardrail against "Review became a repo-wide audit."
|
|
124
|
+
- The scope-creep category deliberately defers to [scope-creep-detection.md](scope-creep-detection.md) for its algorithm; this reference lists it only as a category to avoid re-encoding the detection rules in two places (honoring single-source-of-truth).
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Scope-Creep Detection
|
|
3
|
+
description: Authoritative reference for the Scope phase (Step 4 pre-check) and the Analyze phase (final scope-creep category). Defines how changed files/behaviors are compared against resolved requirements to detect changes beyond the intended scope, the requirement-trace logic, and the rule that scope-creep can only run when a requirements source is present.
|
|
4
|
+
type: reference
|
|
5
|
+
version: 1.0
|
|
6
|
+
timestamp: "2026-08-08"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Scope-Creep Detection
|
|
10
|
+
|
|
11
|
+
Authoritative reference for the **Scope** phase (Step 4 preliminary check) and the **Analyze** phase (Step 1, scope-creep category). Defines how the `required` file list and changed behaviors are compared against resolved requirements to detect changes **beyond the intended scope**, the **requirement-trace** logic attached to every finding, and the hard rule that the scope-creep category can only run when a requirements source is present. Scope and Analyze apply this reference; they do not re-encode it.
|
|
12
|
+
|
|
13
|
+
## Core Rule
|
|
14
|
+
|
|
15
|
+
> **Scope-creep detection requires requirements.** The category runs **only** when `requirements-source` is not `none`. When `requirements-source: none`, the category is **skipped** with the recorded note `skipped (no requirements)` and emits **no** scope-creep findings. Review never invents requirements to test against — without a spec, scope-creep is unmeasurable, and that is recorded explicitly, not silently.
|
|
16
|
+
|
|
17
|
+
This single rule prevents the most common mis-escalation (flagging "creep" against an imagined contract). A missing spec is a legitimate review configuration, not an error (see [error-handling.md](error-handling.md)).
|
|
18
|
+
|
|
19
|
+
## Resolved Requirements Shape
|
|
20
|
+
|
|
21
|
+
When `requirements-source` is present, Scope (Step 3) resolves it into a structured list:
|
|
22
|
+
|
|
23
|
+
```yaml
|
|
24
|
+
spec-content:
|
|
25
|
+
- criterion: "C1: Redis client connects with retry"
|
|
26
|
+
expected-behavior:
|
|
27
|
+
- "connect() reads REDIS_URL"
|
|
28
|
+
- "connect() retries up to 3 times on connection failure"
|
|
29
|
+
- criterion: "C2: SessionStore exports get/save/delete"
|
|
30
|
+
expected-behavior:
|
|
31
|
+
- "get(key) returns the stored value or null"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Each requirement has a short `criterion` id (e.g. `C1`, `C2`) and a list of `expected-behavior` bullets. The requirement ids become the `trace` values Analyze attaches to in-scope findings.
|
|
35
|
+
|
|
36
|
+
## Requirement Trace vs Scope-Creep Flag
|
|
37
|
+
|
|
38
|
+
Every finding produced by Analyze carries **either** a `trace` **or** a `scope-creep: true` flag (orchestrator quality gate #5):
|
|
39
|
+
|
|
40
|
+
| Field | When | Example |
|
|
41
|
+
| -------------------- | ------------------------------------------------------------------- | -------------------------------------- |
|
|
42
|
+
| `trace: <criterion>` | The finding is **inside** the intended scope, relating to a requirement | `trace: C1` (a quality issue in the redis connect code) |
|
|
43
|
+
| `trace: general-quality` | The finding is within the change's intent but not tied to one criterion (acceptable trace) | a naming issue in a touched helper |
|
|
44
|
+
| `trace: no-requirements` | The finding is a quality/security/test/doc/integration issue but `spec-content: none` (scope-creep cannot be assessed) | any finding when there is no spec |
|
|
45
|
+
| `scope-creep: true` | The finding describes a change **beyond** the requirements (the creep itself, not a defect) | a file/behavior with no requirement it serves |
|
|
46
|
+
|
|
47
|
+
> `scope-creep: true` is **never** set when `spec-content: none` — without requirements, "beyond scope" is undefined. Such findings carry `trace: no-requirements` instead.
|
|
48
|
+
|
|
49
|
+
## Detection Algorithm (Scope Step 4 — preliminary)
|
|
50
|
+
|
|
51
|
+
Run only when `requirements-source` is not `none`. This is a **preliminary** file-level check; Analyze confirms with severity.
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
1. For each file in change-boundary.required:
|
|
55
|
+
- find the requirement(s) it serves (by path/convention match against spec-content)
|
|
56
|
+
- if a required file or a changed behavior maps to NO requirement:
|
|
57
|
+
-> add a preliminary scope-creep candidate: { file, candidate-reason }
|
|
58
|
+
2. For each requirement in spec-content:
|
|
59
|
+
- if NO required file maps to it (expected change is absent):
|
|
60
|
+
-> add a preliminary gap candidate: { criterion, expected-but-absent }
|
|
61
|
+
(this is reported for context, NOT as creep — it's an omission, not creep)
|
|
62
|
+
3. Record preliminary-scope-creep: [...] (or "none")
|
|
63
|
+
4. If requirements-source: none -> record preliminary-scope-creep: "skipped (no requirements)"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The preliminary check is deliberately **coarse** (file-level); Analyze's final category check operates at the file-and-behavior level and assigns severity. The gap candidates (expected-but-absent) are surfaced for Analyze's tests/integration categories (coverage gaps), **not** mislabeled as creep.
|
|
67
|
+
|
|
68
|
+
## Detection Algorithm (Analyze Step 1, scope-creep category — final)
|
|
69
|
+
|
|
70
|
+
Run only when `spec-content` is not `none`. Confirms Scope's preliminary candidates and detects behavior-level creep.
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
1. Carry Scope's preliminary-scope-creep candidates as the starting set
|
|
74
|
+
2. For each candidate, inspect the hunks (from the Review Kit's diffs):
|
|
75
|
+
- confirm the changed behaviors are not traceable to any requirement
|
|
76
|
+
- if genuinely beyond scope -> emit a finding:
|
|
77
|
+
{ severity (per severity-rubric), category: scope-creep,
|
|
78
|
+
location: file:hunk, message: "change beyond <criterion-set>",
|
|
79
|
+
scope-creep: true }
|
|
80
|
+
3. Detect behavior-level creep not caught by the file-level pre-check:
|
|
81
|
+
- a changed file that DOES map to a requirement, but a specific hunk/
|
|
82
|
+
added behavior within it serves no requirement
|
|
83
|
+
- emit a finding with scope-creep: true and a precise file:hunk location
|
|
84
|
+
4. Reconcile with Scope's preliminary count:
|
|
85
|
+
- if the confirmed creep count differs from the preliminary count,
|
|
86
|
+
that is an Analyze Smart pause trigger (the user confirms the delta)
|
|
87
|
+
5. If spec-content: none -> record the scope-creep category as
|
|
88
|
+
"skipped (no requirements)" and emit no scope-creep findings
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Severity of Scope-Creep Findings
|
|
92
|
+
|
|
93
|
+
Scope-creep findings carry a severity per [severity-rubric.md](severity-rubric.md):
|
|
94
|
+
|
|
95
|
+
- A creep that introduces a **new public API / behavior / dependency** outside the requirements → typically **major** (it expands the merge's surface area).
|
|
96
|
+
- A creep that is a small, incidental edit (e.g. a stray comment region, an unrelated formatting change in a touched file) → **minor** or **nit**.
|
|
97
|
+
- A creep that introduces a security hole or breaks a core flow → escalate via the rubric to **blocker** (rare; the issue is the security break, traced as scope-creep).
|
|
98
|
+
|
|
99
|
+
Report's approval derivation treats **any** `scope-creep: true` finding as forcing `changes-requested` (see [approval-criteria.md](approval-criteria.md)) — creep always asks for a decision before merge.
|
|
100
|
+
|
|
101
|
+
## Work-linked Edge Cases
|
|
102
|
+
|
|
103
|
+
For `input-shape: work-linked`:
|
|
104
|
+
|
|
105
|
+
- The Work Manifest's resolved task list and each task's single Acceptance Criterion **are** the de facto requirements when Scope maps `requirements-source` to those task criteria. Scope records `requirements-source.type: plan-id | task-criterion` accordingly.
|
|
106
|
+
- A `dependency-warning: expanded-to-upstream` from the Work run is **expected** (the user explicitly expanded scope), **not** creep — Analyze must not flag upstream-task files as creep when the Work record shows the expansion was authorized.
|
|
107
|
+
- A `tentative` (blocked/skipped) task's files are still reviewed, but creep findings on them are flagged with the `tentative` note so the reviewer knows the file may not reflect final intent.
|
|
108
|
+
|
|
109
|
+
## Validation (Scope Step 4 / Analyze Step 1 re-checks)
|
|
110
|
+
|
|
111
|
+
- The category ran only when requirements were present (else explicitly skipped with the note).
|
|
112
|
+
- Every scope-creep finding carries `scope-creep: true` (never a `trace`) and a `location`.
|
|
113
|
+
- No scope-creep finding was emitted when `spec-content: none`.
|
|
114
|
+
- The confirmed count reconciles with the preliminary count (any delta is a documented Analyze pause trigger, not a silent discrepancy).
|
|
115
|
+
|
|
116
|
+
## Notes
|
|
117
|
+
|
|
118
|
+
- This reference is the single source of truth for the detection algorithm, the trace vs scope-creep-flag logic, and the "requires requirements" rule.
|
|
119
|
+
- Scope applies the preliminary check; Analyze applies the final check; Report derives approval from the creep flag (per [approval-criteria.md](approval-criteria.md)); neither the modules nor the orchestrator re-encode the algorithm.
|
|
120
|
+
- The `preliminary-scope-creep` field on the Review Scope artifact and the `scope-creep-summary` field on the Review Report are both populated from this reference's outputs.
|