@clear-capabilities/agentic-security-scanner 0.195.25 → 0.195.27

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 (35) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/bin/agentic-security.js +13 -3
  3. package/dist/396.index.js +936 -0
  4. package/dist/5752.index.js +15 -2
  5. package/dist/7838.index.js +22 -0
  6. package/dist/8218.index.js +19 -2
  7. package/dist/{809c900a90284017aaff.json → 90ebba38d8860ec77376.json} +4 -4
  8. package/dist/9382.index.js +315 -174
  9. package/dist/9560.index.js +19 -2
  10. package/dist/agentic-security.mjs +9 -9
  11. package/dist/agentic-security.mjs.sha256 +1 -1
  12. package/package.json +4 -4
  13. package/src/context-intelligence/CLAUDE.md +4 -0
  14. package/src/context-intelligence/entrypoints.js +141 -9
  15. package/src/context-intelligence/imports.js +1 -1
  16. package/src/context-intelligence/review.js +8 -3
  17. package/src/engine.js +10 -0
  18. package/src/lineage/CLAUDE.md +4 -0
  19. package/src/lineage/graph-builder.js +8 -0
  20. package/src/lineage/index.js +2 -0
  21. package/src/posture/CLAUDE.md +10 -2
  22. package/src/posture/custom-rules.js +7 -2
  23. package/src/posture/dag-commands.js +15 -2
  24. package/src/posture/provenance/coordinator.js +6 -2
  25. package/src/posture/provenance/dag-walk.js +7 -3
  26. package/src/posture/provenance/git-evidence.js +21 -0
  27. package/src/posture/provenance/origin-resolver.js +16 -2
  28. package/src/posture/provenance/providers/github.js +6 -3
  29. package/src/posture/provenance/providers/gitlab.js +5 -3
  30. package/src/posture/rule-compiler/cli.js +76 -21
  31. package/src/posture/rule-compiler/negative-corpus.js +39 -0
  32. package/src/posture/rule-compiler/promotion.js +21 -0
  33. package/src/posture/rule-compiler/regression.js +39 -9
  34. package/src/posture/rule-compiler/store.js +72 -6
  35. package/src/server/graph-loader.js +19 -2
@@ -19,7 +19,7 @@ import { verifyLastScan } from '../posture/integrity.js';
19
19
 
20
20
  /**
21
21
  * @param {string} scanRoot
22
- * @returns {{ok:true, graph:object} | {ok:false, reason:'missing'|'unsigned'|'tampered'|'malformed', message:string}}
22
+ * @returns {{ok:true, graph:object} | {ok:false, reason:'missing'|'unsigned'|'tampered'|'malformed'|'wrong-revision', message:string}}
23
23
  *
24
24
  * Four, and only four, distinct failure reasons — each with its own clear
25
25
  * message so an operator knows exactly what to do next:
@@ -36,7 +36,7 @@ import { verifyLastScan } from '../posture/integrity.js';
36
36
  * valid JSON. Should not happen from a normal scan; the
37
37
  * file may be corrupted on disk after signing.
38
38
  */
39
- export function loadSignedGraph(scanRoot) {
39
+ export function loadSignedGraph(scanRoot, { expectRevision = null } = {}) {
40
40
  const graphPath = statePath(scanRoot, 'lineage-graph.json');
41
41
  const sigPath = graphPath + '.sig';
42
42
 
@@ -86,6 +86,23 @@ export function loadSignedGraph(scanRoot) {
86
86
  };
87
87
  }
88
88
 
89
+ // GA-03.7 (0.195.26): wrong-revision refusal. A caller that knows which
90
+ // revision it expects (`dataflow view --expect-revision`) gets a graph
91
+ // only when the graph records that revision; a graph that records none
92
+ // cannot prove it and is refused for the same reason, never served on
93
+ // the hope that it matches.
94
+ if (expectRevision) {
95
+ const have = graph && graph.scope && graph.scope.revision ? graph.scope.revision.commit : null;
96
+ if (have !== expectRevision) {
97
+ return {
98
+ ok: false,
99
+ reason: 'wrong-revision',
100
+ message: have
101
+ ? `Lineage graph at ${graphPath} was built from revision ${have}, not the expected ${expectRevision}. Re-run the scan on the expected revision.`
102
+ : `Lineage graph at ${graphPath} records no revision, so it cannot be shown to match the expected ${expectRevision}. Re-run the scan inside the repository (AGENTIC_SECURITY_LINEAGE_DEEP=1) so the graph records its revision.`,
103
+ };
104
+ }
105
+ }
89
106
  return { ok: true, graph };
90
107
  }
91
108