@vigolium/piolium 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +117 -0
- package/agents/access-auditor.md +300 -0
- package/agents/assumption-breaker.md +154 -0
- package/agents/attack-designer.md +116 -0
- package/agents/code-scanner.md +139 -0
- package/agents/concurrency-auditor.md +238 -0
- package/agents/confirm-writer.md +257 -0
- package/agents/context-reviewer.md +274 -0
- package/agents/cross-verifier.md +165 -0
- package/agents/cve-scout.md +381 -0
- package/agents/env-builder.md +282 -0
- package/agents/env-profiler.md +205 -0
- package/agents/evidence-collector.md +140 -0
- package/agents/finding-grader.md +142 -0
- package/agents/finding-writer.md +148 -0
- package/agents/flow-tracer.md +106 -0
- package/agents/goal-backtracer.md +146 -0
- package/agents/history-miner.md +467 -0
- package/agents/independent-verifier.md +118 -0
- package/agents/intent-mapper.md +183 -0
- package/agents/longshot-collector.md +128 -0
- package/agents/longshot-prober.md +126 -0
- package/agents/patch-auditor.md +73 -0
- package/agents/poc-author.md +124 -0
- package/agents/poc-runner.md +194 -0
- package/agents/probe-lead.md +269 -0
- package/agents/red-challenger.md +101 -0
- package/agents/report-composer.md +208 -0
- package/agents/review-adjudicator.md +216 -0
- package/agents/spec-auditor.md +155 -0
- package/agents/taint-tracer.md +265 -0
- package/agents/test-locator.md +209 -0
- package/agents/threat-modeler.md +132 -0
- package/agents/variant-scanner.md +108 -0
- package/agents/variant-spotter.md +110 -0
- package/bin/piolium.mjs +376 -0
- package/extensions/piolium/_vendor/yaml.bundle.d.mts +6 -0
- package/extensions/piolium/_vendor/yaml.bundle.mjs +139 -0
- package/extensions/piolium/agent-runner.ts +322 -0
- package/extensions/piolium/agents.ts +266 -0
- package/extensions/piolium/audit-state.ts +522 -0
- package/extensions/piolium/bundled-resources.ts +97 -0
- package/extensions/piolium/candidate-scan.ts +966 -0
- package/extensions/piolium/command-target.ts +177 -0
- package/extensions/piolium/console-stream.ts +57 -0
- package/extensions/piolium/export-results.ts +380 -0
- package/extensions/piolium/findings.ts +448 -0
- package/extensions/piolium/heartbeat.ts +182 -0
- package/extensions/piolium/help.ts +234 -0
- package/extensions/piolium/index.ts +1865 -0
- package/extensions/piolium/longshot.ts +530 -0
- package/extensions/piolium/matcher-suggestions.ts +196 -0
- package/extensions/piolium/matcher-utils.ts +83 -0
- package/extensions/piolium/modes/balanced.ts +750 -0
- package/extensions/piolium/modes/confirm-bootstrap.ts +186 -0
- package/extensions/piolium/modes/confirm.ts +697 -0
- package/extensions/piolium/modes/deep.ts +917 -0
- package/extensions/piolium/modes/diff.ts +177 -0
- package/extensions/piolium/modes/lite.ts +540 -0
- package/extensions/piolium/modes/longshot.ts +595 -0
- package/extensions/piolium/modes/merge.ts +204 -0
- package/extensions/piolium/modes/phase-runner.ts +267 -0
- package/extensions/piolium/modes/reinvest.ts +546 -0
- package/extensions/piolium/modes/revisit.ts +279 -0
- package/extensions/piolium/modes.ts +48 -0
- package/extensions/piolium/phase-labels.ts +123 -0
- package/extensions/piolium/phase-status-strip.ts +92 -0
- package/extensions/piolium/prompt-prefix-editor.ts +39 -0
- package/extensions/piolium/providers/anthropic-vertex.ts +836 -0
- package/extensions/piolium/recon.ts +409 -0
- package/extensions/piolium/result-stats.ts +105 -0
- package/extensions/piolium/retry.ts +120 -0
- package/extensions/piolium/scheduler.ts +212 -0
- package/extensions/piolium/secrets.ts +368 -0
- package/extensions/piolium/tools/web-tools.ts +148 -0
- package/package.json +77 -0
- package/skills/agentic-actions-auditor/SKILL.md +327 -0
- package/skills/agentic-actions-auditor/references/action-profiles.md +186 -0
- package/skills/agentic-actions-auditor/references/cross-file-resolution.md +209 -0
- package/skills/agentic-actions-auditor/references/foundations.md +94 -0
- package/skills/agentic-actions-auditor/references/vector-a-env-var-intermediary.md +77 -0
- package/skills/agentic-actions-auditor/references/vector-b-direct-expression-injection.md +83 -0
- package/skills/agentic-actions-auditor/references/vector-c-cli-data-fetch.md +83 -0
- package/skills/agentic-actions-auditor/references/vector-d-pr-target-checkout.md +88 -0
- package/skills/agentic-actions-auditor/references/vector-e-error-log-injection.md +88 -0
- package/skills/agentic-actions-auditor/references/vector-f-subshell-expansion.md +82 -0
- package/skills/agentic-actions-auditor/references/vector-g-eval-of-ai-output.md +91 -0
- package/skills/agentic-actions-auditor/references/vector-h-dangerous-sandbox-configs.md +102 -0
- package/skills/agentic-actions-auditor/references/vector-i-wildcard-allowlists.md +88 -0
- package/skills/audit/SKILL.md +562 -0
- package/skills/audit/assets/icon.svg +7 -0
- package/skills/audit/hooks/scripts/validate_phase_output.py +550 -0
- package/skills/audit/references/adversarial-review.md +148 -0
- package/skills/audit/references/architecture-aware-sast.md +306 -0
- package/skills/audit/references/audit-workflow.md +737 -0
- package/skills/audit/references/chamber-protocol.md +384 -0
- package/skills/audit/references/creative-attack-modes.md +221 -0
- package/skills/audit/references/deep-analysis.md +273 -0
- package/skills/audit/references/domain-attack-playbooks.md +1129 -0
- package/skills/audit/references/knowledge-base-template.md +513 -0
- package/skills/audit/references/real-env-validation.md +191 -0
- package/skills/audit/references/report-templates.md +417 -0
- package/skills/audit/references/triage-and-prereqs.md +134 -0
- package/skills/audit/scripts/consolidate_drafts.py +554 -0
- package/skills/audit/scripts/partition_findings.py +152 -0
- package/skills/audit/scripts/rg-hotspots.sh +121 -0
- package/skills/audit/scripts/stamp_file_state.py +349 -0
- package/skills/code-reviewer/SKILL.md +65 -0
- package/skills/codeql/SKILL.md +281 -0
- package/skills/codeql/references/build-fixes.md +90 -0
- package/skills/codeql/references/diagnostic-query-templates.md +339 -0
- package/skills/codeql/references/extension-yaml-format.md +209 -0
- package/skills/codeql/references/important-only-suite.md +153 -0
- package/skills/codeql/references/language-details.md +207 -0
- package/skills/codeql/references/macos-arm64e-workaround.md +179 -0
- package/skills/codeql/references/performance-tuning.md +111 -0
- package/skills/codeql/references/quality-assessment.md +172 -0
- package/skills/codeql/references/ruleset-catalog.md +63 -0
- package/skills/codeql/references/run-all-suite.md +92 -0
- package/skills/codeql/references/sarif-processing.md +79 -0
- package/skills/codeql/references/threat-models.md +51 -0
- package/skills/codeql/workflows/build-database.md +280 -0
- package/skills/codeql/workflows/create-data-extensions.md +261 -0
- package/skills/codeql/workflows/run-analysis.md +301 -0
- package/skills/differential-review/SKILL.md +220 -0
- package/skills/differential-review/adversarial.md +203 -0
- package/skills/differential-review/methodology.md +234 -0
- package/skills/differential-review/patterns.md +300 -0
- package/skills/differential-review/reporting.md +369 -0
- package/skills/fp-check/SKILL.md +125 -0
- package/skills/fp-check/references/bug-class-verification.md +114 -0
- package/skills/fp-check/references/deep-verification.md +143 -0
- package/skills/fp-check/references/evidence-templates.md +91 -0
- package/skills/fp-check/references/false-positive-patterns.md +115 -0
- package/skills/fp-check/references/gate-reviews.md +27 -0
- package/skills/fp-check/references/standard-verification.md +78 -0
- package/skills/insecure-defaults/SKILL.md +117 -0
- package/skills/insecure-defaults/references/examples.md +409 -0
- package/skills/last30days/SKILL.md +444 -0
- package/skills/sarif-parsing/SKILL.md +483 -0
- package/skills/sarif-parsing/resources/jq-queries.md +162 -0
- package/skills/sarif-parsing/resources/sarif_helpers.py +331 -0
- package/skills/security-threat-model/LICENSE.txt +201 -0
- package/skills/security-threat-model/SKILL.md +81 -0
- package/skills/security-threat-model/agents/openai.yaml +4 -0
- package/skills/security-threat-model/references/prompt-template.md +255 -0
- package/skills/security-threat-model/references/security-controls-and-assets.md +32 -0
- package/skills/semgrep/SKILL.md +212 -0
- package/skills/semgrep/references/rulesets.md +162 -0
- package/skills/semgrep/references/scan-modes.md +110 -0
- package/skills/semgrep/references/scanner-task-prompt.md +140 -0
- package/skills/semgrep/scripts/merge_sarif.py +203 -0
- package/skills/semgrep/workflows/scan-workflow.md +311 -0
- package/skills/semgrep-rule-creator/SKILL.md +168 -0
- package/skills/semgrep-rule-creator/references/quick-reference.md +202 -0
- package/skills/semgrep-rule-creator/references/workflow.md +240 -0
- package/skills/semgrep-rule-variant-creator/SKILL.md +205 -0
- package/skills/semgrep-rule-variant-creator/references/applicability-analysis.md +250 -0
- package/skills/semgrep-rule-variant-creator/references/language-syntax-guide.md +324 -0
- package/skills/semgrep-rule-variant-creator/references/workflow.md +518 -0
- package/skills/sharp-edges/SKILL.md +292 -0
- package/skills/sharp-edges/references/auth-patterns.md +252 -0
- package/skills/sharp-edges/references/case-studies.md +274 -0
- package/skills/sharp-edges/references/config-patterns.md +333 -0
- package/skills/sharp-edges/references/crypto-apis.md +190 -0
- package/skills/sharp-edges/references/lang-c.md +205 -0
- package/skills/sharp-edges/references/lang-csharp.md +285 -0
- package/skills/sharp-edges/references/lang-go.md +270 -0
- package/skills/sharp-edges/references/lang-java.md +263 -0
- package/skills/sharp-edges/references/lang-javascript.md +269 -0
- package/skills/sharp-edges/references/lang-kotlin.md +265 -0
- package/skills/sharp-edges/references/lang-php.md +245 -0
- package/skills/sharp-edges/references/lang-python.md +274 -0
- package/skills/sharp-edges/references/lang-ruby.md +273 -0
- package/skills/sharp-edges/references/lang-rust.md +272 -0
- package/skills/sharp-edges/references/lang-swift.md +287 -0
- package/skills/sharp-edges/references/language-specific.md +588 -0
- package/skills/spec-to-code-compliance/SKILL.md +357 -0
- package/skills/spec-to-code-compliance/resources/COMPLETENESS_CHECKLIST.md +69 -0
- package/skills/spec-to-code-compliance/resources/IR_EXAMPLES.md +417 -0
- package/skills/spec-to-code-compliance/resources/OUTPUT_REQUIREMENTS.md +105 -0
- package/skills/supply-chain-risk-auditor/SKILL.md +67 -0
- package/skills/supply-chain-risk-auditor/resources/results-template.md +41 -0
- package/skills/variant-analysis/METHODOLOGY.md +327 -0
- package/skills/variant-analysis/SKILL.md +142 -0
- package/skills/variant-analysis/resources/codeql/cpp.ql +119 -0
- package/skills/variant-analysis/resources/codeql/go.ql +69 -0
- package/skills/variant-analysis/resources/codeql/java.ql +71 -0
- package/skills/variant-analysis/resources/codeql/javascript.ql +63 -0
- package/skills/variant-analysis/resources/codeql/python.ql +80 -0
- package/skills/variant-analysis/resources/semgrep/cpp.yaml +98 -0
- package/skills/variant-analysis/resources/semgrep/go.yaml +63 -0
- package/skills/variant-analysis/resources/semgrep/java.yaml +61 -0
- package/skills/variant-analysis/resources/semgrep/javascript.yaml +60 -0
- package/skills/variant-analysis/resources/semgrep/python.yaml +72 -0
- package/skills/variant-analysis/resources/variant-report-template.md +75 -0
- package/skills/vuln-report/SKILL.md +137 -0
- package/skills/vuln-report/agents/openai.yaml +4 -0
- package/skills/vuln-report/references/report-template.md +135 -0
- package/skills/wooyun-legacy/SKILL.md +367 -0
- package/skills/wooyun-legacy/references/bank-penetration.md +222 -0
- package/skills/wooyun-legacy/references/checklists/command-execution-checklist.md +119 -0
- package/skills/wooyun-legacy/references/checklists/csrf-checklist.md +74 -0
- package/skills/wooyun-legacy/references/checklists/file-upload-checklist.md +108 -0
- package/skills/wooyun-legacy/references/checklists/info-disclosure-checklist.md +114 -0
- package/skills/wooyun-legacy/references/checklists/logic-flaws-checklist.md +95 -0
- package/skills/wooyun-legacy/references/checklists/misconfig-checklist.md +124 -0
- package/skills/wooyun-legacy/references/checklists/path-traversal-checklist.md +87 -0
- package/skills/wooyun-legacy/references/checklists/rce-checklist.md +93 -0
- package/skills/wooyun-legacy/references/checklists/sql-injection-checklist.md +97 -0
- package/skills/wooyun-legacy/references/checklists/ssrf-checklist.md +99 -0
- package/skills/wooyun-legacy/references/checklists/unauthorized-access-checklist.md +89 -0
- package/skills/wooyun-legacy/references/checklists/weak-password-checklist.md +115 -0
- package/skills/wooyun-legacy/references/checklists/xss-checklist.md +103 -0
- package/skills/wooyun-legacy/references/checklists/xxe-checklist.md +130 -0
- package/skills/wooyun-legacy/references/info-disclosure.md +975 -0
- package/skills/wooyun-legacy/references/logic-flaws.md +721 -0
- package/skills/wooyun-legacy/references/path-traversal.md +1191 -0
- package/skills/wooyun-legacy/references/telecom-penetration.md +156 -0
- package/skills/wooyun-legacy/references/unauthorized-access.md +980 -0
- package/skills/wooyun-legacy/references/xss.md +746 -0
- package/skills/zeroize-audit/SKILL.md +371 -0
- package/skills/zeroize-audit/configs/c.yaml +21 -0
- package/skills/zeroize-audit/configs/default.yaml +128 -0
- package/skills/zeroize-audit/configs/rust.yaml +83 -0
- package/skills/zeroize-audit/prompts/report_template.md +238 -0
- package/skills/zeroize-audit/prompts/system.md +163 -0
- package/skills/zeroize-audit/prompts/task.md +97 -0
- package/skills/zeroize-audit/references/compile-commands.md +231 -0
- package/skills/zeroize-audit/references/detection-strategy.md +191 -0
- package/skills/zeroize-audit/references/ir-analysis.md +252 -0
- package/skills/zeroize-audit/references/mcp-analysis.md +221 -0
- package/skills/zeroize-audit/references/poc-generation.md +470 -0
- package/skills/zeroize-audit/references/rust-zeroization-patterns.md +867 -0
- package/skills/zeroize-audit/schemas/input.json +83 -0
- package/skills/zeroize-audit/schemas/output.json +140 -0
- package/skills/zeroize-audit/tools/analyze_asm.sh +202 -0
- package/skills/zeroize-audit/tools/analyze_cfg.py +381 -0
- package/skills/zeroize-audit/tools/analyze_heap.sh +211 -0
- package/skills/zeroize-audit/tools/analyze_ir_semantic.py +429 -0
- package/skills/zeroize-audit/tools/diff_ir.sh +135 -0
- package/skills/zeroize-audit/tools/diff_rust_mir.sh +189 -0
- package/skills/zeroize-audit/tools/emit_asm.sh +67 -0
- package/skills/zeroize-audit/tools/emit_ir.sh +77 -0
- package/skills/zeroize-audit/tools/emit_rust_asm.sh +178 -0
- package/skills/zeroize-audit/tools/emit_rust_ir.sh +150 -0
- package/skills/zeroize-audit/tools/emit_rust_mir.sh +158 -0
- package/skills/zeroize-audit/tools/extract_compile_flags.py +284 -0
- package/skills/zeroize-audit/tools/generate_poc.py +1329 -0
- package/skills/zeroize-audit/tools/mcp/apply_confidence_gates.py +113 -0
- package/skills/zeroize-audit/tools/mcp/check_mcp.sh +68 -0
- package/skills/zeroize-audit/tools/mcp/normalize_mcp_evidence.py +125 -0
- package/skills/zeroize-audit/tools/scripts/check_llvm_patterns.py +481 -0
- package/skills/zeroize-audit/tools/scripts/check_mir_patterns.py +554 -0
- package/skills/zeroize-audit/tools/scripts/check_rust_asm.py +424 -0
- package/skills/zeroize-audit/tools/scripts/check_rust_asm_aarch64.py +300 -0
- package/skills/zeroize-audit/tools/scripts/check_rust_asm_x86.py +283 -0
- package/skills/zeroize-audit/tools/scripts/find_dangerous_apis.py +375 -0
- package/skills/zeroize-audit/tools/scripts/semantic_audit.py +923 -0
- package/skills/zeroize-audit/tools/track_dataflow.sh +196 -0
- package/skills/zeroize-audit/tools/validate_rust_toolchain.sh +298 -0
- package/skills/zeroize-audit/workflows/phase-0-preflight.md +150 -0
- package/skills/zeroize-audit/workflows/phase-1-source-analysis.md +144 -0
- package/skills/zeroize-audit/workflows/phase-2-compiler-analysis.md +139 -0
- package/skills/zeroize-audit/workflows/phase-3-interim-report.md +46 -0
- package/skills/zeroize-audit/workflows/phase-4-poc-generation.md +46 -0
- package/skills/zeroize-audit/workflows/phase-5-poc-validation.md +136 -0
- package/skills/zeroize-audit/workflows/phase-6-final-report.md +44 -0
- package/skills/zeroize-audit/workflows/phase-7-test-generation.md +42 -0
- package/themes/piolium-srcery.json +94 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Phase 1 — MCP Resolution and Source Analysis
|
|
2
|
+
|
|
3
|
+
## Preconditions
|
|
4
|
+
|
|
5
|
+
- Phase 0 complete: `orchestrator-state.json` exists with `phases.0.status = "complete"`
|
|
6
|
+
- `{workdir}/preflight.json` exists
|
|
7
|
+
- `{workdir}/merged-config.yaml` exists
|
|
8
|
+
|
|
9
|
+
## Instructions
|
|
10
|
+
|
|
11
|
+
### Wave 1 — MCP Resolver
|
|
12
|
+
|
|
13
|
+
Skip if `mcp_mode=off` or `routing.mcp_available=false` or `language_mode=rust` (MCP is C/C++ only).
|
|
14
|
+
|
|
15
|
+
Write agent inputs to `{workdir}/agent-inputs/mcp-resolver.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"sensitive_candidates": "<from preflight.json sensitive_candidates>"
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Spawn agent `1-mcp-resolver` via `Task` with:
|
|
24
|
+
|
|
25
|
+
| Parameter | Value |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `workdir` | `{workdir}` |
|
|
28
|
+
| `repo_root` | `{{path}}` |
|
|
29
|
+
| `compile_db` | `{{compile_db}}` |
|
|
30
|
+
| `config_path` | `{workdir}/merged-config.yaml` |
|
|
31
|
+
| `input_file` | `{workdir}/agent-inputs/mcp-resolver.json` |
|
|
32
|
+
| `mcp_timeout_ms` | `{{mcp_timeout_ms}}` |
|
|
33
|
+
|
|
34
|
+
**After completion**: Read `{workdir}/mcp-evidence/status.json`.
|
|
35
|
+
|
|
36
|
+
- If `status=failed` and `mcp_mode=require`: **stop the run**.
|
|
37
|
+
- If `status=failed` and `mcp_mode=prefer`: set `mcp_available=false`.
|
|
38
|
+
- If `status=partial` or `status=success`: set `mcp_available=true`.
|
|
39
|
+
|
|
40
|
+
### Wave 2a — Source Analyzer (C/C++ only)
|
|
41
|
+
|
|
42
|
+
Skip if `language_mode=rust`.
|
|
43
|
+
|
|
44
|
+
Write agent inputs to `{workdir}/agent-inputs/source-analyzer.json`:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"tu_list": "<from preflight.json tu_list>"
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Spawn agent `2-source-analyzer` via `Task` **in the same message as Wave 2b** (parallel launch):
|
|
53
|
+
|
|
54
|
+
| Parameter | Value |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `workdir` | `{workdir}` |
|
|
57
|
+
| `repo_root` | `{{path}}` |
|
|
58
|
+
| `compile_db` | `{{compile_db}}` |
|
|
59
|
+
| `config_path` | `{workdir}/merged-config.yaml` |
|
|
60
|
+
| `input_file` | `{workdir}/agent-inputs/source-analyzer.json` |
|
|
61
|
+
| `mcp_available` | Result from Wave 1 |
|
|
62
|
+
| `languages` | `{{languages}}` |
|
|
63
|
+
| `max_tus` | `{{max_tus}}` |
|
|
64
|
+
|
|
65
|
+
### Wave 2b — Rust Source Analyzer (Rust only)
|
|
66
|
+
|
|
67
|
+
Skip if `language_mode=c`.
|
|
68
|
+
|
|
69
|
+
Spawn agent `2b-rust-source-analyzer` via `Task` **in the same message as Wave 2a** (parallel launch):
|
|
70
|
+
|
|
71
|
+
| Parameter | Value |
|
|
72
|
+
|---|---|
|
|
73
|
+
| `workdir` | `{workdir}` |
|
|
74
|
+
| `repo_root` | `{{path}}` |
|
|
75
|
+
| `cargo_manifest` | `{{cargo_manifest}}` |
|
|
76
|
+
| `rust_crate_root` | From `preflight.json` |
|
|
77
|
+
| `rust_tu_hash` | From `preflight.json` |
|
|
78
|
+
| `config_path` | `{workdir}/merged-config.yaml` |
|
|
79
|
+
| `baseDir` | `{baseDir}` |
|
|
80
|
+
|
|
81
|
+
The `2b-rust-source-analyzer` agent must:
|
|
82
|
+
|
|
83
|
+
1. Attempt rustdoc JSON generation:
|
|
84
|
+
```bash
|
|
85
|
+
cargo +nightly rustdoc --manifest-path <cargo_manifest> \
|
|
86
|
+
--document-private-items -- -Z unstable-options --output-format json
|
|
87
|
+
```
|
|
88
|
+
If this fails, warn and skip — proceed with source grep only.
|
|
89
|
+
2. Run semantic audit (if rustdoc JSON succeeded):
|
|
90
|
+
```bash
|
|
91
|
+
uv run {baseDir}/tools/scripts/semantic_audit.py \
|
|
92
|
+
--rustdoc target/doc/<crate>.json \
|
|
93
|
+
--cargo-toml <cargo_manifest> \
|
|
94
|
+
--out {workdir}/source-analysis/rust-semantic-findings.json
|
|
95
|
+
```
|
|
96
|
+
3. Run dangerous API scan:
|
|
97
|
+
```bash
|
|
98
|
+
uv run {baseDir}/tools/scripts/find_dangerous_apis.py \
|
|
99
|
+
--src <rust_crate_root>/src \
|
|
100
|
+
--out {workdir}/source-analysis/rust-dangerous-api-findings.json
|
|
101
|
+
```
|
|
102
|
+
4. Merge outputs into `{workdir}/source-analysis/sensitive-objects.json` (Rust `SO-NNNN` IDs with offset 5000+), `{workdir}/source-analysis/source-findings.json` (IDs `F-RUST-SRC-NNNN`), and `{workdir}/source-analysis/tu-map.json` (adding `{"<cargo_manifest>": "<rust_tu_hash>"}`).
|
|
103
|
+
5. Write `{workdir}/source-analysis/rust-notes.md` summarizing findings and any skipped steps.
|
|
104
|
+
|
|
105
|
+
**After both Wave 2a and Wave 2b complete**: Read `{workdir}/source-analysis/tu-map.json`.
|
|
106
|
+
|
|
107
|
+
- If empty (`{}`): no sensitive objects found. Skip to Phase 6 (empty report).
|
|
108
|
+
- Determine entry classes in `tu-map.json`:
|
|
109
|
+
- **C/C++ entry**: key is a source file path from `compile_commands.json` (typically `.c`, `.cc`, `.cpp`, `.cxx`).
|
|
110
|
+
- **Rust entry**: key is the `cargo_manifest` path (`.../Cargo.toml`).
|
|
111
|
+
- If no C/C++ entries: skip Wave 3 in Phase 2.
|
|
112
|
+
- If no Rust entry: skip Wave 3R in Phase 2.
|
|
113
|
+
- Otherwise: proceed to Phase 2.
|
|
114
|
+
|
|
115
|
+
## State Update
|
|
116
|
+
|
|
117
|
+
Update `orchestrator-state.json`:
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"current_phase": 1,
|
|
122
|
+
"routing": {
|
|
123
|
+
"mcp_available": "<updated value>",
|
|
124
|
+
"tu_count": "<count of TUs in tu-map.json>"
|
|
125
|
+
},
|
|
126
|
+
"phases": {
|
|
127
|
+
"1": {"status": "complete", "output": "source-analysis/tu-map.json"}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Error Handling
|
|
133
|
+
|
|
134
|
+
| Failure | Behavior |
|
|
135
|
+
|---|---|
|
|
136
|
+
| MCP resolver fails + `mcp_mode=require` | Stop the run |
|
|
137
|
+
| MCP resolver fails + `mcp_mode=prefer` | Continue with `mcp_available=false` |
|
|
138
|
+
| Source analyzer (C/C++) fails | Stop C/C++ analysis — no sensitive object list for C/C++ TUs |
|
|
139
|
+
| Rust source analyzer fails | Stop Rust analysis — log failure, continue if C/C++ analysis is also running |
|
|
140
|
+
| No sensitive objects found | Skip Phases 2–5, jump to Phase 6 for empty report |
|
|
141
|
+
|
|
142
|
+
## Next Phase
|
|
143
|
+
|
|
144
|
+
Phase 2 — Compiler Analysis (if `tu-map.json` is non-empty)
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Phase 2 — Compiler Analysis
|
|
2
|
+
|
|
3
|
+
## Preconditions
|
|
4
|
+
|
|
5
|
+
- Phase 1 complete: `tu-map.json` is non-empty
|
|
6
|
+
- `{workdir}/source-analysis/sensitive-objects.json` exists
|
|
7
|
+
- `{workdir}/source-analysis/source-findings.json` exists
|
|
8
|
+
|
|
9
|
+
## Instructions
|
|
10
|
+
|
|
11
|
+
### Wave 3 — TU Compiler Analyzers (C/C++ only, N parallel)
|
|
12
|
+
|
|
13
|
+
Skip if `language_mode=rust` or `tu-map.json` has no C/C++ entries.
|
|
14
|
+
|
|
15
|
+
For each C/C++ TU in `{workdir}/source-analysis/tu-map.json`:
|
|
16
|
+
|
|
17
|
+
1. Create output directory:
|
|
18
|
+
```bash
|
|
19
|
+
mkdir -p {workdir}/compiler-analysis/<tu_hash>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
2. Write per-TU agent input to `{workdir}/agent-inputs/tu-<tu_hash>.json`:
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"sensitive_objects": "<subset of sensitive-objects.json matching this TU>",
|
|
26
|
+
"source_findings": "<subset of source-findings.json matching this TU>"
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
3. Spawn agent `3-tu-compiler-analyzer` via `Task` with:
|
|
31
|
+
|
|
32
|
+
| Parameter | Value |
|
|
33
|
+
|---|---|
|
|
34
|
+
| `workdir` | `{workdir}` |
|
|
35
|
+
| `tu_source` | Source file path (from tu-map key) |
|
|
36
|
+
| `tu_hash` | TU hash (from tu-map value) |
|
|
37
|
+
| `compile_db` | `{{compile_db}}` |
|
|
38
|
+
| `config_path` | `{workdir}/merged-config.yaml` |
|
|
39
|
+
| `input_file` | `{workdir}/agent-inputs/tu-<tu_hash>.json` |
|
|
40
|
+
| `opt_levels` | `{{opt_levels}}` |
|
|
41
|
+
| `enable_asm` | `{{enable_asm}}` |
|
|
42
|
+
| `enable_semantic_ir` | `{{enable_semantic_ir}}` |
|
|
43
|
+
| `enable_cfg` | `{{enable_cfg}}` |
|
|
44
|
+
| `baseDir` | `{baseDir}` |
|
|
45
|
+
|
|
46
|
+
Launch TU agents in parallel using multiple `Task` calls in a single message. **Batching**: if the TU count exceeds 15, launch in batches of 10–15; wait for each batch before launching the next.
|
|
47
|
+
|
|
48
|
+
**After all TU agents complete**: Verify `{workdir}/compiler-analysis/<tu_hash>/ir-findings.json` exists for each TU. Log any failed TUs but continue.
|
|
49
|
+
|
|
50
|
+
### Wave 3R — Rust Compiler Analyzer (single agent)
|
|
51
|
+
|
|
52
|
+
Skip if any of the following are true:
|
|
53
|
+
- `language_mode=c`
|
|
54
|
+
- `tu-map.json` has no Rust entry (manifest key `.../Cargo.toml`)
|
|
55
|
+
- `sensitive-objects.json` is missing or empty
|
|
56
|
+
- `sensitive-objects.json` has no Rust objects (IDs `SO-5NNN` / `SO-5000+`)
|
|
57
|
+
|
|
58
|
+
Spawn agent `3b-rust-compiler-analyzer` via `Task` (after Wave 3 completes or is skipped):
|
|
59
|
+
|
|
60
|
+
| Parameter | Value |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `workdir` | `{workdir}` |
|
|
63
|
+
| `cargo_manifest` | `{{cargo_manifest}}` |
|
|
64
|
+
| `rust_crate_root` | From `preflight.json` |
|
|
65
|
+
| `rust_tu_hash` | From `preflight.json` |
|
|
66
|
+
| `config_path` | `{workdir}/merged-config.yaml` |
|
|
67
|
+
| `opt_levels` | `{{opt_levels}}` |
|
|
68
|
+
| `enable_asm` | `{{enable_asm}}` |
|
|
69
|
+
| `input_file` | `{workdir}/agent-inputs/rust-compiler.json` (write Rust-subset of sensitive-objects and source-findings before spawn) |
|
|
70
|
+
| `baseDir` | `{baseDir}` |
|
|
71
|
+
|
|
72
|
+
The `3b-rust-compiler-analyzer` agent must run these steps in order. On step failures, write status-bearing error objects to the affected output file(s) and continue.
|
|
73
|
+
|
|
74
|
+
**Step A — MIR analysis:**
|
|
75
|
+
```bash
|
|
76
|
+
{baseDir}/tools/emit_rust_mir.sh --manifest <cargo_manifest> --lib --opt O0 \
|
|
77
|
+
--out {workdir}/rust-compiler-analysis/<rust_tu_hash>.mir
|
|
78
|
+
uv run {baseDir}/tools/scripts/check_mir_patterns.py \
|
|
79
|
+
--mir {workdir}/rust-compiler-analysis/<rust_tu_hash>.mir \
|
|
80
|
+
--secrets {workdir}/source-analysis/sensitive-objects.json \
|
|
81
|
+
--out {workdir}/rust-compiler-analysis/mir-findings.json
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Step B — LLVM IR analysis (O0 vs O2):**
|
|
85
|
+
```bash
|
|
86
|
+
{baseDir}/tools/emit_rust_ir.sh --manifest <cargo_manifest> --lib --opt O0 \
|
|
87
|
+
--out {workdir}/rust-compiler-analysis/<rust_tu_hash>.O0.ll
|
|
88
|
+
{baseDir}/tools/emit_rust_ir.sh --manifest <cargo_manifest> --lib --opt O2 \
|
|
89
|
+
--out {workdir}/rust-compiler-analysis/<rust_tu_hash>.O2.ll
|
|
90
|
+
uv run {baseDir}/tools/scripts/check_llvm_patterns.py \
|
|
91
|
+
--o0 {workdir}/rust-compiler-analysis/<rust_tu_hash>.O0.ll \
|
|
92
|
+
--o2 {workdir}/rust-compiler-analysis/<rust_tu_hash>.O2.ll \
|
|
93
|
+
--out {workdir}/rust-compiler-analysis/ir-findings.json
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Step C — Assembly analysis** (skip if `enable_asm=false` or `emit_rust_asm.sh` missing):
|
|
97
|
+
```bash
|
|
98
|
+
{baseDir}/tools/emit_rust_asm.sh --manifest <cargo_manifest> --lib --opt O2 \
|
|
99
|
+
--out {workdir}/rust-compiler-analysis/<rust_tu_hash>.O2.s
|
|
100
|
+
uv run {baseDir}/tools/scripts/check_rust_asm.py \
|
|
101
|
+
--asm {workdir}/rust-compiler-analysis/<rust_tu_hash>.O2.s \
|
|
102
|
+
--secrets {workdir}/source-analysis/sensitive-objects.json \
|
|
103
|
+
--out {workdir}/rust-compiler-analysis/asm-findings.json
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
If assembly tools are missing, write `[]` to `asm-findings.json`.
|
|
107
|
+
|
|
108
|
+
IR finding IDs: `F-RUST-IR-NNNN`. MIR finding IDs: `F-RUST-MIR-NNNN`. Assembly finding IDs: `F-RUST-ASM-NNNN`.
|
|
109
|
+
|
|
110
|
+
Write `{workdir}/rust-compiler-analysis/notes.md` summarizing all steps, any failures, and key observations.
|
|
111
|
+
|
|
112
|
+
**After Wave 3R completes**: Verify `mir-findings.json`, `ir-findings.json`, and `asm-findings.json` exist under `{workdir}/rust-compiler-analysis/`. Log if missing, continue.
|
|
113
|
+
|
|
114
|
+
## State Update
|
|
115
|
+
|
|
116
|
+
Update `orchestrator-state.json`:
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"current_phase": 2,
|
|
121
|
+
"phases": {
|
|
122
|
+
"2": {"status": "complete", "tus_succeeded": "<N>", "tus_failed": "<N>"}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Error Handling
|
|
128
|
+
|
|
129
|
+
| Failure | Behavior |
|
|
130
|
+
|---|---|
|
|
131
|
+
| One TU agent (C/C++) fails | Continue with remaining TUs |
|
|
132
|
+
| All TU agents (C/C++) fail | Proceed — report assembler produces source-only report |
|
|
133
|
+
| Rust compiler analyzer (Wave 3R) fails | Log failure, continue — report assembler handles missing `rust-compiler-analysis/` |
|
|
134
|
+
| `emit_rust_asm.sh` missing | Write `[]` to `asm-findings.json`, continue — assembly findings skipped |
|
|
135
|
+
| MIR or IR emission fails | Write `[]` to that step's output, continue with remaining steps |
|
|
136
|
+
|
|
137
|
+
## Next Phase
|
|
138
|
+
|
|
139
|
+
Phase 3 — Interim Report
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Phase 3 — Interim Finding Collection
|
|
2
|
+
|
|
3
|
+
## Preconditions
|
|
4
|
+
|
|
5
|
+
- Phase 2 complete (or skipped if no compiler analysis needed)
|
|
6
|
+
|
|
7
|
+
## Instructions
|
|
8
|
+
|
|
9
|
+
Spawn agent `4-report-composer` via `Task` with:
|
|
10
|
+
|
|
11
|
+
| Parameter | Value |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `workdir` | `{workdir}` |
|
|
14
|
+
| `config_path` | `{workdir}/merged-config.yaml` |
|
|
15
|
+
| `mcp_available` | From `orchestrator-state.json` routing |
|
|
16
|
+
| `mcp_required_for_advanced` | `{{mcp_required_for_advanced}}` |
|
|
17
|
+
| `baseDir` | `{baseDir}` |
|
|
18
|
+
| `mode` | `interim` |
|
|
19
|
+
|
|
20
|
+
**After completion**: Verify `{workdir}/report/findings.json` exists. Count findings. If the findings array is empty, skip to Phase 6 for an empty report.
|
|
21
|
+
|
|
22
|
+
## State Update
|
|
23
|
+
|
|
24
|
+
Update `orchestrator-state.json`:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"current_phase": 3,
|
|
29
|
+
"routing": {
|
|
30
|
+
"finding_count": "<count from findings.json>"
|
|
31
|
+
},
|
|
32
|
+
"phases": {
|
|
33
|
+
"3": {"status": "complete", "output": "report/findings.json"}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Error Handling
|
|
39
|
+
|
|
40
|
+
| Failure | Behavior |
|
|
41
|
+
|---|---|
|
|
42
|
+
| Report assembler fails | Surface error to user |
|
|
43
|
+
|
|
44
|
+
## Next Phase
|
|
45
|
+
|
|
46
|
+
Phase 4 — PoC Generation (if `finding_count > 0`)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Phase 4 — PoC Generation
|
|
2
|
+
|
|
3
|
+
## Preconditions
|
|
4
|
+
|
|
5
|
+
- Phase 3 complete: `{workdir}/report/findings.json` exists with at least one finding
|
|
6
|
+
|
|
7
|
+
## Instructions
|
|
8
|
+
|
|
9
|
+
Spawn agent `5-poc-generator` via `Task` with:
|
|
10
|
+
|
|
11
|
+
| Parameter | Value |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `workdir` | `{workdir}` |
|
|
14
|
+
| `compile_db` | `{{compile_db}}` |
|
|
15
|
+
| `config_path` | `{workdir}/merged-config.yaml` |
|
|
16
|
+
| `final_report` | `{workdir}/report/findings.json` |
|
|
17
|
+
| `poc_categories` | `{{poc_categories}}` |
|
|
18
|
+
| `poc_output_dir` | `{{poc_output_dir}}` or `{workdir}/poc/` |
|
|
19
|
+
| `baseDir` | `{baseDir}` |
|
|
20
|
+
|
|
21
|
+
The agent reads each finding and the corresponding source code, then crafts a bespoke PoC program tailored to the specific vulnerability. Each PoC is individually written — not generated from templates.
|
|
22
|
+
|
|
23
|
+
**After completion**: Verify `{workdir}/poc/poc_manifest.json` exists and contains an entry for each finding.
|
|
24
|
+
|
|
25
|
+
## State Update
|
|
26
|
+
|
|
27
|
+
Update `orchestrator-state.json`:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"current_phase": 4,
|
|
32
|
+
"phases": {
|
|
33
|
+
"4": {"status": "complete", "output": "poc/poc_manifest.json"}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Error Handling
|
|
39
|
+
|
|
40
|
+
| Failure | Behavior |
|
|
41
|
+
|---|---|
|
|
42
|
+
| PoC generator fails | Pipeline stalls — surface error to user |
|
|
43
|
+
|
|
44
|
+
## Next Phase
|
|
45
|
+
|
|
46
|
+
Phase 5 — PoC Validation & Verification
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Phase 5 — PoC Validation & Verification
|
|
2
|
+
|
|
3
|
+
## Preconditions
|
|
4
|
+
|
|
5
|
+
- Phase 4 complete: `{workdir}/poc/poc_manifest.json` exists
|
|
6
|
+
|
|
7
|
+
## Instructions
|
|
8
|
+
|
|
9
|
+
### Step 5a — Compile and Run All PoCs (agent)
|
|
10
|
+
|
|
11
|
+
Spawn agent `5b-poc-validator` via `Task` with:
|
|
12
|
+
|
|
13
|
+
| Parameter | Value |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `workdir` | `{workdir}` |
|
|
16
|
+
| `config_path` | `{workdir}/merged-config.yaml` |
|
|
17
|
+
|
|
18
|
+
**After completion**: Read `{workdir}/poc/poc_validation_results.json`.
|
|
19
|
+
|
|
20
|
+
If the agent fails, fall back to compiling and running PoCs inline:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
cd {workdir}/poc && make <makefile_target>
|
|
24
|
+
./<makefile_target>
|
|
25
|
+
echo "Exit code: $?"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Step 5b — Verify PoCs Prove Their Claims (agent)
|
|
29
|
+
|
|
30
|
+
Spawn agent `5c-poc-verifier` via `Task` with:
|
|
31
|
+
|
|
32
|
+
| Parameter | Value |
|
|
33
|
+
|---|---|
|
|
34
|
+
| `workdir` | `{workdir}` |
|
|
35
|
+
| `config_path` | `{workdir}/merged-config.yaml` |
|
|
36
|
+
| `validation_results` | `{workdir}/poc/poc_validation_results.json` |
|
|
37
|
+
|
|
38
|
+
The verifier reads each PoC source file, the corresponding finding, and the original source code to check that the PoC actually tests the claimed vulnerability. It verifies:
|
|
39
|
+
- Target variable and function match the finding
|
|
40
|
+
- Verification technique is appropriate for the finding category
|
|
41
|
+
- Optimization level is correct
|
|
42
|
+
- Exit code interpretation is not inverted
|
|
43
|
+
- Results are plausible given the finding evidence
|
|
44
|
+
|
|
45
|
+
**After completion**: Read `{workdir}/poc/poc_verification.json`.
|
|
46
|
+
|
|
47
|
+
### Step 5c — Present Verification Failures to User
|
|
48
|
+
|
|
49
|
+
Read `{workdir}/poc/poc_verification.json`. For any PoC with `verified: false`:
|
|
50
|
+
|
|
51
|
+
1. Use `Read` to show the PoC source file.
|
|
52
|
+
2. Present to the user via `AskUserQuestion` with:
|
|
53
|
+
- Finding ID and category
|
|
54
|
+
- PoC file path
|
|
55
|
+
- Which verification checks failed and why
|
|
56
|
+
- The verifier's notes
|
|
57
|
+
- The PoC's runtime result (from `poc_validation_results.json`)
|
|
58
|
+
|
|
59
|
+
3. Ask the user whether to:
|
|
60
|
+
- **Accept anyway**: Trust the PoC result despite verification failure
|
|
61
|
+
- **Reject**: Discard the PoC result (treat as `no_poc` for this finding)
|
|
62
|
+
|
|
63
|
+
**Block until the user responds for each failed PoC.**
|
|
64
|
+
|
|
65
|
+
### Step 5d — Merge Results
|
|
66
|
+
|
|
67
|
+
Combine validation results (from `poc_validation_results.json`), verification results (from `poc_verification.json`), and user decisions (from Step 5c).
|
|
68
|
+
|
|
69
|
+
Write `{workdir}/poc/poc_final_results.json`:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"timestamp": "<ISO-8601>",
|
|
74
|
+
"results": [
|
|
75
|
+
{
|
|
76
|
+
"finding_id": "ZA-0001",
|
|
77
|
+
"category": "MISSING_SOURCE_ZEROIZE",
|
|
78
|
+
"poc_file": "poc_za_0001_missing_source_zeroize.c",
|
|
79
|
+
"compile_success": true,
|
|
80
|
+
"exit_code": 0,
|
|
81
|
+
"validation_result": "exploitable",
|
|
82
|
+
"verification": {
|
|
83
|
+
"verified": true,
|
|
84
|
+
"checks": { "...": "pass" },
|
|
85
|
+
"notes": "PoC correctly targets session_key in handle_key()"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"finding_id": "ZA-0003",
|
|
90
|
+
"category": "OPTIMIZED_AWAY_ZEROIZE",
|
|
91
|
+
"poc_file": "poc_za_0003_optimized_away_zeroize.c",
|
|
92
|
+
"compile_success": true,
|
|
93
|
+
"exit_code": 1,
|
|
94
|
+
"validation_result": "rejected",
|
|
95
|
+
"verification": {
|
|
96
|
+
"verified": false,
|
|
97
|
+
"checks": { "optimization_level": "fail" },
|
|
98
|
+
"notes": "Compiled at -O0 but wipe disappears at -O2. User rejected PoC result."
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Validation result mapping:
|
|
106
|
+
|
|
107
|
+
- `compile_success=true, exit_code=0, verified=true` → `"exploitable"`
|
|
108
|
+
- `compile_success=true, exit_code=1, verified=true` → `"not_exploitable"`
|
|
109
|
+
- `compile_success=true, verified=false, user accepted` → original result (`"exploitable"` or `"not_exploitable"`)
|
|
110
|
+
- `compile_success=true, verified=false, user rejected` → `"rejected"`
|
|
111
|
+
- `compile_success=false` → `"compile_failure"`
|
|
112
|
+
|
|
113
|
+
## State Update
|
|
114
|
+
|
|
115
|
+
Update `orchestrator-state.json`:
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"current_phase": 5,
|
|
120
|
+
"phases": {
|
|
121
|
+
"5": {"status": "complete", "output": "poc/poc_final_results.json"}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Error Handling
|
|
127
|
+
|
|
128
|
+
| Failure | Behavior |
|
|
129
|
+
|---|---|
|
|
130
|
+
| Validator agent fails | Fall back to inline compilation for all PoCs |
|
|
131
|
+
| Verifier agent fails | Skip verification, use validation results only (warn in report) |
|
|
132
|
+
| Individual PoC compile failure | Record in results, continue with others |
|
|
133
|
+
|
|
134
|
+
## Next Phase
|
|
135
|
+
|
|
136
|
+
Phase 6 — Final Report
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Phase 6 — Report Finalization
|
|
2
|
+
|
|
3
|
+
## Preconditions
|
|
4
|
+
|
|
5
|
+
- Phase 5 complete (or skipped if zero findings): `poc_final_results.json` exists or findings are empty
|
|
6
|
+
|
|
7
|
+
## Instructions
|
|
8
|
+
|
|
9
|
+
Spawn agent `4-report-composer` via `Task` with:
|
|
10
|
+
|
|
11
|
+
| Parameter | Value |
|
|
12
|
+
|---|---|
|
|
13
|
+
| `workdir` | `{workdir}` |
|
|
14
|
+
| `config_path` | `{workdir}/merged-config.yaml` |
|
|
15
|
+
| `mcp_available` | From `orchestrator-state.json` routing |
|
|
16
|
+
| `mcp_required_for_advanced` | `{{mcp_required_for_advanced}}` |
|
|
17
|
+
| `baseDir` | `{baseDir}` |
|
|
18
|
+
| `mode` | `final` |
|
|
19
|
+
| `poc_results` | `{workdir}/poc/poc_final_results.json` |
|
|
20
|
+
|
|
21
|
+
**After completion**: Verify `{workdir}/report/final-report.md` and updated `{workdir}/report/findings.json` exist.
|
|
22
|
+
|
|
23
|
+
## State Update
|
|
24
|
+
|
|
25
|
+
Update `orchestrator-state.json`:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"current_phase": 6,
|
|
30
|
+
"phases": {
|
|
31
|
+
"6": {"status": "complete", "output": "report/final-report.md"}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Error Handling
|
|
37
|
+
|
|
38
|
+
| Failure | Behavior |
|
|
39
|
+
|---|---|
|
|
40
|
+
| Report assembler fails | Surface error to user |
|
|
41
|
+
|
|
42
|
+
## Next Phase
|
|
43
|
+
|
|
44
|
+
Phase 7 — Test Generation (if `enable_runtime_tests=true` and `finding_count > 0`)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Phase 7 — Test Generation
|
|
2
|
+
|
|
3
|
+
## Preconditions
|
|
4
|
+
|
|
5
|
+
- Phase 6 complete
|
|
6
|
+
- `enable_runtime_tests=true`
|
|
7
|
+
- Finding count > 0
|
|
8
|
+
|
|
9
|
+
## Instructions
|
|
10
|
+
|
|
11
|
+
Spawn agent `6-test-generator` via `Task` with:
|
|
12
|
+
|
|
13
|
+
| Parameter | Value |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `workdir` | `{workdir}` |
|
|
16
|
+
| `compile_db` | `{{compile_db}}` |
|
|
17
|
+
| `config_path` | `{workdir}/merged-config.yaml` |
|
|
18
|
+
| `final_report` | `{workdir}/report/findings.json` |
|
|
19
|
+
| `baseDir` | `{baseDir}` |
|
|
20
|
+
|
|
21
|
+
## State Update
|
|
22
|
+
|
|
23
|
+
Update `orchestrator-state.json`:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"current_phase": 7,
|
|
28
|
+
"phases": {
|
|
29
|
+
"7": {"status": "complete", "output": "tests/"}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Error Handling
|
|
35
|
+
|
|
36
|
+
| Failure | Behavior |
|
|
37
|
+
|---|---|
|
|
38
|
+
| Test generator fails | Report is still available without tests |
|
|
39
|
+
|
|
40
|
+
## Next Phase
|
|
41
|
+
|
|
42
|
+
Phase 8 — Return Results (handled inline by dispatcher)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/badlogic/pi-mono/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
3
|
+
"name": "piolium-srcery",
|
|
4
|
+
"vars": {
|
|
5
|
+
"bg": "#1c1b19",
|
|
6
|
+
"fg": "#fce8c3",
|
|
7
|
+
"black": "#1c1b19",
|
|
8
|
+
"red": "#ef2f27",
|
|
9
|
+
"green": "#519f50",
|
|
10
|
+
"yellow": "#fbb829",
|
|
11
|
+
"blue": "#2c78bf",
|
|
12
|
+
"magenta": "#e02c6d",
|
|
13
|
+
"cyan": "#0aaeb3",
|
|
14
|
+
"white": "#baa67f",
|
|
15
|
+
"brblack": "#918175",
|
|
16
|
+
"brred": "#f75341",
|
|
17
|
+
"brgreen": "#98bc37",
|
|
18
|
+
"bryellow": "#fed06e",
|
|
19
|
+
"brblue": "#68a8e4",
|
|
20
|
+
"brmagenta": "#ff5c8f",
|
|
21
|
+
"brcyan": "#2be4d0",
|
|
22
|
+
"brwhite": "#fce8c3",
|
|
23
|
+
"selectedBg": "#3a3328",
|
|
24
|
+
"userMsgBg": "#26231f",
|
|
25
|
+
"customMsgBg": "#24211e",
|
|
26
|
+
"toolPendingBg": "#24231f",
|
|
27
|
+
"toolSuccessBg": "#1f2a1d",
|
|
28
|
+
"toolErrorBg": "#2f1d1b"
|
|
29
|
+
},
|
|
30
|
+
"colors": {
|
|
31
|
+
"accent": "yellow",
|
|
32
|
+
"border": "blue",
|
|
33
|
+
"borderAccent": "cyan",
|
|
34
|
+
"borderMuted": "brblack",
|
|
35
|
+
"success": "brgreen",
|
|
36
|
+
"error": "red",
|
|
37
|
+
"warning": "bryellow",
|
|
38
|
+
"muted": "white",
|
|
39
|
+
"dim": "brblack",
|
|
40
|
+
"text": "fg",
|
|
41
|
+
"thinkingText": "white",
|
|
42
|
+
|
|
43
|
+
"selectedBg": "selectedBg",
|
|
44
|
+
"userMessageBg": "userMsgBg",
|
|
45
|
+
"userMessageText": "fg",
|
|
46
|
+
"customMessageBg": "customMsgBg",
|
|
47
|
+
"customMessageText": "fg",
|
|
48
|
+
"customMessageLabel": "yellow",
|
|
49
|
+
"toolPendingBg": "toolPendingBg",
|
|
50
|
+
"toolSuccessBg": "toolSuccessBg",
|
|
51
|
+
"toolErrorBg": "toolErrorBg",
|
|
52
|
+
"toolTitle": "brcyan",
|
|
53
|
+
"toolOutput": "white",
|
|
54
|
+
|
|
55
|
+
"mdHeading": "bryellow",
|
|
56
|
+
"mdLink": "brblue",
|
|
57
|
+
"mdLinkUrl": "white",
|
|
58
|
+
"mdCode": "brcyan",
|
|
59
|
+
"mdCodeBlock": "fg",
|
|
60
|
+
"mdCodeBlockBorder": "brblack",
|
|
61
|
+
"mdQuote": "white",
|
|
62
|
+
"mdQuoteBorder": "brblack",
|
|
63
|
+
"mdHr": "brblack",
|
|
64
|
+
"mdListBullet": "yellow",
|
|
65
|
+
|
|
66
|
+
"toolDiffAdded": "brgreen",
|
|
67
|
+
"toolDiffRemoved": "brred",
|
|
68
|
+
"toolDiffContext": "white",
|
|
69
|
+
|
|
70
|
+
"syntaxComment": "brblack",
|
|
71
|
+
"syntaxKeyword": "magenta",
|
|
72
|
+
"syntaxFunction": "brblue",
|
|
73
|
+
"syntaxVariable": "fg",
|
|
74
|
+
"syntaxString": "brgreen",
|
|
75
|
+
"syntaxNumber": "bryellow",
|
|
76
|
+
"syntaxType": "brcyan",
|
|
77
|
+
"syntaxOperator": "yellow",
|
|
78
|
+
"syntaxPunctuation": "white",
|
|
79
|
+
|
|
80
|
+
"thinkingOff": "brblack",
|
|
81
|
+
"thinkingMinimal": "white",
|
|
82
|
+
"thinkingLow": "blue",
|
|
83
|
+
"thinkingMedium": "cyan",
|
|
84
|
+
"thinkingHigh": "brblue",
|
|
85
|
+
"thinkingXhigh": "brblue",
|
|
86
|
+
|
|
87
|
+
"bashMode": "yellow"
|
|
88
|
+
},
|
|
89
|
+
"export": {
|
|
90
|
+
"pageBg": "#1c1b19",
|
|
91
|
+
"cardBg": "#24211e",
|
|
92
|
+
"infoBg": "#3a3328"
|
|
93
|
+
}
|
|
94
|
+
}
|