Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

fix(deps): retain strict native dependency edits [B24,H16]

Corey Olson1ff47cf9fd44
diff --git a/src/board.js b/src/board.js
index 5e861ff1..01fd2f8c 100644
--- a/src/board.js
+++ b/src/board.js
@@ -1,6 +1,7 @@
import { foreignBlockers } from './cross-repo-dependencies.js';
import {
dependencyValues,
+ validateNativeDependencies,
localDependencyIds,
dependencyLabel,
} from './item-dependencies.js';
@@ -864,7 +865,7 @@ export function validateItemEdit(board, id, { agentId, brief, route, criterion,
if (!Array.isArray(after)) {
throw new Refused('BAD_DEPENDENCIES', 'item dependencies must be an array of positive integer item ids; use --after 1,2 or --after none');
}
- dependencyValues(after);
+ validateNativeDependencies(after);
validateItemDependencies(board, id, after);
}
const next = {
diff --git a/src/item-dependencies.js b/src/item-dependencies.js
index 2d7be00c..e0a24ec9 100644
--- a/src/item-dependencies.js
+++ b/src/item-dependencies.js
@@ -17,6 +17,15 @@ export function parseDependency(value) {
return { kind: 'foreign', repo: match[1], id: Number(match[2]) };
}
+/** Keep native dependency-edit arrays typed; only CLI and persisted fields decode textual local ids. */
+export function validateNativeDependencies(value) {
+ if (!Array.isArray(value)) invalid();
+ for (const part of value) {
+ const reference = parseDependency(part);
+ if (reference.kind === 'local' && typeof part !== 'number') invalid();
+ }
+}
+
/** Read a persisted comma-separated field or a public dependency list as typed references. */
export function dependencyReferences(value) {
if (value && typeof value === 'object' && !Array.isArray(value)) value = value.item_after;
diff --git a/test/pending-refreeze.test.js b/test/pending-refreeze.test.js
index b2d01a5c..9f3df3d7 100644
--- a/test/pending-refreeze.test.js
+++ b/test/pending-refreeze.test.js
@@ -365,7 +365,7 @@ test('dependency edits replay the same on every engine [B3,V2,H16]', async (t) =
}
} finally { delete board.executionEngineVersion; }
}
- for (const [index, after] of [null, '1', {}, [0], [-1], [1.5], [{}], ['1']].entries()) {
+ for (const [index, after] of [null, '1', {}, [0], [-1], [1.5], [{}], ['1'], ['#1'], ['01'], ['1e0'], [' 1 ']].entries()) {
const board = open(`invalid-${index}`, snapshot);
const before = store.getItem(board, target);
const beforeEvents = store.events(board);