mirror of
https://github.com/Matysh/houseplan-card
synced 2026-07-31 16:38:31 +00:00
R5-1: the backend signs each path independently and answers successfully with whatever it managed, skipping (and logging) the rest. The card read any successful call as 'the batch is done', cleared the backoff for every path in it, then wrote only the urls that came back — so a path the backend kept skipping was asked for again on every render, the exact amplification the backoff was added to stop. A path now counts as signed only when the answer carries a url for it; the others back off individually, keys that were not requested are ignored, and onUpdate fires only when a new signature landed. R5-2: docs/STATUS.md still described main as holding releases up to v1.40.1 and quoted test counts several releases old, while the version line beside them was kept current — a handoff reader got a wrong branch model and less coverage than exists. Branch roles are now accurate, and the counts are gone rather than corrected: scripts/inventory.mjs (npm run inventory) prints them from the tree, so there is nothing left to drift. Tests: three unit cases for empty/partial/foreign-key answers, verified to fail against a v1.45.3 checkout; a backend test pinning the partial-success contract by making async_sign_path raise for one path of two. Docs: CHANGELOG.md + CHANGELOG.ru.md + TESTING.md + STATUS.md.
25 lines
1.2 KiB
JavaScript
25 lines
1.2 KiB
JavaScript
// Current test inventory, printed on demand.
|
|
//
|
|
// docs/STATUS.md used to carry these numbers inline; they went stale within a
|
|
// couple of releases while the version line next to them was kept current,
|
|
// which is worse than no number at all — a maintainer reading the snapshot
|
|
// underestimates the coverage that exists (review R5-2). The counts live here
|
|
// now, one command away, and STATUS.md describes the layers instead.
|
|
import { readdirSync, readFileSync } from 'node:fs';
|
|
|
|
const count = (dir, match, re) =>
|
|
readdirSync(dir)
|
|
.filter((f) => match.test(f))
|
|
.reduce((n, f) => n + (readFileSync(`${dir}/${f}`, 'utf8').match(re) || []).length, 0);
|
|
|
|
const files = (dir, match) => readdirSync(dir).filter((f) => match.test(f)).length;
|
|
|
|
const rows = [
|
|
['frontend unit (node:test)', count('test', /\.test\.mjs$/, /^test\(/gm)],
|
|
['pure backend (pytest, no HA)', count('tests_backend', /^test_validation\.py$/, /^def test_/gm)],
|
|
['HA-harness backend (CI, py3.13)', count('tests_backend', /^test_ha_.*\.py$/, /^async def test_|^def test_/gm)],
|
|
['browser smokes (headless chromium)', files('demo', /^smoke_.*\.mjs$/)],
|
|
];
|
|
const w = Math.max(...rows.map(([n]) => n.length));
|
|
for (const [name, n] of rows) console.log(`${name.padEnd(w)} ${n}`);
|