feat(project-editor): add field-schema registry + test harness
Milestone 1 of the Configuration Engine sprint.
- Add schema/ registry: FieldSchema model, SECTION_FIELD_SCHEMAS covering
every editable field per section, and EditorSchemaService (getFields,
getField, all, getByPath). Single source of truth for labels, defaults,
and validator references; sections stay hand-authored (metadata-augmented).
- Stand up Karma + Jasmine (ng test) with a headless, sandbox-free Chrome
launcher; add tsconfig.spec.json, karma.conf.js, angular.json test target,
and npm "test" script. First spec: editor-schema.service.spec (7 passing).
No behavior change. Gate: arch:check, tsc --noEmit, npm test (7/7), build all green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 01:51:13 +04:00
|
|
|
// Karma configuration for `ng test` (@angular/build:karma builder).
|
|
|
|
|
// A headless, sandbox-free Chrome launcher so the suite runs in CI and in
|
|
|
|
|
// restricted/dev environments where Chrome isn't on PATH. CHROME_BIN falls
|
|
|
|
|
// back to the default Windows install path when the env var isn't set.
|
|
|
|
|
process.env.CHROME_BIN =
|
|
|
|
|
process.env.CHROME_BIN || 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe';
|
|
|
|
|
|
|
|
|
|
module.exports = function (config) {
|
|
|
|
|
config.set({
|
|
|
|
|
frameworks: ['jasmine'],
|
|
|
|
|
plugins: [
|
|
|
|
|
require('karma-jasmine'),
|
|
|
|
|
require('karma-chrome-launcher'),
|
|
|
|
|
require('karma-jasmine-html-reporter'),
|
2026-08-06 10:55:00 +04:00
|
|
|
require('karma-coverage'),
|
feat(project-editor): add field-schema registry + test harness
Milestone 1 of the Configuration Engine sprint.
- Add schema/ registry: FieldSchema model, SECTION_FIELD_SCHEMAS covering
every editable field per section, and EditorSchemaService (getFields,
getField, all, getByPath). Single source of truth for labels, defaults,
and validator references; sections stay hand-authored (metadata-augmented).
- Stand up Karma + Jasmine (ng test) with a headless, sandbox-free Chrome
launcher; add tsconfig.spec.json, karma.conf.js, angular.json test target,
and npm "test" script. First spec: editor-schema.service.spec (7 passing).
No behavior change. Gate: arch:check, tsc --noEmit, npm test (7/7), build all green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 01:51:13 +04:00
|
|
|
],
|
|
|
|
|
browsers: ['ChromeHeadlessNoSandbox'],
|
|
|
|
|
customLaunchers: {
|
|
|
|
|
ChromeHeadlessNoSandbox: {
|
|
|
|
|
base: 'ChromeHeadless',
|
|
|
|
|
flags: ['--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage'],
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-08-06 10:55:00 +04:00
|
|
|
reporters: ['progress', 'coverage'],
|
|
|
|
|
coverageReporter: {
|
|
|
|
|
dir: require('path').join(__dirname, 'coverage'),
|
|
|
|
|
subdir: '.',
|
|
|
|
|
reporters: [{ type: 'text-summary' }, { type: 'html' }, { type: 'lcovonly' }],
|
ci: coverage floor + gate; CI never ran a single test before this (F64)
Delivery plan Q9: "set a justified coverage floor and CI gate. Deliberately
unset today." Both parts of that were still true - karma.conf.js had no
check thresholds, and architecture-governance.yml built and checked
boundaries but never invoked `ng test` at all.
Floor set 5 points below the measured level right after this session's
facade-test pass (43.3%/29.0%/34.1%/43.7% statements/branches/functions/
lines): 40/25/30/40. A deliberate floor, not an aspiration - meant to be
ratcheted up as coverage grows, and to fail a PR that drops below it
rather than silently accept a lower number.
Verified the gate actually fails, not just logs a warning: set
statements to an impossible 99% locally, confirmed `npm run test:coverage`
exits 1 (my first attempt at this check was wrong - piping through `tail`
meant the $? I read back was tail's exit code, not npm's; fixed by
capturing it directly). Restored the real floor and confirmed a clean
exit 0 before committing.
CI changes: added the Setup Chrome + coverage-gated test step
karma.conf.js's CHROME_BIN needs (its fallback is a Windows path, useless
on ubuntu-latest), plus an E2E step. Structurally verified locally (no
tabs, step count, manual read-through) - a real GitHub Actions run on
Anthropic's infrastructure could not be executed from this session, so
this is not confirmed end-to-end the way the coverage gate itself was.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 22:03:29 +04:00
|
|
|
// Floor set 2026-08-18, ~5 points below the measured level right
|
|
|
|
|
// after this session's facade-test pass (43.3%/29.0%/34.1%/43.7%
|
|
|
|
|
// statements/branches/functions/lines) - a deliberate floor per the
|
|
|
|
|
// delivery plan's Q9 ("deliberately unset today"), not an aspiration.
|
|
|
|
|
// Ratchet this UP as coverage grows; a PR that drops below it should
|
|
|
|
|
// fail CI, not get merged with a lower number quietly re-baselined in.
|
|
|
|
|
check: {
|
|
|
|
|
global: {
|
|
|
|
|
statements: 40,
|
|
|
|
|
branches: 25,
|
|
|
|
|
functions: 30,
|
|
|
|
|
lines: 40,
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-08-06 10:55:00 +04:00
|
|
|
},
|
feat(project-editor): add field-schema registry + test harness
Milestone 1 of the Configuration Engine sprint.
- Add schema/ registry: FieldSchema model, SECTION_FIELD_SCHEMAS covering
every editable field per section, and EditorSchemaService (getFields,
getField, all, getByPath). Single source of truth for labels, defaults,
and validator references; sections stay hand-authored (metadata-augmented).
- Stand up Karma + Jasmine (ng test) with a headless, sandbox-free Chrome
launcher; add tsconfig.spec.json, karma.conf.js, angular.json test target,
and npm "test" script. First spec: editor-schema.service.spec (7 passing).
No behavior change. Gate: arch:check, tsc --noEmit, npm test (7/7), build all green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 01:51:13 +04:00
|
|
|
restartOnFileChange: true,
|
|
|
|
|
});
|
|
|
|
|
};
|