import assert from 'node:assert/strict';
import test from 'node:test';
import '../../site/owner-digest.js';
import '../../site/demo.js';
const views = globalThis.TorchOwnerDigest;
const now = new Date('2026-09-30T12:00:00Z');
const section = (items) => ({ available: true, count: items.length, items, truncated: false });
function publication() {
return { id: 'report-1', report: {
schema: 'torch.dev/owner-digest/v1alpha1', generatedAt: '2026-09-30T08:12:00Z',
window: { since: '2026-09-29T08:12:00Z', until: '2026-09-30T08:12:00Z', hours: 24 },
needsOwner: section([{ id: 'approval-1', title: '
', requester: 'interface' }]),
deliveryReview: section([]), shipped: section([]), landed: section([{ sourceArea: 'services', commit: 'abc' }]),
completed: section([]), blocked: section([]), decisions: section([]), neglectedRequests: section([]),
lastDeployment: { label: 'Public beta', commit: 'abc', state: 'unknown', failureReason: '' },
activityCoverage: { complete: false }, coverage: ['Structured decisions only'],
markdown: '',
} };
}
test('SCN-console-owner-digest: published briefing is safe, owner-first, evidence-labelled and never a live shipping claim', () => {
const input = publication();
const before = JSON.stringify(input);
const html = views.render(input, { now });
assert.ok(html.indexOf('Needs you') < html.indexOf('Shipping and integration'));
assert.match(html, /Outcome unknown/);
assert.match(html, /not independent live verification/);
assert.match(html, /activity history is incomplete/i);
assert.match(html, /href="#flow-watch"/);
assert.match(html, /Landed.*not necessarily deployed/s);
assert.doesNotMatch(html, /