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(api): preserve legacy policy provenance [O5,O6]

Corey Olsonf39b3441037c
diff --git a/src/settings-inventory.js b/src/settings-inventory.js
index e3fb5754..bb65e0d0 100644
--- a/src/settings-inventory.js
+++ b/src/settings-inventory.js
@@ -143,7 +143,9 @@ function repositorySettings(rows, board) {
const supported = new Map([...leaves(defaults()), ...Object.entries(OPTIONAL_REPO_DEFAULTS), ['testConcurrency.files', performanceCores()]]);
for (const [key, fallback] of supported) {
const value = key === 'testConcurrency.browser' ? Math.min(effective.testConcurrency?.files ?? supported.get('testConcurrency.files'), effective.testConcurrency?.browser ?? 2) : at(effective, key);
- add(rows, context, key, fallback, { value });
+ // Legacy scalar verify configures only policy; its synthesized siblings retain default provenance.
+ const origin = key === 'verify.policy' && typeof raw.verify === 'string' ? 'configured' : undefined;
+ add(rows, context, key, fallback, { value, origin });
}
resourceSettings(rows, context, join(info.commonDir, 'pullboard', 'resources.sqlite'));
const relayFile = join(info.commonDir, 'pullboard', 'relay.json');
diff --git a/test/settings-api-fixture.js b/test/settings-api-fixture.js
index 3f9c9916..ae17204b 100644
--- a/test/settings-api-fixture.js
+++ b/test/settings-api-fixture.js
@@ -145,6 +145,29 @@ export async function proveSettingsApi() {
assert.equal(falseAdmission.origin, 'configured');
assert.equal(falseAdmission.source, join(repo, 'pullboard.json'));
assert.deepEqual(snapshot(root), falseSnapshot);
+ for (const [verify, policy, origin] of [
+ ['coordinator', 'coordinator', 'configured'],
+ [{ policy: 'coordinator' }, 'coordinator', 'configured'],
+ [{ policy: 'any' }, 'any', 'configured'],
+ [undefined, 'any', 'default'],
+ ]) {
+ writeFileSync(join(repo, 'pullboard.json'), JSON.stringify({ ...config, verify }));
+ const saved = snapshot(root);
+ const provenanceResponse = await fetch(address + '?board=' + id, { headers: { 'x-pullboard-key': 'api-fixture' } });
+ assert.equal(provenanceResponse.status, 200);
+ const provenanceText = await provenanceResponse.text();
+ assert.ok(!provenanceText.includes(canary));
+ const verification = JSON.parse(provenanceText).settings.filter(row => row.scope === 'repo' && row.key.startsWith('verify.'));
+ const policyRow = verification.find(row => row.key === 'verify.policy');
+ assert.equal(policyRow.value, policy);
+ assert.equal(policyRow.default, 'any');
+ assert.equal(policyRow.origin, origin, `verify ${JSON.stringify(verify)} preserves policy provenance`);
+ for (const row of verification) {
+ assert.equal(row.source, join(repo, 'pullboard.json'));
+ if (row.key !== 'verify.policy') assert.equal(row.origin, 'default', `${row.key} was not configured`);
+ }
+ assert.deepEqual(snapshot(root), saved, 'reading legacy or default verification settings changes no durable bytes');
+ }
writeFileSync(join(repo, 'pullboard.json'), JSON.stringify(config));
// Supported fields containing nested canary objects must refuse safely, not become raw JSON.
for (const invalid of [