agents: the hosted witness for agent ledgers (sandbox on testnet 28001), its probe and negative control; crypto-inventory 0.4.1 resolves a minimum TLS version given through a constant or a ternary; proof-kinds and conformance gain the agent-witness-checkpoint kind; the reproduction scripts of the Shield recipes no longer carry a workstation path

This commit is contained in:
Aere Network committed 2026-10-20 01:04:12 +03:00
1 parent 0c8f1de3fd
commit a654c3d522
27 files changed
+4737 -43

No files matched your search

+21
View File
@@ -182,6 +182,27 @@ function rezolvaOData(ctx, nume) {
return null;
}
// 0.4.1 (2026-10-19, D-540): un TERNAR intre doua literale, `const X = <conditie> ? 'A' : 'B'`, cu aceleasi conditii ca rezolva()
// (exact o atribuire in fisier, pe randul declaratiei, numele nu e parametru). Intoarce ambele valori: cine il cheama alege ce conteaza
// (pentru o versiune TLS, ramura cea mai slaba). Numai JavaScript/TypeScript; orice alta forma: null.
export function rezolvaTernarJs(ctx, nume) {
if (ctx.limbaj !== 'javascript' || !identificator(nume)) return null;
const c = ctx.code;
const e = escapeRe(nume);
const atribuiri = ctx.potriviri(new RegExp(`(?<![\\w$.])${e}\\s*(?:[-+*/%|&^]|\\?\\?|\\|\\||&&)?(?::=|=)(?![=>])`, 'g'));
// garda proprie, cu alt text decat cea din rezolvaOData: controlul negativ le ancoreaza separat
if (atribuiri.length > 1 || !atribuiri.length) return null;
const k = atribuiri[0].index;
const ls0 = c.lastIndexOf('\n', k) + 1;
const le0 = c.indexOf('\n', k) < 0 ? c.length : c.indexOf('\n', k);
const linie = c.slice(ls0, le0);
const parametru = new RegExp(`(?:function\\b[^(]{0,200}\\(|\\()([^()]{0,2000}(?<![\\w$.])${e}(?![\\w$])[^()]{0,2000})\\)\\s*(?:=>|\\{)`).test(c)
|| new RegExp(`\\bfor\\s*\\(\\s*(?:const|let|var)?\\s*${e}\\s+(?:of|in)\\b`).test(c)
|| new RegExp(`(?<![\\w$.])${e}\\s*=>`).test(c);
const m = new RegExp(`\\b(?:const|let|var)\\s+${e}\\s*=\\s*[^?\\n;]{1,200}\\?\\s*(['"])([^'"\\n$\\\\]*)\\1\\s*:\\s*(['"])([^'"\\n$\\\\]*)\\3\\s*;?\\s*$`).exec(linie);
return !parametru && m ? { valori: [m[2], m[4]], line: ctx.poz(k).line } : null;
}
// valoarea unui argument: literal, variabila rezolvata sau necunoscuta
export function valoareArgument(ctx, arg) {
if (!arg) return { fel: 'lipsa' };
+27 -1
View File
@@ -1,5 +1,5 @@
// Detectorul JavaScript / TypeScript: node:crypto, WebCrypto, optiuni TLS, biblioteci din importuri.
import { argumente, imparteArgumente, valoareArgument, necunoscut, obiectulDin, cifruOpenssl, identificator, rezolva, escapeRe } from './context.mjs';
import { argumente, imparteArgumente, valoareArgument, necunoscut, obiectulDin, cifruOpenssl, identificator, rezolva, rezolvaTernarJs, escapeRe } from './context.mjs';
import { hashCanonic, grupTls, jws, JWS_RE } from './catalog.mjs';
const MODP = { modp1: 768, modp2: 1024, modp5: 1536, modp14: 2048, modp15: 3072, modp16: 4096, modp17: 6144, modp18: 8192 };
@@ -210,6 +210,32 @@ function detecteazaTlsJs(ctx) {
const rol = /min/i.test(m[1]) ? 'min' : 'max';
ctx.adauga(m.index, `tls ${m[1]}`, 'config', { grup: 'TLS', param: TLSV[m[3]], rol }, { bucata: m[0] });
}
// 0.4.1 (2026-10-19, D-540): versiunea data printr-o EXPRESIE, nu printr-un sir. Pana la 0.4.0 o constanta (`minVersion: v`) nu dadea
// nicio gasire TLS, nici macar una necunoscuta (gasit pe gateway-ul PQ al casei: `const minSus = ... ? 'TLSv1.3' : 'TLSv1.2'`). Acum, ca la
// ecdhCurve: o constanta se rezolva; un ternar intre doua literale de versiune da ramura cea mai SLABA (pentru o minima e podeaua care
// conteaza, pentru o maxima plafonul cel mai jos), spusa in resolvedFrom; orice alta expresie iese "unknown", nu tace. Un nume de tip
// TypeScript (`SecureVersion`, `string`) dupa doua puncte nu e o valoare.
for (const m of ctx.potriviri(/(?<![\w$])(minVersion|maxVersion|DEFAULT_MIN_VERSION|DEFAULT_MAX_VERSION)\s*(?::|=(?![=>]))\s*/g)) {
const baza = m.index + m[0].length;
const expr = expresiePanaLaVirgula(ctx, baza);
if (!expr || /^(['"])/.test(expr) || /^(?:tls\s*\.\s*)?SecureVersion\b|^string\b/.test(expr)) continue;
const rol = /min/i.test(m[1]) ? 'min' : 'max';
const v = valoareExpresie(ctx, expr);
if (v && TLSV[v.valoare]) {
ctx.adauga(m.index, `tls ${m[1]}`, 'config', { grup: 'TLS', param: TLSV[v.valoare], rol }, { bucata: `${m[1]}: ${v.valoare}`, rezolvatDin: v.din });
continue;
}
const id = identificator(expr);
const ter = id && !v ? rezolvaTernarJs(ctx, id) : null;
if (ter && ter.valori.every((x) => TLSV[x])) {
const ORDINE = ['ssl3', '1.0', '1.1', '1.2', '1.3'];
const slaba = ter.valori.slice().sort((a, b) => ORDINE.indexOf(TLSV[a]) - ORDINE.indexOf(TLSV[b]))[0];
ctx.adauga(m.index, `tls ${m[1]}`, 'config', { grup: 'TLS', param: TLSV[slaba], rol },
{ bucata: `${m[1]}: ${slaba}`, rezolvatDin: `${id} (line ${ter.line}, a conditional: ${ter.valori.join(' or ')}; the weaker one)` });
continue;
}
ctx.adauga(m.index, `tls ${m[1]}`, 'config', necunoscut(expr, `tls ${m[1]}`), { bucata: m[0] + expr });
}
for (const m of ctx.potriviri(/(?<![\w$])secureProtocol\s*:\s*(['"])(\w+)\1/g)) {
const map = { SSLv2_method: 'ssl2', SSLv3_method: 'ssl3', TLSv1_method: '1.0', TLSv1_1_method: '1.1', TLSv1_2_method: '1.2', TLS_method: 'negotiated', SSLv23_method: 'negotiated' };
const v = map[m[2].replace(/_(client|server)_method$/, '_method')];
+1 -1
View File
@@ -13,7 +13,7 @@ import { detecteazaKotlin } from './detect-kotlin.mjs';
import { detecteazaPem } from './pem.mjs';
import { citesteManifest, NUME_MANIFEST } from './manifeste.mjs';
export const VERSIUNE = '0.4.0';
export const VERSIUNE = '0.4.1';
export const DOSARE_EXCLUSE_IMPLICIT = ['.git', '.hg', '.svn', 'node_modules', '__pycache__', '.venv', 'venv', '.tox', '.gradle', '.idea', '.mypy_cache', '.pytest_cache', '.claude'];
const LIMBAJ = {