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(view): name the doctrine file in view [D1]

Corey Olson5fcd755b451a
diff --git a/src/cockpit.js b/src/cockpit.js
index 6b8eaca5..070f0751 100644
--- a/src/cockpit.js
+++ b/src/cockpit.js
@@ -981,14 +981,14 @@ function render() {
const reason = declined && r.reason ? '<small class="rule-reason">Reason: ' + esc(r.reason) + '</small>' : '';
const source = kind === 'doctrine' ? '<small class="rule-source">' + esc(ruleSource(r)) + '</small>' : '';
return head + '<div class="srow' + (view.row[kind] === r.id ? ' on' : '') + '" data-row="' + kind + ':' + esc(r.id) + '"><code>' + esc(r.id) + '</code><span><span class="chip ' + tone(r.status) + '">' + esc(r.status) + '</span>' + source + '</span><span>' + text + reason + '</span></div>';
- }).join('') : '<div class="empty">' + (rows.length ? 'No rows match.' : kind === 'spec' ? 'No spec rows yet. Each requirement is one row in SPEC.md, such as G1 [draft, must] and a line; write them, or ask an agent to, and they show up here.' : 'No practice rows yet: they live in PRACTICE.md.') + '</div>';
+ }).join('') : '<div class="empty">' + (rows.length ? 'No rows match.' : kind === 'spec' ? 'No spec rows yet. Each requirement is one row in SPEC.md, such as G1 [draft, must] and a line; write them, or ask an agent to, and they show up here.' : 'No doctrine rows yet: they live in DOCTRINE.md.') + '</div>';
const row = rows.find((r) => r.id === view.row[kind]);
const citing = row ? p.items.filter((i) => i.specs.includes(row.id)) : [];
const declined = kind === 'doctrine' && row && row.status === 'wont';
const text = row ? declined ? '<s>' + esc(row.standardText || row.text) + '</s>' : esc(row.text) : '';
const source = kind === 'doctrine' && row ? '<span class="chip">' + esc(ruleSource(row)) + '</span>' : '';
const reason = declined && row.reason ? '<dt>reason</dt><dd>' + esc(row.reason) + '</dd>' : '';
- const home = kind === 'doctrine' && row && row.origin === 'standard' ? 'Standard rules come with Pullboard; override or decline one in PRACTICE.md.' : 'Rows change in ' + (kind === 'spec' ? 'SPEC.md' : 'PRACTICE.md') + ', and only you approve them.';
+ const home = kind === 'doctrine' && row && row.origin === 'standard' ? 'Standard rules come with Pullboard; override or decline one in DOCTRINE.md.' : 'Rows change in ' + (kind === 'spec' ? 'SPEC.md' : 'DOCTRINE.md') + ', and only you approve them.';
$(kind + '-detail').innerHTML = row ? '<div class="stack tight"><h2><span>' + esc(row.id) + '</span>' + text + '</h2><div class="meta"><span class="chip ' + tone(row.status) + '">' + esc(row.status) + '</span>' + (row.tier ? '<span class="chip">' + esc(row.tier) + '</span>' : '') + source + '</div><dl class="kv"><dt>section</dt><dd>' + esc(row.section) + '</dd>' + reason + (row.gate ? '<dt>gate</dt><dd>' + esc(row.gate) + '</dd>' : '') + (row.serves && row.serves.length ? '<dt>serves</dt><dd>' + esc(row.serves.join(', ')) + '</dd>' : '') + '</dl><div><h3>Items that cite it</h3>' + (citing.length ? '<div class="links">' + citing.map((i) => '<button data-go="item:' + i.id + '" type="button">#' + i.id + ' ' + rich(i.title, titles, false) + '</button>').join('') + '</div>' : '<div class="muted">None yet.</div>') + '</div><div class="muted">' + home + '</div></div>' : '<div class="empty">Pick a row to see it, and the items that cite it.</div>';
}
diff --git a/test/cockpit.test.js b/test/cockpit.test.js
index 6e7272a2..94d3b5bf 100644
--- a/test/cockpit.test.js
+++ b/test/cockpit.test.js
@@ -1917,6 +1917,34 @@ test('the doctrine view carries and labels inherited, local, overridden and decl
}
});
+test('the doctrine pane names DOCTRINE.md and its rules doctrine [D1,N26]', async () => {
+ const box = machine();
+ const alpha = project(box, 'doctrine-name', SPEC, { practice: 'DOCTRINE.md' });
+ writeFileSync(join(alpha.repo, 'DOCTRINE.md'), '# Team\n\n## Team\n- R1 [approved, must] Keep evidence. | gate: review\n');
+ const view = await startView(box);
+ try {
+ const page = await openPage(view);
+ await page.click({ tab: 'doctrine' });
+ const rows = JSON.parse(page.run('JSON.stringify(data.project.practice)'));
+ page.run("data.project.practice = []; view.rows.doctrine = 'all'; render()");
+ const empty = page.show('doctrine-list');
+ assert.match(empty, /No doctrine rows yet: they live in DOCTRINE\.md\./);
+ assert.doesNotMatch(empty, /PRACTICE\.md/);
+
+ page.run('data.project.practice = ' + JSON.stringify(rows) + '; render()');
+ await page.click({ row: 'doctrine:PB1' });
+ const detail = page.show('doctrine-detail');
+ assert.match(detail, /override or decline one in DOCTRINE\.md\./);
+ assert.doesNotMatch(detail, /PRACTICE\.md/);
+ await page.click({ row: 'doctrine:R1' });
+ const localDetail = page.show('doctrine-detail');
+ assert.match(localDetail, /Rows change in DOCTRINE\.md/);
+ assert.doesNotMatch(localDetail, /PRACTICE\.md/);
+ } finally {
+ await view.stop();
+ }
+});
+
test('spec rows read across a phone [N26,D1]', async () => {
const box = machine();
const alpha = project(box, 'alpha', SPEC, { practice: 'DOCTRINE.md' });