{"id":"pre-merge-review","title":"Pre-merge Review Pack","description":"One unified diff in, one merge decision out: the PR exploit gatekeeper (bug hunter, patch synthesizer, secret/dependency/SAST scans) plus the adversarial Unicode / Trojan Source gate. Runs diff-gatekeeper ($0.50) + unicode-safety-gate ($0.25) in one paid call for 20% less than buying them separately. Charged only when every member succeeds.","roi":"One call per pull request covers logic exploits, leaked secrets, dependency breaks and invisible-character backdoors; built for CI.","audience":"developer","channels":["x402","mcp","rapidapi","apify"],"endpoint":{"method":"POST","url":"https://agents.writerslogic.com/api/v1/bundles/pre-merge-review","path":"/api/v1/bundles/pre-merge-review","contentType":"application/json"},"price":{"amount":"0.60","currency":"USDC","network":"base","perCall":true,"failedCallsCharged":false},"inputSchema":{"type":"object","additionalProperties":false,"required":["diff"],"properties":{"diff":{"type":"string","minLength":1,"maxLength":300000,"description":"Unified diff of the change (git diff / PR .diff)."},"packageJsonDiff":{"type":"string","maxLength":50000},"context":{"type":"string","maxLength":4000,"description":"What the PR is supposed to do."}}},"resultSchema":{"type":"object","properties":{"results":{"type":"object","description":"Each member agent's full result, keyed by agent id.","properties":{"diff-gatekeeper":{"type":"object","properties":{"summary":{"type":"string"},"intent_alignment":{"type":"string","description":"Does the diff do what the context says, and anything it does beyond that."},"breakingChanges":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","file","location","severity","description","affected_consumers","grounded","source"],"properties":{"id":{"type":"string","description":"BC-01, BC-02..."},"file":{"type":"string"},"location":{"type":"string"},"severity":{"type":"string","enum":["critical","high","medium","low"]},"description":{"type":"string"},"affected_consumers":{"type":"string"},"grounded":{"type":"boolean","description":"False when the file or line is not in the diff; ungrounded findings never block."},"source":{"type":"string","enum":["model","rule"]}}}},"securityFlaws":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","file","line","category","severity","description","exploit_scenario","grounded","source"],"properties":{"id":{"type":"string","description":"SEC-01, SEC-02..."},"file":{"type":"string"},"line":{"type":"integer"},"category":{"type":"string","enum":["sql_injection","nosql_injection","command_injection","xss","ssrf","path_traversal","authz_bypass","secret_exposure","insecure_crypto","deserialization","supply_chain","other"]},"severity":{"type":"string","enum":["critical","high","medium","low"]},"description":{"type":"string"},"exploit_scenario":{"type":"string"},"grounded":{"type":"boolean","description":"False when the file or line is not in the diff; ungrounded findings never block."},"source":{"type":"string","enum":["model","rule"]}}}},"bugs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","file","line","category","severity","description","grounded","source"],"properties":{"id":{"type":"string","description":"BUG-01, BUG-02..."},"file":{"type":"string"},"line":{"type":"integer"},"category":{"type":"string","enum":["race_condition","state_mutation","error_handling","logic_error","resource_leak","null_handling","performance","other"]},"severity":{"type":"string","enum":["critical","high","medium","low"]},"description":{"type":"string"},"grounded":{"type":"boolean","description":"False when the file or line is not in the diff; ungrounded findings never block."},"source":{"type":"string","enum":["model","rule"]}}}},"dependency_risks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["package","risk","severity"],"properties":{"package":{"type":"string"},"risk":{"type":"string"},"severity":{"type":"string","enum":["critical","high","medium","low"]}}}},"riskScore":{"type":"integer","description":"0-100 overall merge risk."},"verdict":{"type":"string","enum":["fail","warn","pass","inconclusive"],"description":"fail: a secret or a grounded critical or high finding blocks the merge. inconclusive: part of the diff was not reviewed. warn: only non-blocking findings. pass: none."},"verdictReason":{"type":"string"},"status":{"type":"string","enum":["complete","partial"],"description":"partial when part of the diff was not reviewed or an over-long added line was pattern-scanned only in part; the result is still signed."},"nextStep":{"type":"string"},"topFindings":{"type":"array","items":{"type":"object","description":"Up to 5, most severe first: rank, id, kind (secret, security, bug, breaking_change, dependency), severity, file, line, title, fix, blocking."}},"annotations":{"type":"array","items":{"type":"object","description":"GitHub Checks API annotations: path, start_line, end_line, annotation_level (failure, warning, notice), title, message."}},"sarif":{"type":"object","description":"SARIF 2.1.0 log of every grounded finding at its file and line; uploads to GitHub code scanning as-is."},"mergeApproved":{"type":"boolean","description":"True when no secret and no grounded critical or high finding was found and the whole diff was reviewed."},"modelRiskScore":{"type":"integer","description":"The model's own 0-100 estimate; advisory. riskScore is computed from grounded findings (critical 40, high 20, medium 8, low 2, capped at 100) with scanner floors."},"blockers":{"type":"array","items":{"type":"string"}},"dependencyRisks":{"type":"object"},"secretsDetected":{"type":"array","items":{"type":"object"}},"suggestedPatches":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["finding_id","file","original_code","corrected_code","explanation"],"properties":{"finding_id":{"type":"string"},"file":{"type":"string"},"original_code":{"type":"string","description":"The exact lines from the diff being replaced."},"corrected_code":{"type":"string","description":"Drop-in replacement code."},"explanation":{"type":"string"},"also_fixes":{"type":"array","items":{"type":"string"},"description":"Other finding ids this same patch resolves."}}}},"stats":{"type":"object"}},"required":["summary","intent_alignment","breakingChanges","securityFlaws","bugs","riskScore","verdict","verdictReason","status","nextStep","topFindings","annotations","sarif","mergeApproved","modelRiskScore","blockers","dependencyRisks","secretsDetected","suggestedPatches","stats"]},"unicode-safety-gate":{"type":"object","properties":{"verdict":{"type":"string","enum":["block","warn","pass"],"description":"block: a critical finding, or a high finding in a code or config file. warn: other findings. pass: none."},"verdictReason":{"type":"string"},"riskScore":{"type":"integer","description":"0-100: worst severity (critical 90, high 70, medium 40, low 15) plus 1 per further affected line, at most 10."},"status":{"type":"string","enum":["complete","partial"],"description":"partial when files were skipped for size or findings were capped; the result is still signed."},"nextStep":{"type":"string"},"topFindings":{"type":"array","items":{"type":"object","description":"Up to 5 locations, blocking first: rank, path, line, column, severity, blocking, findings (count at that line), ruleIds, codePoints, title, fix."}},"source":{"type":"object","description":"Where the input came from: kind (files, diff, repo, pr), and for repo the owner/repo, ref and commit scanned."},"mode":{"type":"string","enum":["files","diff"]},"summary":{"type":"object","properties":{"total":{"type":"integer"},"returned":{"type":"integer"},"truncated":{"type":"boolean"},"bySeverity":{"type":"object","properties":{"critical":{"type":"integer"},"high":{"type":"integer"},"medium":{"type":"integer"},"low":{"type":"integer"}}},"byRule":{"type":"object","description":"Count per rule id, all 19 rules present."},"blocking":{"type":"integer"},"filesScanned":{"type":"integer"},"filesSkipped":{"type":"integer"}}},"findings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Stable within this response, F1, F2, ..."},"ruleId":{"type":"string","description":"USC001-USC019"},"ruleName":{"type":"string"},"severity":{"type":"string","enum":["critical","high","medium","low"]},"path":{"type":"string"},"line":{"type":"integer"},"column":{"type":"integer","description":"1-based, in code points."},"codePoints":{"type":"string","description":"Space-separated, e.g. \"U+202E\"."},"snippet":{"type":"string","description":"Surrounding text with invisible, control and lookalike characters shown as \\u{XXXX}."},"message":{"type":"string"},"charInfo":{"type":"string"}}}},"sarif":{"type":"object","description":"SARIF 2.1.0 log; columnKind unicodeCodePoints."},"skipped":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"reason":{"type":"string"}}}},"warnings":{"type":"array","items":{"type":"string"}},"explanations":{"type":"array","description":"Model-written, each verified against the finding it names (id, ruleId and codePoints must match).","items":{"type":"object","additionalProperties":false,"required":["id","ruleId","codePoints","attackVector","impact","remediation"],"properties":{"id":{"type":"string","description":"Finding id exactly as given, e.g. F3."},"ruleId":{"type":"string","description":"The finding's ruleId, copied exactly."},"codePoints":{"type":"string","description":"The finding's codePoints, copied exactly."},"attackVector":{"type":"string","description":"How this specific construct is exploited."},"impact":{"type":"string","description":"What an attacker gains if it is merged."},"remediation":{"type":"string","description":"What the reviewer should do."}}}},"llm":{"type":"string","enum":["ok","unavailable","skipped"]},"deterministic":{"type":"object","description":"Engine, finding count, verdict basis and known limits. Findings and verdict involve no model."}}}},"required":["diff-gatekeeper","unicode-safety-gate"]},"deterministic":{"type":"boolean","description":"True only when every member answered without a model."}},"required":["results","deterministic"]},"outputSchema":{"type":"object","properties":{"data":{"type":"object","properties":{"results":{"type":"object","description":"Each member agent's full result, keyed by agent id.","properties":{"diff-gatekeeper":{"type":"object","properties":{"summary":{"type":"string"},"intent_alignment":{"type":"string","description":"Does the diff do what the context says, and anything it does beyond that."},"breakingChanges":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","file","location","severity","description","affected_consumers","grounded","source"],"properties":{"id":{"type":"string","description":"BC-01, BC-02..."},"file":{"type":"string"},"location":{"type":"string"},"severity":{"type":"string","enum":["critical","high","medium","low"]},"description":{"type":"string"},"affected_consumers":{"type":"string"},"grounded":{"type":"boolean","description":"False when the file or line is not in the diff; ungrounded findings never block."},"source":{"type":"string","enum":["model","rule"]}}}},"securityFlaws":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","file","line","category","severity","description","exploit_scenario","grounded","source"],"properties":{"id":{"type":"string","description":"SEC-01, SEC-02..."},"file":{"type":"string"},"line":{"type":"integer"},"category":{"type":"string","enum":["sql_injection","nosql_injection","command_injection","xss","ssrf","path_traversal","authz_bypass","secret_exposure","insecure_crypto","deserialization","supply_chain","other"]},"severity":{"type":"string","enum":["critical","high","medium","low"]},"description":{"type":"string"},"exploit_scenario":{"type":"string"},"grounded":{"type":"boolean","description":"False when the file or line is not in the diff; ungrounded findings never block."},"source":{"type":"string","enum":["model","rule"]}}}},"bugs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","file","line","category","severity","description","grounded","source"],"properties":{"id":{"type":"string","description":"BUG-01, BUG-02..."},"file":{"type":"string"},"line":{"type":"integer"},"category":{"type":"string","enum":["race_condition","state_mutation","error_handling","logic_error","resource_leak","null_handling","performance","other"]},"severity":{"type":"string","enum":["critical","high","medium","low"]},"description":{"type":"string"},"grounded":{"type":"boolean","description":"False when the file or line is not in the diff; ungrounded findings never block."},"source":{"type":"string","enum":["model","rule"]}}}},"dependency_risks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["package","risk","severity"],"properties":{"package":{"type":"string"},"risk":{"type":"string"},"severity":{"type":"string","enum":["critical","high","medium","low"]}}}},"riskScore":{"type":"integer","description":"0-100 overall merge risk."},"verdict":{"type":"string","enum":["fail","warn","pass","inconclusive"],"description":"fail: a secret or a grounded critical or high finding blocks the merge. inconclusive: part of the diff was not reviewed. warn: only non-blocking findings. pass: none."},"verdictReason":{"type":"string"},"status":{"type":"string","enum":["complete","partial"],"description":"partial when part of the diff was not reviewed or an over-long added line was pattern-scanned only in part; the result is still signed."},"nextStep":{"type":"string"},"topFindings":{"type":"array","items":{"type":"object","description":"Up to 5, most severe first: rank, id, kind (secret, security, bug, breaking_change, dependency), severity, file, line, title, fix, blocking."}},"annotations":{"type":"array","items":{"type":"object","description":"GitHub Checks API annotations: path, start_line, end_line, annotation_level (failure, warning, notice), title, message."}},"sarif":{"type":"object","description":"SARIF 2.1.0 log of every grounded finding at its file and line; uploads to GitHub code scanning as-is."},"mergeApproved":{"type":"boolean","description":"True when no secret and no grounded critical or high finding was found and the whole diff was reviewed."},"modelRiskScore":{"type":"integer","description":"The model's own 0-100 estimate; advisory. riskScore is computed from grounded findings (critical 40, high 20, medium 8, low 2, capped at 100) with scanner floors."},"blockers":{"type":"array","items":{"type":"string"}},"dependencyRisks":{"type":"object"},"secretsDetected":{"type":"array","items":{"type":"object"}},"suggestedPatches":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["finding_id","file","original_code","corrected_code","explanation"],"properties":{"finding_id":{"type":"string"},"file":{"type":"string"},"original_code":{"type":"string","description":"The exact lines from the diff being replaced."},"corrected_code":{"type":"string","description":"Drop-in replacement code."},"explanation":{"type":"string"},"also_fixes":{"type":"array","items":{"type":"string"},"description":"Other finding ids this same patch resolves."}}}},"stats":{"type":"object"}},"required":["summary","intent_alignment","breakingChanges","securityFlaws","bugs","riskScore","verdict","verdictReason","status","nextStep","topFindings","annotations","sarif","mergeApproved","modelRiskScore","blockers","dependencyRisks","secretsDetected","suggestedPatches","stats"]},"unicode-safety-gate":{"type":"object","properties":{"verdict":{"type":"string","enum":["block","warn","pass"],"description":"block: a critical finding, or a high finding in a code or config file. warn: other findings. pass: none."},"verdictReason":{"type":"string"},"riskScore":{"type":"integer","description":"0-100: worst severity (critical 90, high 70, medium 40, low 15) plus 1 per further affected line, at most 10."},"status":{"type":"string","enum":["complete","partial"],"description":"partial when files were skipped for size or findings were capped; the result is still signed."},"nextStep":{"type":"string"},"topFindings":{"type":"array","items":{"type":"object","description":"Up to 5 locations, blocking first: rank, path, line, column, severity, blocking, findings (count at that line), ruleIds, codePoints, title, fix."}},"source":{"type":"object","description":"Where the input came from: kind (files, diff, repo, pr), and for repo the owner/repo, ref and commit scanned."},"mode":{"type":"string","enum":["files","diff"]},"summary":{"type":"object","properties":{"total":{"type":"integer"},"returned":{"type":"integer"},"truncated":{"type":"boolean"},"bySeverity":{"type":"object","properties":{"critical":{"type":"integer"},"high":{"type":"integer"},"medium":{"type":"integer"},"low":{"type":"integer"}}},"byRule":{"type":"object","description":"Count per rule id, all 19 rules present."},"blocking":{"type":"integer"},"filesScanned":{"type":"integer"},"filesSkipped":{"type":"integer"}}},"findings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Stable within this response, F1, F2, ..."},"ruleId":{"type":"string","description":"USC001-USC019"},"ruleName":{"type":"string"},"severity":{"type":"string","enum":["critical","high","medium","low"]},"path":{"type":"string"},"line":{"type":"integer"},"column":{"type":"integer","description":"1-based, in code points."},"codePoints":{"type":"string","description":"Space-separated, e.g. \"U+202E\"."},"snippet":{"type":"string","description":"Surrounding text with invisible, control and lookalike characters shown as \\u{XXXX}."},"message":{"type":"string"},"charInfo":{"type":"string"}}}},"sarif":{"type":"object","description":"SARIF 2.1.0 log; columnKind unicodeCodePoints."},"skipped":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"reason":{"type":"string"}}}},"warnings":{"type":"array","items":{"type":"string"}},"explanations":{"type":"array","description":"Model-written, each verified against the finding it names (id, ruleId and codePoints must match).","items":{"type":"object","additionalProperties":false,"required":["id","ruleId","codePoints","attackVector","impact","remediation"],"properties":{"id":{"type":"string","description":"Finding id exactly as given, e.g. F3."},"ruleId":{"type":"string","description":"The finding's ruleId, copied exactly."},"codePoints":{"type":"string","description":"The finding's codePoints, copied exactly."},"attackVector":{"type":"string","description":"How this specific construct is exploited."},"impact":{"type":"string","description":"What an attacker gains if it is merged."},"remediation":{"type":"string","description":"What the reviewer should do."}}}},"llm":{"type":"string","enum":["ok","unavailable","skipped"]},"deterministic":{"type":"object","description":"Engine, finding count, verdict basis and known limits. Findings and verdict involve no model."}}}},"required":["diff-gatekeeper","unicode-safety-gate"]},"deterministic":{"type":"boolean","description":"True only when every member answered without a model."}},"required":["results","deterministic"]},"_provenance":{"type":"object","description":"C2PA-aligned manifest and W3C VC 2.0 (eddsa-jcs-2022) issued by the hub DID; verify at POST /api/v1/verify-provenance"}},"required":["data","_provenance"]},"example":{"diff":"diff --git a/src/users.ts b/src/users.ts\n--- a/src/users.ts\n+++ b/src/users.ts\n@@ -10,3 +10,4 @@ export async function findUser(db, req) {\n-  return db.query('SELECT * FROM users WHERE id = $1', [req.params.id]);\n+  const id = req.params.id;\n+  return db.query(`SELECT * FROM users WHERE id = ${id}`);\n }\n"},"openapiOperation":{"operationId":"pre_merge_review","summary":"Pre-merge Review Pack","description":"One unified diff in, one merge decision out: the PR exploit gatekeeper (bug hunter, patch synthesizer, secret/dependency/SAST scans) plus the adversarial Unicode / Trojan Source gate. Runs diff-gatekeeper ($0.50) + unicode-safety-gate ($0.25) in one paid call for 20% less than buying them separately. Charged only when every member succeeds.\n\nPrice: 0.60 USDC on Base (x402).","x-x402-price-usdc":"0.60","x-x402-amount":"600000","x-audience":"developer","x-sample-url":"https://agents.writerslogic.com/api/v1/samples/pre-merge-review","security":[{"x402":[]},{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["diff"],"properties":{"diff":{"type":"string","minLength":1,"maxLength":300000,"description":"Unified diff of the change (git diff / PR .diff)."},"packageJsonDiff":{"type":"string","maxLength":50000},"context":{"type":"string","maxLength":4000,"description":"What the PR is supposed to do."}}},"example":{"diff":"diff --git a/src/users.ts b/src/users.ts\n--- a/src/users.ts\n+++ b/src/users.ts\n@@ -10,3 +10,4 @@ export async function findUser(db, req) {\n-  return db.query('SELECT * FROM users WHERE id = $1', [req.params.id]);\n+  const id = req.params.id;\n+  return db.query(`SELECT * FROM users WHERE id = ${id}`);\n }\n"}}}},"responses":{"200":{"description":"Paid result with provenance","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"results":{"type":"object","description":"Each member agent's full result, keyed by agent id.","properties":{"diff-gatekeeper":{"type":"object","properties":{"summary":{"type":"string"},"intent_alignment":{"type":"string","description":"Does the diff do what the context says, and anything it does beyond that."},"breakingChanges":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","file","location","severity","description","affected_consumers","grounded","source"],"properties":{"id":{"type":"string","description":"BC-01, BC-02..."},"file":{"type":"string"},"location":{"type":"string"},"severity":{"type":"string","enum":["critical","high","medium","low"]},"description":{"type":"string"},"affected_consumers":{"type":"string"},"grounded":{"type":"boolean","description":"False when the file or line is not in the diff; ungrounded findings never block."},"source":{"type":"string","enum":["model","rule"]}}}},"securityFlaws":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","file","line","category","severity","description","exploit_scenario","grounded","source"],"properties":{"id":{"type":"string","description":"SEC-01, SEC-02..."},"file":{"type":"string"},"line":{"type":"integer"},"category":{"type":"string","enum":["sql_injection","nosql_injection","command_injection","xss","ssrf","path_traversal","authz_bypass","secret_exposure","insecure_crypto","deserialization","supply_chain","other"]},"severity":{"type":"string","enum":["critical","high","medium","low"]},"description":{"type":"string"},"exploit_scenario":{"type":"string"},"grounded":{"type":"boolean","description":"False when the file or line is not in the diff; ungrounded findings never block."},"source":{"type":"string","enum":["model","rule"]}}}},"bugs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","file","line","category","severity","description","grounded","source"],"properties":{"id":{"type":"string","description":"BUG-01, BUG-02..."},"file":{"type":"string"},"line":{"type":"integer"},"category":{"type":"string","enum":["race_condition","state_mutation","error_handling","logic_error","resource_leak","null_handling","performance","other"]},"severity":{"type":"string","enum":["critical","high","medium","low"]},"description":{"type":"string"},"grounded":{"type":"boolean","description":"False when the file or line is not in the diff; ungrounded findings never block."},"source":{"type":"string","enum":["model","rule"]}}}},"dependency_risks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["package","risk","severity"],"properties":{"package":{"type":"string"},"risk":{"type":"string"},"severity":{"type":"string","enum":["critical","high","medium","low"]}}}},"riskScore":{"type":"integer","description":"0-100 overall merge risk."},"verdict":{"type":"string","enum":["fail","warn","pass","inconclusive"],"description":"fail: a secret or a grounded critical or high finding blocks the merge. inconclusive: part of the diff was not reviewed. warn: only non-blocking findings. pass: none."},"verdictReason":{"type":"string"},"status":{"type":"string","enum":["complete","partial"],"description":"partial when part of the diff was not reviewed or an over-long added line was pattern-scanned only in part; the result is still signed."},"nextStep":{"type":"string"},"topFindings":{"type":"array","items":{"type":"object","description":"Up to 5, most severe first: rank, id, kind (secret, security, bug, breaking_change, dependency), severity, file, line, title, fix, blocking."}},"annotations":{"type":"array","items":{"type":"object","description":"GitHub Checks API annotations: path, start_line, end_line, annotation_level (failure, warning, notice), title, message."}},"sarif":{"type":"object","description":"SARIF 2.1.0 log of every grounded finding at its file and line; uploads to GitHub code scanning as-is."},"mergeApproved":{"type":"boolean","description":"True when no secret and no grounded critical or high finding was found and the whole diff was reviewed."},"modelRiskScore":{"type":"integer","description":"The model's own 0-100 estimate; advisory. riskScore is computed from grounded findings (critical 40, high 20, medium 8, low 2, capped at 100) with scanner floors."},"blockers":{"type":"array","items":{"type":"string"}},"dependencyRisks":{"type":"object"},"secretsDetected":{"type":"array","items":{"type":"object"}},"suggestedPatches":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["finding_id","file","original_code","corrected_code","explanation"],"properties":{"finding_id":{"type":"string"},"file":{"type":"string"},"original_code":{"type":"string","description":"The exact lines from the diff being replaced."},"corrected_code":{"type":"string","description":"Drop-in replacement code."},"explanation":{"type":"string"},"also_fixes":{"type":"array","items":{"type":"string"},"description":"Other finding ids this same patch resolves."}}}},"stats":{"type":"object"}},"required":["summary","intent_alignment","breakingChanges","securityFlaws","bugs","riskScore","verdict","verdictReason","status","nextStep","topFindings","annotations","sarif","mergeApproved","modelRiskScore","blockers","dependencyRisks","secretsDetected","suggestedPatches","stats"]},"unicode-safety-gate":{"type":"object","properties":{"verdict":{"type":"string","enum":["block","warn","pass"],"description":"block: a critical finding, or a high finding in a code or config file. warn: other findings. pass: none."},"verdictReason":{"type":"string"},"riskScore":{"type":"integer","description":"0-100: worst severity (critical 90, high 70, medium 40, low 15) plus 1 per further affected line, at most 10."},"status":{"type":"string","enum":["complete","partial"],"description":"partial when files were skipped for size or findings were capped; the result is still signed."},"nextStep":{"type":"string"},"topFindings":{"type":"array","items":{"type":"object","description":"Up to 5 locations, blocking first: rank, path, line, column, severity, blocking, findings (count at that line), ruleIds, codePoints, title, fix."}},"source":{"type":"object","description":"Where the input came from: kind (files, diff, repo, pr), and for repo the owner/repo, ref and commit scanned."},"mode":{"type":"string","enum":["files","diff"]},"summary":{"type":"object","properties":{"total":{"type":"integer"},"returned":{"type":"integer"},"truncated":{"type":"boolean"},"bySeverity":{"type":"object","properties":{"critical":{"type":"integer"},"high":{"type":"integer"},"medium":{"type":"integer"},"low":{"type":"integer"}}},"byRule":{"type":"object","description":"Count per rule id, all 19 rules present."},"blocking":{"type":"integer"},"filesScanned":{"type":"integer"},"filesSkipped":{"type":"integer"}}},"findings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Stable within this response, F1, F2, ..."},"ruleId":{"type":"string","description":"USC001-USC019"},"ruleName":{"type":"string"},"severity":{"type":"string","enum":["critical","high","medium","low"]},"path":{"type":"string"},"line":{"type":"integer"},"column":{"type":"integer","description":"1-based, in code points."},"codePoints":{"type":"string","description":"Space-separated, e.g. \"U+202E\"."},"snippet":{"type":"string","description":"Surrounding text with invisible, control and lookalike characters shown as \\u{XXXX}."},"message":{"type":"string"},"charInfo":{"type":"string"}}}},"sarif":{"type":"object","description":"SARIF 2.1.0 log; columnKind unicodeCodePoints."},"skipped":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"reason":{"type":"string"}}}},"warnings":{"type":"array","items":{"type":"string"}},"explanations":{"type":"array","description":"Model-written, each verified against the finding it names (id, ruleId and codePoints must match).","items":{"type":"object","additionalProperties":false,"required":["id","ruleId","codePoints","attackVector","impact","remediation"],"properties":{"id":{"type":"string","description":"Finding id exactly as given, e.g. F3."},"ruleId":{"type":"string","description":"The finding's ruleId, copied exactly."},"codePoints":{"type":"string","description":"The finding's codePoints, copied exactly."},"attackVector":{"type":"string","description":"How this specific construct is exploited."},"impact":{"type":"string","description":"What an attacker gains if it is merged."},"remediation":{"type":"string","description":"What the reviewer should do."}}}},"llm":{"type":"string","enum":["ok","unavailable","skipped"]},"deterministic":{"type":"object","description":"Engine, finding count, verdict basis and known limits. Findings and verdict involve no model."}}}},"required":["diff-gatekeeper","unicode-safety-gate"]},"deterministic":{"type":"boolean","description":"True only when every member answered without a model."}},"required":["results","deterministic"]},"_provenance":{"type":"object","description":"C2PA-aligned manifest and W3C VC 2.0 (eddsa-jcs-2022) issued by the hub DID; verify at POST /api/v1/verify-provenance"}},"required":["data","_provenance"]}}}},"400":{"description":"Invalid request (no payment consumed)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}},"401":{"description":"Invalid X-API-KEY","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}},"402":{"description":"Payment required or invalid","content":{"application/json":{"schema":{"type":"object","description":"x402 v2 PaymentRequired (also base64 in the PAYMENT-REQUIRED header)","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"code":{"type":"string"},"resource":{"type":"object"},"accepts":{"type":"array","items":{"type":"object"}},"extensions":{"type":"object"}}}}}},"502":{"description":"Upstream failure; the payment is released or not settled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}}}},"links":{"docs":"https://writerslogic.com/agents/pre-merge-review/","docsJson":"https://writerslogic.com/agents/pre-merge-review.json","sample":"https://agents.writerslogic.com/api/v1/samples/pre-merge-review","openapi":"https://agents.writerslogic.com/openapi.json","catalog":"https://agents.writerslogic.com/api/v1/catalog","verifyProvenance":"https://agents.writerslogic.com/api/v1/verify-provenance","index":"https://writerslogic.com/agents/index.json"}}