mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-07 23:19:14 +00:00
fix: close CODE-REVIEW-33-r1 M1-M3
M1: the AC7 no-import test scans the whole src tree for the CURRENT dump name (the old assertion checked the pre-rename string; proven by execution — a planted fetch now turns it red). M2: deduplicate the #33 paragraphs in both changelogs and ARCHITECTURE. M3: the auditor's exit-3 statuses match the spec contract exactly (migrate-*/deprecated-read); decision-required is live behaviour awaiting #44, drop-on-validation is the backend's own job. User-Visible: no Issue: #33
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { readFileSync, readdirSync } from 'node:fs';
|
||||
import { SCHEMA_COMPAT_ALLOWLIST } from '../scripts/schema-compat-allowlist.mjs';
|
||||
import { CONFIG_FIELD_REGISTRY } from '../scripts/config-field-registry.mjs';
|
||||
import {
|
||||
@@ -90,10 +90,17 @@ test('#33 AC4: every registry entry resolves to a manifest path or an explicit p
|
||||
}
|
||||
});
|
||||
|
||||
/** #33 AC7: the manifest is a build/test artefact — the bundle must not grow. */
|
||||
test('#33 AC7: no production source imports the schema manifest', () => {
|
||||
const source = readFileSync(new URL('../src/houseplan-card.ts', import.meta.url), 'utf8')
|
||||
+ readFileSync(new URL('../src/houseplan-editor-runtime.ts', import.meta.url), 'utf8');
|
||||
assert.ok(!source.includes('config-schema-manifest'),
|
||||
'the manifest is test infrastructure, not runtime data');
|
||||
/** #33 AC7: the manifest is a build/test artefact — the bundle must not grow.
|
||||
* r1-M1: scan the WHOLE src tree and look for the CURRENT file name (the
|
||||
* original assertion kept checking the pre-rename string and could not fail). */
|
||||
test('#33 AC7: no production source references the schema dump', () => {
|
||||
const walk = (dir) => readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
|
||||
const target = new URL(entry.name + (entry.isDirectory() ? '/' : ''), dir);
|
||||
return entry.isDirectory() ? walk(target)
|
||||
: /\.(ts|js|mjs|json)$/.test(entry.name) ? [target] : [];
|
||||
});
|
||||
for (const file of walk(new URL('../src/', import.meta.url))) {
|
||||
assert.ok(!readFileSync(file, 'utf8').includes('config-schema.json'),
|
||||
`${file.pathname} references the schema dump — it is test infrastructure, not runtime data`);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user