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): isolate fact events in timeline replay [B33,B29]

Corey Olsonec15dd3fad3c
diff --git a/src/cockpit.js b/src/cockpit.js
index 11b7cd88..1881449f 100644
--- a/src/cockpit.js
+++ b/src/cockpit.js
@@ -257,7 +257,6 @@ function replay(item) {
};
for (const e of item.history) {
const verb = e.kind === 'renew' ? 'claim' : e.kind;
- if (e.kind !== 'add' && !FLOW.moves.some((move) => move.verb === verb)) continue;
// A renew is the claim that stays claimed; a claim logged as such is the one that arrives.
const fits = (s) => FLOW.moves.find((m) => m.verb === verb && m.from.includes(s) && (verb !== 'claim' || (e.kind === 'renew') === (m.to === s)));
const lapse = fits(at) ? null : clock.find((m) => m.from.includes(at) && fits(m.to));
@@ -295,10 +294,10 @@ const span = (ms) => {
* ends or begins at one says its length was not logged rather than guess it.
*/
function timeline(item) {
- const steps = replay(item);
const entries = Array.isArray(item.thread) && item.thread.length
? item.thread
- : item.history.map((entry, eventId) => ({ type: 'move', eventId: eventId + 1, ...entry }));
+ : item.history.filter((entry) => entry.kind !== 'fact').map((entry, eventId) => ({ type: 'move', eventId: eventId + 1, ...entry }));
+ const steps = replay({ ...item, history: entries.filter((entry) => entry.type === 'move').map(({ kind, by, at }) => ({ kind, by, at })) });
const facts = entries.filter((entry) => entry.type === 'fact');
const replacements = new Map(facts.filter((fact) => fact.supersedes).map((fact) => [fact.supersedes, fact]));
const rows = [];
diff --git a/test/cockpit.test.js b/test/cockpit.test.js
index f135ca2f..05fe60cd 100644
--- a/test/cockpit.test.js
+++ b/test/cockpit.test.js
@@ -664,7 +664,7 @@ test("the sidebar shows each product's progress [N28]", async () => {
* stay it began, with any running age read as its text.
*/
function timelineRows(html) {
- return [...html.matchAll(/<li class="([^"]*)"><time>([^<]*)<\/time><span><b>([^<]*)<\/b> ([^<]*)<\/span>(?:<small>(.*?)<\/small>)?<\/li>/g)].map((match) => ({
+ return [...html.matchAll(/<li class="([^"]*)"[^>]*><time>([^<]*)<\/time><span><b>([^<]*)<\/b> ([^<]*)<\/span>(?:<small>(.*?)<\/small>)?<\/li>/g)].map((match) => ({
dot: match[1],
time: match[2],
event: `${match[3]} ${match[4]}`,