[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-108017":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":14,"stars30d":15,"stars90d":13,"forks30d":13,"starsTrendScore":16,"compositeScore":17,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":8,"pushedAt":22,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":13,"starSnapshotCount":13,"syncStatus":16,"lastSyncTime":26,"discoverSource":27},108017,"ZeroMDASH","JANUS-SEC\u002FZeroMDASH","JANUS-SEC",null,"Python",82,14,62,0,5,20,2,42.03,false,"master",true,[],"2026-11-20 17:43:55","2026-11-21 10:42:12","# ZeroMDASH\n\nOpen re-implementation of Microsoft MDASH: a LangGraph-based multi-agent\nvulnerability analysis pipeline that drives external coding-agent runtimes such\nas Claude Code, Codex CLI, TraeX (`traecli` \u002F `traex`), Kimi Code, OpenCode,\nDeepSeek Harness (`dsh`), and DeepAgent.\n\n## Quickstart\n\n```bash\npip install -e \".[all]\"\n\n# Full scan\nzeromdash --target https:\u002F\u002Fgithub.com\u002Fcurl\u002Fcurl\n\n# Diff-highlighted scan over an already-patched checkout\nzeromdash \\\n  --target .\u002Fpatched-repo \\\n  --scan-mode diff \\\n  --diff-file \u002Ftmp\u002Fchange.patch\n\n# Gather cross-target chains from completed workspaces\nzeromdash \\\n  --scan-mode gather \\\n  --gather-workspace-to-chain demo\u002Fgather-multi-target-config.example.yaml \\\n  --agent-config demo\u002Fgather-agent-config.example.yaml\n```\n\n### Full\u002Fdiff workspace layout\n\nFull and diff scans create `.zeromdash\u002Fworkspace_for_\u003Ctarget>\u002F`:\n\n```text\nworkspace_for_\u003Ctarget>\u002F\n├── workspace.json\n├── main\u002F\n│   ├── repo\u002F                    # target source tree\n│   ├── repos\u002F                   # per-repository trees for multi-repo targets\n│   ├── scope\u002F                   # scope.json; diff mode also stores the copied diff\u002Fhunks\n│   ├── spec\u002F                    # relevant RFCs and standards\n│   ├── feature\u002F                 # new or weakly-covered feature surfaces\n│   ├── attack_surface\u002F          # attack_surface.md + domain_invariant_registry.json\n│   ├── writeup\u002F                 # target vulnerability history\n│   └── patch\u002F                   # corresponding patches and patch manifest\n├── similar\u002F\u003Csoftware>\u002F\n│   ├── repo\u002F\n│   ├── writeup\u002F\n│   └── patch\u002F\n├── log\u002F\n│   ├── state\u002F                   # plans, convergence records, dispatch plan, chain pool\u002Fplan\n│   ├── review_log\u002F              # per-attempt agent and validation logs\n│   ├── subtask_res\u002F             # terminal subtask envelopes\n│   ├── primitive_res\u002F           # confirmed non-standalone primitives\n│   ├── chain_res\u002F               # confirmed end-to-end chain findings\n│   ├── chain_candidates\u002F        # rejected or inconclusive chains\n│   └── agent_commands.jsonl\n├── sub_workspace\u002F               # rendered role cards, contracts and runtime settings\n├── summary.en.md\n├── summary.zh_CN.md\n├── summary.md\n├── gate_result.json\n└── final_state.json\n```\n\nDiff mode additionally writes `changes.diff`, changed-file\u002Fsymbol indexes, raw\nplanner candidates and convergence records under `main\u002Fscope\u002F` and `log\u002Fstate\u002F`.\nSelected subtask\u002Fchain reruns use isolated directories under `log\u002F` and do not\noverwrite canonical results.\n\n### Gather workspace layout\n\nGather mode creates a separate\n`.zeromdash\u002Fworkspace_for_gather-\u003Cscenario-name>\u002F`. It does not use\n`main\u002Frepo\u002F` as its input source; every completed source workspace is copied\ninto a target-scoped, immutable analysis snapshot under `inputs\u002F`:\n\n```text\nworkspace_for_gather-\u003Cscenario-name>\u002F\n├── workspace.json\n├── gather_manifest.yaml\n├── inputs\u002F\n│   ├── manifest.normalized.json\n│   ├── gather_inputs.lock.json\n│   └── \u003Ctarget-id>\u002F\n│       ├── workspace.json       # sanitized source-workspace metadata\n│       ├── source_context.json  # sanitized focus\u002Frepository context; no env secrets\n│       ├── attack_surface\u002F      # source main\u002Fattack_surface snapshot\n│       ├── source\u002F\n│       │   ├── main\u002F            # source main\u002Frepo snapshot\n│       │   └── \u003Crepo-id>\u002F       # source main\u002Frepos\u002F\u003Crepo-id> snapshot\n│       ├── primitive_res\u002F       # active confirmed primitives\n│       ├── subtask_res\u002F         # active terminal subtask envelopes\n│       └── chain_res\u002F           # active confirmed local chains\n├── main\u002F\n│   └── attack_surface\u002F\n│       ├── gather_attack_surface.md\n│       └── cross_target_registry.json\n├── log\u002F\n│   ├── state\u002F\n│   │   ├── gather_evidence_pool.json\n│   │   └── gather_chain_plan.json\n│   ├── review_log\u002F              # gather node\u002Fbattle attempt logs\n│   ├── gather_chain_res\u002F        # confirmed cross-target chain findings\n│   ├── gather_chain_candidates\u002F # rejected or inconclusive cross-target chains\n│   ├── gather_report_groups.json\n│   └── agent_commands.jsonl\n├── sub_workspace\u002F               # gather node and per-chain agent work directories\n├── summary.en.md\n├── summary.zh_CN.md\n├── summary.md\n├── gate_result.json\n└── final_state.json\n```\n\nThe base `Workspace` class also creates compatibility directories such as\n`main\u002Frepo\u002F`, `similar\u002F`, `log\u002Fsubtask_res\u002F`, and `log\u002Fchain_res\u002F` in a gather\nworkspace. They are normally empty; canonical gather inputs live under\n`inputs\u002F`, and cross-target results live under the `gather_*` paths shown above.\n\n## CLI Options\n\n```\n--target TEXT              Target software (path, git URL, or package name)\n--scan-mode full|diff|gather\n                           Full, diff-highlighted, or cross-workspace gather scan\n--gather-workspace-to-chain YAML\n                           Multi-target workspace manifest required by gather mode\n--diff-file PATCH          Unified git diff already applied to the target repo\n--diff-git BEFORE..AFTER   Generate diff from refs in the fetched remote git repo\n--workspace-root PATH      Output directory (default: .\u002F.zeromdash)\n--task-id TEXT             Custom task id\n--max-iterations INT       Max critic feedback rounds per subtask (default: 3)\n--min-critic-skills INT    Min expert skills the critic is asked to apply (default: 2)\n--role-lang TEXT           Role-card language, e.g. en or zh_CN (default: en)\n--agent-config YAML_FILE   Configure node runtimes and workflow limits\n--preset-attack-surface MD Seed the attack-surface report before analysis\n--disable-spec             Skip the spec track (search_spec + plan_by_spec; no spec subtasks)\n--disable-target-history   Skip target history and patch-miss planning\n--disable-new-feature      Skip new-feature coverage-gap analysis\n--disable-chain            Skip cross-primitive chain planning and chain battles\n--till-node analyze|plan   Stop after analyze_attack_surface or all planner JSON files\n--start-from-subtask DIR   Restore an existing workspace and start at subtask dispatch\n--select-subtask-to-run IDS\n                           Rerun selected planner subtask IDs without summary\n--select-subtask-to-run-log-dir DIR\n                           Isolated output directory for a selected rerun\n--start-from-chain DIR     Restore an existing workspace and start at chain planning\n--select-chain-to-run IDS  Rerun selected chain IDs without summary\n--select-chain-to-run-log-dir DIR\n                           Isolated output directory for a selected chain rerun\n--start-from-summary DIR   Restore an existing workspace and run only summary\n--fail-on-gate             Exit non-zero when a diff-mode finding blocks\n```\n\nExamples:\n```bash\n# Local source tree\nzeromdash --target .\u002Fmy-project --workspace-root \u002Ftmp\u002Faudit\n\n# MR\u002Fcode-diff gate: repo is already patched; diff only highlights and attributes\nzeromdash \\\n  --target .\u002Fpatched-repo \\\n  --scan-mode diff \\\n  --diff-file \u002Ftmp\u002Fchange.patch \\\n  --fail-on-gate\n\n# Remote git range: fetch refs, checkout AFTER, and highlight BEFORE..AFTER\nzeromdash \\\n  --target https:\u002F\u002Fexample.com\u002Fteam\u002Frepo.git \\\n  --scan-mode diff \\\n  --diff-git release-1.0..main \\\n  --fail-on-gate\n\n# Use Chinese role cards\nzeromdash --target curl --role-lang zh_CN\n\n# Skip the spec track (cost control)\nzeromdash --target curl --disable-spec\n\n# Skip target-history lookup for private software\nzeromdash --target .\u002Fprivate-project --disable-target-history\n\n# Stop after attack-surface analysis\nzeromdash --target curl --till-node analyze\n\n# Stop after planner JSON is materialized\nzeromdash --target curl --till-node plan\n\n# Restore a workspace that already has planner JSON files\nzeromdash --start-from-subtask .zeromdash\u002Fworkspace_for_curl\n\n# Rerun selected subtasks only; canonical results remain unchanged\nzeromdash \\\n  --start-from-subtask .zeromdash\u002Fworkspace_for_curl \\\n  --select-subtask-to-run vuln-013,patch-008,spec012\n\n# Use an explicit isolated output directory\nzeromdash \\\n  --start-from-subtask .zeromdash\u002Fworkspace_for_curl \\\n  --select-subtask-to-run vuln-013 \\\n  --select-subtask-to-run-log-dir selected_runs\u002Fvuln-013-review\n\n# Restore a workspace that already has subtask_res\u002Fprimitive_res and start at\n# chain planning\nzeromdash --start-from-chain .zeromdash\u002Fworkspace_for_curl\n\n# Rerun selected chain candidates only; canonical results remain unchanged\n# (chain IDs are stable hashes from log\u002Fstate\u002Fchain_plan.json)\nzeromdash \\\n  --start-from-chain .zeromdash\u002Fworkspace_for_curl \\\n  --select-chain-to-run chain_1a2b3c4d5e6f7a8b\n\n# Regenerate the bilingual summaries from log\u002Fsubtask_res\u002F*.json\nzeromdash --start-from-summary .zeromdash\u002Fworkspace_for_curl\n\n# Build cross-target chains from completed source workspaces\nzeromdash \\\n  --scan-mode gather \\\n  --gather-workspace-to-chain demo\u002Fgather-multi-target-config.example.yaml \\\n  --agent-config demo\u002Fgather-agent-config.example.yaml\n```\n\nWhen `--target` is a local directory, ZeroMDASH copies the complete source tree\ninto `main\u002Frepo\u002F` deterministically before analysis. The original directory is\nnot modified, and local `.git` \u002F `.zeromdash` metadata is not copied.\n\n## Agent Config\n\n`--agent-config` is the preferred way to set workflow limits, task focus, and\nper-node runtime settings:\n\nUse `demo\u002Fzeromdash.oss.demo.yaml` for a single repository. Use\n`demo\u002Fzeromdash.oss.multi-repo-demo.yaml` when one target product is composed of\na core repository plus plugin or feature repositories. Multi-repo targets\ncurrently support full scan mode only. Gather mode instead consumes two or more\nalready-completed workspaces; its manifest and coordinator examples live at\n`demo\u002Fgather-multi-target-config.example.yaml` and\n`demo\u002Fgather-agent-config.example.yaml`.\n\n```yaml\ncommon_focus: >\n  Threat model, attacker position, trust boundary, target component, impact\n  class, and any project-wide constraints.\n\nmax_concurrency: 8  # default; caps simultaneous LangGraph Send\u002Fnode executions\ntop_K:\n  spec: 5\n  vuln: 8\n  patch: 3\n  feature: 4\n  chain: 16  # chain candidates dispatched to chain battles after pruning\n\n# Optional cross-primitive chain aggregation controls (defaults shown):\n# chain:\n#   enabled: true                      # or use --disable-chain\n#   max_length: 4                      # max primitives per candidate chain\n#   max_successors_per_capability: 4   # successor cap per capability expansion\n#   beam_width: 64                     # search frontier cap\n#   max_candidates_before_top_k: 200   # candidate cap before top_K.chain\n#   max_battle_rounds: 2               # max chain investigate\u002Fcritic iterations\n\nnode:\n  search_spec:\n    runtime: claude_code\n    config: bedrock\n    provider: bedrock\n    focus: \"Relevant protocol and parser specifications.\"\n\n  investigate_subtask:\n    runtime: traex\n    config: work\n    fallbacks:\n      - runtime: claude_code\n        config: ark-proxy\n        provider: ark\n\n  critic_subtask:\n    runtime: codex\n```\n\n`top_K` is an explicit cost cap on dispatched subtasks. Omitting it leaves\nthe bucket uncapped; setting it can reduce coverage and is not implicitly\nenabled by diff mode. `max_concurrency` only limits how many dispatched\nLangGraph tasks run at the same time.\n\n`investigate_subtask`, `critic_subtask`, `plan_chains`,\n`chain_investigate_subtask`, `chain_critic_subtask`, all semantic `gather_*`\nnodes, and `summary` must use a harness with\nverified native subagent support. The accepted runtimes are `codex` (including\n`codex_cli` aliases), `traex`, and `claude_code`; this restriction applies to\nboth the primary runtime and every fallback. ZeroMDASH enables Codex\n`multi_agent`, enables TraeX `multi_agent_v2`, and grants Claude Code's `Agent`\ntool only in these nodes' generated local settings. Other nodes may still use any registered\nruntime. Here, “subtask” means a ZeroMDASH LangGraph work unit; “subagent” means\na child agent created natively by one of those harnesses.\n\nTraeX is supported as `runtime: traex` (aliases: `trae`, `trae_cli`,\n`traecli`, `trae_code`, `traecode`). ZeroMDASH runs `traecli exec` in\nnon-interactive mode, passes the prompt over stdin, captures the final response\nwith `--output-last-message`, and uses native `--output-schema` for object-shaped\nstructured-output contracts. TraeX 0.201.1 rejects top-level array schemas, so\nplanner `Subtask[]` output remains JSON-only and is validated by ZeroMDASH's\nexisting orchestrator validator. TraeX reads the rendered `AGENTS.md` from the\nnode sub-workspace. The sub-workspace is its working root; `--add-dir` grants\nworkspace-write access to the complete task workspace so final artifacts can be\nwritten under `main\u002F`, `similar\u002F`, and `log\u002F`. The adapter sets\n`project_root_markers=[]` so TraeX loads only the invocation-local\n`AGENTS.md` instead of inheriting instructions from ancestor task directories.\n\n`config` selects `~\u002F.trae\u002F\u003Cconfig>.traecli.toml` through TraeX `--profile`.\nOmit `config` to use the base `~\u002F.trae\u002Ftraecli.toml`. ZeroMDASH explicitly uses\nTraeX `workspace-write`, the non-interactive exec default approval policy, and\nephemeral sessions. It does not enable Auto-Review, which cannot ask for\napprovals in exec mode, or the dangerous full-access bypass.\n\n```yaml\nnode:\n  investigate_subtask:\n    runtime: traex\n    config: work\n    model: seed-2.1-pro\n```\n\nKimi Code is also supported as a node runtime. With the official Kimi provider\nconfiguration in `~\u002F.kimi-code\u002Fconfig.toml`, no `provider` or `config` is\nrequired. For Kimi prompt mode, ZeroMDASH renders project-level instructions to\n`.kimi-code\u002FAGENTS.md`. Each `sub_workspace` also gets `.kimi-code\u002Flocal.toml`\nwith `[workspace].additional_dir` pointing at the whole ZeroMDASH workspace.\n\nKimi cannot currently be assigned to `investigate_subtask`, `critic_subtask`,\n`plan_chains`, `chain_investigate_subtask`, `chain_critic_subtask`, or\n`summary`, because this adapter has no verified native-subagent contract for\nKimi. It remains available to fetch, search, analysis, and planner nodes.\n\nDeepSeek Harness is supported through `dsh --profile headless`. ZeroMDASH does\nnot put the complete task in argv. It writes the prompt and runtime metadata to\nthe invocation-local `.dsh\u002F` directory, starts DSH from the task workspace root\nso `workspace-write` covers `main\u002F`, `log\u002F`, and `sub_workspace\u002F`, and keeps the\nlogical current directory at the invocation sub-workspace.\n\nThe default DSH mode is a constrained minimal-plus-search leaf agent. It keeps\npersistent `bash` and `str_replace_editor`, adds bounded `glob`\u002F`grep`\nrepository discovery, and disables interactive approval, writable filesystem\ntools beyond shell\u002Feditor, web access, nested DSH subagents\u002Fworkflows\u002FRalph,\nthe automatic session-title LLM request, and global session persistence. A\nnode `config` value is treated as an additional trusted DSH `--patch` file\napplied after the bundled minimal patch.\n\nBecause the bundled headless DSH overlay disables its subagent tools, DSH also\ncannot be assigned to `investigate_subtask`, `critic_subtask`,\n`plan_chains`, `chain_investigate_subtask`, `chain_critic_subtask`, or `summary`. It can\nstill be used by the other nodes, with `provider`, `model`, and an optional\ntrusted `config` patch.\n\nEach DSH invocation materializes:\n\n```text\nsub_workspace\u002Fnode_\u003Cnode>[\u002Fsubtask_\u003Cid>]\u002F\n  .dsh\u002F\n    AGENTS.md\n    headless-minimal.patch.yml\n    invocation.json\n    prompt.md\n    settings.yaml\n    sessions\u002F\n  output.schema.json        # structured-output nodes only\n  skills\u002F\n```\n\n## Runtime Selection\n\nThe main `zeromdash` workflow uses explicit runtime selection. At startup,\nZeroMDASH health-checks the configured runtime and any explicit `fallbacks` for\nevery enabled node. If a runtime\u002Fconfig\u002Fenv combination is unhealthy, the CLI\npauses and asks for a temporary runtime\u002Fconfig\u002Fprovider\u002Fmodel override. At\nruntime, a node falls back only when its current runtime has exhausted that\nnode's existing retry attempts and still failed.\n\nWhen automatic attempts and all explicit fallbacks are exhausted, the CLI\nasks for a temporary `runtime\u002Fconfig\u002Fprovider\u002Fmodel`, health-checks it, and\nretries the failed invocation without advancing the investigation iteration.\nThis includes invalid structured output even when the agent exits with code 0.\nValid critic `revise`\u002F`reject` decisions continue through the normal graph.\n\nRecovery prompts run on the main thread, one at a time. Concurrent failures\nof the same node share a versioned replacement: waiting tasks and later calls\nreuse the new configuration instead of asking again for the old failure.\nAlready running agent processes can finish; runtime console messages wait\nwhile the prompt owns the terminal. EOF or cancellation aborts recovery,\nwakes waiting tasks, and prevents new agent launches. Existing artifacts remain\non disk; in-flight processes are allowed to finish.\n\nTemporary overrides are recorded in `log\u002Fruntime_recovery.jsonl` (or the\nselected-run log directory) and in the completed `final_state.json`.\nThe source YAML is not changed. Investigation\u002Foutput attempt logs from manual\nretries include `recovery-N` so the exhausted attempts remain inspectable.\nProgrammatic graph calls retain their non-interactive behavior unless wrapped\nin `RuntimeRecovery(callback).run(...)` from `zeromdash.nodes.core.recovery`.\n\n| Node type | Default runtime |\n|---|---|\n| Fetch \u002F search \u002F summary | `claude_code` |\n| Attack-surface analysis | `codex` |\n| Planning \u002F investigation \u002F critic | `codex` |\n| Chain planning \u002F investigation \u002F chain critic | `codex` |\n\nSupported runtime names:\n\n| Runtime | Aliases | `config` meaning |\n|---|---|---|\n| `claude_code` | `claude` | Short name expands to `~\u002F.claude\u002Fsettings.\u003Cname>.json`; paths are used directly. |\n| `codex` | `codex_cli`, `openai_codex` | Passed as `codex --profile \u003Cconfig>`. |\n| `traex` | `trae`, `trae_cli`, `traecli`, `trae_code`, `traecode` | Passed as `traecli exec --profile \u003Cconfig>`; profile file is `~\u002F.trae\u002F\u003Cconfig>.traecli.toml`. |\n| `kimi` | `kimi_code`, `kimi_cli` | Usually omitted; Kimi reads `~\u002F.kimi-code\u002Fconfig.toml`. |\n| `opencode` | `open_code` | No runtime-specific `config` mapping. |\n| `dsh` | `deepseek_harness`, `deepseek_harness_cli` | Optional trusted extra `--patch` path; bundled minimal patch is always applied first. |\n| `deepagent` | `deep_agent` | Python library runtime; set `ZEROMDASH_DEEPAGENT_MODEL`. |\n\n`model`, when non-empty, is passed as `--model \u003Cmodel>` for CLI-backed runtimes\nexcept DSH. TraeX also accepts `ZEROMDASH_TRAEX_BIN` (default resolution:\n`traecli`, then `traex`) and `ZEROMDASH_TRAEX_MODEL`. DSH provider\u002Fmodel\nselection is written to invocation-local `settings.yaml`, because the headless\nprofile does not support `--model`.\nProvider-specific environment handling currently exists for `claude_code` +\n`provider: bedrock` and DSH invocation-local provider\u002Fmodel settings.\n\n## Workflow\n\nThe main workflow is:\n\n```text\nfetch_target_repo\n  -> prepare_scan_scope\n  -> search_spec\n  -> search_fuzz_driver\n  -> search_similar_software -> N x search_similar_history\n  -> search_target_history\n  -> search_new_feature\n  -> analyze_attack_surface\n  -> plan_by_spec \u002F plan_by_vuln_similar \u002F plan_by_vuln_patch \u002F plan_by_new_feature\n  -> N x subtask loops:\n       investigate_subtask -> critic_subtask -> revise\u002Ffinalize\n  -> materialize_chain_pool -> plan_chains\n  -> N x chain subtask loops:\n       chain_investigate_subtask -> chain_critic_subtask -> revise\u002Ffinalize\n  -> prepare_report_groups\n  -> summary\n```\n\nFirst-level subtasks end in one of several terminal states. A result whose root\ncause already violates a security contract with direct C\u002FI\u002FA impact becomes a\nstandalone finding and is scored with CVSS v4.0. A result whose mechanism,\nreachability, attacker control, and gained capability are confirmed by the\ncritic — but which cannot close into a vulnerability on its own — is persisted\nas a confirmed primitive under `log\u002Fprimitive_res\u002F` instead of being dropped.\nIt is not scored and never reported as a vulnerability by itself.\n\nThe chain stage then consumes both standalone findings (as proven capability\nsources) and confirmed primitives. `analyze_attack_surface` also materializes\n`main\u002Fattack_surface\u002Fdomain_invariant_registry.json`, a domain-adaptive registry\nof entities, representations, invariants, transitions, and cross-component\nseams shared by initial and chain agents. `plan_chains` first runs a deterministic\nbounded advisory prefilter over `required_capabilities` and `capabilities_gained` (max\nchain length, per-capability successor cap, beam width, and candidate cap),\nwriting the exact-match candidate audit trail to `log\u002Freview_log\u002Fchain_prefilter.json`\nand pruning reasons to `log\u002Freview_log\u002Fchain_pruning.jsonl`. These matches and\nmismatches are not final security decisions. A native-subagent-capable planning\nagent reads the primitive pool, registry, and prefilter output and produces the final\n`log\u002Fstate\u002Fchain_plan.json`, so semantic near-matches and handoff evidence\ncan be considered before dispatch. Surviving agent-planned candidates fan out to\nchain investigate\u002Fcritic battles that verify attacker entry, per-edge\nprerequisite bindings, cross-component handoff objects, and terminal impact.\nOnly an end-to-end closed chain whose primitives and per-edge semantic bindings\nare all confirmed and that\nproduces direct C\u002FI\u002FA impact is written to `log\u002Fchain_res\u002F` as a chain finding\nscored on the complete attack chain. The final impact may emerge only from the\ncomposition; no individual primitive needs to carry terminal impact. Unclosed combinations stay retained as\nprimitives\u002Fcandidates and are never dressed up as vulnerabilities. `summary`\nconsumes report groups built from standalone findings and chain findings,\ndeduplicated by final root cause and attack path so a standalone finding is not\ndouble-counted as both an individual report and a chain component.\n\n`full` is the default and preserves repository-wide scanning. In `diff` mode,\nthe complete patched repository remains available for call-graph, type,\nconfiguration, and sibling-path analysis. The diff only controls attribution,\npriority, and whether a finding can block the change.\n\nDiff mode has no implicit numeric task cap. `analyze_attack_surface` first\ncreates a canonical `## Diff Risk Surface Registry`: each `RS-XXX` represents\none changed-code anchor, root cause, untrusted-input-to-sink data flow, and\nsecurity invariant. The four planners attach spec\u002FCVE\u002Fpatch\u002Ffeature evidence to\nthose risk surfaces instead of creating one task per evidence item.\n\nFor each planner, `plan_by_*.candidates.json` keeps the raw candidate audit\ntrail, `plan_by_*.json` keeps the diff-attributable plan after same-bucket\n`risk_surface_id` convergence, and `plan_by_*.convergence.json` records the\nmapping and omission reasons. `dispatch_plan.json` then records cross-bucket\nconvergence and the actual fan-out. Adjacent or pre-existing checks without a\nconcrete diff-to-sink path are retained only in the candidate trail. Full mode\nkeeps the existing repository-wide planning and dispatch behavior.\nDiff-mode Sends are ordered round-robin across spec, vuln, patch, and feature\nbuckets so one large planner result cannot occupy all concurrency slots.\n\n`--diff-file` and `--diff-git` are mutually exclusive. `--diff-git` is for\nremote git targets: the fetch stage preserves `.git`, the scope stage resolves\nor fetches both refs, checks out the `after` commit, and generates the two-dot\n`before..after` diff. Tags, branches, and commit SHAs are accepted.\n\n`--disable-spec` removes `search_spec` and `plan_by_spec`.\n`--disable-target-history` removes `search_target_history` and\n`plan_by_vuln_patch`.\n`--disable-new-feature` removes `search_new_feature` and\n`plan_by_new_feature`.\n`--disable-chain` skips chain candidate planning and chain battles\n(`plan_chains` writes an empty plan); confirmed primitives are still persisted\nand standalone findings continue to report grouping and summary.\n\n`search_target_history` writes both `main\u002Fwriteup\u002F_index.md` and the canonical\n`main\u002Fpatch\u002F_patch_commits.json`. The JSON uses patch-manifest schema v1.0 for\nboth single-repository and multi-repository targets: `repositories[]` records\nthe checked-out identities, `coverage[]` contains exactly one result for every\nrepository (including `no_public_history`), and flat `findings[]` records carry\nan explicit `repo_id` plus patch reachability evidence. The orchestrator rejects\nmissing repositories, missing coverage, unknown repo ids, and target-specific\ntop-level layouts before allowing `plan_by_vuln_patch` to run. Existing\nworkspaces keep their old artifacts; rerun `search_target_history` to generate\nthe v1 manifest.\n\n`--till-node analyze` stops after `main\u002Fattack_surface\u002Fattack_surface.md` and\n`domain_invariant_registry.json` are created and valid. `--till-node plan` stops after all enabled planners have\ncreated valid plan JSON under `log\u002Fstate\u002F`.\n\n`--start-from-subtask \u003Cworkspace>` reuses an existing workspace and starts from\nthe subtask fan-out stage. The workspace must already contain a source tree,\n`main\u002Fattack_surface\u002Fattack_surface.md`, and planner files\n`log\u002Fstate\u002Fplan_by_spec.json`, `plan_by_vuln.json`, and\n`plan_by_patch.json`. `plan_by_feature.json` is loaded when present; older\nworkspaces without the feature track remain restorable.\nRestore readers prefer each canonical file under `log\u002Fstate\u002F` and fall back to\nthe same filename under legacy `log\u002Freview_log\u002F`. Subtask-result readers merge\nlegacy `log\u002Freview_res\u002F` with `log\u002Fsubtask_res\u002F`, with a same-named canonical\nfile taking precedence. New runs write only the canonical locations.\n\nWith `--select-subtask-to-run`, ZeroMDASH validates and normalizes the\nrequested IDs against those planner files, then reruns only the selected\nsubtask graphs. Compact IDs such as `spec012` normalize to `spec-012`.\nCanonical `log\u002Fsubtask_res\u002F*.json`, `log\u002Freview_log\u002F*.log`,\n`log\u002Fagent_commands.jsonl`, summaries, and `final_state.json` remain unchanged.\nThe selected run stops after status collection and never runs summary.\n\nBy default, selected outputs go to a new\n`log\u002Fselected_temp_\u003CUTC timestamp>\u002F` directory. An explicit\n`--select-subtask-to-run-log-dir \u003CDIR>` overrides it; relative paths resolve\nunder the restored workspace and the directory must not already exist. The\nisolated directory contains `attempts\u002F`, `investigations\u002F`,\n`critic_reviews\u002F`, `results\u002F`, `agent_commands.jsonl`,\n`selected_subtask_statuses.json`, and its own `final_state.json`. Result JSON\nretains both the final `finding` and complete per-iteration `history`.\n\nThe former `--start-from-subagent`, `--select-subagent-to-run`, and\n`--select-subagent-to-run-log-dir` spellings remain accepted as deprecated\ncompatibility aliases. In current terminology, `subagent` refers only to a\nnative child agent spawned inside a capable harness.\n\n`--start-from-chain \u003Cworkspace>` reuses an existing workspace and starts at\nchain planning. It reloads findings from `log\u002Fsubtask_res\u002F*.json` and primitives\nfrom `log\u002Fprimitive_res\u002F*.json`, rebuilds the chain pool, re-plans candidates\ninto `log\u002Fstate\u002Fchain_plan.json`, and continues through chain battles,\nreport grouping, and summary.\n\nWith `--select-chain-to-run`, ZeroMDASH reruns only the selected chain IDs\n(stable `chain_\u003Chash>` identifiers from `chain_plan.json`). The selected run\nstops after chain status collection and never runs summary. Outputs go to a new\n`log\u002Fselected_chain_runs\u002F\u003Ctimestamp>\u002F` directory, or to an explicit\n`--select-chain-to-run-log-dir \u003CDIR>`; canonical `log\u002Fchain_res\u002F*.json` and\nsummaries remain unchanged.\n\n`--start-from-summary \u003Cworkspace>` reuses an existing workspace and runs only\nthe `summary` node. The workspace must contain `workspace.json`, a non-empty\n`main\u002Frepo\u002F`, a non-empty `main\u002Fattack_surface\u002Fattack_surface.md`, and\n`log\u002Fsubtask_res\u002F*.json`. It reloads the finding objects serialized in\n`subtask_res` and groups them by `kind`; this is a report-regeneration path, not\na fresh critic run. Summary admission is still deterministic: legacy findings\nwithout a passed vulnerability-qualification gate and valid CVSS v4.0 Base\nvector are kept as non-vulnerability observations rather than promoted to\n`VULN-XXX`.\n\nMalformed or incomplete investigation output is retried without consuming an\ninvestigate\u002Fcritic iteration. Before each attempt, ZeroMDASH removes stale\n`finding.json`, `investigation.json`, and `output.json` files from that\ninvocation's sub-workspace. Stdout has priority; only when stdout is invalid\nmay a JSON artifact freshly created by the current attempt be accepted, and it\nmust pass the same non-empty title\u002Fdetail, `evidence.code_locations`, and\n`evidence.call_path` contract. Invalid investigations never reach the critic or\nbecome persisted findings. Attempt logs record the output source and separate\nstdout\u002Fartifact validation failures.\n\nFor DSH investigations, a subprocess timeout can still recover a fresh,\nnon-empty `finding.json` created by that invocation. The adapter only admits a\nnew parseable JSON object as an artifact candidate; the normal investigation\nvalidator still enforces the complete schema before the attempt is accepted.\nMissing, stale, empty, malformed, or contract-invalid files do not mask the\ntimeout.\n\nFor diff-mode runs, `main\u002Fscope\u002F` contains `scope.json`, `changes.diff`,\n`changed_files.txt`, `changed_symbols.json`, and `change_summary.md`.\n`gate_result.json` classifies findings as blocking, warning, or ignored. Only\nqualified vulnerabilities whose code-computed CVSS v4.0 severity is high or\ncritical, attributed as `introduced`, `enabled`, or `regressed`, with a concrete\ndiff-to-sink causal path, block the change. The critic must first classify each\nresult as a confirmed\u002Fconfiguration vulnerability, known CVE patch gap,\nhardening recommendation, expected behavior, insufficient evidence, or\nno-finding. Only the two vulnerability dispositions receive CVSS scores.\nPre-existing and unrelated findings are non-blocking.\n\n`gather` is a separate second-stage graph. It does not fetch or rescan targets.\nIt snapshots the selected workspaces' attack-surface, primitive, subtask, and\nchain artifacts; namespaces every source id by target; synthesizes a\nscenario-level cross-target registry; and runs Agent-Native planning plus\ninvestigate\u002Fcritic battles over candidates that cross at least two targets.\nSource-workspace findings remain evidence and are not reported again as new\nvulnerabilities. The detailed architecture and evidence contracts are in\n[`docs\u002FGATHER_CHAIN.md`](docs\u002FGATHER_CHAIN.md).\n\n## Observability (optional)\n\n```bash\npip install -e \".[observability]\"\nexport LANGFUSE_PUBLIC_KEY=pk-...\nexport LANGFUSE_SECRET_KEY=sk-...\n```\n\nAll LangGraph node invocations are traced to Langfuse.\n\n## Repro Workflow\n\n`zeromdash-repro` is a separate helper for validating findings already produced\nunder `log\u002Fsubtask_res\u002F`:\n\n```bash\nzeromdash-repro \\\n  --subtask-res .zeromdash\u002Fworkspace_for_curl\u002Flog\u002Fsubtask_res \\\n  --repo-path .zeromdash\u002Fworkspace_for_curl\u002Fmain\u002Frepo \\\n  --target curl\n```\n\nIt runs a linear flow:\n\n```text\nload_subtask_results -> plan_repro -> build_harmless_poc -> validate_repro -> summary\n```\n\nThe former `--review-res` option and `review_res=` Python keyword remain\navailable as deprecated compatibility aliases.\n\nUnlike the main workflow, `zeromdash-repro` still uses a backend fallback chain\nduring startup health checks.\n\n## Requirements\n\n- Python ≥ 3.10\n- The default workflow uses both [Claude Code](https:\u002F\u002Fdocs.anthropic.com\u002Fen\u002Fdocs\u002Fclaude-code) and [Codex CLI](https:\u002F\u002Fgithub.com\u002Fopenai\u002Fcodex): fetch\u002Fsearch\u002Fsummary default to `claude_code`, while attack-surface analysis, planning, investigation, and critic default to `codex`.\n- [Kimi Code](https:\u002F\u002Fmoonshotai.github.io\u002Fkimi-code\u002F),\n  [OpenCode](https:\u002F\u002Fgithub.com\u002Fopencode-ai\u002Fopencode),\n  [DeepSeek Harness](https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002Fdeepseek-harness), and\n  `deepagent` are optional runtimes. They only need to be installed\u002Fconfigured\n  when `--agent-config` maps enabled nodes to them.\n","ZeroMDASH 是一个开源的、基于 LangGraph 的多智能体漏洞分析框架，复现并扩展了微软 MDASH 的核心方法论。它通过编排多个外部代码智能体（如 Claude Code、Codex CLI、TraeX、Kimi Code、DeepSeek Harness 等），协同执行源码级漏洞识别、攻击链构建与跨目标模式挖掘。支持全量扫描、diff 增量分析和多目标结果聚合三种模式，并生成结构化工作区（含作用域定义、攻击面建模、补丁比对、验证日志及链式发现报告）。适用于安全研究人员对开源项目开展自动化、可追溯、可复现的深度漏洞研究与横向关联分析。","2026-11-24 04:33:18","CREATED_QUERY"]