test(handoff): bind PDF diagnostics and constrain entry proposal
This commit is contained in:
@@ -166,9 +166,10 @@ export function validatePackage(base = directory) {
|
||||
const after = JSON.parse(artifact(evidence.sourceAfterArtifactId).toString('utf8'));
|
||||
demand(JSON.stringify(source) === JSON.stringify(after), 'Source drifted during the regression run');
|
||||
const prefixes = ['JobTrackerApi/', 'JobTrackerApi.Tests/', 'JobTrackerApi.MariaDb.Tests/', 'job-tracker-ui/', 'scripts/', 'tools/summarizer/', 'docs/pre-phase10-ux/', 'docs/redesign/phase-9/'];
|
||||
const tracked = execFileSync('rtk', ['proxy', 'git', 'ls-files', '-z'], { cwd: root, encoding: 'utf8' }).split('\0').filter(name => prefixes.some(prefix => name.startsWith(prefix))).sort();
|
||||
const entryDiagnostic = name => name.startsWith('docs/p10-entry-final/') && /\.(?:py|cjs)$/.test(name);
|
||||
const tracked = execFileSync('rtk', ['proxy', 'git', 'ls-files', '-z'], { cwd: root, encoding: 'utf8' }).split('\0').filter(name => prefixes.some(prefix => name.startsWith(prefix)) || entryDiagnostic(name)).sort();
|
||||
demand(Object.keys(source).length <= 5000 && JSON.stringify(Object.keys(source).sort()) === JSON.stringify(tracked), 'Frozen source membership does not match the tracked qualification scope');
|
||||
execFileSync('rtk', ['proxy', 'git', 'diff', '--quiet', evidence.testedCommit, '--', ...prefixes], { cwd: root });
|
||||
execFileSync('rtk', ['proxy', 'git', 'diff', '--quiet', evidence.testedCommit, '--', ...prefixes, ...tracked.filter(entryDiagnostic)], { cwd: root });
|
||||
for (const [name, expected] of Object.entries(source)) {
|
||||
demand(!path.isAbsolute(name) && !name.split(/[\\/]/).includes('..'), 'Unsafe source path');
|
||||
const file = path.resolve(root, name);
|
||||
|
||||
Reference in New Issue
Block a user