appsec-agent 2.5.0 → 2.6.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 (35) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +1 -1
  3. package/dist/bin/agent-run.js +16 -2
  4. package/dist/bin/agent-run.js.map +1 -1
  5. package/dist/src/agent_actions.d.ts +5 -3
  6. package/dist/src/agent_actions.d.ts.map +1 -1
  7. package/dist/src/agent_actions.js.map +1 -1
  8. package/dist/src/index.d.ts +1 -0
  9. package/dist/src/index.d.ts.map +1 -1
  10. package/dist/src/index.js +4 -1
  11. package/dist/src/index.js.map +1 -1
  12. package/dist/src/main.d.ts.map +1 -1
  13. package/dist/src/main.js +79 -7
  14. package/dist/src/main.js.map +1 -1
  15. package/dist/src/resolveAgentRunMcpEnv.d.ts +1 -1
  16. package/dist/src/resolveAgentRunMcpEnv.js +1 -1
  17. package/dist/src/schemas/codebase_graph.d.ts +135 -0
  18. package/dist/src/schemas/codebase_graph.d.ts.map +1 -0
  19. package/dist/src/schemas/codebase_graph.js +169 -0
  20. package/dist/src/schemas/codebase_graph.js.map +1 -0
  21. package/dist/src/schemas/context_extraction.d.ts +1 -1
  22. package/dist/src/schemas/context_extraction.js +1 -1
  23. package/dist/src/schemas/finding_validator.d.ts +32 -1
  24. package/dist/src/schemas/finding_validator.d.ts.map +1 -1
  25. package/dist/src/schemas/finding_validator.js +58 -8
  26. package/dist/src/schemas/finding_validator.js.map +1 -1
  27. package/dist/src/schemas/import_graph.d.ts +1 -1
  28. package/dist/src/schemas/import_graph.js +1 -1
  29. package/dist/src/schemas/qa_context.d.ts +1 -1
  30. package/dist/src/schemas/qa_context.js +1 -1
  31. package/dist/src/schemas/runtime_enrichment.d.ts +4 -4
  32. package/dist/src/schemas/runtime_enrichment.js +4 -4
  33. package/dist/src/schemas/security_fix.d.ts +1 -1
  34. package/dist/src/schemas/security_fix.js +1 -1
  35. package/package.json +3 -3
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ /**
3
+ * Codebase-graph context input (v2.6.0 / parent-app plan §8.18 Phase 2) —
4
+ * per-changed-file structural-graph summary passed to `pr_reviewer` so the LLM
5
+ * can factor symbol-level callers/callees and downstream blast-radius into its
6
+ * severity + confidence calls.
7
+ *
8
+ * Distinct from `--import-graph-context` (file-level inbound import counts via
9
+ * SCIP). This context is *symbol-level* (cbm tree-sitter graph; 155 languages):
10
+ * - `callers` — qualified symbol names whose body invokes a symbol
11
+ * defined in the changed file.
12
+ * - `callees` — qualified symbol names invoked from a symbol defined
13
+ * in the changed file.
14
+ * - `blast_radius_files_count` — number of unique files reachable via
15
+ * outbound CALLS edges within the configured depth.
16
+ *
17
+ * The parent app's `composeCodebaseGraphContextPayload`
18
+ * (`<parent-app>/backend/src/services/codebaseGraph/`) does the cbm MCP queries
19
+ * (`search_graph` to find symbols defined in each changed file →
20
+ * `trace_path(direction=both, mode=calls, depth=2)` per symbol) and writes the
21
+ * JSON file. The agent here only parses + formats it for the prompt — no MCP
22
+ * query at agent runtime (Phase 3 is the live-MCP variant).
23
+ *
24
+ * Shape mirrors the v5.4.0 import-graph and v2.3.0 runtime-enrichment patterns
25
+ * exactly so that `prScanProcessor` can reuse the same fail-open + size-cap +
26
+ * coverage tagging conventions across all three structural-context families.
27
+ *
28
+ * **§8.5 PHI gate**: cbm sees only source-code text from CapsuleHealth-owned
29
+ * repos (no PHI). The schema accepts only structural-edge fields; any extras
30
+ * on per-file entries are silently dropped (mirrors runtime-enrichment's PHI
31
+ * minimization invariant defensively, even though cbm's input surface
32
+ * cannot contain PHI by construction).
33
+ */
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ exports.parseCodebaseGraphContext = parseCodebaseGraphContext;
36
+ exports.formatCodebaseGraphContextForPrompt = formatCodebaseGraphContextForPrompt;
37
+ const MAX_FILES = 500;
38
+ const MAX_CALLERS_PER_FILE = 20;
39
+ const MAX_CALLEES_PER_FILE = 20;
40
+ const MAX_SYMBOLS_PER_FILE = 20;
41
+ const VALID_GRAPH_STATUSES = new Set([
42
+ 'ok',
43
+ 'no_symbols',
44
+ 'missing',
45
+ 'partial',
46
+ ]);
47
+ const VALID_COVERAGE_VALUES = new Set([
48
+ 'full',
49
+ 'partial',
50
+ 'none',
51
+ 'empty',
52
+ ]);
53
+ const sanitizeStringArray = (input, cap) => {
54
+ if (!Array.isArray(input)) {
55
+ return undefined;
56
+ }
57
+ const cleaned = input
58
+ .filter((c) => typeof c === 'string' && c.trim().length > 0)
59
+ .slice(0, cap);
60
+ return cleaned.length > 0 ? cleaned : undefined;
61
+ };
62
+ /**
63
+ * Parse and validate a codebase-graph context JSON payload (throws on
64
+ * structural error). Caps mirror import-graph (500 files, 20 callers per
65
+ * file) so the prompt-budget worst case is symmetric across the two
66
+ * structural contexts.
67
+ */
68
+ function parseCodebaseGraphContext(data) {
69
+ if (!data || typeof data !== 'object') {
70
+ throw new Error('Codebase-graph context must be a JSON object');
71
+ }
72
+ const o = data;
73
+ if (!Array.isArray(o.files)) {
74
+ throw new Error('Codebase-graph context must include a "files" array');
75
+ }
76
+ if (o.files.length > MAX_FILES) {
77
+ throw new Error(`Codebase-graph context supports at most ${MAX_FILES} files per run`);
78
+ }
79
+ const files = [];
80
+ for (const item of o.files) {
81
+ if (!item || typeof item !== 'object') {
82
+ throw new Error('Each codebase-graph file entry must be an object');
83
+ }
84
+ const f = item;
85
+ if (typeof f.file !== 'string' || !f.file.trim()) {
86
+ throw new Error('Each codebase-graph file entry must have a non-empty string "file"');
87
+ }
88
+ if (typeof f.blast_radius_files_count !== 'number' ||
89
+ !Number.isFinite(f.blast_radius_files_count)) {
90
+ throw new Error('Each codebase-graph file entry must have a numeric "blast_radius_files_count"');
91
+ }
92
+ const graphStatus = typeof f.graph_status === 'string' &&
93
+ VALID_GRAPH_STATUSES.has(f.graph_status)
94
+ ? f.graph_status
95
+ : undefined;
96
+ files.push({
97
+ file: String(f.file),
98
+ symbols_changed: sanitizeStringArray(f.symbols_changed, MAX_SYMBOLS_PER_FILE),
99
+ callers: sanitizeStringArray(f.callers, MAX_CALLERS_PER_FILE),
100
+ callees: sanitizeStringArray(f.callees, MAX_CALLEES_PER_FILE),
101
+ blast_radius_files_count: Math.max(0, Math.trunc(f.blast_radius_files_count)),
102
+ graph_status: graphStatus,
103
+ });
104
+ }
105
+ const coverage = typeof o.coverage === 'string' &&
106
+ VALID_COVERAGE_VALUES.has(o.coverage)
107
+ ? o.coverage
108
+ : undefined;
109
+ return {
110
+ default_branch_sha: typeof o.default_branch_sha === 'string' ? o.default_branch_sha : undefined,
111
+ parsed_at: typeof o.parsed_at === 'string' ? o.parsed_at : undefined,
112
+ coverage,
113
+ files,
114
+ metadata: o.metadata && typeof o.metadata === 'object'
115
+ ? {
116
+ project_name: typeof o.metadata.project_name === 'string'
117
+ ? o.metadata.project_name
118
+ : undefined,
119
+ }
120
+ : undefined,
121
+ };
122
+ }
123
+ /**
124
+ * Format the context for inclusion in a PR-reviewer user prompt. Compact by
125
+ * design — symbol lists are truncated and the table renders only the most
126
+ * structurally-significant signals so the block stays well under the
127
+ * import-graph + runtime-enrichment budget envelope.
128
+ *
129
+ * Files are rendered most-blast-radius first to anchor the LLM's attention
130
+ * on the structurally-upstream files when the prompt is truncated.
131
+ */
132
+ function formatCodebaseGraphContextForPrompt(ctx) {
133
+ if (ctx.files.length === 0) {
134
+ return '';
135
+ }
136
+ const sorted = [...ctx.files].sort((a, b) => b.blast_radius_files_count - a.blast_radius_files_count);
137
+ const lines = [];
138
+ lines.push('### Codebase-graph context (symbol-level callers/callees, plan §8.18 Phase 2)');
139
+ lines.push('For each changed file below, the parent app queried the codebase-memory-mcp graph for symbols defined in the file and traced their inbound (callers) and outbound (callees) CALLS edges. Use this as a structural-impact signal: a high `blast radius` means a regression in the file propagates to many downstream files; a non-empty `callers` list means the changed code is reached by other code paths and is more likely to fire under realistic traffic.');
140
+ lines.push('Treat this as advisory — when callers ≥ 1 and blast radius ≥ 5, lean toward keeping medium/high-severity findings on the file even if the diff alone looks low-risk. When `graph_status` is `no_symbols` (data file, generated code, unsupported language), structural reach is not measurable from this signal — fall back to your default judgment.');
141
+ if (ctx.default_branch_sha) {
142
+ lines.push(`Graph built from default-branch SHA \`${ctx.default_branch_sha.slice(0, 12)}\`.`);
143
+ }
144
+ if (ctx.coverage && ctx.coverage !== 'full') {
145
+ lines.push(`_Coverage: **${ctx.coverage}** — entries with \`graph_status=missing\` or \`partial\` will **not** be downranked (fail-open)._`);
146
+ }
147
+ lines.push('');
148
+ lines.push('| File | Callers | Callees | Blast radius | Status |');
149
+ lines.push('|---|---|---|---:|:---:|');
150
+ for (const f of sorted) {
151
+ const status = f.graph_status ?? 'ok';
152
+ const callers = f.callers && f.callers.length > 0
153
+ ? f.callers
154
+ .slice(0, 3)
155
+ .map((c) => `\`${c}\``)
156
+ .join(', ') + (f.callers.length > 3 ? ` (+${f.callers.length - 3})` : '')
157
+ : '—';
158
+ const callees = f.callees && f.callees.length > 0
159
+ ? f.callees
160
+ .slice(0, 3)
161
+ .map((c) => `\`${c}\``)
162
+ .join(', ') + (f.callees.length > 3 ? ` (+${f.callees.length - 3})` : '')
163
+ : '—';
164
+ lines.push(`| \`${f.file}\` | ${callers} | ${callees} | ${f.blast_radius_files_count} | ${status} |`);
165
+ }
166
+ lines.push('');
167
+ return lines.join('\n');
168
+ }
169
+ //# sourceMappingURL=codebase_graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codebase_graph.js","sourceRoot":"","sources":["../../../src/schemas/codebase_graph.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;AA0HH,8DA8DC;AAWD,kFAkDC;AA9JD,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC,MAAM,oBAAoB,GAAG,IAAI,GAA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K,CAAC,CAAC,EAAE,CAAC,CAAC;iBACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;iBACtB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7E,CAAC,CAAC,GAAG,CAAC;QACV,KAAK,CAAC,IAAI,CACR,OAAO,CAAC,CAAC,IAAI,QAAQ,OAAO,MAAM,OAAO,MAAM,CAAC,CAAC,wBAAwB,MAAM,MAAM,IAAI,CAC1F,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * Context Extraction Schemas
3
3
  *
4
4
  * Defines the input context and output for the context_extractor role.
5
- * ExtractionContext is assembled by sast-ai-app and passed via --extract-context JSON file.
5
+ * ExtractionContext is assembled by the parent app and passed via --extract-context JSON file.
6
6
  * The structured output contains project intelligence fields used to reduce false positives.
7
7
  */
8
8
  export interface ExtractionContextFile {
@@ -3,7 +3,7 @@
3
3
  * Context Extraction Schemas
4
4
  *
5
5
  * Defines the input context and output for the context_extractor role.
6
- * ExtractionContext is assembled by sast-ai-app and passed via --extract-context JSON file.
6
+ * ExtractionContext is assembled by the parent app and passed via --extract-context JSON file.
7
7
  * The structured output contains project intelligence fields used to reduce false positives.
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -2,7 +2,7 @@
2
2
  * Finding Validator Context and Verdict Schemas
3
3
  *
4
4
  * Defines the input context and output verdict for the finding_validator role.
5
- * RetestContext is assembled by sast-ai-app and passed via --retest-context JSON file.
5
+ * RetestContext is assembled by the parent app and passed via --retest-context JSON file.
6
6
  * RetestVerdict is the structured output returned by the finding_validator agent.
7
7
  */
8
8
  export interface RetestContextFinding {
@@ -24,6 +24,37 @@ export interface RetestVerdict {
24
24
  reasoning: string;
25
25
  current_line: number | null;
26
26
  }
27
+ /**
28
+ * Discriminator for `RetestContextValidationError` — see usage in `main.ts`
29
+ * for the operational contract.
30
+ *
31
+ * Parent apps that spawn `agent-run -r finding_validator` should treat exit
32
+ * code 2 + a stderr line beginning with `RETEST_CONTEXT_INVALID_SIGNAL` as
33
+ * "caller-side input invalid; do not retry without fixing the context",
34
+ * vs. exit code 1 ("agent crash; safe to retry").
35
+ *
36
+ * The signal prefix is intentionally short + greppable + free of regex
37
+ * metacharacters so a parent's `stderr.includes(...)` check is robust.
38
+ */
39
+ export declare const RETEST_CONTEXT_INVALID_SIGNAL = "[finding_validator] retest_context_invalid";
40
+ /**
41
+ * Thrown by {@link loadRetestContext} when the caller-supplied context
42
+ * fails validation. Distinct from generic `Error` so `main.ts` can
43
+ * cleanly route it to exit code 2 (caller-input invalid) rather than the
44
+ * default unhandled-exception path that surfaces as exit code 1 + a Node
45
+ * stack trace.
46
+ *
47
+ * Parent apps (e.g., a `findingRetestService` spawn wrapper) historically
48
+ * captured only the last N chars of stderr, which truncated the
49
+ * throwing-site frame and left only the bottom-of-stack
50
+ * `Module._compile` / `executeUserEntryPoint` frames in their logs.
51
+ * `RETEST_CONTEXT_INVALID_SIGNAL` is emitted to stderr as the FIRST
52
+ * line of the failure so even a 200-char capture window catches it.
53
+ */
54
+ export declare class RetestContextValidationError extends Error {
55
+ readonly kind: string;
56
+ constructor(kind: string, message: string);
57
+ }
27
58
  export declare function loadRetestContext(filePath: string, cwd: string): RetestContext;
28
59
  export declare const RETEST_VERDICT_SCHEMA: Record<string, unknown>;
29
60
  //# sourceMappingURL=finding_validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"finding_validator.d.ts","sourceRoot":"","sources":["../../../src/schemas/finding_validator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAMD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,CAsB9E;AAMD,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAuBzD,CAAC"}
1
+ {"version":3,"file":"finding_validator.d.ts","sourceRoot":"","sources":["../../../src/schemas/finding_validator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAMD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,6BAA6B,+CAA+C,CAAC;AAE1F;;;;;;;;;;;;;GAaG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBACV,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAK1C;AAUD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,CA4B9E;AAMD,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAuBzD,CAAC"}
@@ -3,7 +3,7 @@
3
3
  * Finding Validator Context and Verdict Schemas
4
4
  *
5
5
  * Defines the input context and output verdict for the finding_validator role.
6
- * RetestContext is assembled by sast-ai-app and passed via --retest-context JSON file.
6
+ * RetestContext is assembled by the parent app and passed via --retest-context JSON file.
7
7
  * RetestVerdict is the structured output returned by the finding_validator agent.
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -40,31 +40,81 @@ var __importStar = (this && this.__importStar) || (function () {
40
40
  };
41
41
  })();
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.RETEST_VERDICT_SCHEMA = void 0;
43
+ exports.RETEST_VERDICT_SCHEMA = exports.RetestContextValidationError = exports.RETEST_CONTEXT_INVALID_SIGNAL = void 0;
44
44
  exports.loadRetestContext = loadRetestContext;
45
45
  const fs = __importStar(require("fs"));
46
46
  const path = __importStar(require("path"));
47
47
  // ---------------------------------------------------------------------------
48
48
  // Context loader
49
49
  // ---------------------------------------------------------------------------
50
+ /**
51
+ * Discriminator for `RetestContextValidationError` — see usage in `main.ts`
52
+ * for the operational contract.
53
+ *
54
+ * Parent apps that spawn `agent-run -r finding_validator` should treat exit
55
+ * code 2 + a stderr line beginning with `RETEST_CONTEXT_INVALID_SIGNAL` as
56
+ * "caller-side input invalid; do not retry without fixing the context",
57
+ * vs. exit code 1 ("agent crash; safe to retry").
58
+ *
59
+ * The signal prefix is intentionally short + greppable + free of regex
60
+ * metacharacters so a parent's `stderr.includes(...)` check is robust.
61
+ */
62
+ exports.RETEST_CONTEXT_INVALID_SIGNAL = '[finding_validator] retest_context_invalid';
63
+ /**
64
+ * Thrown by {@link loadRetestContext} when the caller-supplied context
65
+ * fails validation. Distinct from generic `Error` so `main.ts` can
66
+ * cleanly route it to exit code 2 (caller-input invalid) rather than the
67
+ * default unhandled-exception path that surfaces as exit code 1 + a Node
68
+ * stack trace.
69
+ *
70
+ * Parent apps (e.g., a `findingRetestService` spawn wrapper) historically
71
+ * captured only the last N chars of stderr, which truncated the
72
+ * throwing-site frame and left only the bottom-of-stack
73
+ * `Module._compile` / `executeUserEntryPoint` frames in their logs.
74
+ * `RETEST_CONTEXT_INVALID_SIGNAL` is emitted to stderr as the FIRST
75
+ * line of the failure so even a 200-char capture window catches it.
76
+ */
77
+ class RetestContextValidationError extends Error {
78
+ kind;
79
+ constructor(kind, message) {
80
+ super(message);
81
+ this.name = 'RetestContextValidationError';
82
+ this.kind = kind;
83
+ }
84
+ }
85
+ exports.RetestContextValidationError = RetestContextValidationError;
86
+ function fail(kind, message) {
87
+ // Emit the structured signal FIRST so parent apps with small stderr
88
+ // capture windows still see the prefix; the longer human-readable
89
+ // message follows but is not load-bearing.
90
+ console.error(`${exports.RETEST_CONTEXT_INVALID_SIGNAL}: ${kind}: ${message}`);
91
+ throw new RetestContextValidationError(kind, message);
92
+ }
50
93
  function loadRetestContext(filePath, cwd) {
51
94
  const resolved = path.isAbsolute(filePath) ? filePath : path.join(cwd, filePath);
52
95
  if (!fs.existsSync(resolved)) {
53
- throw new Error(`Retest context file not found: ${resolved}`);
96
+ fail('file_not_found', `Retest context file not found: ${resolved}`);
54
97
  }
55
98
  const content = fs.readFileSync(resolved, 'utf-8');
56
- const ctx = JSON.parse(content);
99
+ let ctx;
100
+ try {
101
+ ctx = JSON.parse(content);
102
+ }
103
+ catch (e) {
104
+ const msg = e instanceof Error ? e.message : String(e);
105
+ fail('json_parse_error', `Retest context JSON parse error: ${msg}`);
106
+ }
57
107
  if (!ctx.finding || typeof ctx.finding !== 'object') {
58
- throw new Error('Retest context must include a valid finding object');
108
+ fail('missing_finding', 'Retest context must include a valid finding object');
59
109
  }
60
110
  if (!ctx.finding.title || typeof ctx.finding.title !== 'string') {
61
- throw new Error('Retest context finding must include a valid title');
111
+ fail('missing_finding_title', 'Retest context finding must include a valid title');
62
112
  }
63
113
  if (!ctx.finding.file || typeof ctx.finding.file !== 'string') {
64
- throw new Error('Retest context finding must include a valid file path');
114
+ fail('missing_finding_file', 'Retest context finding must include a valid file path');
65
115
  }
66
116
  if (!ctx.code_snippet || typeof ctx.code_snippet !== 'string') {
67
- throw new Error('Retest context must include a valid code_snippet');
117
+ fail('missing_code_snippet', 'Retest context must include a valid code_snippet');
68
118
  }
69
119
  return ctx;
70
120
  }
@@ -1 +1 @@
1
- {"version":3,"file":"finding_validator.js","sourceRoot":"","sources":["../../../src/schemas/finding_validator.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCH,8CAsBC;AA3DD,uCAAyB;AACzB,2CAA6B;AAgC7B,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E,SAAgB,iBAAiB,CAAC,QAAgB,EAAE,GAAW;IAC7D,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACjF,IAAI,CAAC,EAAE,C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,GAAG,CAAC,YAAY,IAAI,OAAO,GAAG,CAAC,YAAY,KAAK,QAAQ,EAAE,CAAC;QAC9D,IAAI,CAAC,sBAAsB,EAAE,kDAAkD,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,8EAA8E;AAC9E,8DAA8D;AAC9D,8EAA8E;AAEjE,QAAA,qBAAqB,GAA4B;IAC5D,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,CAAC;IACtE,UAAU,EAAE;QACV,aAAa,EAAE;YACb,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,gEAAgE;SAC9E;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC;YAC/B,WAAW,EAAE,oCAAoC;SAClD;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iEAAiE;SAC/E;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;YACxB,WAAW,EAAE,yDAAyD;SACvE;KACF;IACD,oBAAoB,EAAE,KAAK;CAC5B,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * into its confidence calls.
5
5
  *
6
6
  * The authoritative post-LLM confidence downrank lives in the parent app
7
- * (`sast-ai-app/backend/src/services/importGraphDecision.ts`). The context
7
+ * (an `importGraphDecision`-style service). The context
8
8
  * here is advisory — it lets the LLM see what the post-pass will see and
9
9
  * avoid raising a HIGH-confidence finding on an unreachable helper file.
10
10
  *
@@ -5,7 +5,7 @@
5
5
  * into its confidence calls.
6
6
  *
7
7
  * The authoritative post-LLM confidence downrank lives in the parent app
8
- * (`sast-ai-app/backend/src/services/importGraphDecision.ts`). The context
8
+ * (an `importGraphDecision`-style service). The context
9
9
  * here is advisory — it lets the LLM see what the post-pass will see and
10
10
  * avoid raising a HIGH-confidence finding on an unreachable helper file.
11
11
  *
@@ -2,7 +2,7 @@
2
2
  * QA Verification Context and Verdict Schemas
3
3
  *
4
4
  * Defines the input context and output verdict for the qa_verifier role.
5
- * QaContext is assembled by sast-ai-app and passed via --qa-context JSON file.
5
+ * QaContext is assembled by the parent app and passed via --qa-context JSON file.
6
6
  * QaVerdict is the structured output returned by the qa_verifier agent.
7
7
  */
8
8
  export interface QaContext {
@@ -3,7 +3,7 @@
3
3
  * QA Verification Context and Verdict Schemas
4
4
  *
5
5
  * Defines the input context and output verdict for the qa_verifier role.
6
- * QaContext is assembled by sast-ai-app and passed via --qa-context JSON file.
6
+ * QaContext is assembled by the parent app and passed via --qa-context JSON file.
7
7
  * QaVerdict is the structured output returned by the qa_verifier agent.
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Runtime-enrichment context input (v2.3.0 / sast-ai-app plan §4 + §8.14) —
2
+ * Runtime-enrichment context input (v2.3.0 / parent-app plan §4 + §8.14) —
3
3
  * per-file production-incident summary passed to `pr_reviewer` so the LLM can
4
4
  * factor incident history into its severity + confidence calls.
5
5
  *
6
6
  * The authoritative post-LLM gate override lives in the parent app
7
- * (`sast-ai-app/backend/src/routes/prScanProcessor.ts` — partition findings
8
- * into hot/cold and apply the §4 transform `medium → low / 0.6 → 0.4` per
9
- * file). The context here is advisory — it lets the LLM see what the
7
+ * (a `prScanProcessor`-style route — partition findings into hot/cold and
8
+ * apply the §4 transform `medium → low / 0.6 → 0.4` per file). The context
9
+ * here is advisory — it lets the LLM see what the
10
10
  * post-pass will see and avoid raising HIGH-confidence findings on
11
11
  * operationally-fragile files that the gate-override will then have to
12
12
  * "rescue" anyway, AND avoid suppressing low-severity findings on hot files
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  /**
3
- * Runtime-enrichment context input (v2.3.0 / sast-ai-app plan §4 + §8.14) —
3
+ * Runtime-enrichment context input (v2.3.0 / parent-app plan §4 + §8.14) —
4
4
  * per-file production-incident summary passed to `pr_reviewer` so the LLM can
5
5
  * factor incident history into its severity + confidence calls.
6
6
  *
7
7
  * The authoritative post-LLM gate override lives in the parent app
8
- * (`sast-ai-app/backend/src/routes/prScanProcessor.ts` — partition findings
9
- * into hot/cold and apply the §4 transform `medium → low / 0.6 → 0.4` per
10
- * file). The context here is advisory — it lets the LLM see what the
8
+ * (a `prScanProcessor`-style route — partition findings into hot/cold and
9
+ * apply the §4 transform `medium → low / 0.6 → 0.4` per file). The context
10
+ * here is advisory — it lets the LLM see what the
11
11
  * post-pass will see and avoid raising HIGH-confidence findings on
12
12
  * operationally-fragile files that the gate-override will then have to
13
13
  * "rescue" anyway, AND avoid suppressing low-severity findings on hot files
@@ -2,7 +2,7 @@
2
2
  * JSON Schema and TypeScript interfaces for Security Fix Output
3
3
  *
4
4
  * Defines the structured output schema for the code_fixer agent role.
5
- * The agent receives a FixContext (enriched finding data from sast-ai-app)
5
+ * The agent receives a FixContext (enriched finding data from the parent app)
6
6
  * and returns a FixOutput (structured fix via Claude SDK outputFormat).
7
7
  *
8
8
  * Author: Sam Li
@@ -3,7 +3,7 @@
3
3
  * JSON Schema and TypeScript interfaces for Security Fix Output
4
4
  *
5
5
  * Defines the structured output schema for the code_fixer agent role.
6
- * The agent receives a FixContext (enriched finding data from sast-ai-app)
6
+ * The agent receives a FixContext (enriched finding data from the parent app)
7
7
  * and returns a FixOutput (structured fix via Claude SDK outputFormat).
8
8
  *
9
9
  * Author: Sam Li
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "appsec-agent",
3
- "version": "2.5.0",
3
+ "version": "2.6.1",
4
4
  "description": "TypeScript package for AppSec AI Agent management",
5
5
  "author": "Sam Li",
6
- "date": "May 03 2026",
7
- "license": "MIT",
6
+ "date": "May 12 2026",
7
+ "license": "Apache-2.0",
8
8
  "main": "dist/src/index.js",
9
9
  "types": "dist/src/index.d.ts",
10
10
  "files": [