scrumrun 2.7.5 → 2.7.6
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 +6 -0
- package/README.md +1 -1
- package/bin/scrumrun.js +5 -1
- package/lib/memory/index.js +9 -4
- package/lib/runtime/orchestrator.js +8 -1
- package/lib/runtime/workspace-state.js +11 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes follow Semantic Versioning.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 2.7.6 - 2026-08-24
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **Branch tracking on artifacts.** Task, Feature, Sprint, and Run artifacts now record the active git branch in a `branch` frontmatter field at creation time (`null` outside a git repo). `sc plan task --list` and the generated `map.md` show the branch, giving a human-readable "which branch did this work originate from" reference index to complement the exact commit SHA already captured in each Run's workspace baseline.
|
|
12
|
+
|
|
7
13
|
## 2.7.5 - 2026-08-22
|
|
8
14
|
|
|
9
15
|
### Added
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
ScrumRun gives an agent a small command surface and a precise project memory: what should be done, how each attempt happened, which decisions constrain the code, and why the architecture exists in its current form.
|
|
6
6
|
|
|
7
|
-
**Package:** `2.7.
|
|
7
|
+
**Package:** `2.7.6` · **Method target:** `2.0.0` · **Runtime:** Node.js `>=22.13.0` · **License:** MIT
|
|
8
8
|
|
|
9
9
|
**New here?** Read the [Quickstart](docs/QUICKSTART.md) — first Run in under 10 minutes, no `SPEC.md` reading required. Full docs map in [`docs/INDEX.md`](docs/INDEX.md).
|
|
10
10
|
|
package/bin/scrumrun.js
CHANGED
|
@@ -1537,7 +1537,11 @@ function executeRootRoute(route) {
|
|
|
1537
1537
|
if (noun === "plan" && ["task", "run", "feature", "sprint"].includes(subject) && ["--list", "--show"].includes(routeArgs[0])) {
|
|
1538
1538
|
const repository = new ArtifactRepository(projectFile());
|
|
1539
1539
|
if (routeArgs[0] === "--list") {
|
|
1540
|
-
const artifacts = repository.list(subject).map((artifact) =>
|
|
1540
|
+
const artifacts = repository.list(subject).map((artifact) => {
|
|
1541
|
+
const title = ((artifact.body || "").match(/^# ([^\r\n]+)/m) || [])[1] || artifact.record.id;
|
|
1542
|
+
const branch = artifact.record.branch ? ` [${artifact.record.branch}]` : "";
|
|
1543
|
+
return `${artifact.record.id} | ${artifact.record.status} | ${title}${branch}`;
|
|
1544
|
+
});
|
|
1541
1545
|
console.log(artifacts.length ? artifacts.join("\n") : `No ${subject} artifacts.`);
|
|
1542
1546
|
} else {
|
|
1543
1547
|
const artifact = repository.read(subject, routeArgs[1]);
|
package/lib/memory/index.js
CHANGED
|
@@ -12,7 +12,7 @@ const { containsSecret } = require("../security/secrets");
|
|
|
12
12
|
const { canonicalWatchSnapshot, fileWatchSnapshot } = require("../runtime/canonical-snapshot");
|
|
13
13
|
|
|
14
14
|
const CACHE_RELATIVE = path.join(".cache", "semantic-index.sqlite");
|
|
15
|
-
const INDEX_SCHEMA_VERSION =
|
|
15
|
+
const INDEX_SCHEMA_VERSION = 5;
|
|
16
16
|
const INACTIVE = new Set(["rejected", "invalidated", "deprecated", "archived"]);
|
|
17
17
|
const SEARCH_BACKENDS = new Set(["auto", "fts5", "like"]);
|
|
18
18
|
const MAX_SEARCH_TOKENS = 32;
|
|
@@ -124,6 +124,7 @@ function createSchema(database, { searchBackend = "auto" } = {}) {
|
|
|
124
124
|
path TEXT NOT NULL UNIQUE,
|
|
125
125
|
hash TEXT NOT NULL,
|
|
126
126
|
content TEXT NOT NULL,
|
|
127
|
+
branch TEXT,
|
|
127
128
|
valid_from TEXT,
|
|
128
129
|
valid_until TEXT,
|
|
129
130
|
last_verified_commit TEXT,
|
|
@@ -380,7 +381,7 @@ function rebuildIndex(projectRoot, { searchBackend = "auto" } = {}) {
|
|
|
380
381
|
try {
|
|
381
382
|
database = new DatabaseSync(temp);
|
|
382
383
|
selectedSearchBackend = createSchema(database, { searchBackend });
|
|
383
|
-
const insertArtifact = database.prepare("INSERT INTO artifacts(id, kind, status, title, path, hash, content, valid_from, valid_until, last_verified_commit, review_trigger, search_text, active) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
|
384
|
+
const insertArtifact = database.prepare("INSERT INTO artifacts(id, kind, status, title, path, hash, content, branch, valid_from, valid_until, last_verified_commit, review_trigger, search_text, active) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
|
384
385
|
const insertFts = selectedSearchBackend === "fts5"
|
|
385
386
|
? database.prepare("INSERT INTO artifacts_fts(id, title, content) VALUES (?, ?, ?)")
|
|
386
387
|
: null;
|
|
@@ -400,6 +401,7 @@ function rebuildIndex(projectRoot, { searchBackend = "auto" } = {}) {
|
|
|
400
401
|
artifact.path,
|
|
401
402
|
sha256(artifact.content),
|
|
402
403
|
artifact.content,
|
|
404
|
+
artifact.record.branch || null,
|
|
403
405
|
artifact.record.valid_from || null,
|
|
404
406
|
artifact.record.valid_until || null,
|
|
405
407
|
artifact.record.last_verified_commit || null,
|
|
@@ -690,7 +692,7 @@ function graphIndex(projectRoot, { rebuild = true } = {}) {
|
|
|
690
692
|
else if (status.stale) throw new Error("Semantic index is missing or stale; rebuild it first.");
|
|
691
693
|
const database = new DatabaseSync(indexPath(projectRoot), { readOnly: true });
|
|
692
694
|
try {
|
|
693
|
-
const artifacts = database.prepare("SELECT id, kind, status, title, path, 'artifact' AS node_type FROM artifacts ORDER BY id").all();
|
|
695
|
+
const artifacts = database.prepare("SELECT id, kind, status, title, path, branch, 'artifact' AS node_type FROM artifacts ORDER BY id").all();
|
|
694
696
|
const code = database.prepare("SELECT id, kind, status, name AS title, path, 'code' AS node_type, fingerprint, remapped_from FROM code_nodes ORDER BY id").all();
|
|
695
697
|
return {
|
|
696
698
|
nodes: [...artifacts, ...code],
|
|
@@ -725,7 +727,10 @@ function writeMap(projectRoot, { nodeLimit = 200, edgeLimit = 400 } = {}) {
|
|
|
725
727
|
"",
|
|
726
728
|
"## Nodes",
|
|
727
729
|
"",
|
|
728
|
-
...(nodes.length ? nodes.map((node) =>
|
|
730
|
+
...(nodes.length ? nodes.map((node) => {
|
|
731
|
+
const branch = node.branch ? ` | branch:${node.branch}` : "";
|
|
732
|
+
return `- ${node.id} | ${node.node_type} | ${node.kind} | ${node.status} | ${node.title} | ${node.path}${branch}`;
|
|
733
|
+
}) : ["- None."]),
|
|
729
734
|
...(graph.nodes.length > nodes.length ? [`- … ${graph.nodes.length - nodes.length} more nodes in the semantic index.`] : []),
|
|
730
735
|
"",
|
|
731
736
|
"## Relations",
|
|
@@ -19,6 +19,7 @@ const { agentIdentity, evaluatePolicy } = require("./policy-engine");
|
|
|
19
19
|
const { artifactSnapshot, canonicalFingerprint, canonicalWatchSnapshot } = require("./canonical-snapshot");
|
|
20
20
|
const { decodeApproval } = require("./request-engine");
|
|
21
21
|
const { containsSecret } = require("../security/secrets");
|
|
22
|
+
const { currentBranch } = require("./workspace-state");
|
|
22
23
|
const { extractLearningCandidates } = require("../code-intel/learning");
|
|
23
24
|
const { appendRunEvent, appendTechnicalSummary, createRunBody, instant } = require("./run-ledger");
|
|
24
25
|
const { generateBriefing } = require("./briefing");
|
|
@@ -103,6 +104,7 @@ function approveRequestUnlocked(projectRoot, token, { failurePoint = null, inter
|
|
|
103
104
|
const created = date();
|
|
104
105
|
const enforceablePolicy = policyState(projectRoot);
|
|
105
106
|
const baseline = publicWorkspace(workspace);
|
|
107
|
+
const branch = currentBranch(projectRoot);
|
|
106
108
|
const taskId = nextId(repository, "task");
|
|
107
109
|
const runId = nextId(repository, "run");
|
|
108
110
|
const task = {
|
|
@@ -115,6 +117,7 @@ function approveRequestUnlocked(projectRoot, token, { failurePoint = null, inter
|
|
|
115
117
|
method: METHOD_VERSION,
|
|
116
118
|
feature: null,
|
|
117
119
|
sprint: null,
|
|
120
|
+
branch,
|
|
118
121
|
assignee: agentIdentity(scrumDir) || "agent",
|
|
119
122
|
approval_id: approvalId,
|
|
120
123
|
context_fingerprint: payload.fingerprint,
|
|
@@ -129,6 +132,7 @@ function approveRequestUnlocked(projectRoot, token, { failurePoint = null, inter
|
|
|
129
132
|
method: METHOD_VERSION,
|
|
130
133
|
task: taskId,
|
|
131
134
|
sprint: null,
|
|
135
|
+
branch,
|
|
132
136
|
attempt: 1,
|
|
133
137
|
ledger: 1,
|
|
134
138
|
guardrails: 1,
|
|
@@ -304,6 +308,7 @@ function retryTaskUnlocked(projectRoot, taskId, { note = "Retry explicitly appro
|
|
|
304
308
|
method: METHOD_VERSION,
|
|
305
309
|
task: taskId,
|
|
306
310
|
sprint: taskArtifact.record.sprint || null,
|
|
311
|
+
branch: currentBranch(projectRoot),
|
|
307
312
|
attempt: attempts.length ? Math.max(...attempts) + 1 : 1,
|
|
308
313
|
ledger: 1,
|
|
309
314
|
guardrails: 1,
|
|
@@ -374,6 +379,7 @@ function startBacklogTaskUnlocked(projectRoot, taskId, { note = "Backlog Task st
|
|
|
374
379
|
method: METHOD_VERSION,
|
|
375
380
|
task: taskId,
|
|
376
381
|
sprint: taskArtifact.record.sprint || null,
|
|
382
|
+
branch: currentBranch(projectRoot),
|
|
377
383
|
attempt: 1,
|
|
378
384
|
ledger: 1,
|
|
379
385
|
guardrails: 1,
|
|
@@ -504,7 +510,8 @@ function addPlanArtifactUnlocked(projectRoot, kind, label, { type = null, status
|
|
|
504
510
|
status: chosenStatus,
|
|
505
511
|
created,
|
|
506
512
|
updated: created,
|
|
507
|
-
method: METHOD_VERSION
|
|
513
|
+
method: METHOD_VERSION,
|
|
514
|
+
branch: currentBranch(projectRoot)
|
|
508
515
|
};
|
|
509
516
|
if (kind === "task") {
|
|
510
517
|
record.type = chosenType;
|
|
@@ -110,6 +110,16 @@ function workspaceState(projectRoot) {
|
|
|
110
110
|
return { ...state, fingerprint: sha256(stable(canonical)) };
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
function currentBranch(projectRoot) {
|
|
114
|
+
try {
|
|
115
|
+
const branch = gitOutput(projectRoot, ["rev-parse", "--abbrev-ref", "HEAD"]).toString("utf8").trim();
|
|
116
|
+
if (!branch || branch === "HEAD") return null;
|
|
117
|
+
return branch;
|
|
118
|
+
} catch {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
113
123
|
function changesBetween(before, after) {
|
|
114
124
|
if (!before || !after || before.mode !== after.mode || before.head !== after.head) throw new Error("Workspace baseline mode or Git HEAD changed during the Run.");
|
|
115
125
|
const left = new Map(before.files.map((item) => [item.path, item]));
|
|
@@ -139,6 +149,7 @@ function pathAuthorized(relative, allowed) {
|
|
|
139
149
|
|
|
140
150
|
module.exports = {
|
|
141
151
|
changesBetween,
|
|
152
|
+
currentBranch,
|
|
142
153
|
normalizedRelative,
|
|
143
154
|
pathAuthorized,
|
|
144
155
|
stable,
|