@clear-capabilities/agentic-security-scanner 0.150.1 → 0.151.0

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 (89) hide show
  1. package/CHANGELOG.md +137 -0
  2. package/bin/agentic-security.js +73 -10
  3. package/dist/1122.index.js +16 -16
  4. package/dist/1208.index.js +23 -0
  5. package/dist/1301.index.js +3 -3
  6. package/dist/1379.index.js +3 -3
  7. package/dist/1444.index.js +3 -3
  8. package/dist/1660.index.js +1 -1
  9. package/dist/1700.index.js +5 -5
  10. package/dist/1905.index.js +12 -12
  11. package/dist/1920.index.js +10 -10
  12. package/dist/2238.index.js +4 -4
  13. package/dist/2271.index.js +3 -3
  14. package/dist/2432.index.js +8 -8
  15. package/dist/2659.index.js +1 -1
  16. package/dist/2826.index.js +2 -2
  17. package/dist/2830.index.js +3 -3
  18. package/dist/2923.index.js +1 -1
  19. package/dist/3001.index.js +4 -4
  20. package/dist/3117.index.js +4 -4
  21. package/dist/3180.index.js +9 -9
  22. package/dist/3276.index.js +1 -1
  23. package/dist/3415.index.js +1 -1
  24. package/dist/3499.index.js +1 -1
  25. package/dist/3518.index.js +4 -4
  26. package/dist/3736.index.js +7 -7
  27. package/dist/3839.index.js +4 -4
  28. package/dist/4113.index.js +441 -418
  29. package/dist/4265.index.js +4 -4
  30. package/dist/4384.index.js +8 -3
  31. package/dist/4399.index.js +29 -3
  32. package/dist/4547.index.js +2 -2
  33. package/dist/4863.index.js +6 -6
  34. package/dist/4970.index.js +2 -2
  35. package/dist/5051.index.js +15 -15
  36. package/dist/5144.index.js +4 -4
  37. package/dist/5333.index.js +8 -8
  38. package/dist/5343.index.js +2 -2
  39. package/dist/5350.index.js +6 -6
  40. package/dist/5561.index.js +1 -1
  41. package/dist/5637.index.js +10 -5
  42. package/dist/5724.index.js +21642 -0
  43. package/dist/5756.index.js +99 -489
  44. package/dist/5830.index.js +3 -3
  45. package/dist/6257.index.js +21 -8
  46. package/dist/6626.index.js +5 -5
  47. package/dist/6662.index.js +1 -1
  48. package/dist/6675.index.js +4 -4
  49. package/dist/6730.index.js +10 -10
  50. package/dist/6829.index.js +4 -4
  51. package/dist/6944.index.js +2 -2
  52. package/dist/6994.index.js +5 -5
  53. package/dist/7039.index.js +83 -19
  54. package/dist/7178.index.js +11 -6
  55. package/dist/7227.index.js +3 -3
  56. package/dist/7552.index.js +2 -2
  57. package/dist/7709.index.js +2 -2
  58. package/dist/7838.index.js +1037 -0
  59. package/dist/8218.index.js +4 -4
  60. package/dist/8476.index.js +4 -4
  61. package/dist/8513.index.js +8 -8
  62. package/dist/8520.index.js +1 -1
  63. package/dist/8752.index.js +4 -4
  64. package/dist/9207.index.js +2 -2
  65. package/dist/9220.index.js +5 -5
  66. package/dist/9390.index.js +6 -6
  67. package/dist/9503.index.js +2 -2
  68. package/dist/9560.index.js +3232 -0
  69. package/dist/957.index.js +4 -4
  70. package/dist/9801.index.js +1 -1
  71. package/dist/9824.index.js +5 -5
  72. package/dist/agentic-security.mjs +23 -23
  73. package/dist/agentic-security.mjs.sha256 +1 -1
  74. package/package.json +21 -3
  75. package/src/dataflow/catalog.js +52 -0
  76. package/src/egress/redact.js +1 -1
  77. package/src/engine.js +13 -2
  78. package/src/lineage/source-registry.js +8 -0
  79. package/src/llm-validator/agent-loop.js +85 -5
  80. package/src/llm-validator/fix-proposal.js +16 -3
  81. package/src/llm-validator/model-capabilities.js +26 -1
  82. package/src/llm-validator/model-probe.js +46 -8
  83. package/src/llm-validator/ollama-provider.js +26 -1
  84. package/src/llm-validator/oom-feedback.js +69 -0
  85. package/src/llm-validator/providers.js +50 -0
  86. package/src/llm-validator/redact.js +177 -11
  87. package/src/posture/deterministic-fix.js +11 -0
  88. package/src/report/index.js +14 -3
  89. package/src/sast/java-ast-folding.js +18 -2
@@ -2,7 +2,7 @@ export const id = 5830;
2
2
  export const ids = [5830];
3
3
  export const modules = {
4
4
 
5
- /***/ 5830:
5
+ /***/ 95830:
6
6
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7
7
 
8
8
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -13,8 +13,8 @@ export const modules = {
13
13
  /* harmony export */ stampFindingTimestamps: () => (/* binding */ stampFindingTimestamps)
14
14
  /* harmony export */ });
15
15
  /* unused harmony export findingsExceedingSLA */
16
- /* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7598);
17
- /* harmony import */ var _provenance_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4594);
16
+ /* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77598);
17
+ /* harmony import */ var _provenance_schema_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34594);
18
18
  // 0.8.0 Feat-11: MTTR / finding-age tracking — per-finding firstSeenAt/lastSeenAt with SLA breach detection.
19
19
  //
20
20
  // Stamps every finding with `firstSeenAt` (preserved from the baseline if the
@@ -2,7 +2,7 @@ export const id = 6257;
2
2
  export const ids = [6257];
3
3
  export const modules = {
4
4
 
5
- /***/ 6257:
5
+ /***/ 66257:
6
6
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7
7
 
8
8
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -10,10 +10,10 @@ export const modules = {
10
10
  /* harmony export */ proposeOllamaFix: () => (/* binding */ proposeOllamaFix)
11
11
  /* harmony export */ });
12
12
  /* unused harmony export buildFixPrompt */
13
- /* harmony import */ var _egress_redact_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4831);
14
- /* harmony import */ var _egress_policy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5712);
15
- /* harmony import */ var _providers_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8947);
16
- /* harmony import */ var _ollama_provider_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3837);
13
+ /* harmony import */ var _egress_redact_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(74831);
14
+ /* harmony import */ var _egress_policy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45712);
15
+ /* harmony import */ var _providers_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38947);
16
+ /* harmony import */ var _ollama_provider_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23837);
17
17
  // Ollama-assisted patch proposal for the `fix` role, used only when no
18
18
  // deterministic/stored patch exists (agentic-security-ollama-offline-prd.md
19
19
  // §33). Before this module, `fix`/`poc`/`explain`/`logic` had NO call site
@@ -68,7 +68,7 @@ const FIX_PROPOSAL_ERROR = Object.freeze({
68
68
  * through the same redaction pipeline llm-validator/index.js's renderPrompt
69
69
  * uses, and is framed as data the model must never treat as instructions.
70
70
  */
71
- function buildFixPrompt(finding, fileContent, scanRoot) {
71
+ function buildFixPrompt(finding, fileContent, scanRoot, rejectionFeedback) {
72
72
  const sterileContent = (0,_egress_redact_js__WEBPACK_IMPORTED_MODULE_0__/* .redactPayload */ .cy)({ text: String(fileContent || ''), filePath: finding.file, scanRoot }).text;
73
73
  return [
74
74
  'You are a security patch-synthesis component. You PROPOSE a fix; a separate',
@@ -87,6 +87,19 @@ function buildFixPrompt(finding, fileContent, scanRoot) {
87
87
  sterileContent,
88
88
  '--- END-UNTRUSTED-FILE-CONTENT ---',
89
89
  '',
90
+ // Adversarial-review fix (2026-09): at temperature 0 with the SAME
91
+ // prompt, a rejected patch would very likely just reproduce itself on
92
+ // retry — this is the one place cmdFix's bounded one-time retry
93
+ // (bin/agentic-security.js) feeds the deterministic gate's OWN rejection
94
+ // reason back in, so the second attempt has an actual reason to differ
95
+ // rather than repeating the first attempt's exact mistake.
96
+ ...(rejectionFeedback ? [
97
+ 'Your previous proposal for this exact finding was REJECTED by the',
98
+ 'deterministic verification gate below. Propose a DIFFERENT fix that',
99
+ 'avoids this specific problem — do not repeat the same patch:',
100
+ ` ${String(rejectionFeedback).slice(0, 500)}`,
101
+ '',
102
+ ] : []),
90
103
  'Propose a minimal, targeted fix for the finding above. Reply with ONLY a',
91
104
  'single JSON object, no other text:',
92
105
  '{"target_file": "<must exactly equal the File given above>", ' +
@@ -110,7 +123,7 @@ function validateFixResponse(obj, { file }) {
110
123
  * @returns {{ok:true, replacement, rationale, expectedSecurityEffect,
111
124
  * testsToRun, model} | {ok:false, code, reason}}
112
125
  */
113
- async function proposeOllamaFix({ finding, fileContent, scanRoot, env = process.env }) {
126
+ async function proposeOllamaFix({ finding, fileContent, scanRoot, env = process.env, rejectionFeedback } = {}) {
114
127
  const resolved = (0,_providers_js__WEBPACK_IMPORTED_MODULE_2__.resolveProvider)({ role: 'fix', env });
115
128
  if (!resolved.ok || resolved.config.provider !== 'ollama') {
116
129
  return {
@@ -128,7 +141,7 @@ async function proposeOllamaFix({ finding, fileContent, scanRoot, env = process.
128
141
  return { ok: false, code: FIX_PROPOSAL_ERROR.POLICY_BLOCKED, reason: decision.reason, egressDecision: decision };
129
142
  }
130
143
 
131
- const prompt = buildFixPrompt(finding, fileContent, scanRoot);
144
+ const prompt = buildFixPrompt(finding, fileContent, scanRoot, rejectionFeedback);
132
145
  const oc = resolved.config.ollama;
133
146
  const r = await (0,_ollama_provider_js__WEBPACK_IMPORTED_MODULE_3__/* .callOllamaStructured */ .uM)({
134
147
  host: resolved.config.endpoint,
@@ -2,7 +2,7 @@ export const id = 6626;
2
2
  export const ids = [6626,2659];
3
3
  export const modules = {
4
4
 
5
- /***/ 2659:
5
+ /***/ 42659:
6
6
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7
7
 
8
8
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -90,7 +90,7 @@ function validateImpactAssessment(record) {
90
90
 
91
91
  /***/ }),
92
92
 
93
- /***/ 6626:
93
+ /***/ 66626:
94
94
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
95
95
 
96
96
 
@@ -251,11 +251,11 @@ function showDisconnected(graph) {
251
251
  }
252
252
 
253
253
  // EXTERNAL MODULE: ./src/lineage/export-json.js
254
- var export_json = __webpack_require__(859);
254
+ var export_json = __webpack_require__(40859);
255
255
  // EXTERNAL MODULE: ./src/lineage/ids.js
256
- var ids = __webpack_require__(5034);
256
+ var ids = __webpack_require__(45034);
257
257
  // EXTERNAL MODULE: ./src/lineage/impact-assessment.js
258
- var impact_assessment = __webpack_require__(2659);
258
+ var impact_assessment = __webpack_require__(42659);
259
259
  ;// CONCATENATED MODULE: ./src/lineage/impact-engine.js
260
260
  // impact-engine.js — M5 deliverable #4 (FR-507): the pure read/
261
261
  // aggregate computation behind "assess impact" from a compromised
@@ -10,7 +10,7 @@ __webpack_require__.r(__webpack_exports__);
10
10
  /* harmony export */ evaluateDriftPolicies: () => (/* binding */ evaluateDriftPolicies),
11
11
  /* harmony export */ loadDriftPolicies: () => (/* binding */ loadDriftPolicies)
12
12
  /* harmony export */ });
13
- /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3024);
13
+ /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73024);
14
14
  // drift-policy.js — M4 deliverable #8, sub-project 8b, Task 2: a
15
15
  // before/after drift-policy DSL evaluated against a GraphDiff (Task 1's
16
16
  // own output, see graph-diff.js).
@@ -2,16 +2,16 @@ export const id = 6675;
2
2
  export const ids = [6675];
3
3
  export const modules = {
4
4
 
5
- /***/ 6675:
5
+ /***/ 46675:
6
6
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7
7
 
8
8
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9
9
  /* harmony export */ runOnce: () => (/* binding */ runOnce)
10
10
  /* harmony export */ });
11
11
  /* unused harmony exports readDeps, _queryOsvForDep, loadState, persistState, loadConfig, formatPayload, _internals */
12
- /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3024);
13
- /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6760);
14
- /* harmony import */ var _state_dir_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1174);
12
+ /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73024);
13
+ /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76760);
14
+ /* harmony import */ var _state_dir_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31174);
15
15
  // Continuous CVE-watch daemon.
16
16
  //
17
17
  // Polls OSV for the project's dependency tree on a schedule (or one-shot),
@@ -2,7 +2,7 @@ export const id = 6730;
2
2
  export const ids = [6730,5144];
3
3
  export const modules = {
4
4
 
5
- /***/ 5144:
5
+ /***/ 45144:
6
6
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7
7
 
8
8
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -13,9 +13,9 @@ export const modules = {
13
13
  /* harmony export */ removeLegalHold: () => (/* binding */ removeLegalHold)
14
14
  /* harmony export */ });
15
15
  /* unused harmony export LEGAL_HOLD_FILE */
16
- /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3024);
17
- /* harmony import */ var _state_dir_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1174);
18
- /* harmony import */ var _artifact_registry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(471);
16
+ /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73024);
17
+ /* harmony import */ var _state_dir_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31174);
18
+ /* harmony import */ var _artifact_registry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70471);
19
19
  // FR-707 (assurance-hardening PRD): "Support legal hold and policy-
20
20
  // authorized retention exceptions | Legal hold is identity-bound, reasoned,
21
21
  // time-bounded where applicable, and auditable."
@@ -160,18 +160,18 @@ function removeLegalHold(scanRoot, artifact) {
160
160
 
161
161
  /***/ }),
162
162
 
163
- /***/ 6730:
163
+ /***/ 96730:
164
164
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
165
165
 
166
166
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
167
167
  /* harmony export */ findExpiredArtifacts: () => (/* binding */ findExpiredArtifacts)
168
168
  /* harmony export */ });
169
169
  /* unused harmony exports RETENTION_DEFAULTS, loadRetentionPolicy, effectiveTtlDays */
170
- /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3024);
171
- /* harmony import */ var _util_yaml_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2340);
172
- /* harmony import */ var _state_dir_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1174);
173
- /* harmony import */ var _artifact_registry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(471);
174
- /* harmony import */ var _legal_hold_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5144);
170
+ /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73024);
171
+ /* harmony import */ var _util_yaml_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(82340);
172
+ /* harmony import */ var _state_dir_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31174);
173
+ /* harmony import */ var _artifact_registry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(70471);
174
+ /* harmony import */ var _legal_hold_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(45144);
175
175
  // Retention policy: default and maximum TTL by artifact class (assurance-
176
176
  // hardening PRD FR-702).
177
177
  //
@@ -12,10 +12,10 @@ export const modules = {
12
12
  /* harmony export */ signObligationEvidencePack: () => (/* binding */ signObligationEvidencePack),
13
13
  /* harmony export */ verifyObligationEvidencePack: () => (/* binding */ verifyObligationEvidencePack)
14
14
  /* harmony export */ });
15
- /* harmony import */ var _evidence_bundle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8317);
16
- /* harmony import */ var _evidence_grade_wording_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3540);
17
- /* harmony import */ var _lineage_export_json_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(859);
18
- /* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7598);
15
+ /* harmony import */ var _evidence_bundle_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(98317);
16
+ /* harmony import */ var _evidence_grade_wording_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71159);
17
+ /* harmony import */ var _lineage_export_json_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(40859);
18
+ /* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77598);
19
19
  // obligation-evidence-pack.js — Milestone 4 sub-project 6c: signed,
20
20
  // versioned evidence packs for a Regulatory Obligation Overlay framework
21
21
  // evaluation (FR-504, PRD §10.10). Fourth sibling in the
@@ -2,7 +2,7 @@ export const id = 6944;
2
2
  export const ids = [6944];
3
3
  export const modules = {
4
4
 
5
- /***/ 6944:
5
+ /***/ 86944:
6
6
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7
7
 
8
8
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -11,7 +11,7 @@ export const modules = {
11
11
  /* harmony export */ Xv: () => (/* binding */ CSP_HEADER_VALUE),
12
12
  /* harmony export */ generateSessionToken: () => (/* binding */ generateSessionToken)
13
13
  /* harmony export */ });
14
- /* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7598);
14
+ /* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77598);
15
15
  // security.js — Milestone 3, sub-project Server, increment 1.
16
16
  //
17
17
  // Security primitives for the `explore` loopback HTTP server: session-token
@@ -2,7 +2,7 @@ export const id = 6994;
2
2
  export const ids = [6994];
3
3
  export const modules = {
4
4
 
5
- /***/ 6994:
5
+ /***/ 86994:
6
6
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7
7
 
8
8
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -10,10 +10,10 @@ export const modules = {
10
10
  /* harmony export */ proposeOllamaPoc: () => (/* binding */ proposeOllamaPoc)
11
11
  /* harmony export */ });
12
12
  /* unused harmony export buildPocPrompt */
13
- /* harmony import */ var _egress_redact_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4831);
14
- /* harmony import */ var _egress_policy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5712);
15
- /* harmony import */ var _providers_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8947);
16
- /* harmony import */ var _ollama_provider_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3837);
13
+ /* harmony import */ var _egress_redact_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(74831);
14
+ /* harmony import */ var _egress_policy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45712);
15
+ /* harmony import */ var _providers_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(38947);
16
+ /* harmony import */ var _ollama_provider_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23837);
17
17
  // Ollama-assisted PoC sketch for the `poc` role (agentic-security-ollama-offline-prd.md
18
18
  // §18.1 lists "PoC generation" among the P0-required model calls, alongside
19
19
  // fix/explain/logic/verify). Before this module `poc` had a reserved slot in
@@ -2,7 +2,7 @@ export const id = 7039;
2
2
  export const ids = [7039,4399];
3
3
  export const modules = {
4
4
 
5
- /***/ 4399:
5
+ /***/ 54399:
6
6
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7
7
 
8
8
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -14,7 +14,8 @@ export const modules = {
14
14
  /* harmony export */ recommendAdmission: () => (/* binding */ recommendAdmission)
15
15
  /* harmony export */ });
16
16
  /* unused harmony exports KNOWN_MODEL_SIZE_GB, evaluateMemoryAdmission */
17
- /* harmony import */ var node_os__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8161);
17
+ /* harmony import */ var node_os__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(48161);
18
+ /* harmony import */ var _oom_feedback_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6782);
18
19
  // Model family hints, RAM-aware memory profiles, and the memory-admission
19
20
  // check for the Ollama provider (agentic-security-ollama-offline-prd.md
20
21
  // §13, §14, §15, §22.3, §30).
@@ -36,6 +37,7 @@ export const modules = {
36
37
 
37
38
 
38
39
 
40
+
39
41
  // PRD §12/§13 FR-1203 — non-authoritative family hint from a model name.
40
42
  // Longest/most-specific pattern first so `qwen3.5:4b` doesn't fall through to
41
43
  // the bare `qwen` bucket.
@@ -217,7 +219,31 @@ function evaluateMemoryAdmission({
217
219
  * `{admitted:false}` with a human-readable explanation, which callers treat
218
220
  * as "run deterministic-only" (PRD §23.4).
219
221
  */
220
- function recommendAdmission({ profile, freeBytes, requestedContextTokens, requestedModel } = {}) {
222
+ function recommendAdmission(opts = {}) {
223
+ const result = _recommendAdmissionCore(opts);
224
+ // Adversarial-review fix (2026-09): a memory-admission ESTIMATE that
225
+ // actually caused a real OOM (ollama-provider.js's callOllamaChat now
226
+ // records this via oom-feedback.js) used to have no way to affect a
227
+ // future admission decision for the SAME model on the SAME machine — the
228
+ // exact same "admitted: true" would repeat forever. This does not
229
+ // recalibrate the underlying estimate (that needs real hardware variety
230
+ // one machine's observed failures can't substitute for); it attaches an
231
+ // honest warning so the decision is no longer presented with unqualified
232
+ // confidence.
233
+ const chosenModel = result.model || opts.requestedModel;
234
+ const prior = chosenModel ? (0,_oom_feedback_js__WEBPACK_IMPORTED_MODULE_1__/* .priorOOMFor */ .NL)(chosenModel) : null;
235
+ if (prior) {
236
+ return {
237
+ ...result,
238
+ priorOOMWarning: `'${chosenModel}' has previously failed with an out-of-memory error on this machine ` +
239
+ `(${prior.count} time${prior.count === 1 ? '' : 's'}, most recently ${new Date(prior.lastAt).toISOString()}). ` +
240
+ 'The memory estimate below may be optimistic for your hardware.',
241
+ };
242
+ }
243
+ return result;
244
+ }
245
+
246
+ function _recommendAdmissionCore({ profile, freeBytes, requestedContextTokens, requestedModel } = {}) {
221
247
  const p = MEMORY_PROFILES[profile];
222
248
  if (!p) return { admitted: false, reason: `unknown memory profile '${profile}'` };
223
249
 
@@ -263,19 +289,19 @@ function recommendAdmission({ profile, freeBytes, requestedContextTokens, reques
263
289
 
264
290
  /***/ }),
265
291
 
266
- /***/ 7039:
292
+ /***/ 27039:
267
293
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
268
294
 
269
295
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
270
296
  /* harmony export */ getModelCapabilities: () => (/* binding */ getModelCapabilities)
271
297
  /* harmony export */ });
272
- /* unused harmony exports capabilitiesFromShowMetadata, probeStructuredOutput, probeToolCalling, _internals */
273
- /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3024);
274
- /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6760);
275
- /* harmony import */ var node_os__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8161);
276
- /* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7598);
277
- /* harmony import */ var _ollama_provider_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3837);
278
- /* harmony import */ var _model_capabilities_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(4399);
298
+ /* unused harmony exports DEFAULT_CACHE_TTL_MS, capabilitiesFromShowMetadata, probeStructuredOutput, probeToolCalling, _internals */
299
+ /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73024);
300
+ /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76760);
301
+ /* harmony import */ var node_os__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(48161);
302
+ /* harmony import */ var node_crypto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77598);
303
+ /* harmony import */ var _ollama_provider_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23837);
304
+ /* harmony import */ var _model_capabilities_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(54399);
279
305
  // PRD §13.2 — the three-layer model capability detection strategy.
280
306
  //
281
307
  // LAYER A (metadata) is the cheapest and most authoritative: Ollama's own
@@ -296,10 +322,21 @@ function recommendAdmission({ profile, freeBytes, requestedContextTokens, reques
296
322
  // CACHE KEY = Ollama version + model digest + model name (PRD §13.2 exactly).
297
323
  // Digest is load-bearing: `ollama pull` replacing a tag's underlying weights
298
324
  // must invalidate the cache even though the name/tag string is unchanged.
299
- // Persisted forever (no TTL) because the key itself is what expires the
300
- // entry — a version/digest bump makes a new key, not a stale hit on the old
301
- // one. Same disk-cache directory convention as sca/sigstore-verify.js and
325
+ // Same disk-cache directory convention as sca/sigstore-verify.js and
302
326
  // engine.js's OSV cache (`~/.claude/agentic-security/<name>/`).
327
+ //
328
+ // TTL + force-reprobe (adversarial-review fix, 2026-09). The key-based
329
+ // invalidation above is real but not complete: this module's own comment
330
+ // used to claim the entry is safe "forever" because the key changes when
331
+ // the model does — but `/api/show` doesn't expose a digest on every Ollama
332
+ // version (falls back to model NAME alone then, a few lines below), so a
333
+ // same-tag re-pull, or simply an unlucky single-trial probe the first time
334
+ // (see probeStructuredOutput/probeToolCalling's own single-call design),
335
+ // had no way to ever self-correct short of a user manually deleting a file
336
+ // under `~/.claude/agentic-security/`. Two independent fixes, since either
337
+ // alone leaves a real gap: a default TTL as a safety net for the case
338
+ // nobody notices, and an explicit `force` option (`models test --force`)
339
+ // for the case someone DOES suspect a stale answer and wants it right now.
303
340
 
304
341
 
305
342
 
@@ -310,18 +347,38 @@ function recommendAdmission({ profile, freeBytes, requestedContextTokens, reques
310
347
 
311
348
  const CACHE_DIR = node_path__WEBPACK_IMPORTED_MODULE_1__.join(node_os__WEBPACK_IMPORTED_MODULE_2__.homedir(), '.claude', 'agentic-security', 'ollama-capability-cache');
312
349
 
350
+ // Default safety-net TTL: 30 days. Not the primary invalidation mechanism
351
+ // (the key is) — a backstop for the cases the key can't see: a same-tag
352
+ // re-pull on an Ollama version that doesn't expose a digest, or a single
353
+ // unlucky probe trial that happened to pass/fail against the model's true
354
+ // behavior. Overridable for anyone who wants a tighter or looser bound.
355
+ const DEFAULT_CACHE_TTL_MS = 30 * 24 * 60 * 60 * 1000;
356
+
313
357
  function _ensureCacheDir() { try { node_fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(CACHE_DIR, { recursive: true }); } catch {} }
314
358
  function _cacheKey(ollamaVersion, modelDigest, modelName) {
315
359
  return node_crypto__WEBPACK_IMPORTED_MODULE_3__.createHash('sha256').update(`${ollamaVersion}::${modelDigest}::${modelName}`).digest('hex');
316
360
  }
317
361
  function _cachePath(key) { return node_path__WEBPACK_IMPORTED_MODULE_1__.join(CACHE_DIR, key + '.json'); }
318
362
 
319
- function _readProbeCache(key) {
320
- try { return JSON.parse(node_fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(_cachePath(key), 'utf8')); } catch { return null; }
363
+ /**
364
+ * @returns {object|null} the cached probe RESULT (not the envelope), or
365
+ * `null` on a miss, a parse failure, OR an entry older than `ttlMs`.
366
+ */
367
+ function _readProbeCache(key, ttlMs) {
368
+ let envelope;
369
+ try { envelope = JSON.parse(node_fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(_cachePath(key), 'utf8')); } catch { return null; }
370
+ // Backward-compatible with a pre-TTL cache file that was just the bare
371
+ // result object (no `probedAt`) — treat an entry with no timestamp as
372
+ // fresh rather than discarding every cache written before this fix.
373
+ if (envelope && typeof envelope === 'object' && 'probedAt' in envelope && 'result' in envelope) {
374
+ if (Number.isFinite(ttlMs) && ttlMs > 0 && Date.now() - envelope.probedAt > ttlMs) return null;
375
+ return envelope.result;
376
+ }
377
+ return envelope;
321
378
  }
322
379
  function _writeProbeCache(key, value) {
323
380
  _ensureCacheDir();
324
- try { node_fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(_cachePath(key), JSON.stringify(value)); } catch {}
381
+ try { node_fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(_cachePath(key), JSON.stringify({ probedAt: Date.now(), result: value })); } catch {}
325
382
  }
326
383
 
327
384
  /**
@@ -424,9 +481,16 @@ function _mergeLayer(base, overlay, sourceFlag) {
424
481
  * should use, since Layer C spends real inference time on the user's
425
482
  * machine.
426
483
  *
484
+ * `force: true` (adversarial-review fix, 2026-09 — `models test --force`)
485
+ * skips reading the cache — always runs a fresh probe and overwrites
486
+ * whatever was there. `ttlMs` (default 30 days, `DEFAULT_CACHE_TTL_MS`)
487
+ * bounds how long a cached entry is trusted without either; pass `0`/
488
+ * `Infinity` to disable the TTL safety net entirely and rely on the key
489
+ * alone, matching this module's original design intent.
490
+ *
427
491
  * @returns {{ok:true, capabilities:object, cached:boolean} | {ok:false, code, reason}}
428
492
  */
429
- async function getModelCapabilities({ host, model, env = process.env, probe = false, timeouts, keepAlive } = {}) {
493
+ async function getModelCapabilities({ host, model, env = process.env, probe = false, force = false, ttlMs = DEFAULT_CACHE_TTL_MS, timeouts, keepAlive } = {}) {
430
494
  let capabilities = (0,_model_capabilities_js__WEBPACK_IMPORTED_MODULE_5__.capabilitiesFromFamilyHint)(model);
431
495
 
432
496
  const show = await (0,_ollama_provider_js__WEBPACK_IMPORTED_MODULE_4__/* .showOllamaModel */ .$G)({ host, model, timeouts });
@@ -447,7 +511,7 @@ async function getModelCapabilities({ host, model, env = process.env, probe = fa
447
511
  const modelDigest = show.ok && show.details?.digest ? show.details.digest : 'unknown-digest';
448
512
  const cacheKey = _cacheKey(ollamaVersion, modelDigest, model);
449
513
 
450
- const cached = _readProbeCache(cacheKey);
514
+ const cached = force ? null : _readProbeCache(cacheKey, ttlMs);
451
515
  if (cached) {
452
516
  return { ok: true, capabilities: _mergeLayer(capabilities, cached, 'runtimeProbe'), cached: true };
453
517
  }
@@ -3,18 +3,21 @@ export const ids = [7178];
3
3
  export const modules = {
4
4
 
5
5
  /***/ 7178:
6
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
6
+ /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
7
7
 
8
+ __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
8
9
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9
10
  /* harmony export */ runHistory: () => (/* binding */ runHistory),
10
11
  /* harmony export */ runWhatIf: () => (/* binding */ runWhatIf)
11
12
  /* harmony export */ });
12
13
  /* unused harmony export listHistoricalRefs */
13
- /* harmony import */ var node_child_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1421);
14
- /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3024);
15
- /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6760);
16
- /* harmony import */ var _util_git_hardening_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8844);
17
- /* harmony import */ var _engine_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9753);
14
+ /* harmony import */ var node_child_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31421);
15
+ /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73024);
16
+ /* harmony import */ var node_path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(76760);
17
+ /* harmony import */ var _util_git_hardening_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78844);
18
+ /* harmony import */ var _engine_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(67198);
19
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_engine_js__WEBPACK_IMPORTED_MODULE_4__]);
20
+ _engine_js__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
18
21
  // Time-travel + counterfactual scanning (v0.68).
19
22
  //
20
23
  // Two new modes that exploit the pure-input shape of runFullScan:
@@ -262,6 +265,8 @@ function _walkWorkingTree(root) {
262
265
  return out;
263
266
  }
264
267
 
268
+ __webpack_async_result__();
269
+ } catch(e) { __webpack_async_result__(e); } });
265
270
 
266
271
  /***/ })
267
272
 
@@ -2,15 +2,15 @@ export const id = 7227;
2
2
  export const ids = [7227];
3
3
  export const modules = {
4
4
 
5
- /***/ 7227:
5
+ /***/ 67227:
6
6
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7
7
 
8
8
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9
9
  /* harmony export */ evaluatePolicy: () => (/* binding */ evaluatePolicy)
10
10
  /* harmony export */ });
11
11
  /* unused harmony export _internals */
12
- /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3024);
13
- /* harmony import */ var node_child_process__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1421);
12
+ /* harmony import */ var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73024);
13
+ /* harmony import */ var node_child_process__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31421);
14
14
  // Policy-as-code gate (FR-SDLC-9).
15
15
  //
16
16
  // Today's CI gate is `--fail-on <severity>`. That's coarse. Customers want
@@ -2,7 +2,7 @@ export const id = 7552;
2
2
  export const ids = [7552];
3
3
  export const modules = {
4
4
 
5
- /***/ 7552:
5
+ /***/ 67552:
6
6
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7
7
 
8
8
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -12,7 +12,7 @@ export const modules = {
12
12
  /* harmony export */ writeExportReport: () => (/* binding */ writeExportReport)
13
13
  /* harmony export */ });
14
14
  /* unused harmony exports DELETION_REPORT_FILE, EXPORT_REPORT_FILE */
15
- /* harmony import */ var _state_dir_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1174);
15
+ /* harmony import */ var _state_dir_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31174);
16
16
  // FR-706 (assurance-hardening PRD): manifest-based export and deletion
17
17
  // reports — "Operators can prove what was exported, deleted, retained, or
18
18
  // failed."
@@ -2,13 +2,13 @@ export const id = 7709;
2
2
  export const ids = [7709];
3
3
  export const modules = {
4
4
 
5
- /***/ 7709:
5
+ /***/ 17709:
6
6
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
7
7
 
8
8
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9
9
  /* harmony export */ exportFlowsCSV: () => (/* binding */ exportFlowsCSV)
10
10
  /* harmony export */ });
11
- /* harmony import */ var _protection_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(965);
11
+ /* harmony import */ var _protection_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(80965);
12
12
  // export-csv.js — Milestone 4, sub-project JSON/CSV export.
13
13
  //
14
14
  // One row per FLOW (not node, not edge — the closest analogue in this