// O1.5 — Byte's honest microcopy line (deterministic, charm with honesty). import test from "node:test"; import assert from "node:assert/strict"; import { byteLine } from "../features/mascot/microcopy.js"; test("Prove that the line is honest about no/low signal", () => { assert.match(byteLine({ ok: false }), /sinal suficiente/i); assert.match(byteLine({ sentiment: { count: 0 } }), /prontid/i); }); test("Prove that operational state drives the line deterministically", () => { assert.match(byteLine({ control_plane: { autonomy: { suspended: true } } }), /pausado/i); assert.match(byteLine({ queue: { items: [{}] } }), /aprova/i); assert.match(byteLine({ sentiment: { count: 9, avg: 0.5 } }), /hype/i); assert.match(byteLine({ sentiment: { count: 9, avg: -0.4 } }), /esfriou/i); assert.match(byteLine({ sentiment: { count: 9, avg: 0 } }), /lendo o chat/i); }); test("Prove that the same input yields the same line and never throws", () => { const snap = { sentiment: { count: 3, avg: 0.4 } }; assert.equal(byteLine(snap), byteLine(snap)); assert.equal(typeof byteLine(), "string"); assert.ok(byteLine().length > 0); });