@code-sentinel-cli/code-sentinel-cli 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/bin.js +1644 -166
  2. package/dist/index.js +1644 -166
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -225,7 +225,7 @@ function compareTaintFindings(a, b) {
225
225
  if (aIds !== bIds) return aIds < bIds ? -1 : 1;
226
226
  return 0;
227
227
  }
228
- var SEVERITY_ORDER, severityRank, meetsSeverity, LANGUAGES, languageFromExtension, languageFromPath, CORE_PACK, rulePackOf, compareFindings, editsOverlap, AI_GATE_POLICIES, isAiGatePolicy, AI_SKIP_GATE_POLICIES, isAiSkipGatePolicy, aiCoverageGates, findingGates, toRunIngestDto, AI_SKIP_REASONS, isRecallRiskSkip, isRetryableSkip, countRecallRiskSkips, LAYER_FLOW_MAP, sortEdges, createAstDependencyGraph, scenarioVerdictFromOutcome, summarizeClientCoverage, CLIENT_TEST_OUTCOMES, isClientTestOutcome, CLIENT_ORACLE_FAILURE_MARKER, isClientOracleFailure, clientScenarioVerdictFromOutcome, AUTH_FILL_KINDS, isAuthFillKind, STR, STR_LIST, MOCK_USER_RE, ANONYMOUS_RE, JWT_AUTHORITY, JWT_AUTHORITY_LIST, JWT_RE, WMU_ARG, WITH_MOCK_USER_RE, WITH_USER_DETAILS_RE, ALLOWED_IMPORT_RE, isRecord, isSafeLine, validateImports, validateAuthFill, MAX_STATE_WRITES, MAX_HASH_FIELDS, MAX_CLAIMS, MAX_CLAIM_ARRAY, MAX_EVIDENCE, MAX_KEY_LEN, MAX_VALUE_LEN, MAX_EVIDENCE_LEN, TRANSPORTS, ALGORITHMS, VALUE_SOURCES, NAME_RE, CLAIM_NAME_RE, SCHEME_RE, FORBIDDEN_KEY_RE, CONTROL_RE, isRecord2, isSafeText, isSafeKey, isSafeField, INVALID, normaliseKeyFromClaim, normaliseClaimValue, normaliseClaims, normaliseHashFields, normaliseStateWrite, normaliseEvidence, validateRuntimeAuthHypothesis, resolveStateWriteKeys, describeRuntimeAuthHypothesisProblem, CHECKLIST_VERDICTS, rollupChecklistDecisions, UNASSESSED_REASONS, ASSESSMENT_SCHEMA_VERSION, emptyByVerdict, summarize, toAssessmentDocument, rollupRuntime, combinedRuntimeStance, DEFAULT_PENTEST_POLICY, PENTEST_POLICY_PROVENANCE, resolvePentestPolicy, policyProvenanceNote, PENTEST_POLICY_CONSUMERS, PENTEST_POLICY_CONDITIONAL_CONSUMERS, flattenPolicy, readPath, policyOverriddenPaths, appliedPolicyThresholds, PROVENANCE_POLICIES, isProvenancePolicy, canonicalDastId, normalizeRouteTemplate, dastExecutionTargetId, dastScenarioId, dastScenarioVerdict, DAST_TARGET_COVERAGES, classifyDastCoverage, COVERAGE_FIELD, rollupDastCoverage, dastReportHash, dastScanPlanHash, dastTargetManifestHash, resolveDastProvenance, cmpStr, COVERAGE_BINDING_WINDOW_MS, parseInstant, hasExplicitOffset, resolveDastCoverageProvenance, TRUST_TIERS, isTrustTier, PRODUCER_AUTHORITIES, isProducerAuthority, assuranceForAuthority, AUTHORITY_BY_TIER, isAuthorityPermitted, ORACLE_CATALOG, verdictContextFor, isProvenanceSound, deriveVerdict, VALIDATION_REJECT_CLASSES, DAST_NEGATIVE_ORACLE_CATALOG, dastNegativeOracleSpecFor, evaluateDastNegativeOracle, sastCorroborationState, rollupE1Provenance, canonicalE1Id, cmpStr2, e1SuiteHash, parseIso, hasExplicitOffset2, AMBIGUOUS_TIMESTAMP_TOLERANCE_MS, STATUS_RANK, resolveCurrentRunId, classify, resolveE1Provenance, TRUST_RANK, canonicalHarnessPlan, validateHarnessPlan, RUNTIME_OUTCOME_SCHEMA_VERSION, RUNTIME_TIERS, isRuntimeTier, RUNTIME_STOP_REASONS, isRuntimeStopReason, tierForStopReason, REQUIRED_DELIVERABLES, reachedTier, classifyRuntimeOutcome, classifyPreflight, BOOT_CAUSE_SOURCES, isBootCauseSource, validateRuntimeOutcome, computeRuleSetHash, buildRuleResults, reviewProject;
228
+ var SEVERITY_ORDER, severityRank, meetsSeverity, LANGUAGES, languageFromExtension, languageFromPath, CORE_PACK, rulePackOf, compareFindings, editsOverlap, AI_GATE_POLICIES, isAiGatePolicy, AI_SKIP_GATE_POLICIES, isAiSkipGatePolicy, aiCoverageGates, findingGates, toRunIngestDto, AI_SKIP_REASONS, isRecallRiskSkip, isRetryableSkip, countRecallRiskSkips, LAYER_FLOW_MAP, sortEdges, createAstDependencyGraph, scenarioVerdictFromOutcome, summarizeClientCoverage, CLIENT_TEST_OUTCOMES, isClientTestOutcome, CLIENT_ORACLE_FAILURE_MARKER, isClientOracleFailure, clientScenarioVerdictFromOutcome, AUTH_FILL_KINDS, isAuthFillKind, STR, STR_LIST, MOCK_USER_RE, ANONYMOUS_RE, JWT_AUTHORITY, JWT_AUTHORITY_LIST, JWT_RE, WMU_ARG, WITH_MOCK_USER_RE, WITH_USER_DETAILS_RE, ALLOWED_IMPORT_RE, isRecord, isSafeLine, validateImports, validateAuthFill, MAX_STATE_WRITES, MAX_HASH_FIELDS, MAX_CLAIMS, MAX_CLAIM_ARRAY, MAX_EVIDENCE, MAX_KEY_LEN, MAX_VALUE_LEN, MAX_EVIDENCE_LEN, TRANSPORTS, ALGORITHMS, VALUE_SOURCES, NAME_RE, CLAIM_NAME_RE, SCHEME_RE, FORBIDDEN_KEY_RE, CONTROL_RE, isRecord2, isSafeText, isSafeKey, isSafeField, INVALID, normaliseKeyFromClaim, normaliseClaimValue, normaliseClaims, normaliseHashFields, normaliseStateWrite, normaliseEvidence, validateRuntimeAuthHypothesis, resolveStateWriteKeys, describeRuntimeAuthHypothesisProblem, MAX_TARGETS, MAX_ROWS, MAX_COLUMNS, MAX_EVIDENCE2, MAX_STRING_VALUE, MAX_EVIDENCE_LEN2, SQL_IDENTIFIER_RE, isSqlIdentifier, PATH_RE, METHOD_RE, CONTROL_RE2, isRecord3, isSafeText2, normaliseValue, normaliseRow, normaliseEvidence2, normaliseTarget, validateRuntimeDataSeedHypothesis, describeRuntimeDataSeedHypothesisProblem, runtimeDataSeedDeviationBanner, CHECKLIST_VERDICTS, rollupChecklistDecisions, UNASSESSED_REASONS, ASSESSMENT_SCHEMA_VERSION, emptyByVerdict, summarize, toAssessmentDocument, rollupRuntime, combinedRuntimeStance, DEFAULT_PENTEST_POLICY, PENTEST_POLICY_PROVENANCE, resolvePentestPolicy, policyProvenanceNote, PENTEST_POLICY_CONSUMERS, PENTEST_POLICY_CONDITIONAL_CONSUMERS, flattenPolicy, readPath, policyOverriddenPaths, appliedPolicyThresholds, PROVENANCE_POLICIES, isProvenancePolicy, canonicalDastId, normalizeRouteTemplate, dastExecutionTargetId, dastScenarioId, dastScenarioVerdict, DAST_TARGET_COVERAGES, classifyDastCoverage, COVERAGE_FIELD, rollupDastCoverage, dastReportHash, dastScanPlanHash, dastTargetManifestHash, resolveDastProvenance, cmpStr, COVERAGE_BINDING_WINDOW_MS, parseInstant, hasExplicitOffset, resolveDastCoverageProvenance, TRUST_TIERS, isTrustTier, PRODUCER_AUTHORITIES, isProducerAuthority, assuranceForAuthority, AUTHORITY_BY_TIER, isAuthorityPermitted, ORACLE_CATALOG, verdictContextFor, isProvenanceSound, deriveVerdict, VALIDATION_REJECT_CLASSES, DAST_NEGATIVE_ORACLE_CATALOG, dastNegativeOracleSpecFor, evaluateDastNegativeOracle, sastCorroborationState, rollupE1Provenance, canonicalE1Id, cmpStr2, e1SuiteHash, parseIso, hasExplicitOffset2, AMBIGUOUS_TIMESTAMP_TOLERANCE_MS, STATUS_RANK, resolveCurrentRunId, classify, resolveE1Provenance, TRUST_RANK, canonicalHarnessPlan, validateHarnessPlan, RUNTIME_OUTCOME_SCHEMA_VERSION, RUNTIME_TIERS, isRuntimeTier, RUNTIME_STOP_REASONS, isRuntimeStopReason, tierForStopReason, REQUIRED_DELIVERABLES, reachedTier, classifyRuntimeOutcome, classifyPreflight, BOOT_CAUSE_SOURCES, isBootCauseSource, validateRuntimeOutcome, computeRuleSetHash, buildRuleResults, reviewProject;
229
229
  var init_dist2 = __esm({
230
230
  "../core/dist/index.js"() {
231
231
  init_dist();
@@ -815,6 +815,134 @@ var init_dist2 = __esm({
815
815
  }
816
816
  return "the answer did not match the schema; re-check every field against the rules above.";
817
817
  };
818
+ MAX_TARGETS = 32;
819
+ MAX_ROWS = 64;
820
+ MAX_COLUMNS = 32;
821
+ MAX_EVIDENCE2 = 20;
822
+ MAX_STRING_VALUE = 4096;
823
+ MAX_EVIDENCE_LEN2 = 300;
824
+ SQL_IDENTIFIER_RE = /^[A-Za-z_][A-Za-z0-9_]{0,63}$/;
825
+ isSqlIdentifier = (v) => typeof v === "string" && SQL_IDENTIFIER_RE.test(v);
826
+ PATH_RE = /^\/[\x21-\x7e]{0,511}$/;
827
+ METHOD_RE = /^[A-Za-z]{1,10}$/;
828
+ CONTROL_RE2 = /[\u0000-\u001f\u007f]/;
829
+ isRecord3 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
830
+ isSafeText2 = (v, max) => typeof v === "string" && v.length > 0 && v.length <= max && !CONTROL_RE2.test(v);
831
+ normaliseValue = (v) => {
832
+ if (v === null) return null;
833
+ if (typeof v === "boolean") return v;
834
+ if (typeof v === "number") return Number.isFinite(v) ? v : void 0;
835
+ if (typeof v === "string") return isSafeText2(v, MAX_STRING_VALUE) ? v : void 0;
836
+ return void 0;
837
+ };
838
+ normaliseRow = (raw) => {
839
+ if (!isRecord3(raw)) return null;
840
+ const entries = Object.entries(raw.columns ?? raw);
841
+ if (entries.length === 0 || entries.length > MAX_COLUMNS) return null;
842
+ const columns = {};
843
+ for (const [k, v] of entries) {
844
+ if (!isSqlIdentifier(k)) return null;
845
+ const value = normaliseValue(v);
846
+ if (value === void 0) return null;
847
+ columns[k] = value;
848
+ }
849
+ return { columns };
850
+ };
851
+ normaliseEvidence2 = (raw) => {
852
+ if (!Array.isArray(raw)) return null;
853
+ if (raw.length === 0 || raw.length > MAX_EVIDENCE2) return null;
854
+ const out = [];
855
+ for (const item15 of raw) {
856
+ if (!isSafeText2(item15, MAX_EVIDENCE_LEN2)) return null;
857
+ out.push(item15);
858
+ }
859
+ return out;
860
+ };
861
+ normaliseTarget = (raw) => {
862
+ if (!isRecord3(raw)) return null;
863
+ if (typeof raw.httpMethod !== "string" || !METHOD_RE.test(raw.httpMethod)) return null;
864
+ const httpMethod = raw.httpMethod.toUpperCase();
865
+ if (typeof raw.path !== "string" || !PATH_RE.test(raw.path)) return null;
866
+ if (!isSqlIdentifier(raw.table)) return null;
867
+ if (!Array.isArray(raw.rows) || raw.rows.length === 0 || raw.rows.length > MAX_ROWS) return null;
868
+ const rows = [];
869
+ for (const item15 of raw.rows) {
870
+ const row2 = normaliseRow(item15);
871
+ if (row2 === null) return null;
872
+ rows.push(row2);
873
+ }
874
+ return { httpMethod, path: raw.path, table: raw.table, rows };
875
+ };
876
+ validateRuntimeDataSeedHypothesis = (raw) => {
877
+ if (!isRecord3(raw)) return null;
878
+ if (raw.scheme !== "sql-insert") return null;
879
+ if (!Array.isArray(raw.targets)) return null;
880
+ if (raw.targets.length > MAX_TARGETS) return null;
881
+ const targets = [];
882
+ const seen = /* @__PURE__ */ new Set();
883
+ for (const item15 of raw.targets) {
884
+ const t = normaliseTarget(item15);
885
+ if (t === null) return null;
886
+ const id = `${t.httpMethod}\0${t.path}\0${t.table}`;
887
+ if (seen.has(id)) return null;
888
+ seen.add(id);
889
+ targets.push(t);
890
+ }
891
+ const evidence17 = normaliseEvidence2(raw.evidence);
892
+ if (evidence17 === null) return null;
893
+ return { scheme: "sql-insert", targets, evidence: evidence17 };
894
+ };
895
+ describeRuntimeDataSeedHypothesisProblem = (raw) => {
896
+ if (validateRuntimeDataSeedHypothesis(raw) !== null) return null;
897
+ if (raw === null || raw === void 0) return "the answer was null.";
898
+ if (!isRecord3(raw)) return `the answer was not a JSON object (it was ${typeof raw}).`;
899
+ const r = raw;
900
+ if (r.scheme !== "sql-insert") {
901
+ return `"scheme" must be exactly "sql-insert" (got ${JSON.stringify(r.scheme)}).`;
902
+ }
903
+ if (!Array.isArray(r.targets)) {
904
+ return '"targets" must be an array (use [] when no endpoint needs pre-existing state).';
905
+ }
906
+ for (const t of r.targets) {
907
+ if (!isRecord3(t)) continue;
908
+ if (typeof t.table === "string" && !isSqlIdentifier(t.table)) {
909
+ return `"table" must be a bare SQL identifier [A-Za-z_][A-Za-z0-9_]* \u2014 got ${JSON.stringify(t.table)} (schema-qualified names are not accepted).`;
910
+ }
911
+ if (typeof t.path === "string" && !PATH_RE.test(t.path)) {
912
+ return `"path" must be an endpoint path starting with "/" with no whitespace or control characters \u2014 got ${JSON.stringify(t.path)}.`;
913
+ }
914
+ if (Array.isArray(t.rows) && t.rows.length === 0) {
915
+ return `the target for "${t.httpMethod} ${t.path}" has zero rows \u2014 a seed target exists to insert rows; use an empty "targets" array if nothing needs seeding.`;
916
+ }
917
+ if (Array.isArray(t.rows)) {
918
+ for (const row2 of t.rows) {
919
+ if (isRecord3(row2) && isRecord3(row2.columns)) {
920
+ for (const [k, v] of Object.entries(row2.columns)) {
921
+ if (!isSqlIdentifier(k)) {
922
+ return `column name ${JSON.stringify(k)} is not a bare SQL identifier.`;
923
+ }
924
+ if (typeof v === "string" && new RegExp("\\p{Cc}", "u").test(v)) {
925
+ return `the value of column "${k}" contains control characters \u2014 values are data bound as quoted literals; remove the control bytes.`;
926
+ }
927
+ if (typeof v !== "string" && typeof v !== "number" && typeof v !== "boolean" && v !== null) {
928
+ return `the value of column "${k}" must be string/number/boolean/null \u2014 nested objects and arrays are not values this contract can bind.`;
929
+ }
930
+ }
931
+ }
932
+ }
933
+ }
934
+ }
935
+ if (!Array.isArray(r.evidence) || r.evidence.length === 0) {
936
+ return '"evidence" is required and must be a non-empty array of file/class names the answer was read from.';
937
+ }
938
+ return "the answer did not match the schema; re-check every field against the rules above.";
939
+ };
940
+ runtimeDataSeedDeviationBanner = (h) => {
941
+ const tables = [...new Set(h.targets.map((t) => t.table))].sort();
942
+ const rows = h.targets.reduce((n, t) => n + t.rows.length, 0);
943
+ const evidence17 = h.evidence.join("; ");
944
+ return `D\u1EEF li\u1EC7u seed do runner t\u1EF1 gieo (sql-insert, ${rows} d\xF2ng v\xE0o ${tables.length} b\u1EA3ng: ${tables.join(", ")}). Finding li\xEAn quan d\u1EEF li\u1EC7u ch\u1EC9 ph\u1EA3n \xE1nh sandbox, KH\xD4NG ph\u1EA3i production. Gi\u1EA3 thuy\u1EBFt \u0111\u1ECDc t\u1EEB: ${evidence17}.`;
945
+ };
818
946
  CHECKLIST_VERDICTS = [
819
947
  "CONFIRMED-VULN",
820
948
  "CONTROL-ABSENT",
@@ -1013,9 +1141,9 @@ var init_dist2 = __esm({
1013
1141
  ];
1014
1142
  readPath = (override, path) => {
1015
1143
  if (override === void 0) return void 0;
1016
- const [group, field2] = path.split(".");
1017
- if (group === void 0 || field2 === void 0) return void 0;
1018
- const bag = override[group];
1144
+ const [group2, field2] = path.split(".");
1145
+ if (group2 === void 0 || field2 === void 0) return void 0;
1146
+ const bag = override[group2];
1019
1147
  return bag?.[field2];
1020
1148
  };
1021
1149
  policyOverriddenPaths = (override) => {
@@ -1579,6 +1707,7 @@ var init_dist2 = __esm({
1579
1707
  "boot-blocked",
1580
1708
  "nothing-to-verify",
1581
1709
  "auth-gate",
1710
+ "baseline-unreachable",
1582
1711
  "complete",
1583
1712
  "runner-fault"
1584
1713
  ];
@@ -1595,6 +1724,7 @@ var init_dist2 = __esm({
1595
1724
  return "T2";
1596
1725
  case "nothing-to-verify":
1597
1726
  case "auth-gate":
1727
+ case "baseline-unreachable":
1598
1728
  return "T3";
1599
1729
  case "complete":
1600
1730
  return "T4";
@@ -1639,9 +1769,22 @@ var init_dist2 = __esm({
1639
1769
  if (!s.appServedHttp) return { tier: "T2", stopReason: "boot-blocked" };
1640
1770
  if (s.scenariosGenerated === 0) return { tier: "T3", stopReason: "nothing-to-verify" };
1641
1771
  if (s.scenariosConcluded === 0) {
1772
+ if (s.appDiedAbnormally === true) return { tier: "T3", stopReason: "runner-fault" };
1642
1773
  const baseline = s.authBaselineStatus;
1643
- if (baseline !== void 0 && baseline >= 400) return { tier: "T3", stopReason: "auth-gate" };
1644
- if (s.oracleRefusedOnBaseline === true) return { tier: "T3", stopReason: "auth-gate" };
1774
+ const e2Scanned = s.e2ScannedCount;
1775
+ const e2Gated = s.e2AuthGatedCount;
1776
+ const e2SawRealSurfaceUngated = e2Scanned !== void 0 && e2Gated !== void 0 && e2Scanned > 0 && e2Gated === 0;
1777
+ if (baseline !== void 0 && baseline >= 400) {
1778
+ if (baseline === 401 || baseline === 403) {
1779
+ return e2SawRealSurfaceUngated ? { tier: "T3", stopReason: "baseline-unreachable" } : { tier: "T3", stopReason: "auth-gate" };
1780
+ }
1781
+ return { tier: "T3", stopReason: "baseline-unreachable" };
1782
+ }
1783
+ if (s.oracleRefusedOnBaseline === true) {
1784
+ if (e2Gated !== void 0 && e2Gated > 0) return { tier: "T3", stopReason: "auth-gate" };
1785
+ if (e2SawRealSurfaceUngated) return { tier: "T3", stopReason: "baseline-unreachable" };
1786
+ return { tier: "T3", stopReason: "auth-gate" };
1787
+ }
1645
1788
  return { tier: "T3", stopReason: "runner-fault" };
1646
1789
  }
1647
1790
  return { tier: "T4", stopReason: "complete" };
@@ -1942,9 +2085,9 @@ function report(error, callback$1, output2, suppressErrors) {
1942
2085
  else callback$1(null, output2);
1943
2086
  }
1944
2087
  function build$1(options, isSynchronous) {
1945
- const { onlyCounts, group, maxFiles } = options;
2088
+ const { onlyCounts, group: group2, maxFiles } = options;
1946
2089
  if (onlyCounts) return isSynchronous ? onlyCountsSync : onlyCountsAsync;
1947
- else if (group) return isSynchronous ? groupsSync : groupsAsync;
2090
+ else if (group2) return isSynchronous ? groupsSync : groupsAsync;
1948
2091
  else if (maxFiles) return isSynchronous ? limitFilesSync : limitFilesAsync;
1949
2092
  else return isSynchronous ? defaultSync : defaultAsync;
1950
2093
  }
@@ -6996,7 +7139,7 @@ function parseParams(url) {
6996
7139
  function normalizeUrl(url) {
6997
7140
  return url.replace(/^\/+/, "");
6998
7141
  }
6999
- var createCompositeParser, SUPPORTED, createTextParser, requireFromHere, grammarCache, parserInitialized, initParser, resolveGrammarPath, loadGrammar, LANGUAGE_TO_GRAMMAR, SUPPORTED2, createTreeSitterParser, asTreeSitterTree, SUPPORTED3, scriptKindFor, createTsMorphParser, createParser, TS_LANGUAGES, EXTENSIONS, TS_SOURCE_EXTENSIONS_BY_RUNTIME_EXT, scriptKindFor2, normalizeRelativePath, candidatePaths, normalizeConfigPath, stripJsonComments, loadTsConfigResolver, matchPathPattern, applyPathTarget, resolveAliasModule, resolveModule, aliasIfDifferent, exportedSymbols, expressionRootName, addSymbol, compareText, variableBindingNames, importEqualsSpecifier, extractSymbols, fingerprintFor, createTsAstDependencyGraphBuilder, isTsLike, debug, warn, tryLoad, trySave, createIncrementalAstGraphBuilder, SOURCES, SINKS, SANITIZERS, DEFAULT_TS_TAINT_TABLES, JAVA_SOURCES, JAVA_SINKS, JAVA_SANITIZERS, DEFAULT_JAVA_TAINT_TABLES, EMPTY_SUMMARY, paramSentinel, PARAM_SENTINEL_RE, MAX_CROSS_FILE_DEPTH, TYPE_DECL_NODES, indexCache, SCOPE_BOUNDARY, SCOPE_BOUNDARY2, TYPE_DECL, STRING_PASSTHROUGH, ARG_PASSTHROUGH, CONTAINER_ELEMENT, BUILDER_APPENDERS, COLLECTION_MUTATORS, RECEIVER_FOLD_MUTATORS, CONDITIONAL_CONSTRUCT, EMPTY_SUMMARY2, paramSentinel2, PARAM_SENTINEL_RE2, MAX_CROSS_METHOD_DEPTH, SANITIZE_CALL, BYPASS_CALL, PREFIX_GATE, MAX_VALUE_HOPS, SOURCE_PATTERNS, maskJavaComments, maskedCorpusCache, maskJavaFiles, MAPPING_ANNOTATIONS, PARAM_ANNOTATIONS, AUTHZ_ANNOTATIONS, VALIDATION_ANNOTATIONS, annotationScanner, TYPE_DECL2, MODIFIER, METHOD_NAME, LEADING_ANNOTATION, simpleName, lineOf, readBalanced, annotationArgs, firstStringLiteral, readMappingPath, readMappingMethod, joinPaths, skipToDeclaration, isTypeDeclaration, splitParams, parseParam, readAuthAnnotations, ROLE_ANNOTATIONS, stripRolePrefix, readAuthRoles, precedingBlock, readClassContext, extractFromFile, extractHttpEndpoints, findEnclosingEndpoint, SINK_ATTACKS, SOURCE_KIND, kindsFromSources, deriveAuthContext, resolveInjectionPoint, buildServerRequest, buildClientRequest, generateAttackScenario, UNASSESSED_CATALOG, BY_ID, buildUnassessedItems, INJECTION_LANGUAGES, TIER_A_INJECTION_ITEMS, CONFIRMED_LIMITATION, INCONCLUSIVE_LIMITATION, evidenceFrom, byFileLine, CHECKLIST_VERDICT_RANK, mergeEqualRank, dedupeByChecklistId, scenarioByFileLine, PENTEST_CHECKLIST_TOTAL, DECLARED_CHECKLIST_IDS, buildChecklistCoverage, buildCoverage, assembleAssessment, IMPORT_LINE_RE, isImportOrPackageLine, CSRF_SPEC, CORS_SPEC, HEADERS_SPEC, STACKTRACE_SPEC, MESSAGE_SPEC, COOKIE_SPEC, SESSION_FIXATION_SPEC, SESSION_TIMEOUT_SPEC, AUTH_CACHE_SPEC, lineOf2, SECURITY_CONFIG_RE, CSRF_DISABLE_RE, CORS_WILDCARD_RE, CROSS_ORIGIN_BARE_RE, ALLOW_CREDENTIALS_RE, CORS_EXPLICIT_ORIGIN_RE, CORS_ANY_RE, HEADERS_DISABLE_RES, HEADERS_CONFIGURED_RE, CSP_CONFIGURED_RE, STACKTRACE_EXPOSE_RE, STACKTRACE_NEVER_RE, MESSAGE_EXPOSE_RE, MESSAGE_NEVER_RE, COOKIE_CONTEXT_RE, COOKIE_INSECURE_CHECKS, COOKIE_HARDENED_RE, SESSION_FIXATION_DISABLED_RE, CACHE_CONTROL_DISABLE_RE, CACHE_CONTROL_CONFIGURED_RE, SESSION_TIMEOUT_PATH_RE, SESSION_BLOCK_HEADER_RE, SESSION_TIMEOUT_LEAF_RE, YAML_INDENT_RE, control, configEvidence, firstMatch, firstMatchAny, scanCsrf, CORS_ORIGINS_YAML_RE, CORS_CREDENTIALS_YAML_RE, isWildcardOrigins, corsConfigRank, corsOriginHits, scanCors, scanSecurityHeaders, NON_PROD_PROFILE_RE, scanStacktraceExposure, scanErrorMessageExposure, scanCookieAttributes, scanSessionFixation, scanAuthCacheControl, findSessionTimeout, timeoutNeverExpires, timeoutToMinutes, JWT_VALIDITY_RE, NON_PROD_CONFIG_RE, findJwtValidities, hoursOf, judgeJwtValidity, judgeServletTimeout, scanSessionTimeout, scanSecurityConfig, TEST_SOURCE_SET_RE, isTestSourcePath, WEAK_CRYPTO_SPEC, MAX_EVIDENCE2, lineOf3, classifyAlgorithm, GET_INSTANCE_RE, COMMONS_DIGEST_RE, GUAVA_HASHING_RE, SECRET_KEY_SPEC_RE, SHORTHAND_ALGO, collectWeakHits, STRONG_CRYPTO_RE, STRONG_CRYPTO_RE_G, firstStrong, evidence, item, scanWeakCrypto, REGEX_PRECEDING_KEYWORDS, isIdentChar, regexAllowedAt, maskJsComments, maskedCorpusCache2, maskJsFiles, BROWSER_STORAGE_SPEC, MAX_EVIDENCE22, lineOf4, HIGH_SENSITIVITY_RE, TOKEN_FAMILY_RE, classifyStorageKey, VALUE_TOKEN_FAMILY_RE, classifyStorageValue, keyToken, SET_ITEM_RE, BRACKET_ASSIGN_RE, STORAGE_USE_RE, IDB_CONTEXT_RE, LOCALFORAGE_SET_RE, IDB_STORE_WRITE_RE, collectStorageHits, collectIndexedDbHits, finalizeHits, firstStorageUse, evidence2, item2, scanSensitiveBrowserStorage, AT_REST_SPEC, MAX_EVIDENCE3, lineOf5, PWD_GETTER, PWD_EQUALS_RECEIVER_RE, PWD_EQUALS_ARG_RE, collectPasswordComparisonHits, SENSITIVE_FIELD_NAMES, FIELD_DECL_RE, FIELD_PROTECTED_RE, precedingBlock2, collectPlaintextFieldHits, finalizeHits2, PROTECTION_RE, firstProtection, AT_REST_SURFACE_RE, evidence3, item3, scanSensitiveDataAtRest, PADDING_ORACLE_SPEC, MAX_EVIDENCE4, lineOf6, GET_INSTANCE_RE2, collectCbcHits, BAD_PADDING_CATCH_RE, collectBadPaddingHits, finalizeHits3, AEAD_RE, firstAead, CIPHER_SURFACE_RE, evidence4, item4, scanPaddingOracle, LOGGING_SPEC, MAX_EVIDENCE5, lineOf7, LOG_CALL_RE, LOG_SURFACE_RE, stripStringLiterals, SECRET_RE, PII_RE, PROTECTED_TAIL_RE, findSensitiveToken, collectLogHits, firstLogSurface, evidence5, item5, scanSensitiveLogging, CHECKLIST_ID, CONTROL_ID, TITLE, CWE, MAX_EVIDENCE6, ADMIN_PATH_RE, ADMIN_CONTROLLER_RE, isAdminEndpoint, ADMIN_ROLE_RE, ROLE_CAPABLE_AUTHZ, ROLE_ANNOTATION_RE, SEC_CONFIG_HINT_RE, MATCHER_RE, ACCESS_AFTER_RE, ANY_REQUEST_RE, offsetOfLine, readBalanced2, stringLiterals, antMatches, hasAdminRoleAnnotation, classHeaderOf, memberWindow, annotationStance, accessKind, collectFilterConfig, filterStanceFor, combineProtection, publicNote, item6, auditAdminSurface, CLOUD_ACL_SPEC, MAX_EVIDENCE7, lineOf8, PUBLIC_ACL_PATTERNS, finalizeHits4, collectCannedAclHits, EFFECT_ALLOW_RE, WILDCARD_PRINCIPAL_RE, S3_ACTION_RE, enclosingObject, collectBucketPolicyHits, evidence6, item7, scanCloudStorageAcl, ACTUATOR_SPEC, MAX_EVIDENCE8, CONFIG_FILE_RE, SENSITIVE_ACTUATOR_ENDPOINTS, lineOf9, indentOf, isBlankOrComment, splitEndpoints, classifyExposure, exposureNote, H2_NOTE, findChildKey, collectListItems, collectExposureHits, collectH2Hits, finalizeHits5, evidence7, item8, scanActuatorExposure, BACKUP_FILE_SPEC, BACKUP_FILE_GLOBS, BACKUP_FILE_RE, SENSITIVE_BASE_RE, MAX_EVIDENCE9, stripBackupSuffix, classify2, evidence8, scanBackupFiles, CROSSDOMAIN_SPEC, CROSSDOMAIN_GLOBS, MAX_EVIDENCE10, lineOf10, PERMISSIVE_PATTERNS, collectHits, evidence9, scanCrossDomainPolicy, CLIENT_INFO_SPEC, ANGULAR_CONFIG_GLOBS, MAX_EVIDENCE11, lineOf11, asRecord, sourceMapEnabled, buildConfigurations, scanConfigFile, evidence10, item9, scanClientInfoLeak, SENSITIVE_FILE_SPEC, SENSITIVE_FILE_GLOBS, SENSITIVE_FILE_RE, PEM_TEXT_RE, PRIVATE_KEY_HEADER_RE, MAX_EVIDENCE12, classify22, evidence11, scanSensitiveFiles, INSECURE_TRANSPORT_SPEC, ENVIRONMENT_FILE_RE, MAX_EVIDENCE13, lineOf12, extractStringLiterals, HTTP_URL_RE, HTTPS_PRESENCE_RE, isExcludedHost, scanInsecureTransport, WEBSOCKET_SPEC, MAX_EVIDENCE14, WS_URL_RE, WSS_PRESENCE_RE, scanWebSocketSecurity, authFillKey, createStubAuthFillResolver, buildAuthFillMap, ALG_TO_HASH, SIGNING_KEY_LINE, ENV_PLACEHOLDER, lineOf13, cleanValue, discoverJwtSigningKeys, b64url, b64urlStr, signingKeyBytes, mintJwt, DEFAULT_JHIPSTER_CLAIMS, RECIPE_NOTE, sha256Hex, buildRuntimeAuthRecipe, mintTokenFromRecipe, DEFAULT_TTL_SECONDS, commandsFor, credentialFor, buildRuntimeAuthSeedPlan, runtimeAuthSeedDeviation, DEFAULT_TIMEOUT_MS, CRLF, encodeResp, identify, readReply, applyRuntimeAuthSeed, describeShape, resolveRuntimeAuthHypothesis, THREW, createStubRuntimeAuthHypothesisResolver, REACHABILITY_MANIFEST_SCHEMA_VERSION, MANIFEST_NOTE, SCALAR_JAVA_TYPES, baseTypeName, seedForParam, METHOD_INTENT, buildHint, buildReachabilityManifest, norm, dirOf, baseName, isMavenPom, isGradleBuild, stripXmlComments, isAncestorDir, normModulePath, selectRunnableModule, PACKAGE_DECL, BOOT_CLASS, posix22, detectSpringBootClass, BASE_CONFIG_RE, PROFILE_CONFIG_RE, HARNESS_PORT, KEY_LINE_RE, yamlEntries, emptyKeys, isConfigYaml, profileRank, declaresDatasource, detectDatasourceProfileBlocker, detectProfileCompositionBlocker, detectServerPortBlocker, XML_COMMENT_RE, INCLUDE_RE, CREATE_TABLE_RE, ALTER_TARGET_RE, matchAllGroups, detectUnrunnableMigrationBlocker, detectPolicyBootBlockers, BINDABLE_NAME_RE, YAML_KEY_RE, PROPS_KEY_RE, configValueOf, rawTokensOf, MARK, AUTHORITY_LIKE_RE, shapeInAuthority, nextOf, shapeInPath, shapeAt, parseConfigValue, renderTemplate, STANDALONE_BOOT_PROFILE, NOTE, isConfigFile, leafKey, indentOf2, fullPathFor, usesJpa, KAFKA_BUILD_RE, KAFKA_CONFIG_RE, declaresKafka, hasPinnedListenerAutoStartup, ENDPOINT_PROPERTY_RULES, ENDPOINT_VALUE_RE, CLUSTER_TOPOLOGY_RULES, literalDatabaseOf, buildStandaloneBootProfile, runtimeEnvKeyFor, A_SENTINEL, ENC_SENTINEL, isEndpointShaped, hasToken, dummyFor, RELAXED_ENV, envKeyFor, buildSidecars, renderSidecar, identifyByName, PATH_KINDS, PATH_LEAF_ROLES, identifyByPath, roleFromShape, shapedDummy, resolvePlaceholder, encSentinelFor, SHAPE_PRECEDENCE, strongerShape, buildBootResolution, CONFIG_ENTRY_RE, SKIPPED_ENTRY_RE, XML_COMMENT_RE2, SYSTEM_PATH_RE, declaredSystemJarEntries, declaredSystemJarPaths, readCentralDirectory, readEntryBytes, readEntryText, languageFor, detectMissingSystemJars, readJarConfigFiles, listJarClassNames, MIN_CONSTANT_LEN, MAX_CONSTANT_LEN, MAX_CONSTANTS_PER_CLASS, NOISE_CONSTANT_RE, parseClassConstants, constantRank, readJarClassConstants, collectDependencyClassConstants, collectDependencyClassNames, collectDependencyConfigFiles, EOCD_SIGNATURE, CENTRAL_SIGNATURE, EOCD_SEARCH_WINDOW, MAX_COMPRESSION_RATIO, MAX_UNCOMPRESSED_BYTES, MAX_ENTRIES, fail, isUnsafeName, readArchive, readArchiveEntryText, SOURCE_EXTENSIONS, extensionOf, baseNameOf, XML_COMMENT_RE3, isAggregatorPom, declaresParentPath, declaresSystemPaths, resolveAgainst, preflightArchive, SKIP_DIRS, MAX_FILE_BYTES, MAX_PARENT_DEPTH, toPosix2, isFile, walk, XML_COMMENT_RE4, RELATIVE_PATH_RE, SYSTEM_PATH_RE2, PARENT_BLOCK_RE, EMPTY_RELATIVE_PATH_RE, readPom, expandBasedir, planServicePackage, CRC_TABLE, crc32, writePackageZip, listPackageableModules, DIALECT_SPECS, JDBC_URL_PATTERNS, DRIVER_PATTERNS, isConfigFile2, isBuildFile, dialectsMatching, resolveDialect, DDL_AUTO_CREATE_RE, FLYWAY_RE, LIQUIBASE_RE, resolveSchemaProvisioning, detectDbTier, DB_SIDECAR_PORT, DISPOSABLE_DB, dbSidecarEnv, buildDbSidecarSpec, HARNESS_PLAN_SCHEMA_VERSION, isConfigFile3, isBuildFile2, stripComments, SERVICE_DEPS, detectDatabaseDependency, detectServiceDependencies, detectHarnessDependencies, buildHarnessPlan, RUNTIME_PLAN_SCHEMA_VERSION, PLAN_NOTE, describeSidecar, buildSteps, buildRuntimeBringUpPlan, RUNTIME_OVERLAY_FILE, RUNTIME_COMPOSE_FILE, RUNTIME_GUIDE_FILE, RUNTIME_BOOT_ENV_FILE, SIDECAR_IMAGE, REDIS_CLUSTER_COMMAND, renderNestedYaml, renderOverlay, publishLine, renderCompose, renderGuide, renderBootEnv, generateRuntimeArtifacts, SUBMISSION_REQUIREMENTS_SCHEMA_VERSION, MAX_EVIDENCE15, NOTE2, capEvidence, totalSuffix, blockerEvidence, groupBy, packagingRequirements, secretRequirements, POLICY_KINDS, policyRequirements, infrastructureRequirements, authRequirements, seedRequirements, TIER_ORDER, buildSubmissionRequirements, renderSubmissionRequirements, REJECT_SIDECAR, applyRuntimeInput, DESER_SPEC, MAX_EVIDENCE16, lineOf14, UNSAFE_PATTERNS, collectHits2, SAFE_VALIDATOR_RE, firstSafeValidator, evidence12, item10, scanUnsafeDeserialization, WEAK_RANDOM_SPEC, MAX_EVIDENCE17, lineOf15, WEAK_RNG_PATTERNS, SECURITY_ID_RE, statementAround, COOKIE_SINK_MAX_HOPS, namesCarrying, reachesCookie, collectHits3, SECURE_RANDOM_RE, firstSecureRandom, evidence13, item11, scanWeakSecureRandom, POSTMESSAGE_SPEC, MAX_EVIDENCE18, lineOf16, WINDOW_LISTENER_PATTERNS, ORIGIN_RE, isFrontend, listenersIn, evidence14, item12, scanPostMessageOrigin, XXE_SPEC, MAX_EVIDENCE19, lineOf17, XML_PARSER_PATTERNS, HARDENING_RE, parsersIn, evidence15, item13, scanXxe, WEAK_TLS_SPEC, MAX_EVIDENCE20, lineOf18, BYPASS_PATTERNS, TLS_SURFACE_RE, bypassesIn, evidence16, item14, scanWeakTls, HOST_HEADER_SPEC, MAX_EVIDENCE21, lineOf20, HOST_PATTERNS, collectHits5, evidence18, item16, scanHostHeader, CHECKLIST_ID2, CONTROL_ID2, TITLE2, evidenceOf, item17, VALUE_ANNOTATION_RE, FIELD_AFTER_VALUE_RE, LIFETIME_TOKEN_RE, tokenize, hasOtpToken, TIME_UNIT_RE, NAME_UNIT_HINTS, TO_SECONDS, lineOf21, isOtpLifetimeName, configRank, inconclusive, scanOtpPolicy, PASSWORD_POLICY_SPEC, MAX_EVIDENCE222, lineOf22, precedingBlock3, PASSWORD_NAME_RE, NOT_A_SECRET_RE, isPasswordName, STRING_DECL_RE, SIZE_MIN_RE, ANNOTATION_IN_BLOCK_RE, LENGTH_CHECK_RE, CONSTRAINT_VALIDATOR_RE, ANNOTATION_DECL_RE, STRING_LITERAL_RE, QUANT_MIN_RE, POLICY_SURFACE_PATTERNS, ACCOUNT_SURFACE_RE, baseName2, isAccountSurface, collectCustomConstraintMins, sitesIn, firstUsageIndex, pointersIn, dedupeSort, evidenceOf2, item18, policyNote, scanPasswordPolicy, SPEC, MAX_EVIDENCE23, AUTH_SURFACE_RE, ACCOUNT_EXISTENCE_RE, PASSWORD_ONLY_RE, COMBINED_RE, STRING_LITERAL_RE2, lineOf23, scanAuthFile, dedupeSort2, evidenceOf3, item19, scanAccountEnumeration, SPEC2, MAX_EVIDENCE24, LOGOUT_ENDPOINT_RE, LOGOUT_MENTION_RE, INVALIDATION_PATTERNS, lineOf24, invalidationHits, dedupeSort3, evidenceOf4, item20, scanLogoutInvalidation, SPEC3, MAX_EVIDENCE25, OTP_ISSUE_RE, OTP_MENTION_RE, THROTTLE_PATTERNS, lineOf25, firstMatch2, dedupeSort4, evidenceOf5, item21, scanOtpThrottle, SPEC4, MAX_EVIDENCE26, HARD_MUTATION_HANDLER_RE, DIRECT_WRITE_RE, DELEGATION_WRITE_RE, TXN_RE, READ_ONLY_TXN_RE, offsetOfLine2, insideLiteral, extractHandlerBody, braceMatchedBlock, signatureRegion, confirmWrite, dedupeSort5, evidenceOf6, item22, scanStateChangingGet, MAX_EVIDENCE27, REVIEW_SIGNAL_MAP, asJsonRecord, readReviewFinding, parseReviewReport, evidenceOf7, sortEvidence, foldReviewSignals, MAX_EVIDENCE28, AUTHORIZATION_RISK_EVIDENCE, AI_SIGNAL_MAP, readPerRule, parseAiReviewReport, evidenceOf8, sortEvidence2, provenanceOf, skipReasonOf, foldAiSignals, MAX_EVIDENCE29, SEVERITY_ORDER2, SCORE_FLOOR, asRecord2, asString, stripMountPrefix, severityFromTags, field, parseScaReport, effectiveScore, passesThreshold, distinctPairs, bySeverityThenName, evidenceOf9, countBySeverity, provenance, foldScaReport, BRUTE_FORCE_SPEC, MAX_EVIDENCE30, lineOf26, AUTH_CONTEXT_RE, LIMIT_NAME_RE, MAX_VALUE_ASSIGN_RE, MECHANISM_PATTERNS, failOpenHits, mechanismHits, dedupeSort6, evidenceOf10, item23, scanBruteForceProtection, TS_LANGS, MOUNT_ROOT, MOUNT_ANY, TS_EXT_CANDIDATES, MAX_CHAIN_DEPTH, MAX_REEXPORT_DEPTH, UNRESOLVED_PATH, keyOf, applyRouteConfigOverrides, CLIENT_CLASSES, MANUAL_DELIVERY_SOURCES, ENC, ROUTE_BASE_PREFIX, BENIGN_PARAM, CLIENT_ORACLE, deliveryFor, jsStr, normFile, camel, urlChunk, buildGoto, manualComment, renderMethod, renderSpec, dedupeRoutes, generateClientVerificationSuite, buildClientVerificationManifest, WSTG, TC16, MANUAL_CHECKLIST_ITEMS, NEEDS_MANUAL_LIMITATION, buildManualChecklistItems, handoffFileName, MAX_SURFACE_SAMPLE, surfaceContext, INFRA_CONTEXT, buildHandoffPackets, GENERATED_PACKAGE, SERVER_CLASSES, BOOLEAN_BLIND_CLASSES, BOOLEAN_BLIND_PAIRS, CLASS_CANARY, COMMAND_CANARY, VALIDATION_REJECT_CLASSES2, CANON_HELPER, CLASS_ORACLE, javaStr, BENIGN_SEED, renderAuthSuffix, pascal, camel2, identChunk, fillPath, requestExpr, isVerifiable, SERVER_SKIP_REASON, renderBooleanBlind, renderCanary, renderMethod2, renderEvidenceMethod, renderEvidenceHelpers, renderTestcontainersDbTierFields, renderExternalDbTierFields, renderClass, toManifestEntries, generateVerificationSuite, buildVerificationManifest, decodeEntities, attr, stripCdata, childMessage, classify3, parseJUnitXml, simpleClassName, joinKey, DEFAULT_TRUST_TIER, resolveFromEnvelope, ingestVerification, PROVENANCE_DETAIL, applyProvenanceDowngrades, asRecord3, asString2, asBool, asInt, SIGNALS, ATTESTATION_METHODS, parseProvenance, parseOracle, parseEffectBoundary, parseDefenseControl, parseBaseline, parseAttack, parseEvidenceEnvelope, asRecord4, asArray, asString3, asNumber, basename22, specOutcome, walkSuite, parsePlaywrightReport, joinKey2, ingestClientVerification, compareChecklistId, correlateVerification, EMPTY_CORRELATION, notTestedItem, groupDastByChecklist, dastAxisFor, groupClientByChecklist, clientAxisFor, correlateAssessment, ZAP_SCAN_RULES, DEFAULT_DAST_OPTIONS, DAST_PLAN_FILE, DAST_MANIFEST_FILE, isScannable, skipReason, yamlStr, fillPath2, normMethod, toTarget, SEED_VALUE, renderRequest, renderPlanYaml, generateDastPlan, buildDastManifest, cmpStr3, compareScenarioRef, compareExecutionTarget, RISK_BY_CODE, asString4, firstLine, parseZapReport, firstLineOf, usableTimestamp, latestMessageInstant, parseZapMessages, pathOf, stripTrailingSlash, pathMatches, methodMatches, injectionMatches, routeMatchesOrUnknown, alertMatchesTarget, queryHasParam, messageMatchesSurface, computeDastCoverage, detailOf, evidenceOf11, ingestDast, SEMGREP_CWE_MAP, asRecord5, asString5, asNonNegativeInteger, compareText2, compareCwe, stringsFrom, cwesFromProperties, messageText, compareFinding, findingKey, ruleMetadata, metadataForResult, locationsOf, findingsFromRun, parseSemgrepSarif, compareChecklistId2, unmatchedKey, ingestSemgrep, CHECKLIST_ID3, CONTROL_ID3, MAX_EVIDENCE31, OWNER_SCOPED_FINDER, REPOSITORY_DECL, lineOf27, fieldNameFor, collectOwnerScopedRepositories, scanIdor, CHECKLIST_ID4, CONTROL_ID4, MAX_EVIDENCE32, CONTROLLER, MULTIPART_PARAM, ALLOWLIST, CONTENT_SNIFF, lineOf28, collectUploadHandlers, firstMatch3, scanUploadValidation, CHECKLIST_ID5, CONTROL_ID5, MAX_EVIDENCE33, SECRET_KEY_LINE, SELF_IDENTIFYING_KEYS, JWT_CONTEXT_RE, PARENT_KEY_LINE, ancestorPath, ENV_PLACEHOLDER2, NON_PROD_PROFILE, CONFIG_FILE, lineOf29, byFileLine2, collectSecrets, scanJwtSecret;
7142
+ var createCompositeParser, SUPPORTED, createTextParser, requireFromHere, grammarCache, parserInitialized, initParser, resolveGrammarPath, loadGrammar, LANGUAGE_TO_GRAMMAR, SUPPORTED2, createTreeSitterParser, asTreeSitterTree, SUPPORTED3, scriptKindFor, createTsMorphParser, createParser, TS_LANGUAGES, EXTENSIONS, TS_SOURCE_EXTENSIONS_BY_RUNTIME_EXT, scriptKindFor2, normalizeRelativePath, candidatePaths, normalizeConfigPath, stripJsonComments, loadTsConfigResolver, matchPathPattern, applyPathTarget, resolveAliasModule, resolveModule, aliasIfDifferent, exportedSymbols, expressionRootName, addSymbol, compareText, variableBindingNames, importEqualsSpecifier, extractSymbols, fingerprintFor, createTsAstDependencyGraphBuilder, isTsLike, debug, warn, tryLoad, trySave, createIncrementalAstGraphBuilder, SOURCES, SINKS, SANITIZERS, DEFAULT_TS_TAINT_TABLES, JAVA_SOURCES, JAVA_SINKS, JAVA_SANITIZERS, DEFAULT_JAVA_TAINT_TABLES, EMPTY_SUMMARY, paramSentinel, PARAM_SENTINEL_RE, MAX_CROSS_FILE_DEPTH, TYPE_DECL_NODES, indexCache, SCOPE_BOUNDARY, SCOPE_BOUNDARY2, TYPE_DECL, STRING_PASSTHROUGH, ARG_PASSTHROUGH, CONTAINER_ELEMENT, BUILDER_APPENDERS, COLLECTION_MUTATORS, RECEIVER_FOLD_MUTATORS, CONDITIONAL_CONSTRUCT, EMPTY_SUMMARY2, paramSentinel2, PARAM_SENTINEL_RE2, MAX_CROSS_METHOD_DEPTH, SANITIZE_CALL, BYPASS_CALL, PREFIX_GATE, MAX_VALUE_HOPS, SOURCE_PATTERNS, maskJavaComments, maskedCorpusCache, maskJavaFiles, MAPPING_ANNOTATIONS, PARAM_ANNOTATIONS, AUTHZ_ANNOTATIONS, VALIDATION_ANNOTATIONS, annotationScanner, TYPE_DECL2, MODIFIER, METHOD_NAME, LEADING_ANNOTATION, simpleName, lineOf, readBalanced, annotationArgs, firstStringLiteral, readMappingPath, readMappingMethod, joinPaths, skipToDeclaration, isTypeDeclaration, splitParams, parseParam, readAuthAnnotations, ROLE_ANNOTATIONS, stripRolePrefix, readAuthRoles, precedingBlock, readClassContext, extractFromFile, extractHttpEndpoints, findEnclosingEndpoint, SINK_ATTACKS, SOURCE_KIND, kindsFromSources, deriveAuthContext, resolveCompanionParams, resolveInjectionPoint, buildServerRequest, buildClientRequest, generateAttackScenario, UNASSESSED_CATALOG, BY_ID, buildUnassessedItems, INJECTION_LANGUAGES, TIER_A_INJECTION_ITEMS, CONFIRMED_LIMITATION, INCONCLUSIVE_LIMITATION, evidenceFrom, byFileLine, CHECKLIST_VERDICT_RANK, mergeEqualRank, dedupeByChecklistId, scenarioByFileLine, PENTEST_CHECKLIST_TOTAL, DECLARED_CHECKLIST_IDS, buildChecklistCoverage, buildCoverage, assembleAssessment, IMPORT_LINE_RE, isImportOrPackageLine, CSRF_SPEC, CORS_SPEC, HEADERS_SPEC, STACKTRACE_SPEC, MESSAGE_SPEC, COOKIE_SPEC, SESSION_FIXATION_SPEC, SESSION_TIMEOUT_SPEC, AUTH_CACHE_SPEC, lineOf2, SECURITY_CONFIG_RE, CSRF_DISABLE_RE, CORS_WILDCARD_RE, CROSS_ORIGIN_BARE_RE, ALLOW_CREDENTIALS_RE, CORS_EXPLICIT_ORIGIN_RE, CORS_ANY_RE, HEADERS_DISABLE_RES, HEADERS_CONFIGURED_RE, CSP_CONFIGURED_RE, STACKTRACE_EXPOSE_RE, STACKTRACE_NEVER_RE, MESSAGE_EXPOSE_RE, MESSAGE_NEVER_RE, COOKIE_CONTEXT_RE, COOKIE_INSECURE_CHECKS, COOKIE_HARDENED_RE, SESSION_FIXATION_DISABLED_RE, CACHE_CONTROL_DISABLE_RE, CACHE_CONTROL_CONFIGURED_RE, SESSION_TIMEOUT_PATH_RE, SESSION_BLOCK_HEADER_RE, SESSION_TIMEOUT_LEAF_RE, YAML_INDENT_RE, control, configEvidence, firstMatch, firstMatchAny, scanCsrf, CORS_ORIGINS_YAML_RE, CORS_CREDENTIALS_YAML_RE, isWildcardOrigins, corsConfigRank, corsOriginHits, scanCors, scanSecurityHeaders, NON_PROD_PROFILE_RE, scanStacktraceExposure, scanErrorMessageExposure, scanCookieAttributes, scanSessionFixation, scanAuthCacheControl, findSessionTimeout, timeoutNeverExpires, timeoutToMinutes, JWT_VALIDITY_RE, NON_PROD_CONFIG_RE, findJwtValidities, hoursOf, judgeJwtValidity, judgeServletTimeout, scanSessionTimeout, scanSecurityConfig, TEST_SOURCE_SET_RE, isTestSourcePath, WEAK_CRYPTO_SPEC, MAX_EVIDENCE3, lineOf3, classifyAlgorithm, GET_INSTANCE_RE, COMMONS_DIGEST_RE, GUAVA_HASHING_RE, SECRET_KEY_SPEC_RE, SHORTHAND_ALGO, collectWeakHits, STRONG_CRYPTO_RE, STRONG_CRYPTO_RE_G, firstStrong, evidence, item, scanWeakCrypto, REGEX_PRECEDING_KEYWORDS, isIdentChar, regexAllowedAt, maskJsComments, maskedCorpusCache2, maskJsFiles, BROWSER_STORAGE_SPEC, MAX_EVIDENCE22, lineOf4, HIGH_SENSITIVITY_RE, TOKEN_FAMILY_RE, classifyStorageKey, VALUE_TOKEN_FAMILY_RE, classifyStorageValue, keyToken, SET_ITEM_RE, BRACKET_ASSIGN_RE, STORAGE_USE_RE, IDB_CONTEXT_RE, LOCALFORAGE_SET_RE, IDB_STORE_WRITE_RE, collectStorageHits, collectIndexedDbHits, finalizeHits, firstStorageUse, evidence2, item2, scanSensitiveBrowserStorage, AT_REST_SPEC, MAX_EVIDENCE32, lineOf5, PWD_GETTER, PWD_EQUALS_RECEIVER_RE, PWD_EQUALS_ARG_RE, collectPasswordComparisonHits, SENSITIVE_FIELD_NAMES, FIELD_DECL_RE, FIELD_PROTECTED_RE, precedingBlock2, collectPlaintextFieldHits, finalizeHits2, PROTECTION_RE, firstProtection, AT_REST_SURFACE_RE, evidence3, item3, scanSensitiveDataAtRest, PADDING_ORACLE_SPEC, MAX_EVIDENCE4, lineOf6, GET_INSTANCE_RE2, collectCbcHits, BAD_PADDING_CATCH_RE, collectBadPaddingHits, finalizeHits3, AEAD_RE, firstAead, CIPHER_SURFACE_RE, evidence4, item4, scanPaddingOracle, LOGGING_SPEC, MAX_EVIDENCE5, lineOf7, LOG_CALL_RE, LOG_SURFACE_RE, stripStringLiterals, SECRET_RE, PII_RE, PROTECTED_TAIL_RE, findSensitiveToken, collectLogHits, firstLogSurface, evidence5, item5, scanSensitiveLogging, CHECKLIST_ID, CONTROL_ID, TITLE, CWE, MAX_EVIDENCE6, ADMIN_PATH_RE, ADMIN_CONTROLLER_RE, isAdminEndpoint, ADMIN_ROLE_RE, ROLE_CAPABLE_AUTHZ, ROLE_ANNOTATION_RE, SEC_CONFIG_HINT_RE, MATCHER_RE, ACCESS_AFTER_RE, ANY_REQUEST_RE, offsetOfLine, readBalanced2, stringLiterals, antMatches, hasAdminRoleAnnotation, classHeaderOf, memberWindow, annotationStance, accessKind, collectFilterConfig, filterStanceFor, combineProtection, publicNote, item6, auditAdminSurface, CLOUD_ACL_SPEC, MAX_EVIDENCE7, lineOf8, PUBLIC_ACL_PATTERNS, finalizeHits4, collectCannedAclHits, EFFECT_ALLOW_RE, WILDCARD_PRINCIPAL_RE, S3_ACTION_RE, enclosingObject, collectBucketPolicyHits, evidence6, item7, scanCloudStorageAcl, ACTUATOR_SPEC, MAX_EVIDENCE8, CONFIG_FILE_RE, SENSITIVE_ACTUATOR_ENDPOINTS, lineOf9, indentOf, isBlankOrComment, splitEndpoints, classifyExposure, exposureNote, H2_NOTE, findChildKey, collectListItems, collectExposureHits, collectH2Hits, finalizeHits5, evidence7, item8, scanActuatorExposure, BACKUP_FILE_SPEC, BACKUP_FILE_GLOBS, BACKUP_FILE_RE, SENSITIVE_BASE_RE, MAX_EVIDENCE9, stripBackupSuffix, classify2, evidence8, scanBackupFiles, CROSSDOMAIN_SPEC, CROSSDOMAIN_GLOBS, MAX_EVIDENCE10, lineOf10, PERMISSIVE_PATTERNS, collectHits, evidence9, scanCrossDomainPolicy, CLIENT_INFO_SPEC, ANGULAR_CONFIG_GLOBS, MAX_EVIDENCE11, lineOf11, asRecord, sourceMapEnabled, buildConfigurations, scanConfigFile, evidence10, item9, scanClientInfoLeak, SENSITIVE_FILE_SPEC, SENSITIVE_FILE_GLOBS, SENSITIVE_FILE_RE, PEM_TEXT_RE, PRIVATE_KEY_HEADER_RE, MAX_EVIDENCE12, classify22, evidence11, scanSensitiveFiles, INSECURE_TRANSPORT_SPEC, ENVIRONMENT_FILE_RE, MAX_EVIDENCE13, lineOf12, extractStringLiterals, HTTP_URL_RE, HTTPS_PRESENCE_RE, isExcludedHost, scanInsecureTransport, WEBSOCKET_SPEC, MAX_EVIDENCE14, WS_URL_RE, WSS_PRESENCE_RE, scanWebSocketSecurity, authFillKey, createStubAuthFillResolver, buildAuthFillMap, ALG_TO_HASH, SIGNING_KEY_LINE, ENV_PLACEHOLDER, lineOf13, cleanValue, discoverJwtSigningKeys, b64url, b64urlStr, signingKeyBytes, mintJwt, DEFAULT_JHIPSTER_CLAIMS, RECIPE_NOTE, sha256Hex, buildRuntimeAuthRecipe, mintTokenFromRecipe, DEFAULT_TTL_SECONDS, commandsFor, credentialFor, buildRuntimeAuthSeedPlan, runtimeAuthSeedDeviation, DEFAULT_TIMEOUT_MS, CRLF, encodeResp, identify, readReply, applyRuntimeAuthSeed, describeShape, resolveRuntimeAuthHypothesis, THREW, createStubRuntimeAuthHypothesisResolver, dataSeedKey, describeShape2, THREW2, resolveRuntimeDataSeedHypothesis, createStubRuntimeDataSeedResolver, buildDataSeedPlan, dataSeedEndpointSummaries, IDEMPOTENT_INSERT, BACKSLASH_IS_ESCAPE, escapeSqlString, sqlLiteral, assertIdentifier, renderDataSeedSql, SEED_AUDIT_SENTINEL, AUDIT_FIELD_RE, CLASS_DECL_RE, TABLE_RE, EXTENDS_RE, NULLABLE_FALSE_RE, LENGTH_RE, stripJavaComments, group, detectSeedAuditColumns, applySeedAuditColumns, seedAuditAddedColumns, REACHABILITY_MANIFEST_SCHEMA_VERSION, MANIFEST_NOTE, SCALAR_JAVA_TYPES, baseTypeName, seedForParam, METHOD_INTENT, buildHint, buildReachabilityManifest, norm, dirOf, baseName, isMavenPom, isGradleBuild, stripXmlComments, isAncestorDir, normModulePath, selectRunnableModule, PACKAGE_DECL, BOOT_CLASS, posix22, detectSpringBootClass, BASE_CONFIG_RE, PROFILE_CONFIG_RE, HARNESS_PORT, KEY_LINE_RE, yamlEntries, emptyKeys, isConfigYaml, profileRank, declaresDatasource, detectDatasourceProfileBlocker, detectProfileCompositionBlocker, detectServerPortBlocker, XML_COMMENT_RE, INCLUDE_RE, CREATE_TABLE_RE, ALTER_TARGET_RE, matchAllGroups, detectUnrunnableMigrationBlocker, detectPolicyBootBlockers, BINDABLE_NAME_RE, YAML_KEY_RE, PROPS_KEY_RE, configValueOf, rawTokensOf, MARK, AUTHORITY_LIKE_RE, shapeInAuthority, nextOf, shapeInPath, shapeAt, parseConfigValue, renderTemplate, STANDALONE_BOOT_PROFILE, NOTE, isConfigFile, leafKey, indentOf2, fullPathFor, usesJpa, KAFKA_BUILD_RE, KAFKA_CONFIG_RE, declaresKafka, hasPinnedListenerAutoStartup, ENDPOINT_PROPERTY_RULES, ENDPOINT_VALUE_RE, CLUSTER_TOPOLOGY_RULES, literalDatabaseOf, buildStandaloneBootProfile, runtimeEnvKeyFor, A_SENTINEL, ENC_SENTINEL, isEndpointShaped, hasToken, dummyFor, RELAXED_ENV, envKeyFor, buildSidecars, renderSidecar, identifyByName, PATH_KINDS, PATH_LEAF_ROLES, identifyByPath, roleFromShape, shapedDummy, resolvePlaceholder, encSentinelFor, SHAPE_PRECEDENCE, strongerShape, buildBootResolution, CONFIG_ENTRY_RE, SKIPPED_ENTRY_RE, XML_COMMENT_RE2, SYSTEM_PATH_RE, declaredSystemJarEntries, declaredSystemJarPaths, readCentralDirectory, readEntryBytes, readEntryText, languageFor, detectMissingSystemJars, readJarConfigFiles, listJarClassNames, MIN_CONSTANT_LEN, MAX_CONSTANT_LEN, MAX_CONSTANTS_PER_CLASS, NOISE_CONSTANT_RE, parseClassConstants, constantRank, readJarClassConstants, collectDependencyClassConstants, collectDependencyClassNames, collectDependencyConfigFiles, EOCD_SIGNATURE, CENTRAL_SIGNATURE, EOCD_SEARCH_WINDOW, MAX_COMPRESSION_RATIO, MAX_UNCOMPRESSED_BYTES, MAX_ENTRIES, fail, isUnsafeName, readArchive, readArchiveEntryText, SOURCE_EXTENSIONS, extensionOf, baseNameOf, XML_COMMENT_RE3, isAggregatorPom, declaresParentPath, declaresSystemPaths, resolveAgainst, preflightArchive, SKIP_DIRS, MAX_FILE_BYTES, MAX_PARENT_DEPTH, toPosix2, isFile, walk, XML_COMMENT_RE4, RELATIVE_PATH_RE, SYSTEM_PATH_RE2, PARENT_BLOCK_RE, EMPTY_RELATIVE_PATH_RE, readPom, expandBasedir, planServicePackage, CRC_TABLE, crc32, writePackageZip, listPackageableModules, DIALECT_SPECS, JDBC_URL_PATTERNS, DRIVER_PATTERNS, isConfigFile2, isBuildFile, dialectsMatching, resolveDialect, DDL_AUTO_CREATE_RE, FLYWAY_RE, LIQUIBASE_RE, resolveSchemaProvisioning, detectDbTier, DB_SIDECAR_PORT, DISPOSABLE_DB, dbSidecarEnv, buildDbSidecarSpec, HARNESS_PLAN_SCHEMA_VERSION, isConfigFile3, isBuildFile2, stripComments, SERVICE_DEPS, detectDatabaseDependency, detectServiceDependencies, detectHarnessDependencies, buildHarnessPlan, RUNTIME_PLAN_SCHEMA_VERSION, PLAN_NOTE, describeSidecar, buildSteps, buildRuntimeBringUpPlan, RUNTIME_OVERLAY_FILE, RUNTIME_COMPOSE_FILE, RUNTIME_GUIDE_FILE, RUNTIME_BOOT_ENV_FILE, SIDECAR_IMAGE, REDIS_CLUSTER_COMMAND, renderNestedYaml, renderOverlay, publishLine, renderCompose, renderGuide, renderBootEnv, generateRuntimeArtifacts, SUBMISSION_REQUIREMENTS_SCHEMA_VERSION, MAX_EVIDENCE15, NOTE2, capEvidence, totalSuffix, blockerEvidence, groupBy, packagingRequirements, secretRequirements, POLICY_KINDS, policyRequirements, infrastructureRequirements, authRequirements, seedRequirements, TIER_ORDER, buildSubmissionRequirements, renderSubmissionRequirements, REJECT_SIDECAR, applyRuntimeInput, DESER_SPEC, MAX_EVIDENCE16, lineOf14, UNSAFE_PATTERNS, collectHits2, SAFE_VALIDATOR_RE, firstSafeValidator, evidence12, item10, scanUnsafeDeserialization, WEAK_RANDOM_SPEC, MAX_EVIDENCE17, lineOf15, WEAK_RNG_PATTERNS, SECURITY_ID_RE, statementAround, COOKIE_SINK_MAX_HOPS, namesCarrying, reachesCookie, collectHits3, SECURE_RANDOM_RE, firstSecureRandom, evidence13, item11, scanWeakSecureRandom, POSTMESSAGE_SPEC, MAX_EVIDENCE18, lineOf16, WINDOW_LISTENER_PATTERNS, ORIGIN_RE, isFrontend, listenersIn, evidence14, item12, scanPostMessageOrigin, XXE_SPEC, MAX_EVIDENCE19, lineOf17, XML_PARSER_PATTERNS, HARDENING_RE, parsersIn, evidence15, item13, scanXxe, WEAK_TLS_SPEC, MAX_EVIDENCE20, lineOf18, BYPASS_PATTERNS, TLS_SURFACE_RE, bypassesIn, evidence16, item14, scanWeakTls, HOST_HEADER_SPEC, MAX_EVIDENCE21, lineOf20, HOST_PATTERNS, collectHits5, evidence18, item16, scanHostHeader, CHECKLIST_ID2, CONTROL_ID2, TITLE2, evidenceOf, item17, VALUE_ANNOTATION_RE, FIELD_AFTER_VALUE_RE, LIFETIME_TOKEN_RE, tokenize, hasOtpToken, TIME_UNIT_RE, NAME_UNIT_HINTS, TO_SECONDS, lineOf21, isOtpLifetimeName, configRank, inconclusive, scanOtpPolicy, PASSWORD_POLICY_SPEC, MAX_EVIDENCE222, lineOf22, precedingBlock3, PASSWORD_NAME_RE, NOT_A_SECRET_RE, isPasswordName, STRING_DECL_RE, SIZE_MIN_RE, ANNOTATION_IN_BLOCK_RE, LENGTH_CHECK_RE, CONSTRAINT_VALIDATOR_RE, ANNOTATION_DECL_RE, STRING_LITERAL_RE, QUANT_MIN_RE, POLICY_SURFACE_PATTERNS, ACCOUNT_SURFACE_RE, baseName2, isAccountSurface, collectCustomConstraintMins, sitesIn, firstUsageIndex, pointersIn, dedupeSort, evidenceOf2, item18, policyNote, scanPasswordPolicy, SPEC, MAX_EVIDENCE23, AUTH_SURFACE_RE, ACCOUNT_EXISTENCE_RE, PASSWORD_ONLY_RE, COMBINED_RE, STRING_LITERAL_RE2, lineOf23, scanAuthFile, dedupeSort2, evidenceOf3, item19, scanAccountEnumeration, SPEC2, MAX_EVIDENCE24, LOGOUT_ENDPOINT_RE, LOGOUT_MENTION_RE, INVALIDATION_PATTERNS, lineOf24, invalidationHits, dedupeSort3, evidenceOf4, item20, scanLogoutInvalidation, SPEC3, MAX_EVIDENCE25, OTP_ISSUE_RE, OTP_MENTION_RE, THROTTLE_PATTERNS, lineOf25, firstMatch2, dedupeSort4, evidenceOf5, item21, scanOtpThrottle, SPEC4, MAX_EVIDENCE26, HARD_MUTATION_HANDLER_RE, DIRECT_WRITE_RE, DELEGATION_WRITE_RE, TXN_RE, READ_ONLY_TXN_RE, offsetOfLine2, insideLiteral, extractHandlerBody, braceMatchedBlock, signatureRegion, confirmWrite, dedupeSort5, evidenceOf6, item22, scanStateChangingGet, MAX_EVIDENCE27, REVIEW_SIGNAL_MAP, asJsonRecord, readReviewFinding, parseReviewReport, evidenceOf7, sortEvidence, foldReviewSignals, MAX_EVIDENCE28, AUTHORIZATION_RISK_EVIDENCE, AI_SIGNAL_MAP, readPerRule, parseAiReviewReport, evidenceOf8, sortEvidence2, provenanceOf, skipReasonOf, foldAiSignals, MAX_EVIDENCE29, SEVERITY_ORDER2, SCORE_FLOOR, asRecord2, asString, stripMountPrefix, severityFromTags, field, parseScaReport, effectiveScore, passesThreshold, distinctPairs, bySeverityThenName, evidenceOf9, countBySeverity, provenance, foldScaReport, BRUTE_FORCE_SPEC, MAX_EVIDENCE30, lineOf26, AUTH_CONTEXT_RE, LIMIT_NAME_RE, MAX_VALUE_ASSIGN_RE, MECHANISM_PATTERNS, failOpenHits, mechanismHits, dedupeSort6, evidenceOf10, item23, scanBruteForceProtection, TS_LANGS, MOUNT_ROOT, MOUNT_ANY, TS_EXT_CANDIDATES, MAX_CHAIN_DEPTH, MAX_REEXPORT_DEPTH, UNRESOLVED_PATH, keyOf, applyRouteConfigOverrides, CLIENT_CLASSES, MANUAL_DELIVERY_SOURCES, ENC, ROUTE_BASE_PREFIX, BENIGN_PARAM, CLIENT_ORACLE, deliveryFor, jsStr, normFile, camel, urlChunk, buildGoto, manualComment, renderMethod, renderSpec, dedupeRoutes, generateClientVerificationSuite, buildClientVerificationManifest, WSTG, TC16, MANUAL_CHECKLIST_ITEMS, NEEDS_MANUAL_LIMITATION, buildManualChecklistItems, handoffFileName, MAX_SURFACE_SAMPLE, surfaceContext, INFRA_CONTEXT, buildHandoffPackets, OBJECT_STORE_PROBE_SINKS, GENERATED_PACKAGE, SERVER_CLASSES, BOOLEAN_BLIND_CLASSES, BOOLEAN_BLIND_PAIRS, CLASS_CANARY, COMMAND_CANARY, VALIDATION_REJECT_CLASSES2, CANON_HELPER, CLASS_ORACLE, javaStr, BENIGN_SEED, BUCKET_BENIGN_SEED, benignSeedFor, renderAuthSuffix, RUNTIME_AUTH_SUFFIX, renderRuntimeAuthHelper, pascal, camel2, verificationTestClassName, identChunk, fillPath, companionCalls, requestExpr, isVerifiable, SERVER_SKIP_REASON, renderBooleanBlind, renderCanary, isObjectStoreProbeSink, OBJECT_STORE_REJECT_CATCH_LINES, wrapObjectStoreAttackGuard, wrapObjectStoreEvidenceAttackGuard, renderMethod2, renderEvidenceMethod, renderEvidenceHelpers, renderTestcontainersDbTierFields, renderExternalDbTierFields, javaSeedValue, renderSeedMethod, renderClass, toManifestEntries, generateVerificationSuite, buildVerificationManifest, decodeEntities, attr, stripCdata, childMessage, classify3, parseJUnitXml, simpleClassName, joinKey, DEFAULT_TRUST_TIER, resolveFromEnvelope, ingestVerification, PROVENANCE_DETAIL, applyProvenanceDowngrades, asRecord3, asString2, asBool, asInt, SIGNALS, ATTESTATION_METHODS, parseProvenance, parseOracle, parseEffectBoundary, parseDefenseControl, parseBaseline, parseAttack, parseEvidenceEnvelope, asRecord4, asArray, asString3, asNumber, basename22, specOutcome, walkSuite, parsePlaywrightReport, joinKey2, ingestClientVerification, compareChecklistId, correlateVerification, EMPTY_CORRELATION, notTestedItem, groupDastByChecklist, dastAxisFor, groupClientByChecklist, clientAxisFor, correlateAssessment, ZAP_SCAN_RULES, DEFAULT_DAST_OPTIONS, DAST_PLAN_FILE, DAST_MANIFEST_FILE, DAST_PROBE_SCRIPT_FILE, PROBE_VICTIM_BUCKET_REF, PROBE_CANARY_OBJECT_REF, PROBE_INJECTION_KINDS, isScannable, skipReason, yamlStr, normMethod, toTarget, SEED_VALUE, allParams, queryString, requestPath, renderRequest, renderPlanYaml, generateDastPlan, buildProbeSpec, buildProbe, buildDastManifest, cmpStr3, compareScenarioRef, compareExecutionTarget, shq, PROBE_SCRIPT_PROLOGUE, PROBE_SCRIPT_EPILOGUE, renderDastProbeScript, RISK_BY_CODE, asString4, firstLine, parseZapReport, firstLineOf, usableTimestamp, latestMessageInstant, parseZapMessages, pathOf, stripTrailingSlash, pathMatches, methodMatches, injectionMatches, routeMatchesOrUnknown, alertMatchesTarget, queryHasParam, messageMatchesSurface, computeDastCoverage, detailOf, evidenceOf11, ingestDast, SEMGREP_CWE_MAP, asRecord5, asString5, asNonNegativeInteger, compareText2, compareCwe, stringsFrom, cwesFromProperties, messageText, compareFinding, findingKey, ruleMetadata, metadataForResult, locationsOf, findingsFromRun, parseSemgrepSarif, compareChecklistId2, unmatchedKey, ingestSemgrep, CHECKLIST_ID3, CONTROL_ID3, MAX_EVIDENCE31, OWNER_SCOPED_FINDER, REPOSITORY_DECL, lineOf27, fieldNameFor, collectOwnerScopedRepositories, scanIdor, CHECKLIST_ID4, CONTROL_ID4, MAX_EVIDENCE322, CONTROLLER, MULTIPART_PARAM, ALLOWLIST, CONTENT_SNIFF, lineOf28, collectUploadHandlers, firstMatch3, scanUploadValidation, CHECKLIST_ID5, CONTROL_ID5, MAX_EVIDENCE33, SECRET_KEY_LINE, SELF_IDENTIFYING_KEYS, JWT_CONTEXT_RE, PARENT_KEY_LINE, ancestorPath, ENV_PLACEHOLDER2, NON_PROD_PROFILE, CONFIG_FILE, lineOf29, byFileLine2, collectSecrets, scanJwtSecret;
7000
7143
  var init_dist5 = __esm({
7001
7144
  "../parsers/dist/index.js"() {
7002
7145
  init_dist();
@@ -9185,6 +9328,7 @@ ${edgePart}`);
9185
9328
  if (anns.includes("PermitAll") || anns.length === 0) return { kind: "public" };
9186
9329
  return endpoint.roles.length > 0 ? { kind: "authenticated", roles: endpoint.roles } : { kind: "authenticated" };
9187
9330
  };
9331
+ resolveCompanionParams = (endpoint, injection) => endpoint.params.filter((p) => p.kind !== "body").filter((p) => !(injection !== null && p.name === injection.name && p.kind === injection.kind)).map((p) => ({ name: p.name, kind: p.kind }));
9188
9332
  resolveInjectionPoint = (endpoint, sourceKinds) => {
9189
9333
  const byKind = (k) => endpoint.params.find((p) => p.kind === k);
9190
9334
  for (const k of sourceKinds) {
@@ -9236,6 +9380,10 @@ ${edgePart}`);
9236
9380
  expectedIfSafe: template.expectedIfSafe,
9237
9381
  sinkFile: finding.file,
9238
9382
  sinkLine: finding.line,
9383
+ // ADR-0071: the sink FAMILY identity — one vulnerability class spans several sinks
9384
+ // (path-traversal = path-file + path-resource + minio-object) and only some carry a
9385
+ // canary probe; downstream layers key on this id, never on the class alone.
9386
+ sinkId: finding.sinkId,
9239
9387
  verdict: "suspected",
9240
9388
  confidence,
9241
9389
  ...finding.path && finding.path.length > 0 ? { taintPath: finding.path } : {}
@@ -9248,6 +9396,10 @@ ${edgePart}`);
9248
9396
  httpMethod: endpoint ? endpoint.httpMethod === "ANY" ? "GET" : endpoint.httpMethod : "GET",
9249
9397
  path: endpoint?.path ?? null,
9250
9398
  injectionPoint: injection2,
9399
+ ...(() => {
9400
+ const companions = endpoint ? resolveCompanionParams(endpoint, injection2) : [];
9401
+ return companions.length > 0 ? { companionParams: companions } : {};
9402
+ })(),
9251
9403
  ...endpoint ? { authContext: deriveAuthContext(endpoint) } : {},
9252
9404
  requestExample: endpoint ? buildServerRequest(endpoint, injection2, firstPayload) : `# Kh\xF4ng gi\u1EA3i \u0111\u01B0\u1EE3c HTTP entry point cho sink ${finding.file}:${finding.line} \u2014 ki\u1EC3m tra th\u1EE7 c\xF4ng`
9253
9405
  };
@@ -10716,7 +10868,7 @@ ${edgePart}`);
10716
10868
  title: "Thu\u1EADt to\xE1n m\xE3 ho\xE1/b\u0103m m\u1EA1nh (kh\xF4ng MD5/SHA1/DES/RC4/ECB)",
10717
10869
  cweId: "CWE-327"
10718
10870
  };
10719
- MAX_EVIDENCE2 = 50;
10871
+ MAX_EVIDENCE3 = 50;
10720
10872
  lineOf3 = (content, index2) => {
10721
10873
  let line = 1;
10722
10874
  for (let i = 0; i < index2 && i < content.length; i++) {
@@ -10818,7 +10970,7 @@ ${edgePart}`);
10818
10970
  if (seen.has(key)) return false;
10819
10971
  seen.add(key);
10820
10972
  return true;
10821
- }).slice(0, MAX_EVIDENCE2);
10973
+ }).slice(0, MAX_EVIDENCE3);
10822
10974
  };
10823
10975
  STRONG_CRYPTO_RE = /\bgetInstance\s*\(\s*"[^"]*(?:SHA-?(?:256|384|512)|SHA3|SHA-3|PBKDF2|\/GCM|ChaCha20|Poly1305)|\b(?:BCryptPasswordEncoder|Argon2PasswordEncoder|Pbkdf2PasswordEncoder|SCryptPasswordEncoder|DelegatingPasswordEncoder)\b|\b(?:DigestUtils|Hashing)\s*\.\s*sha(?:256|384|512)/i;
10824
10976
  STRONG_CRYPTO_RE_G = new RegExp(STRONG_CRYPTO_RE.source, "gi");
@@ -11312,7 +11464,7 @@ ${edgePart}`);
11312
11464
  title: "M\xE3 ho\xE1/b\u0103m d\u1EEF li\u1EC7u nh\u1EA1y c\u1EA3m khi l\u01B0u tr\u1EEF (at-rest)",
11313
11465
  cweId: "CWE-312"
11314
11466
  };
11315
- MAX_EVIDENCE3 = 50;
11467
+ MAX_EVIDENCE32 = 50;
11316
11468
  lineOf5 = (content, index2) => {
11317
11469
  let line = 1;
11318
11470
  for (let i = 0; i < index2 && i < content.length; i++) {
@@ -11451,7 +11603,7 @@ ${edgePart}`);
11451
11603
  if (seen.has(key)) return false;
11452
11604
  seen.add(key);
11453
11605
  return true;
11454
- }).slice(0, MAX_EVIDENCE3);
11606
+ }).slice(0, MAX_EVIDENCE32);
11455
11607
  };
11456
11608
  PROTECTION_RE = /\b(?:BCrypt|Argon2|Pbkdf2|SCrypt|Delegating)PasswordEncoder\b|\bPasswordEncoder\b|\bpasswordEncoder\s*\.\s*(?:encode|matches)\s*\(|@ColumnTransformer\b|@Convert\s*\(\s*converter\s*=\s*[\w.]*(?:Crypt|Encrypt|Cipher|Aes|AES)/;
11457
11609
  firstProtection = (javaFiles) => {
@@ -13233,6 +13385,249 @@ ${edgePart}`);
13233
13385
  createStubRuntimeAuthHypothesisResolver = () => ({
13234
13386
  resolve: () => Promise.resolve(null)
13235
13387
  });
13388
+ dataSeedKey = (httpMethod, path2) => `${httpMethod} ${path2}`;
13389
+ describeShape2 = (raw) => {
13390
+ if (typeof raw !== "object" || raw === null) return `not an object (${typeof raw})`;
13391
+ const rec = raw;
13392
+ const keys = Object.keys(rec).sort();
13393
+ const targets = Array.isArray(rec.targets) ? rec.targets : [];
13394
+ const shapes = targets.slice(0, 6).map((t) => {
13395
+ if (typeof t !== "object" || t === null) return "<not-an-object>";
13396
+ const r = t;
13397
+ const rows = Array.isArray(r.rows) ? r.rows.length : -1;
13398
+ return `{${Object.keys(r).sort().join(",")}}${typeof r.table === "string" ? ` table=${r.table}` : ""} rows=${rows}`;
13399
+ });
13400
+ return `keys=[${keys.join(",")}] targets=${targets.length}${shapes.length > 0 ? ` ${shapes.join(" ")}` : ""}`;
13401
+ };
13402
+ THREW2 = /* @__PURE__ */ Symbol("resolver-threw");
13403
+ resolveRuntimeDataSeedHypothesis = async (resolver, request) => {
13404
+ const ask = async (req) => {
13405
+ try {
13406
+ return await resolver.resolve(req);
13407
+ } catch {
13408
+ return THREW2;
13409
+ }
13410
+ };
13411
+ const raw = await ask(request);
13412
+ if (raw === THREW2) return { hypothesis: null, outcome: "resolver-error" };
13413
+ if (raw === null || raw === void 0) return { hypothesis: null, outcome: "no-proposal" };
13414
+ const hypothesis = validateRuntimeDataSeedHypothesis(raw);
13415
+ if (hypothesis !== null) return { hypothesis, outcome: "accepted" };
13416
+ const reason = describeRuntimeDataSeedHypothesisProblem(raw);
13417
+ if (reason !== null) {
13418
+ const retried = await ask({ ...request, priorRejection: reason });
13419
+ if (retried !== THREW2 && retried !== null && retried !== void 0) {
13420
+ const fixed = validateRuntimeDataSeedHypothesis(retried);
13421
+ if (fixed !== null) return { hypothesis: fixed, outcome: "accepted" };
13422
+ return { hypothesis: null, outcome: "rejected", rejectedShape: describeShape2(retried) };
13423
+ }
13424
+ }
13425
+ return { hypothesis: null, outcome: "rejected", rejectedShape: describeShape2(raw) };
13426
+ };
13427
+ createStubRuntimeDataSeedResolver = () => ({
13428
+ resolve: () => Promise.resolve(null)
13429
+ });
13430
+ buildDataSeedPlan = (hypothesis) => {
13431
+ const plan = /* @__PURE__ */ new Map();
13432
+ for (const target of hypothesis.targets) {
13433
+ const key = dataSeedKey(target.httpMethod, target.path);
13434
+ const bucket = plan.get(key);
13435
+ if (bucket) bucket.push(target);
13436
+ else plan.set(key, [target]);
13437
+ }
13438
+ return plan;
13439
+ };
13440
+ dataSeedEndpointSummaries = (entries) => entries.filter((e) => e.seedRequirements.length > 0).map((e) => ({
13441
+ httpMethod: e.endpoint.httpMethod,
13442
+ path: e.endpoint.path,
13443
+ seedRequirements: e.seedRequirements.map((r) => ({
13444
+ kind: r.kind,
13445
+ param: r.param,
13446
+ javaType: r.javaType
13447
+ }))
13448
+ }));
13449
+ IDEMPOTENT_INSERT = /* @__PURE__ */ new Map([
13450
+ ["mysql", { prefix: "IGNORE " }],
13451
+ ["mariadb", { prefix: "IGNORE " }],
13452
+ ["postgresql", { suffix: " ON CONFLICT DO NOTHING" }]
13453
+ ]);
13454
+ BACKSLASH_IS_ESCAPE = /* @__PURE__ */ new Set(["mysql", "mariadb"]);
13455
+ escapeSqlString = (value, dialect) => {
13456
+ const body = BACKSLASH_IS_ESCAPE.has(dialect) ? value.replace(/\\/g, "\\\\").replace(/'/g, "''") : value.replace(/'/g, "''");
13457
+ return `'${body}'`;
13458
+ };
13459
+ sqlLiteral = (value, dialect) => {
13460
+ if (value === null) return "NULL";
13461
+ if (typeof value === "boolean") return value ? "TRUE" : "FALSE";
13462
+ if (typeof value === "number") {
13463
+ if (!Number.isFinite(value)) {
13464
+ throw new Error("runtime-data-seed render: non-finite number (firewall bypassed?)");
13465
+ }
13466
+ return String(value);
13467
+ }
13468
+ return escapeSqlString(value, dialect);
13469
+ };
13470
+ assertIdentifier = (name, what) => {
13471
+ if (!isSqlIdentifier(name)) {
13472
+ throw new Error(`runtime-data-seed render: invalid ${what} identifier (firewall bypassed?)`);
13473
+ }
13474
+ return name;
13475
+ };
13476
+ renderDataSeedSql = (hypothesis, dialect = "generic") => {
13477
+ const statements = [];
13478
+ const seen = /* @__PURE__ */ new Set();
13479
+ const idempotent = IDEMPOTENT_INSERT.get(dialect);
13480
+ for (const target of hypothesis.targets) {
13481
+ if (target.rows.length === 0) {
13482
+ throw new Error("runtime-data-seed render: zero-row target (firewall bypassed?)");
13483
+ }
13484
+ const table = assertIdentifier(target.table, "table");
13485
+ for (const row2 of target.rows) {
13486
+ const columns = Object.keys(row2.columns).sort();
13487
+ if (columns.length === 0) {
13488
+ throw new Error("runtime-data-seed render: zero-column row (firewall bypassed?)");
13489
+ }
13490
+ for (const column of columns) assertIdentifier(column, "column");
13491
+ const values = columns.map((c) => {
13492
+ const v = row2.columns[c];
13493
+ if (v === void 0) {
13494
+ throw new Error("runtime-data-seed render: vanished column value (firewall bypassed?)");
13495
+ }
13496
+ return sqlLiteral(v, dialect);
13497
+ }).join(", ");
13498
+ const insert = `INSERT ${idempotent?.prefix ?? ""}INTO ${table} (${columns.join(", ")}) VALUES (${values})${idempotent?.suffix ?? ""};`;
13499
+ if (seen.has(insert)) continue;
13500
+ seen.add(insert);
13501
+ statements.push(insert);
13502
+ }
13503
+ }
13504
+ const evidenceLines = hypothesis.evidence.map((e) => `-- ${e}`);
13505
+ return [
13506
+ "-- code-sentinel data seed (ADR-0070) \u2014 d\u1EEF li\u1EC7u do runner t\u1EF1 gieo; finding li\xEAn quan d\u1EEF li\u1EC7u",
13507
+ "-- ch\u1EC9 ph\u1EA3n \xE1nh sandbox, KH\xD4NG ph\u1EA3i production.",
13508
+ `-- INSERT-only, idempotent (duplicate-key coi nh\u01B0 th\xE0nh c\xF4ng \u2014 INSERT IGNORE / ON CONFLICT DO NOTHING). Dialect: ${dialect}.`,
13509
+ "-- Gi\u1EA3 thuy\u1EBFt \u0111\u1ECDc t\u1EEB:",
13510
+ ...evidenceLines,
13511
+ "",
13512
+ ...statements,
13513
+ ""
13514
+ ].join("\n");
13515
+ };
13516
+ SEED_AUDIT_SENTINEL = "pentest-seed";
13517
+ AUDIT_FIELD_RE = /@(CreatedBy|LastModifiedBy)\s*@Column\s*\(([^)]*)\)\s*private\s+String\s+[A-Za-z_]\w*\s*;/g;
13518
+ CLASS_DECL_RE = /\b(?:class|interface|enum)\s+([A-Za-z_]\w*)/g;
13519
+ TABLE_RE = /@Table\s*\([^)]*?name\s*=\s*"([A-Za-z_]\w*)"/;
13520
+ EXTENDS_RE = /\bextends\s+([A-Za-z_]\w*)/;
13521
+ NULLABLE_FALSE_RE = /nullable\s*=\s*false/;
13522
+ LENGTH_RE = /\blength\s*=\s*(\d+)/;
13523
+ stripJavaComments = (src) => src.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/\/\/[^\n]*/g, " ");
13524
+ group = (m, i) => m[i] ?? "";
13525
+ detectSeedAuditColumns = (files) => {
13526
+ const auditByClass = /* @__PURE__ */ new Map();
13527
+ const tableByClass = /* @__PURE__ */ new Map();
13528
+ const superByClass = /* @__PURE__ */ new Map();
13529
+ for (const file of files) {
13530
+ if (!file.path.endsWith(".java")) continue;
13531
+ const src = stripJavaComments(file.content);
13532
+ const classNames = [];
13533
+ for (const m of src.matchAll(CLASS_DECL_RE)) {
13534
+ const name = group(m, 1);
13535
+ if (name !== "") classNames.push(name);
13536
+ }
13537
+ const auditFields = [];
13538
+ for (const m of src.matchAll(AUDIT_FIELD_RE)) {
13539
+ const args = group(m, 2);
13540
+ if (!NULLABLE_FALSE_RE.test(args)) continue;
13541
+ const columnMatch = /name\s*=\s*"([A-Za-z_]\w*)"/.exec(args);
13542
+ if (columnMatch === null) continue;
13543
+ const column = group(columnMatch, 1);
13544
+ if (column === "") continue;
13545
+ const lengthMatch = LENGTH_RE.exec(args);
13546
+ const length = lengthMatch !== null ? Number.parseInt(group(lengthMatch, 1), 10) : void 0;
13547
+ auditFields.push({ column, length });
13548
+ }
13549
+ if (classNames.length > 0 && auditFields.length > 0) {
13550
+ for (const cls of classNames) auditByClass.set(cls, auditFields);
13551
+ }
13552
+ const tableMatch = TABLE_RE.exec(src);
13553
+ if (tableMatch !== null && classNames.length > 0) {
13554
+ const table = group(tableMatch, 1);
13555
+ if (table !== "") tableByClass.set(classNames[0] ?? "", table);
13556
+ }
13557
+ const extendsMatch = EXTENDS_RE.exec(src);
13558
+ if (extendsMatch !== null && classNames.length > 0) {
13559
+ const sup = group(extendsMatch, 1);
13560
+ if (sup !== "") superByClass.set(classNames[0] ?? "", sup);
13561
+ }
13562
+ }
13563
+ const out = /* @__PURE__ */ new Map();
13564
+ for (const [cls, table] of tableByClass) {
13565
+ const seen = /* @__PURE__ */ new Set([cls]);
13566
+ let current = cls;
13567
+ for (let depth = 0; current !== void 0 && depth <= 5; depth += 1) {
13568
+ const fields = auditByClass.get(current);
13569
+ if (fields !== void 0) {
13570
+ for (const f of fields) {
13571
+ const key = `${table}\0${f.column}`;
13572
+ if (out.has(key)) continue;
13573
+ out.set(key, {
13574
+ table,
13575
+ column: f.column,
13576
+ value: f.length !== void 0 && f.length > 0 ? SEED_AUDIT_SENTINEL.slice(0, f.length) : SEED_AUDIT_SENTINEL
13577
+ });
13578
+ }
13579
+ }
13580
+ const sup = superByClass.get(current);
13581
+ if (sup === void 0 || seen.has(sup)) break;
13582
+ seen.add(sup);
13583
+ current = sup;
13584
+ }
13585
+ }
13586
+ return [...out.values()].sort(
13587
+ (a, b) => a.table === b.table ? a.column.localeCompare(b.column) : a.table.localeCompare(b.table)
13588
+ );
13589
+ };
13590
+ applySeedAuditColumns = (hypothesis, audit) => {
13591
+ if (audit.length === 0) return hypothesis;
13592
+ const byTable = /* @__PURE__ */ new Map();
13593
+ for (const c of audit) {
13594
+ const bucket = byTable.get(c.table);
13595
+ if (bucket) bucket.push(c);
13596
+ else byTable.set(c.table, [c]);
13597
+ }
13598
+ let changed = false;
13599
+ const targets = hypothesis.targets.map((t) => {
13600
+ const cols = byTable.get(t.table);
13601
+ if (cols === void 0) return t;
13602
+ let targetChanged = false;
13603
+ const rows = t.rows.map((row2) => {
13604
+ let rowColumns = row2.columns;
13605
+ for (const c of cols) {
13606
+ if (c.column in rowColumns) continue;
13607
+ rowColumns = { ...rowColumns, [c.column]: c.value };
13608
+ targetChanged = true;
13609
+ }
13610
+ return rowColumns === row2.columns ? row2 : { columns: rowColumns };
13611
+ });
13612
+ if (!targetChanged) return t;
13613
+ changed = true;
13614
+ return { ...t, rows };
13615
+ });
13616
+ return changed ? { ...hypothesis, targets } : hypothesis;
13617
+ };
13618
+ seedAuditAddedColumns = (before, after) => {
13619
+ const seen = /* @__PURE__ */ new Set();
13620
+ for (const t of after.targets) {
13621
+ const prev = before.targets.find((v) => v.table === t.table);
13622
+ if (prev === void 0) continue;
13623
+ const prevKeys = new Set(prev.rows.flatMap((r) => Object.keys(r.columns)));
13624
+ const nowKeys = new Set(t.rows.flatMap((r) => Object.keys(r.columns)));
13625
+ for (const k of nowKeys) {
13626
+ if (!prevKeys.has(k)) seen.add(`${k}\u2192${t.table}`);
13627
+ }
13628
+ }
13629
+ return [...seen];
13630
+ };
13236
13631
  REACHABILITY_MANIFEST_SCHEMA_VERSION = 1;
13237
13632
  MANIFEST_NOTE = "This manifest LISTS the pre-existing state each endpoint needs to be REACHABLE (a seeded row for a path id, a valid body payload) plus its auth/authz evidence. It does NOT seed anything: schema and entity relationships cannot be inferred from a controller signature, so provisioning stays a human/workflow step (ADR-0065 \xA7D1). Auth/authz fields are EVIDENCE, never a verdict \u2014 an empty annotation list does not mean the route is open.";
13238
13633
  SCALAR_JAVA_TYPES = /* @__PURE__ */ new Set([
@@ -14021,7 +14416,7 @@ ${edgePart}`);
14021
14416
  if (isEndpointShaped(v)) return `http://${A_SENTINEL}`;
14022
14417
  return A_SENTINEL;
14023
14418
  };
14024
- RELAXED_ENV = (path2) => path2.replace(/[.-]/g, "_").toUpperCase();
14419
+ RELAXED_ENV = (path2) => path2.replace(/\./g, "_").replace(/-/g, "").toUpperCase();
14025
14420
  envKeyFor = (varName) => /^[A-Za-z_][A-Za-z0-9_]*$/.test(varName) ? varName : RELAXED_ENV(varName);
14026
14421
  buildSidecars = (db) => ({
14027
14422
  database: {
@@ -14357,6 +14752,12 @@ ${edgePart}`);
14357
14752
  SPRING_CLOUD_CONSUL_CONFIG_ENABLED: "false"
14358
14753
  };
14359
14754
  for (const [k, v] of Object.entries(remoteDisables)) if (!(k in env)) env[k] = v;
14755
+ const appNamesDdlAuto = boot.bootBlockers.some(
14756
+ (b) => /(?:^|\.)ddl-auto$/.test(b.path) || /(?:^|\.)hbm2ddl\.auto$/.test(b.path)
14757
+ );
14758
+ if (!("SPRING_JPA_PROPERTIES_HIBERNATE_HBM2DDL_AUTO" in env) && !appNamesDdlAuto) {
14759
+ env.SPRING_JPA_PROPERTIES_HIBERNATE_HBM2DDL_AUTO = "update";
14760
+ }
14360
14761
  const wired = [...placeholders.keys()].filter((k) => wiredKeys.has(k)).length;
14361
14762
  const dummied = placeholders.size - wired;
14362
14763
  const deviations = [
@@ -14383,6 +14784,9 @@ ${edgePart}`);
14383
14784
  `${dummied} unmatched placeholder(s) set to a type-guessed dummy (\`${A_SENTINEL}\` / 0 / 10 / 30000 / false by name) \u2014 REACHABILITY only: a bean that eagerly connects with one still fails at boot, honestly.`
14384
14785
  );
14385
14786
  deviations.push(...conflicts);
14787
+ deviations.push(
14788
+ "Schema provisioning: SPRING_JPA_PROPERTIES_HIBERNATE_HBM2DDL_AUTO=update \u2014 tables the service's own migration set does not create are generated by Hibernate from its entities (a no-op when the app does not use JPA or binds its SessionFactory in code). The sandbox schema is Hibernate-assisted, NOT the production one."
14789
+ );
14386
14790
  return {
14387
14791
  env,
14388
14792
  deviations,
@@ -14579,7 +14983,9 @@ ${edgePart}`);
14579
14983
  const len = bytes.readUInt16BE(p);
14580
14984
  p += 2;
14581
14985
  if (p + len > bytes.length) return out;
14582
- out.push(bytes.toString("utf8", p, p + len).replace(/[]/g, "{}"));
14986
+ out.push(
14987
+ bytes.toString("utf8", p, p + len).replaceAll("", "{}").replaceAll("", "{}")
14988
+ );
14583
14989
  p += len;
14584
14990
  break;
14585
14991
  }
@@ -15798,30 +16204,30 @@ ${todos.join("\n")}` : "";
15798
16204
  const placeholders = plan.boot.bootBlockers.filter(
15799
16205
  (b) => b.kind === "unresolved-placeholder" && b.varName !== void 0
15800
16206
  );
15801
- for (const [varName, group] of groupBy(placeholders, (b) => b.varName ?? "")) {
16207
+ for (const [varName, group2] of groupBy(placeholders, (b) => b.varName ?? "")) {
15802
16208
  if (varName === "") continue;
15803
- const { evidence: evidence19, omitted } = capEvidence(group.map(blockerEvidence));
16209
+ const { evidence: evidence19, omitted } = capEvidence(group2.map(blockerEvidence));
15804
16210
  const isPropertyRef = varName.includes(".");
15805
16211
  out.push({
15806
16212
  id: `config-value:${varName}`,
15807
16213
  category: "config-value",
15808
16214
  severity: "substituted",
15809
16215
  tierUnlocked: "T2",
15810
- whatWeNeed: isPropertyRef ? `X\xE1c nh\u1EADn property \`${varName}\` c\xF3 \u0111\u01B0\u1EE3c \u0111\u1ECBnh ngh\u0129a trong config kh\xF4ng (d\xF9ng \u1EDF ${group.length} n\u01A1i).${totalSuffix(group.length, omitted)}` : `Gi\xE1 tr\u1ECB cho bi\u1EBFn m\xF4i tr\u01B0\u1EDDng \`${varName}\` (d\xF9ng \u1EDF ${group.length} property).${totalSuffix(group.length, omitted)}`,
16216
+ whatWeNeed: isPropertyRef ? `X\xE1c nh\u1EADn property \`${varName}\` c\xF3 \u0111\u01B0\u1EE3c \u0111\u1ECBnh ngh\u0129a trong config kh\xF4ng (d\xF9ng \u1EDF ${group2.length} n\u01A1i).${totalSuffix(group2.length, omitted)}` : `Gi\xE1 tr\u1ECB cho bi\u1EBFn m\xF4i tr\u01B0\u1EDDng \`${varName}\` (d\xF9ng \u1EDF ${group2.length} property).${totalSuffix(group2.length, omitted)}`,
15811
16217
  whyItBlocks: isPropertyRef ? "T\xEAn c\xF3 d\u1EA5u ch\u1EA5m \u21D2 \u0111\xE2y l\xE0 THAM CHI\u1EBEU PROPERTY c\u1EE7a Spring, kh\xF4ng ph\u1EA3i bi\u1EBFn m\xF4i tr\u01B0\u1EDDng: Spring t\u1EF1 gi\u1EA3i n\xF3 t\u1EEB ch\xEDnh config n\u1EBFu property \u0111\xF3 t\u1ED3n t\u1EA1i. C\xF4ng c\u1EE5 li\u1EC7t k\xEA v\xEC n\xF3 kh\xF4ng c\xF3 default; n\u1EBFu property \u0111\xE3 \u0111\u01B0\u1EE3c \u0111\u1ECBnh ngh\u0129a th\xEC KH\xD4NG c\u1EA7n g\u1EEDi g\xEC c\u1EA3." : "Placeholder kh\xF4ng c\xF3 default th\xEC Spring d\u1EEBng ngay khi bind. C\xF4ng c\u1EE5 \u0110\xC3 \u0111i\u1EC1n m\u1ED9t gi\xE1 tr\u1ECB theo h\xECnh d\u1EA1ng v\u1ECB tr\xED c\u1EE7a n\xF3, n\xEAn boot v\u1EABn \u0111\u01B0\u1EE3c th\u1EED \u2014 nh\u01B0ng m\u1ED9t bean n\u1ED1i eager s\u1EBD ch\u1EBFt v\u1EDBi gi\xE1 tr\u1ECB gi\u1EA3, v\xE0 ch\u1EC9 l\xFAc ch\u1EA1y m\u1EDBi bi\u1EBFt.",
15812
16218
  evidence: evidence19,
15813
16219
  howToProvide: isPropertyRef ? `N\u1EBFu property ch\u01B0a c\xF3, \u0111\u1EB7t \`values.${varName}\` trong \`code-sentinel-runtime.yaml\`; n\u1EBFu \u0111\xE3 c\xF3 th\xEC b\u1ECF qua d\xF2ng n\xE0y.` : `\u0110\u1EB7t \`values.${varName}\` trong \`code-sentinel-runtime.yaml\`. Gi\xE1 tr\u1ECB d\xF9ng-m\u1ED9t-l\u1EA7n l\xE0 \u0111\u1EE7; n\xF3 kh\xF4ng r\u1EDDi sandbox v\xE0 kh\xF4ng v\xE0o b\xE1o c\xE1o.`
15814
16220
  });
15815
16221
  }
15816
16222
  const encrypted = plan.boot.bootBlockers.filter((b) => b.kind === "encrypted-value");
15817
- for (const [path2, group] of groupBy(encrypted, (b) => b.path === "" ? b.key : b.path)) {
15818
- const { evidence: evidence19, omitted } = capEvidence(group.map(blockerEvidence));
16223
+ for (const [path2, group2] of groupBy(encrypted, (b) => b.path === "" ? b.key : b.path)) {
16224
+ const { evidence: evidence19, omitted } = capEvidence(group2.map(blockerEvidence));
15819
16225
  out.push({
15820
16226
  id: `secret-value:${path2}`,
15821
16227
  category: "secret-value",
15822
16228
  severity: "substituted",
15823
16229
  tierUnlocked: "T2",
15824
- whatWeNeed: `Gi\xE1 tr\u1ECB PLAINTEXT d\xF9ng-m\u1ED9t-l\u1EA7n cho \`${path2}\` (\u0111ang l\xE0 \`ENC(...)\` jasypt).${totalSuffix(group.length, omitted)}`,
16230
+ whatWeNeed: `Gi\xE1 tr\u1ECB PLAINTEXT d\xF9ng-m\u1ED9t-l\u1EA7n cho \`${path2}\` (\u0111ang l\xE0 \`ENC(...)\` jasypt).${totalSuffix(group2.length, omitted)}`,
15825
16231
  whyItBlocks: "Kh\xF4ng c\xF3 m\u1EADt kh\u1EA9u jasypt th\xEC kh\xF4ng gi\u1EA3i m\xE3 \u0111\u01B0\u1EE3c, v\xE0 m\u1EADt kh\u1EA9u \u0111\xF3 kh\xF4ng n\u1EB1m trong archive \u2014 \u0111\xE2y l\xE0 gi\u1EDBi h\u1EA1n TH\xD4NG TIN, kh\xF4ng ph\u1EA3i gi\u1EDBi h\u1EA1n c\xF4ng c\u1EE5. C\xF4ng c\u1EE5 \u0110\xC3 thay b\u1EB1ng sentinel (ho\u1EB7c \u0111\u1ECBa ch\u1EC9 sidecar n\u1EBFu property n\xE0y l\xE0 endpoint datastore), n\xEAn boot v\u1EABn \u0111\u01B0\u1EE3c th\u1EED; gi\xE1 tr\u1ECB th\u1EADt ch\u1EC9 c\u1EA7n khi bean n\u1ED1i eager t\u1EDBi \u0111\xFAng ch\u1ED7 \u0111\xF3.",
15826
16232
  evidence: evidence19,
15827
16233
  howToProvide: `\u0110\u1EB7t \`values.${path2}\` (gi\xE1 tr\u1ECB t\u1EA1m, tr\u1ECF v\xE0o sidecar d\xF9ng-m\u1ED9t-l\u1EA7n l\xE0 \u0111\u01B0\u1EE3c), HO\u1EB6C c\u1EA5p m\u1EADt kh\u1EA9u jasypt qua \`values.jasypt.encryptor.password\`.`
@@ -18622,9 +19028,9 @@ ${methods.join("\n\n")}
18622
19028
  });
18623
19029
  continue;
18624
19030
  }
18625
- const group = byChecklist.get(scenario.checklistId) ?? [];
18626
- for (const route of routes) group.push({ scenario, route });
18627
- byChecklist.set(scenario.checklistId, group);
19031
+ const group2 = byChecklist.get(scenario.checklistId) ?? [];
19032
+ for (const route of routes) group2.push({ scenario, route });
19033
+ byChecklist.set(scenario.checklistId, group2);
18628
19034
  }
18629
19035
  const tests = [...byChecklist.entries()].sort(([a], [b]) => Number(a) - Number(b)).map(([checklistId, pairs]) => {
18630
19036
  const sorted = [...pairs].sort(
@@ -18926,6 +19332,7 @@ ${methods.join("\n\n")}
18926
19332
  }));
18927
19333
  return { packets, meta, ...unassessed !== void 0 ? { unassessed } : {} };
18928
19334
  };
19335
+ OBJECT_STORE_PROBE_SINKS = /* @__PURE__ */ new Set(["spring/minio-object"]);
18929
19336
  GENERATED_PACKAGE = "com.codesentinel.generated.pentest";
18930
19337
  SERVER_CLASSES = /* @__PURE__ */ new Set([
18931
19338
  "sql-injection",
@@ -19043,17 +19450,55 @@ ${methods.join("\n\n")}
19043
19450
  };
19044
19451
  javaStr = (s) => s.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
19045
19452
  BENIGN_SEED = "1";
19453
+ BUCKET_BENIGN_SEED = "pentest-bucket";
19454
+ benignSeedFor = (paramName2) => /bucket/i.test(paramName2) ? BUCKET_BENIGN_SEED : BENIGN_SEED;
19046
19455
  renderAuthSuffix = (auth) => {
19047
19456
  if (!auth || auth.kind !== "authenticated") return "";
19048
19457
  const roles = auth.roles && auth.roles.length > 0 ? auth.roles : ["USER"];
19049
19458
  const args = roles.map((r) => `"${javaStr(r)}"`).join(", ");
19050
19459
  return `.with(user("pentest").roles(${args}))`;
19051
19460
  };
19461
+ RUNTIME_AUTH_SUFFIX = '.header("Authorization", "Bearer " + csRuntimeToken()).with(csServletPathFromUri())';
19462
+ renderRuntimeAuthHelper = (envVar) => [
19463
+ " /**",
19464
+ ` * ADR-0070: token runtime do pipeline mint qua bi\u1EBFn m\xF4i tr\u01B0\u1EDDng ${envVar}, g\u1EAFn v\xE0o M\u1ECCI`,
19465
+ " * request c\u1EE7a suite (baseline + attack). R\u1ED7ng/sai \u21D2 baseline b\u1ECB t\u1EEB ch\u1ED1i (4xx) \u21D2 test",
19466
+ " * skipped \u21D2 `not-tested` (\xA7D1). Suite KH\xD4NG t\u1EF1 mint v\xE0 KH\xD4NG bao gi\u1EDD in gi\xE1 tr\u1ECB token",
19467
+ " * (\xA7D1/#48).",
19468
+ " */",
19469
+ " private static String csRuntimeToken() {",
19470
+ ` String t = System.getenv("${javaStr(envVar)}");`,
19471
+ ' return t == null ? "" : t;',
19472
+ " }",
19473
+ "",
19474
+ " /**",
19475
+ " * ADR-0070 (MEASURED, E1 lane run ptr_mtlepy7l): MockMvc ch\u1EC9 set requestURI \u2014",
19476
+ " * getServletPath() r\u1ED7ng, v\xE0 filter ph\xE2n quy\u1EC1n ki\u1EC3u dvs (UserContextFilter \u2192",
19477
+ " * RedisAbstract.checkAccess) fail-closed khi path r\u1ED7ng \u21D2 403 d\xF9 token \u0111\xFAng. Helper",
19478
+ " * mirror requestURI (tr\u1EEB contextPath n\u1EBFu c\xF3) v\xE0o servletPath CH\u1EC8 KHI n\xF3 r\u1ED7ng \u2014",
19479
+ " * kh\xF4ng bao gi\u1EDD ghi \u0111\xE8 gi\xE1 tr\u1ECB container \u0111\xE3 set. Reachability-only (\xA7D1).",
19480
+ " */",
19481
+ " private static RequestPostProcessor csServletPathFromUri() {",
19482
+ " return request -> {",
19483
+ " MockHttpServletRequest req = (MockHttpServletRequest) request;",
19484
+ " if (req.getServletPath() == null || req.getServletPath().isEmpty()) {",
19485
+ " String uri = req.getRequestURI();",
19486
+ " String ctx = req.getContextPath();",
19487
+ " if (ctx != null && !ctx.isEmpty() && uri != null && uri.startsWith(ctx)) {",
19488
+ " uri = uri.substring(ctx.length());",
19489
+ " }",
19490
+ ' req.setServletPath(uri == null ? "" : uri);',
19491
+ " }",
19492
+ " return req;",
19493
+ " };",
19494
+ " }"
19495
+ ].join("\n");
19052
19496
  pascal = (slug) => slug.split(/[-_]/).filter((p) => p.length > 0).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join("");
19053
19497
  camel2 = (slug) => {
19054
19498
  const p = pascal(slug);
19055
19499
  return p.charAt(0).toLowerCase() + p.slice(1);
19056
19500
  };
19501
+ verificationTestClassName = (vulnerabilityClass, checklistId) => `${pascal(vulnerabilityClass)}${checklistId}VerificationTest`;
19057
19502
  identChunk = (raw) => {
19058
19503
  const parts = raw.replace(/\{[^}]*\}/g, " ").split(/[^A-Za-z0-9]+/).filter((p) => p.length > 0).map((p) => p.charAt(0).toUpperCase() + p.slice(1));
19059
19504
  return parts.join("");
@@ -19063,19 +19508,26 @@ ${methods.join("\n\n")}
19063
19508
  if (/\{[^}]+\}/.test(path2)) return path2.replace(/\{[^}]+\}/, encoded);
19064
19509
  return `${path2.replace(/\/$/, "")}/${encoded}`;
19065
19510
  };
19066
- requestExpr = (method, path2, injection, payload) => {
19511
+ companionCalls = (companions) => companions.filter((c) => c.kind === "query" || c.kind === "header").map(
19512
+ (c) => c.kind === "query" ? `.param("${javaStr(c.name)}", "${javaStr(benignSeedFor(c.name))}")` : `.header("${javaStr(c.name)}", "${javaStr(benignSeedFor(c.name))}")`
19513
+ ).join("");
19514
+ requestExpr = (method, path2, injection, payload, companions = []) => {
19067
19515
  const m = `HttpMethod.${(method === "ANY" ? "GET" : method).toUpperCase()}`;
19516
+ const extra = companionCalls(companions);
19068
19517
  switch (injection.kind) {
19069
19518
  case "query":
19070
19519
  return {
19071
- expr: `request(${m}, "${javaStr(path2)}").param("${javaStr(injection.name)}", "${javaStr(payload)}")`,
19520
+ expr: `request(${m}, "${javaStr(path2)}").param("${javaStr(injection.name)}", "${javaStr(payload)}")${extra}`,
19072
19521
  usesMediaType: false
19073
19522
  };
19074
19523
  case "path":
19075
- return { expr: `request(${m}, "${javaStr(fillPath(path2, payload))}")`, usesMediaType: false };
19524
+ return {
19525
+ expr: `request(${m}, "${javaStr(fillPath(path2, payload))}")${extra}`,
19526
+ usesMediaType: false
19527
+ };
19076
19528
  case "header":
19077
19529
  return {
19078
- expr: `request(${m}, "${javaStr(path2)}").header("${javaStr(injection.name)}", "${javaStr(payload)}")`,
19530
+ expr: `request(${m}, "${javaStr(path2)}").header("${javaStr(injection.name)}", "${javaStr(payload)}")${extra}`,
19079
19531
  usesMediaType: false
19080
19532
  };
19081
19533
  case "body":
@@ -19090,7 +19542,7 @@ ${methods.join("\n\n")}
19090
19542
  isVerifiable = (s) => SERVER_CLASSES.has(s.vulnerabilityClass) && s.path !== null && s.injectionPoint !== null;
19091
19543
  SERVER_SKIP_REASON = "Kh\xF4ng gi\u1EA3i \u0111\u01B0\u1EE3c HTTP entry point / injection point cho sink \u2014 ki\u1EC3m tra th\u1EE7 c\xF4ng (kh\xF4ng sinh \u0111\u01B0\u1EE3c MockMvc request).";
19092
19544
  renderBooleanBlind = (s, path2, injection, authSuffix) => {
19093
- const capture = (payload) => `mockMvc.perform(${requestExpr(s.httpMethod, path2, injection, payload).expr}${authSuffix}).andReturn().getResponse().getContentAsString()`;
19545
+ const capture = (payload) => `mockMvc.perform(${requestExpr(s.httpMethod, path2, injection, payload, s.companionParams ?? []).expr}${authSuffix}).andReturn().getResponse().getContentAsString()`;
19094
19546
  const lines = [
19095
19547
  " // E1.7 ([ADR-0041]): boolean-based blind SQLi \u2014 vi sai 3 ph\u1EA3n h\u1ED3i qua canon()",
19096
19548
  " // (\u0111i\u1EC1u ki\u1EC7n lu\xF4n-\u0111\xFAng KH\u1EDAP baseline l\xE0nh, lu\xF4n-sai KH\xC1C \u21D2 WHERE b\u1ECB thao t\xFAng)."
@@ -19113,7 +19565,13 @@ ${methods.join("\n\n")}
19113
19565
  return lines;
19114
19566
  };
19115
19567
  renderCanary = (s, path2, injection, authSuffix, canary) => {
19116
- const expr = requestExpr(s.httpMethod, path2, injection, canary.payload).expr;
19568
+ const expr = requestExpr(
19569
+ s.httpMethod,
19570
+ path2,
19571
+ injection,
19572
+ canary.payload,
19573
+ s.companionParams ?? []
19574
+ ).expr;
19117
19575
  const marker = javaStr(canary.reflected);
19118
19576
  return [
19119
19577
  ` // E1.7 ([ADR-0041]): canary ph\u1EA3n chi\u1EBFu ${canary.payload} \u2192 ${canary.reflected} (${canary.note}).`,
@@ -19123,16 +19581,73 @@ ${methods.join("\n\n")}
19123
19581
  ` "Ph\u1EA3n h\u1ED3i ch\u1EE9a k\u1EBFt qu\u1EA3 ${canary.payload}=${canary.reflected} (kh\xF4ng c\xF3 \u1EDF baseline) \u2014 bi\u1EC3u th\u1EE9c \u0111\xE3 \u0111\u01B0\u1EE3c \u0110\xC1NH GI\xC1 (SSTI) (#${s.checklistId}). X\xE1c nh\u1EADn th\u1EE7 c\xF4ng.");`
19124
19582
  ];
19125
19583
  };
19126
- renderMethod2 = (s, methodName, fill) => {
19584
+ isObjectStoreProbeSink = (s) => s.sinkId !== void 0 && OBJECT_STORE_PROBE_SINKS.has(s.sinkId);
19585
+ OBJECT_STORE_REJECT_CATCH_LINES = (checklistId) => [
19586
+ " } catch (Exception rejected) {",
19587
+ " // [ADR-0071 \xA7Validation] payload traversal l\xE0 bucket name b\u1EA5t h\u1EE3p l\u1EC7 v\u1EC1 c\u1EA5u tr\xFAc \u2014",
19588
+ " // SDK MinIO/S3 t\u1EEB ch\u1ED1i CLIENT-SIDE (IllegalArgumentException) tr\u01B0\u1EDBc m\u1ECDi network I/O.",
19589
+ ` // \u0110\u1ECDc nh\u01B0 "attack b\u1ECB reject" (kh\xF4ng ph\u1EA3i crash) \u0111\u1EC3 testcase pass v\xE0 probe canary #${checklistId}`,
19590
+ " // b\u1EAFn \u0111\u01B0\u1EE3c; exception kh\xE1c (infra/app bug th\u1EADt) rethrow \u21D2 `<error` \u21D2 probe fail-closed.",
19591
+ " boolean clientSideReject = false;",
19592
+ " for (Throwable c = rejected; c != null; c = c.getCause()) {",
19593
+ " if (c instanceof java.lang.IllegalArgumentException) { clientSideReject = true; break; }",
19594
+ " }",
19595
+ " if (!clientSideReject) throw rejected;"
19596
+ ];
19597
+ wrapObjectStoreAttackGuard = (lines, checklistId) => {
19598
+ const start = lines.findIndex((line) => line.startsWith(" mockMvc.perform("));
19599
+ if (start < 0) return lines;
19600
+ const end = lines.indexOf(" });", start);
19601
+ if (end < 0) return lines;
19602
+ return [
19603
+ ...lines.slice(0, start),
19604
+ " try {",
19605
+ ...lines.slice(start, end + 1).map((line) => ` ${line}`),
19606
+ ...OBJECT_STORE_REJECT_CATCH_LINES(checklistId),
19607
+ " }",
19608
+ ...lines.slice(end + 1)
19609
+ ];
19610
+ };
19611
+ wrapObjectStoreEvidenceAttackGuard = (lines, checklistId) => {
19612
+ const start = lines.findIndex(
19613
+ (line) => line.startsWith(" MvcResult attackResult = mockMvc.perform(")
19614
+ );
19615
+ if (start < 0) return lines;
19616
+ const inner = lines.slice(start, start + 3).map(
19617
+ (line) => line.replace(/^ {8}int attackStatus = /, " attackStatus = ").replace(/^ {8}String attackBody = /, " attackBody = ").replace(/^/, " ")
19618
+ );
19619
+ return [
19620
+ ...lines.slice(0, start),
19621
+ " int attackStatus;",
19622
+ " String attackBody;",
19623
+ " try {",
19624
+ ...inner,
19625
+ ...OBJECT_STORE_REJECT_CATCH_LINES(checklistId),
19626
+ " // Ghi nh\u01B0 validation-reject: attack b\u1ECB SDK ch\u1EB7n TR\u01AF\u1EDAC khi ch\u1EA1m store \u2014 400",
19627
+ ' // (kh\xF4ng ph\u1EA3i 5xx) \u21D2 noCrash=true, negative \u0111\xFAng ngh\u0129a "\u0111\xE3 t\u1EEB ch\u1ED1i", envelope v\u1EABn ghi.',
19628
+ " attackStatus = 400;",
19629
+ ' attackBody = "";',
19630
+ " }",
19631
+ ...lines.slice(start + 3)
19632
+ ];
19633
+ };
19634
+ renderMethod2 = (s, methodName, fill, runtimeAuth) => {
19127
19635
  const path2 = s.path;
19128
19636
  const injection = s.injectionPoint;
19129
19637
  const payload = s.payloads[0] ?? "";
19130
- const attack = requestExpr(s.httpMethod, path2, injection, payload);
19131
- const baseline = requestExpr(s.httpMethod, path2, injection, BENIGN_SEED);
19132
- const authSuffix = fill?.suffix ?? renderAuthSuffix(s.authContext);
19638
+ const attack = requestExpr(s.httpMethod, path2, injection, payload, s.companionParams ?? []);
19639
+ const baseline = requestExpr(
19640
+ s.httpMethod,
19641
+ path2,
19642
+ injection,
19643
+ benignSeedFor(injection.name),
19644
+ s.companionParams ?? []
19645
+ );
19646
+ const authSuffix = fill?.suffix ?? (runtimeAuth !== void 0 ? RUNTIME_AUTH_SUFFIX : renderAuthSuffix(s.authContext));
19133
19647
  const hasAuth = authSuffix !== "";
19134
19648
  const usesFillSuffix = fill?.suffix !== void 0;
19135
- const usesSecurity = hasAuth && !usesFillSuffix;
19649
+ const usesRuntimeAuth = !usesFillSuffix && runtimeAuth !== void 0;
19650
+ const usesSecurity = hasAuth && !usesFillSuffix && !usesRuntimeAuth;
19136
19651
  const fillImports = usesFillSuffix ? fill?.imports ?? [] : [];
19137
19652
  const usesMediaType = attack.usesMediaType || baseline.usesMediaType;
19138
19653
  const others = s.payloads.slice(1);
@@ -19143,8 +19658,8 @@ ${methods.join("\n\n")}
19143
19658
  const contentLine = oracle !== void 0 ? `
19144
19659
  * n\u1ED9i dung: FAIL n\u1EBFu body T\u1EA4N C\xD4NG l\u1ED9 [${oracle.leakMarkers.join(" | ")}] m\xE0 baseline l\xE0nh KH\xD4NG c\xF3 (${oracle.note})` : "";
19145
19660
  const roleCount = s.authContext?.roles?.length ?? 0;
19146
- const authNote = hasAuth ? usesFillSuffix ? "\n * Auth: principal qua auth-fill LLM slot-fill (ADR-0045) \u2014 E1.5 t\u1EA5t \u0111\u1ECBnh ch\u01B0a suy \u0111\u01B0\u1EE3c (vd @VauthzCheck/OAuth2). Fill sai \u21D2 baseline 4xx \u21D2 not-tested (\xA7D1)." : `
19147
- * Auth: principal \`pentest\`${roleCount > 0 ? ` roles ${s.authContext?.roles?.join("/")}` : " role USER (suy \u0111o\xE1n)"} \u2014 endpoint c\xF3 authz annotation (E1.5).` : "";
19661
+ const authNote = !hasAuth ? "" : usesFillSuffix ? "\n * Auth: principal qua auth-fill LLM slot-fill (ADR-0045) \u2014 E1.5 t\u1EA5t \u0111\u1ECBnh ch\u01B0a suy \u0111\u01B0\u1EE3c (vd @VauthzCheck/OAuth2). Fill sai \u21D2 baseline 4xx \u21D2 not-tested (\xA7D1)." : usesRuntimeAuth ? "\n * Auth: Bearer runtime (ADR-0070) \u2014 token TH\u1EACT t\u1EEB $CS_RUNTIME_TOKEN do pipeline mint; r\u1ED7ng/sai \u21D2 baseline 4xx \u21D2 not-tested (\xA7D1)." : `
19662
+ * Auth: principal \`pentest\`${roleCount > 0 ? ` roles ${s.authContext?.roles?.join("/")}` : " role USER (suy \u0111o\xE1n)"} \u2014 endpoint c\xF3 authz annotation (E1.5).`;
19148
19663
  const contentAssertions = oracle === void 0 ? [] : [
19149
19664
  " String body = result.getResponse().getContentAsString();",
19150
19665
  ...oracle.leakMarkers.flatMap((marker) => [
@@ -19164,7 +19679,7 @@ ${methods.join("\n\n")}
19164
19679
  const canary = hasOracle ? CLASS_CANARY[s.vulnerabilityClass] : void 0;
19165
19680
  const canaryLines = canary ? renderCanary(s, path2, injection, authSuffix, canary) : [];
19166
19681
  const usesCanon = blindLines.length > 0;
19167
- const code = [
19682
+ const codeLines = [
19168
19683
  " /**",
19169
19684
  ` * #${s.checklistId} ${s.title}`,
19170
19685
  ` * Sink: ${s.sinkFile}:${s.sinkLine} \xB7 \u0111i\u1EC3m ti\xEAm: ${injection.kind} \`${injection.name}\``,
@@ -19190,19 +19705,27 @@ ${methods.join("\n\n")}
19190
19705
  ...blindLines,
19191
19706
  ...canaryLines,
19192
19707
  " }"
19193
- ].join("\n");
19708
+ ];
19709
+ const code = (isObjectStoreProbeSink(s) ? wrapObjectStoreAttackGuard(codeLines, s.checklistId) : codeLines).join("\n");
19194
19710
  return { code, usesMediaType, usesSecurity, usesMvcResult: hasOracle, usesCanon, fillImports };
19195
19711
  };
19196
- renderEvidenceMethod = (s, methodName, className, fill) => {
19712
+ renderEvidenceMethod = (s, methodName, className, fill, runtimeAuth) => {
19197
19713
  const path2 = s.path;
19198
19714
  const injection = s.injectionPoint;
19199
19715
  const payload = s.payloads[0] ?? "";
19200
- const attack = requestExpr(s.httpMethod, path2, injection, payload);
19201
- const baseline = requestExpr(s.httpMethod, path2, injection, BENIGN_SEED);
19202
- const authSuffix = fill?.suffix ?? renderAuthSuffix(s.authContext);
19716
+ const attack = requestExpr(s.httpMethod, path2, injection, payload, s.companionParams ?? []);
19717
+ const baseline = requestExpr(
19718
+ s.httpMethod,
19719
+ path2,
19720
+ injection,
19721
+ benignSeedFor(injection.name),
19722
+ s.companionParams ?? []
19723
+ );
19724
+ const authSuffix = fill?.suffix ?? (runtimeAuth !== void 0 ? RUNTIME_AUTH_SUFFIX : renderAuthSuffix(s.authContext));
19203
19725
  const hasAuth = authSuffix !== "";
19204
19726
  const usesFillSuffix = fill?.suffix !== void 0;
19205
- const usesSecurity = hasAuth && !usesFillSuffix;
19727
+ const usesRuntimeAuth = !usesFillSuffix && runtimeAuth !== void 0;
19728
+ const usesSecurity = hasAuth && !usesFillSuffix && !usesRuntimeAuth;
19206
19729
  const fillImports = usesFillSuffix ? fill?.imports ?? [] : [];
19207
19730
  const usesMediaType = attack.usesMediaType || baseline.usesMediaType;
19208
19731
  const oracle = CLASS_ORACLE[s.vulnerabilityClass];
@@ -19212,7 +19735,7 @@ ${methods.join("\n\n")}
19212
19735
  const usesBlind = BOOLEAN_BLIND_CLASSES.has(s.vulnerabilityClass);
19213
19736
  const blindLines = [];
19214
19737
  if (usesBlind) {
19215
- const cap = (pl2) => `mockMvc.perform(${requestExpr(s.httpMethod, path2, injection, pl2).expr}${authSuffix}).andReturn().getResponse().getContentAsString()`;
19738
+ const cap = (pl2) => `mockMvc.perform(${requestExpr(s.httpMethod, path2, injection, pl2, s.companionParams ?? []).expr}${authSuffix}).andReturn().getResponse().getContentAsString()`;
19216
19739
  const conds = [];
19217
19740
  for (const pair of BOOLEAN_BLIND_PAIRS) {
19218
19741
  const tVar = `blindTrue${pascal(pair.label)}`;
@@ -19228,7 +19751,13 @@ ${methods.join("\n\n")}
19228
19751
  const canary = CLASS_CANARY[s.vulnerabilityClass];
19229
19752
  const canaryLines = [];
19230
19753
  if (canary) {
19231
- const expr = requestExpr(s.httpMethod, path2, injection, canary.payload).expr;
19754
+ const expr = requestExpr(
19755
+ s.httpMethod,
19756
+ path2,
19757
+ injection,
19758
+ canary.payload,
19759
+ s.companionParams ?? []
19760
+ ).expr;
19232
19761
  const marker = javaStr(canary.reflected);
19233
19762
  canaryLines.push(
19234
19763
  ` String canaryBody = mockMvc.perform(${expr}${authSuffix}).andReturn().getResponse().getContentAsString();`
@@ -19240,7 +19769,13 @@ ${methods.join("\n\n")}
19240
19769
  const commandLines = [];
19241
19770
  if (s.vulnerabilityClass === "command-injection") {
19242
19771
  const probePayload = `${BENIGN_SEED}; echo ${COMMAND_CANARY}`;
19243
- const expr = requestExpr(s.httpMethod, path2, injection, probePayload).expr;
19772
+ const expr = requestExpr(
19773
+ s.httpMethod,
19774
+ path2,
19775
+ injection,
19776
+ probePayload,
19777
+ s.companionParams ?? []
19778
+ ).expr;
19244
19779
  commandLines.push(
19245
19780
  ` // slice #4: canary ph\u1EA3n chi\u1EBFu output l\u1EC7nh \u2014 '${COMMAND_CANARY}' trong body \u21D2 shell \u0111\xE3 ch\u1EA1y l\u1EC7nh ti\xEAm.`
19246
19781
  );
@@ -19252,7 +19787,7 @@ ${methods.join("\n\n")}
19252
19787
  const hasNegative = ORACLE_CATALOG[s.vulnerabilityClass]?.negativeOracleId !== void 0;
19253
19788
  const negExpr = !hasNegative ? "false" : VALIDATION_REJECT_CLASSES2.has(s.vulnerabilityClass) ? "baselineReached && attackStatus >= 400 && attackStatus < 500" : "baselineReached && noCrash && !positive";
19254
19789
  const scenarioId = `${className}::${methodName}`;
19255
- const code = [
19790
+ const codeLines = [
19256
19791
  " /**",
19257
19792
  ` * #${s.checklistId} ${s.title}`,
19258
19793
  ` * Sink: ${s.sinkFile}:${s.sinkLine} \xB7 \u0111i\u1EC3m ti\xEAm: ${injection.kind} \`${injection.name}\``,
@@ -19287,7 +19822,8 @@ ${methods.join("\n\n")}
19287
19822
  " Assertions.assertFalse(!noCrash || positive,",
19288
19823
  ` "T\u1EA5n c\xF4ng (#${s.checklistId}): crash 5xx HO\u1EB6C oracle d\u01B0\u01A1ng \u2014 nghi khai th\xE1c. Verdict chu\u1EA9n: cs verify --evidence. X\xE1c nh\u1EADn th\u1EE7 c\xF4ng.");`,
19289
19824
  " }"
19290
- ].join("\n");
19825
+ ];
19826
+ const code = (isObjectStoreProbeSink(s) ? wrapObjectStoreEvidenceAttackGuard(codeLines, s.checklistId) : codeLines).join("\n");
19291
19827
  return {
19292
19828
  code,
19293
19829
  usesMediaType,
@@ -19405,13 +19941,84 @@ ${methods.join("\n\n")}
19405
19941
  " return value;",
19406
19942
  " }"
19407
19943
  ].join("\n");
19408
- renderClass = (checklistId, scenarios, dbTier, dbRuntime = "testcontainers", authFills, emitEvidence = false, suiteHash = "", bootClass) => {
19944
+ javaSeedValue = (v) => {
19945
+ if (v === null) return "null";
19946
+ if (typeof v === "boolean") return v ? "true" : "false";
19947
+ if (typeof v === "number") {
19948
+ if (!Number.isFinite(v)) {
19949
+ throw new Error(
19950
+ "runtime-data-seed @BeforeAll render: non-finite number (firewall bypassed?)"
19951
+ );
19952
+ }
19953
+ return String(v);
19954
+ }
19955
+ return `"${javaStr(v)}"`;
19956
+ };
19957
+ renderSeedMethod = (targets) => {
19958
+ const updateLines = [];
19959
+ for (const target of targets) {
19960
+ if (target.rows.length === 0) {
19961
+ throw new Error("runtime-data-seed @BeforeAll render: zero-row target (firewall bypassed?)");
19962
+ }
19963
+ const table = isSqlIdentifier(target.table) ? target.table : (() => {
19964
+ throw new Error(
19965
+ "runtime-data-seed @BeforeAll render: invalid table (firewall bypassed?)"
19966
+ );
19967
+ })();
19968
+ for (const row2 of target.rows) {
19969
+ const columns = Object.keys(row2.columns).sort();
19970
+ if (columns.length === 0) {
19971
+ throw new Error(
19972
+ "runtime-data-seed @BeforeAll render: zero-column row (firewall bypassed?)"
19973
+ );
19974
+ }
19975
+ for (const column of columns) {
19976
+ if (!isSqlIdentifier(column)) {
19977
+ throw new Error(
19978
+ "runtime-data-seed @BeforeAll render: invalid column (firewall bypassed?)"
19979
+ );
19980
+ }
19981
+ }
19982
+ const sql2 = `INSERT INTO ${table} (${columns.join(", ")}) VALUES (${columns.map(() => "?").join(", ")})`;
19983
+ const args = columns.map((c) => {
19984
+ const v = row2.columns[c];
19985
+ if (v === void 0) {
19986
+ throw new Error(
19987
+ "runtime-data-seed @BeforeAll render: vanished column value (firewall bypassed?)"
19988
+ );
19989
+ }
19990
+ return javaSeedValue(v);
19991
+ }).join(", ");
19992
+ updateLines.push(
19993
+ ` jdbcTemplate.update("${javaStr(sql2)}"${args ? `, ${args}` : ""});`
19994
+ );
19995
+ }
19996
+ }
19997
+ return [
19998
+ " @BeforeAll",
19999
+ " static void csSeedData(@Autowired JdbcTemplate jdbcTemplate) {",
20000
+ " try {",
20001
+ ...updateLines.map(
20002
+ (line) => ` try {
20003
+ ${line}
20004
+ } catch (DuplicateKeyException csAlreadySeeded) {
20005
+ // idempotent: d\xF2ng \u0111\xE3 t\u1ED3n t\u1EA1i trong DB d\xF9ng m\u1ED9t l\u1EA7n (ADR-0070)
20006
+ }`
20007
+ ),
20008
+ " } catch (Exception csSeedFailure) {",
20009
+ " // seed h\u1ECFng \u21D2 baseline s\u1EBD kh\xF4ng reachable \u21D2 skip HONEST (kh\xF4ng ph\u1EA3i blocked)",
20010
+ ' Assumptions.abort("seedFailed: " + csSeedFailure);',
20011
+ " }",
20012
+ " }"
20013
+ ].join("\n");
20014
+ };
20015
+ renderClass = (checklistId, scenarios, dbTier, dbRuntime = "testcontainers", authFills, emitEvidence = false, suiteHash = "", bootClass, seedPlan, runtimeAuth) => {
19409
20016
  const vulnClass = scenarios[0]?.vulnerabilityClass ?? "injection";
19410
20017
  const catalogEntry = ORACLE_CATALOG[vulnClass];
19411
20018
  const positiveOracleId = catalogEntry?.positiveOracleId ?? `${vulnClass}.positive`;
19412
20019
  const negativeOracleId = catalogEntry?.negativeOracleId ?? `${vulnClass}.no-negative-oracle`;
19413
20020
  const useDbTier = vulnClass === "sql-injection" && dbTier !== void 0;
19414
- const className = `${pascal(vulnClass)}${checklistId}VerificationTest`;
20021
+ const className = verificationTestClassName(vulnClass, checklistId);
19415
20022
  const used = /* @__PURE__ */ new Set();
19416
20023
  let anyMediaType = false;
19417
20024
  let anySecurity = false;
@@ -19428,7 +20035,7 @@ ${methods.join("\n\n")}
19428
20035
  while (used.has(name)) name = `${base}_${i++}`;
19429
20036
  used.add(name);
19430
20037
  const fill = authFills?.get(authFillKey(s.httpMethod, s.path ?? ""));
19431
- const { code, usesMediaType, usesSecurity, usesMvcResult, usesCanon, fillImports } = emitEvidence ? renderEvidenceMethod(s, name, className, fill) : renderMethod2(s, name, fill);
20038
+ const { code, usesMediaType, usesSecurity, usesMvcResult, usesCanon, fillImports } = emitEvidence ? renderEvidenceMethod(s, name, className, fill, runtimeAuth) : renderMethod2(s, name, fill, runtimeAuth);
19432
20039
  for (const imp of fillImports) fillImportSet.add(imp);
19433
20040
  if (usesMediaType) anyMediaType = true;
19434
20041
  if (usesSecurity) anySecurity = true;
@@ -19444,6 +20051,11 @@ ${methods.join("\n\n")}
19444
20051
  sinkLine: s.sinkLine
19445
20052
  });
19446
20053
  }
20054
+ const seedKeys = new Set(scenarios.map((s) => dataSeedKey(s.httpMethod, s.path ?? "")));
20055
+ const classSeedTargets = seedPlan ? [...seedKeys].flatMap((k) => seedPlan.get(k) ?? []) : [];
20056
+ const anySeed = classSeedTargets.length > 0;
20057
+ const anyRuntimeAuth = runtimeAuth !== void 0;
20058
+ const runtimeAuthHelper = anyRuntimeAuth ? renderRuntimeAuthHelper(runtimeAuth.envVar) : "";
19447
20059
  const importLines = [
19448
20060
  "import org.junit.jupiter.api.Assertions;",
19449
20061
  "import org.junit.jupiter.api.Assumptions;",
@@ -19453,8 +20065,12 @@ ${methods.join("\n\n")}
19453
20065
  "import org.springframework.boot.test.context.SpringBootTest;",
19454
20066
  "import org.springframework.http.HttpMethod;",
19455
20067
  ...anyMediaType ? ["import org.springframework.http.MediaType;"] : [],
20068
+ // [ADR-0070]: runtime-auth rides with BOTH helpers (token + servletPath mirror) —
20069
+ // absent ⇒ byte-identical output (the isolation gate, like every E1 option).
20070
+ ...anyRuntimeAuth ? ["import org.springframework.mock.web.MockHttpServletRequest;"] : [],
19456
20071
  "import org.springframework.test.web.servlet.MockMvc;",
19457
20072
  ...anyMvcResult ? ["import org.springframework.test.web.servlet.MvcResult;"] : [],
20073
+ ...anyRuntimeAuth ? ["import org.springframework.test.web.servlet.request.RequestPostProcessor;"] : [],
19458
20074
  "import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.request;",
19459
20075
  ...anySecurity ? [
19460
20076
  "import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user;"
@@ -19467,6 +20083,12 @@ ${methods.join("\n\n")}
19467
20083
  "import org.testcontainers.junit.jupiter.Container;",
19468
20084
  "import org.testcontainers.junit.jupiter.Testcontainers;"
19469
20085
  ] : []
20086
+ ] : [],
20087
+ // [ADR-0070]: seed imports ride ONLY with a seed-bearing class (isolation gate).
20088
+ ...anySeed ? [
20089
+ "import org.junit.jupiter.api.BeforeAll;",
20090
+ "import org.springframework.dao.DuplicateKeyException;",
20091
+ "import org.springframework.jdbc.core.JdbcTemplate;"
19470
20092
  ] : []
19471
20093
  ];
19472
20094
  const extraImports = [...fillImportSet].filter((i) => !importLines.includes(i)).sort();
@@ -19478,6 +20100,9 @@ ${methods.join("\n\n")}
19478
20100
  ].join("\n");
19479
20101
  const dbTierFields = useDbTier && dbTier !== void 0 ? `${dbRuntime === "external" ? renderExternalDbTierFields(dbTier) : renderTestcontainersDbTierFields(dbTier)}
19480
20102
 
20103
+ ` : "";
20104
+ const seedBlock = anySeed ? `${renderSeedMethod(classSeedTargets)}
20105
+
19481
20106
  ` : "";
19482
20107
  const content = `package ${GENERATED_PACKAGE};
19483
20108
 
@@ -19498,7 +20123,11 @@ ${imports}
19498
20123
  * \u2014 c\u1EA7n \`spring-security-test\` tr\xEAn test classpath). Baseline b\u1ECB t\u1EEB ch\u1ED1i (4xx: auth
19499
20124
  * thi\u1EBFu/sai, route/binding sai) \u21D2 test skipped \u21D2 \`not-tested\`, KH\xD4NG ph\u1EA3i
19500
20125
  * \`blocked\` (\xA7D1). Endpoint d\xF9ng authz tu\u1EF3 bi\u1EBFn (vd \`@VauthzCheck\`) / OAuth2 /
19501
- * principal \u0111\u1EB7c th\xF9: ch\u1EC9nh slot auth cho kh\u1EDBp \u2014 ch\u01B0a kh\u1EDBp th\xEC honest \`not-tested\`.${emitEvidence ? `
20126
+ * principal \u0111\u1EB7c th\xF9: ch\u1EC9nh slot auth cho kh\u1EDBp \u2014 ch\u01B0a kh\u1EDBp th\xEC honest \`not-tested\`.${anyRuntimeAuth ? `
20127
+ *
20128
+ * ADR-0070 (runtime-auth): M\u1ECCI request (baseline + attack) g\u1EAFn \`Authorization: Bearer\` t\u1EEB
20129
+ * $CS_RUNTIME_TOKEN do pipeline mint \u2014 token TH\u1EACT \u0111i qua servlet filter (kh\xF4ng ph\u1EA3i principal
20130
+ * Spring Security Test). Token r\u1ED7ng/sai \u21D2 baseline 4xx \u21D2 test skipped \u21D2 \`not-tested\` (\xA7D1).` : ""}${emitEvidence ? `
19502
20131
  *
19503
20132
  * ADR-0049 (evidence mode, --emit-evidence): m\u1ED7i test c\xF2n ghi 1 evidence-envelope sidecar
19504
20133
  * (quan s\xE1t dual-run baseline+attack, provenance \`generated-test\`) v\xE0o $CODE_SENTINEL_EVIDENCE_DIR
@@ -19511,11 +20140,13 @@ class ${className} {
19511
20140
  ${dbTierFields} @Autowired
19512
20141
  private MockMvc mockMvc;
19513
20142
 
19514
- ${methods.join("\n\n")}${anyCanon ? `
20143
+ ${seedBlock}${methods.join("\n\n")}${anyCanon ? `
19515
20144
 
19516
20145
  ${CANON_HELPER}` : ""}${emitEvidence ? `
19517
20146
 
19518
- ${renderEvidenceHelpers(positiveOracleId, negativeOracleId, suiteHash)}` : ""}
20147
+ ${renderEvidenceHelpers(positiveOracleId, negativeOracleId, suiteHash)}` : ""}${anyRuntimeAuth ? `
20148
+
20149
+ ${runtimeAuthHelper}` : ""}
19519
20150
  }
19520
20151
  `;
19521
20152
  return {
@@ -19542,8 +20173,8 @@ ${renderEvidenceHelpers(positiveOracleId, negativeOracleId, suiteHash)}` : ""}
19542
20173
  const skipped = [];
19543
20174
  for (const s of scenarios) {
19544
20175
  if (isVerifiable(s)) {
19545
- const group = byChecklist.get(s.checklistId);
19546
- if (group) group.push(s);
20176
+ const group2 = byChecklist.get(s.checklistId);
20177
+ if (group2) group2.push(s);
19547
20178
  else byChecklist.set(s.checklistId, [s]);
19548
20179
  } else if (SERVER_CLASSES.has(s.vulnerabilityClass)) {
19549
20180
  skipped.push({
@@ -19555,15 +20186,17 @@ ${renderEvidenceHelpers(positiveOracleId, negativeOracleId, suiteHash)}` : ""}
19555
20186
  }
19556
20187
  const emitEvidence = options?.emitEvidence ?? false;
19557
20188
  const renderAll = (suiteHash) => [...byChecklist.entries()].sort(([a], [b]) => Number(a) - Number(b)).map(
19558
- ([checklistId, group]) => renderClass(
20189
+ ([checklistId, group2]) => renderClass(
19559
20190
  checklistId,
19560
- group,
20191
+ group2,
19561
20192
  options?.dbTier,
19562
20193
  options?.dbRuntime ?? "testcontainers",
19563
20194
  options?.authFills,
19564
20195
  emitEvidence,
19565
20196
  suiteHash,
19566
- options?.bootClass
20197
+ options?.bootClass,
20198
+ options?.seedPlan,
20199
+ options?.runtimeAuth
19567
20200
  )
19568
20201
  );
19569
20202
  const firstPass = renderAll("");
@@ -20313,13 +20946,13 @@ ${renderEvidenceHelpers(positiveOracleId, negativeOracleId, suiteHash)}` : ""}
20313
20946
  };
20314
20947
  DAST_PLAN_FILE = "code-sentinel-dast-plan.yaml";
20315
20948
  DAST_MANIFEST_FILE = "code-sentinel-dast.json";
20949
+ DAST_PROBE_SCRIPT_FILE = "code-sentinel-dast-probe.sh";
20950
+ PROBE_VICTIM_BUCKET_REF = "${CS_PROBE_VICTIM_BUCKET}";
20951
+ PROBE_CANARY_OBJECT_REF = "${CS_PROBE_CANARY_OBJECT}";
20952
+ PROBE_INJECTION_KINDS = /* @__PURE__ */ new Set(["query", "path"]);
20316
20953
  isScannable = (s) => ZAP_SCAN_RULES.has(s.vulnerabilityClass) && s.path !== null && s.injectionPoint !== null;
20317
20954
  skipReason = (s) => ZAP_SCAN_RULES.has(s.vulnerabilityClass) ? "Kh\xF4ng gi\u1EA3i \u0111\u01B0\u1EE3c HTTP entry point / injection point cho sink \u2014 ki\u1EC3m tra th\u1EE7 c\xF4ng (kh\xF4ng d\u1EF1ng \u0111\u01B0\u1EE3c ZAP scan target)." : "B\u1EC1 m\u1EB7t client-side (DOM/redirect/eval tr\xECnh duy\u1EC7t) \u2014 c\u1EA7n AJAX spider + tr\xECnh duy\u1EC7t, ngo\xE0i ph\u1EA1m vi ZAP active-scan targeted (E2.0).";
20318
20955
  yamlStr = (s) => `"${s.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
20319
- fillPath2 = (path2, value) => {
20320
- if (/\{[^}]+\}/.test(path2)) return path2.replace(/\{[^}]+\}/, value);
20321
- return `${path2.replace(/\/$/, "")}/${value}`;
20322
- };
20323
20956
  normMethod = (method) => method === "ANY" ? "GET" : method.toUpperCase();
20324
20957
  toTarget = (s) => {
20325
20958
  const scanRule = ZAP_SCAN_RULES.get(s.vulnerabilityClass);
@@ -20330,34 +20963,59 @@ ${renderEvidenceHelpers(positiveOracleId, negativeOracleId, suiteHash)}` : ""}
20330
20963
  httpMethod: normMethod(s.httpMethod),
20331
20964
  path: s.path,
20332
20965
  injectionPoint: s.injectionPoint,
20966
+ ...s.companionParams && s.companionParams.length > 0 ? { companionParams: s.companionParams } : {},
20333
20967
  sinkFile: s.sinkFile,
20334
- sinkLine: s.sinkLine
20968
+ sinkLine: s.sinkLine,
20969
+ ...s.sinkId !== void 0 ? { sinkId: s.sinkId } : {}
20335
20970
  };
20336
20971
  };
20337
20972
  SEED_VALUE = "1";
20973
+ allParams = (t) => [
20974
+ t.injectionPoint,
20975
+ ...t.companionParams ?? []
20976
+ ];
20977
+ queryString = (t) => {
20978
+ const q = allParams(t).filter((p) => p.kind === "query");
20979
+ return q.length === 0 ? "" : `?${q.map((p) => `${p.name}=${SEED_VALUE}`).join("&")}`;
20980
+ };
20981
+ requestPath = (t) => {
20982
+ const hasVar = /\{[^}]+\}/.test(t.path);
20983
+ if (!hasVar && t.injectionPoint.kind === "path") {
20984
+ return `${t.path.replace(/\/$/, "")}/${SEED_VALUE}`;
20985
+ }
20986
+ return t.path.replace(/\{[^}]+\}/g, SEED_VALUE);
20987
+ };
20338
20988
  renderRequest = (t, varRef) => {
20339
20989
  const inj = t.injectionPoint;
20340
20990
  const lines = [];
20991
+ const headerParams = allParams(t).filter((p) => p.kind === "header");
20992
+ const headerLines = headerParams.length === 0 ? [] : [
20993
+ " headers:",
20994
+ ...headerParams.flatMap((p) => [
20995
+ ` - name: ${yamlStr(p.name)}`,
20996
+ ` value: ${yamlStr(SEED_VALUE)}`
20997
+ ])
20998
+ ];
20341
20999
  switch (inj.kind) {
20342
21000
  case "query":
20343
21001
  lines.push(
20344
- ` - url: ${yamlStr(`${varRef}${t.path}?${inj.name}=${SEED_VALUE}`)}`,
20345
- ` method: ${yamlStr(t.httpMethod)}`
21002
+ ` - url: ${yamlStr(`${varRef}${requestPath(t)}${queryString(t)}`)}`,
21003
+ ` method: ${yamlStr(t.httpMethod)}`,
21004
+ ...headerLines
20346
21005
  );
20347
21006
  break;
20348
21007
  case "path":
20349
21008
  lines.push(
20350
- ` - url: ${yamlStr(`${varRef}${fillPath2(t.path, SEED_VALUE)}`)}`,
20351
- ` method: ${yamlStr(t.httpMethod)}`
21009
+ ` - url: ${yamlStr(`${varRef}${requestPath(t)}${queryString(t)}`)}`,
21010
+ ` method: ${yamlStr(t.httpMethod)}`,
21011
+ ...headerLines
20352
21012
  );
20353
21013
  break;
20354
21014
  case "header":
20355
21015
  lines.push(
20356
- ` - url: ${yamlStr(`${varRef}${t.path}`)}`,
21016
+ ` - url: ${yamlStr(`${varRef}${requestPath(t)}${queryString(t)}`)}`,
20357
21017
  ` method: ${yamlStr(t.httpMethod)}`,
20358
- " headers:",
20359
- ` - name: ${yamlStr(inj.name)}`,
20360
- ` value: ${yamlStr(SEED_VALUE)}`
21018
+ ...headerLines
20361
21019
  );
20362
21020
  break;
20363
21021
  case "body":
@@ -20378,7 +21036,16 @@ ${renderEvidenceHelpers(positiveOracleId, negativeOracleId, suiteHash)}` : ""}
20378
21036
  };
20379
21037
  renderPlanYaml = (targets, scanRuleIds, opts) => {
20380
21038
  const varRef = `\${${opts.targetUrlVar}}`;
20381
- const replacerJob = opts.authTokenEnvVar ? ` # Auth cho E2 (ADR-0065): th\xEAm Bearer token runtime \u0111\u1EC3 qu\xE9t endpoint SAU c\u1ED5ng auth.
21039
+ const authTokenVar = opts.authTokenEnvVar ? `
21040
+ ${opts.authTokenEnvVar}: "\${${opts.authTokenEnvVar}}" # \u0111\u1ECDc t\u1EEB bi\u1EBFn m\xF4i tr\u01B0\u1EDDng l\xFAc ch\u1EA1y; KH\xD4NG ch\u1EE9a token` : "";
21041
+ const replacerJob = opts.authTokenEnvVar ? ` # \u26A0\uFE0F T\xCAN FIELD L\xC0 H\u1EE2P \u0110\u1ED2NG V\u1EDAI ZAP, KH\xD4NG PH\u1EA2I S\u1EDE TH\xCDCH. \u0110\xFAng t\xEAn: \`replacementString\`
21042
+ # (KH\xD4NG ph\u1EA3i \`replacement\`), v\xE0 KH\xD4NG c\xF3 \`enabled\`. Sai t\xEAn th\xEC ZAP **v\u1EABn ch\u1EA1y job v\xE0 v\u1EABn in
21043
+ # \`Job replacer started/finished\`** \u2014 n\xF3 ch\u1EC9 l\u1EB7ng l\u1EBD b\u1ECF field: MEASURED tr\xEAn run
21044
+ # cs-pentest-ptr-mtk7753j-3da8c6d7, ZAP 2.16.1 in \`Unrecognised parameter for job replacer :
21045
+ # replacement\`, r\u1ED3i active scan g\u1EEDi 31 request KH\xD4NG c\xF3 header Authorization v\xE0 nh\u1EADn 401
21046
+ # "Kh\xF4ng c\xF3 th\xF4ng tin x\xE1c th\u1EF1c" cho m\u1ECDi request \u2014 0 alert, tr\xF4ng y h\u1EC7t m\u1ED9t app s\u1EA1ch.
21047
+ # M\u1ECDi c\xF4ng s\u1EE9c mint + seed token d\u1EEBng l\u1EA1i \u1EDF \u0111\xE2y n\u1EBFu t\xEAn field sai.
21048
+ # Auth cho E2 (ADR-0065): th\xEAm Bearer token runtime \u0111\u1EC3 qu\xE9t endpoint SAU c\u1ED5ng auth.
20382
21049
  # \${${opts.authTokenEnvVar}} do ZAP AF thay t\u1EEB OS env l\xFAc ch\u1EA1y; plan KH\xD4NG ch\u1EE9a token (ch\u1EC9 t\xEAn bi\u1EBFn).
20383
21050
  # Token ch\u1EC9 m\u1EDF REACHABILITY \u2014 oracle v\u1EABn ph\xE1n l\u1ED7 h\u1ED5ng (\xA7D1).
20384
21051
  - type: replacer
@@ -20387,9 +21054,8 @@ ${renderEvidenceHelpers(positiveOracleId, negativeOracleId, suiteHash)}` : ""}
20387
21054
  matchType: "req_header"
20388
21055
  matchString: "Authorization"
20389
21056
  matchRegex: false
20390
- replacement: ${yamlStr(`Bearer \${${opts.authTokenEnvVar}}`)}
21057
+ replacementString: ${yamlStr(`Bearer \${${opts.authTokenEnvVar}}`)}
20391
21058
  tokenProcessing: false
20392
- enabled: true
20393
21059
  ` : "";
20394
21060
  const requests = targets.flatMap((t) => renderRequest(t, varRef));
20395
21061
  const rules = scanRuleIds.flatMap((id) => {
@@ -20427,7 +21093,7 @@ env:
20427
21093
  authentication:
20428
21094
  method: "manual" # n\u1ED1i auth/session h\u1EE3p l\u1EC7 n\u1EBFu endpoint \u0111\u01B0\u1EE3c b\u1EA3o v\u1EC7 (\xA7D15)
20429
21095
  vars:
20430
- ${opts.targetUrlVar}: ${yamlStr(opts.targetUrlPlaceholder)} # \u2190 S\u1EECA th\xE0nh URL env ephemeral c\u1EE7a b\u1EA1n
21096
+ ${opts.targetUrlVar}: ${yamlStr(opts.targetUrlPlaceholder)} # \u2190 S\u1EECA th\xE0nh URL env ephemeral c\u1EE7a b\u1EA1n${authTokenVar}
20431
21097
  parameters:
20432
21098
  failOnError: false
20433
21099
  failOnWarning: false
@@ -20488,6 +21154,26 @@ ${rules.join("\n")}
20488
21154
  const planYaml = renderPlanYaml(targets, scanRuleIds, opts);
20489
21155
  return { contextName: opts.contextName, planYaml, targets, scanRuleIds, skipped };
20490
21156
  };
21157
+ buildProbeSpec = (t) => {
21158
+ const inj = t.injectionPoint;
21159
+ return {
21160
+ kind: "object-store-cross-tenant",
21161
+ method: t.httpMethod,
21162
+ urlPath: t.path.replace(/\{[^}]+\}/g, PROBE_VICTIM_BUCKET_REF),
21163
+ params: [
21164
+ ...inj.kind === "query" ? [{ name: inj.name, kind: "query", value: PROBE_VICTIM_BUCKET_REF }] : [],
21165
+ ...(t.companionParams ?? []).filter((p) => p.kind === "query" || p.kind === "header").map((p) => ({ name: p.name, kind: p.kind, value: PROBE_CANARY_OBJECT_REF }))
21166
+ ],
21167
+ e1GateClass: verificationTestClassName(t.vulnerabilityClass, t.checklistId)
21168
+ };
21169
+ };
21170
+ buildProbe = (base, scenarios) => {
21171
+ const hasProbeFamilySink = scenarios.some(
21172
+ (s) => s.sinkId !== void 0 && OBJECT_STORE_PROBE_SINKS.has(s.sinkId)
21173
+ );
21174
+ if (!hasProbeFamilySink || !PROBE_INJECTION_KINDS.has(base.injectionPoint.kind)) return {};
21175
+ return { probe: buildProbeSpec(base) };
21176
+ };
20491
21177
  buildDastManifest = (plan, meta) => {
20492
21178
  const groups = /* @__PURE__ */ new Map();
20493
21179
  for (const t of plan.targets) {
@@ -20508,12 +21194,13 @@ ${rules.join("\n")}
20508
21194
  checklistId: t.checklistId,
20509
21195
  vulnerabilityClass: t.vulnerabilityClass,
20510
21196
  sinkFile: t.sinkFile,
20511
- sinkLine: t.sinkLine
21197
+ sinkLine: t.sinkLine,
21198
+ ...t.sinkId !== void 0 ? { sinkId: t.sinkId } : {}
20512
21199
  };
20513
- const group = groups.get(executionTargetId);
20514
- if (group === void 0) groups.set(executionTargetId, { base: t, scenarios: [scenario] });
20515
- else if (!group.scenarios.some((s) => s.scenarioId === scenario.scenarioId))
20516
- group.scenarios.push(scenario);
21200
+ const group2 = groups.get(executionTargetId);
21201
+ if (group2 === void 0) groups.set(executionTargetId, { base: t, scenarios: [scenario] });
21202
+ else if (!group2.scenarios.some((s) => s.scenarioId === scenario.scenarioId))
21203
+ group2.scenarios.push(scenario);
20517
21204
  }
20518
21205
  const targets = [...groups.entries()].map(([executionTargetId, { base, scenarios }]) => ({
20519
21206
  executionTargetId,
@@ -20523,7 +21210,8 @@ ${rules.join("\n")}
20523
21210
  path: base.path,
20524
21211
  injectionName: base.injectionPoint.name,
20525
21212
  injectionKind: base.injectionPoint.kind,
20526
- scenarios: [...scenarios].sort((a, b) => compareScenarioRef(a, b))
21213
+ scenarios: [...scenarios].sort((a, b) => compareScenarioRef(a, b)),
21214
+ ...buildProbe(base, scenarios)
20527
21215
  })).sort(compareExecutionTarget);
20528
21216
  const expectedProvenance = {
20529
21217
  scanPlanHash: dastScanPlanHash(plan.planYaml),
@@ -20556,6 +21244,145 @@ ${rules.join("\n")}
20556
21244
  if (a.httpMethod !== b.httpMethod) return cmpStr3(a.httpMethod, b.httpMethod);
20557
21245
  return cmpStr3(a.executionTargetId, b.executionTargetId);
20558
21246
  };
21247
+ shq = (value) => value.split(/(\$\{CS_PROBE_(?:VICTIM_BUCKET|CANARY_OBJECT)\})/).map((part) => {
21248
+ if (part === PROBE_VICTIM_BUCKET_REF) return '"${CS_PROBE_VICTIM_BUCKET}"';
21249
+ if (part === PROBE_CANARY_OBJECT_REF) return '"${CS_PROBE_CANARY_OBJECT}"';
21250
+ if (part === "") return "";
21251
+ return `'${part.replaceAll("'", "'\\''")}'`;
21252
+ }).join("");
21253
+ PROBE_SCRIPT_PROLOGUE = `#!/usr/bin/env bash
21254
+ # [ADR-0071] Canary cross-tenant probe \u2014 GENERATED by \`cs assess --emit-dast\`; do not edit.
21255
+ # \`cs dast-verify\` / \`cs correlate\` read <out-file> from the manifest's directory
21256
+ # (DAST_PROBE_FILE) and join each attempt onto the resolution whose e1GateClass it carries.
21257
+ #
21258
+ # Usage: code-sentinel-dast-probe.sh <canary-token> <out-file> <base-url> <e1-results-dir>
21259
+ # <canary-token> the canary marker the runtime seeded (an absent token SKIPS every fire \u2014
21260
+ # fail-closed; the attempts are still recorded with the note)
21261
+ # <out-file> where the probe-results envelope is written (temp file + atomic mv)
21262
+ # <base-url> the application base URL (e.g. http://127.0.0.1:8080 in the runtime pod)
21263
+ # <e1-results-dir> the E1 surefire directory whose TEST-*.xml results gate each attempt
21264
+ #
21265
+ # Env: CS_RUNTIME_TOKEN (optional bearer); CS_PROBE_VICTIM_BUCKET + CS_PROBE_CANARY_OBJECT are
21266
+ # expanded at run time from the reference strings this script was generated with (the manifest
21267
+ # carries names, never values \u2014 same rule as the ZAP plan's \`\${ZAP_TARGET_URL}\`).
21268
+ #
21269
+ # Honesty contract (ADR-0071): every attempt is recorded whatever happens; a failed curl is
21270
+ # httpStatus 0; a gate that is not 'e1-baseline-passed' SKIPS the probe (recorded with the gate
21271
+ # as the note). Only a POSITIVE canary match may upgrade a verdict downstream \u2014 this script can
21272
+ # never manufacture 'blocked'. Empty arrays under \`set -u\` need bash >= 4.4 (ZAP image: bash 5).
21273
+ set -u
21274
+
21275
+ CANARY="\${1:-}"
21276
+ OUT_FILE="\${2:-}"
21277
+ BASE_URL="\${3:-}"
21278
+ E1_RESULTS="\${4:-}"
21279
+
21280
+ if [ -z "$CANARY" ] || [ -z "$OUT_FILE" ] || [ -z "$BASE_URL" ]; then
21281
+ echo "[adr-0071] usage: code-sentinel-dast-probe.sh <canary-token> <out-file> <base-url> <e1-results-dir>" >&2
21282
+ exit 2
21283
+ fi
21284
+
21285
+ BODY_FILE=$(mktemp)
21286
+ ATTEMPTS_FILE=$(mktemp)
21287
+ trap 'rm -f "$BODY_FILE" "$ATTEMPTS_FILE"' EXIT
21288
+
21289
+ auth_args=()
21290
+ [ -n "\${CS_RUNTIME_TOKEN:-}" ] && auth_args=(-H "Authorization: Bearer \${CS_RUNTIME_TOKEN}")
21291
+
21292
+ # Map the E1 JUnit baseline of the gate class to the schema's gate enum (fail-closed): a missing
21293
+ # file, a <skipped> case (baseline unreachable) or an <error> (harness/context failure) all mean
21294
+ # the attack shape is NOT proven to reach the handler, so the probe records the honest gate and
21295
+ # never fires. A JUnit <failure> still PASSES this gate: the attack REACHED the handler, which is
21296
+ # what E1 proved \u2014 the exploit oracle here is the canary, not the assertion.
21297
+ probe_gate() {
21298
+ _cls="$1"
21299
+ _xml=$(find "$E1_RESULTS" -name "TEST-*\${_cls}.xml" -print -quit 2>/dev/null)
21300
+ if [ -z "$_xml" ]; then
21301
+ echo 'e1-baseline-missing'
21302
+ elif grep -q '<skipped' "$_xml" 2>/dev/null; then
21303
+ echo 'e1-baseline-skipped'
21304
+ elif grep -q '<error' "$_xml" 2>/dev/null; then
21305
+ echo 'e1-baseline-errored'
21306
+ else
21307
+ echo 'e1-baseline-passed'
21308
+ fi
21309
+ }
21310
+
21311
+ # JSON string escape for interpolated values (single-line values; backslash and double-quote are
21312
+ # the only characters that can break the envelope).
21313
+ json_escape() {
21314
+ sed -e 's/\\\\/\\\\\\\\/g' -e 's/"/\\\\"/g'
21315
+ }
21316
+
21317
+ # Append one attempt object (one JSON line) to the attempts scratch file.
21318
+ # Fields match the dastProbeAttemptSchema consumed by cs dast-verify / cs correlate.
21319
+ emit_attempt() {
21320
+ _tid="$1"; _cls="$2"; _gate="$3"; _match="$4"; _status="$5"; _req="$6"; _note="\${7:-}"
21321
+ _canary_esc=$(printf '%s' "$CANARY" | json_escape)
21322
+ printf '{"executionTargetId":"%s","e1GateClass":"%s","gate":"%s","canaryMatched":%s,"canaryToken":"%s","httpStatus":%s,"requestedPath":"%s"' \\
21323
+ "$_tid" "$_cls" "$_gate" "$_match" "$_canary_esc" "$_status" "$_req" >> "$ATTEMPTS_FILE"
21324
+ if [ -n "$_note" ]; then
21325
+ _note_esc=$(printf '%s' "$_note" | json_escape)
21326
+ printf ',"note":"%s"' "$_note_esc" >> "$ATTEMPTS_FILE"
21327
+ fi
21328
+ printf '}\\n' >> "$ATTEMPTS_FILE"
21329
+ }
21330
+
21331
+ # Fire one probe (or record why it was skipped). Args: <targetId> <gateClass> <method> <path> <query>
21332
+ # Headers for this target ride the global hdr_args array (reset before each call). A failed curl
21333
+ # yields code 000/empty \u2192 httpStatus 0 (a numeric field, never a JSON-invalid 000).
21334
+ probe_one() {
21335
+ _tid="$1"; _cls="$2"; _method="$3"; _path="$4"; _query="\${5:-}"
21336
+ _gate=$(probe_gate "$_cls")
21337
+ _match=false
21338
+ _status=0
21339
+ _req="$_path"
21340
+ [ -n "$_query" ] && _req="\${_path}?\${_query}"
21341
+ if [ "$_gate" = 'e1-baseline-passed' ]; then
21342
+ _url="\${BASE_URL}\${_path}"
21343
+ [ -n "$_query" ] && _url="\${_url}?\${_query}"
21344
+ _code=$(curl -sS -o "$BODY_FILE" -w '%{http_code}' --max-time 30 -X "$_method" \\
21345
+ "\${auth_args[@]}" "\${hdr_args[@]}" "$_url" 2>/dev/null) || true
21346
+ case "$_code" in ''|*[!0-9]*|000) _code=0 ;; esac
21347
+ _status="$_code"
21348
+ grep -qF -- "$CANARY" "$BODY_FILE" 2>/dev/null && _match=true
21349
+ fi
21350
+ _note=''
21351
+ [ "$_gate" != 'e1-baseline-passed' ] && _note="probe skipped: E1 baseline \${_gate}"
21352
+ _req_esc=$(printf '%s' "$_req" | json_escape)
21353
+ emit_attempt "$_tid" "$_cls" "$_gate" "$_match" "$_status" "$_req_esc" "$_note"
21354
+ }`;
21355
+ PROBE_SCRIPT_EPILOGUE = `
21356
+ # Assemble the envelope: one JSON object per line \u2192 comma-joined (tr \u2014 no paste dependency on a
21357
+ # foreign image), written to a temp file and renamed so a reader never sees a half-written file.
21358
+ attempts_json=$(tr '\\n' ',' < "$ATTEMPTS_FILE")
21359
+ attempts_json="\${attempts_json%,}"
21360
+ now=$(date -u +%Y-%m-%dT%H:%M:%SZ)
21361
+ printf '{"schemaVersion":1,"generatedAt":"%s","attempts":[%s]}' "$now" "$attempts_json" > "\${OUT_FILE}.tmp"
21362
+ mv -f "\${OUT_FILE}.tmp" "$OUT_FILE"
21363
+ echo "[adr-0071] probe-results written: \${OUT_FILE} ($(wc -l < "$ATTEMPTS_FILE") attempt(s))"`;
21364
+ renderDastProbeScript = (manifest) => {
21365
+ const probeTargets = manifest.targets.filter(
21366
+ (t) => t.probe !== void 0
21367
+ );
21368
+ if (probeTargets.length === 0) return null;
21369
+ const lines = [PROBE_SCRIPT_PROLOGUE];
21370
+ for (const t of probeTargets) {
21371
+ const p = t.probe;
21372
+ const query = p.params.filter((q) => q.kind === "query").map((q) => `${q.name}=${q.value}`).join("&");
21373
+ lines.push("");
21374
+ lines.push(`# target ${t.executionTargetId} (${p.method} ${p.urlPath})`);
21375
+ lines.push("hdr_args=()");
21376
+ for (const h of p.params.filter((q) => q.kind === "header"))
21377
+ lines.push(`hdr_args+=(-H ${shq(`${h.name}: ${h.value}`)})`);
21378
+ lines.push(
21379
+ `probe_one ${shq(t.executionTargetId)} ${shq(p.e1GateClass)} ${shq(p.method)} ${shq(p.urlPath)} ${shq(query)}`
21380
+ );
21381
+ }
21382
+ lines.push(PROBE_SCRIPT_EPILOGUE);
21383
+ return `${lines.join("\n")}
21384
+ `;
21385
+ };
20559
21386
  RISK_BY_CODE = {
20560
21387
  "3": "High",
20561
21388
  "2": "Medium",
@@ -20794,7 +21621,7 @@ ${rules.join("\n")}
20794
21621
  };
20795
21622
  const negativeOracleEnabled = options.defenseObservations !== void 0 && options.trustTier !== void 0 && options.attemptId !== void 0 && !unparseable && !prov.downgrade;
20796
21623
  const observationFor = (executionTargetId) => options.defenseObservations?.find((o) => o.executionTargetId === executionTargetId);
20797
- const resolutions = baseResolutions.map((r0) => {
21624
+ const afterNegativeOracle = baseResolutions.map((r0) => {
20798
21625
  const r = withCoverage(r0);
20799
21626
  if (unparseable) return { ...r, verdict: "not-tested", reason: "report-unparseable" };
20800
21627
  if (prov.downgrade) return { ...r, verdict: "not-tested", reason: prov.reason ?? r.reason };
@@ -20819,6 +21646,17 @@ ${rules.join("\n")}
20819
21646
  });
20820
21647
  return outcome.verdict === "blocked" ? { ...r, verdict: "blocked", reason: "negative-oracle-observed" } : r;
20821
21648
  });
21649
+ const probeByTargetId = new Map(
21650
+ (options.probeAttempts ?? []).map((a) => [a.executionTargetId, a])
21651
+ );
21652
+ const probeEligible = probeByTargetId.size > 0 && !unparseable && !prov.downgrade;
21653
+ const resolutions = probeEligible ? afterNegativeOracle.map((r) => {
21654
+ if (r.verdict !== "not-tested" || r.reason !== "no-alert-observed") return r;
21655
+ const attempt = probeByTargetId.get(r.executionTargetId);
21656
+ if (attempt === void 0) return r;
21657
+ if (!(attempt.gate === "e1-baseline-passed" && attempt.canaryMatched)) return r;
21658
+ return { ...r, verdict: "exploited", reason: "probe-canary" };
21659
+ }) : afterNegativeOracle;
20822
21660
  const unmatchedAlerts = parsed.alerts.filter((_a, i) => !matchedAlerts.has(i));
20823
21661
  const summary = {
20824
21662
  exploited: resolutions.filter((r) => r.verdict === "exploited").length,
@@ -21138,7 +21976,7 @@ ${rules.join("\n")}
21138
21976
  };
21139
21977
  CHECKLIST_ID4 = "71";
21140
21978
  CONTROL_ID4 = "upload-validation";
21141
- MAX_EVIDENCE32 = 50;
21979
+ MAX_EVIDENCE322 = 50;
21142
21980
  CONTROLLER = /@(?:RestController|Controller)\b/;
21143
21981
  MULTIPART_PARAM = /\bMultipartFile\b/g;
21144
21982
  ALLOWLIST = /\bALLOWED_EXTENSIONS?\b|\ballowedExtensions?\b|\bALLOWED_CONTENT_TYPES?\b|\ballowedContentTypes?\b|\bALLOWED_MIME_TYPES?\b/;
@@ -21209,7 +22047,7 @@ ${rules.join("\n")}
21209
22047
  }
21210
22048
  ];
21211
22049
  }
21212
- const evidence19 = handlers.slice(0, MAX_EVIDENCE32).map((h) => ({
22050
+ const evidence19 = handlers.slice(0, MAX_EVIDENCE322).map((h) => ({
21213
22051
  file: h.file,
21214
22052
  line: h.line,
21215
22053
  sinkId: `pointer/${CONTROL_ID4}`,
@@ -21374,7 +22212,7 @@ ${rules.join("\n")}
21374
22212
  };
21375
22213
  }
21376
22214
  });
21377
- var escapeInline, escapeInlinePreservingCodeSpans, escapeCodeSpan, escapeTableCell, fenceFor, SEVERITY_DESC, severityLabel, groupBySeverity, groupByField, categoryOf, groupFindings, countBySeverity2, topFiles, topRootCauses, SEVERITY_SYMBOL, formatDuration, renderHeader, ruleRecallRiskSkips, renderAiStats, renderSummary, renderSnippet, languageHintFromPath, renderFinding, renderGroup, renderFindingsSection, renderFooter, renderReport, createMarkdownReporter, SEVERITY_DESC2, SEVERITY_RANK, SEVERITY_LABEL, pickModal, groupByRule, formatDuration2, renderCompactHeader, renderSeverityTable, renderRulesTable, renderCompactSummary, MAX_INLINE_LOCATIONS, renderRuleSection, renderCompactFindings, renderCompactFooter, renderCompactReport, createMarkdownCompactReporter, JSON_SCHEMA_VERSION, buildRunBlock, buildRangeBlock, buildFindingBlock, projectSkipReasons, buildAiStatsBlock, buildJsonDocument, renderJsonReport, createJsonReporter, SARIF_SCHEMA, SARIF_VERSION, SEVERITY_TO_LEVEL, toFileUri, toArtifactUri, buildRegion, buildResult, buildRules, sarifSkipReasons, buildInvocation, buildSarifReport, renderSarifReport, createSarifReporter, VERDICT_LABEL, noteFor, renderHeader2, renderPolicy, countVerdict, renderOverview, renderChecklistTable, renderEvidence, renderScenario, renderConfirmedDetails, renderControlGaps, renderInconclusiveLeads, renderChecklistCoverage, REASON_HEADING, REASON_NOTE, renderUnassessedGroup, renderUnassessed, renderCoverage, renderFooter2, renderAssessmentReport, renderAssessmentJson, renderVerificationManifest, renderClientVerificationReadme, E1_PROVENANCE_BADGE, VERDICT_BADGE, renderVerificationRunReport, VERDICT_BADGE2, renderClientVerificationRunReport, RUNTIME_BADGE, meaningFor, countSuffix, renderChecklistCorrelation, CODE_BADGE, DAST_PROVENANCE_BADGE, RUNTIME_BADGE2, runtimeCell, dastFullyUnscanned, dastRuntimeCell, clientRuntimeCell, sastCell, meaningFor2, renderHeader3, renderOverview2, renderCorrelationReport, PLAN_FILE, MANIFEST_FILE, REPORT_FILE, renderDastReadme, VERDICT_BADGE3, verdictCell, PROVENANCE_BADGE, COVERAGE_BADGE, hoursOf2, coverageCause, COVERAGE_COUNT, renderDastRunReport, locationOf, renderSastRunReport, UNASSESSED_LABEL, renderUnassessedSection, metaLine, fileNameOf, renderHandoffPacket, renderHandoffManifest;
22215
+ var escapeInline, escapeInlinePreservingCodeSpans, escapeCodeSpan, escapeTableCell, fenceFor, SEVERITY_DESC, severityLabel, groupBySeverity, groupByField, categoryOf, groupFindings, countBySeverity2, topFiles, topRootCauses, SEVERITY_SYMBOL, formatDuration, renderHeader, ruleRecallRiskSkips, renderAiStats, renderSummary, renderSnippet, languageHintFromPath, renderFinding, renderGroup, renderFindingsSection, renderFooter, renderReport, createMarkdownReporter, SEVERITY_DESC2, SEVERITY_RANK, SEVERITY_LABEL, pickModal, groupByRule, formatDuration2, renderCompactHeader, renderSeverityTable, renderRulesTable, renderCompactSummary, MAX_INLINE_LOCATIONS, renderRuleSection, renderCompactFindings, renderCompactFooter, renderCompactReport, createMarkdownCompactReporter, JSON_SCHEMA_VERSION, buildRunBlock, buildRangeBlock, buildFindingBlock, projectSkipReasons, buildAiStatsBlock, buildJsonDocument, renderJsonReport, createJsonReporter, SARIF_SCHEMA, SARIF_VERSION, SEVERITY_TO_LEVEL, toFileUri, toArtifactUri, buildRegion, buildResult, buildRules, sarifSkipReasons, buildInvocation, buildSarifReport, renderSarifReport, createSarifReporter, VERDICT_LABEL, noteFor, renderHeader2, renderPolicy, countVerdict, renderOverview, renderChecklistTable, renderEvidence, renderScenario, renderConfirmedDetails, renderControlGaps, renderInconclusiveLeads, renderChecklistCoverage, REASON_HEADING, REASON_NOTE, renderUnassessedGroup, renderUnassessed, renderCoverage, renderFooter2, renderAssessmentReport, renderAssessmentJson, renderVerificationManifest, renderClientVerificationReadme, E1_PROVENANCE_BADGE, VERDICT_BADGE, renderVerificationRunReport, VERDICT_BADGE2, renderClientVerificationRunReport, RUNTIME_BADGE, meaningFor, countSuffix, renderChecklistCorrelation, CODE_BADGE, DAST_PROVENANCE_BADGE, RUNTIME_BADGE2, runtimeCell, dastFullyUnscanned, dastRuntimeCell, clientRuntimeCell, sastCell, meaningFor2, renderHeader3, renderOverview2, renderCorrelationReport, PLAN_FILE, MANIFEST_FILE, REPORT_FILE, DAST_PROBE_SCRIPT_FILE2, DAST_PROBE_FILE, renderDastReadme, VERDICT_BADGE3, verdictCell, PROVENANCE_BADGE, COVERAGE_BADGE, hoursOf2, coverageCause, COVERAGE_COUNT, renderDastRunReport, locationOf, renderSastRunReport, UNASSESSED_LABEL, renderUnassessedSection, metaLine, fileNameOf, renderHandoffPacket, renderHandoffManifest;
21378
22216
  var init_dist6 = __esm({
21379
22217
  "../reporters/dist/index.js"() {
21380
22218
  init_dist2();
@@ -21648,9 +22486,9 @@ ${fence}`;
21648
22486
  }
21649
22487
  return lines.join("\n");
21650
22488
  };
21651
- renderGroup = (group) => {
21652
- const heading = `### ${escapeInline(group.label)} (${group.findings.length})`;
21653
- const items = group.findings.map(renderFinding).join("\n\n---\n\n");
22489
+ renderGroup = (group2) => {
22490
+ const heading = `### ${escapeInline(group2.label)} (${group2.findings.length})`;
22491
+ const items = group2.findings.map(renderFinding).join("\n\n---\n\n");
21654
22492
  return `${heading}
21655
22493
 
21656
22494
  ${items}`;
@@ -21849,31 +22687,31 @@ ${body}`;
21849
22687
  return lines.join("\n");
21850
22688
  };
21851
22689
  MAX_INLINE_LOCATIONS = 30;
21852
- renderRuleSection = (group) => {
21853
- const conf = group.confidenceRange ? group.confidenceRange.min === group.confidenceRange.max ? `${group.confidenceRange.min}% confidence` : `confidence ${group.confidenceRange.min}-${group.confidenceRange.max}%` : "no confidence";
21854
- const fixBadge = group.fixableCount > 0 ? ` \xB7 \u{1F527} ${group.fixableCount} fixable${group.hasUnsafeFix ? " (unsafe)" : ""}` : "";
21855
- const heading = `### ${escapeCodeSpan(group.ruleId)} \u2014 ${group.findings.length} finding(s) \xB7 ${SEVERITY_LABEL[group.severity]} \xB7 ${conf}${fixBadge}`;
21856
- const bodyLines = [heading, "", `> ${escapeInlinePreservingCodeSpans(group.message)}`];
21857
- if (group.suggestion) {
22690
+ renderRuleSection = (group2) => {
22691
+ const conf = group2.confidenceRange ? group2.confidenceRange.min === group2.confidenceRange.max ? `${group2.confidenceRange.min}% confidence` : `confidence ${group2.confidenceRange.min}-${group2.confidenceRange.max}%` : "no confidence";
22692
+ const fixBadge = group2.fixableCount > 0 ? ` \xB7 \u{1F527} ${group2.fixableCount} fixable${group2.hasUnsafeFix ? " (unsafe)" : ""}` : "";
22693
+ const heading = `### ${escapeCodeSpan(group2.ruleId)} \u2014 ${group2.findings.length} finding(s) \xB7 ${SEVERITY_LABEL[group2.severity]} \xB7 ${conf}${fixBadge}`;
22694
+ const bodyLines = [heading, "", `> ${escapeInlinePreservingCodeSpans(group2.message)}`];
22695
+ if (group2.suggestion) {
21858
22696
  bodyLines.push("");
21859
- bodyLines.push(`**Suggestion**: ${escapeInlinePreservingCodeSpans(group.suggestion)}`);
22697
+ bodyLines.push(`**Suggestion**: ${escapeInlinePreservingCodeSpans(group2.suggestion)}`);
21860
22698
  }
21861
- if (group.fixableCount > 0) {
22699
+ if (group2.fixableCount > 0) {
21862
22700
  bodyLines.push("");
21863
22701
  bodyLines.push(
21864
- `**Fix**: \`cs fix${group.hasUnsafeFix ? " --unsafe" : ""}\` applies ${group.fixableCount} edit(s) for this rule (run with \`--dry-run\` first to preview).`
22702
+ `**Fix**: \`cs fix${group2.hasUnsafeFix ? " --unsafe" : ""}\` applies ${group2.fixableCount} edit(s) for this rule (run with \`--dry-run\` first to preview).`
21865
22703
  );
21866
22704
  }
21867
- const baseline = group.baselineConfidence;
21868
- const locationLines = group.findings.map((f) => {
22705
+ const baseline = group2.baselineConfidence;
22706
+ const locationLines = group2.findings.map((f) => {
21869
22707
  const loc = `${f.file}:${f.range.line}:${f.range.column}`;
21870
22708
  const confBadge = f.confidence !== void 0 && f.confidence !== baseline ? ` _(${f.confidence}%)_` : "";
21871
22709
  return `- ${escapeCodeSpan(loc)}${confBadge}`;
21872
22710
  });
21873
22711
  bodyLines.push("");
21874
- if (group.findings.length > MAX_INLINE_LOCATIONS) {
22712
+ if (group2.findings.length > MAX_INLINE_LOCATIONS) {
21875
22713
  bodyLines.push(
21876
- `<details><summary>Locations (${group.findings.length}) \u2014 click to expand</summary>`
22714
+ `<details><summary>Locations (${group2.findings.length}) \u2014 click to expand</summary>`
21877
22715
  );
21878
22716
  bodyLines.push("");
21879
22717
  bodyLines.push(...locationLines);
@@ -23332,6 +24170,8 @@ ${body}`;
23332
24170
  PLAN_FILE = "code-sentinel-dast-plan.yaml";
23333
24171
  MANIFEST_FILE = "code-sentinel-dast.json";
23334
24172
  REPORT_FILE = "code-sentinel-zap-report.json";
24173
+ DAST_PROBE_SCRIPT_FILE2 = "code-sentinel-dast-probe.sh";
24174
+ DAST_PROBE_FILE = "probe-results.json";
23335
24175
  renderDastReadme = (plan, meta) => {
23336
24176
  const version2 = meta.toolVersion ? ` \xB7 code-sentinel ${meta.toolVersion}` : "";
23337
24177
  const lines = [
@@ -23500,12 +24340,17 @@ ${body}`;
23500
24340
  lines.push("");
23501
24341
  }
23502
24342
  lines.push(
23503
- `> **Sau khi ch\u1EA1y**: \`cs dast-verify\` ingest report + \`${MANIFEST_FILE}\` b\u1EB1ng **strict join**`,
24343
+ `> **Sau khi ch\u1EA7y**: \`cs dast-verify\` ingest report + \`${MANIFEST_FILE}\` b\u1EB1ng **strict join**`,
23504
24344
  "> `executionTargetId` (ADR-0051 `#8.2`: c\xF9ng scan rule + HTTP method + \u0111\xFAng param, ho\u1EB7c route",
23505
24345
  "> template cho path-injection) \u2192 flip `suspected \u2192 exploited/not-tested`; m\u1ED9t alert kh\u1EDBp NHI\u1EC0U H\u01A0N",
23506
24346
  "> m\u1ED9t target l\xE0 `ambiguous-match` \u2192 `not-tested`, kh\xF4ng bao gi\u1EDD th\xE0nh `exploited` sai. Sau \u0111\xF3 fold",
23507
- "> v\xE0o `cs correlate` theo kh\xF3a \xA7D20 c\u1EA1nh tr\u1EE5c E1/JUnit + E1.9/Playwright.",
23508
- "> Client-side (DOM-XSS/redirect) c\u1EA7n AJAX spider \u2014 t\u1EA7ng sau.",
24347
+ "> v\xE0o `cs correlate` theo kh\xF3a \u011020 c\u1EA1nh tr\u01B0\u1EDBc E1/JUnit + E1.9/Playwright.",
24348
+ "> Client-side (DOM-XSS/redirect) c\u1EA7n AJAX spider \u2014 t\u01B0\u01A1ng lai sau.",
24349
+ ">",
24350
+ "> **ADR-0071 \u2014 canary probe (object-store)**: khi manifest c\xF3 target mang probe spec, c\xF9ng th\u01B0 m\u1EE5c c\xF2n ch\u1EE9a",
24351
+ `> \`${DAST_PROBE_SCRIPT_FILE2}\` \u2014 script probe SINH T\u1EF0 \u0110\u1ED8NG, runtime fire SAU khi E1 baseline gate PASSED,`,
24352
+ `> \`${DAST_PROBE_FILE}\` n\u01A1i c\xF9ng th\u01B0 m\u1EE5c; \`cs dast-verify\` t\u1EF1 \u0111\u1ECDc n\u1EBFu file t\u1ED3n t\u1EA1i. Canary trong response`,
24353
+ "> \u2192 `exploited` (b\u1EB1ng ch\u1EE9ng D\u01AF\u01A0NG); kh\xF4ng match/skip \u2192 `not-tested` \u2014 probe kh\xF4ng bao gi\u1EDD sinh `blocked`.",
23509
24354
  ""
23510
24355
  );
23511
24356
  return lines.join("\n");
@@ -23516,7 +24361,11 @@ ${body}`;
23516
24361
  "not-tested": "\u26AA not-tested",
23517
24362
  suspected: "\u{1F7E1} suspected"
23518
24363
  };
23519
- verdictCell = (r) => r.reason === "ambiguous-match" ? "\u26AA not-tested (ambiguous)" : VERDICT_BADGE3[r.verdict];
24364
+ verdictCell = (r) => {
24365
+ if (r.reason === "ambiguous-match") return "\u26AA not-tested (ambiguous)";
24366
+ if (r.reason === "probe-canary") return "\u{1F534} exploited (canary)";
24367
+ return VERDICT_BADGE3[r.verdict];
24368
+ };
23520
24369
  PROVENANCE_BADGE = {
23521
24370
  verified: "\u2705 verified",
23522
24371
  unverified: "\u26AA unverified",
@@ -23598,6 +24447,16 @@ ${body}`;
23598
24447
  "> HTTP method + \u0111\xFAng param (query/header/body) ho\u1EB7c route template (path). M\u1ED9t alert kh\u1EDBp NHI\u1EC0U H\u01A0N",
23599
24448
  "> m\u1ED9t target = `ambiguous-match` \u2192 `not-tested` (KH\xD4NG ph\u1EA3i `exploited`) v\xEC kh\xF4ng quy \u0111\u01B0\u1EE3c v\u1EC1 m\u1ED9t",
23600
24449
  "> b\u1EC1 m\u1EB7t runtime; b\u1EB1ng ch\u1EE9ng c\u1EE7a m\u1ED9t target kh\u1EDBp \u0111\u01B0\u1EE3c fan-out ra m\u1ECDi scenario link.",
24450
+ // The canary paragraph is DATA-DRIVEN like the `blocked` one: with no probe upgrade the sentence
24451
+ // would describe a path that did not run this time.
24452
+ ...resolutions.some((r) => r.reason === "probe-canary") ? [
24453
+ ">",
24454
+ "> \u{1F9EA} **M\u1ED9t ph\u1EA7n `exploited` \u0111\u1EBFn t\u1EEB canary probe** ([ADR-0071]): E1 baseline \u0111\xE3 ch\u1EE9ng minh",
24455
+ "> request-shape ghi \u0111\u01B0\u1EE3c object store; E2 replay \u0110\xDANG shape \u0111\xF3 v\u1EDBi bucket-victim v\xE0 nh\u1EADn l\u1EA1i",
24456
+ "> canary token \u2014 ghi ch\xE9o tenant \u0110\xC3 \u0110\u01AF\u1EE2C CH\u1EE8NG MINH \u1EDF runtime, kh\xF4ng ph\u1EA3i suy \u0111o\xE1n t\u1EEB v\u1EAFng-m\u1EB7t",
24457
+ "> c\u1EE7a ZAP. Verdict v\u1EABn KH\xD4NG h\u1EA1 c\u1EA5p `CONFIRMED-VULN` \u2014 \u0111\u01B0\u1EDDng t\u1EA5n c\xF4ng trong M\xC3 v\u1EABn c\xF2n, V\u1EAAN ph\u1EA3i",
24458
+ "> s\u1EEDa m\xE3."
24459
+ ] : [],
23601
24460
  "",
23602
24461
  `**Th\u1EDDi \u0111i\u1EC3m**: ${meta.generatedAt.toISOString()}${version2}`
23603
24462
  ];
@@ -23735,10 +24594,19 @@ ${body}`;
23735
24594
  lines.push(
23736
24595
  `- **Sink**: \`${escapeInline(`${r.sinkFile}:${r.sinkLine}`)}\` (\u0111\u01B0\u1EDDng t\u1EA5n c\xF4ng taint \u0111\xE3 ch\u1EE9ng minh)`
23737
24596
  );
23738
- if (r.detail !== void 0) lines.push(`- **B\u1EB1ng ch\u1EE9ng ZAP**: ${escapeInline(r.detail)}`);
23739
- lines.push(
23740
- "- **Vi\u1EC7c c\u1EA7n l\xE0m**: x\xE1c nh\u1EADn alert kh\xF4ng ph\u1EA3i false-positive c\u1EE7a ZAP, r\u1ED3i s\u1EEDa l\u1ED7 h\u1ED5ng trong m\xE3 (\u0111\u01B0\u1EDDng t\u1EA5n c\xF4ng \u0111\xE3 \u0111\u01B0\u1EE3c taint ch\u1EE9ng minh)."
23741
- );
24597
+ if (r.reason === "probe-canary") {
24598
+ lines.push(
24599
+ "- **B\u1EB1ng ch\u1EE9ng canary** ([ADR-0071]): E1 baseline \u0111\xE3 ch\u1EE9ng minh request-shape ghi \u0111\u01B0\u1EE3c object store; E2 replay \u0111\xFAng shape v\u1EDBi bucket-victim (bucket principal KH\xD4NG s\u1EDF h\u1EEFu) v\xE0 nh\u1EADn l\u1EA1i canary token \u2192 ghi ch\xE9o tenant ch\u1EE9ng minh \u0111\u01B0\u1EE3c \u1EDF runtime. \u0110\u1ED1i chi\u1EBFu `probe-results.json` trong artifacts c\u1EE7a c\xF9ng l\u1EA7n ch\u1EA1y."
24600
+ );
24601
+ lines.push(
24602
+ "- **Vi\u1EC7c c\u1EA7n l\xE0m**: x\xE1c nh\u1EADn canary token kh\u1EDBp v\xE0 probe-results.json c\xF9ng l\u1EA7n ch\u1EA1y v\u1EDBi report ZAP, r\u1ED3i s\u1EEDa l\u1ED7 h\u1ED5ng trong m\xE3 (\u0111\u01B0\u1EDDng t\u1EA5n c\xF4ng \u0111\xE3 \u0111\u01B0\u1EE3c taint ch\u1EE9ng minh)."
24603
+ );
24604
+ } else {
24605
+ if (r.detail !== void 0) lines.push(`- **B\u1EB1ng ch\u1EE9ng ZAP**: ${escapeInline(r.detail)}`);
24606
+ lines.push(
24607
+ "- **Vi\u1EC7c c\u1EA7n l\xE0m**: x\xE1c nh\u1EADn alert kh\xF4ng ph\u1EA3i false-positive c\u1EE7a ZAP, r\u1ED3i s\u1EEDa l\u1ED7 h\u1ED5ng trong m\xE3 (\u0111\u01B0\u1EDDng t\u1EA5n c\xF4ng \u0111\xE3 \u0111\u01B0\u1EE3c taint ch\u1EE9ng minh)."
24608
+ );
24609
+ }
23742
24610
  lines.push("");
23743
24611
  }
23744
24612
  }
@@ -29283,7 +30151,7 @@ async function evaluateSliceWithAi(options) {
29283
30151
  return { vulnerable: false, reason: `LLM execution error: ${message}` };
29284
30152
  }
29285
30153
  }
29286
- var OLLAMA_DEFAULT_BASE, NETMIND_DEFAULT_BASE, OPENCODE_GO_DEFAULT_BASE, stripTrailingSlash2, buildLanguageModel, resolveModelOverride, pingTarget, shouldUseRawJsonChat, openAICompatibleChatUrl, REASONING_HEADROOM_TOKENS, NETMIND_MINIMAX_M3_MODEL, NETMIND_SMALL_PROMPT_MAX_CHARS, NETMIND_MEDIUM_PROMPT_MAX_CHARS, NETMIND_SMALL_OUTPUT_TOKENS, NETMIND_MEDIUM_OUTPUT_TOKENS, NETMIND_LARGE_OUTPUT_TOKENS, NETMIND_MAX_OUTPUT_TOKENS, supportsNetmindJsonResponseFormat, emptyResponseDiagnostics, effectiveMaxTokensFor, completeRawOpenAICompatibleJsonChat, createAiSdkProvider, createFallbackClient, numberLines, renderPrompt, cache, loadPromptTemplate, nullableOptional, AI_VIOLATION_MESSAGE_MAX_LENGTH, aiViolationSchema, aiResponseSchema, stripCodeFence, parseAiResponse, VIETNAMESE_OUTPUT_POLICY_VERSION, VIETNAMESE_OUTPUT_INSTRUCTION, TOKEN_BUDGET_WARN_DEFAULT, CHARS_PER_TOKEN, SAFETY_MARGIN, estimateTokens, formatTokenWarning, CACHE_NAMESPACE, DEFAULT_PROVIDER_RETRY_MAX_RETRIES, DEFAULT_PROVIDER_RETRY_MAX_DELAY_MS, DEFAULT_ADAPTIVE_RETRY_MAX_RETRIES, DEFAULT_ADAPTIVE_CONTEXT_REDUCTION_FACTOR, DEFAULT_ADAPTIVE_TIMEOUT_MULTIPLIER, DEFAULT_ADAPTIVE_MAX_DELAY_MS, DEFAULT_PROVIDER_TIMEOUT_MS, sleep, parseRetryDelayMs, providerRetryDelayMs, adaptiveFailureKind, compactClusterContext, findingDedupeKey, dedupeFindings, capFindings, createAiExecutor, PATH_FAST_PATHS, SPRING_BOOT_PATTERNS, ANGULAR_PATTERNS, FLUTTER_PATTERNS, ENTRY_HINTS, ALL_PATTERNS, matchesRule, classifyLayer, classifyLayers, PRIMARY_LAYER_CANDIDATES, TEST_AND_GENERATED, LAYER_SUFFIXES, FILE_SUFFIX_RE, ANY_EXT_RE, dropExt, stripPascalSuffix, normalize3, extractDomainTokens, extractDomainTokensBatch, TRIVIAL_TOKENS, sharesDomainToken, TS_IMPORT_RE, JAVA_IMPORT_RE, extractImports, POSIX_SEP_RE, sharedDirDepth, resolveImportTarget, KIND_STRENGTH, upsertEdge, buildEdges, ADVICE_ANNOTATION, isGlobalAdviceFile, findGlobalAdvicePaths, DEFAULT_MAX_CANDIDATES, DEFAULT_MAX_SUPPORT_FILES, DEFAULT_TOKEN_BUDGET, SCORE_DIRECT_NEIGHBOR, SCORE_SECOND_DEGREE, SCORE_SIBLING_STEM, SCORE_ANGULAR_TEMPLATE_SIBLING, SCORE_DOMAIN_TOKEN, PENALTY_TEST_VS_NON_TEST, PENALTY_GENERATED, SCORE_GLOBAL_ADVICE, prefilterCandidates, layerFlowBonus, isTest, isGenerated, scoreFor, tokensOf, trimToBudget, toMember, clusterIdFor, createClusterAssembler, CLUSTER_TREE_BUILDER_VERSION, DEFAULT_MODULE_DEPTH, posixDirname, moduleGroupKey, uniqueSortedPaths, memberFingerprint, featureNodeFor, moduleNodeFor, appNodeFor, countCrossModuleEdges, createClusterTreeBuilder, TRANSACTIONAL, TYPE_DECL3, METHOD_NAME2, MUTATION_CALL, LEADING_ANNOTATION2, SPRING_TX_SUPPORT_IMPORT, PROGRAMMATIC_TYPE, PROGRAMMATIC_CALL, INLINE_TEMPLATE_CALL, CONTROL_FLOW_NAMES, maskNonCode, methodNameFromHeader, methodAt, delegatedTargetAt, collectProgrammaticReceivers, readAttr, skipToDeclaration2, countMutations, lineOf19, configuredReadOnly, extractProgrammaticFromFile, extractFromFile2, extractTransactionBoundaries, renderPrDiffPrompt, nullableOptional2, prDiffResponseSchema, createPrDiffReviewer, renderGroupedRulePrompt, confidenceLabelSchema, severitySchema2, groupedResponseSchema, labelToConfidence, createGroupedRuleReviewer, renderPerRulePrompt, createPerRuleReviewer, DEFAULT_MAX_TOKENS, SYSTEM_PROMPT, SCHEMA_PROMPT, clip, buildUserPrompt, extractJsonObject, describeUnusableAnswer, createRuntimeAuthHypothesisResolver, extractJsonObject2;
30154
+ var OLLAMA_DEFAULT_BASE, NETMIND_DEFAULT_BASE, OPENCODE_GO_DEFAULT_BASE, stripTrailingSlash2, buildLanguageModel, resolveModelOverride, pingTarget, shouldUseRawJsonChat, openAICompatibleChatUrl, REASONING_HEADROOM_TOKENS, NETMIND_MINIMAX_M3_MODEL, NETMIND_SMALL_PROMPT_MAX_CHARS, NETMIND_MEDIUM_PROMPT_MAX_CHARS, NETMIND_SMALL_OUTPUT_TOKENS, NETMIND_MEDIUM_OUTPUT_TOKENS, NETMIND_LARGE_OUTPUT_TOKENS, NETMIND_MAX_OUTPUT_TOKENS, supportsNetmindJsonResponseFormat, emptyResponseDiagnostics, effectiveMaxTokensFor, completeRawOpenAICompatibleJsonChat, createAiSdkProvider, createFallbackClient, numberLines, renderPrompt, cache, loadPromptTemplate, nullableOptional, AI_VIOLATION_MESSAGE_MAX_LENGTH, aiViolationSchema, aiResponseSchema, stripCodeFence, parseAiResponse, VIETNAMESE_OUTPUT_POLICY_VERSION, VIETNAMESE_OUTPUT_INSTRUCTION, TOKEN_BUDGET_WARN_DEFAULT, CHARS_PER_TOKEN, SAFETY_MARGIN, estimateTokens, formatTokenWarning, CACHE_NAMESPACE, DEFAULT_PROVIDER_RETRY_MAX_RETRIES, DEFAULT_PROVIDER_RETRY_MAX_DELAY_MS, DEFAULT_ADAPTIVE_RETRY_MAX_RETRIES, DEFAULT_ADAPTIVE_CONTEXT_REDUCTION_FACTOR, DEFAULT_ADAPTIVE_TIMEOUT_MULTIPLIER, DEFAULT_ADAPTIVE_MAX_DELAY_MS, DEFAULT_PROVIDER_TIMEOUT_MS, sleep, parseRetryDelayMs, providerRetryDelayMs, adaptiveFailureKind, compactClusterContext, findingDedupeKey, dedupeFindings, capFindings, createAiExecutor, PATH_FAST_PATHS, SPRING_BOOT_PATTERNS, ANGULAR_PATTERNS, FLUTTER_PATTERNS, ENTRY_HINTS, ALL_PATTERNS, matchesRule, classifyLayer, classifyLayers, PRIMARY_LAYER_CANDIDATES, TEST_AND_GENERATED, LAYER_SUFFIXES, FILE_SUFFIX_RE, ANY_EXT_RE, dropExt, stripPascalSuffix, normalize3, extractDomainTokens, extractDomainTokensBatch, TRIVIAL_TOKENS, sharesDomainToken, TS_IMPORT_RE, JAVA_IMPORT_RE, extractImports, POSIX_SEP_RE, sharedDirDepth, resolveImportTarget, KIND_STRENGTH, upsertEdge, buildEdges, ADVICE_ANNOTATION, isGlobalAdviceFile, findGlobalAdvicePaths, DEFAULT_MAX_CANDIDATES, DEFAULT_MAX_SUPPORT_FILES, DEFAULT_TOKEN_BUDGET, SCORE_DIRECT_NEIGHBOR, SCORE_SECOND_DEGREE, SCORE_SIBLING_STEM, SCORE_ANGULAR_TEMPLATE_SIBLING, SCORE_DOMAIN_TOKEN, PENALTY_TEST_VS_NON_TEST, PENALTY_GENERATED, SCORE_GLOBAL_ADVICE, prefilterCandidates, layerFlowBonus, isTest, isGenerated, scoreFor, tokensOf, trimToBudget, toMember, clusterIdFor, createClusterAssembler, CLUSTER_TREE_BUILDER_VERSION, DEFAULT_MODULE_DEPTH, posixDirname, moduleGroupKey, uniqueSortedPaths, memberFingerprint, featureNodeFor, moduleNodeFor, appNodeFor, countCrossModuleEdges, createClusterTreeBuilder, TRANSACTIONAL, TYPE_DECL3, METHOD_NAME2, MUTATION_CALL, LEADING_ANNOTATION2, SPRING_TX_SUPPORT_IMPORT, PROGRAMMATIC_TYPE, PROGRAMMATIC_CALL, INLINE_TEMPLATE_CALL, CONTROL_FLOW_NAMES, maskNonCode, methodNameFromHeader, methodAt, delegatedTargetAt, collectProgrammaticReceivers, readAttr, skipToDeclaration2, countMutations, lineOf19, configuredReadOnly, extractProgrammaticFromFile, extractFromFile2, extractTransactionBoundaries, renderPrDiffPrompt, nullableOptional2, prDiffResponseSchema, createPrDiffReviewer, renderGroupedRulePrompt, confidenceLabelSchema, severitySchema2, groupedResponseSchema, labelToConfidence, createGroupedRuleReviewer, renderPerRulePrompt, createPerRuleReviewer, DEFAULT_MAX_TOKENS, SYSTEM_PROMPT, SCHEMA_PROMPT, clip, buildUserPrompt, extractJsonObject, describeUnusableAnswer, createRuntimeAuthHypothesisResolver, DEFAULT_MAX_TOKENS2, SYSTEM_PROMPT2, SCHEMA_PROMPT2, clip2, buildUserPrompt2, describeUnusableAnswer2, createRuntimeDataSeedResolver, extractJsonObject2;
29287
30155
  var init_dist7 = __esm({
29288
30156
  "../ai-engine/dist/index.js"() {
29289
30157
  init_dist();
@@ -31965,6 +32833,148 @@ ${buildUserPrompt(request, options.maxEvidenceChars, logger)}`,
31965
32833
  }
31966
32834
  }
31967
32835
  });
32836
+ DEFAULT_MAX_TOKENS2 = 4e3;
32837
+ SYSTEM_PROMPT2 = [
32838
+ "You analyse a Java/Spring service and decide WHICH ROWS its relational database must contain so",
32839
+ "its HTTP endpoints can be exercised against an EMPTY, disposable database. You are helping a",
32840
+ "security test harness seed pre-existing state (the entity row a path variable references, or the",
32841
+ "lookup rows a request payload needs). You never invent a schema: if the evidence does not show",
32842
+ "the tables and columns, say so.",
32843
+ "",
32844
+ "Answer with ONE JSON object and nothing else. Do not output SQL and do not invent identifiers:",
32845
+ "a separate deterministic step renders your rows into INSERT statements."
32846
+ ].join("\n");
32847
+ SCHEMA_PROMPT2 = [
32848
+ "{",
32849
+ ' "scheme": "<short label, letters/digits/dot/dash/underscore, e.g. sql-insert>",',
32850
+ ' "targets": [',
32851
+ ' { "httpMethod": "GET",',
32852
+ ' "path": "<copy VERBATIM from the endpoint list>",',
32853
+ ' "table": "<SQL table name>",',
32854
+ ' "rows": [ { "<column>": "<string>" | <number> | <boolean> | null } ] }',
32855
+ " ],",
32856
+ ' "evidence": ["<file you read this from>"]',
32857
+ "}",
32858
+ "",
32859
+ "Rules that will cause your answer to be REJECTED:",
32860
+ "- a table or column name that is not a SQL identifier (letters/digits/underscore, starting with",
32861
+ " a letter or underscore, at most 64 characters)",
32862
+ "- a value that is an object, an array, or an SQL expression (no NOW(), no sequence calls, no",
32863
+ " function calls of any kind)",
32864
+ "- more than 32 targets, more than 64 rows in one target, more than 32 columns in one row",
32865
+ "- two targets with the same httpMethod + path + table",
32866
+ "",
32867
+ "MATCHING: one target per listed endpoint that needs pre-existing state, matched EXACTLY by",
32868
+ "httpMethod and path \u2014 copy the path VERBATIM, a path that does not join is silently useless. An",
32869
+ "endpoint that needs no state gets NO target.",
32870
+ "",
32871
+ "WHAT TO SEED:",
32872
+ "- an endpoint whose path carries a variable (`{id}`) needs the entity ROW it will look up. The",
32873
+ "harness exercises the benign baseline with identifier '1', so include one row whose",
32874
+ "primary-key column equals 1.",
32875
+ "- a PUT/DELETE/PATCH needs the row it mutates to already exist \u2014 same primary-key rule.",
32876
+ "- a POST whose body references other rows by identifier needs those LOOKUP rows present, with",
32877
+ "the exact identifier values the payload will carry.",
32878
+ "- seed referenced/parent rows too: a row with a foreign key must have its parent present, or the",
32879
+ "INSERT itself fails and the seed is worthless.",
32880
+ "",
32881
+ "CHOOSING columns and values: include every column the evidence shows the application READING on",
32882
+ "this row, and every NOT NULL column without a default. A row missing a column the app reads",
32883
+ "makes the request fail AFTER the seed \u2014 the worst outcome, because it looks like a working seed.",
32884
+ "Match the JSON type to the column: strings for varchar/text/enum, numbers for numerics, booleans",
32885
+ "for booleans, and null ONLY for a nullable column the flow tolerates.",
32886
+ "",
32887
+ "If the evidence does not show the schema, return exactly: null"
32888
+ ].join("\n");
32889
+ clip2 = (text2, max) => text2.length <= max ? text2 : `${text2.slice(0, max)}
32890
+ \u2026 [${text2.length - max} more characters]`;
32891
+ buildUserPrompt2 = (req, maxEvidence, logger) => {
32892
+ const parts = [];
32893
+ if (req.endpoints.length > 0) {
32894
+ parts.push(
32895
+ "",
32896
+ "Endpoints that will be exercised, with the state their signatures imply:",
32897
+ ...req.endpoints.slice(0, 40).map((e) => {
32898
+ const reqs = e.seedRequirements.map((r) => `${r.kind} ${r.param} (${r.javaType})`).join(", ");
32899
+ return ` ${e.httpMethod} ${e.path}${reqs.length > 0 ? ` [${reqs}]` : ""}`;
32900
+ })
32901
+ );
32902
+ if (req.endpoints.length > 40) parts.push(` \u2026 and ${req.endpoints.length - 40} more`);
32903
+ }
32904
+ parts.push("", "Evidence:");
32905
+ let used = 0;
32906
+ const dropped = [];
32907
+ for (const ex of req.excerpts) {
32908
+ if (maxEvidence !== void 0 && used >= maxEvidence) {
32909
+ dropped.push(ex.path);
32910
+ continue;
32911
+ }
32912
+ const body = maxEvidence === void 0 ? ex.content : clip2(ex.content, maxEvidence - used);
32913
+ used += body.length;
32914
+ parts.push(`--- ${ex.path} ---`, body);
32915
+ }
32916
+ if (dropped.length > 0) {
32917
+ logger?.warn(
32918
+ `runtime-data-seed resolver: the ${maxEvidence}-character ceiling DROPPED ${dropped.length} excerpt(s): ${dropped.join(", ")}`
32919
+ );
32920
+ }
32921
+ if (req.priorRejection !== void 0 && req.priorRejection.length > 0) {
32922
+ parts.push(
32923
+ "",
32924
+ "Your PREVIOUS answer was REJECTED for this reason \u2014 fix ONLY this and keep everything else:",
32925
+ ` ${req.priorRejection}`
32926
+ );
32927
+ }
32928
+ parts.push("", "Respond with the JSON object described above, or null.");
32929
+ return parts.join("\n");
32930
+ };
32931
+ describeUnusableAnswer2 = (text2) => {
32932
+ const bare = text2.replace(/^```(?:json)?/i, "").replace(/```$/, "").trim();
32933
+ if (/^null[.,]?$/i.test(bare)) {
32934
+ return "the model DECLINED (answered null) \u2014 the evidence did not show it a schema; this is the prompt/evidence to change, not the schema.";
32935
+ }
32936
+ if (!text2.includes("{")) {
32937
+ return `the model answered PROSE with no JSON object at all (${text2.length} chars) \u2014 it did not follow the output contract; tighten the instruction, not the schema.`;
32938
+ }
32939
+ return `the model answered something containing '{' but no BALANCED, parseable object could be read from it (${text2.length} chars) \u2014 the shape is close; check the schema prompt.`;
32940
+ };
32941
+ createRuntimeDataSeedResolver = (options) => ({
32942
+ resolve: async (request) => {
32943
+ const { client, logger } = options;
32944
+ try {
32945
+ const result = await client.complete({
32946
+ system: SYSTEM_PROMPT2,
32947
+ user: `${SCHEMA_PROMPT2}
32948
+
32949
+ ${buildUserPrompt2(request, options.maxEvidenceChars, logger)}`,
32950
+ model: options.model ?? "",
32951
+ temperature: 0,
32952
+ maxTokens: options.maxTokens ?? DEFAULT_MAX_TOKENS2
32953
+ // responseFormat is deliberately ABSENT — see the header. Asking for JSON mode emptied the
32954
+ // response on the measured provider, which is indistinguishable from "found nothing".
32955
+ });
32956
+ if (!result.ok) {
32957
+ logger?.warn(`runtime-data-seed resolver: provider call FAILED \u2014 ${result.error.message}`);
32958
+ throw result.error;
32959
+ }
32960
+ const text2 = result.value.text.trim();
32961
+ if (text2.length === 0) {
32962
+ logger?.warn(
32963
+ "runtime-data-seed resolver: the model returned an EMPTY response; no hypothesis."
32964
+ );
32965
+ return null;
32966
+ }
32967
+ const parsed = extractJsonObject(text2);
32968
+ if (parsed === null) {
32969
+ logger?.warn(`runtime-data-seed resolver: ${describeUnusableAnswer2(text2)}`);
32970
+ }
32971
+ return parsed;
32972
+ } catch (e) {
32973
+ logger?.warn(`runtime-data-seed resolver: provider call THREW \u2014 ${e.message}`);
32974
+ throw e;
32975
+ }
32976
+ }
32977
+ });
31968
32978
  extractJsonObject2 = (text2) => {
31969
32979
  const start = text2.indexOf("{");
31970
32980
  if (start === -1) return null;
@@ -42261,11 +43271,11 @@ var definedBuildValue = (value, fallback) => typeof value === "string" && value.
42261
43271
  var getCliBuildMetadata = (version2) => ({
42262
43272
  version: version2,
42263
43273
  gitSha: definedBuildValue(
42264
- "45ed282da872" ,
43274
+ "44783c9956ee" ,
42265
43275
  "unknown"
42266
43276
  ),
42267
43277
  buildTimestamp: definedBuildValue(
42268
- "2026-09-04T08:56:17.349Z" ,
43278
+ "2026-09-08T06:55:48.668Z" ,
42269
43279
  "unknown"
42270
43280
  ),
42271
43281
  configSchemaRange: definedBuildValue(
@@ -42696,7 +43706,7 @@ var SecretCommandError = class extends Error {
42696
43706
  code;
42697
43707
  };
42698
43708
  var nativeRunner = {
42699
- run: (command, args, input4) => new Promise((resolve54, reject) => {
43709
+ run: (command, args, input4) => new Promise((resolve55, reject) => {
42700
43710
  const child = spawn(command, args, { stdio: ["pipe", "pipe", "pipe"] });
42701
43711
  let stdout = "";
42702
43712
  let stderr = "";
@@ -42710,7 +43720,7 @@ var nativeRunner = {
42710
43720
  });
42711
43721
  child.on("error", (error) => reject(error));
42712
43722
  child.on("close", (code) => {
42713
- if (code === 0) resolve54(stdout);
43723
+ if (code === 0) resolve55(stdout);
42714
43724
  else reject(new SecretCommandError(command, code, stderr.trim() || `${command} failed`));
42715
43725
  });
42716
43726
  if (input4 !== void 0) child.stdin.end(input4);
@@ -43851,6 +44861,7 @@ init_dist5();
43851
44861
  init_zod();
43852
44862
  var SUITE_MANIFEST = "code-sentinel-suite.json";
43853
44863
  var DAST_MANIFEST = "code-sentinel-dast.json";
44864
+ var DAST_PROBE_FILE2 = "probe-results.json";
43854
44865
  var CLIENT_SUITE_MANIFEST = "code-sentinel-client-suite.json";
43855
44866
  var toolVersion = () => {
43856
44867
  const req = createRequire(import.meta.url);
@@ -43907,7 +44918,24 @@ var dastScenarioRefSchema = external_exports.object({
43907
44918
  checklistId: external_exports.string(),
43908
44919
  vulnerabilityClass: external_exports.string(),
43909
44920
  sinkFile: external_exports.string(),
43910
- sinkLine: external_exports.number()
44921
+ sinkLine: external_exports.number(),
44922
+ // [ADR-0071] additive: the sink-family discriminator stamped onto the scenario. Kept so Zod
44923
+ // does not STRIP it on read (mirrors the `#8.3.2` rule below).
44924
+ sinkId: external_exports.string().optional()
44925
+ });
44926
+ var dastProbeSpecSchema = external_exports.object({
44927
+ kind: external_exports.literal("object-store-cross-tenant"),
44928
+ method: external_exports.string(),
44929
+ urlPath: external_exports.string(),
44930
+ params: external_exports.array(
44931
+ external_exports.object({
44932
+ name: external_exports.string(),
44933
+ kind: external_exports.enum(["query", "path", "body", "header"]),
44934
+ value: external_exports.string()
44935
+ })
44936
+ ),
44937
+ bodyJson: external_exports.string().optional(),
44938
+ e1GateClass: external_exports.string()
43911
44939
  });
43912
44940
  var dastManifestSchema = external_exports.object({
43913
44941
  schemaVersion: external_exports.literal(2),
@@ -43924,7 +44952,9 @@ var dastManifestSchema = external_exports.object({
43924
44952
  path: external_exports.string(),
43925
44953
  injectionName: external_exports.string(),
43926
44954
  injectionKind: external_exports.enum(["query", "path", "body", "header"]),
43927
- scenarios: external_exports.array(dastScenarioRefSchema)
44955
+ scenarios: external_exports.array(dastScenarioRefSchema),
44956
+ // [ADR-0071] additive: the canary probe the runtime harness MAY execute for this surface.
44957
+ probe: dastProbeSpecSchema.optional()
43928
44958
  })
43929
44959
  ),
43930
44960
  skipped: external_exports.array(
@@ -43964,6 +44994,37 @@ var readDastAttestation = async (attestationPath) => {
43964
44994
  const raw = await readFile(attestationPath, "utf8");
43965
44995
  return dastAttestationSchema.parse(JSON.parse(raw));
43966
44996
  };
44997
+ var dastProbeAttemptSchema = external_exports.object({
44998
+ executionTargetId: external_exports.string(),
44999
+ e1GateClass: external_exports.string(),
45000
+ gate: external_exports.enum([
45001
+ "e1-baseline-passed",
45002
+ "e1-baseline-missing",
45003
+ "e1-baseline-skipped",
45004
+ "e1-baseline-errored"
45005
+ ]),
45006
+ canaryMatched: external_exports.boolean(),
45007
+ canaryToken: external_exports.string().optional(),
45008
+ httpStatus: external_exports.number().optional(),
45009
+ requestedPath: external_exports.string().optional(),
45010
+ note: external_exports.string().optional()
45011
+ });
45012
+ var dastProbeResultsSchema = external_exports.object({
45013
+ schemaVersion: external_exports.literal(1),
45014
+ generatedAt: external_exports.string(),
45015
+ attempts: external_exports.array(dastProbeAttemptSchema)
45016
+ });
45017
+ var readDastProbesIfPresent = async (planDir) => {
45018
+ const probesPath = join(planDir, DAST_PROBE_FILE2);
45019
+ let raw;
45020
+ try {
45021
+ raw = await readFile(probesPath, "utf8");
45022
+ } catch (e) {
45023
+ if (e.code === "ENOENT") return [];
45024
+ throw e;
45025
+ }
45026
+ return dastProbeResultsSchema.parse(JSON.parse(raw)).attempts;
45027
+ };
43967
45028
  var dastDefenseObservationSchema = external_exports.object({
43968
45029
  negativeOracleId: external_exports.string(),
43969
45030
  decision: external_exports.enum(["reject", "deny", "allow"]),
@@ -44268,6 +45329,14 @@ var runAssess = async (options, deps = {}) => {
44268
45329
  console.error(red("--emit-evidence is only meaningful with --emit-tests."));
44269
45330
  return EXIT.USAGE;
44270
45331
  }
45332
+ if (options.dataSeed !== void 0 && options.emitTests === void 0) {
45333
+ console.error(red("--data-seed is only meaningful with --emit-tests."));
45334
+ return EXIT.USAGE;
45335
+ }
45336
+ if (options.runtimeAuth !== void 0 && options.emitTests === void 0) {
45337
+ console.error(red("--runtime-auth is only meaningful with --emit-tests."));
45338
+ return EXIT.USAGE;
45339
+ }
44271
45340
  if (options.scope !== void 0) {
44272
45341
  if (!isReviewScope(options.scope)) {
44273
45342
  console.error(
@@ -44677,13 +45746,84 @@ var runAssess = async (options, deps = {}) => {
44677
45746
  }))
44678
45747
  ) : void 0;
44679
45748
  const bootClass = detectSpringBootClass(files, options.module);
45749
+ let seedPlan;
45750
+ if (options.dataSeed !== void 0) {
45751
+ const seedPath = resolve(options.dataSeed);
45752
+ try {
45753
+ const raw = JSON.parse(await readFile(seedPath, "utf8"));
45754
+ const hypothesis = validateRuntimeDataSeedHypothesis(raw);
45755
+ if (hypothesis === null) {
45756
+ console.error(
45757
+ red(`--data-seed ${options.dataSeed} kh\xF4ng qua \u0111\u01B0\u1EE3c ki\u1EC3m duy\u1EC7t (sai h\xECnh d\u1EA1ng).`)
45758
+ );
45759
+ return EXIT.USAGE;
45760
+ }
45761
+ const auditColumns = detectSeedAuditColumns(files);
45762
+ const enrichedHypothesis = applySeedAuditColumns(hypothesis, auditColumns);
45763
+ const addedAuditColumns = seedAuditAddedColumns(hypothesis, enrichedHypothesis);
45764
+ if (addedAuditColumns.length > 0) {
45765
+ console.error(
45766
+ dim(
45767
+ `[data-seed] B\u1ED5 sung ${addedAuditColumns.length} c\u1ED9t audit NOT NULL t\u1EEB entity: ${addedAuditColumns.join(", ")} (raw JDBC INSERT kh\xF4ng qua AuditingEntityListener \u2014 tr\xE1nh ERROR 1364).`
45768
+ )
45769
+ );
45770
+ }
45771
+ seedPlan = buildDataSeedPlan(enrichedHypothesis);
45772
+ console.error(
45773
+ dim(
45774
+ `[data-seed] E1 s\u1EBD gieo ${hypothesis.targets.length} target v\xE0o @BeforeAll (scheme \`${hypothesis.scheme}\`).`
45775
+ )
45776
+ );
45777
+ } catch (e) {
45778
+ console.error(
45779
+ red(`Kh\xF4ng \u0111\u1ECDc \u0111\u01B0\u1EE3c --data-seed ${options.dataSeed}: ${e.message}`)
45780
+ );
45781
+ return EXIT.USAGE;
45782
+ }
45783
+ }
45784
+ let runtimeAuth;
45785
+ if (options.runtimeAuth !== void 0) {
45786
+ const authPath = resolve(options.runtimeAuth);
45787
+ try {
45788
+ const raw = JSON.parse(await readFile(authPath, "utf8"));
45789
+ const hypothesis = validateRuntimeAuthHypothesis(raw);
45790
+ if (hypothesis === null) {
45791
+ console.warn(
45792
+ yellow(
45793
+ `--runtime-auth ${options.runtimeAuth} kh\xF4ng qua \u0111\u01B0\u1EE3c ki\u1EC3m duy\u1EC7t \u2014 E1 ch\u1EA1y KH\xD4NG auth runtime (baseline 401 \u21D2 not-tested nh\u01B0 tr\u01B0\u1EDBc).`
45794
+ )
45795
+ );
45796
+ } else if (hypothesis.transport !== "bearer-header") {
45797
+ console.warn(
45798
+ yellow(
45799
+ `--runtime-auth: transport '${hypothesis.transport}' ch\u01B0a h\u1ED7 tr\u1EE3 \u1EDF E1 (ch\u1EC9 bearer-header) \u2014 E1 ch\u1EA1y KH\xD4NG auth runtime.`
45800
+ )
45801
+ );
45802
+ } else {
45803
+ runtimeAuth = { envVar: "CS_RUNTIME_TOKEN" };
45804
+ console.error(
45805
+ dim(
45806
+ `[runtime-auth] E1 g\u1EAFn Bearer runtime token t\u1EEB $CS_RUNTIME_TOKEN (scheme \`${hypothesis.scheme}\`) \u2014 token do pipeline mint, suite kh\xF4ng t\u1EF1 mint.`
45807
+ )
45808
+ );
45809
+ }
45810
+ } catch (e) {
45811
+ console.warn(
45812
+ yellow(
45813
+ `Kh\xF4ng \u0111\u1ECDc \u0111\u01B0\u1EE3c --runtime-auth ${options.runtimeAuth}: ${e.message} \u2014 E1 ch\u1EA1y KH\xD4NG auth runtime.`
45814
+ )
45815
+ );
45816
+ }
45817
+ }
44680
45818
  const suite = generateVerificationSuite(scenarios, {
44681
45819
  ...bootClass !== null ? { bootClass } : {},
44682
45820
  ...dbTier ? { dbTier } : {},
44683
45821
  ...options.dbRuntime ? { dbRuntime: options.dbRuntime } : {},
44684
45822
  ...authFills ? { authFills } : {},
44685
45823
  // ADR-0049 (#2b): --emit-evidence makes each @Test write a dual-run evidence sidecar.
44686
- ...options.emitEvidence ? { emitEvidence: true } : {}
45824
+ ...options.emitEvidence ? { emitEvidence: true } : {},
45825
+ ...seedPlan !== void 0 ? { seedPlan } : {},
45826
+ ...runtimeAuth !== void 0 ? { runtimeAuth } : {}
44687
45827
  });
44688
45828
  const emitDir = resolve(target, options.emitTests);
44689
45829
  const confirmedPlan = validateHarnessPlan(buildHarnessPlan(files), {
@@ -44958,6 +46098,10 @@ var runAssess = async (options, deps = {}) => {
44958
46098
  `,
44959
46099
  "utf8"
44960
46100
  );
46101
+ const probeScript = renderDastProbeScript(dastManifest);
46102
+ if (probeScript !== null) {
46103
+ await writeFile(resolve(emitDir, DAST_PROBE_SCRIPT_FILE), probeScript, "utf8");
46104
+ }
44961
46105
  } catch (e) {
44962
46106
  console.error(red(`Kh\xF4ng ghi \u0111\u01B0\u1EE3c k\u1EBF ho\u1EA1ch DAST: ${e.message}`));
44963
46107
  return EXIT.RUNTIME;
@@ -45213,7 +46357,7 @@ var openBrowser = async (url) => {
45213
46357
  else await execFile2("xdg-open", [url]);
45214
46358
  };
45215
46359
  var credentialStore = () => createPlatformCredentialStore();
45216
- var sleep2 = (milliseconds) => new Promise((resolve54) => setTimeout(resolve54, milliseconds));
46360
+ var sleep2 = (milliseconds) => new Promise((resolve55) => setTimeout(resolve55, milliseconds));
45217
46361
  var defaults = () => ({
45218
46362
  store: credentialStore(),
45219
46363
  start: startDeviceAuthorization,
@@ -46266,7 +47410,7 @@ var resolveGroupedRoutingLimits = (input4) => {
46266
47410
  const tokenBudget = Math.max(2e3, input4.tokenBudget ?? 5e4);
46267
47411
  const fileTokens = Math.max(1, input4.estimateTokens(input4.profile.file.content));
46268
47412
  const ruleTexts = input4.groups.flatMap(
46269
- (group) => group.rules.map((rule) => `${rule.id}
47413
+ (group2) => group2.rules.map((rule) => `${rule.id}
46270
47414
  ${rule.title}
46271
47415
  ${rule.description ?? ""}`)
46272
47416
  );
@@ -46313,7 +47457,7 @@ var buildFullReviewSmartSelection = (input4) => {
46313
47457
  }
46314
47458
  return selected;
46315
47459
  };
46316
- var selectRulesForGroup = (group, profile, maxRules) => group.rules.filter(
47460
+ var selectRulesForGroup = (group2, profile, maxRules) => group2.rules.filter(
46317
47461
  (rule) => classifyRuleApplicability(rule, profile) !== PR_RULE_APPLICABILITY.NOT_APPLICABLE
46318
47462
  ).sort(
46319
47463
  (a, b) => (b.prRouting?.riskWeight ?? 0) - (a.prRouting?.riskWeight ?? 0) || a.id.localeCompare(b.id)
@@ -46348,11 +47492,11 @@ var buildAiReviewPlan = (input4) => {
46348
47492
  });
46349
47493
  limitsByFile.set(profile.file.path, limits);
46350
47494
  let groupsForFile = 0;
46351
- for (const group of groups) {
47495
+ for (const group2 of groups) {
46352
47496
  if (groupsForFile >= limits.maxGroupsPerFile) break;
46353
- const rules = selectRulesForGroup(group, profile, limits.maxRulesPerGroup);
47497
+ const rules = selectRulesForGroup(group2, profile, limits.maxRulesPerGroup);
46354
47498
  if (rules.length === 0) continue;
46355
- groupedCalls.push({ profile, groupId: group.id, rules });
47499
+ groupedCalls.push({ profile, groupId: group2.id, rules });
46356
47500
  groupsForFile += 1;
46357
47501
  }
46358
47502
  }
@@ -46362,8 +47506,8 @@ var buildAiReviewPlan = (input4) => {
46362
47506
  if (maxSpecializedCalls > 0) {
46363
47507
  const candidates = [];
46364
47508
  for (const profile of primaryProfiles) {
46365
- for (const group of groups) {
46366
- for (const rule of group.rules) {
47509
+ for (const group2 of groups) {
47510
+ for (const rule of group2.rules) {
46367
47511
  if (!ruleMatchesProfile(rule, profile)) continue;
46368
47512
  candidates.push({ profile, rule });
46369
47513
  }
@@ -50020,7 +51164,7 @@ var NodeFsHandler = class {
50020
51164
  this._addToNodeFs(path, initialAdd, wh, depth + 1);
50021
51165
  }
50022
51166
  }).on(EV.ERROR, this._boundHandleError);
50023
- return new Promise((resolve54, reject) => {
51167
+ return new Promise((resolve55, reject) => {
50024
51168
  if (!stream)
50025
51169
  return reject();
50026
51170
  stream.once(STR_END, () => {
@@ -50029,7 +51173,7 @@ var NodeFsHandler = class {
50029
51173
  return;
50030
51174
  }
50031
51175
  const wasThrottled = throttler ? throttler.clear() : false;
50032
- resolve54(void 0);
51176
+ resolve55(void 0);
50033
51177
  previous.getChildren().filter((item15) => {
50034
51178
  return item15 !== directory && !current.has(item15);
50035
51179
  }).forEach((item15) => {
@@ -50988,11 +52132,11 @@ var getLocalEffectiveConfig = async (input4) => {
50988
52132
  }
50989
52133
  };
50990
52134
  var LABEL_WIDTH = 20;
50991
- var isRecord3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
52135
+ var isRecord4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
50992
52136
  var pick = (source, path) => {
50993
52137
  let current = source;
50994
52138
  for (const key of path) {
50995
- if (!isRecord3(current)) return void 0;
52139
+ if (!isRecord4(current)) return void 0;
50996
52140
  current = current[key];
50997
52141
  }
50998
52142
  return current;
@@ -51000,7 +52144,7 @@ var pick = (source, path) => {
51000
52144
  var asString6 = (value) => typeof value === "string" && value.length > 0 ? value : void 0;
51001
52145
  var countOf = (value) => {
51002
52146
  if (Array.isArray(value)) return value.length;
51003
- if (isRecord3(value)) return Object.keys(value).length;
52147
+ if (isRecord4(value)) return Object.keys(value).length;
51004
52148
  return 0;
51005
52149
  };
51006
52150
  var row = (label, value) => ` ${label.padEnd(LABEL_WIDTH)}${value}`;
@@ -52279,11 +53423,11 @@ var runWatchLoop = async (target, baseOptions) => {
52279
53423
  ignored,
52280
53424
  onBatch: (changed) => runIteration(changed)
52281
53425
  });
52282
- await new Promise((resolve54) => {
53426
+ await new Promise((resolve55) => {
52283
53427
  const onSigint = () => {
52284
53428
  console.log();
52285
53429
  console.log(dim("Stopping watcher\u2026"));
52286
- resolve54();
53430
+ resolve55();
52287
53431
  };
52288
53432
  process.once("SIGINT", onSigint);
52289
53433
  });
@@ -52689,6 +53833,17 @@ Ch\u1EA1y \`cs assess --emit-dast <dir>\` \u0111\u1EC3 sinh k\u1EBF ho\u1EA1ch t
52689
53833
  );
52690
53834
  return EXIT.USAGE;
52691
53835
  }
53836
+ let dastProbeAttempts = [];
53837
+ try {
53838
+ dastProbeAttempts = await readDastProbesIfPresent(options.dastPlan);
53839
+ } catch (e) {
53840
+ console.error(
53841
+ red(
53842
+ `Kh\xF4ng \u0111\u1ECDc/parse \u0111\u01B0\u1EE3c ${DAST_PROBE_FILE2} t\u1EA1i ${resolve(options.dastPlan, DAST_PROBE_FILE2)}: ${e.message}`
53843
+ )
53844
+ );
53845
+ return EXIT.USAGE;
53846
+ }
52692
53847
  dastReportPathResolved = resolve(options.dastReport);
52693
53848
  try {
52694
53849
  const rawDastReport = await readFile(dastReportPathResolved, "utf8");
@@ -52702,7 +53857,8 @@ Ch\u1EA1y \`cs assess --emit-dast <dir>\` \u0111\u1EC3 sinh k\u1EBF ho\u1EA1ch t
52702
53857
  ...messages !== void 0 ? { messages, scanCompleted: options.dastScanCompleted === true } : {},
52703
53858
  ...dastDefenseObservations !== void 0 ? { defenseObservations: dastDefenseObservations } : {},
52704
53859
  ...dastTrustTier !== void 0 ? { trustTier: dastTrustTier } : {},
52705
- ...dastAttemptId !== void 0 ? { attemptId: dastAttemptId } : {}
53860
+ ...dastAttemptId !== void 0 ? { attemptId: dastAttemptId } : {},
53861
+ ...dastProbeAttempts.length > 0 ? { probeAttempts: dastProbeAttempts } : {}
52706
53862
  });
52707
53863
  } catch (e) {
52708
53864
  console.error(
@@ -52951,6 +54107,17 @@ Ch\u1EA1y \`cs assess --emit-dast <dir>\` \u0111\u1EC3 sinh k\u1EBF ho\u1EA1ch t
52951
54107
  );
52952
54108
  return EXIT.USAGE;
52953
54109
  }
54110
+ let probeAttempts = [];
54111
+ try {
54112
+ probeAttempts = await readDastProbesIfPresent(options.plan);
54113
+ } catch (e) {
54114
+ console.error(
54115
+ red(
54116
+ `Kh\xF4ng \u0111\u1ECDc/parse \u0111\u01B0\u1EE3c ${DAST_PROBE_FILE2} t\u1EA1i ${resolve(options.plan, DAST_PROBE_FILE2)}: ${e.message}`
54117
+ )
54118
+ );
54119
+ return EXIT.USAGE;
54120
+ }
52954
54121
  const reportPath = resolve(options.report);
52955
54122
  let rawReport;
52956
54123
  try {
@@ -53036,7 +54203,9 @@ Ch\u1EA1y \`cs assess --emit-dast <dir>\` \u0111\u1EC3 sinh k\u1EBF ho\u1EA1ch t
53036
54203
  ...messages !== void 0 ? { messages, scanCompleted: options.scanCompleted === true } : {},
53037
54204
  ...defenseObservations !== void 0 ? { defenseObservations } : {},
53038
54205
  ...trustTier !== void 0 ? { trustTier } : {},
53039
- ...attemptId !== void 0 ? { attemptId } : {}
54206
+ ...attemptId !== void 0 ? { attemptId } : {},
54207
+ // [ADR-0071] probe pass 5 — only when attempts exist, else byte-identical.
54208
+ ...probeAttempts.length > 0 ? { probeAttempts } : {}
53040
54209
  };
53041
54210
  const runReport2 = ingestDast(manifest, parsed, ingestOptions);
53042
54211
  const version2 = toolVersion();
@@ -53106,6 +54275,13 @@ Ch\u1EA1y \`cs assess --emit-dast <dir>\` \u0111\u1EC3 sinh k\u1EBF ho\u1EA1ch t
53106
54275
  );
53107
54276
  }
53108
54277
  }
54278
+ if (probeAttempts.length > 0) {
54279
+ console.log(
54280
+ dim(
54281
+ ` \u{1F9EA} canary probe: ${probeAttempts.length} l\u1EA7n th\u1EED (ADR-0071) \u2014 ch\u1EC9 n\xE2ng not-tested \u2192 exploited khi canary kh\u1EDBp V\xC0 gate E1 pass; kh\xF4ng bao gi\u1EDD h\u1EA1 verdict`
54282
+ )
54283
+ );
54284
+ }
53109
54285
  if (!runReport2.reportHasSites && runReport2.resolutions.length > 0) {
53110
54286
  console.log(dim(" (report ZAP kh\xF4ng c\xF3 site n\xE0o \u2014 t\u1EA5t c\u1EA3 not-tested)"));
53111
54287
  }
@@ -54749,7 +55925,7 @@ var unwrapProjectReviewConfig = (value) => {
54749
55925
  }
54750
55926
  return typeof value === "object" && value !== null ? value : {};
54751
55927
  };
54752
- var isRecord4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
55928
+ var isRecord5 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
54753
55929
  var aiProviderConfigKey = (provider) => {
54754
55930
  switch (provider) {
54755
55931
  case "viettel-netmind":
@@ -54772,14 +55948,14 @@ var mergeIfMissing = (target, key, value) => {
54772
55948
  if (value !== void 0 && target[key] === void 0) target[key] = value;
54773
55949
  };
54774
55950
  var materializeDashboardRuntimeConfig = (config) => {
54775
- const ai = isRecord4(config.ai) ? { ...config.ai } : {};
55951
+ const ai = isRecord5(config.ai) ? { ...config.ai } : {};
54776
55952
  const provider = typeof ai.provider === "string" ? ai.provider : typeof config.aiProvider === "string" ? config.aiProvider : void 0;
54777
55953
  mergeIfMissing(ai, "provider", provider);
54778
55954
  mergeIfMissing(ai, "timeoutMs", config.aiTimeoutMs);
54779
55955
  if (provider && provider !== "none") {
54780
55956
  const providerKey = aiProviderConfigKey(provider);
54781
55957
  if (providerKey) {
54782
- const providerConfig = isRecord4(ai[providerKey]) ? { ...ai[providerKey] } : {};
55958
+ const providerConfig = isRecord5(ai[providerKey]) ? { ...ai[providerKey] } : {};
54783
55959
  if (typeof config.aiModel === "string" && config.aiModel.trim().length > 0) {
54784
55960
  mergeIfMissing(providerConfig, "model", config.aiModel.trim());
54785
55961
  }
@@ -54790,7 +55966,7 @@ var materializeDashboardRuntimeConfig = (config) => {
54790
55966
  }
54791
55967
  }
54792
55968
  if (Object.keys(ai).length > 0) config.ai = ai;
54793
- const review = isRecord4(config.review) ? { ...config.review } : {};
55969
+ const review = isRecord5(config.review) ? { ...config.review } : {};
54794
55970
  mergeIfMissing(review, "minSeverity", config.minSeverity);
54795
55971
  mergeIfMissing(review, "extraInstructions", config.extraInstructions);
54796
55972
  mergeIfMissing(
@@ -54799,7 +55975,7 @@ var materializeDashboardRuntimeConfig = (config) => {
54799
55975
  config.baseline === "capture" ? "apply" : config.baseline ?? (config.findingsMode === "all" ? "ignore" : void 0)
54800
55976
  );
54801
55977
  if (Object.keys(review).length > 0) config.review = review;
54802
- const report2 = isRecord4(config.report) ? { ...config.report } : {};
55978
+ const report2 = isRecord5(config.report) ? { ...config.report } : {};
54803
55979
  const reportFormat = config.reportFormat === "both" ? "markdown" : config.reportFormat;
54804
55980
  mergeIfMissing(report2, "format", reportFormat);
54805
55981
  mergeIfMissing(report2, "output", config.reportOutput);
@@ -54844,7 +56020,7 @@ var isConfigSyncFormatError = (error) => error instanceof Error && error.message
54844
56020
  var parseConfigFile = (text2) => parse(text2);
54845
56021
  var localConfigToDashboardPolicy = (value) => {
54846
56022
  const parsed = codeReviewConfigSchema.parse(value);
54847
- const raw = isRecord4(value) ? value : {};
56023
+ const raw = isRecord5(value) ? value : {};
54848
56024
  const policy = {};
54849
56025
  for (const key of Object.keys(raw)) {
54850
56026
  if (key === "dashboard") continue;
@@ -55579,9 +56755,194 @@ var runRuntimeAuthSeed = async (options) => {
55579
56755
  return EXIT.SUCCESS;
55580
56756
  };
55581
56757
 
56758
+ // src/commands/runtime-data-seed.command.ts
56759
+ init_dist7();
56760
+ init_dist2();
56761
+ init_dist5();
56762
+ init_dist();
56763
+ init_composition();
56764
+ init_load();
56765
+ init_exit_codes();
56766
+ init_find_files();
56767
+ var CONFIG_GLOBS2 = [
56768
+ "**/application*.yml",
56769
+ "**/application*.yaml",
56770
+ "**/application*.properties",
56771
+ "**/bootstrap*.yml",
56772
+ "**/bootstrap*.yaml",
56773
+ "**/bootstrap*.properties"
56774
+ ];
56775
+ var DB_BUILD_GLOBS2 = ["**/pom.xml", "**/build.gradle", "**/build.gradle.kts"];
56776
+ var JAVA_GLOBS3 = ["**/*.java"];
56777
+ var SCHEMA_GLOBS = [
56778
+ "**/liquibase/**",
56779
+ "**/flyway/**",
56780
+ "**/db/migration/**",
56781
+ "**/*changelog*.xml",
56782
+ "**/schema.sql",
56783
+ "**/data.sql",
56784
+ "**/import.sql"
56785
+ ];
56786
+ var EXCLUDES3 = ["**/node_modules/**", "**/dist/**", "**/target/**"];
56787
+ var MAX_EXCERPTS2 = 40;
56788
+ var ENTITY_RE = /@(Entity|Table)\b/;
56789
+ var buildDataSeedEvidence = (schemaFiles, entityFiles, configs) => [...schemaFiles, ...entityFiles, ...configs].slice(0, MAX_EXCERPTS2);
56790
+ var runRuntimeDataSeed = async (options) => {
56791
+ if (options.emitHypothesis !== void 0 && options.hypothesis !== void 0) {
56792
+ console.error(
56793
+ "[data-seed] --emit-hypothesis v\xE0 --hypothesis lo\u1EA1i tr\u1EEB nhau: m\u1ED9t b\xEAn GI\u1EA2I (ch\u1EA1y ngo\xE0i namespace c\xF4 l\u1EADp, n\u01A1i c\xF3 egress AI), m\u1ED9t b\xEAn TI\xCAU TH\u1EE4 (ch\u1EA1y trong pod, render SQL)."
56794
+ );
56795
+ return EXIT.USAGE;
56796
+ }
56797
+ if (options.renderSql !== void 0 && options.hypothesis === void 0) {
56798
+ console.error("[data-seed] --render-sql c\u1EA7n --hypothesis (lane ti\xEAu th\u1EE5 trong pod).");
56799
+ return EXIT.USAGE;
56800
+ }
56801
+ const source = resolve(process.cwd(), options.source);
56802
+ const configResult = await findFiles({
56803
+ projectRoot: source,
56804
+ include: CONFIG_GLOBS2,
56805
+ exclude: EXCLUDES3
56806
+ });
56807
+ const configs = configResult.ok ? configResult.value.map((f) => ({ path: f.path, content: f.content })) : [];
56808
+ const buildResult2 = await findFiles({
56809
+ projectRoot: source,
56810
+ include: DB_BUILD_GLOBS2,
56811
+ exclude: EXCLUDES3
56812
+ });
56813
+ const javaResult = await findFiles({
56814
+ projectRoot: source,
56815
+ include: JAVA_GLOBS3,
56816
+ exclude: EXCLUDES3
56817
+ });
56818
+ const javaFiles = javaResult.ok ? javaResult.value : [];
56819
+ const endpoints = javaResult.ok ? extractHttpEndpoints(javaResult.value) : [];
56820
+ if (options.emitHypothesis !== void 0) {
56821
+ let resolver = createStubRuntimeDataSeedResolver();
56822
+ if (options.useAi === true) {
56823
+ const logger = createLogger({ level: "warn", destination: "stderr" });
56824
+ const config = await loadConfig(
56825
+ options.config === void 0 ? { cwd: source } : { cwd: source, configPath: resolve(process.cwd(), options.config) }
56826
+ );
56827
+ const client = config.ok ? buildAiClient(config.value.config, logger) : null;
56828
+ if (!config.ok) {
56829
+ console.error(
56830
+ `[data-seed] KH\xD4NG N\u1EA0P \u0110\u01AF\u1EE2C CONFIG (${config.error.message.split(String.fromCharCode(10))[0]}) \u2192 d\xF9ng resolver r\u1ED7ng. \u0110\xE2y l\xE0 l\u1ED7i FILE C\u1EA4U H\xCCNH, kh\xF4ng ph\u1EA3i thi\u1EBFu provider.`
56831
+ );
56832
+ } else if (client === null) {
56833
+ console.error(
56834
+ "[data-seed] --ai \u0111\u01B0\u1EE3c y\xEAu c\u1EA7u nh\u01B0ng kh\xF4ng c\xF3 provider AI n\xE0o c\u1EA5u h\xECnh \u0111\u01B0\u1EE3c (ai.provider=none ho\u1EB7c thi\u1EBFu key) \u2192 d\xF9ng resolver r\u1ED7ng."
56835
+ );
56836
+ } else {
56837
+ const resolverOptions = { client, logger };
56838
+ resolver = createRuntimeDataSeedResolver(resolverOptions);
56839
+ console.error(`[data-seed] H\u1ECFi gi\u1EA3 thuy\u1EBFt d\u1EEF li\u1EC7u qua ${client.name}.`);
56840
+ }
56841
+ }
56842
+ const manifest = buildReachabilityManifest(endpoints, {});
56843
+ const endpointSummaries = dataSeedEndpointSummaries(manifest.entries);
56844
+ const schemaResult = await findFiles({
56845
+ projectRoot: source,
56846
+ include: SCHEMA_GLOBS,
56847
+ exclude: EXCLUDES3
56848
+ });
56849
+ const schemaFiles = schemaResult.ok ? schemaResult.value.map((f) => ({ path: f.path, content: f.content })) : [];
56850
+ const entityFiles = javaFiles.filter((f) => ENTITY_RE.test(f.content)).map((f) => ({ path: f.path, content: f.content }));
56851
+ const excerpts = buildDataSeedEvidence(schemaFiles, entityFiles, configs);
56852
+ if (options.useAi === true) {
56853
+ const chars = excerpts.reduce((n, e) => n + e.content.length, 0);
56854
+ console.error(
56855
+ `[data-seed] B\u1EB1ng ch\u1EE9ng: ${excerpts.length} excerpt \xB7 ${chars} k\xFD t\u1EF1 \xB7 ${endpointSummaries.length} endpoint c\u1EA7n seed.`
56856
+ );
56857
+ }
56858
+ const { hypothesis, outcome, rejectedShape } = await resolveRuntimeDataSeedHypothesis(
56859
+ resolver,
56860
+ {
56861
+ endpoints: endpointSummaries,
56862
+ excerpts
56863
+ }
56864
+ );
56865
+ if (hypothesis === null) {
56866
+ const why = outcome === "resolver-error" ? "G\u1ECCI PROVIDER TH\u1EA4T B\u1EA0I (m\u1EA1ng/egress/kho\xE1) \u2014 kh\xF4ng ph\u1EA3i model kh\xF4ng t\xECm ra g\xEC; xem d\xF2ng WARN c\u1EE7a resolver ngay tr\xEAn" : outcome === "rejected" ? `model C\xD3 tr\u1EA3 l\u1EDDi nh\u01B0ng KH\xD4NG QUA \u0111\u01B0\u1EE3c ki\u1EC3m duy\u1EC7t (sai h\xECnh d\u1EA1ng) \u2014 v\u1EA5n \u0111\u1EC1 schema/prompt, kh\xF4ng ph\u1EA3i m\u1EA1ng. H\xECnh d\u1EA1ng nh\u1EADn \u0111\u01B0\u1EE3c: ${rejectedShape ?? "(kh\xF4ng c\xF3)"}` : "kh\xF4ng c\xF3 \u0111\u1EC1 xu\u1EA5t n\xE0o (resolver t\u1EEB ch\u1ED1i, ho\u1EB7c \u0111ang d\xF9ng resolver r\u1ED7ng)";
56867
+ console.error(
56868
+ `[data-seed] ${why} \u2192 KH\xD4NG ghi gi\u1EA3 thuy\u1EBFt; lane runtime s\u1EBD ch\u1EA1y \u0111\u01B0\u1EDDng t\u1EA5t \u0111\u1ECBnh (kh\xF4ng gieo d\u1EEF li\u1EC7u).`
56869
+ );
56870
+ return EXIT.SUCCESS;
56871
+ }
56872
+ const out = resolve(process.cwd(), options.emitHypothesis);
56873
+ await mkdir(resolve(out, ".."), { recursive: true });
56874
+ await writeFile(out, `${JSON.stringify(hypothesis, null, 2)}
56875
+ `, "utf8");
56876
+ console.error(
56877
+ `[data-seed] \u0110\xE3 ghi gi\u1EA3 thuy\u1EBFt \`${hypothesis.scheme}\` (${hypothesis.targets.length} target) ra ${options.emitHypothesis}; KH\xD4NG render SQL \u1EDF \u0111\xE2y.`
56878
+ );
56879
+ return EXIT.SUCCESS;
56880
+ }
56881
+ if (options.hypothesis !== void 0) {
56882
+ const path = resolve(process.cwd(), options.hypothesis);
56883
+ let validated = null;
56884
+ try {
56885
+ const raw = JSON.parse(await readFile(path, "utf8"));
56886
+ validated = validateRuntimeDataSeedHypothesis(raw);
56887
+ if (validated === null) {
56888
+ const problem = describeRuntimeDataSeedHypothesisProblem(raw);
56889
+ console.error(
56890
+ `[data-seed] Gi\u1EA3 thuy\u1EBFt n\u1EA1p t\u1EEB ${options.hypothesis} KH\xD4NG qua \u0111\u01B0\u1EE3c ki\u1EC3m duy\u1EC7t (sai h\xECnh d\u1EA1ng${problem !== null ? `: ${problem}` : ""}) \u2192 KH\xD4NG render SQL.`
56891
+ );
56892
+ } else {
56893
+ console.error(
56894
+ `[data-seed] D\xF9ng gi\u1EA3 thuy\u1EBFt \`${validated.scheme}\` \u0111\xE3 gi\u1EA3i s\u1EB5n ngo\xE0i namespace c\xF4 l\u1EADp (kh\xF4ng g\u1ECDi model \u1EDF \u0111\xE2y).`
56895
+ );
56896
+ }
56897
+ } catch (e) {
56898
+ console.error(
56899
+ `[data-seed] Kh\xF4ng \u0111\u1ECDc \u0111\u01B0\u1EE3c gi\u1EA3 thuy\u1EBFt t\u1EEB ${options.hypothesis} (${e.message}) \u2192 KH\xD4NG render SQL.`
56900
+ );
56901
+ }
56902
+ if (validated === null) return EXIT.SUCCESS;
56903
+ const auditColumns = detectSeedAuditColumns(javaFiles);
56904
+ const enriched = applySeedAuditColumns(validated, auditColumns);
56905
+ const addedAuditColumns = seedAuditAddedColumns(validated, enriched);
56906
+ if (addedAuditColumns.length > 0) {
56907
+ console.error(
56908
+ `[data-seed] B\u1ED5 sung ${addedAuditColumns.length} c\u1ED9t audit NOT NULL t\u1EEB entity: ${addedAuditColumns.join(", ")} (raw JDBC INSERT kh\xF4ng qua AuditingEntityListener \u2014 tr\xE1nh ERROR 1364).`
56909
+ );
56910
+ }
56911
+ const dbTier = detectDbTier([
56912
+ ...configResult.ok ? configResult.value : [],
56913
+ ...buildResult2.ok ? buildResult2.value : []
56914
+ ]);
56915
+ const dialect = dbTier?.dialect ?? "generic";
56916
+ let sql2;
56917
+ try {
56918
+ sql2 = renderDataSeedSql(enriched, dialect);
56919
+ } catch (e) {
56920
+ console.error(
56921
+ `[data-seed] Render SQL th\u1EA5t b\u1EA1i (${e.message}) \u2192 KH\xD4NG gieo d\u1EEF li\u1EC7u.`
56922
+ );
56923
+ return EXIT.SUCCESS;
56924
+ }
56925
+ const renderOut = options.renderSql;
56926
+ if (renderOut === void 0) return EXIT.USAGE;
56927
+ const out = resolve(process.cwd(), renderOut);
56928
+ await mkdir(resolve(out, ".."), { recursive: true });
56929
+ await writeFile(out, sql2, "utf8");
56930
+ console.error(
56931
+ `[data-seed] \u0110\xE3 render ${validated.targets.length} target \u2192 ${renderOut} (dialect: ${dialect}).`
56932
+ );
56933
+ console.error(`[data-seed] \u0110\u1ED8 L\u1EC6CH: ${runtimeDataSeedDeviationBanner(validated)}`);
56934
+ return EXIT.SUCCESS;
56935
+ }
56936
+ console.error(
56937
+ "[data-seed] Ch\u01B0a ch\u1EC9 \u0111\u1ECBnh vi\u1EC7c c\u1EA7n l\xE0m: d\xF9ng --emit-hypothesis (gi\u1EA3i ngo\xE0i pod, k\xE8m --ai) ho\u1EB7c --hypothesis + --render-sql (ti\xEAu th\u1EE5 trong pod)."
56938
+ );
56939
+ return EXIT.USAGE;
56940
+ };
56941
+
55582
56942
  // src/commands/package.command.ts
55583
56943
  init_dist5();
55584
56944
  var HYPOTHESIS_ENTRY = ".code-sentinel/auth-hypothesis.json";
56945
+ var DATA_SEED_HYPOTHESIS_ENTRY = ".code-sentinel/data-seed-hypothesis.json";
55585
56946
  var AI_TRIAGE_ENTRY = ".code-sentinel/ai-triage-assessment.json";
55586
56947
  var formatBytes = (n) => n > 1024 * 1024 ? `${(n / (1024 * 1024)).toFixed(1)} MB` : `${(n / 1024).toFixed(0)} KB`;
55587
56948
  var runPackageCommand = async (options) => {
@@ -55613,10 +56974,11 @@ ${candidates.map((c) => ` ${c}`).join("\n")}
55613
56974
  return 2;
55614
56975
  }
55615
56976
  let planWithAuth = plan;
55616
- const shouldResolveAuth = options.resolveAuth === true || options.push === true && (Boolean(process.env.LLM_API_KEY) || Boolean(process.env.NETMIND_API_KEY) || Boolean(process.env.CODE_SENTINEL_AI_KEY));
56977
+ const resolveAuthLocally = options.resolveAuth === true && !options.push;
56978
+ const resolveAuthOnServer = options.resolveAuth === true && options.push === true;
55617
56979
  let hypothesisTmp;
55618
56980
  let triageTmp;
55619
- if (shouldResolveAuth) {
56981
+ if (resolveAuthLocally) {
55620
56982
  hypothesisTmp = join(tmpdir(), `cs-auth-hypothesis-${process.pid}-${Date.now()}.json`);
55621
56983
  triageTmp = join(tmpdir(), `cs-ai-triage-${process.pid}-${Date.now()}.json`);
55622
56984
  await runRuntimeAuthSeed({
@@ -55637,7 +56999,7 @@ ${candidates.map((c) => ` ${c}`).join("\n")}
55637
56999
  newEntries.push({ name: HYPOTHESIS_ENTRY, absolutePath: hypothesisTmp });
55638
57000
  } else {
55639
57001
  process.stderr.write(
55640
- `cs package: khong giai duoc gia thuyet xac thuc \u2014 ZIP khong mang gia thuyet, lane runtime se chay duong tat dinh${String.fromCharCode(10)}`
57002
+ `cs package: kh\xF4ng gi\u1EA3i \u0111\u01B0\u1EE3c gi\u1EA3 thuy\u1EBFt x\xE1c th\u1EF1c \u2014 ZIP kh\xF4ng mang gi\u1EA3 thuy\u1EBFt, lane runtime s\u1EBD ch\u1EA1y \u0111\u01B0\u1EDDng t\u1EA5t \u0111\u1ECBnh${String.fromCharCode(10)}`
55641
57003
  );
55642
57004
  }
55643
57005
  if (existsSync(triageTmp)) {
@@ -55645,12 +57007,37 @@ ${candidates.map((c) => ` ${c}`).join("\n")}
55645
57007
  }
55646
57008
  planWithAuth = { ...plan, entries: newEntries };
55647
57009
  }
57010
+ let dataSeedTmp;
57011
+ if (options.resolveDataSeed === true) {
57012
+ dataSeedTmp = join(tmpdir(), `cs-data-seed-${process.pid}-${Date.now()}.json`);
57013
+ await runRuntimeDataSeed({
57014
+ source: join(repoRoot, modulePath),
57015
+ useAi: true,
57016
+ emitHypothesis: dataSeedTmp,
57017
+ ...options.config === void 0 ? {} : { config: options.config }
57018
+ });
57019
+ if (existsSync(dataSeedTmp)) {
57020
+ planWithAuth = {
57021
+ ...planWithAuth,
57022
+ entries: [
57023
+ ...planWithAuth.entries,
57024
+ { name: DATA_SEED_HYPOTHESIS_ENTRY, absolutePath: dataSeedTmp }
57025
+ ]
57026
+ };
57027
+ } else {
57028
+ process.stderr.write(
57029
+ `cs package: kh\xF4ng gi\u1EA3i \u0111\u01B0\u1EE3c gi\u1EA3 thuy\u1EBFt d\u1EEF li\u1EC7u \u2014 ZIP kh\xF4ng mang data-seed, E1.5 s\u1EBD \u0111\u1ECDc baseline-unreachable th\u1EADt${String.fromCharCode(10)}`
57030
+ );
57031
+ }
57032
+ }
55648
57033
  const outPath = resolve(
55649
57034
  options.out ?? `${basename(plan.modulePath.replace(/\/$/, "")) || "service"}.zip`
55650
57035
  );
55651
57036
  const bytes = writePackageZip(planWithAuth, outPath);
55652
57037
  if (hypothesisTmp !== void 0) rmSync(hypothesisTmp, { force: true });
57038
+ if (hypothesisTmp !== void 0) rmSync(hypothesisTmp, { force: true });
55653
57039
  if (triageTmp !== void 0) rmSync(triageTmp, { force: true });
57040
+ if (dataSeedTmp !== void 0) rmSync(dataSeedTmp, { force: true });
55654
57041
  process.stdout.write(`Packaged ${plan.modulePath} \u2192 ${outPath} (${formatBytes(bytes)})
55655
57042
  `);
55656
57043
  process.stdout.write(` ${planWithAuth.entries.length} files
@@ -55717,6 +57104,9 @@ H\xE3y ch\u1EA1y \`cs auth login\`.`
55717
57104
  const formData = new FormData();
55718
57105
  formData.append("sourceKind", "archive");
55719
57106
  formData.append("archive", new Blob([readFileSync3(outPath)]), basename(outPath));
57107
+ if (resolveAuthOnServer) {
57108
+ formData.append("useAi", "true");
57109
+ }
55720
57110
  const res = await fetch(url, {
55721
57111
  method: "POST",
55722
57112
  headers: { authorization: `Bearer ${token}` },
@@ -57323,7 +58713,7 @@ var runServerRunner = async (options = {}) => {
57323
58713
  init_dist5();
57324
58714
  init_exit_codes();
57325
58715
  init_find_files();
57326
- var CONFIG_GLOBS2 = [
58716
+ var CONFIG_GLOBS3 = [
57327
58717
  "**/application*.yml",
57328
58718
  "**/application*.yaml",
57329
58719
  "**/application*.properties",
@@ -57346,7 +58736,7 @@ var runRuntimeAuthToken = async (options) => {
57346
58736
  const source = resolve(process.cwd(), options.source);
57347
58737
  const filesResult = await findFiles({
57348
58738
  projectRoot: source,
57349
- include: CONFIG_GLOBS2,
58739
+ include: CONFIG_GLOBS3,
57350
58740
  exclude: CONFIG_EXCLUDES
57351
58741
  });
57352
58742
  if (!filesResult.ok) {
@@ -57454,31 +58844,51 @@ var countConcluded = (doc) => {
57454
58844
  }
57455
58845
  return concluded;
57456
58846
  };
58847
+ var BASELINE_STATUS_RE = /trả HTTP (\d{3})/;
57457
58848
  var detectBaselineRefusal = async (dir) => {
57458
58849
  let entries;
57459
58850
  try {
57460
58851
  entries = await readdir(dir);
57461
58852
  } catch {
57462
- return { refused: false, evidence: null };
58853
+ return { refused: false, evidence: [] };
57463
58854
  }
57464
58855
  let total = 0;
57465
58856
  let skipped = 0;
58857
+ let measuredStatus;
58858
+ let skipMessage;
57466
58859
  for (const entry of entries) {
57467
58860
  if (!entry.toLowerCase().endsWith(".xml")) continue;
57468
58861
  const content = await readFile(join(dir, entry), "utf8").catch(() => null);
57469
58862
  if (content === null) continue;
57470
58863
  for (const testCase of parseJUnitXml(content)) {
57471
58864
  total += 1;
57472
- if (testCase.outcome === "skipped") skipped += 1;
58865
+ if (testCase.outcome === "skipped") {
58866
+ skipped += 1;
58867
+ if (measuredStatus === void 0 && testCase.message !== void 0) {
58868
+ const match = BASELINE_STATUS_RE.exec(testCase.message);
58869
+ const statusText = match?.[1];
58870
+ if (statusText !== void 0) {
58871
+ measuredStatus = Number(statusText);
58872
+ skipMessage = testCase.message;
58873
+ }
58874
+ }
58875
+ }
57473
58876
  }
57474
58877
  }
57475
- if (total === 0 || skipped !== total) return { refused: false, evidence: null };
57476
- return {
57477
- refused: true,
57478
- evidence: {
58878
+ if (total === 0 || skipped !== total) return { refused: false, evidence: [] };
58879
+ const rows = [
58880
+ {
57479
58881
  source: "e1.junit",
57480
58882
  verbatim: `Tests run: ${total}, Skipped: ${skipped} \u2014 every generated test skipped on the E1.5 baseline gate`
57481
58883
  }
58884
+ ];
58885
+ if (skipMessage !== void 0) {
58886
+ rows.push({ source: "e1.junit.skipMessage", verbatim: skipMessage });
58887
+ }
58888
+ return {
58889
+ refused: true,
58890
+ evidence: rows,
58891
+ ...measuredStatus !== void 0 ? { measuredStatus } : {}
57482
58892
  };
57483
58893
  };
57484
58894
  var runRuntimeOutcome = async (options) => {
@@ -57525,7 +58935,8 @@ var runRuntimeOutcome = async (options) => {
57525
58935
  evidence17.push({ source: "app.bootFailure", verbatim: bootFailure });
57526
58936
  }
57527
58937
  const appExitCode = options.appExitCode;
57528
- if (appServedHttp && appExitCode !== void 0 && Number.isInteger(appExitCode) && !RUNNER_ENDED_EXIT_CODES.has(appExitCode)) {
58938
+ const appDiedAbnormally = appServedHttp && appExitCode !== void 0 && Number.isInteger(appExitCode) && !RUNNER_ENDED_EXIT_CODES.has(appExitCode);
58939
+ if (appDiedAbnormally) {
57529
58940
  evidence17.push({
57530
58941
  source: "app.exitCode",
57531
58942
  verbatim: `application exited ${appExitCode} after serving HTTP (not the runner's lifetime cap or teardown signal)`
@@ -57541,10 +58952,12 @@ var runRuntimeOutcome = async (options) => {
57541
58952
  const scenariosConcluded = countConcluded(correlationDoc);
57542
58953
  if (correlationDoc !== null) delivered.push("correlation");
57543
58954
  let oracleRefusedOnBaseline = false;
58955
+ let measuredBaselineStatus;
57544
58956
  if (options.junitDir !== void 0) {
57545
58957
  const refusal = await detectBaselineRefusal(resolve(cwd, options.junitDir));
57546
58958
  oracleRefusedOnBaseline = refusal.refused;
57547
- if (refusal.evidence) evidence17.push(refusal.evidence);
58959
+ evidence17.push(...refusal.evidence);
58960
+ if (refusal.measuredStatus !== void 0) measuredBaselineStatus = refusal.measuredStatus;
57548
58961
  if (refusal.refused || scenariosConcluded > 0) delivered.push("e1-evidence");
57549
58962
  }
57550
58963
  const signals = {
@@ -57557,7 +58970,11 @@ var runRuntimeOutcome = async (options) => {
57557
58970
  appServedHttp,
57558
58971
  scenariosGenerated,
57559
58972
  scenariosConcluded,
58973
+ ...measuredBaselineStatus !== void 0 ? { authBaselineStatus: measuredBaselineStatus } : {},
57560
58974
  ...oracleRefusedOnBaseline ? { oracleRefusedOnBaseline: true } : {},
58975
+ ...options.e2Scanned !== void 0 ? { e2ScannedCount: options.e2Scanned } : {},
58976
+ ...options.e2AuthGated !== void 0 ? { e2AuthGatedCount: options.e2AuthGated } : {},
58977
+ ...appDiedAbnormally ? { appDiedAbnormally: true } : {},
57561
58978
  ...options.runnerFault !== void 0 ? { runnerFault: options.runnerFault } : {}
57562
58979
  };
57563
58980
  const { tier, stopReason } = classifyRuntimeOutcome(signals);
@@ -57568,7 +58985,11 @@ var runRuntimeOutcome = async (options) => {
57568
58985
  if (stopReason === "runner-fault" && options.runnerFault === void 0) {
57569
58986
  evidence17.push({
57570
58987
  source: "ladder.derivation",
57571
- verbatim: "the oracle had work and produced no conclusion, and no auth-gate signal explained it; the remainder is ours"
58988
+ // Two different derivations reach `runner-fault` here, and saying the wrong one is how a
58989
+ // reader is sent at the wrong subsystem. When the app DIED, an auth-gate signal may well
58990
+ // have been present — it was simply not the cause — so the old wording ("no auth-gate
58991
+ // signal explained it") would have been false in exactly the case that matters most.
58992
+ verbatim: appDiedAbnormally ? "the oracle had work and produced no conclusion because the application process died under it; any auth-gate signal describes a target that was no longer running" : "the oracle had work and produced no conclusion; no measured baseline status and no E2 telemetry explained it, so the remainder is ours"
57572
58993
  });
57573
58994
  }
57574
58995
  if (options.runnerFault !== void 0) {
@@ -58900,6 +60321,12 @@ var buildProgram = () => {
58900
60321
  ).option(
58901
60322
  "--emit-evidence",
58902
60323
  "with --emit-tests: each @Test also writes a dual-run evidence sidecar for `cs verify --evidence` (ADR-0049)"
60324
+ ).option(
60325
+ "--data-seed <file>",
60326
+ "with --emit-tests: seed the resolved data hypothesis (ADR-0070) in the suite @BeforeAll so the E1.5 baseline passes; resolve it once via `cs package --resolve-data-seed`"
60327
+ ).option(
60328
+ "--runtime-auth <file>",
60329
+ "with --emit-tests: the E1 suite attaches a REAL bearer token from $CS_RUNTIME_TOKEN (minted by the pipeline; ADR-0070 part c) instead of the E1.5 Spring-Security-Test principal; resolve it once via `cs package --resolve-auth`"
58903
60330
  ).option(
58904
60331
  "--json <path>",
58905
60332
  "also write the machine-readable assessment JSON (audit spine) to <path> (ADR-0036)"
@@ -58950,6 +60377,8 @@ var buildProgram = () => {
58950
60377
  ...typeof opts.dbRuntime === "string" && opts.dbRuntime.length > 0 ? { dbRuntime: opts.dbRuntime } : {},
58951
60378
  ...opts.authLlm === true ? { authLlm: true } : {},
58952
60379
  ...opts.emitEvidence === true ? { emitEvidence: true } : {},
60380
+ ...typeof opts.dataSeed === "string" && opts.dataSeed.length > 0 ? { dataSeed: opts.dataSeed } : {},
60381
+ ...typeof opts.runtimeAuth === "string" && opts.runtimeAuth.length > 0 ? { runtimeAuth: opts.runtimeAuth } : {},
58953
60382
  ...typeof opts.json === "string" && opts.json.length > 0 ? { json: opts.json } : {},
58954
60383
  // [ADR-0061]/[ADR-0063]/[ADR-0064] — the three artifact folds. These were DECLARED as
58955
60384
  // options and never forwarded, so `cs assess --review-report x.json` parsed the flag and
@@ -58970,7 +60399,7 @@ var buildProgram = () => {
58970
60399
  silent: opts.silent === true
58971
60400
  });
58972
60401
  });
58973
- program.command("verify").description(
60402
+ program.command("verify", internalCommand).description(
58974
60403
  "X\xE1c minh Pentest \u2014 ingest k\u1EBFt qu\u1EA3 JUnit c\u1EE7a CI, flip verdict suspected\u2192exploited/blocked (ADR-0033)"
58975
60404
  ).requiredOption(
58976
60405
  "--tests <dir>",
@@ -58999,7 +60428,7 @@ var buildProgram = () => {
58999
60428
  silent: opts.silent === true
59000
60429
  });
59001
60430
  });
59002
- program.command("client-verify").description(
60431
+ program.command("client-verify", internalCommand).description(
59003
60432
  "X\xE1c minh Pentest CLIENT \u2014 ingest report Playwright c\u1EE7a CI, flip verdict suspected\u2192exploited/blocked (ADR-0044)"
59004
60433
  ).requiredOption(
59005
60434
  "--tests <dir>",
@@ -59015,7 +60444,7 @@ var buildProgram = () => {
59015
60444
  silent: opts.silent === true
59016
60445
  });
59017
60446
  });
59018
- program.command("runtime-auth-token").description(
60447
+ program.command("runtime-auth-token", internalCommand).description(
59019
60448
  "Mint token auth runtime (JHipster JWT) t\u1EEB source \u0111\xE3 stage \u2014 in ra stdout \u0111\u1EC3 workflow capture (ADR-0065)"
59020
60449
  ).requiredOption("--source <dir>", "th\u01B0 m\u1EE5c source \u0111\xE3 stage (ch\u1EE9a config mang signing key)").option(
59021
60450
  "--recipe <path>",
@@ -59026,7 +60455,7 @@ var buildProgram = () => {
59026
60455
  ...typeof opts.recipe === "string" && opts.recipe.length > 0 ? { recipe: opts.recipe } : {}
59027
60456
  });
59028
60457
  });
59029
- program.command("runtime-auth-seed").description(
60458
+ program.command("runtime-auth-seed", internalCommand).description(
59030
60459
  "Gieo state phi\xEAn x\xE1c th\u1EF1c cho t\u1EA7ng runtime r\u1ED3i in token ra stdout \u2014 ch\u1EA1y TR\u01AF\u1EDAC khi app kh\u1EDFi \u0111\u1ED9ng (ADR-0068)"
59031
60460
  ).requiredOption("--source <dir>", "th\u01B0 m\u1EE5c source \u0111\xE3 stage (ch\u1EE9a config mang signing key)").option("--redis-host <host>", "host c\u1EE7a Redis sidecar d\xF9ng-m\u1ED9t-l\u1EA7n", "127.0.0.1").option("--redis-port <port>", "port c\u1EE7a Redis sidecar d\xF9ng-m\u1ED9t-l\u1EA7n", "6379").option(
59032
60461
  "--ai",
@@ -59052,12 +60481,50 @@ var buildProgram = () => {
59052
60481
  redisPort: Number.isInteger(port) && port > 0 ? port : 6379
59053
60482
  });
59054
60483
  });
60484
+ program.command("runtime-data-seed", internalCommand).description(
60485
+ "Gieo d\u1EEF li\u1EC7u nghi\u1EC7p v\u1EE5 cho baseline E1.5 (ADR-0070) \u2014 gi\u1EA3i gi\u1EA3 thuy\u1EBFt ngo\xE0i pod ho\u1EB7c render SQL trong pod"
60486
+ ).requiredOption("--source <dir>", "th\u01B0 m\u1EE5c source \u0111\xE3 stage (ch\u1EE9a changelog/entity mang schema)").option(
60487
+ "--ai",
60488
+ "h\u1ECFi model xem c\u1EA7n gieo h\xE0ng n\xE0o (ADR-0070 part b) \u2014 m\u1EB7c \u0111\u1ECBnh T\u1EAET, ch\u1EA1y offline"
60489
+ ).option(
60490
+ "--config <file>",
60491
+ "file c\u1EA5u h\xECnh t\u01B0\u1EDDng minh (c\u1EA7n cho --ai: kho\xE1 API ch\u1EC9 t\u1EDBi provider qua n\u1ED9i suy config)"
60492
+ ).option(
60493
+ "--emit-hypothesis <file>",
60494
+ "GI\u1EA2I gi\u1EA3 thuy\u1EBFt r\u1ED3i D\u1EEANG, ghi ra file \u2014 ch\u1EA1y NGO\xC0I namespace c\xF4 l\u1EADp (n\u01A1i g\u1ECDi \u0111\u01B0\u1EE3c provider)"
60495
+ ).option(
60496
+ "--hypothesis <file>",
60497
+ "TI\xCAU TH\u1EE4 gi\u1EA3 thuy\u1EBFt \u0111\xE3 gi\u1EA3i s\u1EB5n (\u0111\u01B0\u1EE3c ki\u1EC3m duy\u1EC7t l\u1EA1i) thay v\xEC h\u1ECFi model \u2014 ch\u1EA1y TRONG pod"
60498
+ ).option(
60499
+ "--render-sql <out>",
60500
+ "render gi\u1EA3 thuy\u1EBFt th\xE0nh M\u1ED8T file SQL cho db sidecar \xE1p sau khi app kh\u1ECFe (lane E2) \u2014 c\u1EA7n --hypothesis"
60501
+ ).action(async (opts) => {
60502
+ process.exitCode = await runRuntimeDataSeed({
60503
+ source: opts.source,
60504
+ useAi: opts.ai === true,
60505
+ ...typeof opts.config === "string" && opts.config.length > 0 ? { config: opts.config } : {},
60506
+ ...typeof opts.emitHypothesis === "string" && opts.emitHypothesis.length > 0 ? { emitHypothesis: opts.emitHypothesis } : {},
60507
+ ...typeof opts.hypothesis === "string" && opts.hypothesis.length > 0 ? { hypothesis: opts.hypothesis } : {},
60508
+ ...typeof opts.renderSql === "string" && opts.renderSql.length > 0 ? { renderSql: opts.renderSql } : {}
60509
+ });
60510
+ });
60511
+ program.command("pentest").description("\u0110\xF3ng g\xF3i, gi\u1EA3i quy\u1EBFt x\xE1c th\u1EF1c b\u1EB1ng AI v\xE0 \u0111\u1EA9y m\xE3 ngu\u1ED3n l\xEAn Server Pentest").requiredOption("--source <dir>", "th\u01B0 m\u1EE5c g\u1ED1c repository").option("--module <path>", "module c\u1EA7n \u0111\xF3ng g\xF3i, \u0111\u01B0\u1EDDng d\u1EABn t\u01B0\u01A1ng \u0111\u1ED1i so v\u1EDBi g\u1ED1c repo").action(async (options) => {
60512
+ process.exitCode = await runPackageCommand({
60513
+ ...options,
60514
+ resolveAuth: true,
60515
+ resolveDataSeed: true,
60516
+ push: true
60517
+ });
60518
+ });
59055
60519
  program.command("package").description("\u0110\xF3ng g\xF3i M\u1ED8T service (k\xE8m parent pom + jar khai b\xE1o) th\xE0nh ZIP, c\xF3 t\u1EF1 ki\u1EC3m").requiredOption("--source <dir>", "th\u01B0 m\u1EE5c g\u1ED1c repository").option("--module <path>", "module c\u1EA7n \u0111\xF3ng g\xF3i, \u0111\u01B0\u1EDDng d\u1EABn t\u01B0\u01A1ng \u0111\u1ED1i so v\u1EDBi g\u1ED1c repo").option("--out <file>", "\u0111\u01B0\u1EDDng d\u1EABn file zip \u0111\u1EA7u ra").option(
59056
60520
  "--resolve-auth",
59057
- "h\u1ECFi model gi\u1EA3 thuy\u1EBFt x\xE1c th\u1EF1c NGAY T\u1EA0I \u0110\xC2Y r\u1ED3i nh\xFAng v\xE0o ZIP (namespace pentest b\u1ECB c\xF4 l\u1EADp egress n\xEAn kh\xF4ng h\u1ECFi \u0111\u01B0\u1EE3c t\u1EEB trong \u0111\xF3)"
60521
+ "h\u1ECFi model gi\u1EA3i thuy\u1EBFt x\xE1c th\u1EF1c NGAY T\u1EA0I \u0110\xC2Y (n\u1EBFu kh\xF4ng push) ho\u1EB7c T\u1EA0I SERVER (n\u1EBFu c\xF3 push)"
60522
+ ).option(
60523
+ "--resolve-data-seed",
60524
+ "h\u1ECFi model gi\u1EA3 thuy\u1EBFt d\u1EEF li\u1EC7u (ADR-0070) NGAY T\u1EA0I \u0110\xC2Y r\u1ED3i nh\xFAng v\xE0o ZIP \u2014 E1.5 c\u1EA7n baseline \u0111i qua \u0111\u01B0\u1EE3c"
59058
60525
  ).option(
59059
60526
  "--config <file>",
59060
- "file c\u1EA5u h\xECnh cho --resolve-auth (kho\xE1 API ch\u1EC9 t\u1EDBi provider qua n\u1ED9i suy config)"
60527
+ "file c\u1EA5u h\xECnh cho --resolve-auth / --resolve-data-seed (kho\xE1 API ch\u1EC9 t\u1EDBi provider qua n\u1ED9i suy config)"
59061
60528
  ).option(
59062
60529
  "--push",
59063
60530
  "\u0110\xF3ng g\xF3i xong t\u1EF1 \u0111\u1ED9ng \u0111\u1EA9y l\xEAn m\xE1y ch\u1EE7 Pentest (t\u01B0\u01A1ng \u0111\u01B0\u01A1ng upload Dashboard)"
@@ -59066,12 +60533,13 @@ var buildProgram = () => {
59066
60533
  process.exitCode = await runPackageCommand({
59067
60534
  ...options,
59068
60535
  resolveAuth: options.resolveAuth === true,
60536
+ resolveDataSeed: options.resolveDataSeed === true,
59069
60537
  ...typeof options.config === "string" && options.config.length > 0 ? { config: options.config } : {},
59070
60538
  push: options.push === true
59071
60539
  });
59072
60540
  }
59073
60541
  );
59074
- program.command("runtime-outcome").description(
60542
+ program.command("runtime-outcome", internalCommand).description(
59075
60543
  "T\xEDnh b\u1EADc k\u1EBFt qu\u1EA3 T0-T4 (ADR-0069) cho m\u1ED9t l\u1EA7n n\u1ED9p ZIP \u2014 in JSON \u0111\u1EC3 g\u1EAFn v\xE0o payload ho\xE0n t\u1EA5t"
59076
60544
  ).option("--archive <path>", "file ZIP \u0111\xE3 n\u1ED9p (l\u1EA5y t\xEDn hi\u1EC7u T0/T1 qua preflight)").option("--assessment <path>", "audit.json t\u1EEB `cs assess` (c\xF3 m\u1EB7t = lane t\u0129nh \u0111\xE3 ch\u1EA1y tr\u1ECDn)").option("--suite <path>", "code-sentinel-suite.json (\u0111\u1EBFm k\u1ECBch b\u1EA3n E1 sinh ra)").option("--dast-manifest <path>", "code-sentinel-dast.json (\u0111\u1EBFm k\u1ECBch b\u1EA3n E2 sinh ra)").option("--dast-report <path>", "b\xE1o c\xE1o ZAP (c\xF3 m\u1EB7t = \u0111\xE3 giao b\u1EB1ng ch\u1EE9ng E2)").option("--correlation <path>", "code-sentinel-correlation.json (\u0111\u1EBFm k\u1ECBch b\u1EA3n \u0111\xE3 k\u1EBFt lu\u1EADn)").option("--junit-dir <dir>", "th\u01B0 m\u1EE5c JUnit XML c\u1EE7a E1 (ph\xE1t hi\u1EC7n oracle t\u1EEB ch\u1ED1i v\xEC baseline)").option(
59077
60545
  "--build-outcome <state>",
@@ -59083,6 +60551,12 @@ var buildProgram = () => {
59083
60551
  ).option(
59084
60552
  "--app-exit-code <n>",
59085
60553
  "m\xE3 tho\xE1t c\u1EE7a ti\u1EBFn tr\xECnh app (124 = tr\u1EA7n th\u1EDDi gian c\u1EE7a runner, 143 = SIGTERM teardown \u2014 c\u1EA3 hai KH\xD4NG ph\u1EA3i l\u1ED7i app)"
60554
+ ).option(
60555
+ "--e2-scanned <n>",
60556
+ "QUAN S\xC1T E2: s\u1ED1 message ZAP \u0111\xE3 qu\xE9t \u1EE9ng d\u1EE5ng (telemetry real-HTTP, [ADR-0070])"
60557
+ ).option(
60558
+ "--e2-auth-gated <n>",
60559
+ "QUAN S\xC1T E2: s\u1ED1 response 401/403 trong s\u1ED1 message ZAP \u0111\xE3 qu\xE9t ([ADR-0070])"
59086
60560
  ).option(
59087
60561
  "--runner-fault <message>",
59088
60562
  "CH\u1EC8 \u0111\u1EB7t khi ch\xEDnh runner h\u1ECFng (\xE9p stopReason runner-fault)"
@@ -59117,12 +60591,16 @@ var buildProgram = () => {
59117
60591
  // A non-numeric value is DROPPED rather than coerced: `Number('')` is 0 and `Number('x')`
59118
60592
  // is NaN, and either would let a value nobody measured decide whether the run is clean.
59119
60593
  ...Number.isInteger(Number(opts.appExitCode)) && String(opts.appExitCode).trim() !== "" ? { appExitCode: Number(opts.appExitCode) } : {},
60594
+ // Same drop-don't-coerce rule as --app-exit-code: a value nobody measured (empty
60595
+ // string, NaN) must not decide how the run is classified.
60596
+ ...Number.isInteger(Number(opts.e2Scanned)) && String(opts.e2Scanned).trim() !== "" ? { e2Scanned: Number(opts.e2Scanned) } : {},
60597
+ ...Number.isInteger(Number(opts.e2AuthGated)) && String(opts.e2AuthGated).trim() !== "" ? { e2AuthGated: Number(opts.e2AuthGated) } : {},
59120
60598
  ...typeof opts.runnerFault === "string" ? { runnerFault: opts.runnerFault } : {},
59121
60599
  ...Array.isArray(opts.stepFailure) ? { stepFailures: opts.stepFailure } : {},
59122
60600
  ...Array.isArray(opts.deviation) ? { deviations: opts.deviation } : {}
59123
60601
  });
59124
60602
  });
59125
- program.command("correlate").description(
60603
+ program.command("correlate", internalCommand).description(
59126
60604
  "\u0110\u1ED1i chi\u1EBFu xuy\xEAn t\u1EA7ng \u2014 m\xE3 \xD7 E1/JUnit \xD7 E2/DAST \xD7 E1.9/Playwright to\xE0n checklist (ADR-0036/0038/0044)"
59127
60605
  ).requiredOption("--assessment <path>", "file JSON m\xE1y-\u0111\u1ECDc t\u1EEB `cs assess --json <path>`").option(
59128
60606
  "--tests <dir>",
@@ -59199,7 +60677,7 @@ var buildProgram = () => {
59199
60677
  silent: opts.silent === true
59200
60678
  });
59201
60679
  });
59202
- program.command("dast-verify").description(
60680
+ program.command("dast-verify", internalCommand).description(
59203
60681
  "X\xE1c minh DAST \u2014 ingest report ZAP c\u1EE7a b\u1EA1n, flip verdict scan target suspected\u2192exploited/blocked (ADR-0038)"
59204
60682
  ).requiredOption(
59205
60683
  "--plan <dir>",
@@ -59250,7 +60728,7 @@ var buildProgram = () => {
59250
60728
  silent: opts.silent === true
59251
60729
  });
59252
60730
  });
59253
- program.command("sast-verify").description("External SAST \u2014 ingest Semgrep SARIF, corroborate checklist (ADR-0048)").requiredOption("--assessment <path>", "file JSON t\u1EEB `cs assess --json <path>`").requiredOption("--report <path>", "file SARIF do team ch\u1EA1y Semgrep sinh ra").option("-o, --output <file>", "report output (default code-sentinel-sast-verification.md)").option("--silent", "no console summary; only write the report file").action(async (opts) => {
60731
+ program.command("sast-verify", internalCommand).description("External SAST \u2014 ingest Semgrep SARIF, corroborate checklist (ADR-0048)").requiredOption("--assessment <path>", "file JSON t\u1EEB `cs assess --json <path>`").requiredOption("--report <path>", "file SARIF do team ch\u1EA1y Semgrep sinh ra").option("-o, --output <file>", "report output (default code-sentinel-sast-verification.md)").option("--silent", "no console summary; only write the report file").action(async (opts) => {
59254
60732
  process.exitCode = await runSastVerify({
59255
60733
  ...typeof opts.assessment === "string" && opts.assessment.length > 0 ? { assessment: opts.assessment } : {},
59256
60734
  ...typeof opts.report === "string" && opts.report.length > 0 ? { report: opts.report } : {},