[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6991H78NDS64PZ1CGDQ4SQT":3,"skill-same:01M6991H78NDS64PZ1CGDQ4SQT":62},{"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":33,"linkOnly":34,"markdownContent":35,"markdownBody":36,"frontMatter":37,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":43,"ownerHtmlUrl":44,"ownerBlogUrl":45,"ownerDescription":46,"updatedAt":47,"install":48,"resources":61},"01M6991H78NDS64PZ1CGDQ4SQT","mantis-dedupe",null,"Consolidates raw security findings to eliminate redundant reports. Use when raw findings have been generated by the researcher and need consolidation before review. Don't use for initial code auditing or patch generation.","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-dedupe\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32],"mantis dedupe","review","security","code","researcher","generated","use","patch","reports","generation","consolidation","for","patch generation","when","2026-11-10 10:12:30",false,"---\nname: mantis-dedupe\ndescription: >-\n  Consolidates raw security findings to eliminate redundant reports.\n  Use when raw findings have been generated by the researcher and need consolidation before review.\n  Don't use for initial code auditing or patch generation.\n---\n\n# Deduplicator (\u002Fmantis-dedupe)\n\n## System Goal\n\nDuplicate Finding Merger. Evaluates lists of raw findings to cluster and\nconsolidate identical or highly overlapping issues into singular, descriptive\nrecords.\n\n## Command Definition\n\n- **Command:** `\u002Fmantis-dedupe`\n- **Description:** Consolidates raw security findings to eliminate redundant\n  reports.\n- **Arguments (optional; supplied by the orchestrator, consumed by Block A):**\n  `--snapshot_root`\u002F`--snapshot_id`\u002F`--state_root`. All absent ->\n  MODE-OFF\u002Flegacy mode (behaves as today; snapshot gating disabled).\n\n## Input\u002FOutput Contract\n\n- **Reads**:\n  - `workspace\u002Ffindings\u002F` (raw finding JSON files, ignoring `.trash\u002F`).\n  - `workspace\u002Farchive\u002Ffindings_pass_*\u002F*.json` and\n    `workspace\u002Farchive\u002Floop*_findings\u002F*.json` (to skip findings already\n    evaluated and triaged in previous passes).\n  - `workspace\u002F.mantis_state.json` (to track current loop pass).\n- **Writes**:\n  - Moves duplicate findings to `workspace\u002Ffindings\u002F.trash\u002F` after setting\n    `\"status\": \"DUPLICATE\"` and `\"duplicate_of\"`.\n  - Sets `\"possible_duplicate_of\"` (soft, non-terminal) on NOT_MATCHED matches\n    and stamps `\"discovery_commit\"` on current findings that lack it. Reads\n    `active_snapshot`\u002F`snapshot_pinned` from `.mantis_state.json`.\n  - Appends transaction logs to `workspace\u002F.tx_log.jsonl`.\n  - Generates\u002Fexecutes merging script `workspace\u002Fhelpers\u002Fmerge_findings.py`.\n  - Updates primary finding `workspace\u002Ffindings\u002F\u003Cprimary_id>.json` (merges\n    fields and history).\n- **Preconditions**:\n  - `workspace\u002Ffindings\u002F` must exist and contain finding files.\n- **Idempotency Guarantee**:\n  - Cross-references against archived findings in `workspace\u002Farchive\u002F` to filter\n    out any findings already processed in previous passes of this run.\n    Snapshot-gated: a resolved archived finding on a differing snapshot is\n    flagged as POSSIBLE REGRESSION (never silently filtered). Logs transactions\n    to `workspace\u002F.tx_log.jsonl` to support tracking and potential rollbacks.\n    Deterministic merging rules implemented in `merge_findings.py`.\n\n## Instructions\n\n### Step 0: Locator Resolution (run first)\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\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\nNotes: `workspace\u002Ffindings\u002F`, `workspace\u002Farchive\u002F`, `workspace\u002F.tx_log.jsonl`,\n`workspace\u002Fhelpers\u002F` and `.mantis_state.json` are STATE-RELATIVE (under\n--state_root). Any code snippet you inspect for a finding is SNAPSHOT-RELATIVE\n(under CODE_ROOT). Never write under CODE_ROOT.\n\nReview a list of security findings and merge duplicate findings that refer to\nthe exact same security flaw or adjacent code paths.\n\nExecute your task as follows:\n\n1. **Load Raw Findings & Archived Findings Queue:**\n\n   - List the contents of the directory and read the files in\n     `workspace\u002Ffindings\u002F`. If the directory is empty or does not exist, notify\n     the user and exit.\n   - *Important:* Ignore hidden files and directories (such as the `.trash\u002F`\n     subdirectory) when listing or processing findings.\n   - Locate and load all archived finding JSON files from previous loop passes,\n     if they exist, under `workspace\u002Farchive\u002Ffindings_pass_*\u002F*.json` and\n     `workspace\u002Farchive\u002Floop*_findings\u002F*.json`. These files represent\n     vulnerabilities that have already been fully evaluated, triaged, and\n     potentially patched in previous passes.\n   - *Important:* Do NOT read or deduplicate against\n     `workspace\u002Fhistorical_learnings.jsonl` (VCS history), as we want to catch\n     regressions if old bugs were reintroduced.\n\n2. **Filter Loop Duplicates (snapshot-gated).** First, stamp `discovery_commit`\n   on any CURRENT finding that lacks it, using `active_snapshot.snapshot_id`\n   from `.mantis_state.json` (skip when unpinned). Then, for each current\n   finding that matches an archived finding (by `code_paths`+`title`\n   similarity), run:\n\n   **Signature-based candidate matching (Phase 3) — TIGHTENS, never replaces:**\n   `signature` may only PROMOTE a pair to \"candidate for the pairwise snapshot\n   check\"; it may NEVER by itself cause a hard DUPLICATE\u002Ftrash. A pair is a\n   candidate for the Pairwise Snapshot Match Check below ONLY if it satisfies\n   BOTH:\n\n   - it matches under today's `code_paths` + `title` similarity, comparing\n     `code_paths` entries line-inclusively (WITH their trailing `:line`); AND\n   - (when both findings have a `signature`) their `signature` fields are equal.\n     A `signature` match WITHOUT the `code_paths` + `title` agreement is NOT a\n     duplicate — at most a soft `possible_duplicate_of` (keep the finding\n     ACTIVE), never a trash. Rationale: `signature` strips the line number and\n     all-but-first `code_paths` entry, so two DISTINCT bugs in the same file\n     (e.g. `parser.c:100` vs `parser.c:900`) with the same title+CWE share one\n     `signature`; trashing on signature alone would silently delete a real\n     finding. If EITHER lacks `signature`, use today's `code_paths` + `title`\n     similarity matching unchanged.\n\n   PAIRWISE SNAPSHOT MATCH CHECK (decides MATCHED vs NOT_MATCHED) — compares the\n   CURRENT finding's `discovery_commit` against the ARCHIVED finding's\n   `discovery_commit` for this pair (NOT against `SNAPSHOT_ID`):\n\n   1. If `snapshot_pinned` is false AND there is NO `active_snapshot` in state\n      (MODE-OFF) -> NOT_MATCHED. Stop. (In HALT — `active_snapshot` present but\n      `snapshot_pinned=false` — do NOT short-circuit here; fall through to the\n      pairwise comparison below, which will be NOT_MATCHED because the current\n      finding's `discovery_commit` is a `live:` id that will not equal the\n      archived one.)\n   2. Read the CURRENT finding's `discovery_commit` and the ARCHIVED finding's\n      `discovery_commit`:\n      - If EITHER is missing, empty, or the literal `\"MIXED\"` -> NOT_MATCHED.\n      - If they are NOT byte-for-byte equal to each other -> NOT_MATCHED.\n      - If they ARE byte-for-byte equal to each other (both present, non-MIXED)\n        -> MATCHED. There is no other route to MATCHED; never fuzzy-compare. The\n        global \"default the field and proceed\" backward-compat rule does NOT\n        apply to `discovery_commit`: absent = NOT_MATCHED. (There is NO separate\n        \"dirty\" gate: a dirty tree's SNAPSHOT_ID already embeds the working-tree\n        content hash, so within-pass findings MATCH and cross-pass bare-commit\n        findings do not.) Note: this is a PAIRWISE check (current vs archived),\n        NOT a check against the global `SNAPSHOT_ID` — dedupe stamps the current\n        finding's `discovery_commit` to `SNAPSHOT_ID` in Step 2 above, so a\n        check against `SNAPSHOT_ID` would always be MATCHED and would trash\n        reintroduced\u002Fregression bugs as DUPLICATE.\n\n   Then, using the idempotency rule (Input\u002FOutput Contract → Idempotency\n   Guarantee) to avoid double-writes, decide mechanically:\n\n   - **MATCHED** (both present and equal): soft-delete the current finding as a\n     loop-duplicate exactly as before — set `\"status\": \"DUPLICATE\"` and\n     `\"duplicate_of\": \"\u003Carchived_uuid>\"`, clear `possible_duplicate_of` if\n     present, ensure `mkdir -p workspace\u002Ffindings\u002F.trash\u002F`, move it there, and\n     log a `loop_filter` transaction in `workspace\u002F.tx_log.jsonl`. If the\n     current finding lacks `lineage_id` but the archived finding has one,\n     inherit the archived finding's `lineage_id` onto the current finding before\n     moving it (so the lineage chain is preserved across the merge).\n   - **NOT_MATCHED** (differ, or either absent): do NOT set `DUPLICATE` and do\n     NOT move to trash. Keep the current finding ACTIVE and set\n     `\"possible_duplicate_of\": \"\u003Carchived_uuid>\"` (a soft, non-terminal hint).\n     If the current finding lacks `lineage_id` but the archived finding has one,\n     inherit the archived finding's `lineage_id` onto the current finding (so\n     the lineage chain is preserved for report folding even when the findings\n     are on different snapshots).\n\n   > [!IMPORTANT] **STATUS & DUPLICATE INVARIANTS:**\n   >\n   > - A finding MUST NOT carry both `duplicate_of` and `possible_duplicate_of`\n   >   pointing to the same target UUID.\n   > - `status = \"DUPLICATE\"` MUST NOT coexist with `possible_duplicate_of`\n   >   pointing to the same target UUID.\n   > - Under **NOT_MATCHED** (outside the MODE-OFF fallback exception), the\n   >   finding's `status` MUST remain active (e.g. `VALID`,\n   >   `PROVISIONALLY_VALID`, `NEEDS_RESEARCH`), `duplicate_of` MUST NOT be set,\n   >   and the finding MUST NOT be moved to `.trash\u002F`. Setting\n   >   `possible_duplicate_of` is a non-terminal hint only.\n\n   - **POSSIBLE REGRESSION:** if the archived match has a RESOLVED status\n     (`patch_status` in {`VERIFIED_SECURE`,`MITIGATION_PROPOSED`} OR\n     `status`==`FALSE_POSITIVE` OR `production_viability`==`NON_VIABLE`) AND the\n     pair is NOT MATCHED, keep the current finding ACTIVE, add a history note\n     \"POSSIBLE REGRESSION vs \\\u003Carchived_uuid>\", and do NOT filter it. (A\n     reverted fix re-discovered on new code must never be trashed.)\n   - **EXACT-UUID retry exception (unchanged):** if the current finding has the\n     EXACT SAME UUID as the archived one, it was intentionally copied back for a\n     retry — do NOT filter it (keep as-is).\n   - **Permanently-unpinned exception (MODE-OFF only — no `active_snapshot`):**\n     if there is NO `active_snapshot` in state (MODE-OFF = today's default; a\n     target with no snapshot boundary, e.g. a live endpoint), `snapshot_pinned`\n     is false at the PASS level (`active_snapshot.snapshot_pinned` — it is NOT a\n     per-finding field) and Block B is uninformative — fall back to today's\n     dedup by `signature` if present, else `stable_key` = normalized_title +\n     first `code_paths` entry **including its trailing `:line`**\n     (line-inclusive, same as Step 2). Rationale: stripping `:line` would\n     collapse two DISTINCT bugs in the same file (e.g. `parser.c:100` vs\n     `parser.c:900`) with the same title+CWE into one — silently deleting a real\n     finding. Note: `signature` itself strips `:line` by design (it is a coarse\n     identity for cross-pass lineage, not a dedup key); this fallback therefore\n     prefers `signature` only when `stable_key`'s line-inclusive match ALSO\n     agrees, never on `signature` alone. This preserves dedup for targets that\n     can never MATCH. When `active_snapshot` IS present but unpinned (HALT\n     mode), this exception does NOT fire: keep the snapshot-gated behavior above\n     (NOT_MATCHED → keep ACTIVE + `possible_duplicate_of`, never `DUPLICATE`).\n     **POSSIBLE REGRESSION takes precedence over this fallback:** a\n     resolved-archived finding paired with a NOT_MATCHED current finding is\n     ALWAYS kept active (never trashed), regardless of mode.\n\n3. **3-Tier Deduplication Ladder (Deterministic & Semantic Matching):** When\n   resolving finding lineages and evaluating deduplication candidates, the\n   deduplicator uses a hierarchical 3-tier ladder designed for sub-millisecond\n   fast-path execution with semantic RAG fallback:\n\n   - **Tier 1 (Fast-Path Exact Heuristic Anchors — \u003C 1ms, 0 tokens):**\n\n     1. Exact content identity signature match:\n        `hashlib.sha256(canonical_fp | canonical_cwe | target_symbol)`\n        (invariant to line shifts, backticks, and title paraphrasing).\n     2. Exact `canonical_filepath + normalized CWE + target_symbol` match.\n     3. Strict line proximity window ($\\\\le 3$ lines) on exact canonical\n        filepath when target symbol is empty.\n\n     - *Result*: If matched, immediately inherit ancestor `lineage_id` without\n       LLM or embedding overhead.\n\n   - **Tier 2 (RCA Normalization):** If Tier 1 heuristic matching does not\n     produce an exact anchor, synthesize a standardized 5-line Root Cause\n     Analysis (RCA) summary:\n\n     - `Component`: Normalized canonical filepath and symbol.\n     - `Vulnerability Class`: Canonical CWE taxonomy identifier and name.\n     - `Root Cause Mechanism`: Underlying programming or logic defect.\n     - `Failure Condition`: Specific input, state, or boundary condition.\n     - `Taint Dataflow`: Source-to-sink dataflow trajectory.\n\n   - **Tier 3 (Vector Embedding & Cosine Similarity Scan):**\n\n     - Project the standardized RCA summary into dense vector embeddings using\n       the configured multi-provider embedding engine (default:\n       `vertex_ai\u002Fgemini-embedding-001`).\n     - Perform nearest-neighbor scan over historical `lineage_vectors` in the\n       database using bounded cosine similarity.\n     - **CWE Family & Class Structural Guard:** When comparing query finding\n       vectors against candidate lineage records, if both findings have explicit\n       CWE classifications (e.g. CWE-89 vs CWE-78), normalize them. If they\n       belong to distinct, incompatible CWE IDs, skip candidate vector\n       comparison entirely to structurally prevent false-merging distinct\n       vulnerability classes regardless of cosine score.\n     - **Positive threshold ($\\\\ge 0.90$):** Semantically equivalent findings\n       with differing phrasing, scanner labels, or line shifts merge into the\n       same ancestor `lineage_id` (default: 0.90, configurable via\n       `EMBEDDING_SIMILARITY_THRESHOLD`).\n     - **Negative threshold ($\u003C 0.70$):** Distinct vulnerability classes (e.g.,\n       SQLi vs Command Injection, Stored vs Reflected XSS) maintain low\n       similarity and fail closed, minting a fresh unique `lineage_id`.\n\n4. **Filter Duplicate Findings in Current Batch:** Check the current findings\n   against each other to find duplicates. Two findings are duplicates ONLY if\n   they share the same `code_paths` entry **line-inclusively** (WITH trailing\n   `:line`) AND have the same or highly similar title. If multiple findings\n   refer to the exact same flaw at the same location, they must be merged.\n   Findings at different lines in the same file are DISTINCT — never merge them.\n\n5. **Map\u002FReduce Chunking Strategy (For Scale):** If there are many finding files\n   (e.g., > 20 items), use a Map\u002FReduce approach to group them by target file or\n   component before checking for overlaps to avoid context window limits.\n\n6. **Token-Optimized Consolidation and Merging:** To minimize LLM output tokens\n   and prevent data loss, **do not manually rewrite or output the merged JSON\n   files in your response.** Instead, follow this pattern:\n\n   1. **Identify Duplicates:** Internally map which findings are duplicates of a\n      primary finding.\n   2. **Reusable Deterministic Scripting (versioned):** Write a reusable helper\n      script (e.g. `workspace\u002Fhelpers\u002Fmerge_findings.py`) whose FIRST LINE is\n      exactly `# MANTIS_HELPER_VERSION = 2`. Before reusing an existing helper,\n      grep its first lines for `MANTIS_HELPER_VERSION = 2`; if that marker is\n      absent or a different integer (a helper left by an older pipeline\n      version), REGENERATE the helper. Only reuse it when the marker matches.\n      The script must follow these deterministic rules:\n      - **Title:** Pick the most comprehensive and descriptive title.\n      - **ID:** Preserve the unique `\"id\"` of the primary finding being kept.\n      - **Severity:** Pick the highest severity level specified among the merged\n        items.\n      - **Privileges Required:** Inherit the most severe privilege requirement\n        (priority: `NONE` > `LOW` > `HIGH`).\n      - **Attacker Position:** Inherit the most critical position requirement\n        (priority: `EXTERNAL` > `INTERNAL_NETWORK` > `IN_CLUSTER` > `LOCAL` >\n        `HOST_SYSTEM` > `SUPPLY_CHAIN` > `PHYSICAL_TEMPORARY` >\n        `PHYSICAL_LONG_TERM`).\n      - **User Interaction:** Inherit the most severe user interaction\n        requirement (priority: `NONE` > `REQUIRED`).\n      - **Code Paths:** Collect and deduplicate all file paths and line numbers\n        into a single unique array.\n      - **Description, Mitigation, & Impact:** Concatenate cleanly.\n      - **History:** Concatenate and preserve all `\"history\"` entries from the\n        merged findings. Append a new entry to the `\"history\"` array for this\n        merge action conforming to the schema (containing `\"stage\": \"dedupe\"`,\n        `\"action\": \"merge\"`,\n        `\"details\": \"Merged duplicate findings: [comma-separated-ids]\"`,\n        `\"pass_number\": \u003Ccurrent_pass_number>`, and\n        `\"timestamp\": \"\u003Ccurrent_iso8601_timestamp>\"`).\n      - **Unknown keys & provenance (MANDATORY):** The script MUST copy through\n        EVERY key it does not explicitly handle (including `discovery_commit`,\n        `repro_snapshot_id`, `patch_base_snapshot`, `possible_duplicate_of`,\n        `signature`, `lineage_id`, `cwe`) from the primary finding onto the\n        merged object — never drop unknown fields. It MUST REFUSE to merge two\n        findings whose `discovery_commit` values differ (they describe different\n        code versions); leave them separate and log the refusal. When merging\n        findings that all share one `discovery_commit`, preserve it unchanged.\n   3. **Execute the Script:** Run your script to update the primary finding's\n      file (`workspace\u002Ffindings\u002F\u003Cprimary_id>.json`) on disk.\n\n7. **Transactional Staged Clean Up:** Do not permanently delete redundant files.\n   Ensure the trash directory exists (e.g.,\n   `mkdir -p workspace\u002Ffindings\u002F.trash\u002F`). Before moving, the script must update\n   the duplicate finding files, setting `\"status\": \"DUPLICATE\"` and\n   `\"duplicate_of\": \"\u003Cprimary_uuid>\"`. Move the merged duplicate `.json` files\n   to the trash staging directory (`workspace\u002Ffindings\u002F.trash\u002F`). For every file\n   moved, append a transaction record to `workspace\u002F.tx_log.jsonl`.\n\n   ### Transaction Log Schema Format (`workspace\u002F.tx_log.jsonl`)\n\n   Each line must be a self-contained JSON object documenting the transaction:\n\n   ```json\n   {\"timestamp\": \"2026-07-14T15:13:00Z\", \"action\": \"loop_filter | dedupe_merge\", \"primary_uuid\": \"[UUID] (or null for loop_filter)\", \"moved_uuid\": \"[UUID]\"}\n   ```\n\n   This cleans up the directory for downstream stages while preserving rollback\n   capability.\n\nWhen complete, notify the user.\n","# Deduplicator (\u002Fmantis-dedupe)\n\n## System Goal\n\nDuplicate Finding Merger. Evaluates lists of raw findings to cluster and\nconsolidate identical or highly overlapping issues into singular, descriptive\nrecords.\n\n## Command Definition\n\n- **Command:** `\u002Fmantis-dedupe`\n- **Description:** Consolidates raw security findings to eliminate redundant\n  reports.\n- **Arguments (optional; supplied by the orchestrator, consumed by Block A):**\n  `--snapshot_root`\u002F`--snapshot_id`\u002F`--state_root`. All absent ->\n  MODE-OFF\u002Flegacy mode (behaves as today; snapshot gating disabled).\n\n## Input\u002FOutput Contract\n\n- **Reads**:\n  - `workspace\u002Ffindings\u002F` (raw finding JSON files, ignoring `.trash\u002F`).\n  - `workspace\u002Farchive\u002Ffindings_pass_*\u002F*.json` and\n    `workspace\u002Farchive\u002Floop*_findings\u002F*.json` (to skip findings already\n    evaluated and triaged in previous passes).\n  - `workspace\u002F.mantis_state.json` (to track current loop pass).\n- **Writes**:\n  - Moves duplicate findings to `workspace\u002Ffindings\u002F.trash\u002F` after setting\n    `\"status\": \"DUPLICATE\"` and `\"duplicate_of\"`.\n  - Sets `\"possible_duplicate_of\"` (soft, non-terminal) on NOT_MATCHED matches\n    and stamps `\"discovery_commit\"` on current findings that lack it. Reads\n    `active_snapshot`\u002F`snapshot_pinned` from `.mantis_state.json`.\n  - Appends transaction logs to `workspace\u002F.tx_log.jsonl`.\n  - Generates\u002Fexecutes merging script `workspace\u002Fhelpers\u002Fmerge_findings.py`.\n  - Updates primary finding `workspace\u002Ffindings\u002F\u003Cprimary_id>.json` (merges\n    fields and history).\n- **Preconditions**:\n  - `workspace\u002Ffindings\u002F` must exist and contain finding files.\n- **Idempotency Guarantee**:\n  - Cross-references against archived findings in `workspace\u002Farchive\u002F` to filter\n    out any findings already processed in previous passes of this run.\n    Snapshot-gated: a resolved archived finding on a differing snapshot is\n    flagged as POSSIBLE REGRESSION (never silently filtered). Logs transactions\n    to `workspace\u002F.tx_log.jsonl` to support tracking and potential rollbacks.\n    Deterministic merging rules implemented in `merge_findings.py`.\n\n## Instructions\n\n### Step 0: Locator Resolution (run first)\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\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\nNotes: `workspace\u002Ffindings\u002F`, `workspace\u002Farchive\u002F`, `workspace\u002F.tx_log.jsonl`,\n`workspace\u002Fhelpers\u002F` and `.mantis_state.json` are STATE-RELATIVE (under\n--state_root). Any code snippet you inspect for a finding is SNAPSHOT-RELATIVE\n(under CODE_ROOT). Never write under CODE_ROOT.\n\nReview a list of security findings and merge duplicate findings that refer to\nthe exact same security flaw or adjacent code paths.\n\nExecute your task as follows:\n\n1. **Load Raw Findings & Archived Findings Queue:**\n\n   - List the contents of the directory and read the files in\n     `workspace\u002Ffindings\u002F`. If the directory is empty or does not exist, notify\n     the user and exit.\n   - *Important:* Ignore hidden files and directories (such as the `.trash\u002F`\n     subdirectory) when listing or processing findings.\n   - Locate and load all archived finding JSON files from previous loop passes,\n     if they exist, under `workspace\u002Farchive\u002Ffindings_pass_*\u002F*.json` and\n     `workspace\u002Farchive\u002Floop*_findings\u002F*.json`. These files represent\n     vulnerabilities that have already been fully evaluated, triaged, and\n     potentially patched in previous passes.\n   - *Important:* Do NOT read or deduplicate against\n     `workspace\u002Fhistorical_learnings.jsonl` (VCS history), as we want to catch\n     regressions if old bugs were reintroduced.\n\n2. **Filter Loop Duplicates (snapshot-gated).** First, stamp `discovery_commit`\n   on any CURRENT finding that lacks it, using `active_snapshot.snapshot_id`\n   from `.mantis_state.json` (skip when unpinned). Then, for each current\n   finding that matches an archived finding (by `code_paths`+`title`\n   similarity), run:\n\n   **Signature-based candidate matching (Phase 3) — TIGHTENS, never replaces:**\n   `signature` may only PROMOTE a pair to \"candidate for the pairwise snapshot\n   check\"; it may NEVER by itself cause a hard DUPLICATE\u002Ftrash. A pair is a\n   candidate for the Pairwise Snapshot Match Check below ONLY if it satisfies\n   BOTH:\n\n   - it matches under today's `code_paths` + `title` similarity, comparing\n     `code_paths` entries line-inclusively (WITH their trailing `:line`); AND\n   - (when both findings have a `signature`) their `signature` fields are equal.\n     A `signature` match WITHOUT the `code_paths` + `title` agreement is NOT a\n     duplicate — at most a soft `possible_duplicate_of` (keep the finding\n     ACTIVE), never a trash. Rationale: `signature` strips the line number and\n     all-but-first `code_paths` entry, so two DISTINCT bugs in the same file\n     (e.g. `parser.c:100` vs `parser.c:900`) with the same title+CWE share one\n     `signature`; trashing on signature alone would silently delete a real\n     finding. If EITHER lacks `signature`, use today's `code_paths` + `title`\n     similarity matching unchanged.\n\n   PAIRWISE SNAPSHOT MATCH CHECK (decides MATCHED vs NOT_MATCHED) — compares the\n   CURRENT finding's `discovery_commit` against the ARCHIVED finding's\n   `discovery_commit` for this pair (NOT against `SNAPSHOT_ID`):\n\n   1. If `snapshot_pinned` is false AND there is NO `active_snapshot` in state\n      (MODE-OFF) -> NOT_MATCHED. Stop. (In HALT — `active_snapshot` present but\n      `snapshot_pinned=false` — do NOT short-circuit here; fall through to the\n      pairwise comparison below, which will be NOT_MATCHED because the current\n      finding's `discovery_commit` is a `live:` id that will not equal the\n      archived one.)\n   2. Read the CURRENT finding's `discovery_commit` and the ARCHIVED finding's\n      `discovery_commit`:\n      - If EITHER is missing, empty, or the literal `\"MIXED\"` -> NOT_MATCHED.\n      - If they are NOT byte-for-byte equal to each other -> NOT_MATCHED.\n      - If they ARE byte-for-byte equal to each other (both present, non-MIXED)\n        -> MATCHED. There is no other route to MATCHED; never fuzzy-compare. The\n        global \"default the field and proceed\" backward-compat rule does NOT\n        apply to `discovery_commit`: absent = NOT_MATCHED. (There is NO separate\n        \"dirty\" gate: a dirty tree's SNAPSHOT_ID already embeds the working-tree\n        content hash, so within-pass findings MATCH and cross-pass bare-commit\n        findings do not.) Note: this is a PAIRWISE check (current vs archived),\n        NOT a check against the global `SNAPSHOT_ID` — dedupe stamps the current\n        finding's `discovery_commit` to `SNAPSHOT_ID` in Step 2 above, so a\n        check against `SNAPSHOT_ID` would always be MATCHED and would trash\n        reintroduced\u002Fregression bugs as DUPLICATE.\n\n   Then, using the idempotency rule (Input\u002FOutput Contract → Idempotency\n   Guarantee) to avoid double-writes, decide mechanically:\n\n   - **MATCHED** (both present and equal): soft-delete the current finding as a\n     loop-duplicate exactly as before — set `\"status\": \"DUPLICATE\"` and\n     `\"duplicate_of\": \"\u003Carchived_uuid>\"`, clear `possible_duplicate_of` if\n     present, ensure `mkdir -p workspace\u002Ffindings\u002F.trash\u002F`, move it there, and\n     log a `loop_filter` transaction in `workspace\u002F.tx_log.jsonl`. If the\n     current finding lacks `lineage_id` but the archived finding has one,\n     inherit the archived finding's `lineage_id` onto the current finding before\n     moving it (so the lineage chain is preserved across the merge).\n   - **NOT_MATCHED** (differ, or either absent): do NOT set `DUPLICATE` and do\n     NOT move to trash. Keep the current finding ACTIVE and set\n     `\"possible_duplicate_of\": \"\u003Carchived_uuid>\"` (a soft, non-terminal hint).\n     If the current finding lacks `lineage_id` but the archived finding has one,\n     inherit the archived finding's `lineage_id` onto the current finding (so\n     the lineage chain is preserved for report folding even when the findings\n     are on different snapshots).\n\n   > [!IMPORTANT] **STATUS & DUPLICATE INVARIANTS:**\n   >\n   > - A finding MUST NOT carry both `duplicate_of` and `possible_duplicate_of`\n   >   pointing to the same target UUID.\n   > - `status = \"DUPLICATE\"` MUST NOT coexist with `possible_duplicate_of`\n   >   pointing to the same target UUID.\n   > - Under **NOT_MATCHED** (outside the MODE-OFF fallback exception), the\n   >   finding's `status` MUST remain active (e.g. `VALID`,\n   >   `PROVISIONALLY_VALID`, `NEEDS_RESEARCH`), `duplicate_of` MUST NOT be set,\n   >   and the finding MUST NOT be moved to `.trash\u002F`. Setting\n   >   `possible_duplicate_of` is a non-terminal hint only.\n\n   - **POSSIBLE REGRESSION:** if the archived match has a RESOLVED status\n     (`patch_status` in {`VERIFIED_SECURE`,`MITIGATION_PROPOSED`} OR\n     `status`==`FALSE_POSITIVE` OR `production_viability`==`NON_VIABLE`) AND the\n     pair is NOT MATCHED, keep the current finding ACTIVE, add a history note\n     \"POSSIBLE REGRESSION vs \\\u003Carchived_uuid>\", and do NOT filter it. (A\n     reverted fix re-discovered on new code must never be trashed.)\n   - **EXACT-UUID retry exception (unchanged):** if the current finding has the\n     EXACT SAME UUID as the archived one, it was intentionally copied back for a\n     retry — do NOT filter it (keep as-is).\n   - **Permanently-unpinned exception (MODE-OFF only — no `active_snapshot`):**\n     if there is NO `active_snapshot` in state (MODE-OFF = today's default; a\n     target with no snapshot boundary, e.g. a live endpoint), `snapshot_pinned`\n     is false at the PASS level (`active_snapshot.snapshot_pinned` — it is NOT a\n     per-finding field) and Block B is uninformative — fall back to today's\n     dedup by `signature` if present, else `stable_key` = normalized_title +\n     first `code_paths` entry **including its trailing `:line`**\n     (line-inclusive, same as Step 2). Rationale: stripping `:line` would\n     collapse two DISTINCT bugs in the same file (e.g. `parser.c:100` vs\n     `parser.c:900`) with the same title+CWE into one — silently deleting a real\n     finding. Note: `signature` itself strips `:line` by design (it is a coarse\n     identity for cross-pass lineage, not a dedup key); this fallback therefore\n     prefers `signature` only when `stable_key`'s line-inclusive match ALSO\n     agrees, never on `signature` alone. This preserves dedup for targets that\n     can never MATCH. When `active_snapshot` IS present but unpinned (HALT\n     mode), this exception does NOT fire: keep the snapshot-gated behavior above\n     (NOT_MATCHED → keep ACTIVE + `possible_duplicate_of`, never `DUPLICATE`).\n     **POSSIBLE REGRESSION takes precedence over this fallback:** a\n     resolved-archived finding paired with a NOT_MATCHED current finding is\n     ALWAYS kept active (never trashed), regardless of mode.\n\n3. **3-Tier Deduplication Ladder (Deterministic & Semantic Matching):** When\n   resolving finding lineages and evaluating deduplication candidates, the\n   deduplicator uses a hierarchical 3-tier ladder designed for sub-millisecond\n   fast-path execution with semantic RAG fallback:\n\n   - **Tier 1 (Fast-Path Exact Heuristic Anchors — \u003C 1ms, 0 tokens):**\n\n     1. Exact content identity signature match:\n        `hashlib.sha256(canonical_fp | canonical_cwe | target_symbol)`\n        (invariant to line shifts, backticks, and title paraphrasing).\n     2. Exact `canonical_filepath + normalized CWE + target_symbol` match.\n     3. Strict line proximity window ($\\\\le 3$ lines) on exact canonical\n        filepath when target symbol is empty.\n\n     - *Result*: If matched, immediately inherit ancestor `lineage_id` without\n       LLM or embedding overhead.\n\n   - **Tier 2 (RCA Normalization):** If Tier 1 heuristic matching does not\n     produce an exact anchor, synthesize a standardized 5-line Root Cause\n     Analysis (RCA) summary:\n\n     - `Component`: Normalized canonical filepath and symbol.\n     - `Vulnerability Class`: Canonical CWE taxonomy identifier and name.\n     - `Root Cause Mechanism`: Underlying programming or logic defect.\n     - `Failure Condition`: Specific input, state, or boundary condition.\n     - `Taint Dataflow`: Source-to-sink dataflow trajectory.\n\n   - **Tier 3 (Vector Embedding & Cosine Similarity Scan):**\n\n     - Project the standardized RCA summary into dense vector embeddings using\n       the configured multi-provider embedding engine (default:\n       `vertex_ai\u002Fgemini-embedding-001`).\n     - Perform nearest-neighbor scan over historical `lineage_vectors` in the\n       database using bounded cosine similarity.\n     - **CWE Family & Class Structural Guard:** When comparing query finding\n       vectors against candidate lineage records, if both findings have explicit\n       CWE classifications (e.g. CWE-89 vs CWE-78), normalize them. If they\n       belong to distinct, incompatible CWE IDs, skip candidate vector\n       comparison entirely to structurally prevent false-merging distinct\n       vulnerability classes regardless of cosine score.\n     - **Positive threshold ($\\\\ge 0.90$):** Semantically equivalent findings\n       with differing phrasing, scanner labels, or line shifts merge into the\n       same ancestor `lineage_id` (default: 0.90, configurable via\n       `EMBEDDING_SIMILARITY_THRESHOLD`).\n     - **Negative threshold ($\u003C 0.70$):** Distinct vulnerability classes (e.g.,\n       SQLi vs Command Injection, Stored vs Reflected XSS) maintain low\n       similarity and fail closed, minting a fresh unique `lineage_id`.\n\n4. **Filter Duplicate Findings in Current Batch:** Check the current findings\n   against each other to find duplicates. Two findings are duplicates ONLY if\n   they share the same `code_paths` entry **line-inclusively** (WITH trailing\n   `:line`) AND have the same or highly similar title. If multiple findings\n   refer to the exact same flaw at the same location, they must be merged.\n   Findings at different lines in the same file are DISTINCT — never merge them.\n\n5. **Map\u002FReduce Chunking Strategy (For Scale):** If there are many finding files\n   (e.g., > 20 items), use a Map\u002FReduce approach to group them by target file or\n   component before checking for overlaps to avoid context window limits.\n\n6. **Token-Optimized Consolidation and Merging:** To minimize LLM output tokens\n   and prevent data loss, **do not manually rewrite or output the merged JSON\n   files in your response.** Instead, follow this pattern:\n\n   1. **Identify Duplicates:** Internally map which findings are duplicates of a\n      primary finding.\n   2. **Reusable Deterministic Scripting (versioned):** Write a reusable helper\n      script (e.g. `workspace\u002Fhelpers\u002Fmerge_findings.py`) whose FIRST LINE is\n      exactly `# MANTIS_HELPER_VERSION = 2`. Before reusing an existing helper,\n      grep its first lines for `MANTIS_HELPER_VERSION = 2`; if that marker is\n      absent or a different integer (a helper left by an older pipeline\n      version), REGENERATE the helper. Only reuse it when the marker matches.\n      The script must follow these deterministic rules:\n      - **Title:** Pick the most comprehensive and descriptive title.\n      - **ID:** Preserve the unique `\"id\"` of the primary finding being kept.\n      - **Severity:** Pick the highest severity level specified among the merged\n        items.\n      - **Privileges Required:** Inherit the most severe privilege requirement\n        (priority: `NONE` > `LOW` > `HIGH`).\n      - **Attacker Position:** Inherit the most critical position requirement\n        (priority: `EXTERNAL` > `INTERNAL_NETWORK` > `IN_CLUSTER` > `LOCAL` >\n        `HOST_SYSTEM` > `SUPPLY_CHAIN` > `PHYSICAL_TEMPORARY` >\n        `PHYSICAL_LONG_TERM`).\n      - **User Interaction:** Inherit the most severe user interaction\n        requirement (priority: `NONE` > `REQUIRED`).\n      - **Code Paths:** Collect and deduplicate all file paths and line numbers\n        into a single unique array.\n      - **Description, Mitigation, & Impact:** Concatenate cleanly.\n      - **History:** Concatenate and preserve all `\"history\"` entries from the\n        merged findings. Append a new entry to the `\"history\"` array for this\n        merge action conforming to the schema (containing `\"stage\": \"dedupe\"`,\n        `\"action\": \"merge\"`,\n        `\"details\": \"Merged duplicate findings: [comma-separated-ids]\"`,\n        `\"pass_number\": \u003Ccurrent_pass_number>`, and\n        `\"timestamp\": \"\u003Ccurrent_iso8601_timestamp>\"`).\n      - **Unknown keys & provenance (MANDATORY):** The script MUST copy through\n        EVERY key it does not explicitly handle (including `discovery_commit`,\n        `repro_snapshot_id`, `patch_base_snapshot`, `possible_duplicate_of`,\n        `signature`, `lineage_id`, `cwe`) from the primary finding onto the\n        merged object — never drop unknown fields. It MUST REFUSE to merge two\n        findings whose `discovery_commit` values differ (they describe different\n        code versions); leave them separate and log the refusal. When merging\n        findings that all share one `discovery_commit`, preserve it unchanged.\n   3. **Execute the Script:** Run your script to update the primary finding's\n      file (`workspace\u002Ffindings\u002F\u003Cprimary_id>.json`) on disk.\n\n7. **Transactional Staged Clean Up:** Do not permanently delete redundant files.\n   Ensure the trash directory exists (e.g.,\n   `mkdir -p workspace\u002Ffindings\u002F.trash\u002F`). Before moving, the script must update\n   the duplicate finding files, setting `\"status\": \"DUPLICATE\"` and\n   `\"duplicate_of\": \"\u003Cprimary_uuid>\"`. Move the merged duplicate `.json` files\n   to the trash staging directory (`workspace\u002Ffindings\u002F.trash\u002F`). For every file\n   moved, append a transaction record to `workspace\u002F.tx_log.jsonl`.\n\n   ### Transaction Log Schema Format (`workspace\u002F.tx_log.jsonl`)\n\n   Each line must be a self-contained JSON object documenting the transaction:\n\n   ```json\n   {\"timestamp\": \"2026-07-14T15:13:00Z\", \"action\": \"loop_filter | dedupe_merge\", \"primary_uuid\": \"[UUID] (or null for loop_filter)\", \"moved_uuid\": \"[UUID]\"}\n   ```\n\n   This cleans up the directory for downstream stages while preserving rollback\n   capability.\n\nWhen complete, notify the user.\n",{"name":5,"description":7},"main","f3162c039ecd9c9d5d8bc404dd1373c7ca3152f7","skills\u002Fmantis-dedupe",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":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add google\u002Fmantis --skill mantis-dedupe",{"tool":54,"command":55},"bunx","bunx skills add google\u002Fmantis --skill mantis-dedupe",{"tool":57,"command":58},"pnpm","pnpm dlx skills add google\u002Fmantis --skill mantis-dedupe","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fmantis\u002Fblob\u002Fmain\u002Fskills\u002Fmantis-dedupe\u002FSKILL.md",true,[],[63,89,115,142,153,167],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":33},"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",[],[70,71,72,73,74,22,75,76,77,78,79,80,81,82,83,84,85,86,87,88],"mantis threat model","threat model","model","threat","architecture","analyzing","knowledge","kb","files","surfaces","trust","learnings","knowledge base","as","extracting","reading","jsonl","source","source code",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":100,"publishedAt":33},"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",[95],{"categoryNo":96,"categoryName":97,"taxonomyType":98,"taxonomyTypeDesc":99},"01JBSEEDCAT000000000000021","资料检索与研究","SCENARIO","使用场景",[101,102,103,104,20,21,105,22,106,107,108,73,109,110,111,112,113,114,30,32],"summarize","mantis summarize","writing","directory","threat modeling","planning","repository","patching","campaign","map","modeling","scripts","make","reviews",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":126,"publishedAt":33},"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",[121],{"categoryNo":122,"categoryName":123,"taxonomyType":124,"taxonomyTypeDesc":125},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[127,128,129,130,22,131,132,133,134,108,135,136,137,25,138,139,140,141,30,32],"mantis structural index","index","structural","research","content","reporting","data","analysis","improve","quality","context","research quality","reference","live","unit",{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":148,"publishedAt":33},"01M6992KRP2XYWEMV12P5M4GPE","mantis-review","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.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fmantis\u002Fblob\u002Fmain\u002Fskills\u002Fmantis-review\u002FSKILL.md",[],[20,149,22,150,108,25,151,152,114,30,87,88,32],"mantis review","validation","filters","false",{"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":33},"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",[],[160,23,103,20,161,22,106,134,162,163,25,78,164,165,114,30,87,166,88,32],"mantis researcher","static analysis","plan","strategy","deep","you","static",{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":33},"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",[],[174,175,21,22,108,176,177,178,25,179,180,181,165,30,32],"mantis reproduce","reproduce","verify","write","execute","crash","payload","script"]