Post-test fixes: event authorship (resolver, contract proposer per revision), /events lightweight polling, SSH pubkey bootstrap pattern in secrets policy
deploy / deploy (push) Canceled after 0s

This commit is contained in:
2026-09-06 23:11:19 +03:00
parent 4301cd3838
commit 4d60b81176
9 changed files with 119 additions and 12 deletions
+24
View File
@@ -231,6 +231,7 @@ test('activity timeline includes every action of every participant', () => {
const q = svc.openQuestion(created.room_id, B, 'check IIS logs', true, created.participants[0].id);
svc.resolveQuestion(created.room_id, A, q.id, 'checked: every 15 min');
svc.proposeContract(created.room_id, B, '## Facts\n- ok');
svc.proposeContract(created.room_id, A, '## Facts\n- ok\n## Decisions\n- v2');
svc.agree(created.room_id, A);
svc.agree(created.room_id, B);
@@ -250,4 +251,27 @@ test('activity timeline includes every action of every participant', () => {
assert.ok(timeline[i - 1].at <= timeline[i].at, 'timeline must be sorted by time');
// every event is attributed to a role
for (const e of timeline) assert.ok(e.role.length > 0 && e.action.length > 0);
// resolution is attributed to the RESOLVER (A), not the question author (B)
const roleA = created.participants.find((p) => p.token === A)!.role;
const roleB = created.participants.find((p) => p.token === B)!.role;
const resolved = timeline.find((e) => e.kind === 'resolved')!;
assert.equal(resolved.role, roleA);
assert.ok(resolved.action.includes(`'s question`), 'resolved action should name the author');
// contract proposal is attributed to the proposer (B)
const contractEv = timeline.find((e) => e.kind === 'contract')!;
assert.equal(contractEv.role, roleB);
// a second revision is its own timeline event with its own author
const view2 = svc.getRoomView(created.room_id, A);
const timeline2 = buildTimeline({
participants: view2.participants,
conversation: view2.conversation,
openQuestions: view2.open_questions,
resolvedQuestions: view2.resolved_questions,
contract: view2.current_contract,
});
const contractEvents = timeline2.filter((e) => e.kind === 'contract');
assert.equal(contractEvents.length, 2, 'each contract revision is a timeline event');
assert.equal(contractEvents[0].action, 'proposed contract v1');
assert.equal(contractEvents[1].action, 'proposed contract v2');
assert.notEqual(contractEvents[0].role, contractEvents[1].role, 'authors differ per revision');
});