crypto-inventory 0.3.0: Rust detector (use-resolved names, static calls, generics, ring constants, Noise patterns), Cargo.toml manifests, BLAKE3; 44/44, negative control 21/21

This commit is contained in:
Aere Network committed 2026-10-18 05:35:11 +03:00
1 parent 86779c8334
commit f2f6217b4c
16 files changed
+942 -21

No files matched your search

@@ -29,12 +29,15 @@ function ruleaza(pagina) {
const T = fs.mkdtempSync(path.join(os.tmpdir(), 'cons-web-ctl-'));
let rele = 0;
try {
const m0 = path.join(T, 'martor.html'); fs.copyFileSync(PAGINA, m0);
// (2026-10-16) capetele de rand se aduc la LF inainte de orice: copia de pe disc a unui checkout Windows (core.autocrlf) are CRLF,
// iar doua tipare cer '\n'; asa au iesit STRICAT ("apare de 0 ori") si poarta D-459 a stat NEMASURAT. Martorul e scris din ACEEASI
// forma ca plantarile, deci o plantare difera de martor numai prin defectul ei.
const src = fs.readFileSync(PAGINA, 'utf8').replace(/\r\n/g, '\n');
const m0 = path.join(T, 'martor.html'); fs.writeFileSync(m0, src);
const m = await ruleaza(m0);
if (m.nemasurat) { console.log('NEMASURAT: proba nu poate rula aici (fara browser)'); process.exit(2); }
if (m.rulat && m.cod === 0 && !m.rosii.length) console.log(' OK martorul: copia neatinsa verde');
else { rele++; console.log(` STRICAT martorul nu e verde (cod ${m.cod}, ${m.rosii.length} rosii)`); }
const src = fs.readFileSync(PAGINA, 'utf8');
const planteaza = async ([nume, din, inl, tinta], i) => {
if (src.split(din).length !== 2) return [false, ` STRICAT ${nume}: tiparul apare de ${src.split(din).length - 1} ori`];
const f = path.join(T, `p${i}.html`); fs.writeFileSync(f, src.replace(din, inl));