scrumrun 1.5.2 → 2.1.0
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/CHANGELOG.md +64 -0
- package/CORE.md +231 -308
- package/DECISIONS.md +151 -11
- package/LICENSE +21 -0
- package/MIGRATION-1-to-2.md +120 -0
- package/README.md +147 -78
- package/SPEC.md +259 -251
- package/bin/claude-install.js +18 -132
- package/bin/scrumrun.js +1367 -174
- package/docs/COMMANDS.md +71 -0
- package/docs/ENTITY-MODEL.md +38 -0
- package/docs/RELEASE-SCORECARD.md +43 -0
- package/docs/RELEASE.md +51 -0
- package/docs/SCHEMA.md +89 -0
- package/docs/SEMANTIC-MEMORY.md +68 -0
- package/docs/TROUBLESHOOTING.md +78 -0
- package/lib/code-intel/adapter.js +20 -0
- package/lib/code-intel/javascript.js +199 -0
- package/lib/code-intel/learning.js +66 -0
- package/lib/code-intel/scanner.js +126 -0
- package/lib/commands/manifest.js +118 -0
- package/lib/commands/render.js +78 -0
- package/lib/memory/index.js +659 -0
- package/lib/memory/markdown.js +51 -0
- package/lib/memory/service.js +300 -0
- package/lib/runtime/budgets.js +23 -0
- package/lib/runtime/canonical-snapshot.js +110 -0
- package/lib/runtime/context.js +101 -0
- package/lib/runtime/orchestrator.js +303 -0
- package/lib/runtime/policy-engine.js +184 -0
- package/lib/runtime/request-engine.js +132 -0
- package/lib/runtime/run-ledger.js +324 -0
- package/lib/security/secrets.js +23 -0
- package/lib/v2/artifacts.js +363 -0
- package/lib/v2/conformance.js +214 -0
- package/lib/v2/migration.js +1221 -0
- package/lib/v2/project-store.js +44 -0
- package/lib/v2/run-ledger-migration.js +240 -0
- package/lib/v2/schema.js +148 -0
- package/lib/v2/transaction.js +254 -0
- package/package.json +16 -6
- package/scripts/generate-contract-docs.js +124 -0
- package/templates/project/.scrumrun/config.md +4 -7
- package/templates/project/.scrumrun/guardrails.md +31 -0
- package/templates/project/.scrumrun/map.md +5 -16
- package/templates/project/.scrumrun/memory/decisions/.gitkeep +1 -0
- package/templates/project/.scrumrun/memory/dossiers/.gitkeep +1 -0
- package/templates/project/.scrumrun/memory/insights/.gitkeep +1 -0
- package/templates/project/.scrumrun/memory/knowledge/.gitkeep +1 -0
- package/templates/project/.scrumrun/method.json +7 -0
- package/templates/project/.scrumrun/project.md +6 -12
- package/templates/project/.scrumrun/runs/.gitkeep +1 -0
- package/templates/project/.scrumrun/sprints/.gitkeep +1 -0
- package/templates/project/.scrumrun/state.md +14 -0
- package/templates/project/.scrumrun/tasks/.gitkeep +1 -0
- package/templates/project/AGENTS.md +16 -49
- package/templates/project-lean/AGENTS.md +18 -0
- package/templates/shared/skills/scrumrun/SKILL.md +211 -0
- package/templates/codex/prompts/sc-agent.md +0 -14
- package/templates/codex/prompts/sc-backlog.md +0 -13
- package/templates/codex/prompts/sc-challenge.md +0 -57
- package/templates/codex/prompts/sc-config.md +0 -18
- package/templates/codex/prompts/sc-context.md +0 -24
- package/templates/codex/prompts/sc-decisions.md +0 -8
- package/templates/codex/prompts/sc-feature.md +0 -16
- package/templates/codex/prompts/sc-fix.md +0 -21
- package/templates/codex/prompts/sc-goal.md +0 -14
- package/templates/codex/prompts/sc-golden.md +0 -14
- package/templates/codex/prompts/sc-help.md +0 -12
- package/templates/codex/prompts/sc-init.md +0 -14
- package/templates/codex/prompts/sc-intake.md +0 -22
- package/templates/codex/prompts/sc-know.md +0 -75
- package/templates/codex/prompts/sc-map.md +0 -13
- package/templates/codex/prompts/sc-review.md +0 -13
- package/templates/codex/prompts/sc-sprint.md +0 -28
- package/templates/codex/prompts/sc-study.md +0 -23
- package/templates/codex/prompts/sc-uninstall.md +0 -14
- package/templates/codex/prompts/sc-update.md +0 -8
- package/templates/codex/prompts/sc-vault.md +0 -27
- package/templates/codex/skills/scrumrun/SKILL.md +0 -412
- package/templates/opencode/commands/sc-agent.md +0 -14
- package/templates/opencode/commands/sc-backlog.md +0 -13
- package/templates/opencode/commands/sc-challenge.md +0 -57
- package/templates/opencode/commands/sc-config.md +0 -18
- package/templates/opencode/commands/sc-context.md +0 -24
- package/templates/opencode/commands/sc-decisions.md +0 -8
- package/templates/opencode/commands/sc-feature.md +0 -16
- package/templates/opencode/commands/sc-fix.md +0 -21
- package/templates/opencode/commands/sc-goal.md +0 -14
- package/templates/opencode/commands/sc-golden.md +0 -14
- package/templates/opencode/commands/sc-help.md +0 -12
- package/templates/opencode/commands/sc-init.md +0 -14
- package/templates/opencode/commands/sc-intake.md +0 -22
- package/templates/opencode/commands/sc-know.md +0 -75
- package/templates/opencode/commands/sc-map.md +0 -13
- package/templates/opencode/commands/sc-review.md +0 -13
- package/templates/opencode/commands/sc-sprint.md +0 -28
- package/templates/opencode/commands/sc-study.md +0 -23
- package/templates/opencode/commands/sc-uninstall.md +0 -14
- package/templates/opencode/commands/sc-update.md +0 -8
- package/templates/opencode/commands/sc-vault.md +0 -27
- package/templates/opencode/skills/scrumrun/SKILL.md +0 -412
- package/templates/project/.scrumrun/agents.md +0 -36
- package/templates/project/.scrumrun/backlog.md +0 -7
- package/templates/project/.scrumrun/context.md +0 -61
- package/templates/project/.scrumrun/goals/main/decisions.md +0 -9
- package/templates/project/.scrumrun/goals/main/history.md +0 -51
- package/templates/project/.scrumrun/goals/main/sprint.md +0 -54
- package/templates/project/.scrumrun/golden-rules.md +0 -9
- package/templates/project/.scrumrun/knowledge.md +0 -15
- package/templates/project/.scrumrun/runbook.md +0 -101
- package/templates/project/.scrumrun/token-policy.md +0 -43
package/SPEC.md
CHANGED
|
@@ -1,324 +1,332 @@
|
|
|
1
1
|
# ScrumRun Method Specification
|
|
2
2
|
|
|
3
|
-
Version: `
|
|
3
|
+
Version: `2.0.0` · Status: stable
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`SPEC.md` defines normative meanings and invariants. `lib/v2/schema.js` defines the machine-enforced ids, paths, statuses, transitions, structural relations, and truth ownership metadata; `lib/commands/manifest.js` defines command grammar. `CORE.md` is the operational runtime guide. Generated `docs/SCHEMA.md` must match the executable schema byte-for-byte. A conflict is a conformance failure: semantics defer to SPEC, mechanically enforced values defer to the schema, grammar defers to the command manifest, and the conflicting representation must be corrected.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 1. Purpose and principles
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
ScrumRun is an evidence-driven Agile runtime for AI-assisted software work. It keeps intent, execution, decisions, and learning distinct while preserving a small daily interface.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The method is built on five principles:
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
| **Sprint** | A bounded unit of work under the main goal. |
|
|
19
|
-
| **Feature lane** | An isolated planning surface for work that should not pollute the main goal. |
|
|
20
|
-
| **Fix** | A corrective action for a defect or regression. Lighter than a sprint. |
|
|
21
|
-
| **Backlog item** | A candidate for future work. Not active, not committed. |
|
|
22
|
-
| **Decision** | A pending question that blocks or shapes execution. |
|
|
23
|
-
| **Golden rule** | An absolute constraint. Cannot be silently overridden. |
|
|
24
|
-
| **Knowledge fact** | A short, approved statement about the project used during planning. |
|
|
25
|
-
| **Dossier** | A deep, topic-focused study persisted as a durable document. |
|
|
26
|
-
| **Review agent** | A reusable review persona with defined scope and prompt. |
|
|
27
|
-
| **Intake** | The natural-language classifier that routes requests to workflows. |
|
|
28
|
-
| **Approval gate** | A synchronous checkpoint requiring explicit owner consent. |
|
|
13
|
+
1. no canonical write before explicit approval;
|
|
14
|
+
2. Task is the atomic work unit; Sprint is only a timebox or delivery batch;
|
|
15
|
+
3. every execution attempt is a separate Run;
|
|
16
|
+
4. Markdown is canonical and generated indexes are disposable;
|
|
17
|
+
5. knowledge becomes active truth only through evidence and review.
|
|
29
18
|
|
|
30
|
-
|
|
19
|
+
## 2. Terminology
|
|
20
|
+
|
|
21
|
+
| Term | Meaning |
|
|
22
|
+
|---|---|
|
|
23
|
+
| Feature | Long-lived initiative explaining why related work matters. |
|
|
24
|
+
| Task | Atomic intended work: what must be changed or learned. |
|
|
25
|
+
| Sprint | Explicit timebox or delivery batch grouping Tasks: when work is grouped. |
|
|
26
|
+
| Run | One concrete attempt to execute a Task: how it happened. |
|
|
27
|
+
| Review | Scoped validation evidence for a Run, artifact, migration, or release. |
|
|
28
|
+
| Knowledge | Reviewed project fact. |
|
|
29
|
+
| Decision | Explicit normative choice and its evidence. |
|
|
30
|
+
| Insight | Contextual explanation, trade-off, warning, or rationale. |
|
|
31
|
+
| Dossier | Curated topic/module memory with evidence and review metadata. |
|
|
32
|
+
| Guardrail | Mandatory project policy that configuration cannot weaken. |
|
|
33
|
+
| Context package | Bounded, temporary evidence assembled for one request. |
|
|
34
|
+
| Semantic index | Ignored SQLite projection of canonical artifacts, code symbols, and relations. |
|
|
35
|
+
|
|
36
|
+
A fix is a Task with `type: fix`. A backlog is a view of Tasks with `status: backlog`; neither is a separate canonical entity.
|
|
37
|
+
|
|
38
|
+
Exact status sets, transitions, directories, cardinalities, and truth-ownership boundaries are generated in [`docs/SCHEMA.md`](docs/SCHEMA.md); they are not duplicated manually here.
|
|
39
|
+
|
|
40
|
+
## 3. Canonical project model
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
.scrumrun/
|
|
44
|
+
core.md
|
|
45
|
+
guardrails.md
|
|
46
|
+
config.md
|
|
47
|
+
project.md
|
|
48
|
+
method.json
|
|
49
|
+
state.md # generated view
|
|
50
|
+
map.md # generated view
|
|
51
|
+
features/FEAT-NNN.md
|
|
52
|
+
tasks/TASK-NNN.md
|
|
53
|
+
sprints/SPRINT-NNN.md
|
|
54
|
+
runs/RUN-NNN.md
|
|
55
|
+
reviews/REV-NNN.md
|
|
56
|
+
memory/
|
|
57
|
+
knowledge/K-NNN.md
|
|
58
|
+
decisions/DEC-NNN.md
|
|
59
|
+
insights/INS-NNN.md
|
|
60
|
+
dossiers/DOS-NNN.md
|
|
61
|
+
.cache/ # ignored and disposable
|
|
62
|
+
semantic-index.sqlite
|
|
63
|
+
contexts/
|
|
64
|
+
vault.local.md # optional, ignored, never indexed/rendered
|
|
65
|
+
```
|
|
31
66
|
|
|
32
|
-
|
|
67
|
+
`guardrails.md` is the only canonical project-policy file. A v1 `golden-rules.md` may remain as migrated source evidence, but it is never a competing v2 authority.
|
|
33
68
|
|
|
34
|
-
|
|
69
|
+
### 3.1 Universal frontmatter
|
|
35
70
|
|
|
36
|
-
|
|
71
|
+
Every canonical entity file must contain:
|
|
37
72
|
|
|
38
73
|
```yaml
|
|
39
74
|
---
|
|
40
|
-
id:
|
|
41
|
-
kind:
|
|
42
|
-
status:
|
|
43
|
-
created:
|
|
44
|
-
updated:
|
|
45
|
-
method:
|
|
75
|
+
id: TASK-018
|
|
76
|
+
kind: task
|
|
77
|
+
status: running
|
|
78
|
+
created: 2026-07-21
|
|
79
|
+
updated: 2026-07-21
|
|
80
|
+
method: 2.0.0
|
|
46
81
|
---
|
|
47
82
|
```
|
|
48
83
|
|
|
49
|
-
|
|
84
|
+
IDs, filenames, kind, status, real ISO dates, and method version must agree. Unknown fields and authored prose are preserved. Duplicate fields, malformed frontmatter, unsafe paths, and symlinked canonical paths are invalid.
|
|
50
85
|
|
|
51
|
-
|
|
52
|
-
|---|---|
|
|
53
|
-
| goal (main) | `.scrumrun/goals/main/sprint.md` |
|
|
54
|
-
| goal history | `.scrumrun/goals/main/history.md` |
|
|
55
|
-
| goal decisions | `.scrumrun/goals/main/decisions.md` |
|
|
56
|
-
| feature | `.scrumrun/features/<slug>/feature.md` |
|
|
57
|
-
| feature sprint | `.scrumrun/features/<slug>/sprint.md` |
|
|
58
|
-
| feature history | `.scrumrun/features/<slug>/history.md` |
|
|
59
|
-
| feature decisions | `.scrumrun/features/<slug>/decisions.md` |
|
|
60
|
-
| fix | `.scrumrun/fixes.md` (append-only) |
|
|
61
|
-
| backlog | `.scrumrun/backlog.md` |
|
|
62
|
-
| golden rules | `.scrumrun/golden-rules.md` |
|
|
63
|
-
| knowledge facts | `.scrumrun/knowledge.md` |
|
|
64
|
-
| dossier | `.scrumrun/knowledge/dossiers/<slug>.md` |
|
|
65
|
-
| map | `.scrumrun/map.md` |
|
|
66
|
-
| context | `.scrumrun/context.md` |
|
|
67
|
-
| config | `.scrumrun/config.md` |
|
|
68
|
-
| agents | `.scrumrun/agents.md` |
|
|
69
|
-
| reviews | `.scrumrun/reviews/<id>.md` |
|
|
70
|
-
| vault (local) | `.scrumrun/vault.local.md` |
|
|
86
|
+
### 3.2 Stable identifiers
|
|
71
87
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
| Kind | Identifier |
|
|
89
|
+
|---|---|
|
|
90
|
+
| Feature | `FEAT-NNN` |
|
|
91
|
+
| Task | `TASK-NNN` |
|
|
92
|
+
| Sprint | `SPRINT-NNN` |
|
|
93
|
+
| Run | `RUN-NNN` |
|
|
94
|
+
| Review | `REV-NNN` |
|
|
95
|
+
| Knowledge | `K-NNN` |
|
|
96
|
+
| Decision | `DEC-NNN` |
|
|
97
|
+
| Insight | `INS-NNN` |
|
|
98
|
+
| Dossier | `DOS-NNN` |
|
|
99
|
+
|
|
100
|
+
Relations use stable IDs or qualified code subjects. Example:
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
FEAT-003
|
|
104
|
+
└── TASK-018
|
|
105
|
+
├── executed_by → RUN-044
|
|
106
|
+
├── included_in → SPRINT-012
|
|
107
|
+
├── constrained_by → DEC-018
|
|
108
|
+
└── generated → INS-041
|
|
86
109
|
```
|
|
87
110
|
|
|
88
|
-
|
|
89
|
-
- `proposed → approved`: owner approval required.
|
|
90
|
-
- `approved → running`: explicit `--run` or intake execution consent.
|
|
91
|
-
- `running → done`: all acceptance criteria met AND review agents passed.
|
|
92
|
-
- `running → blocked`: unresolved decision, missing dependency, or golden rule fire.
|
|
93
|
-
- `running → aborted`: owner-initiated cancellation. Requires reason in history.
|
|
94
|
-
- `approved → shelved`: sent to backlog before execution.
|
|
111
|
+
### 3.3 Run event ledger
|
|
95
112
|
|
|
96
|
-
|
|
113
|
+
A newly authored Run declares `ledger: 1` and owns exactly one append-only operational event stream under `## Events`. Event ids are stable and scoped to the Run (`RUN-044-EVT-001`, `RUN-044-EVT-002`, ...). Each JSON event records a contiguous sequence, RFC3339 timestamp, timestamp precision, actor, source and destination states, reason, and typed evidence.
|
|
97
114
|
|
|
98
|
-
|
|
115
|
+
Native Runs begin with `created → executing`. A migration may instead create one evidenced `snapshot` as the historical baseline when the source proves a recorded status but not its full transition path. A snapshot exposes that uncertainty and never fabricates intermediate states.
|
|
99
116
|
|
|
100
|
-
|
|
101
|
-
proposed ──approve──▶ approved ──run──▶ running ──complete──▶ done
|
|
102
|
-
│
|
|
103
|
-
└──escalate──▶ (becomes sprint)
|
|
104
|
-
```
|
|
117
|
+
The ledger is the execution authority. Task retains approved scope and synchronized current status, but does not copy Run events. Conformance reconstructs the Run state from its ledger and rejects missing or duplicate ids, invalid ordering, time reversal, illegal transitions, frontmatter drift, missing evidence, and unevidenced completion.
|
|
105
118
|
|
|
106
|
-
|
|
119
|
+
## 4. State machines
|
|
107
120
|
|
|
108
|
-
|
|
121
|
+
Only the following transitions are valid.
|
|
109
122
|
|
|
110
|
-
|
|
111
|
-
proposed ──approve──▶ active ──archive──▶ archived
|
|
112
|
-
│
|
|
113
|
-
└──merge-to-main──▶ merged
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
A feature lane is a container for sprints. Its sprints follow the sprint state machine independently. `merge-to-main` folds accepted sprints into main goal history.
|
|
117
|
-
|
|
118
|
-
### 3.4 Backlog item
|
|
123
|
+
### Feature
|
|
119
124
|
|
|
125
|
+
```text
|
|
126
|
+
backlog → proposed|active|cancelled
|
|
127
|
+
proposed → active|cancelled
|
|
128
|
+
active → paused|completed|cancelled
|
|
129
|
+
paused → active|cancelled
|
|
120
130
|
```
|
|
121
|
-
added ──promote──▶ (becomes sprint|fix|feature)
|
|
122
|
-
│
|
|
123
|
-
└──drop──▶ dropped
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Backlog items have no execution state. Promotion creates a new artifact.
|
|
127
131
|
|
|
128
|
-
###
|
|
132
|
+
### Task
|
|
129
133
|
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
```text
|
|
135
|
+
backlog → proposed|running|cancelled
|
|
136
|
+
proposed → running|cancelled
|
|
137
|
+
running → validating|failed|blocked|cancelled
|
|
138
|
+
validating → learning|failed|blocked
|
|
139
|
+
learning → completed|failed|blocked
|
|
140
|
+
partial|failed|blocked → running|cancelled
|
|
134
141
|
```
|
|
135
142
|
|
|
136
|
-
|
|
143
|
+
### Sprint
|
|
137
144
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
└──reject──▶ rejected (kept for anti-repetition)
|
|
145
|
+
```text
|
|
146
|
+
proposed → running|cancelled
|
|
147
|
+
running → partial|completed|blocked|cancelled
|
|
148
|
+
partial → running|completed|cancelled
|
|
149
|
+
blocked → running|cancelled
|
|
144
150
|
```
|
|
145
151
|
|
|
146
|
-
|
|
152
|
+
### Run
|
|
147
153
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
154
|
+
```text
|
|
155
|
+
executing → validating|failed|blocked
|
|
156
|
+
validating → learning|failed|blocked
|
|
157
|
+
learning → completed|failed|blocked
|
|
158
|
+
partial → executing|failed|blocked
|
|
159
|
+
blocked → executing|failed
|
|
152
160
|
```
|
|
153
161
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
###
|
|
157
|
-
|
|
158
|
-
```
|
|
159
|
-
proposed
|
|
162
|
+
A failed or blocked Run is never reused as a new attempt. Retrying its Task creates a new `RUN-NNN` with an incremented attempt and preserves the previous Run byte-for-byte.
|
|
163
|
+
|
|
164
|
+
### Review and memory
|
|
165
|
+
|
|
166
|
+
```text
|
|
167
|
+
Review: proposed → running; running → passed|failed
|
|
168
|
+
failed → running|archived; passed → archived
|
|
169
|
+
Knowledge: candidate → approved|rejected; approved → deprecated|invalidated
|
|
170
|
+
rejected → candidate; deprecated → approved
|
|
171
|
+
Decision: open → resolved|deprecated|invalidated; resolved → deprecated|invalidated
|
|
172
|
+
deprecated → open
|
|
173
|
+
Insight: candidate → confirmed|invalidated
|
|
174
|
+
confirmed → stale|deprecated|invalidated
|
|
175
|
+
stale → confirmed|deprecated|invalidated; deprecated → confirmed
|
|
176
|
+
Dossier: active → stale|deprecated|archived; stale → active|deprecated|archived
|
|
177
|
+
deprecated → archived
|
|
160
178
|
```
|
|
161
179
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
Blocking relationships:
|
|
181
|
-
|
|
182
|
-
- An `open` decision **linked** to a sprint blocks that sprint.
|
|
183
|
-
- A `proposed` golden rule does not block anything.
|
|
184
|
-
- An `active` golden rule blocks any transition that would violate it.
|
|
185
|
-
- A `stale` dossier does not block, but must be surfaced in intake responses.
|
|
186
|
-
|
|
187
|
-
---
|
|
188
|
-
|
|
189
|
-
## 5. Precedence
|
|
190
|
-
|
|
191
|
-
When guidance conflicts, apply in this strict order:
|
|
192
|
-
|
|
193
|
-
```
|
|
194
|
-
1. Golden rules (active)
|
|
195
|
-
2. Open decisions linked to current work
|
|
196
|
-
3. Approved knowledge facts
|
|
197
|
-
4. Current sprint / feature plan
|
|
198
|
-
5. Backlog priority
|
|
199
|
-
6. Dossiers and map
|
|
200
|
-
7. context.md (never authoritative)
|
|
180
|
+
Confirmation/resolution requires at least one resolvable evidence reference. An active Dossier requires evidence at creation; refreshing an already active Dossier records verification without changing its state. AI extraction may create candidates only.
|
|
181
|
+
|
|
182
|
+
## 5. Request and execution protocol
|
|
183
|
+
|
|
184
|
+
```text
|
|
185
|
+
RECEIVED
|
|
186
|
+
→ CONTEXTUALIZING (Project Scan + History Engine + Decision Engine)
|
|
187
|
+
→ CONTEXT_PACKAGE
|
|
188
|
+
→ POLICY
|
|
189
|
+
→ RISK
|
|
190
|
+
→ CLASSIFICATION
|
|
191
|
+
→ PLANNING
|
|
192
|
+
→ AWAITING_APPROVAL
|
|
193
|
+
→ EXECUTING
|
|
194
|
+
→ VALIDATING
|
|
195
|
+
→ LEARNING
|
|
196
|
+
→ COMPLETED | FAILED | BLOCKED
|
|
201
197
|
```
|
|
202
198
|
|
|
203
|
-
|
|
199
|
+
Everything through `AWAITING_APPROVAL` is read-only. It may exist in process memory or ignored cache only. A valid approval token binds the normalized request, policy result, classification, risk, issuance time, and canonical context fingerprint.
|
|
204
200
|
|
|
205
|
-
|
|
201
|
+
Approval atomically creates one Task and its first Run. If either write fails, neither may remain. Project changes after planning invalidate the token. Reusing a successfully consumed token is idempotent.
|
|
206
202
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
Numbered for stable reference. Every implementation must uphold all of these.
|
|
210
|
-
|
|
211
|
-
- **I-01** — No sprint may transition from `proposed` to `running` without explicit owner approval.
|
|
212
|
-
- **I-02** — No code changes may occur outside a `running` sprint, a `running` fix, or an explicitly authorized quick task.
|
|
213
|
-
- **I-03** — An active golden rule cannot be bypassed by any command, flag, or config. Retirement is the only path.
|
|
214
|
-
- **I-04** — Intake is read-only. Intake cannot create, modify, or delete artifacts. Intake cannot modify code.
|
|
215
|
-
- **I-05** — Main goal history and feature lane history are physically separate files and never merge automatically.
|
|
216
|
-
- **I-06** — Approval is synchronous and explicit. Ambiguous acknowledgements (e.g., "ok", "sure") do not constitute approval unless the owner has enabled `Quick Tasks: allow` for that class of action.
|
|
217
|
-
- **I-07** — Every state transition writes exactly one entry to the relevant history file. History is append-only.
|
|
218
|
-
- **I-08** — Golden rules are checked before every planning or execution workflow. A rule fire during a running sprint moves that sprint to `blocked`.
|
|
219
|
-
- **I-09** — `context.md` is never authoritative. All planning must verify against canonical artifacts and source.
|
|
220
|
-
- **I-10** — Only `approved` knowledge facts inform planning. `pending` and `rejected` facts are context, not truth.
|
|
221
|
-
- **I-11** — Secrets from `vault.local.md` must never appear in history, knowledge, backlog, reviews, commits, or logs.
|
|
222
|
-
- **I-12** — Every artifact carries `id`, `kind`, `status`, `created`, `updated`, and `method` frontmatter fields.
|
|
223
|
-
- **I-13** — A dossier update must record the source commit hash for drift detection.
|
|
224
|
-
- **I-14** — Quick tasks may be executed with `Quick Tasks: allow`, but never bypass golden rules, security checks, or explicit user constraints.
|
|
225
|
-
- **I-15** — Rejecting a knowledge fact preserves it in `rejected` state to prevent re-proposing the same assumption.
|
|
203
|
+
Run transitions synchronously update the linked Task and append exactly one structured event to the Run ledger. Validation, learning, completion, failure, block, and resume transitions require a reason or typed evidence. Task status changes without receiving a duplicate narrative history. Multi-file mutations use a durable local transaction journal: `prepared` operations roll back byte-exactly after failure/interruption, while `committed` journals are verified and finalized. Ordinary audit is read-only and reports pending recovery; `doctor --recover` or retrying the approved mutation performs recovery explicitly. Entering `learning` may extract structured candidates from the Run, but extraction failure never blocks Run progress.
|
|
226
204
|
|
|
227
|
-
|
|
205
|
+
## 6. Policy and precedence
|
|
228
206
|
|
|
229
|
-
|
|
207
|
+
When guidance conflicts, apply this order:
|
|
230
208
|
|
|
231
|
-
|
|
209
|
+
1. current explicit owner constraints;
|
|
210
|
+
2. universal method invariants in `core.md`/this specification;
|
|
211
|
+
3. active project Guardrails;
|
|
212
|
+
4. resolved Decisions and confirmed, non-stale Memory relevant to the subject;
|
|
213
|
+
5. the approved Task and active Run;
|
|
214
|
+
6. Sprint/Feature grouping context;
|
|
215
|
+
7. generated `state.md`, `map.md`, context packages, and indexes as navigation only.
|
|
232
216
|
|
|
233
|
-
|
|
234
|
-
2. **Interpret intent** using the desired outcome, not keyword matching.
|
|
235
|
-
3. **Determine risk class:** trivial / bounded / cross-cutting / sensitive.
|
|
236
|
-
4. **Load conditional context** based on risk class:
|
|
237
|
-
- trivial: current sprint header only.
|
|
238
|
-
- bounded: current sprint + relevant dossier + relevant knowledge facts.
|
|
239
|
-
- cross-cutting: full sprint plan + all decisions + map.
|
|
240
|
-
- sensitive: everything in cross-cutting + full history relevant to affected modules.
|
|
241
|
-
5. **Classify** into one of: `quick-task`, `discovery`, `sprint`, `fix`, `feature`, `backlog`, `reject`, `clarify`.
|
|
242
|
-
6. **Compose response:**
|
|
243
|
-
- Recommendation with rationale.
|
|
244
|
-
- Up to two alternatives with tradeoffs.
|
|
245
|
-
- Risks and unknowns.
|
|
246
|
-
- Explicit approval request.
|
|
247
|
-
7. **Wait for approval.** No side effects until owner responds.
|
|
217
|
+
Configuration controls preferences but cannot weaken higher levels. Missing or stale context must be surfaced, never rendered as certainty.
|
|
248
218
|
|
|
249
|
-
|
|
219
|
+
Every project Guardrail has a stable `GR-NNN` identity, lifecycle status, rule text, enforcement mode, and optional scope/source. Intake evaluates active Guardrails into structured `passed`, `blocked`, or `deferred` results. A block names the responsible Guardrail and machine-readable reason code; a deferred result is shown explicitly and must be enforced at the mutation, migration, review, or owner gate it names. Deferred checks do not become evidence of a pass.
|
|
250
220
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
## 8. Approval Semantics
|
|
254
|
-
|
|
255
|
-
Approval is a first-class concept and comes in three kinds:
|
|
256
|
-
|
|
257
|
-
| Kind | What it permits |
|
|
258
|
-
|---|---|
|
|
259
|
-
| **Planning approval** | Create planning records (sprint plan, fix plan, backlog item, dossier draft). |
|
|
260
|
-
| **Execution approval** | Change application code, run tests, execute review agents. |
|
|
261
|
-
| **Structural approval** | Modify golden rules, retire rules, change config, delete artifacts. |
|
|
262
|
-
|
|
263
|
-
Config policy `Execution Approval: always` requires both planning AND execution approvals separately. `implementation-only` collapses them for the recommended path but still requires an explicit yes before code changes.
|
|
264
|
-
|
|
265
|
-
There is intentionally no mode that grants blanket implementation permission.
|
|
221
|
+
The executable Policy Engine may infer enforcement for migrated prose, but fresh v2 policy declares it explicitly. Unknown enforcement, duplicate ids, inactive-only policy, configuration that disables approval, and unsafe read-only paths fail conformance. Configuration can tune presentation and workflow preferences; it cannot retire, bypass, or weaken active Guardrails.
|
|
266
222
|
|
|
267
|
-
|
|
223
|
+
## 7. Semantic memory and code intelligence
|
|
268
224
|
|
|
269
|
-
|
|
225
|
+
Memory records include subject, source, evidence, validity window, confidence where useful, review trigger, and last-verified commit. Insight types may include placement rationale, design constraint, known trade-off, failure history, usage warning, compatibility reason, business rule, performance reason, security reason, and testing note.
|
|
270
226
|
|
|
271
|
-
|
|
227
|
+
The derived graph may contain:
|
|
272
228
|
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
229
|
+
```text
|
|
230
|
+
defined_in
|
|
231
|
+
depends_on
|
|
232
|
+
used_by
|
|
233
|
+
protected_by
|
|
234
|
+
constrained_by
|
|
235
|
+
introduced_by
|
|
236
|
+
modified_by
|
|
237
|
+
has_insight
|
|
238
|
+
evidenced_by
|
|
279
239
|
```
|
|
280
240
|
|
|
281
|
-
|
|
241
|
+
JavaScript/TypeScript symbols carry a qualified id, path, kind, line, content fingerprint, commit, and adapter identity. A move with the same fingerprint may be remapped. A rename/removal that cannot be proved is retained as orphaned context. Code or evidence drift marks linked memory stale in the projection; it never silently rewrites canonical Markdown.
|
|
282
242
|
|
|
283
|
-
|
|
243
|
+
Queries must explain content/relation matches, return evidence/provenance, distinguish candidate/confirmed/stale/inactive/orphaned truth, cap result and relation counts, and exclude rejected/deprecated/invalidated records by default.
|
|
284
244
|
|
|
285
|
-
|
|
245
|
+
The agreed v1 control-context baseline is 48,000 characters. A fresh lean v2 intake control package, excluding the user's request, must remain at or below 12,000 characters (25%). Default semantic retrieval returns at most 10 records and 40 relations per record; hard caps are 100/100.
|
|
286
246
|
|
|
287
|
-
|
|
247
|
+
## 8. Generated views and cache
|
|
288
248
|
|
|
289
|
-
|
|
290
|
-
- **Minor** (`1.x.0`): additive changes (new artifact kind, new state, new invariant).
|
|
291
|
-
- **Major** (`x.0.0`): breaking changes (removed states, changed invariants, changed frontmatter schema, changed path map).
|
|
249
|
+
`state.md`, `map.md`, context packages, and `.cache/semantic-index.sqlite` are non-authoritative projections. They carry source fingerprints or are treated as stale. `state.md` uses the exact canonical fingerprint bound into intake, plus a projection schema, RFC3339 generation time, and a disposable watch fingerprint. SQLite stores its source and watch fingerprints with an explicit cache schema.
|
|
292
250
|
|
|
293
|
-
|
|
251
|
+
Freshness checks use a two-tier strategy: unchanged path/stat identity proves that no source read or reparse is needed; changed metadata triggers a complete canonical/source content fingerprint before staleness is asserted. Cache metadata may optimize verification but never supplies project truth. A cache-schema mismatch forces one disposable rebuild. Deleting `.cache/` must not remove authored knowledge, and rebuilding it from unchanged sources must yield equivalent query results.
|
|
294
252
|
|
|
295
|
-
|
|
253
|
+
The index must never scan or store `vault.local.md`. Source scanning is bounded, skips dependencies/build output and symlinks, and uses replaceable language adapters.
|
|
296
254
|
|
|
297
|
-
|
|
255
|
+
## 9. Migration from v1
|
|
298
256
|
|
|
299
|
-
|
|
257
|
+
Migration is explicit and reversible:
|
|
300
258
|
|
|
301
|
-
|
|
259
|
+
```text
|
|
260
|
+
scrumrun migrate --to 2 --dry-run
|
|
261
|
+
scrumrun migrate --to 2 --apply
|
|
262
|
+
scrumrun migrate --to 2 --rollback
|
|
263
|
+
```
|
|
302
264
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
265
|
+
`npx scrumrun@latest update` performs the same read-only preflight when run inside a v1 project and leaves project data untouched. `update --migrate` is an explicit request to apply the verified plan; it is not implicit migration.
|
|
266
|
+
|
|
267
|
+
Inside an early v2 project, the same commands preflight and explicitly upgrade legacy Run prose to ledger schema 1. Deterministic transition chains are recovered; incomplete history becomes an evidenced snapshot. Apply keeps byte-exact ignored backups, verifies hashes, is idempotent, and supports rollback that refuses to erase later Run changes.
|
|
268
|
+
|
|
269
|
+
The migrator must:
|
|
270
|
+
|
|
271
|
+
- hash every source file and block;
|
|
272
|
+
- keep a byte-exact ignored backup;
|
|
273
|
+
- transform in staging and validate before an atomic switch;
|
|
274
|
+
- map each source block to a destination or explicit warning;
|
|
275
|
+
- preserve original v1 files byte-exactly in the ignored backup while removing legacy-only aggregates from the active v2 tree;
|
|
276
|
+
- detect incomplete hybrid v1/v2 layouts and reuse proven canonical Task/Sprint/Run relations instead of duplicating them;
|
|
277
|
+
- normalize only deterministic schema aliases and require resolvable evidence for active migrated memory;
|
|
278
|
+
- be idempotent;
|
|
279
|
+
- reject symlinks, malformed markers, ambiguous destructive guesses, and concurrent source changes;
|
|
280
|
+
- rollback only when doing so cannot erase post-migration work.
|
|
281
|
+
|
|
282
|
+
Legacy sprint entries become Tasks. History entries become Runs only with an evidenced Task relation. A Sprint is created only from real grouping/timebox evidence. Feature lanes become Features, fixes become `type: fix` Tasks, backlog items become backlog Tasks, extracted insights remain candidates, and golden rules become stable-id Guardrails.
|
|
283
|
+
|
|
284
|
+
## 10. Normative invariants
|
|
285
|
+
|
|
286
|
+
- **I-01** No canonical artifact or code write occurs before explicit approval.
|
|
287
|
+
- **I-02** Approval creates a linked Task/Run pair atomically or creates nothing.
|
|
288
|
+
- **I-03** Task is atomic work; Sprint only groups Tasks with real batch/timebox evidence.
|
|
289
|
+
- **I-04** Every retry creates a new Run and preserves earlier attempts.
|
|
290
|
+
- **I-05** Only declared, ordered, evidenced state transitions are accepted; Run event ids are unique and paired transitions are recoverable.
|
|
291
|
+
- **I-06** `guardrails.md` is canonical project policy and configuration cannot weaken it.
|
|
292
|
+
- **I-07** Markdown is canonical; SQLite and generated views are disposable projections.
|
|
293
|
+
- **I-08** AI-created facts/insights remain candidates until explicit human confirmation.
|
|
294
|
+
- **I-09** Confirmed claims have resolvable evidence and review metadata.
|
|
295
|
+
- **I-10** Rejected, deprecated, and invalidated memory is auditable but not active truth; stale memory is labeled.
|
|
296
|
+
- **I-11** Vault values never enter context, artifacts, indexes, reports, logs, commits, or approval tokens.
|
|
297
|
+
- **I-12** Canonical artifacts have valid, matching id/kind/status/date/method frontmatter.
|
|
298
|
+
- **I-13** Missing/stale projections are surfaced and never treated as authoritative.
|
|
299
|
+
- **I-14** Context and semantic retrieval are bounded and explain why evidence matched.
|
|
300
|
+
- **I-15** Migration is explicit; dry-run and ordinary update perform no project writes.
|
|
301
|
+
- **I-16** Migration preserves hashed source coverage, backup, mapping, idempotency, and safe rollback.
|
|
302
|
+
- **I-17** Migration warnings preserve ambiguity; they never invent Sprints, Runs, approval, or truth.
|
|
303
|
+
- **I-18** Partial/interrupted writes, conflicting overwrites, unsafe paths, and symlink traversal fail or recover without corrupting canonical state or overwriting later owner work.
|
|
304
|
+
- **I-19** Code intelligence is derived, adapter-based, fingerprinted, and cannot silently confirm memory.
|
|
305
|
+
- **I-20** Post-validation learning proposes candidates and never blocks Task/Run completion.
|
|
306
|
+
|
|
307
|
+
## 11. Command grammar
|
|
308
|
+
|
|
309
|
+
The only canonical root is:
|
|
310
|
+
|
|
311
|
+
```text
|
|
312
|
+
/sc <noun> <subject> <action> [args]
|
|
313
|
+
```
|
|
309
314
|
|
|
310
|
-
|
|
315
|
+
Exactly five nouns exist: `plan`, `knowledge`, `rules`, `review`, and `config`. The implementation manifest is the command source of truth for help and client adapters. Fresh installs expose `/sc`; generated v1 aliases may remain for one compatibility cycle and must execute the canonical route.
|
|
311
316
|
|
|
312
|
-
|
|
317
|
+
Unknown syntax fails deterministically and never guesses a mutation.
|
|
313
318
|
|
|
314
|
-
## 12.
|
|
319
|
+
## 12. Conformance and compatibility
|
|
315
320
|
|
|
316
|
-
|
|
321
|
+
An implementation may claim ScrumRun method 2.0.0 only when it:
|
|
317
322
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
+
1. passes positive and negative tests for I-01 through I-20;
|
|
324
|
+
2. enforces every exposed state machine and schema;
|
|
325
|
+
3. proves read-only intake and dry-run migration through full-tree fingerprints;
|
|
326
|
+
4. proves migration failure recovery, rollback safety, and vault exclusion;
|
|
327
|
+
5. reconstructs every native Run status from a valid, evidenced ledger and detects tampering;
|
|
328
|
+
6. proves cache deletion/rebuild equivalence and inactive-memory filtering;
|
|
329
|
+
7. bounds context/retrieval and records benchmark budgets;
|
|
330
|
+
8. declares method `2.0.0` and requires Node.js `>=22.13.0` for the native SQLite index.
|
|
323
331
|
|
|
324
|
-
|
|
332
|
+
Method changes follow semantic versioning. Breaking entity, path, invariant, or state changes require a major version and a migration guide.
|