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): a question's Needs-you button says answer and its id [N26]

Corey Olsonba3fcf65e48f
diff --git a/src/cockpit.js b/src/cockpit.js
index 6e6e339b..f9f4cccb 100644
--- a/src/cockpit.js
+++ b/src/cockpit.js
@@ -2204,7 +2204,7 @@ function renderGroup(group) {
$('group-needs').innerHTML = needs.length ? needs.map((row) => {
const titles = new Map(row.repo.board.items.map((item) => [String(item.id), item.title]));
const text = rich(row.text, titles, true, row.repo.root);
- return '<div class="group-need"><b>' + esc(row.repo.name) + '</b><code>' + esc(row.ref) + '</code><span>' + text + '</span><button data-root="' + esc(row.repo.root) + '" type="button"><em>' + esc(row.what) + (row.at ? ', ' + age(row.at) : '') + ' →</em></button></div>';
+ return '<div class="group-need"><b>' + esc(row.repo.name) + '</b><code>' + esc(row.ref) + '</code><span>' + text + '</span><button data-root="' + esc(row.repo.root) + '" type="button"><em>' + esc(row.kind === 'pending' ? 'answer ' + row.ref : row.what) + (row.at ? ', ' + age(row.at) : '') + ' →</em></button></div>';
}).join('') : '<div class="empty">Nothing needs you across this project.</div>';
const events = group.repos.flatMap((repo) => {
const titles = new Map(repo.board.items.map((item) => [String(item.id), item.title]));
@@ -2539,7 +2539,7 @@ function render() {
// Adapt display targets and the existing hold age without reimplementing which calls belong here.
const needs = personalNeeds.filter((row) => !['draft', 'rigor-draft'].includes(row.kind)).map((row) => row.kind === 'decision'
? ['decide:' + row.id, row.ref, row.text, 'decide', row.at]
- : row.kind === 'pending' ? ['spec:' + row.id, row.ref, row.text, row.what]
+ : row.kind === 'pending' ? ['spec:' + row.id, row.ref, row.text, 'answer ' + row.ref] // the person's words; agents get the command (#875)
: ['tab:shouts', row.ref, row.text, row.what, p.holds.find((hold) => hold.hold_lane === row.id)?.hold_at]);
const drafts = personalNeeds.find((row) => row.kind === 'draft')?.count ?? 0;
const rigorDrafts = personalNeeds.filter((row) => row.kind === 'rigor-draft');
diff --git a/test/cockpit/projects.test.js b/test/cockpit/projects.test.js
index 1f4aa14c..2a246391 100644
--- a/test/cockpit/projects.test.js
+++ b/test/cockpit/projects.test.js
@@ -182,7 +182,8 @@ test('projects group repos with combined needs and activity, while ungrouped and
assert.equal(page.element('tabs').hidden, true);
assert.match(page.show('group-needs'), /Core API/);
assert.match(page.show('group-needs'), /Web UI/);
- assert.match(page.show('group-needs'), /<b>Core API<\/b><code>G3<\/code><span>Should <a class="ref" href="\/Core%20API\/items\/1\?k=[^"]+" data-go="item:1" data-board="[^"]+" title="Core target #1">#1<\/a> greet in French\?<\/span><button data-root="[^"]+" type="button"><em>answer in SPEC\.md →<\/em><\/button>/, "a question in one repo's spec");
+ assert.match(page.show('group-needs'), /<b>Core API<\/b><code>G3<\/code><span>Should <a class="ref" href="\/Core%20API\/items\/1\?k=[^"]+" data-go="item:1" data-board="[^"]+" title="Core target #1">#1<\/a> greet in French\?<\/span><button data-root="[^"]+" type="button"><em>answer G3 →<\/em><\/button>/, "a question in one repo's spec, in the person's words");
+ assert.doesNotMatch(page.show('group-needs'), /pullboard spec answer|answer in SPEC\.md/, 'the person never gets a command or the old wording on a button (#875)');
assert.match(page.show('group-needs'), /<b>Web UI<\/b><code>coordinator \(unknown\)<\/code><span>Ship <a class="ref" href="\/Web%20UI\/items\/1\?k=[^"]+" data-go="item:1" data-board="[^"]+" title="Target for #1">#1<\/a> today\?<\/span><button data-root="[^"]+" type="button"><em>decision, /, "and a decision in another's");
assert.doesNotMatch(page.show('group-needs'), /sent back|to verify|Greeting|Header/, "work sent back or waiting for a verdict is the agents', not the person's");
assert.match(page.show('group-activity'), /Core API/);