mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-30 12:25:19 +00:00
Validate 27 library, 25 CLI and 3 CI cases; full suite reports 4423 passed, zero failed. New-code coverage: 98.43% statements/lines, 90% branches, 100% functions. Lint and real packed offline consumer smoke pass. Preserve read-only state, source provenance, explicit target gaps and unobserved activation.
40 lines
1.4 KiB
JavaScript
40 lines
1.4 KiB
JavaScript
#!/usr/bin/env node
|
|
'use strict';
|
|
|
|
const { loadContextRegistry } = require('../lib/context-pack-registry');
|
|
const { compileContextProfile } = require('../lib/context-profiles');
|
|
|
|
function validate(repoRoot) {
|
|
const registry = loadContextRegistry({ repoRoot });
|
|
const profiles = ['lean@1', 'full@1'];
|
|
for (const profileId of profiles) {
|
|
for (const target of registry.targets) {
|
|
compileContextProfile({ repoRoot, profileId, target });
|
|
}
|
|
}
|
|
return {
|
|
status: 'success', skillCount: registry.entries.length,
|
|
profileCount: profiles.length, targetCount: registry.targets.length,
|
|
projectionCount: profiles.length * registry.targets.length,
|
|
registryDigest: registry.registryDigest, nativeCertification: 'unobserved',
|
|
};
|
|
}
|
|
|
|
function main(args = process.argv.slice(2)) {
|
|
try {
|
|
for (const arg of args) {
|
|
if (arg !== '--json') throw new Error(`Unknown argument: ${arg}`);
|
|
}
|
|
const result = validate();
|
|
console.log(args.includes('--json') ? JSON.stringify(result, null, 2)
|
|
: `Context profiles valid: ${result.skillCount} skills, ${result.projectionCount} profile/target projections. Native certification: unobserved.`);
|
|
return 0;
|
|
} catch (error) {
|
|
console.error(`Context profile validation failed: ${error.message}`);
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
if (require.main === module) process.exitCode = main();
|
|
module.exports = { main, validate };
|