test(tests): R4.1f O10 report:compare outputs and the R4 test ledger (299 cases)

This commit is contained in:
bchanot committed 2026-10-18 06:00:34 +02:00
1 parent 516342beca
commit 4bdfda59ba
19 files changed
+9291

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
# Repository gitleaks config: the default rules, plus narrow, justified exceptions.
[extend]
useDefault = true
[allowlist]
description = "R4 report:compare oracle: sha256 digests of fixture PDFs whose names contain 'key' or 'keywords' (the /Keywords stamp cases); no secret can live in this generated file"
paths = ['''^crates/core/tests/oracles/r4/compare/compare\.json$''']
@@ -0,0 +1,774 @@
/**
* R4 freeze O10 (plan 2026-10-17 §B.5.1, §B.1.7): what `pnpm report:compare`
* prints and answers today, for the Rust binary of R4.7 to reproduce. The TS
* CLI (scripts/compare-reports.ts) runs as pnpm runs it: tsx from apps/app,
* INIT_CWD at the repository root, arguments typed from there. Invocations:
* every fixture PDF (top level, pdf/r3, pdf/step6, pdf/r4/tolerance and
* pdf/r4/read), one folder, the argument errors, and the 11 scenarios of
* scripts.compare.test.ts, their documents attached to PDFs under
* crates/core/tests/oracles/r4/compare/scenarios/. Absolute paths are made
* repo-relative. Rows whose output the plan §A.3 declares as changing in R4
* carry `r4Declared`. `MAKE_R4_ORACLES=1` writes the scenario PDFs and
* compare.json; never again without the owner.
*/
import { spawn } from 'node:child_process'
import { readdirSync, readFileSync, statSync } from 'node:fs'
import { availableParallelism } from 'node:os'
import { basename, dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { AFRelationship, PDFDocument } from 'pdf-lib'
import { beforeAll, describe, expect, it } from 'vitest'
import { readReportDocument, type ReportV2 } from '@faunosteo/domain'
import {
PDF_KEYWORD,
readAttachedDocument,
readAttachmentBytes,
} from '@faunosteo/pdf'
import type { SheetIndex } from '@/services/sheetIndex'
import {
compareSheetIndex,
type CompareSheetIndex,
} from '../../scripts/compare/sheet'
import {
archiveEnvelope,
bundledSheet,
loadTestSheet,
minimalReport,
} from '../helpers/sheet'
import {
checkBytesOracle,
checkJsonOracle,
MAKE_R4_ORACLES,
sha256,
} from '../helpers/r4-draw'
const HERE = dirname(fileURLToPath(import.meta.url))
const ROOT = resolve(HERE, '../../../..')
const APP_DIR = resolve(ROOT, 'apps/app')
const TSX_CLI = resolve(APP_DIR, 'node_modules/tsx/dist/cli.mjs')
const CLI_SCRIPT = 'scripts/compare-reports.ts'
const FIXTURES = 'apps/app/tests/fixtures'
const ORACLE_DIR = 'crates/core/tests/oracles/r4/compare'
const SCENARIO_DIR = `${ORACLE_DIR}/scenarios`
const OUT = resolve(ROOT, ORACLE_DIR, 'compare.json')
const V2_FULL_PDF = `${FIXTURES}/report-v2.full.pdf`
const STEP6_FOLDER = `${FIXTURES}/pdf/step6/`
const CONCURRENCY = Math.max(1, Math.min(8, availableParallelism()))
const RUN_TIMEOUT = 300_000
/** Every date of the scenario PDFs: they are byte-stable. */
const FIXED_DATE = new Date('2026-10-18T09:00:00.000Z')
const A4: [number, number] = [595.28, 841.89]
const ESC = '\u001b[2K'
const DECLARED = {
zod: 'A.3: the TS prints a ZodError message',
infinity: 'A.3: the TS reads a version as Infinity',
surrogate: 'A.3: the TS keeps a lone surrogate',
overwritten:
'A.3 (OD-4): the TS reads a lone surrogate held by an overwritten ' +
'duplicate',
} as const
type Group = 'fixture' | 'folder' | 'cli' | 'scenario'
interface Invocation {
group: Group
/** The scripts.compare.test.ts case, `describe > it`. */
scenario?: string
args: string[]
}
interface CliResult {
exitCode: number
stdout: string[]
stderr: string[]
}
interface Scenario {
title: string
/** Scenario PDF name → the document attached to it. */
documents: Record<string, unknown>
runs: string[][]
}
// ---------------------------------------------------------------------------
// The 11 scenarios of scripts.compare.test.ts, inputs reproduced as written
const scenarioPdf = (name: string) => `${SCENARIO_DIR}/${name}.pdf`
function minimalV2(): ReportV2 {
const path = resolve(ROOT, FIXTURES, 'report-v2.minimal.json')
return JSON.parse(readFileSync(path, 'utf8')) as ReportV2
}
function frozenV2Scenario(): Scenario {
return {
title:
'compareReport on the frozen v2 archive PDF > shows every legacy zone ' +
'and finding next to its canonical target',
documents: {},
runs: [[V2_FULL_PDF], ['--summary', V2_FULL_PDF], ['--full', V2_FULL_PDF]],
}
}
function unresolvedV2Scenario(): Scenario {
const v2: ReportV2 = {
...minimalV2(),
observations: [
{
id: 'o',
zones: [{ boneId: 'point-gone' }],
findings: [
{
zoneId: 'ssb',
path: ['ssb-dysfunctions', 'sutures', 'sphenozygomatic'],
labelFrSnapshot: 'Suture sphéno-zygomatique',
labelEnSnapshot: 'Sphenozygomatic suture',
requiresVetReferral: true,
},
{
zoneId: 'nowhere',
path: ['x'],
labelFrSnapshot: 'X',
labelEnSnapshot: 'X',
},
],
freeTextFindings: [],
comment: '',
},
],
}
return {
title:
'compareReport on unresolved items > names a removed finding, a ' +
'finding unknown to the catalog and an unknown zone',
documents: { 'v2-unresolved-items': v2 },
runs: [[scenarioPdf('v2-unresolved-items')]],
}
}
function v3AsIsScenario(sheet: SheetIndex): Scenario {
const report = minimalReport(sheet, {
observations: [
{
id: 'o3',
zones: [{ annotationId: 'hip', viewId: 'main', side: 'left' }],
findings: [
{
findingZoneId: 'hip',
path: ['hip-dysfunctions', 'articular', 'restriction-flexion'],
labelFrSnapshot: 'Restriction en flexion',
labelEnSnapshot: 'Flexion restriction',
},
{
findingZoneId: 'atm',
path: ['atm-observations', 'headshaking'],
labelFrSnapshot: 'Headshaking (secouement de tête)',
labelEnSnapshot: 'Headshaking',
unresolved: true,
},
{
findingZoneId: 'hip',
path: ['hip-dysfunctions'],
labelFrSnapshot: 'Catégorie',
labelEnSnapshot: 'Category',
},
],
freeTextFindings: [],
comment: '',
},
],
})
return {
title:
'compareReport on unresolved items > reads a v3 report as is and ' +
'flags what the sheet cannot place',
documents: { 'v3-as-is': report },
runs: [[scenarioPdf('v3-as-is')]],
}
}
function envelopeScenario(sheet: SheetIndex): Scenario {
const envelope = archiveEnvelope(
sheet,
minimalReport(sheet, {
observations: [
{
id: 'o-env',
zones: [{ annotationId: 'hip', viewId: 'main', side: 'left' }],
findings: [],
freeTextFindings: [],
comment: '',
},
],
}),
)
const names = ['envelope-kept', 'envelope-version-2', 'envelope-report-only']
return {
title:
'compareReport on unresolved items > prints the archive line of an ' +
'envelope: snapshot kept, or rejected with its reason',
documents: {
'envelope-kept': envelope,
'envelope-version-2': { ...envelope, envelopeVersion: 2 },
'envelope-report-only': envelope.report,
},
runs: names.map((name) => [scenarioPdf(name)]),
}
}
function otherSheetScenario(sheet: SheetIndex): Scenario {
const report = minimalReport(sheet, {
sheet: { ...sheet.sheet.ref, documentSha256: 'b'.repeat(64) },
})
return {
title:
'compareReport on unresolved items > warns when a v3 report was ' +
'written on another sheet document',
documents: { 'other-sheet-document': report },
runs: [[scenarioPdf('other-sheet-document')]],
}
}
function migratedDiffScenario(cli: CompareSheetIndex): Scenario {
const v2 = minimalV2()
const migrated = readReportDocument(v2, cli.sheet.migrationMap).report
const [a, b, c] = ['diff-v2', 'diff-v2-migrated', 'diff-v2-changed']
return {
title:
'diff and arguments > diffs the v3 content of a migrated v2 report ' +
'and its v3 re-reading',
documents: {
[a]: v2,
[b]: migrated,
[c]: { ...migrated, conclusion: 'changed' },
},
runs: [
['--diff', scenarioPdf(a), scenarioPdf(b)],
['--diff', scenarioPdf(a), scenarioPdf(c)],
],
}
}
function placeholderDiffScenario(cli: CompareSheetIndex): Scenario {
const base = readReportDocument(minimalV2(), cli.sheet.migrationMap)
const [original, edited] = ['diff-original', 'diff-edited']
return {
title:
'diff and arguments > compares placeholders by default and real ' +
'texts with --full',
documents: {
[original]: { ...base.report, conclusion: 'original' },
[edited]: { ...base.report, conclusion: 'changed' },
},
runs: [
['--diff', scenarioPdf(original), scenarioPdf(edited)],
['--full', '--diff', scenarioPdf(original), scenarioPdf(edited)],
],
}
}
function argumentsScenario(): Scenario {
return {
title:
'diff and arguments > parses files and options, refuses unknown ones',
documents: {},
runs: [
['a.pdf', '--summary', 'dir', '--locale', 'en'],
['--full', '--diff', 'a', 'b'],
['--identity'],
['--locale', 'de'],
['--json'],
],
}
}
function controlCharactersScenario(sheet: SheetIndex): Scenario {
const report = minimalReport(sheet, {
observations: [
{
id: `o${ESC}\n1`,
zones: [],
findings: [
{
findingZoneId: 'hip',
path: ['hip-dysfunctions', `x${ESC}\ny`],
labelFrSnapshot: `L${ESC}`,
labelEnSnapshot: 'L',
unresolved: true,
},
],
freeTextFindings: [`t${ESC}\nu`],
comment: `c${ESC}\nd\u009b‮
`,
},
],
})
return {
title:
'terminal safety and privacy > escapes control characters in every ' +
'untrusted string',
documents: { 'control-characters': report },
runs: [['--full', scenarioPdf('control-characters')]],
}
}
function prototypeIdsScenario(): Scenario {
const v2: ReportV2 = {
...minimalV2(),
observations: [
{
id: 'o',
zones: [{ boneId: '__proto__' }, { boneId: 'constructor' }],
findings: [
{
zoneId: '__proto__',
path: ['constructor'],
labelFrSnapshot: 'X',
labelEnSnapshot: 'X',
},
],
freeTextFindings: [],
comment: '',
},
],
}
return {
title:
'terminal safety and privacy > does not throw on prototype-chain ' +
'names used as legacy ids',
documents: { 'prototype-ids': v2 },
runs: [[scenarioPdf('prototype-ids')]],
}
}
function privacyScenario(sheet: SheetIndex): Scenario {
const report = minimalReport(sheet, {
conclusion: 'SECRET-CONCLUSION',
recommendations: 'SECRET-RECO',
nextAppointment: { kind: 'period', text: 'SECRET-WHEN' },
observations: [
{
id: 'o',
zones: [],
findings: [],
freeTextFindings: ['SECRET-TEXT'],
comment: 'SECRET-COMMENT',
},
],
})
const pdf = scenarioPdf('hidden-texts')
return {
title:
'terminal safety and privacy > hides names and free texts by default, ' +
'shows them with --full',
documents: { 'hidden-texts': report },
runs: [[pdf], ['--full', pdf]],
}
}
function buildScenarios(sheet: SheetIndex, cli: CompareSheetIndex) {
return [
frozenV2Scenario(),
unresolvedV2Scenario(),
v3AsIsScenario(sheet),
envelopeScenario(sheet),
otherSheetScenario(sheet),
migratedDiffScenario(cli),
placeholderDiffScenario(cli),
argumentsScenario(),
controlCharactersScenario(sheet),
prototypeIdsScenario(),
privacyScenario(sheet),
]
}
// ---------------------------------------------------------------------------
// Invocation plan
/** PDFs of a folder, repo-relative and sorted; `deep` walks sub-folders. */
function pdfsUnder(folder: string, deep: boolean): string[] {
return readdirSync(resolve(ROOT, folder), { withFileTypes: true })
.flatMap((entry) => {
const path = `${folder}/${entry.name}`
if (entry.isDirectory()) return deep ? pdfsUnder(path, true) : []
return entry.name.toLowerCase().endsWith('.pdf') ? [path] : []
})
.sort()
}
function fixturePdfs(): string[] {
return [
...pdfsUnder(FIXTURES, false),
...pdfsUnder(`${FIXTURES}/pdf/r3`, true),
...pdfsUnder(`${FIXTURES}/pdf/step6`, false),
...pdfsUnder(`${FIXTURES}/pdf/r4/tolerance`, false),
...pdfsUnder(`${FIXTURES}/pdf/r4/read`, false),
]
}
function invocationPlan(scenarios: readonly Scenario[]): Invocation[] {
const of = (group: Group, runs: string[][]) =>
runs.map((args): Invocation => ({ group, args }))
return [
...of(
'fixture',
fixturePdfs().map((pdf) => [pdf]),
),
...of('folder', [
[STEP6_FOLDER],
['--full', '--locale', 'en', STEP6_FOLDER],
]),
...of('cli', [
[],
['--diff', V2_FULL_PDF],
['--locale'],
[V2_FULL_PDF, '--summary', STEP6_FOLDER, '--locale', 'en'],
]),
...scenarios.flatMap(({ title, runs }) =>
runs.map(
(args): Invocation => ({ group: 'scenario', scenario: title, args }),
),
),
]
}
/** The files the CLI reads for `args`: options skipped, folders listed. */
function inputFiles(args: readonly string[]): string[] {
const files: string[] = []
for (let i = 0; i < args.length; i += 1) {
const arg = args[i]!
if (arg === '--locale') i += 1
else if (!arg.startsWith('--')) files.push(...expandArg(arg))
}
return files
}
function expandArg(arg: string): string[] {
try {
if (!statSync(resolve(ROOT, arg)).isDirectory()) return [arg]
} catch {
return [arg]
}
return pdfsUnder(arg.replace(/\/$/, ''), false)
}
// ---------------------------------------------------------------------------
// Running the CLI
function cliEnv(): NodeJS.ProcessEnv {
const env: NodeJS.ProcessEnv = { INIT_CWD: ROOT }
for (const key of ['PATH', 'HOME', 'TMPDIR'] as const) {
if (process.env[key] !== undefined) env[key] = process.env[key]
}
return env
}
/** The exact text split on "\n", the repository root cut from paths. */
function outputLines(chunks: readonly Buffer[]): string[] {
const text = Buffer.concat(chunks).toString('utf8')
return text.split(`${ROOT}/`).join('').split(ROOT).join('.').split('\n')
}
function runCli(args: readonly string[]): Promise<CliResult> {
return new Promise((settle, fail) => {
const child = spawn(process.execPath, [TSX_CLI, CLI_SCRIPT, ...args], {
cwd: APP_DIR,
env: cliEnv(),
stdio: ['ignore', 'pipe', 'pipe'],
})
const stdout: Buffer[] = []
const stderr: Buffer[] = []
child.stdout.on('data', (chunk: Buffer) => stdout.push(chunk))
child.stderr.on('data', (chunk: Buffer) => stderr.push(chunk))
child.on('error', fail)
child.on('close', (code, signal) => {
if (code === null) fail(new Error(`CLI stopped by ${signal}`))
else
settle({
exitCode: code,
stdout: outputLines(stdout),
stderr: outputLines(stderr),
})
})
})
}
/** `run` over `items`, at most `limit` at a time, results in item order. */
async function inPool<T, R>(
items: readonly T[],
limit: number,
run: (item: T) => Promise<R>,
): Promise<R[]> {
const results = new Array<R>(items.length)
let next = 0
const lane = async () => {
while (next < items.length) {
const at = next++
results[at] = await run(items[at]!)
}
}
await Promise.all(Array.from({ length: limit }, lane))
return results
}
// ---------------------------------------------------------------------------
// The A.3 declarations, from the outputs and the attachment each file holds
interface AttachmentFacts {
/** A key or string of the parsed attachment holds a lone surrogate. */
parsedSurrogate: boolean
/** A string literal of the attachment text holds one (overwritten too). */
textSurrogate: boolean
/** `version`, `envelopeVersion` or `report.version` parsed as ±Infinity. */
infiniteVersion: boolean
}
const NO_FACTS: AttachmentFacts = {
parsedSurrogate: false,
textSurrogate: false,
infiniteVersion: false,
}
const LONE_SURROGATE = /\p{Cs}/u
const STRING_LITERAL = /"(?:[^"\\]|\\.)*"/g
function holdsLoneSurrogate(value: unknown): boolean {
if (typeof value === 'string') return LONE_SURROGATE.test(value)
if (typeof value !== 'object' || value === null) return false
return Object.entries(value).some(
([key, item]) => LONE_SURROGATE.test(key) || holdsLoneSurrogate(item),
)
}
function decodesToLoneSurrogate(literal: string): boolean {
try {
return LONE_SURROGATE.test(JSON.parse(literal) as string)
} catch {
return false
}
}
function literalHoldsLoneSurrogate(text: string): boolean {
for (const [literal] of text.matchAll(STRING_LITERAL)) {
if (decodesToLoneSurrogate(literal)) return true
}
return false
}
const versionOf = (value: unknown): unknown =>
typeof value === 'object' && value !== null
? (value as { version?: unknown }).version
: undefined
function hasInfiniteVersion(raw: unknown): boolean {
if (typeof raw !== 'object' || raw === null) return false
const doc = raw as { envelopeVersion?: unknown; report?: unknown }
return [versionOf(raw), doc.envelopeVersion, versionOf(doc.report)].some(
(v) => typeof v === 'number' && !Number.isFinite(v),
)
}
async function settled<T>(promise: Promise<T>): Promise<T | undefined> {
try {
return await promise
} catch {
return undefined
}
}
async function attachmentFacts(file: string): Promise<AttachmentFacts> {
let bytes: Uint8Array
try {
bytes = new Uint8Array(readFileSync(resolve(ROOT, file)))
} catch {
return NO_FACTS
}
const raw = await settled(readAttachedDocument(bytes))
const text = await settled(
readAttachmentBytes(bytes).then((b) => new TextDecoder().decode(b)),
)
return {
parsedSurrogate: raw !== undefined && holdsLoneSurrogate(raw),
textSurrogate: text !== undefined && literalHoldsLoneSurrogate(text),
infiniteVersion: raw !== undefined && hasInfiniteVersion(raw),
}
}
/** A failure line whose reason is a ZodError message (issues as JSON). */
function isZodFailure(line: string): boolean {
const at = line.indexOf(': [')
if (!line.startsWith('!! ') || at < 0) return false
const reason = line
.slice(at + 2)
.replace(/\\u([0-9a-f]{4})/g, (_, hex: string) =>
String.fromCharCode(parseInt(hex, 16)),
)
try {
const issues: unknown = JSON.parse(reason)
return (
Array.isArray(issues) &&
issues.length > 0 &&
issues.every(
(i) => typeof (i as { code?: unknown } | null)?.code === 'string',
)
)
} catch {
return false
}
}
function declaredChange(
files: readonly string[],
stdout: readonly string[],
facts: ReadonlyMap<string, AttachmentFacts>,
): string | undefined {
const reasons = new Set<string>()
if (stdout.some(isZodFailure)) reasons.add(DECLARED.zod)
for (const file of files) {
const fact = facts.get(file) ?? NO_FACTS
if (fact.infiniteVersion) reasons.add(DECLARED.infinity)
if (stdout.some((l) => l.startsWith(`!! ${basename(file)}: `))) continue
if (fact.parsedSurrogate) reasons.add(DECLARED.surrogate)
else if (fact.textSurrogate) reasons.add(DECLARED.overwritten)
}
return reasons.size ? [...reasons].join('; ') : undefined
}
// ---------------------------------------------------------------------------
// Oracle
/** Shaped like an archive export, as r4.tolerance-oracles builds its corpus. */
async function buildPdf(document: unknown): Promise<Uint8Array> {
const doc = await PDFDocument.create()
doc.addPage(A4)
doc.setKeywords([PDF_KEYWORD])
doc.setCreationDate(FIXED_DATE)
doc.setModificationDate(FIXED_DATE)
const bytes = new TextEncoder().encode(JSON.stringify(document))
await doc.attach(bytes, 'osteo-report.json', {
mimeType: 'application/json',
description: 'Faunosteo report archive v1',
creationDate: FIXED_DATE,
modificationDate: FIXED_DATE,
afRelationship: AFRelationship.Data,
})
return doc.save({ useObjectStreams: false })
}
async function factsOf(files: readonly string[]) {
const facts = new Map<string, AttachmentFacts>()
for (const file of files) facts.set(file, await attachmentFacts(file))
return facts
}
/** sha256 of every input file that exists (argument errors name none). */
function inputDigests(files: readonly string[]): Record<string, string> {
const digests: Record<string, string> = {}
for (const file of files) {
const path = resolve(ROOT, file)
if (statSync(path, { throwIfNoEntry: false })?.isFile()) {
digests[file] = sha256(new Uint8Array(readFileSync(path)))
}
}
return digests
}
async function recordInvocations(plan: readonly Invocation[]) {
const results = await inPool(plan, CONCURRENCY, (inv) => runCli(inv.args))
const files = [...new Set(plan.flatMap((inv) => inputFiles(inv.args)))]
const facts = await factsOf(files)
const invocations = plan.map((inv, i) => {
const { exitCode, stdout, stderr } = results[i]!
const declared = declaredChange(inputFiles(inv.args), stdout, facts)
return {
...inv,
...(declared ? { r4Declared: declared } : {}),
exitCode,
stdout,
stderr,
}
})
return { inputs: inputDigests(files), invocations }
}
function refuseFieldCorpus(): void {
if (process.env.FAUNOSTEO_FIELD_CORPUS) {
throw new Error('refused: FAUNOSTEO_FIELD_CORPUS is set (plan §B.5.2)')
}
}
type OracleRow = Invocation & { r4Declared?: string; exitCode: number }
function committedRows(): OracleRow[] {
return (JSON.parse(readFileSync(OUT, 'utf8')) as { invocations: OracleRow[] })
.invocations
}
// ---------------------------------------------------------------------------
describe('R4 O10 report:compare outputs of the TS CLI', () => {
let cli: CompareSheetIndex
let scenarios: Scenario[]
beforeAll(async () => {
if (MAKE_R4_ORACLES) refuseFieldCorpus()
const sheet = await loadTestSheet()
cli = compareSheetIndex(await bundledSheet())
scenarios = buildScenarios(sheet, cli)
})
it('builds byte-stable scenario PDFs (MAKE_R4_ORACLES writes)', async () => {
const names = scenarios.flatMap((s) => Object.keys(s.documents))
expect(new Set(names).size).toBe(names.length)
for (const scenario of scenarios) {
for (const [name, document] of Object.entries(scenario.documents)) {
const path = resolve(ROOT, scenarioPdf(name))
checkBytesOracle(path, await buildPdf(document))
}
}
const listed = readdirSync(resolve(ROOT, SCENARIO_DIR)).sort()
expect(listed).toEqual(names.map((n) => `${n}.pdf`).sort())
})
it(
'records every invocation (written under MAKE_R4_ORACLES)',
async () => {
const { inputs, invocations } = await recordInvocations(
invocationPlan(scenarios),
)
checkJsonOracle(OUT, {
oracle: 'O10',
cli: `apps/app/${CLI_SCRIPT}`,
run:
'node apps/app/node_modules/tsx/dist/cli.mjs ' +
`${CLI_SCRIPT} <args>, cwd apps/app, INIT_CWD at the repository ` +
'root (pnpm report:compare typed from the root); arguments and ' +
'printed paths are repo-relative',
text:
'stdout and stderr are split on "\\n": joined with "\\n" they ' +
'give the exact text',
sheet: cli.sheet.ref,
inputs,
invocations,
})
},
RUN_TIMEOUT,
)
it('covers the 11 scenarios and marks every A.3 class at least once', () => {
const rows = committedRows()
const titles = new Set(rows.flatMap((r) => r.scenario ?? []))
expect(titles.size).toBe(11)
for (const reason of Object.values(DECLARED)) {
expect(
rows.some((r) => r.r4Declared?.includes(reason)),
reason,
).toBe(true)
}
const control = rows.find(
(r) => r.group === 'fixture' && r.args[0] === V2_FULL_PDF,
)
expect(control).toMatchObject({ exitCode: 0 })
expect(control).not.toHaveProperty('r4Declared')
})
})
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,95 @@
%PDF-1.7
%����
1 0 obj
<<
/Type /Pages
/Kids [ 4 0 R ]
/Count 1
>>
endobj
2 0 obj
<<
/Type /Catalog
/Pages 1 0 R
/Names <<
/EmbeddedFiles <<
/Names [ <FEFF006F007300740065006F002D007200650070006F00720074002E006A0073006F006E> 5 0 R ]
>>
>>
/AF [ 5 0 R ]
>>
endobj
3 0 obj
<<
/Producer <FEFF007000640066002D006C006900620020002800680074007400700073003A002F002F006700690074006800750062002E0063006F006D002F0048006F007000640069006E0067002F007000640066002D006C006900620029>
/ModDate (D:20261018090000Z)
/Creator <FEFF007000640066002D006C006900620020002800680074007400700073003A002F002F006700690074006800750062002E0063006F006D002F0048006F007000640069006E0067002F007000640066002D006C006900620029>
/CreationDate (D:20261018090000Z)
/Keywords <FEFF006600610075006E006F007300740065006F002D0061007200630068006900760065002F0031>
>>
endobj
4 0 obj
<<
/Type /Page
/Parent 1 0 R
/Resources <<
>>
/MediaBox [ 0 0 595.28 841.89 ]
>>
endobj
5 0 obj
<<
/Type /Filespec
/F (osteo-report.json)
/UF <FEFF006F007300740065006F002D007200650070006F00720074002E006A0073006F006E>
/EF <<
/F 6 0 R
>>
/Desc <FEFF004600610075006E006F007300740065006F0020007200650070006F0072007400200061007200630068006900760065002000760031>
/AFRelationship /Data
>>
endobj
6 0 obj
<<
/Type /EmbeddedFile
/Subtype /application#2Fjson
/Params <<
/Size 688
/CreationDate (D:20261018090000Z)
/ModDate (D:20261018090000Z)
>>
/Filter /FlateDecode
/Length 431
>>
stream
xœURKnÛ0½J0k© %Y²´ �è'«d•Ï‚"Ç™Tùq“r�^ «¢GÉI2”ÜÔ¸ ç½yoæI{Ø¡óÚèÊ ´‚‡ ¤CP�*¬¨sÎèÜpÖ±tn‰¢ˆð¥Úä„ :�:èö`Ä6q.܇³‹8Yà��0z+Æû ¥Fÿ)Ùâ÷¨␍’ƱçJûàˆF␍öÇ{¹Ï(ÌÙ•pA›û1Ìré2‹­X©dÉx.Ö=ÏWLUy‹U•³–·}±‘EËk²:îžZLGÚÉʸE®Q¬ê´]#›r]ʪZÑEÉ‚1Žý¦jÚJ”(êRU¼n9ëû^¦šuµVª)˜ÂFuÍæñ{�n'R*º»ý³½�¤Õß_îMJü'e–à‡ 6Ú(m¾-äãã–àyµAO)h‚Ó+WO~�\ô3x<~’E�㥻6bòƒM_ôëŽðGs
S5‡ÞŽ;$Ïà"Ò\ñÃåÿù œ¸Åä&í6%H2òR½<ÿyyþ␍‡™cä—ßÈÌáÒ¥þ…”Š£•b<7Ɔ·è¯' Û
endstream
endobj
xref
0 7
0000000000 65535 f
0000000016 00000 n
0000000076 00000 n
0000000266 00000 n
0000000829 00000 n
0000000926 00000 n
0000001228 00000 n
trailer
<<
/Size 7
/Root 2 0 R
/Info 3 0 R
>>
startxref
1868
%%EOF
@@ -0,0 +1,96 @@
%PDF-1.7
%����
1 0 obj
<<
/Type /Pages
/Kids [ 4 0 R ]
/Count 1
>>
endobj
2 0 obj
<<
/Type /Catalog
/Pages 1 0 R
/Names <<
/EmbeddedFiles <<
/Names [ <FEFF006F007300740065006F002D007200650070006F00720074002E006A0073006F006E> 5 0 R ]
>>
>>
/AF [ 5 0 R ]
>>
endobj
3 0 obj
<<
/Producer <FEFF007000640066002D006C006900620020002800680074007400700073003A002F002F006700690074006800750062002E0063006F006D002F0048006F007000640069006E0067002F007000640066002D006C006900620029>
/ModDate (D:20261018090000Z)
/Creator <FEFF007000640066002D006C006900620020002800680074007400700073003A002F002F006700690074006800750062002E0063006F006D002F0048006F007000640069006E0067002F007000640066002D006C006900620029>
/CreationDate (D:20261018090000Z)
/Keywords <FEFF006600610075006E006F007300740065006F002D0061007200630068006900760065002F0031>
>>
endobj
4 0 obj
<<
/Type /Page
/Parent 1 0 R
/Resources <<
>>
/MediaBox [ 0 0 595.28 841.89 ]
>>
endobj
5 0 obj
<<
/Type /Filespec
/F (osteo-report.json)
/UF <FEFF006F007300740065006F002D007200650070006F00720074002E006A0073006F006E>
/EF <<
/F 6 0 R
>>
/Desc <FEFF004600610075006E006F007300740065006F0020007200650070006F0072007400200061007200630068006900760065002000760031>
/AFRelationship /Data
>>
endobj
6 0 obj
<<
/Type /EmbeddedFile
/Subtype /application#2Fjson
/Params <<
/Size 558
/CreationDate (D:20261018090000Z)
/ModDate (D:20261018090000Z)
>>
/Filter /FlateDecode
/Length 354
>>
stream
xœUQAnƒ0üJå3T6Ü"E•Z)§æÔª‡Å^K`Sc’ªQþÞ5¤•"ù`ïÎÌîŒ/ì„~2β&O˜Ñ¬a^°„)�Po2ž•©àt‚7<ž7‚hÜu©6zPÁÒCÏš ³0DÌÎ?>ìæÑÙÀ® kèc{QœžãXüš�EÒ¸qöf
ž`Dpç{¹û°Œ�í鈹xYÄ
žk•s‘¦iÁµLk”2嵨۬SY-Juó)vî{òäÔ< ␍¯GÈŠ2º«T•or%eA­2Î�¬j 9B™k)ÊZð¶m¸®6r£u•q�•ÊÊ’/ë·úÄT&Ö¼_Ö˜]ŠöD;üPVk¬ua�-ŽfŒ+</ÏÈ-™5:FÐcGY~$¬3VûâË#ð;<ÝU•¢)¢-å¬êçõÓIz\úoÅXì�‚~û¿Ñ¢týø­6
endstream
endobj
xref
0 7
0000000000 65535 f
0000000016 00000 n
0000000076 00000 n
0000000266 00000 n
0000000829 00000 n
0000000926 00000 n
0000001228 00000 n
trailer
<<
/Size 7
/Root 2 0 R
/Info 3 0 R
>>
startxref
1791
%%EOF
@@ -0,0 +1,95 @@
%PDF-1.7
%����
1 0 obj
<<
/Type /Pages
/Kids [ 4 0 R ]
/Count 1
>>
endobj
2 0 obj
<<
/Type /Catalog
/Pages 1 0 R
/Names <<
/EmbeddedFiles <<
/Names [ <FEFF006F007300740065006F002D007200650070006F00720074002E006A0073006F006E> 5 0 R ]
>>
>>
/AF [ 5 0 R ]
>>
endobj
3 0 obj
<<
/Producer <FEFF007000640066002D006C006900620020002800680074007400700073003A002F002F006700690074006800750062002E0063006F006D002F0048006F007000640069006E0067002F007000640066002D006C006900620029>
/ModDate (D:20261018090000Z)
/Creator <FEFF007000640066002D006C006900620020002800680074007400700073003A002F002F006700690074006800750062002E0063006F006D002F0048006F007000640069006E0067002F007000640066002D006C006900620029>
/CreationDate (D:20261018090000Z)
/Keywords <FEFF006600610075006E006F007300740065006F002D0061007200630068006900760065002F0031>
>>
endobj
4 0 obj
<<
/Type /Page
/Parent 1 0 R
/Resources <<
>>
/MediaBox [ 0 0 595.28 841.89 ]
>>
endobj
5 0 obj
<<
/Type /Filespec
/F (osteo-report.json)
/UF <FEFF006F007300740065006F002D007200650070006F00720074002E006A0073006F006E>
/EF <<
/F 6 0 R
>>
/Desc <FEFF004600610075006E006F007300740065006F0020007200650070006F0072007400200061007200630068006900760065002000760031>
/AFRelationship /Data
>>
endobj
6 0 obj
<<
/Type /EmbeddedFile
/Subtype /application#2Fjson
/Params <<
/Size 630
/CreationDate (D:20261018090000Z)
/ModDate (D:20261018090000Z)
>>
/Filter /FlateDecode
/Length 351
>>
stream
xœm’MjÃ0…¯b´¶ƒêE¡ÞÒB Ù4¡„–.dy ì‘£Ÿü’õ½XGRMh!�>Í{óìÛ‚±J#«Êœ©†Ul¥öÎ(z…ª]±-YΤá yt”¼¼/8­»¨8§5áœÖtEPm0B:åH «N E˜©™dS?htìœ3µÂµ@*°/Á
l¼B ofÊ:C=лëv¯ 0› ãÆëÚ‚ÙŠ jYõyJ£iju$©TÓ.Ê Z¡+Ötd篜ÀFá:ADz¶Ã×R=œŠæ`WeÒÈ™õ!¶¸Z@}<¬uO$£ž�¨¡{6sƒmuHqñŒØŸoÔÅHo|˜7âOx‰_÷Ì’¡&„DºïàÞ`&äS9ãáœ_¸G½k!òãûÛ¶–7Õ—)°€½{þˆªR÷=` "$5ÊΧ_ŠE hÆ�AØ/´ÕÔ
endstream
endobj
xref
0 7
0000000000 65535 f
0000000016 00000 n
0000000076 00000 n
0000000266 00000 n
0000000829 00000 n
0000000926 00000 n
0000001228 00000 n
trailer
<<
/Size 7
/Root 2 0 R
/Info 3 0 R
>>
startxref
1788
%%EOF
+300
View File
@@ -0,0 +1,300 @@
ts_file case_title disposition target oracle note
apps/app/tests/unit/archive.envelopes.test.ts archive envelope of v2full > matches the frozen envelope and the N-1 reader accepts it kept vitest (same case) - reader switched to the frozen O11 scanner at R4.8
apps/app/tests/unit/archive.envelopes.test.ts archive envelope of demo > matches the frozen envelope and the N-1 reader accepts it kept vitest (same case) - reader switched to the frozen O11 scanner at R4.8
apps/app/tests/unit/archive.envelopes.test.ts archive envelope of v2unresolved > matches the frozen envelope and the N-1 reader accepts it kept vitest (same case) - reader switched to the frozen O11 scanner at R4.8
apps/app/tests/unit/migration.leaves.test.ts the 612 legacy leaves in the application > resolves every migrated leaf to a leaf node of the bundled sheet kept vitest (same case) - -
apps/app/tests/unit/migration.leaves.test.ts the 612 legacy leaves in the application > keeps every finding, resolved or not, through an archive PDF export and import kept vitest (same case) - -
apps/app/tests/unit/n-1.reader.test.ts drafts written through the core > a new report kept vitest (same case) - reader switched to the frozen O11 scanner at R4.8
apps/app/tests/unit/n-1.reader.test.ts drafts written through the core > after the editor reducers (zones, sides, vertebrae, findings) kept vitest (same case) - reader switched to the frozen O11 scanner at R4.8
apps/app/tests/unit/n-1.reader.test.ts drafts written through the core > after the restore of a v2 draft left by the previous version kept vitest (same case) - reader switched to the frozen O11 scanner at R4.8
apps/app/tests/unit/n-1.reader.test.ts drafts written through the core > after the import of an archive (draft and archive mirror) kept vitest (same case) - reader switched to the frozen O11 scanner at R4.8
apps/app/tests/unit/n-1.reader.test.ts archives exported from core-built reports > the attachment of report-v3.demo.json reads back through the N-1 reader kept vitest (same case) - reader switched to the frozen O11 scanner at R4.8
apps/app/tests/unit/n-1.reader.test.ts archives exported from core-built reports > the attachment of report-v2.full.json reads back through the N-1 reader kept vitest (same case) - reader switched to the frozen O11 scanner at R4.8
apps/app/tests/unit/pdf.browserRasterizer.test.ts browserRasterizer > returns PNG bytes for a valid SVG, sized by the engine kept vitest (same case) - -
apps/app/tests/unit/pdf.browserRasterizer.test.ts browserRasterizer > falls back to toDataURL when toBlob returns null kept vitest (same case) - -
apps/app/tests/unit/pdf.export.app.test.ts the archive survives its resources > T2 catalog changed: the envelope re-exports the archived sheet, not the revised one ported R4.5 cargo from_envelope (pending) - -
apps/app/tests/unit/pdf.export.app.test.ts the archive survives its resources > scenario 3 branding changed: the envelope re-exports the archived branding and never fetches ported R4.5 cargo from_envelope (pending) - -
apps/app/tests/unit/pdf.goldens.test.ts golden inputs > the 2×1 PNG decodes as 2×1 and the 1×1 as 1×1 replaced R4.4/R4.5 cargo goldens (pending) O6 pdf-lib embedPng check of the golden rasters
apps/app/tests/unit/pdf.goldens.test.ts golden inputs > the demo report covers the sheet features the goldens must freeze kept vitest (same case) - inputs of the kept views cases
apps/app/tests/unit/pdf.goldens.test.ts golden inputs > the v2unresolved report really carries unresolved findings kept vitest (same case) - inputs of the kept views cases
apps/app/tests/unit/pdf.goldens.test.ts goldens of v2full > nologos > text, images and links per locale; same pagination across locales replaced R4.4/R4.5 cargo goldens (pending) O1 Step 6 text, images and links goldens
apps/app/tests/unit/pdf.goldens.test.ts goldens of v2full > logos > text, images and links per locale; same pagination across locales replaced R4.4/R4.5 cargo goldens (pending) O1 Step 6 text, images and links goldens
apps/app/tests/unit/pdf.goldens.test.ts goldens of v2full > highlighted views: same facts but titles and data attributes kept vitest (same case) - app path
apps/app/tests/unit/pdf.goldens.test.ts goldens of demo > nologos > text, images and links per locale; same pagination across locales replaced R4.4/R4.5 cargo goldens (pending) O1 Step 6 text, images and links goldens
apps/app/tests/unit/pdf.goldens.test.ts goldens of demo > logos > text, images and links per locale; same pagination across locales replaced R4.4/R4.5 cargo goldens (pending) O1 Step 6 text, images and links goldens
apps/app/tests/unit/pdf.goldens.test.ts goldens of demo > highlighted views: same facts but titles and data attributes kept vitest (same case) - app path
apps/app/tests/unit/pdf.goldens.test.ts goldens of v2unresolved > nologos > text, images and links per locale; same pagination across locales replaced R4.4/R4.5 cargo goldens (pending) O1 Step 6 text, images and links goldens
apps/app/tests/unit/pdf.goldens.test.ts goldens of v2unresolved > logos > text, images and links per locale; same pagination across locales replaced R4.4/R4.5 cargo goldens (pending) O1 Step 6 text, images and links goldens
apps/app/tests/unit/pdf.goldens.test.ts goldens of v2unresolved > highlighted views: same facts but titles and data attributes kept vitest (same case) - app path
apps/app/tests/unit/pdf.goldens.test.ts report-v3.bare.pdf > is the demo report exported bare by Step 5 and imports with no archive kept vitest (same case) - bare v3 import
apps/app/tests/unit/pdf.import.test.ts importReportFromPdf error kinds > no_attachment for a PDF without the attachment replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.import.test.ts importReportFromPdf error kinds > attachment_stripped for a stamped archive whose attachment was removed replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.import.test.ts importReportFromPdf error kinds > invalid_pdf for an oversized file, before parsing it replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.import.test.ts importAttachment on the core (L1) > refuses an attachment with a lone surrogate as lone_surrogate, never rewritten replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.import.test.ts importAttachment on the core (L1) > imports normal text with pairs and literal backslashes unchanged replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts export on a full v3 report (FR) > produces one page per observation plus the conclusion, labels from the sheet replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts export on a full v3 report (FR) > attaches the envelope and roundtrips in both locales replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts export on a full v3 report (FR) > highlights the observation zones of a view and omits the other markers replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts PDF content on a two-observation report > prints the empty marker for a zoneless observation and keeps its findings replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts PDF content on a two-observation report > prints an unknown annotation id and an unknown finding zone raw replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts PDF content on a two-observation report > draws the EN dictionary, annotation names and finding snapshots replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts PDF content on a two-observation report > draws free findings, comments, the conclusion page and the header on every page replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts PDF content on a two-observation report > sets the PDF metadata and the archive keyword replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts PDF content on a two-observation report > embeds the four bundled logos without any network request replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts PDF content on a two-observation report > attaches osteo-report.json as a Flate EmbeddedFile, AFRelationship Data, "Faunosteo report archive v1" replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts attachment rejection > reports no_attachment for a foreign JSON attachment (no version) replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts attachment rejection > reports no_attachment for a v3 report failing validation replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts import of the frozen v2 archive PDFs > migrates the full v2 report: ids, views, paths, severities, unresolved findings replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts import of the frozen v2 archive PDFs > keeps a v2 finding whose node was removed and a zone whose id is unknown, both flagged replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts import of the frozen v2 archive PDFs > migrates the minimal v2 report replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/pdf.roundtrip.test.ts import of the frozen v2 archive PDFs > refuses unknown versions and unrelated PDFs with typed errors replaced R4.3/R4.5 (pending) - pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader
apps/app/tests/unit/r4.compare-oracles.test.ts R4 O10 report:compare outputs of the TS CLI > builds byte-stable scenario PDFs (MAKE_R4_ORACLES writes) deleted - O10 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.compare-oracles.test.ts R4 O10 report:compare outputs of the TS CLI > records every invocation (written under MAKE_R4_ORACLES) deleted - O10 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.compare-oracles.test.ts R4 O10 report:compare outputs of the TS CLI > covers the 11 scenarios and marks every A.3 class at least once deleted - O10 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.synthetic-reports.test.ts the draft sheet the reports are built on > has two views, main first, and the demo has zones on both kept vitest (same case) O13 runs on the core only
apps/app/tests/unit/r4.synthetic-reports.test.ts synthetic report L > matches the committed file kept vitest (same case) O13 runs on the core only
apps/app/tests/unit/r4.synthetic-reports.test.ts synthetic report L > comes back byte for byte through the draft restore (draft.restore) kept vitest (same case) O13 runs on the core only
apps/app/tests/unit/r4.synthetic-reports.test.ts synthetic report L > rasterises two views per observation kept vitest (same case) O13 runs on the core only
apps/app/tests/unit/r4.synthetic-reports.test.ts synthetic report L > stays within the export caps kept vitest (same case) O13 runs on the core only
apps/app/tests/unit/r4.synthetic-reports.test.ts synthetic report CAP > matches the committed file kept vitest (same case) O13 runs on the core only
apps/app/tests/unit/r4.synthetic-reports.test.ts synthetic report CAP > comes back byte for byte through the draft restore (draft.restore) kept vitest (same case) O13 runs on the core only
apps/app/tests/unit/r4.synthetic-reports.test.ts synthetic report CAP > rasterises two views per observation kept vitest (same case) O13 runs on the core only
apps/app/tests/unit/r4.synthetic-reports.test.ts synthetic report CAP > stays within the export caps kept vitest (same case) O13 runs on the core only
apps/app/tests/unit/r4.tolerance-oracles.test.ts R4 O8 tolerance corpus on the R3 import path > has unique case ids deleted - O8 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.tolerance-oracles.test.ts R4 O8 tolerance corpus on the R3 import path > builds byte-identical PDFs (written under MAKE_R4_ORACLES) deleted - O8 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.tolerance-oracles.test.ts R4 O8 tolerance corpus on the R3 import path > records the R3 outcome of every committed PDF deleted - O8 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.tolerance-oracles.test.ts R4 O8 tolerance corpus on the R3 import path > imports both controls with their archive state deleted - O8 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts writer oracles of v2full > nologos > fr: O1 draw log, O2 PDF, rounded = step6 deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts writer oracles of v2full > nologos > en: O1 draw log, O2 PDF, rounded = step6 deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts writer oracles of v2full > logos > fr: O1 draw log, O2 PDF, rounded = step6 deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts writer oracles of v2full > logos > en: O1 draw log, O2 PDF, rounded = step6 deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts writer oracles of demo > nologos > fr: O1 draw log, O2 PDF, rounded = step6 deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts writer oracles of demo > nologos > en: O1 draw log, O2 PDF, rounded = step6 deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts writer oracles of demo > logos > fr: O1 draw log, O2 PDF, rounded = step6 deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts writer oracles of demo > logos > en: O1 draw log, O2 PDF, rounded = step6 deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts writer oracles of v2unresolved > nologos > fr: O1 draw log, O2 PDF, rounded = step6 deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts writer oracles of v2unresolved > nologos > en: O1 draw log, O2 PDF, rounded = step6 deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts writer oracles of v2unresolved > logos > fr: O1 draw log, O2 PDF, rounded = step6 deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts writer oracles of v2unresolved > logos > en: O1 draw log, O2 PDF, rounded = step6 deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts O2 real raster: v2full first observation, fr, logos, resvg > freezes the PDF, every PNG returned and the call manifest deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts O2 store path: demo, next appointment set, practitioner edited > freezes the PDF and the store report; attachment order is D-R11 deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts O3 pre-R2 envelope PDF demo.fr.nologos > carries the frozen bytes, read back as is deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts O3 pre-R2 envelope PDF v2full.fr.nologos > carries the frozen bytes, read back as is deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/r4.writer-oracles.test.ts O3 pre-R2 envelope PDF v2unresolved.fr.nologos > carries the frozen bytes, read back as is deleted - O1/O2/O3 generator; oracle files kept (R4.8)
apps/app/tests/unit/routes.EditorRoute.export.test.tsx EditorRoute export > calls exportReportToPdf with the store report, the loaded index and the FR locale kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.EditorRoute.export.test.tsx EditorRoute export > passes the active locale (EN) kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.EditorRoute.export.test.tsx EditorRoute export > downloads bilan-<animal>-<date>.pdf through a blob URL it revokes after a delay kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.EditorRoute.export.test.tsx EditorRoute export > downloads then alerts editor.export_warnings naming the failed logo slots and views kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.EditorRoute.export.test.tsx EditorRoute export > alerts editor.export_failed when the export rejects kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.archive.test.tsx HomeRoute import of a Step 6 archive > same sheet: keeps the archive in the store and its mirror, alerts archive_ok, no rebase kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.archive.test.tsx HomeRoute import of a Step 6 archive > other sheet: rebases onto the loaded sheet, labels from the archived snapshot, alert with the count kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.archive.test.tsx HomeRoute import of a Step 6 archive > other sheet, everything resolved: complete headline, the rebased line says 0 kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.archive.test.tsx HomeRoute import of a Step 6 archive > snapshot rejected: the report opens, the alert names the reason, no archive kept kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.archive.test.tsx HomeRoute import of a Step 6 archive > attachment_stripped → its error message, nothing opened kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.import.test.tsx HomeRoute import: success paths > passes the file bytes to the scan and the attachment to the loaded sheet, hydrates, navigates to /editor kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.import.test.tsx HomeRoute import: success paths > alerts "degraded" then the unresolved count (zones + findings) after a lossy migration kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.import.test.tsx HomeRoute import: success paths > stays silent on a migration that lost nothing kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.import.test.tsx HomeRoute import: error paths > incompatible_version → message with the found version kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.import.test.tsx HomeRoute import: error paths > invalid_pdf → unreadable PDF message kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.import.test.tsx HomeRoute import: error paths > no_attachment → not a Faunosteo PDF message kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.import.test.tsx HomeRoute import: error paths > lone_surrogate → malformed text message, file untouched kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.import.test.tsx HomeRoute import: error paths > generic Error → generic message kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.import.test.tsx HomeRoute import: size gate > refuses a file over MAX_PDF_BYTES before reading it: unreadable PDF message kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.import.test.tsx HomeRoute import: a core failure reading the tab draft > shows the engine error line, not the held-session alert kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.import.test.tsx HomeRoute import: a core failure reading the tab draft > still alerts and opens the editor for a held session text kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.rescueCopy.test.tsx opening a rescue copy > reopens the v2full report equal to the original kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.rescueCopy.test.tsx opening a rescue copy > reopens the demo report equal to the original kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.rescueCopy.test.tsx opening a rescue copy > reopens the v2unresolved report equal to the original kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.rescueCopy.test.tsx opening a rescue copy > routes by content: no .json name, no type, leading blanks and a BOM kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.rescueCopy.test.tsx opening a rescue copy > announces a copy rebased on another sheet revision kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.rescueCopy.test.tsx opening a rescue copy > still sends a PDF down the PDF path kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.rescueCopy.test.tsx refusing a file > invalid JSON: error line, nothing changed, nothing held kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.rescueCopy.test.tsx refusing a file > an unsupported version: error line, nothing changed, nothing held kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.rescueCopy.test.tsx refusing a file > a lone surrogate: error line, nothing changed, nothing held kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.rescueCopy.test.tsx refusing a file > invalid UTF-8: error line, nothing changed, nothing held kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.rescueCopy.test.tsx refusing a file > an over-cap file is refused before any full read kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.rescueCopy.test.tsx refusing a file > the core kind internal takes the engine message path, not the copy message kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.HomeRoute.rescueCopy.test.tsx refusing a file > the core kind rebase_failed takes the engine message path, not the copy message kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx the stopped notice on the pages that run the core > Home, New report and the full-page notice: reload when the save is fine kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx the stopped notice on the pages that run the core > Home, New report and the full-page notice: a copy of the in-memory report when storage is full kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx the stopped notice on the pages that run the core > is absent while the engine runs, and appears when it stops kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx the stopped notice on the pages that run the core > keeps the full-page retry while the engine is not stopped kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx EditorRoute > puts the stopped notice in the banner slot, in place of the storage-full text kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx EditorRoute > keeps the storage-full text and adds the copy button when the engine runs kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx EditorRoute > says the stopped text when the export fails once the engine stopped kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx EditorRoute > says the unsaved stopped text for an export that fails with a full storage kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx EditorRoute > keeps the export message while the engine is not stopped kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx the stopped text on the Home import line and the New report alert > Home import: the engine error line says the stopped text kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx the stopped text on the Home import line and the New report alert > Home import: the unsaved stopped text when storage is full kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx the stopped text on the Home import line and the New report alert > Home import: keeps the engine error line while the engine is not stopped kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx the stopped text on the Home import line and the New report alert > New report: the alert says the stopped text kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx the stopped text on the Home import line and the New report alert > New report: the unsaved stopped text when storage is full kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/routes.coreStopped.test.tsx the stopped text on the Home import line and the New report alert > New report: keeps the sheet alert while the engine is not stopped kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/scripts.compare.test.ts compareReport on the frozen v2 archive PDF > shows every legacy zone and finding next to its canonical target ported R4.7 cargo (pending) O10 -
apps/app/tests/unit/scripts.compare.test.ts compareReport on unresolved items > names a removed finding, a finding unknown to the catalog and an unknown zone ported R4.7 cargo (pending) O10 -
apps/app/tests/unit/scripts.compare.test.ts compareReport on unresolved items > reads a v3 report as is and flags what the sheet cannot place ported R4.7 cargo (pending) O10 -
apps/app/tests/unit/scripts.compare.test.ts compareReport on unresolved items > prints the archive line of an envelope: snapshot kept, or rejected with its reason ported R4.7 cargo (pending) O10 -
apps/app/tests/unit/scripts.compare.test.ts compareReport on unresolved items > warns when a v3 report was written on another sheet document ported R4.7 cargo (pending) O10 -
apps/app/tests/unit/scripts.compare.test.ts diff and arguments > diffs the v3 content of a migrated v2 report and its v3 re-reading ported R4.7 cargo (pending) O10 -
apps/app/tests/unit/scripts.compare.test.ts diff and arguments > compares placeholders by default and real texts with --full ported R4.7 cargo (pending) O10 -
apps/app/tests/unit/scripts.compare.test.ts diff and arguments > parses files and options, refuses unknown ones ported R4.7 cargo (pending) O10 -
apps/app/tests/unit/scripts.compare.test.ts terminal safety and privacy > escapes control characters in every untrusted string ported R4.7 cargo (pending) O10 -
apps/app/tests/unit/scripts.compare.test.ts terminal safety and privacy > does not throw on prototype-chain names used as legacy ids ported R4.7 cargo (pending) O10 -
apps/app/tests/unit/scripts.compare.test.ts terminal safety and privacy > hides names and free texts by default, shows them with --full ported R4.7 cargo (pending) O10 -
apps/app/tests/unit/state.coreFailures.test.tsx store actions on a failing core > change nothing and answer { ok: false } kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/state.coreFailures.test.tsx store actions on a failing core > answer { ok: true } on the live core kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/state.coreFailures.test.tsx callers stop on a failed core call > the new-report page stays put when the core cannot load kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/state.coreFailures.test.tsx callers stop on a failed core call > the new-report page stays put when the creation fails kept vitest (same case) - mocks rewritten at R4.3 / R4.6
apps/app/tests/unit/state.coreFailures.test.tsx callers stop on a failed core call > the home page shows the import error when the core cannot load kept vitest (same case) - mocks rewritten at R4.3 / R4.6
packages/core-wasm/tests/n-1.scanner.test.ts the frozen scanner reads the archives of earlier builds > report-v2.full.pdf carries report-v2.full.json kept vitest (same case) O11 -
packages/core-wasm/tests/n-1.scanner.test.ts the frozen scanner reads the archives of earlier builds > report-v2.minimal.pdf carries report-v2.minimal.json kept vitest (same case) O11 -
packages/core-wasm/tests/n-1.scanner.test.ts the frozen scanner reads the archives of earlier builds > report-v3.bare.pdf carries report-v3.demo.json kept vitest (same case) O11 -
packages/core-wasm/tests/n-1.scanner.test.ts a stamped archive whose attachment was removed > stamp written as UTF-16BE hex (the export): attachment_stripped kept vitest (same case) O11 -
packages/core-wasm/tests/n-1.scanner.test.ts a stamped archive whose attachment was removed > stamp written as literal: attachment_stripped kept vitest (same case) O11 -
packages/core-wasm/tests/n-1.scanner.test.ts a stamped archive whose attachment was removed > the same file without the stamp: no_attachment kept vitest (same case) O11 -
packages/pdf/tests/goldens.test.ts golden inputs > the 2×1 PNG decodes as 2×1 and the 1×1 as 1×1 ported R4.4/R4.5 cargo (pending) O1/O2 -
packages/pdf/tests/goldens.test.ts golden inputs > the v2unresolved report carries the unresolved findings of the freeze ported R4.4/R4.5 cargo (pending) O1/O2 -
packages/pdf/tests/goldens.test.ts goldens of v2full > nologos > text, images and links per locale; same pagination across locales ported R4.4/R4.5 cargo (pending) O1/O2 -
packages/pdf/tests/goldens.test.ts goldens of v2full > logos > text, images and links per locale; same pagination across locales ported R4.4/R4.5 cargo (pending) O1/O2 -
packages/pdf/tests/goldens.test.ts goldens of v2full > highlighted views: same facts but titles and data attributes ported R4.4/R4.5 cargo (pending) O1/O2 -
packages/pdf/tests/goldens.test.ts goldens of demo > nologos > text, images and links per locale; same pagination across locales ported R4.4/R4.5 cargo (pending) O1/O2 -
packages/pdf/tests/goldens.test.ts goldens of demo > logos > text, images and links per locale; same pagination across locales ported R4.4/R4.5 cargo (pending) O1/O2 -
packages/pdf/tests/goldens.test.ts goldens of demo > highlighted views: same facts but titles and data attributes ported R4.4/R4.5 cargo (pending) O1/O2 -
packages/pdf/tests/goldens.test.ts goldens of v2unresolved > nologos > text, images and links per locale; same pagination across locales ported R4.4/R4.5 cargo (pending) O1/O2 -
packages/pdf/tests/goldens.test.ts goldens of v2unresolved > logos > text, images and links per locale; same pagination across locales ported R4.4/R4.5 cargo (pending) O1/O2 -
packages/pdf/tests/goldens.test.ts goldens of v2unresolved > highlighted views: same facts but titles and data attributes ported R4.4/R4.5 cargo (pending) O1/O2 -
packages/pdf/tests/inflate.test.ts inflateFlate > round-trips a payload spanning several slices ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > feeds the inflater in 16 KiB slices, each awaited ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > an output exactly at the limit passes, one byte more is null ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > empty input: null ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > truncated stream: null ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > trailing junk: null ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > corrupt body: null ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > not deflate at all: null ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/inflate.test.ts inflateFlate > a 64 MiB bomb past the default cap is cancelled in well under a second ported R4.2 cargo (pending) O7/O9 -
packages/pdf/tests/r3.highlight-oracles.test.ts R3 highlight oracles (TypeScript freeze) > matches the frozen highlighted trees deleted - R3 highlight generator; oracle files kept (R4.8)
packages/pdf/tests/r3.sanitiser-oracles.test.ts R3 sanitiser oracles (TypeScript freeze) > keeps every legitimate SVG untouched deleted - R3 sanitiser generator; oracle files kept (R4.8)
packages/pdf/tests/r3.sanitiser-oracles.test.ts R3 sanitiser oracles (TypeScript freeze) > matches the frozen verdicts deleted - R3 sanitiser generator; oracle files kept (R4.8)
packages/pdf/tests/r4.dates-oracles.test.ts R4 date oracles (TypeScript freeze) > matches the frozen formatDate outputs deleted - O5 generator; oracle files kept (R4.8)
packages/pdf/tests/r4.inflate-oracles.test.ts R4 inflate oracles O9 (TypeScript freeze, Node) > matches the frozen inputs and Node verdicts deleted - O9 generator; oracle files kept (R4.8)
packages/pdf/tests/r4.png-oracles.test.ts R4 PNG oracles (TypeScript freeze) > matches the frozen gate verdicts and decodes deleted - O6 generator; oracle files kept (R4.8)
packages/pdf/tests/r4.reader-oracles.test.ts R4 reader oracles O7 (TypeScript freeze) > matches the frozen inputs and reader outcomes deleted - O7 generator; oracle files kept (R4.8)
packages/pdf/tests/r4.text-oracles.test.ts R4 text oracles (TypeScript freeze) > matches the frozen AFM metrics and WinAnsi table deleted - O4 generator; oracle files kept (R4.8)
packages/pdf/tests/r4.text-oracles.test.ts R4 text oracles (TypeScript freeze) > matches the frozen text and number rules deleted - O4 generator; oracle files kept (R4.8)
packages/pdf/tests/raster.test.ts resvg rasterisation of the demo views > main (haloed) and head views: 1200 px wide, highlight present, sane coverage ported R4.4/R4.5 cargo (pending) O2/O4 -
packages/pdf/tests/raster.test.ts resvg rasterisation of the demo views > a rasterizer that throws: page without image, one view_raster_failed warning ported R4.4/R4.5 cargo (pending) O2/O4 -
packages/pdf/tests/read.test.ts T4 roundtrip > reads back the exported envelope whole ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T5 v2 archives and the bare v3 fixture > report-v2.full.pdf: migrated, re-exported, imported again equal ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T5 v2 archives and the bare v3 fixture > report-v2.minimal.pdf: migrated, re-exported, imported again equal ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T5 v2 archives and the bare v3 fixture > keeps the 29 unresolved findings of the 612-leaf report through export and import ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T5 v2 archives and the bare v3 fixture > reads report-v3.bare.pdf as a bare v3 with no archive ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T6 versions > envelope v2 wrapper: report kept, snapshot rejected as unsupported_envelope ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T6 versions > envelope v1 with a report v4: incompatible_version 4 ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts T6 versions > bare report version 7: incompatible_version 7 ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > a stamped PDF without attachment: attachment_stripped ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > a stamped PDF saved with object streams (pre-BLK-009 layout): the stamp is invisible, no_attachment ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > a foreign PDF: no_attachment ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > the Filespec named osteo-report.json wins over an earlier EmbeddedFile ported R4.2 cargo (pending) O7 -
packages/pdf/tests/read.test.ts attachment presence and selection > refuses an oversized file or one without a %PDF- header as invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/reexport.test.ts re-export from the envelope alone > reproduces text, images, views and the envelope minus exportedAt ported R4.4/R4.5 cargo (pending) O2 -
packages/pdf/tests/scan.test.ts findEmbeddedFiles on a fresh export (no object streams) > finds the one Flate stream, named through its visible Filespec ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts findEmbeddedFiles on a fresh export (no object streams) > the length is the declared /Length and the data ends on endstream ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts findEmbeddedFiles on a fresh export (no object streams) > the export keeps the Filespec, its name and the stamp in clear, no object stream ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts findEmbeddedFiles on a fresh export (no object streams) > readAttachmentBytes returns the inflated envelope bytes ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts compatibility: frozen fixtures written with object streams > report-v2.full.pdf → origin v2 ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts compatibility: frozen fixtures written with object streams > report-v2.minimal.pdf → origin v2 ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts compatibility: frozen fixtures written with object streams > report-v3.bare.pdf → origin bare_v3 ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts compatibility: frozen fixtures written with object streams > a stamped PDF with object streams hides its stamp: no_attachment (documented) ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts selection between several embedded files > a decoy EmbeddedFile first, the named Faunosteo one second: the name wins ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts selection between several embedded files > an unnamed decoy without a version is skipped for the versioned JSON after it ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts selection between several embedded files > a foreign PDF, with or without attachments: no_attachment ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > /Length as an indirect reference: read up to endstream ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > a wrong direct /Length that does not land on endstream: measured instead ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > CRLF after stream, /Type/EmbeddedFile unspaced, a leading /Params dict ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > a Filespec with a hex /F name and an /EF listing /UF too names its stream ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts crafted stream layouts > decodePdfString: literal with escapes, hex ASCII, hex UTF-16BE with BOM ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts the keyword stamp > hex (pdf-lib) and literal /Keywords strings are both read ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > empty: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > random bytes: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > the type alone: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > dict without stream: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > stream without endstream: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > only the /EmbeddedFiles name tree key: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > unterminated dictionary: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > hex /Keywords without a closing bracket: no candidate, no stamp, no_attachment or invalid_pdf ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts garbage never throws > caps the candidates at 32 ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts object-stream bomb (BLK-009) > 64 MiB ObjStm bomb beside the attachment: report in ms, bomb never inflated ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts object-stream bomb (BLK-009) > EmbeddedFile bomb past 16 MiB: inflation cancelled, no_attachment, no hang ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts object-stream bomb (BLK-009) > both bombs before an unnamed real attachment: bomb skipped, report read ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > 32 candidates without any endstream on a 20 MiB file: no candidate, well under a second ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > 32 nested EmbeddedFile dicts (descending offsets) without endstream on a 20 MiB file: no candidate, no finder reset ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > several indirect /Length streams in a row: each measured to its own endstream ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > a measured stream running past the cap window is not a candidate, the next one is ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > 32 raw candidates of 1 MiB of "[": no_attachment under a second, JSON.parse never called ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > bracket-depth pre-scan before JSON.parse (audit finding 3) > a 16 KB Flate candidate opening 8 million "[" deep: skipped unparsed, no_attachment fast ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > bracket-depth pre-scan before JSON.parse (audit finding 3) > 2000 "[" inside a string with escaped quotes and backslashes: not rejected, parsed once ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > bracket-depth pre-scan before JSON.parse (audit finding 3) > the real envelope passes the pre-scan and is parsed once ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > one 16 MiB budget shared by every candidate > one 10 MiB garbage object before the attachment: 6 MiB left, the report is read ported R4.2 cargo (pending) O7 -
packages/pdf/tests/scan.test.ts candidate cost bounds (audit M2) > one 16 MiB budget shared by every candidate > two 10 MiB garbage objects before the attachment: budget exhausted, no_attachment ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > 5 assets → schema ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > a 3 MiB asset → caps ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > finding depth 9 → caps ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > 1,025 annotations → caps ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > a view chain cycle → integrity ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > a dangling svg_asset_id → integrity ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts import: the report survives a rejected snapshot > another sheet (sheet_mismatch) → sheet_mismatch ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts export: a snapshot over the caps fails with a typed error and no file > 1,025 annotations → snapshot_too_large ported R4.4/R4.5 cargo (pending) - typed export errors, no oracle file
packages/pdf/tests/security.test.ts export: a snapshot over the caps fails with a typed error and no file > a 3 MiB asset → snapshot_too_large ported R4.4/R4.5 cargo (pending) - typed export errors, no oracle file
packages/pdf/tests/security.test.ts export: a snapshot over the caps fails with a typed error and no file > 5 assets → snapshot_invalid ported R4.4/R4.5 cargo (pending) - typed export errors, no oracle file
packages/pdf/tests/security.test.ts export: a snapshot over the caps fails with a typed error and no file > a dangling svg_asset_id → snapshot_invalid ported R4.4/R4.5 cargo (pending) - typed export errors, no oracle file
packages/pdf/tests/security.test.ts export: a snapshot over the caps fails with a typed error and no file > another sheet → sheet_mismatch ported R4.4/R4.5 cargo (pending) - typed export errors, no oracle file
packages/pdf/tests/security.test.ts export: a snapshot over the caps fails with a typed error and no file > too many observations or views per observation → too_many_pages ported R4.4/R4.5 cargo (pending) - typed export errors, no oracle file
packages/pdf/tests/security.test.ts hostile SVG assets > <script>, on*, javascript: href, external <image>, <style> are gone from what is rasterised ported R4.4/R4.5 cargo (pending) - export SVG path; R4 refuses where the TS sanitised (A.3, RUST.md §9.4)
packages/pdf/tests/security.test.ts hostile SVG assets > the sanitiser names what it removed and clamps stdDeviation ported R4.4/R4.5 cargo (pending) - export SVG path; R4 refuses where the TS sanitised (A.3, RUST.md §9.4)
packages/pdf/tests/security.test.ts hostile SVG assets > CSS escapes, image-set and function calls in style or presentation attributes are removed ported R4.4/R4.5 cargo (pending) - export SVG path; R4 refuses where the TS sanitised (A.3, RUST.md §9.4)
packages/pdf/tests/security.test.ts hostile SVG assets > a non-finite or empty viewBox falls back to the 0.6 ratio, never NaN ported R4.4/R4.5 cargo (pending) - export SVG path; R4 refuses where the TS sanitised (A.3, RUST.md §9.4)
packages/pdf/tests/security.test.ts hostile SVG assets > <!ENTITY> and 257 <use> are refused: the export fails as snapshot_invalid ported R4.4/R4.5 cargo (pending) - export SVG path; R4 refuses where the TS sanitised (A.3, RUST.md §9.4)
packages/pdf/tests/security.test.ts hostile SVG assets > a huge root viewBox is clamped to a 1200×2400 raster ported R4.4/R4.5 cargo (pending) - export SVG path; R4 refuses where the TS sanitised (A.3, RUST.md §9.4)
packages/pdf/tests/security.test.ts hostile SVG assets > horse.svg and paws-in-harmony.svg pass with nothing removed and an identical serialisation ported R4.4/R4.5 cargo (pending) - export SVG path; R4 refuses where the TS sanitised (A.3, RUST.md §9.4)
packages/pdf/tests/security.test.ts __proto__ ids and the inflate bomb > report ids named __proto__ print raw and pollute nothing ported R4.4/R4.5 cargo (pending) O1 -
packages/pdf/tests/security.test.ts __proto__ ids and the inflate bomb > inflates a normal payload and returns null for a 24 MB bomb ported R4.2 cargo (pending) O7 -
packages/pdf/tests/security.test.ts branding URL injection (HIGH) > writes /URI as the hex of the ASCII bytes, no UTF-16 BOM, and reloads to the URL ported R4.4/R4.5 cargo (pending) O2 link sink
packages/pdf/tests/security.test.ts branding URL injection (HIGH) > a URL with a code point above 0x7e or below 0x21 throws branding_invalid at the sink ported R4.4/R4.5 cargo (pending) O2 link sink
packages/pdf/tests/security.test.ts branding URL injection (HIGH) > the link sink alone keeps the whole URL inside the /URI string ported R4.4/R4.5 cargo (pending) O2 link sink
packages/pdf/tests/security.test.ts branding URL injection (HIGH) > exportFromEnvelope refuses the URL before drawing anything: branding_invalid ported R4.4/R4.5 cargo (pending) O2 link sink
packages/pdf/tests/security.test.ts branding URL injection (HIGH) > a credit URL with a parenthesis and a broken label set are refused the same way ported R4.4/R4.5 cargo (pending) O2 link sink
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > 8193 × 1 → dimensions ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > 1 × 8193 → dimensions ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > 4097 × 4096 (over 4096²) → dimensions ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > 12000 × 12000 (144 Mpx) → dimensions ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > 0 × 0 → dimensions ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > 1 × 0 → dimensions ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > 8192 × 0 → dimensions ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > the raw-size budget: 16 MiB of scanlines at most, whatever the pixel count ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > depth 255 → ihdr ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > colour type 5 → ihdr ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > interlace 1 (Adam7) → ihdr ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > filter method 1 → ihdr ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > compression method 1 → ihdr ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > depth 4 for RGBA → ihdr ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > depth 16 for a palette → ihdr ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > every colour type and depth the spec allows passes with a matching IDAT ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > an IDAT stream that is truncated, empty, not zlib or off by one raw byte → idat ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > the IDAT stream may span several chunks ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > a wrong signature or a truncated header is refused; the real logos pass ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > the chunk walk refuses a second IHDR, an APNG acTL and a length past the buffer ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > a chunk UPNG reads with nextZero, or any type outside the allowlist, is refused ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > the list must end on an empty IEND that closes the buffer; ancillary chunks pass ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > an oversized header logo fails alone with logo_failed and never reaches embedPng ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > a doubled-IHDR header logo fails alone with logo_failed and never reaches embedPng ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > a tEXt-without-NUL header logo (UPNG would spin) fails alone with logo_failed and never reaches embedPng ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > a truncated-IDAT header logo (UPNG inflateRaw would read past the buffer) fails alone with logo_failed and never reaches embedPng ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > a 1 × 0 header logo fails alone with logo_failed and never reaches embedPng ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/security.test.ts PNG budget (MEDIUM) > the real logos reach embedPng when the gate passes them ported R4.4/R4.5 cargo (pending) O6 -
packages/pdf/tests/size.test.ts demo envelope size > nologos: stored attachment under 250,000 bytes ported R4.4/R4.5 cargo (pending) O2 E2 budget
packages/pdf/tests/size.test.ts demo envelope size > logos: stored attachment under 250,000 bytes ported R4.4/R4.5 cargo (pending) O2 E2 budget
packages/pdf/tests/text.test.ts safeText > keeps the WinAnsi glyphs the pages use ported R4.4/R4.5 cargo (pending) O4 -
packages/pdf/tests/text.test.ts safeText > replaces unencodable glyphs by ? and strips control characters ported R4.4/R4.5 cargo (pending) O4 -
packages/pdf/tests/text.test.ts safeText > wrapLines splits on any whitespace first, then makes each word safe ported R4.4/R4.5 cargo (pending) O4 -
packages/pdf/tests/text.test.ts export with hostile text > a report with ⚠ in a comment exports; the glyph prints as ? ported R4.4/R4.5 cargo (pending) O4 -
packages/pdf/tests/text.test.ts formatDate > formats an ISO date per locale and returns anything else unchanged ported R4.4/R4.5 cargo (pending) O5 -
Can't render this file because it contains an unexpected character in line 44 and column 158.
+418
View File
@@ -0,0 +1,418 @@
// R4 test ledger (plan 2026-10-17 §B.6): one row per TypeScript test case
// of the PDF path at the freeze, with its planned disposition. Runs vitest
// with its JSON reporter (report files in os.tmpdir()) on every packages/pdf
// suite, the application's PDF, route and store suites and its r4.*
// generators, and the core-wasm N-1 scanner test; writes
// crates/core/tests/pdf/LEDGER.tsv (files sorted, cases in declaration
// order) and prints the rows per file and disposition. Fails, writing
// nothing, when a run fails, a requested file is missing from its report, a
// case matches no rule, a rule matches no case, or the rows do not reconcile
// with vitest's totals. "(pending)" targets are filled when the case is
// ported.
// Usage: node scripts/r4-ledger.mjs (core module built: pnpm wasm:build)
import { spawnSync } from 'node:child_process'
import {
existsSync,
mkdirSync,
mkdtempSync,
readdirSync,
readFileSync,
rmdirSync,
unlinkSync,
writeFileSync,
} from 'node:fs'
import { tmpdir } from 'node:os'
import { dirname, join, relative, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
const ROOT = resolve(fileURLToPath(new URL('..', import.meta.url)))
const OUT = join(ROOT, 'crates/core/tests/pdf/LEDGER.tsv')
const COLUMNS = [
'ts_file',
'case_title',
'disposition',
'target',
'oracle',
'note',
]
const DISPOSITIONS = ['ported', 'replaced', 'kept', 'deleted']
const PDF = 'packages/pdf/tests/'
const APP = 'apps/app/tests/unit/'
const N1_SCANNER = 'packages/core-wasm/tests/n-1.scanner.test.ts'
const APP_PDF_SUITES = [
'pdf.goldens.test.ts',
'pdf.roundtrip.test.ts',
'pdf.import.test.ts',
'archive.envelopes.test.ts',
'n-1.reader.test.ts',
'pdf.export.app.test.ts',
'migration.leaves.test.ts',
'pdf.browserRasterizer.test.ts',
'scripts.compare.test.ts',
]
/** Suites mocking `@/pdf/*`: rewritten when the import (R4.3) and the
* export (R4.6) switch. */
const APP_MOCKING_SUITES = [
'routes.HomeRoute.archive.test.tsx',
'routes.HomeRoute.import.test.tsx',
'routes.HomeRoute.rescueCopy.test.tsx',
'routes.EditorRoute.export.test.tsx',
'routes.coreStopped.test.tsx',
'state.coreFailures.test.tsx',
]
const READER = 'R4.2 cargo (pending)'
const WRITER = 'R4.4/R4.5 cargo (pending)'
const CARGO_GOLDENS = 'R4.4/R4.5 cargo goldens (pending)'
const SAME = 'vitest (same case)'
const NONE = '-'
const GENERATOR = 'generator; oracle files kept (R4.8)'
const N1_SWITCH = 'reader switched to the frozen O11 scanner at R4.8'
const PDF_LIB_LEAVES =
'pdf-lib leaves the app; read-back moves to cargo/lopdf or the wasm reader'
const ported = (target, oracle, note = NONE) => ({
disposition: 'ported',
target,
oracle,
note,
})
const kept = (oracle, note = NONE) => ({
disposition: 'kept',
target: SAME,
oracle,
note,
})
const replaced = (target, oracle, note) => ({
disposition: 'replaced',
target,
oracle,
note,
})
const generator = ([file, oracle]) => ({
file,
disposition: 'deleted',
target: NONE,
oracle,
note: GENERATOR,
})
const SECURITY = `${PDF}security.test.ts`
const GOLDENS = `${APP}pdf.goldens.test.ts`
// First match wins. `title` (a prefix or a RegExp) splits a file's cases.
const RULES = [
// packages/pdf, reader side (R4.2)
{ file: `${PDF}scan.test.ts`, ...ported(READER, 'O7') },
{ file: `${PDF}inflate.test.ts`, ...ported(READER, 'O7/O9') },
{ file: `${PDF}read.test.ts`, ...ported(READER, 'O7') },
{
file: SECURITY,
title: 'import: the report survives a rejected snapshot > ',
...ported(READER, 'O7'),
},
{
file: SECURITY,
title: '__proto__ ids and the inflate bomb > inflates a normal payload',
...ported(READER, 'O7'),
},
// packages/pdf, export side (R4.4 layout, R4.5 serialiser)
{
file: SECURITY,
title: '__proto__ ids and the inflate bomb > report ids named __proto__',
...ported(WRITER, 'O1'),
},
{
file: SECURITY,
title: 'export: a snapshot over the caps fails',
...ported(WRITER, NONE, 'typed export errors, no oracle file'),
},
{
file: SECURITY,
title: 'hostile SVG assets > ',
...ported(
WRITER,
NONE,
'export SVG path; R4 refuses where the TS sanitised (A.3, RUST.md §9.4)',
),
},
{
file: SECURITY,
title: 'branding URL injection (HIGH) > ',
...ported(WRITER, 'O2', 'link sink'),
},
{ file: SECURITY, title: 'PNG budget (MEDIUM) > ', ...ported(WRITER, 'O6') },
{ file: `${PDF}goldens.test.ts`, ...ported(WRITER, 'O1/O2') },
{
file: `${PDF}text.test.ts`,
title: 'formatDate > ',
...ported(WRITER, 'O5'),
},
{ file: `${PDF}text.test.ts`, ...ported(WRITER, 'O4') },
{ file: `${PDF}size.test.ts`, ...ported(WRITER, 'O2', 'E2 budget') },
{ file: `${PDF}raster.test.ts`, ...ported(WRITER, 'O2/O4') },
{ file: `${PDF}reexport.test.ts`, ...ported(WRITER, 'O2') },
// Oracle generators, deleted with the TS they freeze; the oracle files stay
...[
[`${PDF}r3.highlight-oracles.test.ts`, 'R3 highlight'],
[`${PDF}r3.sanitiser-oracles.test.ts`, 'R3 sanitiser'],
[`${PDF}r4.dates-oracles.test.ts`, 'O5'],
[`${PDF}r4.inflate-oracles.test.ts`, 'O9'],
[`${PDF}r4.png-oracles.test.ts`, 'O6'],
[`${PDF}r4.reader-oracles.test.ts`, 'O7'],
[`${PDF}r4.text-oracles.test.ts`, 'O4'],
[`${APP}r4.compare-oracles.test.ts`, 'O10'],
[`${APP}r4.tolerance-oracles.test.ts`, 'O8'],
[`${APP}r4.writer-oracles.test.ts`, 'O1/O2/O3'],
].map(generator),
{
file: `${APP}r4.synthetic-reports.test.ts`,
...kept('O13', 'runs on the core only'),
},
// apps/app PDF suites
{
file: GOLDENS,
title: 'golden inputs > the 2×1 PNG decodes',
...replaced(
CARGO_GOLDENS,
'O6',
'pdf-lib embedPng check of the golden rasters',
),
},
{
file: GOLDENS,
title: 'golden inputs > ',
...kept(NONE, 'inputs of the kept views cases'),
},
{
file: GOLDENS,
title: /^goldens of [^>]+ > [^>]+ > text, images and links per locale/,
...replaced(CARGO_GOLDENS, 'O1', 'Step 6 text, images and links goldens'),
},
{
file: GOLDENS,
title: /^goldens of [^>]+ > highlighted views/,
...kept(NONE, 'app path'),
},
{
file: GOLDENS,
title: 'report-v3.bare.pdf > ',
...kept(NONE, 'bare v3 import'),
},
{
file: `${APP}pdf.import.test.ts`,
...replaced('R4.3/R4.5 (pending)', NONE, PDF_LIB_LEAVES),
},
{
file: `${APP}pdf.roundtrip.test.ts`,
...replaced('R4.3/R4.5 (pending)', NONE, PDF_LIB_LEAVES),
},
{ file: `${APP}archive.envelopes.test.ts`, ...kept(NONE, N1_SWITCH) },
{ file: `${APP}n-1.reader.test.ts`, ...kept(NONE, N1_SWITCH) },
{
file: `${APP}pdf.export.app.test.ts`,
...ported('R4.5 cargo from_envelope (pending)', NONE),
},
{ file: `${APP}migration.leaves.test.ts`, ...kept(NONE) },
{ file: `${APP}pdf.browserRasterizer.test.ts`, ...kept(NONE) },
{
file: `${APP}scripts.compare.test.ts`,
...ported('R4.7 cargo (pending)', 'O10'),
},
...APP_MOCKING_SUITES.map((name) => ({
file: `${APP}${name}`,
...kept(NONE, 'mocks rewritten at R4.3 / R4.6'),
})),
{ file: N1_SCANNER, ...kept('O11') },
]
function testFiles(dir, keep) {
return readdirSync(join(ROOT, dir))
.filter(keep)
.sort()
.map((name) => `${dir}${name}`)
}
function suites() {
const appGenerators = testFiles(APP, (n) => /^r4\..+\.test\.tsx?$/.test(n))
const appNamed = [...APP_PDF_SUITES, ...APP_MOCKING_SUITES].map(
(n) => `${APP}${n}`,
)
return [
{
pkg: 'packages/pdf',
files: testFiles(PDF, (n) => n.endsWith('.test.ts')),
},
{ pkg: 'apps/app', files: [...appNamed, ...appGenerators] },
{ pkg: 'packages/core-wasm', files: [N1_SCANNER] },
]
}
/** vitest's JSON report of `files`, run from the package as test:run. */
function runVitest({ pkg, files }, reportDir, errors) {
const report = join(reportDir, `${pkg.replaceAll('/', '_')}.json`)
const args = [
join(ROOT, pkg, 'node_modules/vitest/vitest.mjs'),
'run',
...files.map((file) => relative(pkg, file)),
'--reporter=json',
`--outputFile=${report}`,
]
const run = spawnSync(process.execPath, args, {
cwd: join(ROOT, pkg),
stdio: ['ignore', 'inherit', 'inherit'],
})
if (run.status !== 0)
errors.push(`${pkg}: vitest exited with ${run.status ?? run.signal}`)
if (!existsSync(report)) {
errors.push(`${pkg}: no JSON report`)
return null
}
const parsed = JSON.parse(readFileSync(report, 'utf8'))
unlinkSync(report)
return parsed
}
function matches(rule, file, title) {
if (rule.file !== file) return false
if (rule.title === undefined) return true
return rule.title instanceof RegExp
? rule.title.test(title)
: title.startsWith(rule.title)
}
function rowOf(file, assertion, used, errors) {
const title = [...assertion.ancestorTitles, assertion.title].join(' > ')
const at = RULES.findIndex((rule) => matches(rule, file, title))
if (at < 0) {
errors.push(`no disposition: ${file} > ${title}`)
return null
}
used.add(at)
const { disposition, target, oracle, note } = RULES[at]
const status =
assertion.status === 'passed'
? ''
: ` (status at freeze: ${assertion.status})`
return {
ts_file: file,
case_title: title,
disposition,
target,
oracle,
note: note + status,
}
}
/** The rows of one package's report, checked to hold the requested files. */
function suiteRows(suite, report, context) {
const { errors, used } = context
const results = report.testResults.map((result) => ({
...result,
file: relative(ROOT, result.name),
}))
const found = results.map((r) => r.file)
for (const file of suite.files)
if (!found.includes(file)) errors.push(`missing: ${file}`)
for (const file of found)
if (!suite.files.includes(file)) errors.push(`unrequested: ${file}`)
for (const r of results)
if (r.status !== 'passed') errors.push(`${r.file}: ${r.status}`)
const rows = results.flatMap((r) =>
r.assertionResults.map((a) => rowOf(r.file, a, used, errors)),
)
if (rows.length !== report.numTotalTests) {
const total = report.numTotalTests
errors.push(`${suite.pkg}: ${rows.length} rows, ${total} vitest cases`)
}
return rows.filter((row) => row !== null)
}
function collect() {
const context = { errors: [], used: new Set(), totals: [] }
const reportDir = mkdtempSync(join(tmpdir(), 'faunosteo-r4-ledger-'))
try {
const rows = suites().flatMap((suite) => {
const report = runVitest(suite, reportDir, context.errors)
if (!report) return []
context.totals.push([suite.pkg, report.numTotalTests])
return suiteRows(suite, report, context)
})
RULES.forEach((rule, at) => {
if (!context.used.has(at))
context.errors.push(
`rule matches no case: ${rule.file} ${rule.title ?? ''}`,
)
})
// Stable sort: files in path order, cases in declaration order.
rows.sort((a, b) =>
a.ts_file === b.ts_file ? 0 : a.ts_file < b.ts_file ? -1 : 1,
)
return { rows, ...context }
} finally {
rmdirSync(reportDir)
}
}
function tsvField(value) {
if (/[\t\r\n]/.test(value))
throw new Error(`tab or newline in ledger field: ${value}`)
return value
}
function writeLedger(rows) {
const lines = rows.map((row) =>
COLUMNS.map((c) => tsvField(row[c])).join('\t'),
)
mkdirSync(dirname(OUT), { recursive: true })
writeFileSync(OUT, [COLUMNS.join('\t'), ...lines].join('\n') + '\n')
}
function countLine(label, rows) {
const counts = DISPOSITIONS.map(
(d) => rows.filter((r) => r.disposition === d).length,
)
return [
label.padEnd(58),
String(rows.length).padStart(5),
...counts.map((n) => String(n).padStart(9)),
].join('')
}
function printSummary(rows, totals) {
console.log(
[
'file'.padEnd(58),
'rows'.padStart(5),
...DISPOSITIONS.map((d) => d.padStart(9)),
].join(''),
)
for (const file of [...new Set(rows.map((r) => r.ts_file))]) {
console.log(
countLine(
file,
rows.filter((r) => r.ts_file === file),
),
)
}
console.log(countLine('total', rows))
const vitest = totals.map(([pkg, n]) => `${pkg} ${n}`).join(', ')
const sum = totals.reduce((n, [, count]) => n + count, 0)
console.log(`vitest cases: ${vitest} = ${sum}; ledger rows: ${rows.length}`)
console.log(`written: ${relative(ROOT, OUT)}`)
}
function main() {
const { rows, errors, totals } = collect()
if (errors.length) {
for (const error of errors) console.error(`r4-ledger: ${error}`)
console.error('r4-ledger: nothing written')
return 1
}
writeLedger(rows)
printSummary(rows, totals)
return 0
}
process.exitCode = main()