scrumrun 1.5.2 → 2.0.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 +42 -0
- package/CORE.md +224 -311
- package/DECISIONS.md +95 -11
- package/LICENSE +21 -0
- package/MIGRATION-1-to-2.md +109 -0
- package/README.md +137 -78
- package/SPEC.md +248 -257
- package/bin/claude-install.js +18 -132
- package/bin/scrumrun.js +1259 -174
- package/docs/COMMANDS.md +69 -0
- package/docs/ENTITY-MODEL.md +38 -0
- package/docs/RELEASE.md +44 -0
- package/docs/SCHEMA.md +80 -0
- package/docs/SEMANTIC-MEMORY.md +68 -0
- package/docs/TROUBLESHOOTING.md +66 -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 +109 -0
- package/lib/commands/render.js +75 -0
- package/lib/memory/index.js +600 -0
- package/lib/memory/markdown.js +51 -0
- package/lib/memory/service.js +300 -0
- package/lib/runtime/budgets.js +19 -0
- package/lib/runtime/context.js +141 -0
- package/lib/runtime/orchestrator.js +270 -0
- package/lib/runtime/request-engine.js +128 -0
- package/lib/security/secrets.js +23 -0
- package/lib/v2/artifacts.js +343 -0
- package/lib/v2/conformance.js +167 -0
- package/lib/v2/migration.js +1161 -0
- package/lib/v2/project-store.js +44 -0
- package/lib/v2/schema.js +128 -0
- package/package.json +16 -6
- package/scripts/generate-contract-docs.js +113 -0
- package/templates/project/.scrumrun/config.md +4 -7
- package/templates/project/.scrumrun/guardrails.md +23 -0
- package/templates/project/.scrumrun/map.md +4 -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 +4 -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 +21 -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 +201 -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
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const fs = require("node:fs");
|
|
4
|
+
const path = require("node:path");
|
|
5
|
+
const { ArtifactRepository, graphFromRecords } = require("./artifacts");
|
|
6
|
+
const { MANIFEST_PATH, migrationPlan } = require("./migration");
|
|
7
|
+
|
|
8
|
+
const LEGACY_PATHS = [
|
|
9
|
+
"backlog.md",
|
|
10
|
+
"fixes.md",
|
|
11
|
+
"golden-rules.md",
|
|
12
|
+
"knowledge.md",
|
|
13
|
+
path.join("goals", "main", "sprint.md"),
|
|
14
|
+
path.join("goals", "main", "history.md"),
|
|
15
|
+
path.join("goals", "main", "decisions.md")
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
function readProjectModel(projectRoot) {
|
|
19
|
+
const scrumDir = path.join(projectRoot, ".scrumrun");
|
|
20
|
+
if (!fs.existsSync(scrumDir)) throw new Error("Not a ScrumRun project: .scrumrun/ is missing.");
|
|
21
|
+
const hasV2Marker = fs.existsSync(path.join(scrumDir, "method.json")) || fs.existsSync(path.join(scrumDir, MANIFEST_PATH));
|
|
22
|
+
const hasLegacy = LEGACY_PATHS.some((relative) => fs.existsSync(path.join(scrumDir, relative)));
|
|
23
|
+
|
|
24
|
+
if (hasV2Marker) {
|
|
25
|
+
const repository = new ArtifactRepository(scrumDir);
|
|
26
|
+
return {
|
|
27
|
+
layout: hasLegacy ? "mixed" : "v2",
|
|
28
|
+
source: "canonical-v2",
|
|
29
|
+
graph: repository.graph(),
|
|
30
|
+
warnings: []
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const plan = migrationPlan(projectRoot);
|
|
35
|
+
return {
|
|
36
|
+
layout: "v1",
|
|
37
|
+
source: "read-only-v2-projection",
|
|
38
|
+
graph: graphFromRecords(plan.artifacts.map((artifact) => artifact.record)),
|
|
39
|
+
warnings: plan.warnings,
|
|
40
|
+
errors: plan.errors
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
module.exports = { LEGACY_PATHS, readProjectModel };
|
package/lib/v2/schema.js
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function deepFreeze(value) {
|
|
4
|
+
if (!value || typeof value !== "object" || Object.isFrozen(value)) return value;
|
|
5
|
+
for (const nested of Object.values(value)) deepFreeze(nested);
|
|
6
|
+
return Object.freeze(value);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const METHOD_VERSION = "2.0.0";
|
|
10
|
+
|
|
11
|
+
const ARTIFACT_TYPES = deepFreeze({
|
|
12
|
+
feature: {
|
|
13
|
+
prefix: "FEAT",
|
|
14
|
+
directory: "features",
|
|
15
|
+
initial: ["backlog", "proposed"],
|
|
16
|
+
statuses: ["backlog", "proposed", "active", "completed", "paused", "cancelled"]
|
|
17
|
+
},
|
|
18
|
+
task: {
|
|
19
|
+
prefix: "TASK",
|
|
20
|
+
directory: "tasks",
|
|
21
|
+
initial: ["backlog", "proposed", "running"],
|
|
22
|
+
statuses: ["backlog", "proposed", "running", "validating", "learning", "partial", "completed", "failed", "blocked", "cancelled"]
|
|
23
|
+
},
|
|
24
|
+
sprint: {
|
|
25
|
+
prefix: "SPRINT",
|
|
26
|
+
directory: "sprints",
|
|
27
|
+
initial: ["proposed"],
|
|
28
|
+
statuses: ["proposed", "running", "partial", "completed", "blocked", "cancelled"]
|
|
29
|
+
},
|
|
30
|
+
run: {
|
|
31
|
+
prefix: "RUN",
|
|
32
|
+
directory: "runs",
|
|
33
|
+
initial: ["executing"],
|
|
34
|
+
statuses: ["executing", "validating", "learning", "partial", "completed", "failed", "blocked"]
|
|
35
|
+
},
|
|
36
|
+
review: {
|
|
37
|
+
prefix: "REV",
|
|
38
|
+
directory: "reviews",
|
|
39
|
+
initial: ["proposed"],
|
|
40
|
+
statuses: ["proposed", "running", "passed", "failed", "archived"]
|
|
41
|
+
},
|
|
42
|
+
knowledge: {
|
|
43
|
+
prefix: "K",
|
|
44
|
+
directory: "memory/knowledge",
|
|
45
|
+
initial: ["candidate"],
|
|
46
|
+
statuses: ["candidate", "approved", "rejected", "deprecated", "invalidated"]
|
|
47
|
+
},
|
|
48
|
+
decision: {
|
|
49
|
+
prefix: "DEC",
|
|
50
|
+
directory: "memory/decisions",
|
|
51
|
+
initial: ["open"],
|
|
52
|
+
statuses: ["open", "resolved", "deprecated", "invalidated"]
|
|
53
|
+
},
|
|
54
|
+
insight: {
|
|
55
|
+
prefix: "INS",
|
|
56
|
+
directory: "memory/insights",
|
|
57
|
+
initial: ["candidate"],
|
|
58
|
+
statuses: ["candidate", "confirmed", "stale", "deprecated", "invalidated"]
|
|
59
|
+
},
|
|
60
|
+
dossier: {
|
|
61
|
+
prefix: "DOS",
|
|
62
|
+
directory: "memory/dossiers",
|
|
63
|
+
initial: ["active"],
|
|
64
|
+
statuses: ["active", "stale", "deprecated", "archived"]
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const ARTIFACT_TRANSITIONS = deepFreeze({
|
|
69
|
+
feature: {
|
|
70
|
+
backlog: ["proposed", "active", "cancelled"], proposed: ["active", "cancelled"], active: ["paused", "completed", "cancelled"], paused: ["active", "cancelled"]
|
|
71
|
+
},
|
|
72
|
+
task: {
|
|
73
|
+
backlog: ["proposed", "running", "cancelled"], proposed: ["running", "cancelled"], running: ["validating", "failed", "blocked", "cancelled"], validating: ["learning", "failed", "blocked"], learning: ["completed", "failed", "blocked"], partial: ["running", "cancelled"], failed: ["running", "cancelled"], blocked: ["running", "cancelled"]
|
|
74
|
+
},
|
|
75
|
+
sprint: {
|
|
76
|
+
proposed: ["running", "cancelled"], running: ["partial", "completed", "blocked", "cancelled"], partial: ["running", "completed", "cancelled"], blocked: ["running", "cancelled"]
|
|
77
|
+
},
|
|
78
|
+
run: {
|
|
79
|
+
executing: ["validating", "failed", "blocked"], validating: ["learning", "failed", "blocked"], learning: ["completed", "failed", "blocked"], partial: ["executing", "failed", "blocked"], blocked: ["executing", "failed"]
|
|
80
|
+
},
|
|
81
|
+
review: { proposed: ["running"], running: ["passed", "failed"], failed: ["running", "archived"], passed: ["archived"] },
|
|
82
|
+
knowledge: { candidate: ["approved", "rejected"], approved: ["deprecated", "invalidated"], rejected: ["candidate"], deprecated: ["approved"], invalidated: [] },
|
|
83
|
+
decision: { open: ["resolved", "deprecated", "invalidated"], resolved: ["deprecated", "invalidated"], deprecated: ["open"], invalidated: [] },
|
|
84
|
+
insight: { candidate: ["confirmed", "invalidated"], confirmed: ["stale", "deprecated", "invalidated"], stale: ["confirmed", "deprecated", "invalidated"], deprecated: ["confirmed"], invalidated: [] },
|
|
85
|
+
dossier: { active: ["stale", "deprecated", "archived"], stale: ["active", "deprecated", "archived"], deprecated: ["archived"], archived: [] }
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const STRUCTURAL_RELATIONS = deepFreeze({
|
|
89
|
+
feature: { targetKind: "feature", cardinality: "0..1", meaning: "long-lived initiative containing the artifact" },
|
|
90
|
+
sprint: { targetKind: "sprint", cardinality: "0..1", meaning: "optional delivery batch containing a Task or Run" },
|
|
91
|
+
task: { targetKind: "task", cardinality: "1 for Run; otherwise 0..1", requiredFor: ["run"], meaning: "atomic work executed or reviewed by the artifact" }
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const SCALAR_FIELDS = deepFreeze({
|
|
95
|
+
attempt: { kinds: ["run"], required: true, type: "positive integer", meaning: "monotonic execution-attempt number within one Task" }
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const TRUTH_OWNERSHIP = deepFreeze({
|
|
99
|
+
feature: { question: "Why does this initiative exist?", truth: "initiative purpose, scope, dependencies, and lifecycle" },
|
|
100
|
+
task: { question: "What approved atomic outcome is intended?", truth: "scope, acceptance criteria, approval, and intended status" },
|
|
101
|
+
sprint: { question: "When are related Tasks grouped?", truth: "timebox or delivery-batch membership; never execution history" },
|
|
102
|
+
run: { question: "How did one execution attempt actually happen?", truth: "append-only execution events, evidence, result, and attempt number" },
|
|
103
|
+
review: { question: "What independent validation was performed?", truth: "scoped findings, checks, evidence, and verdict" },
|
|
104
|
+
knowledge: { question: "What verified project fact is reusable?", truth: "approved evidence-backed fact and validity" },
|
|
105
|
+
decision: { question: "What normative choice constrains future work?", truth: "decision, rationale, validity, and lifecycle" },
|
|
106
|
+
insight: { question: "Why is something arranged or constrained this way?", truth: "explanatory candidate/confirmed context and evidence" },
|
|
107
|
+
dossier: { question: "What evidence belongs to one retrieval topic?", truth: "reviewed topic bundle and freshness" }
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const AUTHORITY = deepFreeze({
|
|
111
|
+
semantics: { source: "SPEC.md", scope: "normative meanings and invariants" },
|
|
112
|
+
schema: { source: "lib/v2/schema.js", scope: "machine-enforced ids, paths, statuses, transitions, relations, and ownership metadata" },
|
|
113
|
+
commands: { source: "lib/commands/manifest.js", scope: "public command grammar and compatibility routes" },
|
|
114
|
+
projectPolicy: { source: ".scrumrun/guardrails.md", scope: "owner/project constraints" },
|
|
115
|
+
projectTruth: { source: ".scrumrun/**/*.md", scope: "authored canonical project records" },
|
|
116
|
+
projections: { source: ".scrumrun/state.md, .scrumrun/map.md, .scrumrun/.cache/", scope: "disposable derived views; never authority" }
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
module.exports = {
|
|
120
|
+
ARTIFACT_TRANSITIONS,
|
|
121
|
+
ARTIFACT_TYPES,
|
|
122
|
+
AUTHORITY,
|
|
123
|
+
METHOD_VERSION,
|
|
124
|
+
SCALAR_FIELDS,
|
|
125
|
+
STRUCTURAL_RELATIONS,
|
|
126
|
+
TRUTH_OWNERSHIP,
|
|
127
|
+
deepFreeze
|
|
128
|
+
};
|
package/package.json
CHANGED
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scrumrun",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Evidence-driven Agile runtime and semantic project memory for AI coding agents.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"scrumrun": "bin/scrumrun.js",
|
|
7
7
|
"sr-claude": "bin/claude-install.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"bin",
|
|
11
|
+
"lib",
|
|
12
|
+
"scripts",
|
|
11
13
|
"templates",
|
|
12
14
|
"CORE.md",
|
|
13
15
|
"SPEC.md",
|
|
14
16
|
"DECISIONS.md",
|
|
15
|
-
"README.md"
|
|
17
|
+
"README.md",
|
|
18
|
+
"MIGRATION-1-to-2.md",
|
|
19
|
+
"CHANGELOG.md",
|
|
20
|
+
"LICENSE",
|
|
21
|
+
"docs"
|
|
16
22
|
],
|
|
17
23
|
"scripts": {
|
|
18
|
-
"
|
|
24
|
+
"docs:contract": "node scripts/generate-contract-docs.js",
|
|
25
|
+
"check:contract": "node scripts/generate-contract-docs.js --check",
|
|
26
|
+
"test": "node scripts/generate-contract-docs.js --check && node --test tests/*.test.js",
|
|
27
|
+
"benchmark": "node --test tests/performance.test.js"
|
|
19
28
|
},
|
|
20
29
|
"keywords": [
|
|
21
30
|
"ai",
|
|
@@ -23,7 +32,8 @@
|
|
|
23
32
|
"codex",
|
|
24
33
|
"opencode",
|
|
25
34
|
"agents",
|
|
26
|
-
"sprints"
|
|
35
|
+
"sprints",
|
|
36
|
+
"semantic-memory"
|
|
27
37
|
],
|
|
28
38
|
"author": {
|
|
29
39
|
"name": "Leander Costa",
|
|
@@ -43,6 +53,6 @@
|
|
|
43
53
|
},
|
|
44
54
|
"license": "MIT",
|
|
45
55
|
"engines": {
|
|
46
|
-
"node": ">=
|
|
56
|
+
"node": ">=22.13.0"
|
|
47
57
|
}
|
|
48
58
|
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const {
|
|
7
|
+
ARTIFACT_TRANSITIONS,
|
|
8
|
+
ARTIFACT_TYPES,
|
|
9
|
+
AUTHORITY,
|
|
10
|
+
METHOD_VERSION,
|
|
11
|
+
SCALAR_FIELDS,
|
|
12
|
+
STRUCTURAL_RELATIONS,
|
|
13
|
+
TRUTH_OWNERSHIP
|
|
14
|
+
} = require("../lib/v2/schema");
|
|
15
|
+
|
|
16
|
+
const ROOT = path.resolve(__dirname, "..");
|
|
17
|
+
const OUTPUT = path.join(ROOT, "docs", "SCHEMA.md");
|
|
18
|
+
|
|
19
|
+
function inline(value) {
|
|
20
|
+
return String(value).replace(/\|/g, "\\|").replace(/\r?\n/g, " ");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function renderContract() {
|
|
24
|
+
const entityRows = Object.entries(ARTIFACT_TYPES).map(([kind, spec]) => {
|
|
25
|
+
const ownership = TRUTH_OWNERSHIP[kind];
|
|
26
|
+
return `| ${kind} | \`${spec.prefix}-NNN\` | \`${spec.directory}/\` | ${spec.initial.map((item) => `\`${item}\``).join(", ")} | ${inline(ownership.truth)} |`;
|
|
27
|
+
});
|
|
28
|
+
const relationRows = Object.entries(STRUCTURAL_RELATIONS).map(([field, relation]) => {
|
|
29
|
+
const target = ARTIFACT_TYPES[relation.targetKind];
|
|
30
|
+
return `| \`${field}\` | ${relation.targetKind} (\`${target.prefix}-NNN\`) | ${relation.cardinality} | ${inline(relation.meaning)} |`;
|
|
31
|
+
});
|
|
32
|
+
const scalarRows = Object.entries(SCALAR_FIELDS).map(([field, constraint]) => `| \`${field}\` | ${constraint.kinds.join(", ")} | ${constraint.required ? "required" : "optional"} | ${constraint.type} | ${inline(constraint.meaning)} |`);
|
|
33
|
+
const lifecycleRows = Object.entries(ARTIFACT_TYPES).map(([kind, spec]) => {
|
|
34
|
+
const transitions = ARTIFACT_TRANSITIONS[kind] || {};
|
|
35
|
+
const rendered = spec.statuses.map((status) => {
|
|
36
|
+
const targets = transitions[status];
|
|
37
|
+
return targets ? `\`${status}\` → ${targets.length ? targets.map((target) => `\`${target}\``).join(", ") : "terminal"}` : `\`${status}\` → terminal`;
|
|
38
|
+
}).join("<br>");
|
|
39
|
+
return `| ${kind} | ${rendered} |`;
|
|
40
|
+
});
|
|
41
|
+
const authorityRows = Object.entries(AUTHORITY).map(([concern, rule]) => `| ${concern} | \`${rule.source}\` | ${inline(rule.scope)} |`);
|
|
42
|
+
|
|
43
|
+
return `# ScrumRun ${METHOD_VERSION} Executable Schema
|
|
44
|
+
|
|
45
|
+
> Generated by \`scripts/generate-contract-docs.js\` from \`lib/v2/schema.js\`. Do not edit this file manually.
|
|
46
|
+
|
|
47
|
+
## Authority boundaries
|
|
48
|
+
|
|
49
|
+
| Concern | Authoritative source | Scope |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
${authorityRows.join("\n")}
|
|
52
|
+
|
|
53
|
+
The boundaries above are deliberately different: SPEC owns meanings, the executable schema owns mechanically enforced values, the command manifest owns grammar, project Markdown owns authored project truth, and generated views own nothing.
|
|
54
|
+
|
|
55
|
+
## Artifact contract
|
|
56
|
+
|
|
57
|
+
| Kind | Stable ID | Canonical directory | Allowed initial status | Truth owned by this artifact |
|
|
58
|
+
|---|---|---|---|---|
|
|
59
|
+
${entityRows.join("\n")}
|
|
60
|
+
|
|
61
|
+
Every artifact also requires \`id\`, \`kind\`, \`status\`, \`created\`, \`updated\`, and \`method: ${METHOD_VERSION}\`.
|
|
62
|
+
|
|
63
|
+
## Structural cardinalities
|
|
64
|
+
|
|
65
|
+
| Frontmatter field | Target | Cardinality | Meaning |
|
|
66
|
+
|---|---|---|---|
|
|
67
|
+
${relationRows.join("\n")}
|
|
68
|
+
|
|
69
|
+
Task is the atomic unit. A Task may have zero or one Sprint. A Task may have many Runs, but every Run belongs to exactly one Task and has a monotonically increasing attempt number within that Task. Sprint membership is authoritative on \`Task.sprint\`; a Sprint's \`## Tasks\` list is a human-readable projection that must agree with it.
|
|
70
|
+
|
|
71
|
+
## Scalar constraints
|
|
72
|
+
|
|
73
|
+
| Field | Kinds | Presence | Type | Meaning |
|
|
74
|
+
|---|---|---|---|---|
|
|
75
|
+
${scalarRows.join("\n")}
|
|
76
|
+
|
|
77
|
+
Native creation uses the declared initial statuses. Migration may restore a historical non-initial status only with provenance and validation.
|
|
78
|
+
|
|
79
|
+
## Truth questions
|
|
80
|
+
|
|
81
|
+
${Object.entries(TRUTH_OWNERSHIP).map(([kind, owner]) => `- **${kind}:** ${owner.question}`).join("\n")}
|
|
82
|
+
|
|
83
|
+
## Lifecycles
|
|
84
|
+
|
|
85
|
+
| Kind | Declared transitions |
|
|
86
|
+
|---|---|
|
|
87
|
+
${lifecycleRows.join("\n")}
|
|
88
|
+
|
|
89
|
+
## Projections
|
|
90
|
+
|
|
91
|
+
\`state.md\`, \`map.md\`, context packages, and \`.cache/\` are disposable. They may summarize or index canonical artifacts, but they cannot introduce status, policy, relations, decisions, or knowledge.
|
|
92
|
+
`;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function main(args = process.argv.slice(2)) {
|
|
96
|
+
const rendered = renderContract();
|
|
97
|
+
if (args.includes("--check")) {
|
|
98
|
+
const current = fs.existsSync(OUTPUT) ? fs.readFileSync(OUTPUT, "utf8") : "";
|
|
99
|
+
if (current !== rendered) {
|
|
100
|
+
console.error("docs/SCHEMA.md is stale; run `npm run docs:contract`.");
|
|
101
|
+
process.exitCode = 1;
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
console.log("ok docs/SCHEMA.md matches lib/v2/schema.js");
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
fs.writeFileSync(OUTPUT, rendered);
|
|
108
|
+
console.log(`generated ${path.relative(ROOT, OUTPUT)}`);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (require.main === module) main();
|
|
112
|
+
|
|
113
|
+
module.exports = { renderContract };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
# ScrumRun Config - {{PROJECT_NAME}}
|
|
1
|
+
# ScrumRun Project Config - {{PROJECT_NAME}}
|
|
2
2
|
|
|
3
|
+
Method Version: 2.0.0
|
|
4
|
+
CLI Target: 2.0.0
|
|
3
5
|
Language: English
|
|
4
6
|
Interaction Mode: guided
|
|
5
7
|
Execution Approval: always
|
|
6
8
|
Quick Tasks: ask
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- Keep sprint summaries concise and actionable.
|
|
11
|
-
- Ask only blocking questions before implementation.
|
|
12
|
-
- Preserve main goal history and feature lane history separately.
|
|
13
|
-
Sprint Automation: backlog
|
|
10
|
+
These are operating preferences. They can never weaken `.scrumrun/guardrails.md`.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# ScrumRun Project Guardrails - {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
Canonical project policy. Universal method invariants live in `core.md`; this file contains stable owner/project constraints.
|
|
4
|
+
|
|
5
|
+
## GR-001 - Protect secrets
|
|
6
|
+
|
|
7
|
+
Status: active
|
|
8
|
+
Rule: Never commit or print real secrets. Keep local development values in `vault.local.md` and runtime values in environment/config.
|
|
9
|
+
|
|
10
|
+
## GR-002 - Preserve owner work
|
|
11
|
+
|
|
12
|
+
Status: active
|
|
13
|
+
Rule: Never overwrite unrelated or pre-existing owner changes. Canonical mutations must be scoped, lossless, validated, and recoverable.
|
|
14
|
+
|
|
15
|
+
## GR-003 - Respect read-only paths
|
|
16
|
+
|
|
17
|
+
Status: active
|
|
18
|
+
Rule: Never modify a path marked read-only by the owner or project configuration.
|
|
19
|
+
|
|
20
|
+
## GR-004 - Approval gates execution
|
|
21
|
+
|
|
22
|
+
Status: active
|
|
23
|
+
Rule: Intake remains read-only. Create/update a Task and create a Run only after explicit valid approval.
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ScrumRun Map - {{PROJECT_NAME}}
|
|
2
2
|
|
|
3
3
|
Generated: {{DATE}}
|
|
4
|
+
Authority: none; rebuild from canonical artifacts and source code.
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
+
## Active Graph
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Top-Level Structure
|
|
10
|
-
|
|
11
|
-
- `AGENTS.md` — root agent instructions.
|
|
12
|
-
- `.scrumrun/` — ScrumRun project memory, plans, histories, decisions, and reviews.
|
|
13
|
-
|
|
14
|
-
## Important Commands
|
|
15
|
-
|
|
16
|
-
- Pending: run `/scr-map --build` after project files exist.
|
|
17
|
-
|
|
18
|
-
## Notes
|
|
19
|
-
|
|
20
|
-
- Update this file when important folders, modules, commands, routes, or config files are added or moved.
|
|
8
|
+
- Pending: no Features, Tasks, Sprints, Runs, Memory, or Reviews yet.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
# Project - {{PROJECT_NAME}}
|
|
2
2
|
|
|
3
3
|
Created: {{DATE}}
|
|
4
|
+
Method: 2.0.0
|
|
4
5
|
|
|
5
6
|
## Purpose
|
|
6
7
|
|
|
7
|
-
Pending: define the
|
|
8
|
+
Pending: define the project outcome through `/sc plan intake <request>`.
|
|
8
9
|
|
|
9
10
|
## Stack
|
|
10
11
|
|
|
11
|
-
Pending:
|
|
12
|
+
Pending: discover or confirm runtime, frameworks, persistence, tests, deployment, and integrations.
|
|
12
13
|
|
|
13
14
|
## Architecture
|
|
14
15
|
|
|
15
|
-
Pending:
|
|
16
|
+
Pending: record verified boundaries and link evidence-backed Decisions/Insights.
|
|
16
17
|
|
|
17
|
-
##
|
|
18
|
+
## Read-only Paths
|
|
18
19
|
|
|
19
|
-
-
|
|
20
|
-
- Features: `.scrumrun/features/`
|
|
21
|
-
|
|
22
|
-
## Safety Boundaries
|
|
23
|
-
|
|
24
|
-
- Never commit real secrets.
|
|
25
|
-
- Runtime-specific values must come from env/config.
|
|
26
|
-
- Read-only source paths: pending confirmation.
|
|
20
|
+
- Pending: none declared.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ScrumRun State - {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
Generated: {{DATE}}
|
|
4
|
+
Authority: none; this is a disposable view.
|
|
5
|
+
|
|
6
|
+
## Active Work
|
|
7
|
+
|
|
8
|
+
- Feature: none.
|
|
9
|
+
- Task: none.
|
|
10
|
+
- Sprint: none.
|
|
11
|
+
- Run: none.
|
|
12
|
+
|
|
13
|
+
## Relevant Memory
|
|
14
|
+
|
|
15
|
+
- Decisions: none.
|
|
16
|
+
- Knowledge: none.
|
|
17
|
+
- Insights: none.
|
|
18
|
+
|
|
19
|
+
## Next Action
|
|
20
|
+
|
|
21
|
+
- Use `/sc plan intake <request>`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,59 +1,26 @@
|
|
|
1
1
|
# AGENTS.md - {{PROJECT_NAME}}
|
|
2
2
|
|
|
3
|
-
## ScrumRun
|
|
3
|
+
## ScrumRun 2.0
|
|
4
4
|
|
|
5
|
-
This project uses ScrumRun.
|
|
5
|
+
This project uses ScrumRun. The method is mandatory; `/sc` is its single optional shortcut.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
For normal work, read:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
1. `.scrumrun/guardrails.md` — canonical project policy;
|
|
10
|
+
2. `.scrumrun/state.md` — disposable index of active ids;
|
|
11
|
+
3. the referenced Task, Sprint, Feature, Run, Memory, and Review artifacts relevant to the request;
|
|
12
|
+
4. `.scrumrun/core.md` when the method contract or an exceptional transition is needed.
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
2. `.scrumrun/golden-rules.md` — **MANDATORY. Highest priority. Never violate.**
|
|
13
|
-
3. `.scrumrun/config.md` — response language and ScrumRun behavior preferences.
|
|
14
|
-
4. `.scrumrun/token-policy.md` — context economy rules.
|
|
15
|
-
5. `.scrumrun/context.md` — token-safe snapshot, not source of truth.
|
|
16
|
-
6. `.scrumrun/map.md` — project folders, paths, modules, and key files.
|
|
17
|
-
7. `.scrumrun/project.md`
|
|
18
|
-
8. `.scrumrun/knowledge.md`
|
|
19
|
-
9. `.scrumrun/runbook.md` — execution protocol before reading operational work.
|
|
20
|
-
10. `.scrumrun/backlog.md`
|
|
21
|
-
11. `.scrumrun/goals/main/sprint.md`
|
|
22
|
-
12. `.scrumrun/agents.md`
|
|
23
|
-
13. `.scrumrun/goals/main/history.md`
|
|
24
|
-
14. `.scrumrun/goals/main/decisions.md`
|
|
14
|
+
Natural-language product requests automatically enter the read-only ScrumRun intake pipeline. Before explicit approval, do not create canonical records or modify application code.
|
|
25
15
|
|
|
26
|
-
|
|
16
|
+
After approval:
|
|
27
17
|
|
|
28
|
-
|
|
18
|
+
- Task is the atomic work item;
|
|
19
|
+
- Sprint is only a real timebox/batch of Tasks;
|
|
20
|
+
- Run is one execution attempt and follows `executing → validating → learning → completed|failed|blocked`;
|
|
21
|
+
- a retry creates a new Run and preserves the old one;
|
|
22
|
+
- learning proposes evidence-backed Knowledge, Decisions, or candidate Insights.
|
|
29
23
|
|
|
30
|
-
|
|
24
|
+
Never bypass guardrails, overwrite owner work, treat generated state/cache as truth, auto-confirm AI knowledge, auto-migrate a v1 project, or print vault values.
|
|
31
25
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- Do not start a sprint unless the owner explicitly asks for that sprint.
|
|
35
|
-
- Do not convert an intake recommendation into a backlog item, sprint, feature lane, fix, or code change until the configured approval gate is satisfied.
|
|
36
|
-
- Before executing any main-goal sprint, check `.scrumrun/goals/main/history.md`.
|
|
37
|
-
- Before executing any feature sprint, check that feature lane's `history.md`.
|
|
38
|
-
- If a sprint is `completed`, ask whether to audit, rerun/fix, or continue to the next sprint.
|
|
39
|
-
- If a sprint is `partial` or `blocked`, ask whether to resume, audit, or move to another sprint.
|
|
40
|
-
- Never commit real secrets.
|
|
41
|
-
- Runtime-specific values must come from env/config, not hardcoded strings.
|
|
42
|
-
- If a project has a read-only source path, never modify it.
|
|
43
|
-
- Keep main goal history and feature lane history separate.
|
|
44
|
-
- Use `.scrumrun/context.md` to reduce unnecessary reading, but never as canonical truth.
|
|
45
|
-
- If context conflicts with golden rules, approved knowledge, history, decisions, or source code, context loses.
|
|
46
|
-
|
|
47
|
-
## Sprint Protocol
|
|
48
|
-
|
|
49
|
-
Every sprint must follow:
|
|
50
|
-
|
|
51
|
-
1. Entenda
|
|
52
|
-
2. Avalie Impactos
|
|
53
|
-
3. Tire Duvidas
|
|
54
|
-
4. Execute
|
|
55
|
-
5. Teste
|
|
56
|
-
|
|
57
|
-
## Handoff
|
|
58
|
-
|
|
59
|
-
At the end of each sprint, update the relevant history file with status, files changed, commands run, tests, decisions, env variable names, risks, and follow-ups.
|
|
26
|
+
If `/sc` is unavailable, follow the equivalent workflow in `.scrumrun/core.md` manually.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# AGENTS.md - {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
## ScrumRun 2.0 lean read policy
|
|
4
|
+
|
|
5
|
+
This project stores the complete ScrumRun v2 truth but uses a bounded default read path:
|
|
6
|
+
|
|
7
|
+
1. `.scrumrun/guardrails.md`;
|
|
8
|
+
2. `.scrumrun/state.md`;
|
|
9
|
+
3. only canonical artifacts referenced by active ids;
|
|
10
|
+
4. `.scrumrun/core.md` only when method details are needed.
|
|
11
|
+
|
|
12
|
+
Do not scan every Task, Run, Sprint, Feature, or Memory file by default. Generated `state.md`, `map.md`, and `.cache/` guide retrieval but never override canonical Markdown.
|
|
13
|
+
|
|
14
|
+
Natural-language product work begins as read-only intake. Explicit approval creates/updates a Task and creates one Run. A Sprint exists only for a real batch/timebox. Run state is `executing → validating → learning → completed|failed|blocked`; retries preserve prior Runs.
|
|
15
|
+
|
|
16
|
+
`.scrumrun/guardrails.md` is canonical policy. Never bypass it, overwrite owner work, auto-confirm AI knowledge, auto-migrate v1 state, or print vault values.
|
|
17
|
+
|
|
18
|
+
Use `/sc <noun> <subject> <action> [args]`; if `/sc` is unavailable, follow `.scrumrun/core.md` manually.
|