39 lines
2.1 KiB
JavaScript
39 lines
2.1 KiB
JavaScript
// Row 116 replay rows: the live f71c73c9 rows Sage saved, or a 19/229
|
|
// decision of the same shape over verdict 1fbd1ed1. Prints fixture.mjs input.
|
|
import { readFileSync } from 'node:fs';
|
|
const [file, which] = process.argv.slice(2);
|
|
const j = JSON.parse(readFileSync(file, 'utf8'));
|
|
const ev = (r) => ({ table: 'events', business: 'mosaic-stack', ...r });
|
|
const bySeq = (a, b) => a.seq - b.seq;
|
|
// task.created rows are left out: the schema's trigger needs the human.input
|
|
// request they cite, which isn't in the dump, and land-work never reads them.
|
|
const kept = (r) => r.kind !== 'task.created';
|
|
let rows;
|
|
if (which === '265') {
|
|
rows = [
|
|
{ table: 'decisions', ...j.decision[0] },
|
|
...[...j.raise_allowed, ...j.verdict_events].filter(kept).sort(bySeq).map(ev),
|
|
...j.decision_events.map((r) => ({ table: 'decision_events', ...r })),
|
|
];
|
|
} else {
|
|
const D = 'd2290000-0000-4000-8000-000000000229';
|
|
const d = j.decision[0];
|
|
const options = [
|
|
{ key: 'yes', text: 'Squash-merge work/vikunja-19-229 into refactor' },
|
|
{ key: 'no', text: "Don't merge yet" },
|
|
];
|
|
rows = [
|
|
{ table: 'decisions', ...d, id: D, at: '2026-10-14T16:40:00.000Z', raised_by_run: 'rfixture229',
|
|
question: 'Can I squash-merge work/vikunja-19-229 into refactor? Row 116 fixture over verdict 1fbd1ed1.',
|
|
options: JSON.stringify(options) },
|
|
...j.task229.filter(kept).sort(bySeq).map(ev),
|
|
ev({ seq: 900, id: '2290d000-0000-4000-8000-000000000900', kind: 'action.allowed', subject: D, actor_role: 'pm',
|
|
actor_run: 'rfixture229', at: '2026-10-14T16:40:00.001Z',
|
|
body: { decision: D, action: 'git.merge.protected', operation: 'decision.raise', task_ref: null, target: 'refactor', approvalChoice: 'yes', holderRun: null } }),
|
|
ev({ seq: 901, id: '2290d000-0000-4000-8000-000000000901', kind: 'human.input', subject: D, actor_role: null,
|
|
at: '2026-10-14T16:41:00.001Z', body: { kind: 'answer', decision: D, op: 'resolved', choice: 'yes' } }),
|
|
{ table: 'decision_events', seq: 3, decision: D, at: '2026-10-14T16:41:00.000Z', op: 'resolved', by: 'jason', choice: 'yes', note: null, via: 'cli' },
|
|
];
|
|
}
|
|
process.stdout.write(JSON.stringify(rows));
|