@xaccefy/pi-casefile 0.8.2 → 0.9.0
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/README.md +4 -3
- package/package.json +3 -5
- package/skills/casefile/SKILL.md +4 -3
- package/src/index.ts +294 -225
- package/src/ledger.ts +591 -396
- package/src/pipeline-submit.ts +279 -26
- package/src/poc-runner.ts +186 -65
- package/src/scratchpad.ts +106 -16
- package/src/workflow.ts +79 -16
package/README.md
CHANGED
|
@@ -44,8 +44,8 @@ hypothesis → investigating → confirmed → reported
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
- **investigating** needs `evidence` + `confidence`
|
|
47
|
-
- **confirmed** only
|
|
48
|
-
- **
|
|
47
|
+
- **confirmed** only through the two-phase gate — `PromoteFinding` (evidence bundle: PoC 2× target + 1× same-script control, every run completing with nonce-bound `evidence.json`; machine-checks nonce binding, determinism, target/control differential) → confirmer subagent verdict → `ConfirmFinding` (CONFIRMED requires re_executed + target_only + disconfirmation_attempt). You can't just set status to confirmed, and markers/exit codes are diagnostics. Promotion additionally requires an EvidenceAdd `observation` item (the initial signal) — the ledger rejects a `confirmed` with no evidence chain.
|
|
48
|
+
- **Every promotion requires `control_path`** (the same bytes as the PoC — sha256 enforced) and a distinct `control_target`; a run whose control evidence matches the target's is blocked as not-target-dependent. The control run is stored as `controlVerified`. Runs that **crash** (killed / timeout / spawn error / missing evidence.json) are blocked too: a crash is not a verdict.
|
|
49
49
|
- **New cases require `disproveIf`** — falsification conditions (what would disprove this hypothesis). A hypothesis that can't say what kills it isn't one yet.
|
|
50
50
|
- **A kill must be justified**: either an EvidenceAdd `refutation` item, or a kill-reason token (intended_behavior, duplicate, framework_protection, out_of_scope, skeptic-disproven, no_attack_path, ...) in assumptions/nextStep. Bare `status: "killed"` is rejected.
|
|
51
51
|
- **reported** needs `CaseContext` first (records the report path; the report writer produces the final file)
|
|
@@ -62,7 +62,8 @@ hypothesis → investigating → confirmed → reported
|
|
|
62
62
|
| `CaseAdd` | Open a case (`title` + `disproveIf` required; start as `hypothesis` or `investigating`) |
|
|
63
63
|
| `CaseUpdate` | Evidence, impact, severity, status (not direct confirm) |
|
|
64
64
|
| `EvidenceAdd` | Role-typed, hashed evidence item on a case (refutation justifies kills; cleanup tracks cleanup) |
|
|
65
|
-
| `PromoteFinding` |
|
|
65
|
+
| `PromoteFinding` | Phase 1: run on-disk PoC (Docker sandbox by default; `local:true` = host-network sandbox, host execution operator-gated via `PI_POC_ALLOW_LOCAL=1`) 2× target + 1× control; validates nonce-bound evidence.json, determinism, differential; records the 1h pending bundle + confirmer dispatch instruction |
|
|
66
|
+
| `ConfirmFinding` | Phase 2: commit the confirmer's verdict (CONFIRMED promotes; NOT_CONFIRMED keeps investigating — no tie-breaker) |
|
|
66
67
|
| `CaseGet` / `CaseList` / `CaseSearch` | Read / filter / search |
|
|
67
68
|
| `CaseLink` / `CaseUnlink` | Bidirectional exploit chains |
|
|
68
69
|
| `ChainSuggest` | Scan cases for exploitable chain combinations (credential+endpoint→ATO, redirect+OAuth→token theft, XSS+state-change→CSRF, IDOR+user-data, SSTI→RCE, race+payment, info-disclosure+SSRF), ranked by confidence |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xaccefy/pi-casefile",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Offensive security case tracker for Pi Agent — bug bounties, CTFs, security audits",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -51,9 +51,6 @@
|
|
|
51
51
|
"./skills"
|
|
52
52
|
]
|
|
53
53
|
},
|
|
54
|
-
"dependencies": {
|
|
55
|
-
"@sinclair/typebox": "^0.32.34"
|
|
56
|
-
},
|
|
57
54
|
"devDependencies": {
|
|
58
55
|
"@types/bun": "^1.3.14",
|
|
59
56
|
"typescript": "^6.0.3"
|
|
@@ -61,6 +58,7 @@
|
|
|
61
58
|
"peerDependencies": {
|
|
62
59
|
"@earendil-works/pi-ai": "*",
|
|
63
60
|
"@earendil-works/pi-coding-agent": "*",
|
|
64
|
-
"@earendil-works/pi-tui": "*"
|
|
61
|
+
"@earendil-works/pi-tui": "*",
|
|
62
|
+
"typebox": "*"
|
|
65
63
|
}
|
|
66
64
|
}
|
package/skills/casefile/SKILL.md
CHANGED
|
@@ -13,7 +13,7 @@ Use Casefile to maintain durable security investigation state across agent turns
|
|
|
13
13
|
1. Check existing cases before opening a new one with CaseList or CaseSearch.
|
|
14
14
|
2. Open new leads with CaseAdd as `hypothesis` or `investigating`.
|
|
15
15
|
3. Promote cases with CaseUpdate only after materially new evidence, proof, impact, blockers, remediation, or status changes.
|
|
16
|
-
4. Mark `confirmed` only via PromoteFinding
|
|
16
|
+
4. Mark `confirmed` only via the two-phase gate — `PromoteFinding` (runs the PoC 2× against the target + 1× against a distinct control target; every run must write nonce-bound `evidence.json` and complete with captured output) → dispatch the `confirmer` subagent → commit its verdict with `ConfirmFinding`. Markers and exit codes are diagnostics, not gates.
|
|
17
17
|
5. Use CaseLink and CaseUnlink for exploit chains. Do not edit linked case IDs directly.
|
|
18
18
|
6. Use CaseContext only for confirmed or already reported cases: it writes the full context bundle (complete record, verification logs, links, pipeline artifacts) and records the report path. Then have the report written (reporter agent in the full pipeline; yourself in lite mode) and CaseUpdate status=`reported`.
|
|
19
19
|
7. Use `killed` for disproven, duplicate, or dead-end leads, and include evidence, blockers, next step, or assumptions explaining why.
|
|
@@ -27,14 +27,15 @@ hypothesis → investigating → confirmed → reported
|
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
- investigating requires evidence + confidence
|
|
30
|
-
- confirmed requires PromoteFinding (
|
|
30
|
+
- confirmed requires PromoteFinding + ConfirmFinding (never CaseUpdate)
|
|
31
31
|
- killed/reported are terminal (no field edits or re-links)
|
|
32
32
|
|
|
33
33
|
## Tool Map
|
|
34
34
|
|
|
35
35
|
- `CaseAdd`: create a new case.
|
|
36
36
|
- `CaseUpdate`: update an existing case.
|
|
37
|
-
- `PromoteFinding`: run an on-disk PoC script (Docker sandbox or local) and
|
|
37
|
+
- `PromoteFinding`: phase 1 of confirmation — run an on-disk PoC script (Docker sandbox or local) against the target 2× plus a same-script control run; machine-validates nonce-bound evidence.json, determinism, and the target/control differential; records a 1h pending bundle and returns the confirmer dispatch instruction.
|
|
38
|
+
- `ConfirmFinding`: phase 2 — commit the confirmer's verdict (CONFIRMED promotes to confirmed; NOT_CONFIRMED keeps investigating, no tie-breaker).
|
|
38
39
|
- `CaseGet`: read one case by ID.
|
|
39
40
|
- `CaseList`: list cases with filters and pagination.
|
|
40
41
|
- `CaseSearch`: search all fields or a scoped field.
|