[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6992KRP2XYWEMV12P5M4GPE":3,"skill-same:01M6992KRP2XYWEMV12P5M4GPE":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":42,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M6992KRP2XYWEMV12P5M4GPE","mantis-review",null,"Independently reviews findings and filters out false positives. Use when consolidated findings need validation against the actual source code. Don't use for reproducing crashes or patching code.","google\u002Fmantis","google","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1342004?v=4","01M698VYEFDM0VJBZDYYJ2T83S","Google","01M6990SDGGFEAP21TJNS7HEG9",2778,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fmantis\u002Fblob\u002Fmain\u002Fskills\u002Fmantis-review\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31],"review","mantis review","code","validation","patching","use","filters","false","reviews","for","source","source code","when","2026-11-10 10:12:30",false,"---\nname: mantis-review\ndescription: >-\n  Independently reviews findings and filters out false positives.\n  Use when consolidated findings need validation against the actual source code.\n  Don't use for reproducing crashes or patching code.\n---\n\n# Reviewer (\u002Fmantis-review)\n\n## System Goal\n\nIndependent Validator. Reviews consolidated findings against active source code\nto verify validity and filter out noise and false positives.\n\n## Command Definition\n\n- **Command:** `\u002Fmantis-review`\n- **Description:** Independently reviews findings and filters out false\n  positives.\n\n## Input\u002FOutput Contract\n\n- **Reads**:\n  - `workspace\u002Ffindings\u002F` (finding JSON files, including each finding's optional\n    `discovery_commit` provenance stamp).\n  - `workspace\u002F.mantis_state.json` (current loop `pass_number`; and, when\n    present, `active_snapshot` = `{root, snapshot_id, snapshot_pinned}` for\n    snapshot provenance).\n  - Invocation args when passed by the orchestrator: `--snapshot_root`,\n    `--snapshot_id`, `--state_root` (and, rarely, `--target_root`).\n  - Target source code files at the `code_paths` paths\u002Flines, read under the\n    resolved `CODE_ROOT` (the pinned snapshot root — see Instructions Step 0 \u002F\n    Block A), never the live tree when a snapshot is pinned.\n- **Writes**:\n  - Updates findings on disk in-place (sets `\"status\"`, `\"reasoning\"`,\n    `\"repro_hints\"`, `\"triage_checklist\"`, and appends history).\n  - Writes helper script `workspace\u002Fhelpers\u002Fappend_review.py`.\n- **Preconditions**:\n  - `workspace\u002Ffindings\u002F` exists with finding files.\n  - Target source code files exist.\n- **Idempotency Guarantee**:\n  - Modifies finding files in-place using the helper script `append_review.py`,\n    which MUST carry `# MANTIS_HELPER_VERSION = 2` as its first line; regenerate\n    the helper if that marker is absent or a different integer (see Instructions\n    step 5).\n  - Idempotency key is **(pass_number, snapshot)**. Before (re)writing a\n    finding, scan its `history` array:\n    - **SNAPSHOT MODE OFF** (neither `--snapshot_id` was passed NOR is\n      `active_snapshot` readable in state): SKIP the review update iff a\n      `\"stage\": \"reviewer\"` entry already exists for the current `pass_number`\n      (byte-for-byte today's behavior).\n    - **SNAPSHOT MODE ON**: SKIP the review update iff a `\"stage\": \"reviewer\"`\n      entry exists whose `pass_number` equals the current pass AND whose\n      `snapshot` equals `SNAPSHOT_ID`. A reviewer entry that lacks `snapshot`\n      (legacy) or carries a different `snapshot` counts as UNKNOWN → RE-REVIEW\n      (do NOT skip), so a finding reviewed under the old skill is re-grounded\n      against the current pinned snapshot.\n\n## Instructions\n\nRead and evaluate the deduplicated findings against the actual source code of\nthe repository. **Assume every finding is a false positive by default. Your job\nis to disprove the finding using an adversarial stance. Evaluate the claim based\nONLY on the code and the raw claim itself. Explicitly ignore the original\nfinder's prose reasoning and justification, as they may be hallucinated.**\n\nExecute your validation as follows:\n\n**Step 0 — Locator Resolution & Snapshot Provenance Gate (do this FIRST, before\nreading any finding's code):**\n\n0a. **Resolve where to read code.** **Block A — Locator Resolution** here:\n\n```\nLOCATOR RESOLUTION (before reading ANY target code or artifact):\n0. ROLE: If this skill NEVER reads target source (report, calibrate, reflect),\n   you are a FINDINGS-ONLY stage: skip steps 2-6; still read active_snapshot from\n   state for provenance\u002Fannotation; NEVER stop merely because a code root is unset.\n1. Determine CODE_ROOT, in this priority order:\n   a. If --target_root is passed on THIS invocation, CODE_ROOT = --target_root.\n      It is AUTHORITATIVE and OVERRIDES SNAPSHOT_ROOT and the state fallback\n      (used when a caller hands you a prepared tree, e.g. a patched shadow).\n   b. Else if --snapshot_root (or SNAPSHOT_ROOT) is passed, use it.\n   c. Else read state_root\u002Fworkspace\u002F.mantis_state.json (state_root from\n      --state_root if passed, else .\u002Fworkspace\u002F... relative to the current dir)\n      -> active_snapshot.root \u002F .snapshot_id \u002F .snapshot_pinned.\n   d. Else (no arg AND no readable active_snapshot): CODE_ROOT = current directory,\n      treat snapshot_pinned = false (MODE-OFF). Do NOT stop.\n2. SENTINEL CHECK (only if snapshot_pinned is true AND you did NOT take path 1a):\n   verify CODE_ROOT\u002F.mantis_snapshot_id exists and equals SNAPSHOT_ID. If missing\n   or different -> STOP \"snapshot sentinel mismatch\". (A --target_root tree (1a) is\n   deliberately mutated and is sentinel-EXEMPT.)\n3. PATH FIELDS:\n   - SNAPSHOT-RELATIVE (read under CODE_ROOT): code_paths entries; plan target_files\n     that are file paths. Strip ONLY a trailing \":\u003Cdigits>\". A code_paths entry\n     containing \":\u002F\u002F\" is a URL\u002Fendpoint, NOT a file read. A code_paths entry that is\n     NOT of the form \u003Cexisting-path>:\u003Cinteger> is a non-source LOCATOR\n     (symbol\u002Foffset\u002Fendpoint): only check that the artifact\u002Fsymbol exists; skip ALL\n     line-range and line-existence logic.\n   - STATE-RELATIVE (read\u002Fwrite under state_root\u002Fworkspace, NEVER prefix CODE_ROOT):\n     kb_references, repro_file_path, reattack_file_path, helper scripts, report\n     files, and all state\u002Ffindings JSON.\n4. Never WRITE under CODE_ROOT when snapshot_pinned is true. Any command that\n   compiles, generates, or writes artifacts MUST run in a PRIVATE SHADOW copy\n   (mktemp -d from CODE_ROOT), never with cwd=CODE_ROOT. Read-only inspection may\n   cd into CODE_ROOT.\n5. VCS-METADATA CARVE-OUT: history-log extraction and any VCS diff\u002Fblame command\n   run in the LIVE repository root (which still has .git\u002F.hg\u002F.repo), NOT CODE_ROOT\n   (the snapshot copy strips VCS metadata). Do NOT stop merely because CODE_ROOT\n   lacks .git\u002F.hg\u002F.repo.\n6. Every shell command uses ABSOLUTE paths and sets its own working directory on\n   that call. Do NOT assume the working directory persists between calls.\n```\n\nThe reviewer READS target source, so it is NOT a findings-only stage: run all of\nBlock A steps 1-6. `CODE_ROOT` is the pinned snapshot root you will read every\n`code_paths` entry under. Per Block A step 3, a `code_paths` entry containing\n`:\u002F\u002F` is a URL (existence check only), and any entry not of the form\n`\u003Cexisting-path>:\u003Cinteger>` is a non-source locator (check the artifact\u002Fsymbol\nexists; skip all line-existence logic). Never STOP merely because `CODE_ROOT`\nlacks `.git`\u002F`.hg` (Block A step 5).\n\n> [!NOTE] **CURRENT-PASS CHECK (defensive; the binding guarantee is on the\n> harness per `mantis-pipeline-adapter` Scenario 2):** if `active_snapshot` is\n> present AND `active_snapshot.pass != state.pass_number`, treat the snapshot as\n> STALE for this pass — STOP \"stale active_snapshot: pass mismatch\" or degrade\n> as HALT (`snapshot_pinned` effectively false: no authoritative verdicts, Block\n> B NOT_MATCHED, reproduce `not_attempted`). This catches a custom harness that\n> preserved `active_snapshot` across the Stage 15 pass increment without\n> re-pinning. The reference meta-agent re-pins every pass, so this check never\n> fires there. Block B itself cannot detect this (it is `snapshot_id`-only, not\n> `pass`-aware).\n\n0b. **Determine SNAPSHOT MODE (once, before touching findings):** - SNAPSHOT\nMODE is **OFF** iff `--snapshot_id` was NOT passed on this invocation AND\n`workspace\u002F.mantis_state.json` has no readable `active_snapshot`. This is a\nlegacy \u002F non-sync run: do NOT run the Snapshot Provenance Gate below; review\nEVERY finding with steps 1-5 exactly as before. - Otherwise SNAPSHOT MODE is\n**ON**. From Block A you now hold `SNAPSHOT_ID` and `snapshot_pinned`. Apply the\nSnapshot Provenance Gate (0c) to every finding.\n\n0c. **Snapshot Provenance Gate (SNAPSHOT MODE ON only).** After Step 1 loads the\nfindings, apply the match check to EACH finding F via **Block B — Snapshot Match\nCheck**, applied to F:\n\n```\nSNAPSHOT MATCH CHECK for finding F (decides MATCHED vs NOT_MATCHED):\n1. If snapshot_pinned is false -> NOT_MATCHED. Stop.\n2. Read F.discovery_commit:\n   - missing OR empty OR the literal \"MIXED\" -> NOT_MATCHED.\n   - not exactly equal to SNAPSHOT_ID          -> NOT_MATCHED.\n   - exactly equal to SNAPSHOT_ID              -> MATCHED.\nThere is no other route to MATCHED; never fuzzy-compare. The global \"default the\nfield and proceed\" backward-compat rule does NOT apply to discovery_commit:\nabsent = NOT_MATCHED. (There is NO separate \"dirty\" gate: a dirty tree's\nSNAPSHOT_ID already embeds the working-tree content hash, so within-pass findings\nMATCH and cross-pass bare-commit findings do not.)\n```\n\nThen, using the idempotency rule (Input\u002FOutput Contract → Idempotency Guarantee)\nto avoid double-writes:\n\n- **MATCHED** → F is grounded in the current pinned snapshot. Proceed to steps\n  2-5 (the full 13-rule review) for F.\n- **NOT_MATCHED** (includes: `snapshot_pinned` false \u002F HALT \u002F live-endpoint\n  pass; `discovery_commit` missing, empty, or the literal `MIXED`; or\n  `discovery_commit != SNAPSHOT_ID`) → F was discovered against a different (or\n  absent\u002Funpinned) snapshot; its `code_paths` line numbers may no longer point\n  at the same code. **DO NOT run the 13 rules on F. DO NOT mark it\n  FALSE_POSITIVE.** Finalize F as a drift `NEEDS_RESEARCH` via the helper (step\n  5), writing EXACTLY:\n  - `\"status\": \"NEEDS_RESEARCH\"`\n  - `\"reasoning\"`:\n    `\"Snapshot drift: finding discovered against snapshot \u003CF.discovery_commit or 'unknown'>, which does not match the current pinned snapshot \u003CSNAPSHOT_ID>. Not re-validated this pass; routed to re-research.\"`\n  - omit `\"repro_hints\"` (and, if F carried stale `repro_hints` from a prior\n    pass, leave them — they are ignored downstream because status is not\n    VALID\u002FPROVISIONALLY_VALID).\n  - `\"triage_checklist\"`: all 13 constraints set to `UNKNOWN` (paste the object\n    below verbatim). This object is REQUIRED: appending a `reviewer` history\n    entry makes `triage_checklist` mandatory on a non-chain finding\n    (`schema.json` lines 365-398), and for a `NEEDS_RESEARCH` finding every\n    entry MUST avoid `FAIL`\u002F`passes:false` (`schema.json` lines 418-470).\n    Setting `ensure_source_code_coherence` and\n    `verify_attacker_control_of_source` to `UNKNOWN` (never `FAIL`) is the whole\n    point: a line\u002Fpath mismatch caused by DRIFT is NOT evidence of\n    hallucination, so Rules 12\u002F13 must NOT fire on it.\n  - append the `reviewer` `\"history\"` entry (with `\"snapshot\"`, per step 5 \u002F the\n    history JSON below). Then STOP processing F — skip steps 2-5 for it.\n\nDrift `triage_checklist` (paste verbatim; all 13 keys, all `UNKNOWN`):\n\n```json\n{\n  \"ignore_hypothetical_misuse\":        { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"ignore_missing_hygiene\":            { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"require_strict_reproducibility\":    { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"avoid_pedantic_linting\":            { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"no_security_flaw_stretching\":       { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"evaluate_questionable_file_paths\":  { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"ignore_resource_exhaustion_dos\":    { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"intrinsic_security_flaws\":          { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"verify_mitigations_pragmatically\":  { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"refine_code_paths_strictly\":        { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"ignore_simd_vector_padding\":        { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"ensure_source_code_coherence\":      { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: line\u002Fpath mismatch may be caused by drift, not hallucination; not re-validated\" },\n  \"verify_attacker_control_of_source\": { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: trust-boundary path not re-traced against the current pinned snapshot\" }\n}\n```\n\nFindings finalized as drift `NEEDS_RESEARCH` in Step 0c are DONE — do not\nprocess them again in steps 2-5. Only MATCHED findings (SNAPSHOT MODE ON) or all\nfindings (SNAPSHOT MODE OFF) flow into steps 2-5 below.\n\n1. **Load Clustered Findings:** Read the JSON files in the `workspace\u002Ffindings\u002F`\n   directory. If the directory is empty or missing, notify the user.\n\n2. **Source Code Inspection:** For each finding that reached this step (in\n   SNAPSHOT MODE ON, only findings that were **MATCHED** in Step 0c; findings\n   finalized there as drift `NEEDS_RESEARCH` are already done and are skipped),\n   read the file **under `CODE_ROOT`** (the pinned snapshot root resolved in\n   Step 0 \u002F Block A — resolve every `code_paths` path relative to `CODE_ROOT`,\n   never the live tree) to inspect the exact files and line numbers listed in\n   `code_paths` and confirm the finding is grounded in the actual snapshot\n   state. Do not make assumptions about the validity of a path without\n   inspecting the source code first.\n\n3. **Strict Validation Filtering (Apply the 13 Negative Constraints):** Evaluate\n   each finding against these strict criteria. Mark a finding as\n   **FALSE_POSITIVE** if it violates any of the following rules:\n\n   01. **Ignore Hypothetical Misuse:** Do not flag security flaws that rely on a\n       calling API hypothetically misusing a function, writing bad fallback\n       logic, or sending invalid parameters if the function itself behaves\n       safely.\n   02. **Ignore Missing Hygiene \u002F Defense-In-Depth:** Do not report missing HTTP\n       security headers (e.g., `X-Content-Type-Options`), missing authentication\n       on local-only test functions, or hardcoded mock databases as security\n       flaws.\n   03. **Require Strict Reproducibility:** Only mark a finding as VALID if a\n       direct, unambiguous, and triggerable flaw exists within the boundaries of\n       the code logic. If the finding is extremely fragile (e.g., relies on\n       unstable timing that cannot be automated or brute-forced, or requires\n       unrealistic environmental conditions to trigger), mark it as\n       FALSE_POSITIVE. *Note on Race Conditions:* Do NOT dismiss race conditions\n       or timing bugs simply because they have a low success probability (e.g.,\n       1 in a million), provided the attack path can be automated and repeatedly\n       attempted by an attacker to eventually trigger the exploit.\n   04. **Avoid Pedantic Linting:** If the code uses standard safe libraries\n       (such as `json.loads`, parameterised SQL queries, or secure standard\n       library hashes) but lacks extreme paranoia, mark it as FALSE_POSITIVE.\n   05. **No Security Flaw Stretching on Mitigations:** If you are reviewing a\n       mitigation or a safe variant of a function that successfully blocks the\n       original security flaw class, do NOT invent complex protocol-level\n       bypasses or adjacent security flaw classes (e.g., SSRF when reviewing\n       Command Injection fixes). If the primary security flaw is successfully\n       blocked, mark it as FALSE_POSITIVE.\n   06. **Evaluate Questionable File Paths:** Do NOT instantly dismiss a finding\n       simply because its path contains `\u002Ftest`, `\u002Fexperimental`, or `\u002Fmock`.\n       Code in these paths is sometimes compiled into production targets or\n       reachable via production endpoints. Do not blindly assume it is safe;\n       instead, take reasonable measures to trace its usage to confirm whether\n       it is actually exposed in production.\n   07. **Ignore Resource Exhaustion DoS:** Do not flag functions for lacking\n       recursion limits, input size boundaries, or cycle constraints unless the\n       primary stated purpose of the module is to defend against DoS attacks.\n   08. **Intrinsic Security Flaws:** If a function uses a fundamentally broken\n       algorithm (such as MD5, SHA1), hardcodes static secrets, or contains\n       direct injection paths in its own logic, mark it as VALID even if it is\n       not currently called anywhere in the codebase.\n   09. **Verify Mitigations Pragmatically:** Do not hallucinate flaws in active\n       mitigations. If the code adds trailing validation slashes or configures\n       safe parsing flags, accept that the mitigation works.\n   10. **Refine `code_paths` Strictly:** The `code_paths` field should only\n       include the exact `filename:line_number` of the flawed code block. Strip\n       out any helper files, test harnesses, or correct caller files from\n       `code_paths`.\n   11. **Ignore SIMD\u002FVector Padding Violations:** If a finding represents an\n       out-of-bounds read or write inside optimized vector routines (e.g., NEON,\n       SSE, AVX, VSX), verify if the library employs a global memory allocation\n       contract (such as trailing safety padding, like `row_bytes + 16`). If the\n       out-of-bounds access is mathematically guaranteed to reside entirely\n       within this pre-allocated padding buffer under all execution paths, mark\n       the finding as a FALSE_POSITIVE (By Design).\n   12. **Ensure Source Code Coherence (Anti-Hallucination):** Verify that every\n       file path listed in `code_paths` exists in the repository, and that\n       function names, variable names, or line numbers actually exist at those\n       locations. If references are missing or incorrect, immediately mark the\n       finding as a FALSE_POSITIVE to prevent downstream agents from wasting\n       resources on hallucinated bugs.\n   13. **Verify Attacker Control of the Source (Trust-Boundary Tracing):**\n       Before marking a data-flow finding VALID, identify and cite the file:line\n       where untrusted data enters the analyzed codebase (the \"Ingress Point\")\n       from which the specific tainted field's value flows to the sink, OR where\n       that field is populated by an untrusted writer.\n       - If you have access to the untrusted-side code (e.g. Guest\u002FClient in a\n         multi-component repo), cite the writer.\n       - If you only have access to the trusted-side code, cite the Host\u002FServer\n         ingress point on the data-flow path (e.g., reads from shared memory,\n         IPC handlers, HTTP request parameter retrieval).\n       - If the source data is proven to originate solely from trusted-side\n         origins (server-authored static config, host-plane internal state),\n         mark FALSE_POSITIVE.\n       - Exception: Do not apply this rule to Intrinsic Security Flaws (Rule 08)\n         where the vulnerability exists in library code independent of active\n         callers.\n\n   - **Status Resolution:**\n\n     - Mark as **FALSE_POSITIVE** if it violates any of the 13 rules above.\n     - Mark as **VALID** if it passes all rules and has a clear, triggerable\n       flaw.\n     - Mark as **PROVISIONALLY_VALID** if it passes the rules, but you are\n       uncertain of its feasibility without dynamic verification (e.g. requires\n       complex heap grooming or precise timing).\n     - Mark as **NEEDS_RESEARCH** if the review is inconclusive due to high\n       complexity, unresolved external APIs, or massive call graphs — OR because\n       the finding was **NOT_MATCHED** by the Step 0c Snapshot Provenance Gate\n       (snapshot drift). Drift findings are finalized in Step 0c and never reach\n       these 13 rules; do NOT re-classify a drift finding as `FALSE_POSITIVE`.\n     - **SCHEMA-CRITICAL:** `FALSE_POSITIVE` is the ONLY status for which a\n       `triage_checklist` entry may be `\"FAIL\"` (or `\"passes\": false`). For any\n       `VALID`, `PROVISIONALLY_VALID`, or `NEEDS_RESEARCH` finding, EVERY\n       checklist entry must be `PASS` \u002F `NOT_APPLICABLE` \u002F `UNKNOWN` — never\n       `FAIL` — or `schema.json` (lines 418-470) will reject the finding. If a\n       rule looks failed but you are NOT setting status to `FALSE_POSITIVE`\n       (e.g. Rule 12\u002F13 references look off only because of snapshot drift), use\n       `UNKNOWN` with a `reason`, not `FAIL`.\n\n   - **Checklist Construction:**\n\n     - Construct the `triage_checklist` object evaluating all 13 negative\n       constraints. For each rule, set `outcome` to:\n       - `\"PASS\"`: if the finding satisfies the constraint (does not violate the\n         rule, meaning the bug remains potentially valid).\n       - `\"FAIL\"`: if the finding violates the rule. Setting ANY entry to\n         `\"FAIL\"` REQUIRES the finding's `status` to be `FALSE_POSITIVE`\n         (`schema.json` lines 418-470 reject `FAIL` on `VALID`\u002F\n         `PROVISIONALLY_VALID`\u002F`NEEDS_RESEARCH`). A `FAIL` entry also REQUIRES a\n         `reason` (`schema.json` lines 788-797).\n       - `\"UNKNOWN\"`: if the rule applicability is unresolved\u002Fneeds research\n         (REQUIRES a `reason`). Use this — not `\"FAIL\"` — whenever the finding\n         is not being marked `FALSE_POSITIVE`, including all rules on a drift\n         `NEEDS_RESEARCH` finding (Step 0c).\n       - `\"NOT_APPLICABLE\"`: if this rule is entirely irrelevant to this class\n         of bug (REQUIRES a `reason`).\n     - Consistency rule: if `status` is `VALID`, every entry must be `PASS` or\n       `NOT_APPLICABLE` (no `UNKNOWN`, no `FAIL`) per `schema.json` lines\n       471-507.\n\n4. **Construct Reproduction Script Hints:** For every finding marked as\n   **VALID** or **PROVISIONALLY_VALID**, provide high-signal `\"repro_hints\"`\n   explaining how a reproducer agent can trigger the bug, what inputs or payload\n   parameters are required, and what crash condition, sanitizer trace\n   (ASan\u002FUBSan\u002FMSan\u002FTSan), or functional validation result (e.g., an unexpected\n   HTTP 200 OK) is expected to confirm the security flaw.\n\n5. **Token-Optimized File Updates:** To minimize LLM output tokens, **do not\n   re-emit or manually rewrite the entire JSON object in your output.** Instead,\n   write a reusable helper script (e.g., `workspace\u002Fhelpers\u002Fappend_review.py`)\n   during your first finding update. For all subsequent findings, do not\n   regenerate the script; simply execute the existing helper script with the new\n   parameters to append the required fields.\n\n   **Helper version guard (mechanical):** the helper's FIRST line MUST be the\n   comment `# MANTIS_HELPER_VERSION = 2`. Before reusing an existing\n   `workspace\u002Fhelpers\u002Fappend_review.py`, check that first line (a one-line\n   grep): if the marker is ABSENT or a DIFFERENT integer, REGENERATE the helper\n   (an old persisted helper would silently omit the `snapshot` provenance field\n   and mishandle the drift path). The regenerated helper MUST:\n\n   - accept parameters for `status`, `reasoning`, optional `repro_hints`,\n     `triage_checklist` (JSON), `pass_number`, `timestamp`, and `snapshot`\n     (write it under key `\"snapshot\"`, never `\"snapshot_id\"`);\n   - write the reviewer `history` entry INCLUDING `\"snapshot\"` (the current\n     `SNAPSHOT_ID`; omit or write `\"\"` only in SNAPSHOT MODE OFF, where no\n     snapshot is in play);\n   - enforce the (pass_number, snapshot) idempotency check (Idempotency\n     Guarantee): do nothing if a matching reviewer entry already exists.\n\n   You must append the following to the existing object:\n\n   - A `\"status\"` field (one of `\"VALID\"`, `\"FALSE_POSITIVE\"`,\n     `\"PROVISIONALLY_VALID\"`, or `\"NEEDS_RESEARCH\"`).\n\n   - A `\"reasoning\"` field.\n\n   - A `\"repro_hints\"` field (optional for `\"NEEDS_RESEARCH\"` or\n     `\"FALSE_POSITIVE\"`).\n\n   - A `\"triage_checklist\"` object containing evaluations for all 13 negative\n     constraints (each key in the object maps to the constraint of the matching\n     name from Section 3 above):\n\n     ```json\n     {\n       \"ignore_hypothetical_misuse\": { \"outcome\": \"PASS\" },\n       \"ignore_missing_hygiene\": { \"outcome\": \"PASS\" },\n       \"require_strict_reproducibility\": { \"outcome\": \"FAIL\", \"reason\": \"Requires unstable 1-in-a-million race condition that cannot be automated.\" },\n       \"avoid_pedantic_linting\": { \"outcome\": \"PASS\" },\n       \"no_security_flaw_stretching\": { \"outcome\": \"PASS\" },\n       \"evaluate_questionable_file_paths\": { \"outcome\": \"PASS\" },\n       \"ignore_resource_exhaustion_dos\": { \"outcome\": \"PASS\" },\n       \"intrinsic_security_flaws\": { \"outcome\": \"PASS\" },\n       \"verify_mitigations_pragmatically\": { \"outcome\": \"PASS\" },\n       \"refine_code_paths_strictly\": { \"outcome\": \"PASS\" },\n       \"ignore_simd_vector_padding\": { \"outcome\": \"PASS\" },\n       \"ensure_source_code_coherence\": { \"outcome\": \"PASS\" },\n       \"verify_attacker_control_of_source\": { \"outcome\": \"PASS\" }\n     }\n     ```\n\n     For backward compatibility, the schema also permits `\"passes\": \u003Cbool>` as\n     an alternative to `\"outcome\"`, but `\"outcome\"` is preferred. The `reason`\n     must be provided if the outcome is `FAIL`, `UNKNOWN`, or `NOT_APPLICABLE`\n     (or if `passes` is `false`) to explain the evaluation; it should be omitted\n     for `PASS` \u002F `true` to save tokens.\n\n   - An entry to the `\"history\"` array (now carrying the snapshot the review was\n     performed against, for `(pass_number, snapshot)` idempotency):\n\n   ```json\n   {\n     \"stage\": \"reviewer\",\n     \"action\": \"reviewed\",\n     \"details\": \"Determined status as [VALID\u002FFALSE_POSITIVE\u002FPROVISIONALLY_VALID\u002FNEEDS_RESEARCH] because [reason]\",\n     \"pass_number\": \u003Ccurrent_pass_number>,\n     \"snapshot\": \"\u003CSNAPSHOT_ID>\",\n     \"timestamp\": \"\u003Ccurrent_iso8601_timestamp>\"\n   }\n   ```\n\n   In SNAPSHOT MODE OFF (no snapshot in play), set `\"snapshot\": \"\"` (or omit the\n   field). `schema.json`'s `history_entry` has no `additionalProperties:false`,\n   so this extra field validates unchanged.\n\nWhen complete, notify the user.\n","# Reviewer (\u002Fmantis-review)\n\n## System Goal\n\nIndependent Validator. Reviews consolidated findings against active source code\nto verify validity and filter out noise and false positives.\n\n## Command Definition\n\n- **Command:** `\u002Fmantis-review`\n- **Description:** Independently reviews findings and filters out false\n  positives.\n\n## Input\u002FOutput Contract\n\n- **Reads**:\n  - `workspace\u002Ffindings\u002F` (finding JSON files, including each finding's optional\n    `discovery_commit` provenance stamp).\n  - `workspace\u002F.mantis_state.json` (current loop `pass_number`; and, when\n    present, `active_snapshot` = `{root, snapshot_id, snapshot_pinned}` for\n    snapshot provenance).\n  - Invocation args when passed by the orchestrator: `--snapshot_root`,\n    `--snapshot_id`, `--state_root` (and, rarely, `--target_root`).\n  - Target source code files at the `code_paths` paths\u002Flines, read under the\n    resolved `CODE_ROOT` (the pinned snapshot root — see Instructions Step 0 \u002F\n    Block A), never the live tree when a snapshot is pinned.\n- **Writes**:\n  - Updates findings on disk in-place (sets `\"status\"`, `\"reasoning\"`,\n    `\"repro_hints\"`, `\"triage_checklist\"`, and appends history).\n  - Writes helper script `workspace\u002Fhelpers\u002Fappend_review.py`.\n- **Preconditions**:\n  - `workspace\u002Ffindings\u002F` exists with finding files.\n  - Target source code files exist.\n- **Idempotency Guarantee**:\n  - Modifies finding files in-place using the helper script `append_review.py`,\n    which MUST carry `# MANTIS_HELPER_VERSION = 2` as its first line; regenerate\n    the helper if that marker is absent or a different integer (see Instructions\n    step 5).\n  - Idempotency key is **(pass_number, snapshot)**. Before (re)writing a\n    finding, scan its `history` array:\n    - **SNAPSHOT MODE OFF** (neither `--snapshot_id` was passed NOR is\n      `active_snapshot` readable in state): SKIP the review update iff a\n      `\"stage\": \"reviewer\"` entry already exists for the current `pass_number`\n      (byte-for-byte today's behavior).\n    - **SNAPSHOT MODE ON**: SKIP the review update iff a `\"stage\": \"reviewer\"`\n      entry exists whose `pass_number` equals the current pass AND whose\n      `snapshot` equals `SNAPSHOT_ID`. A reviewer entry that lacks `snapshot`\n      (legacy) or carries a different `snapshot` counts as UNKNOWN → RE-REVIEW\n      (do NOT skip), so a finding reviewed under the old skill is re-grounded\n      against the current pinned snapshot.\n\n## Instructions\n\nRead and evaluate the deduplicated findings against the actual source code of\nthe repository. **Assume every finding is a false positive by default. Your job\nis to disprove the finding using an adversarial stance. Evaluate the claim based\nONLY on the code and the raw claim itself. Explicitly ignore the original\nfinder's prose reasoning and justification, as they may be hallucinated.**\n\nExecute your validation as follows:\n\n**Step 0 — Locator Resolution & Snapshot Provenance Gate (do this FIRST, before\nreading any finding's code):**\n\n0a. **Resolve where to read code.** **Block A — Locator Resolution** here:\n\n```\nLOCATOR RESOLUTION (before reading ANY target code or artifact):\n0. ROLE: If this skill NEVER reads target source (report, calibrate, reflect),\n   you are a FINDINGS-ONLY stage: skip steps 2-6; still read active_snapshot from\n   state for provenance\u002Fannotation; NEVER stop merely because a code root is unset.\n1. Determine CODE_ROOT, in this priority order:\n   a. If --target_root is passed on THIS invocation, CODE_ROOT = --target_root.\n      It is AUTHORITATIVE and OVERRIDES SNAPSHOT_ROOT and the state fallback\n      (used when a caller hands you a prepared tree, e.g. a patched shadow).\n   b. Else if --snapshot_root (or SNAPSHOT_ROOT) is passed, use it.\n   c. Else read state_root\u002Fworkspace\u002F.mantis_state.json (state_root from\n      --state_root if passed, else .\u002Fworkspace\u002F... relative to the current dir)\n      -> active_snapshot.root \u002F .snapshot_id \u002F .snapshot_pinned.\n   d. Else (no arg AND no readable active_snapshot): CODE_ROOT = current directory,\n      treat snapshot_pinned = false (MODE-OFF). Do NOT stop.\n2. SENTINEL CHECK (only if snapshot_pinned is true AND you did NOT take path 1a):\n   verify CODE_ROOT\u002F.mantis_snapshot_id exists and equals SNAPSHOT_ID. If missing\n   or different -> STOP \"snapshot sentinel mismatch\". (A --target_root tree (1a) is\n   deliberately mutated and is sentinel-EXEMPT.)\n3. PATH FIELDS:\n   - SNAPSHOT-RELATIVE (read under CODE_ROOT): code_paths entries; plan target_files\n     that are file paths. Strip ONLY a trailing \":\u003Cdigits>\". A code_paths entry\n     containing \":\u002F\u002F\" is a URL\u002Fendpoint, NOT a file read. A code_paths entry that is\n     NOT of the form \u003Cexisting-path>:\u003Cinteger> is a non-source LOCATOR\n     (symbol\u002Foffset\u002Fendpoint): only check that the artifact\u002Fsymbol exists; skip ALL\n     line-range and line-existence logic.\n   - STATE-RELATIVE (read\u002Fwrite under state_root\u002Fworkspace, NEVER prefix CODE_ROOT):\n     kb_references, repro_file_path, reattack_file_path, helper scripts, report\n     files, and all state\u002Ffindings JSON.\n4. Never WRITE under CODE_ROOT when snapshot_pinned is true. Any command that\n   compiles, generates, or writes artifacts MUST run in a PRIVATE SHADOW copy\n   (mktemp -d from CODE_ROOT), never with cwd=CODE_ROOT. Read-only inspection may\n   cd into CODE_ROOT.\n5. VCS-METADATA CARVE-OUT: history-log extraction and any VCS diff\u002Fblame command\n   run in the LIVE repository root (which still has .git\u002F.hg\u002F.repo), NOT CODE_ROOT\n   (the snapshot copy strips VCS metadata). Do NOT stop merely because CODE_ROOT\n   lacks .git\u002F.hg\u002F.repo.\n6. Every shell command uses ABSOLUTE paths and sets its own working directory on\n   that call. Do NOT assume the working directory persists between calls.\n```\n\nThe reviewer READS target source, so it is NOT a findings-only stage: run all of\nBlock A steps 1-6. `CODE_ROOT` is the pinned snapshot root you will read every\n`code_paths` entry under. Per Block A step 3, a `code_paths` entry containing\n`:\u002F\u002F` is a URL (existence check only), and any entry not of the form\n`\u003Cexisting-path>:\u003Cinteger>` is a non-source locator (check the artifact\u002Fsymbol\nexists; skip all line-existence logic). Never STOP merely because `CODE_ROOT`\nlacks `.git`\u002F`.hg` (Block A step 5).\n\n> [!NOTE] **CURRENT-PASS CHECK (defensive; the binding guarantee is on the\n> harness per `mantis-pipeline-adapter` Scenario 2):** if `active_snapshot` is\n> present AND `active_snapshot.pass != state.pass_number`, treat the snapshot as\n> STALE for this pass — STOP \"stale active_snapshot: pass mismatch\" or degrade\n> as HALT (`snapshot_pinned` effectively false: no authoritative verdicts, Block\n> B NOT_MATCHED, reproduce `not_attempted`). This catches a custom harness that\n> preserved `active_snapshot` across the Stage 15 pass increment without\n> re-pinning. The reference meta-agent re-pins every pass, so this check never\n> fires there. Block B itself cannot detect this (it is `snapshot_id`-only, not\n> `pass`-aware).\n\n0b. **Determine SNAPSHOT MODE (once, before touching findings):** - SNAPSHOT\nMODE is **OFF** iff `--snapshot_id` was NOT passed on this invocation AND\n`workspace\u002F.mantis_state.json` has no readable `active_snapshot`. This is a\nlegacy \u002F non-sync run: do NOT run the Snapshot Provenance Gate below; review\nEVERY finding with steps 1-5 exactly as before. - Otherwise SNAPSHOT MODE is\n**ON**. From Block A you now hold `SNAPSHOT_ID` and `snapshot_pinned`. Apply the\nSnapshot Provenance Gate (0c) to every finding.\n\n0c. **Snapshot Provenance Gate (SNAPSHOT MODE ON only).** After Step 1 loads the\nfindings, apply the match check to EACH finding F via **Block B — Snapshot Match\nCheck**, applied to F:\n\n```\nSNAPSHOT MATCH CHECK for finding F (decides MATCHED vs NOT_MATCHED):\n1. If snapshot_pinned is false -> NOT_MATCHED. Stop.\n2. Read F.discovery_commit:\n   - missing OR empty OR the literal \"MIXED\" -> NOT_MATCHED.\n   - not exactly equal to SNAPSHOT_ID          -> NOT_MATCHED.\n   - exactly equal to SNAPSHOT_ID              -> MATCHED.\nThere is no other route to MATCHED; never fuzzy-compare. The global \"default the\nfield and proceed\" backward-compat rule does NOT apply to discovery_commit:\nabsent = NOT_MATCHED. (There is NO separate \"dirty\" gate: a dirty tree's\nSNAPSHOT_ID already embeds the working-tree content hash, so within-pass findings\nMATCH and cross-pass bare-commit findings do not.)\n```\n\nThen, using the idempotency rule (Input\u002FOutput Contract → Idempotency Guarantee)\nto avoid double-writes:\n\n- **MATCHED** → F is grounded in the current pinned snapshot. Proceed to steps\n  2-5 (the full 13-rule review) for F.\n- **NOT_MATCHED** (includes: `snapshot_pinned` false \u002F HALT \u002F live-endpoint\n  pass; `discovery_commit` missing, empty, or the literal `MIXED`; or\n  `discovery_commit != SNAPSHOT_ID`) → F was discovered against a different (or\n  absent\u002Funpinned) snapshot; its `code_paths` line numbers may no longer point\n  at the same code. **DO NOT run the 13 rules on F. DO NOT mark it\n  FALSE_POSITIVE.** Finalize F as a drift `NEEDS_RESEARCH` via the helper (step\n  5), writing EXACTLY:\n  - `\"status\": \"NEEDS_RESEARCH\"`\n  - `\"reasoning\"`:\n    `\"Snapshot drift: finding discovered against snapshot \u003CF.discovery_commit or 'unknown'>, which does not match the current pinned snapshot \u003CSNAPSHOT_ID>. Not re-validated this pass; routed to re-research.\"`\n  - omit `\"repro_hints\"` (and, if F carried stale `repro_hints` from a prior\n    pass, leave them — they are ignored downstream because status is not\n    VALID\u002FPROVISIONALLY_VALID).\n  - `\"triage_checklist\"`: all 13 constraints set to `UNKNOWN` (paste the object\n    below verbatim). This object is REQUIRED: appending a `reviewer` history\n    entry makes `triage_checklist` mandatory on a non-chain finding\n    (`schema.json` lines 365-398), and for a `NEEDS_RESEARCH` finding every\n    entry MUST avoid `FAIL`\u002F`passes:false` (`schema.json` lines 418-470).\n    Setting `ensure_source_code_coherence` and\n    `verify_attacker_control_of_source` to `UNKNOWN` (never `FAIL`) is the whole\n    point: a line\u002Fpath mismatch caused by DRIFT is NOT evidence of\n    hallucination, so Rules 12\u002F13 must NOT fire on it.\n  - append the `reviewer` `\"history\"` entry (with `\"snapshot\"`, per step 5 \u002F the\n    history JSON below). Then STOP processing F — skip steps 2-5 for it.\n\nDrift `triage_checklist` (paste verbatim; all 13 keys, all `UNKNOWN`):\n\n```json\n{\n  \"ignore_hypothetical_misuse\":        { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"ignore_missing_hygiene\":            { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"require_strict_reproducibility\":    { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"avoid_pedantic_linting\":            { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"no_security_flaw_stretching\":       { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"evaluate_questionable_file_paths\":  { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"ignore_resource_exhaustion_dos\":    { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"intrinsic_security_flaws\":          { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"verify_mitigations_pragmatically\":  { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"refine_code_paths_strictly\":        { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"ignore_simd_vector_padding\":        { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: not re-validated against the current pinned snapshot\" },\n  \"ensure_source_code_coherence\":      { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: line\u002Fpath mismatch may be caused by drift, not hallucination; not re-validated\" },\n  \"verify_attacker_control_of_source\": { \"outcome\": \"UNKNOWN\", \"reason\": \"snapshot drift: trust-boundary path not re-traced against the current pinned snapshot\" }\n}\n```\n\nFindings finalized as drift `NEEDS_RESEARCH` in Step 0c are DONE — do not\nprocess them again in steps 2-5. Only MATCHED findings (SNAPSHOT MODE ON) or all\nfindings (SNAPSHOT MODE OFF) flow into steps 2-5 below.\n\n1. **Load Clustered Findings:** Read the JSON files in the `workspace\u002Ffindings\u002F`\n   directory. If the directory is empty or missing, notify the user.\n\n2. **Source Code Inspection:** For each finding that reached this step (in\n   SNAPSHOT MODE ON, only findings that were **MATCHED** in Step 0c; findings\n   finalized there as drift `NEEDS_RESEARCH` are already done and are skipped),\n   read the file **under `CODE_ROOT`** (the pinned snapshot root resolved in\n   Step 0 \u002F Block A — resolve every `code_paths` path relative to `CODE_ROOT`,\n   never the live tree) to inspect the exact files and line numbers listed in\n   `code_paths` and confirm the finding is grounded in the actual snapshot\n   state. Do not make assumptions about the validity of a path without\n   inspecting the source code first.\n\n3. **Strict Validation Filtering (Apply the 13 Negative Constraints):** Evaluate\n   each finding against these strict criteria. Mark a finding as\n   **FALSE_POSITIVE** if it violates any of the following rules:\n\n   01. **Ignore Hypothetical Misuse:** Do not flag security flaws that rely on a\n       calling API hypothetically misusing a function, writing bad fallback\n       logic, or sending invalid parameters if the function itself behaves\n       safely.\n   02. **Ignore Missing Hygiene \u002F Defense-In-Depth:** Do not report missing HTTP\n       security headers (e.g., `X-Content-Type-Options`), missing authentication\n       on local-only test functions, or hardcoded mock databases as security\n       flaws.\n   03. **Require Strict Reproducibility:** Only mark a finding as VALID if a\n       direct, unambiguous, and triggerable flaw exists within the boundaries of\n       the code logic. If the finding is extremely fragile (e.g., relies on\n       unstable timing that cannot be automated or brute-forced, or requires\n       unrealistic environmental conditions to trigger), mark it as\n       FALSE_POSITIVE. *Note on Race Conditions:* Do NOT dismiss race conditions\n       or timing bugs simply because they have a low success probability (e.g.,\n       1 in a million), provided the attack path can be automated and repeatedly\n       attempted by an attacker to eventually trigger the exploit.\n   04. **Avoid Pedantic Linting:** If the code uses standard safe libraries\n       (such as `json.loads`, parameterised SQL queries, or secure standard\n       library hashes) but lacks extreme paranoia, mark it as FALSE_POSITIVE.\n   05. **No Security Flaw Stretching on Mitigations:** If you are reviewing a\n       mitigation or a safe variant of a function that successfully blocks the\n       original security flaw class, do NOT invent complex protocol-level\n       bypasses or adjacent security flaw classes (e.g., SSRF when reviewing\n       Command Injection fixes). If the primary security flaw is successfully\n       blocked, mark it as FALSE_POSITIVE.\n   06. **Evaluate Questionable File Paths:** Do NOT instantly dismiss a finding\n       simply because its path contains `\u002Ftest`, `\u002Fexperimental`, or `\u002Fmock`.\n       Code in these paths is sometimes compiled into production targets or\n       reachable via production endpoints. Do not blindly assume it is safe;\n       instead, take reasonable measures to trace its usage to confirm whether\n       it is actually exposed in production.\n   07. **Ignore Resource Exhaustion DoS:** Do not flag functions for lacking\n       recursion limits, input size boundaries, or cycle constraints unless the\n       primary stated purpose of the module is to defend against DoS attacks.\n   08. **Intrinsic Security Flaws:** If a function uses a fundamentally broken\n       algorithm (such as MD5, SHA1), hardcodes static secrets, or contains\n       direct injection paths in its own logic, mark it as VALID even if it is\n       not currently called anywhere in the codebase.\n   09. **Verify Mitigations Pragmatically:** Do not hallucinate flaws in active\n       mitigations. If the code adds trailing validation slashes or configures\n       safe parsing flags, accept that the mitigation works.\n   10. **Refine `code_paths` Strictly:** The `code_paths` field should only\n       include the exact `filename:line_number` of the flawed code block. Strip\n       out any helper files, test harnesses, or correct caller files from\n       `code_paths`.\n   11. **Ignore SIMD\u002FVector Padding Violations:** If a finding represents an\n       out-of-bounds read or write inside optimized vector routines (e.g., NEON,\n       SSE, AVX, VSX), verify if the library employs a global memory allocation\n       contract (such as trailing safety padding, like `row_bytes + 16`). If the\n       out-of-bounds access is mathematically guaranteed to reside entirely\n       within this pre-allocated padding buffer under all execution paths, mark\n       the finding as a FALSE_POSITIVE (By Design).\n   12. **Ensure Source Code Coherence (Anti-Hallucination):** Verify that every\n       file path listed in `code_paths` exists in the repository, and that\n       function names, variable names, or line numbers actually exist at those\n       locations. If references are missing or incorrect, immediately mark the\n       finding as a FALSE_POSITIVE to prevent downstream agents from wasting\n       resources on hallucinated bugs.\n   13. **Verify Attacker Control of the Source (Trust-Boundary Tracing):**\n       Before marking a data-flow finding VALID, identify and cite the file:line\n       where untrusted data enters the analyzed codebase (the \"Ingress Point\")\n       from which the specific tainted field's value flows to the sink, OR where\n       that field is populated by an untrusted writer.\n       - If you have access to the untrusted-side code (e.g. Guest\u002FClient in a\n         multi-component repo), cite the writer.\n       - If you only have access to the trusted-side code, cite the Host\u002FServer\n         ingress point on the data-flow path (e.g., reads from shared memory,\n         IPC handlers, HTTP request parameter retrieval).\n       - If the source data is proven to originate solely from trusted-side\n         origins (server-authored static config, host-plane internal state),\n         mark FALSE_POSITIVE.\n       - Exception: Do not apply this rule to Intrinsic Security Flaws (Rule 08)\n         where the vulnerability exists in library code independent of active\n         callers.\n\n   - **Status Resolution:**\n\n     - Mark as **FALSE_POSITIVE** if it violates any of the 13 rules above.\n     - Mark as **VALID** if it passes all rules and has a clear, triggerable\n       flaw.\n     - Mark as **PROVISIONALLY_VALID** if it passes the rules, but you are\n       uncertain of its feasibility without dynamic verification (e.g. requires\n       complex heap grooming or precise timing).\n     - Mark as **NEEDS_RESEARCH** if the review is inconclusive due to high\n       complexity, unresolved external APIs, or massive call graphs — OR because\n       the finding was **NOT_MATCHED** by the Step 0c Snapshot Provenance Gate\n       (snapshot drift). Drift findings are finalized in Step 0c and never reach\n       these 13 rules; do NOT re-classify a drift finding as `FALSE_POSITIVE`.\n     - **SCHEMA-CRITICAL:** `FALSE_POSITIVE` is the ONLY status for which a\n       `triage_checklist` entry may be `\"FAIL\"` (or `\"passes\": false`). For any\n       `VALID`, `PROVISIONALLY_VALID`, or `NEEDS_RESEARCH` finding, EVERY\n       checklist entry must be `PASS` \u002F `NOT_APPLICABLE` \u002F `UNKNOWN` — never\n       `FAIL` — or `schema.json` (lines 418-470) will reject the finding. If a\n       rule looks failed but you are NOT setting status to `FALSE_POSITIVE`\n       (e.g. Rule 12\u002F13 references look off only because of snapshot drift), use\n       `UNKNOWN` with a `reason`, not `FAIL`.\n\n   - **Checklist Construction:**\n\n     - Construct the `triage_checklist` object evaluating all 13 negative\n       constraints. For each rule, set `outcome` to:\n       - `\"PASS\"`: if the finding satisfies the constraint (does not violate the\n         rule, meaning the bug remains potentially valid).\n       - `\"FAIL\"`: if the finding violates the rule. Setting ANY entry to\n         `\"FAIL\"` REQUIRES the finding's `status` to be `FALSE_POSITIVE`\n         (`schema.json` lines 418-470 reject `FAIL` on `VALID`\u002F\n         `PROVISIONALLY_VALID`\u002F`NEEDS_RESEARCH`). A `FAIL` entry also REQUIRES a\n         `reason` (`schema.json` lines 788-797).\n       - `\"UNKNOWN\"`: if the rule applicability is unresolved\u002Fneeds research\n         (REQUIRES a `reason`). Use this — not `\"FAIL\"` — whenever the finding\n         is not being marked `FALSE_POSITIVE`, including all rules on a drift\n         `NEEDS_RESEARCH` finding (Step 0c).\n       - `\"NOT_APPLICABLE\"`: if this rule is entirely irrelevant to this class\n         of bug (REQUIRES a `reason`).\n     - Consistency rule: if `status` is `VALID`, every entry must be `PASS` or\n       `NOT_APPLICABLE` (no `UNKNOWN`, no `FAIL`) per `schema.json` lines\n       471-507.\n\n4. **Construct Reproduction Script Hints:** For every finding marked as\n   **VALID** or **PROVISIONALLY_VALID**, provide high-signal `\"repro_hints\"`\n   explaining how a reproducer agent can trigger the bug, what inputs or payload\n   parameters are required, and what crash condition, sanitizer trace\n   (ASan\u002FUBSan\u002FMSan\u002FTSan), or functional validation result (e.g., an unexpected\n   HTTP 200 OK) is expected to confirm the security flaw.\n\n5. **Token-Optimized File Updates:** To minimize LLM output tokens, **do not\n   re-emit or manually rewrite the entire JSON object in your output.** Instead,\n   write a reusable helper script (e.g., `workspace\u002Fhelpers\u002Fappend_review.py`)\n   during your first finding update. For all subsequent findings, do not\n   regenerate the script; simply execute the existing helper script with the new\n   parameters to append the required fields.\n\n   **Helper version guard (mechanical):** the helper's FIRST line MUST be the\n   comment `# MANTIS_HELPER_VERSION = 2`. Before reusing an existing\n   `workspace\u002Fhelpers\u002Fappend_review.py`, check that first line (a one-line\n   grep): if the marker is ABSENT or a DIFFERENT integer, REGENERATE the helper\n   (an old persisted helper would silently omit the `snapshot` provenance field\n   and mishandle the drift path). The regenerated helper MUST:\n\n   - accept parameters for `status`, `reasoning`, optional `repro_hints`,\n     `triage_checklist` (JSON), `pass_number`, `timestamp`, and `snapshot`\n     (write it under key `\"snapshot\"`, never `\"snapshot_id\"`);\n   - write the reviewer `history` entry INCLUDING `\"snapshot\"` (the current\n     `SNAPSHOT_ID`; omit or write `\"\"` only in SNAPSHOT MODE OFF, where no\n     snapshot is in play);\n   - enforce the (pass_number, snapshot) idempotency check (Idempotency\n     Guarantee): do nothing if a matching reviewer entry already exists.\n\n   You must append the following to the existing object:\n\n   - A `\"status\"` field (one of `\"VALID\"`, `\"FALSE_POSITIVE\"`,\n     `\"PROVISIONALLY_VALID\"`, or `\"NEEDS_RESEARCH\"`).\n\n   - A `\"reasoning\"` field.\n\n   - A `\"repro_hints\"` field (optional for `\"NEEDS_RESEARCH\"` or\n     `\"FALSE_POSITIVE\"`).\n\n   - A `\"triage_checklist\"` object containing evaluations for all 13 negative\n     constraints (each key in the object maps to the constraint of the matching\n     name from Section 3 above):\n\n     ```json\n     {\n       \"ignore_hypothetical_misuse\": { \"outcome\": \"PASS\" },\n       \"ignore_missing_hygiene\": { \"outcome\": \"PASS\" },\n       \"require_strict_reproducibility\": { \"outcome\": \"FAIL\", \"reason\": \"Requires unstable 1-in-a-million race condition that cannot be automated.\" },\n       \"avoid_pedantic_linting\": { \"outcome\": \"PASS\" },\n       \"no_security_flaw_stretching\": { \"outcome\": \"PASS\" },\n       \"evaluate_questionable_file_paths\": { \"outcome\": \"PASS\" },\n       \"ignore_resource_exhaustion_dos\": { \"outcome\": \"PASS\" },\n       \"intrinsic_security_flaws\": { \"outcome\": \"PASS\" },\n       \"verify_mitigations_pragmatically\": { \"outcome\": \"PASS\" },\n       \"refine_code_paths_strictly\": { \"outcome\": \"PASS\" },\n       \"ignore_simd_vector_padding\": { \"outcome\": \"PASS\" },\n       \"ensure_source_code_coherence\": { \"outcome\": \"PASS\" },\n       \"verify_attacker_control_of_source\": { \"outcome\": \"PASS\" }\n     }\n     ```\n\n     For backward compatibility, the schema also permits `\"passes\": \u003Cbool>` as\n     an alternative to `\"outcome\"`, but `\"outcome\"` is preferred. The `reason`\n     must be provided if the outcome is `FAIL`, `UNKNOWN`, or `NOT_APPLICABLE`\n     (or if `passes` is `false`) to explain the evaluation; it should be omitted\n     for `PASS` \u002F `true` to save tokens.\n\n   - An entry to the `\"history\"` array (now carrying the snapshot the review was\n     performed against, for `(pass_number, snapshot)` idempotency):\n\n   ```json\n   {\n     \"stage\": \"reviewer\",\n     \"action\": \"reviewed\",\n     \"details\": \"Determined status as [VALID\u002FFALSE_POSITIVE\u002FPROVISIONALLY_VALID\u002FNEEDS_RESEARCH] because [reason]\",\n     \"pass_number\": \u003Ccurrent_pass_number>,\n     \"snapshot\": \"\u003CSNAPSHOT_ID>\",\n     \"timestamp\": \"\u003Ccurrent_iso8601_timestamp>\"\n   }\n   ```\n\n   In SNAPSHOT MODE OFF (no snapshot in play), set `\"snapshot\": \"\"` (or omit the\n   field). `schema.json`'s `history_entry` has no `additionalProperties:false`,\n   so this extra field validates unchanged.\n\nWhen complete, notify the user.\n",{"name":5,"description":7},"main","f3162c039ecd9c9d5d8bc404dd1373c7ca3152f7","skills\u002Fmantis-review",237,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fmantis","https:\u002F\u002Fcloud.google.com\u002F","https:\u002F\u002Fgithub.com\u002Fgoogle","https:\u002F\u002Fopensource.google\u002F","Google ❤️ Open Source","2026-11-15 00:33:31",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add google\u002Fmantis --skill mantis-review",{"tool":53,"command":54},"bunx","bunx skills add google\u002Fmantis --skill mantis-review",{"tool":56,"command":57},"pnpm","pnpm dlx skills add google\u002Fmantis --skill mantis-review","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fmantis\u002Fblob\u002Fmain\u002Fskills\u002Fmantis-review\u002FSKILL.md",true,[],[62,86,111,138,153,168],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":32},"01M6992XJHHV0R5N8E392EHRW3","mantis-threat-model","Synthesizes trust boundaries, attack surfaces, and attacker profiles into a living threat model. Use as Stage B of the Knowledge Base generation process, reading architecture and entity definitions from the KB. Don't use for analyzing source code or extracting raw learnings from JSONL files.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fmantis\u002Fblob\u002Fmain\u002Fskills\u002Fmantis-threat-model\u002FSKILL.md",[],[69,70,71,72,73,21,74,75,76,77,78,79,80,81,82,83,84,85,29,30],"mantis threat model","threat model","model","threat","architecture","analyzing","knowledge","kb","files","surfaces","trust","learnings","knowledge base","as","extracting","reading","jsonl",{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":97,"publishedAt":32},"01M6992TR1BPA5HVF13QRM7EP0","mantis-summarize","Pre-processes the repository by generating security-focused summaries (mantis-summary.md) for each directory to make planning and research more efficient. Use when starting a review campaign to map the codebase before threat modeling and planning. Don't use for executing code reviews, writing test scripts, or patching code.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fmantis\u002Fblob\u002Fmain\u002Fskills\u002Fmantis-summarize\u002FSKILL.md",[92],{"categoryNo":93,"categoryName":94,"taxonomyType":95,"taxonomyTypeDesc":96},"01JBSEEDCAT000000000000021","资料检索与研究","SCENARIO","使用场景",[98,99,100,101,19,102,103,21,104,105,23,72,106,107,108,109,110,27,28,31],"summarize","mantis summarize","writing","directory","security","threat modeling","planning","repository","campaign","map","modeling","scripts","make",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":122,"publishedAt":32},"01M6992QB4DVMDR2AGT6BPSE3N","mantis-structural-index","Builds a content-addressed semantic-unit index from source code for structural context. Use when a pinned or live codebase is available and structural cross-reference data would improve research quality. Don't use for findings analysis, patching, or reporting.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fmantis\u002Fblob\u002Fmain\u002Fskills\u002Fmantis-structural-index\u002FSKILL.md",[117],{"categoryNo":118,"categoryName":119,"taxonomyType":120,"taxonomyTypeDesc":121},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[123,124,125,126,21,127,128,129,130,23,131,132,133,24,134,135,136,137,28,31],"mantis structural index","index","structural","research","content","reporting","data","analysis","improve","quality","context","research quality","reference","live","unit",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":32},"01M6992GKVGJ2NXEJWYFVCN01Q","mantis-researcher","Audits production source code files based on the strategy in workspace\u002Fplan.json. Use when a review plan exists and you need to perform static analysis and deep-dive reviews of targeted files. Don't use for planning, deduplicating, or writing patches.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fmantis\u002Fblob\u002Fmain\u002Fskills\u002Fmantis-researcher\u002FSKILL.md",[],[145,146,100,19,147,21,104,130,148,149,24,77,150,151,27,28,29,152,30,31],"mantis researcher","researcher","static analysis","plan","strategy","deep","you","static",{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":32},"01M6992D5WXENF3TW68GM5WPHC","mantis-reproduce","Generates and runs crash reproducers to verify security flaws. Use when viable findings exist and you need to write and execute a script or payload to verify the crash. Don't use for code auditing or patching.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fmantis\u002Fblob\u002Fmain\u002Fskills\u002Fmantis-reproduce\u002FSKILL.md",[],[160,161,102,21,23,162,163,164,24,165,166,167,151,28,31],"mantis reproduce","reproduce","verify","write","execute","crash","payload","script",{"skillNo":169,"name":170,"nameZh":6,"description":171,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":172,"categories":173,"keywords":177,"publishedAt":32},"01M69929WWZT1MCG427PSHY7ZA","mantis-report","Generates a human-readable security review packet compiled from confirmed findings and exploit chains. Use at the end of a review cycle to produce stakeholder-facing documentation. Don't use for auditing code or verifying patches directly.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fmantis\u002Fblob\u002Fmain\u002Fskills\u002Fmantis-report\u002FSKILL.md",[174],{"categoryNo":175,"categoryName":176,"taxonomyType":120,"taxonomyTypeDesc":121},"01JBSEEDCAT000000000000034","行政与办公人员",[178,179,19,102,180,181,21,182,24,183,184,185,186,187,188,28,189],"mantis report","report","security review","documentation","produce","exploit","cycle","review cycle","human","end","at","review packet"]