@izkac/forgekit 0.3.12 → 0.3.14
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/bin/forge.mjs +119 -107
- package/bin/forgekit.mjs +83 -83
- package/bin/review.mjs +81 -81
- package/package.json +2 -1
- package/scripts/prepack.mjs +78 -78
- package/scripts/run-tests.mjs +50 -50
- package/src/adr.mjs +236 -236
- package/src/adr.test.mjs +170 -170
- package/src/change.mjs +327 -234
- package/src/change.test.mjs +145 -83
- package/src/cleanup-sessions.mjs +84 -84
- package/src/config.mjs +103 -103
- package/src/defer.mjs +75 -75
- package/src/doctor.mjs +350 -341
- package/src/doctor.test.mjs +114 -114
- package/src/fleet.test.mjs +50 -0
- package/src/init.mjs +680 -621
- package/src/install.mjs +815 -815
- package/src/install.test.mjs +180 -180
- package/src/integrity-check.mjs +60 -60
- package/src/integrity.mjs +688 -682
- package/src/integrity.test.mjs +612 -566
- package/src/lib/fleet.mjs +61 -4
- package/src/lib.mjs +160 -143
- package/src/lib.test.mjs +128 -0
- package/src/models.defaults.json +41 -41
- package/src/new-session.mjs +99 -99
- package/src/openspec-overlays/README.md +19 -19
- package/src/openspec-overlays/openspec-apply-change-footer.md +14 -14
- package/src/openspec-overlays/opsx-apply-completion-step.md +1 -1
- package/src/openspec-overlays/opsx-apply-implement-step.md +11 -11
- package/src/paths.mjs +92 -92
- package/src/plan-engine.mjs +321 -278
- package/src/plan-engine.test.mjs +447 -283
- package/src/preferences.defaults.json +78 -78
- package/src/preferences.mjs +438 -438
- package/src/preferences.test.mjs +174 -174
- package/src/record-evidence.mjs +204 -204
- package/src/repo-root.mjs +33 -0
- package/src/resolve-model.mjs +312 -312
- package/src/resolve-model.test.mjs +194 -194
- package/src/review/cli.test.mjs +117 -117
- package/src/review/export.mjs +172 -172
- package/src/review/export.test.mjs +197 -197
- package/src/review/fixtures/valid-review.json +42 -42
- package/src/review/lib.mjs +894 -894
- package/src/review/lib.test.mjs +266 -266
- package/src/review/schema.json +196 -196
- package/src/review/signals.test.mjs +62 -62
- package/src/score-cli.mjs +68 -68
- package/src/score.mjs +568 -568
- package/src/score.test.mjs +366 -366
- package/src/session-reminder.mjs +207 -207
- package/src/session-status.mjs +70 -70
- package/src/set-models.mjs +186 -186
- package/src/set-phase.mjs +205 -205
- package/src/set-prefs.mjs +294 -294
- package/src/specs-sync.mjs +232 -0
- package/src/specs-sync.test.mjs +114 -0
- package/src/spine.mjs +93 -93
- package/src/triage-prompt.mjs +175 -175
- package/src/triage-prompt.test.mjs +50 -50
- package/src/vendor-openspec-overlays.mjs +176 -176
- package/src/vendor-openspec-overlays.test.mjs +62 -62
- package/vendor/skills/archive-to-adr/SKILL.md +149 -149
- package/vendor/skills/forge/SKILL.md +136 -136
- package/vendor/skills/forge/docs/forge.md +650 -647
- package/vendor/skills/forge/phases/brainstorm.md +23 -23
- package/vendor/skills/forge/phases/finish.md +90 -87
- package/vendor/skills/forge/phases/implement.md +77 -77
- package/vendor/skills/forge/phases/plan-openspec.md +60 -60
- package/vendor/skills/forge/phases/plan-specs.md +163 -117
- package/vendor/skills/forge/phases/review.md +25 -25
- package/vendor/skills/forge/phases/verify.md +124 -124
- package/vendor/skills/forge/references/forge-layout.md +85 -85
- package/vendor/skills/forge/references/pace.md +115 -115
- package/vendor/skills/forge/references/plan-routing.md +52 -51
- package/vendor/skills/forge/references/runtime-integrity.md +232 -232
- package/vendor/skills/forge/references/substantial-work.md +37 -37
- package/vendor/skills/forge/references/test-evidence.md +30 -30
- package/vendor/skills/forge/references/test-strategy.md +68 -68
- package/vendor/skills/forge/skills/subagent-driven-development/SKILL.md +87 -87
- package/vendor/skills/forge/subagents/final-reviewer-prompt.md +56 -56
- package/vendor/skills/forge/subagents/implementer-prompt.md +38 -38
- package/vendor/skills/git-resolve-adr-conflict/SKILL.md +132 -132
- package/vendor/skills/thorough-code-review/SKILL.md +290 -290
- package/vendor/skills/thorough-code-review/examples.md +133 -133
- package/vendor/skills/thorough-code-review/reference/accepted-risks.md +26 -26
- package/vendor/skills/thorough-code-review/reference/lenses.md +96 -96
- package/vendor/skills/thorough-code-review/reference/phase1-scout.md +62 -62
- package/vendor/skills/thorough-code-review/reference/phase2-skeptic.md +105 -105
- package/vendor/skills/thorough-code-review/reference/report-schema.json +222 -222
- package/vendor/skills/thorough-code-review/reference/report-template.md +115 -115
- package/vendor/skills/thorough-code-review/reference/severity-rubric.md +49 -49
- package/vendor/skills/thorough-code-review/reference/signals-preflight.md +55 -55
- package/vendor/templates/adr/README.md +7 -7
- package/vendor/templates/adr/decisions.md +141 -141
- package/vendor/templates/adr/hooks/check-pending-adrs.mjs +74 -74
- package/vendor/templates/adr/hooks/check-pending-adrs.sh +3 -3
- package/vendor/templates/adr/hooks/openspec-archive-agent-message.mjs +52 -52
- package/vendor/templates/adr/hooks/openspec-archive-agent-message.sh +3 -3
- package/vendor/templates/project/claude/commands/forge-apply.md +75 -75
- package/vendor/templates/project/claude/commands/forge-brainstorm.md +7 -7
- package/vendor/templates/project/claude/commands/forge-build.md +17 -17
- package/vendor/templates/project/claude/commands/forge-plan.md +12 -12
- package/vendor/templates/project/claude/commands/forge-skip.md +14 -14
- package/vendor/templates/project/claude/commands/forge-status.md +16 -16
- package/vendor/templates/project/claude/commands/forge.md +16 -16
- package/vendor/templates/project/claude/hooks/forge-prompt-hook.mjs +73 -73
- package/vendor/templates/project/claude/hooks/forge-session-start.mjs +19 -19
- package/vendor/templates/project/claude/hooks/forge-triage-hook.mjs +77 -77
- package/vendor/templates/project/cursor/commands/forge-apply.md +75 -75
- package/vendor/templates/project/cursor/commands/forge-brainstorm.md +10 -10
- package/vendor/templates/project/cursor/commands/forge-build.md +17 -17
- package/vendor/templates/project/cursor/commands/forge-plan.md +15 -15
- package/vendor/templates/project/cursor/commands/forge-skip.md +14 -14
- package/vendor/templates/project/cursor/commands/forge-status.md +16 -16
- package/vendor/templates/project/cursor/commands/forge.md +16 -16
- package/vendor/templates/project/cursor/hooks/forge-session-start.mjs +30 -30
- package/vendor/templates/project/cursor/hooks/forge-session-start.sh +3 -3
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
# Phase 2 — Skeptic pass
|
|
2
|
-
|
|
3
|
-
You are an **adversarial skeptic**. Your job is to **disprove** the scout's claim unless evidence confirms it.
|
|
4
|
-
|
|
5
|
-
**You receive only this packet — no chat history.** It may contain **one finding** (critical, or an important finding alone in its file) or a **batch of findings sharing a file or module** (important: ≤4, minor: ≤6) — steelman and verdict each finding independently; never let one verdict color another.
|
|
6
|
-
|
|
7
|
-
## Finding(s) under review
|
|
8
|
-
|
|
9
|
-
One block per finding:
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
id: {FINDING_ID}
|
|
13
|
-
lens: {LENS}
|
|
14
|
-
location: {LOCATION}
|
|
15
|
-
claim: {CLAIM}
|
|
16
|
-
evidence: {EVIDENCE}
|
|
17
|
-
context: {CONTEXT_EXCERPT} # ±30 lines around the cited location, from the scout
|
|
18
|
-
related: {RELATED} # callers, test files, ADR paths
|
|
19
|
-
tentative_severity: {SEVERITY}
|
|
20
|
-
confidence: {CONFIDENCE}
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Start from `context` and `related` — most verdicts need only 1–2 additional reads. Read more files only when the disproof checklist genuinely requires it.
|
|
24
|
-
|
|
25
|
-
## Scope context
|
|
26
|
-
|
|
27
|
-
- **Scope:** {SCOPE_DESCRIPTION}
|
|
28
|
-
- **Mode:** {MODE} <!-- `initial` or `reverify` -->
|
|
29
|
-
- **Accepted risks:** {ACCEPTED_RISKS_DIGEST} <!-- contents of reference/accepted-risks.md -->
|
|
30
|
-
|
|
31
|
-
Check the digest **before** reading `docs/adr/` — if it covers the claim and no re-open trigger fired, the verdict is `false_positive` (cite the ADR id). Read full ADRs only when the digest is silent.
|
|
32
|
-
|
|
33
|
-
## Steelman rule
|
|
34
|
-
|
|
35
|
-
First, restate the **strongest** version of the claim — the worst reasonable interpretation an attacker or failure mode could exploit.
|
|
36
|
-
|
|
37
|
-
## Disproof checklist
|
|
38
|
-
|
|
39
|
-
Attempt each before concluding:
|
|
40
|
-
|
|
41
|
-
1. **Call chain** — trace callers and callees; does the dangerous path actually execute?
|
|
42
|
-
2. **Data flow** — is input attacker-controlled at the sink?
|
|
43
|
-
3. **Tests** — read (or run if feasible) tests covering this path
|
|
44
|
-
4. **Framework mitigations** — middleware, ORM parameterization, framework defaults
|
|
45
|
-
5. **Deployment boundary** — internal-only API, LAN trust model, ADR-accepted risk
|
|
46
|
-
6. **Project docs** — `docs/adr/`, `AGENTS.md`, prior security reviews
|
|
47
|
-
7. **Intent** — comment, type guard, or early return that negates the claim
|
|
48
|
-
|
|
49
|
-
## Verdict (initial review)
|
|
50
|
-
|
|
51
|
-
| Verdict | When |
|
|
52
|
-
| ------- | ---- |
|
|
53
|
-
| `confirmed` | Issue is real at stated or higher severity |
|
|
54
|
-
| `false_positive` | Claim does not hold after investigation |
|
|
55
|
-
| `downgraded` | Real issue but lower severity — set `severity` and `original_severity` |
|
|
56
|
-
| `needs_decision` | Architectural/policy choice; not a clear defect |
|
|
57
|
-
|
|
58
|
-
**Requirements:**
|
|
59
|
-
|
|
60
|
-
- `verdict_reason` must cite specific evidence (file:line, test name, ADR id).
|
|
61
|
-
- "Looks fine" without evidence is invalid.
|
|
62
|
-
- Upgrade severity only with **new** evidence not in the scout packet.
|
|
63
|
-
|
|
64
|
-
## Risk-weighted second opinion
|
|
65
|
-
|
|
66
|
-
A single skeptic returning `false_positive` is itself a single point of failure — it can quietly bury a real bug. The orchestrator dispatches a **second independent skeptic** (no history, blind to the first verdict) when the finding is in the **dangerous quadrant**:
|
|
67
|
-
|
|
68
|
-
- `severity` is `critical`/`important` **and** the first verdict is `false_positive`, or
|
|
69
|
-
- `phase1_confidence: high` **and** the first verdict is `false_positive` (scout/skeptic disagreement), or
|
|
70
|
-
- `phase1_confidence: low` **and** `severity: critical` (high-stakes, low-certainty).
|
|
71
|
-
|
|
72
|
-
If you are the second skeptic, verify independently and return your verdict in the `second_opinion` block. When the two skeptics disagree, the orchestrator keeps the higher-severity outcome or routes to `needs_decision` — a disagreement is never silently resolved in favour of dismissal.
|
|
73
|
-
|
|
74
|
-
## Verdict (reverify mode)
|
|
75
|
-
|
|
76
|
-
When `MODE` is `reverify`, the finding was previously `confirmed` or `downgraded`. Read **current** code at `location`.
|
|
77
|
-
|
|
78
|
-
| Verdict | When |
|
|
79
|
-
| ------- | ---- |
|
|
80
|
-
| `resolved` | Fix fully addresses the issue |
|
|
81
|
-
| `still_open` | Issue persists unchanged |
|
|
82
|
-
| `partially_fixed` | Improved but incomplete |
|
|
83
|
-
| `regressed` | Fix introduced new problem or made it worse |
|
|
84
|
-
|
|
85
|
-
Include `verdict_reason` with before/after comparison.
|
|
86
|
-
|
|
87
|
-
## Output
|
|
88
|
-
|
|
89
|
-
Return one structured block **per finding** for synthesis:
|
|
90
|
-
|
|
91
|
-
```yaml
|
|
92
|
-
id: F-001
|
|
93
|
-
lens: security
|
|
94
|
-
location: path:line
|
|
95
|
-
claim: ...
|
|
96
|
-
severity: critical | important | minor
|
|
97
|
-
original_severity: ... # required if downgraded
|
|
98
|
-
verdict: confirmed | false_positive | downgraded | needs_decision | resolved | still_open | partially_fixed | regressed
|
|
99
|
-
verdict_reason: ...
|
|
100
|
-
evidence: ...
|
|
101
|
-
second_opinion: # only for dangerous-quadrant findings
|
|
102
|
-
verdict: ...
|
|
103
|
-
verdict_reason: ...
|
|
104
|
-
agrees: true | false
|
|
105
|
-
```
|
|
1
|
+
# Phase 2 — Skeptic pass
|
|
2
|
+
|
|
3
|
+
You are an **adversarial skeptic**. Your job is to **disprove** the scout's claim unless evidence confirms it.
|
|
4
|
+
|
|
5
|
+
**You receive only this packet — no chat history.** It may contain **one finding** (critical, or an important finding alone in its file) or a **batch of findings sharing a file or module** (important: ≤4, minor: ≤6) — steelman and verdict each finding independently; never let one verdict color another.
|
|
6
|
+
|
|
7
|
+
## Finding(s) under review
|
|
8
|
+
|
|
9
|
+
One block per finding:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
id: {FINDING_ID}
|
|
13
|
+
lens: {LENS}
|
|
14
|
+
location: {LOCATION}
|
|
15
|
+
claim: {CLAIM}
|
|
16
|
+
evidence: {EVIDENCE}
|
|
17
|
+
context: {CONTEXT_EXCERPT} # ±30 lines around the cited location, from the scout
|
|
18
|
+
related: {RELATED} # callers, test files, ADR paths
|
|
19
|
+
tentative_severity: {SEVERITY}
|
|
20
|
+
confidence: {CONFIDENCE}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Start from `context` and `related` — most verdicts need only 1–2 additional reads. Read more files only when the disproof checklist genuinely requires it.
|
|
24
|
+
|
|
25
|
+
## Scope context
|
|
26
|
+
|
|
27
|
+
- **Scope:** {SCOPE_DESCRIPTION}
|
|
28
|
+
- **Mode:** {MODE} <!-- `initial` or `reverify` -->
|
|
29
|
+
- **Accepted risks:** {ACCEPTED_RISKS_DIGEST} <!-- contents of reference/accepted-risks.md -->
|
|
30
|
+
|
|
31
|
+
Check the digest **before** reading `docs/adr/` — if it covers the claim and no re-open trigger fired, the verdict is `false_positive` (cite the ADR id). Read full ADRs only when the digest is silent.
|
|
32
|
+
|
|
33
|
+
## Steelman rule
|
|
34
|
+
|
|
35
|
+
First, restate the **strongest** version of the claim — the worst reasonable interpretation an attacker or failure mode could exploit.
|
|
36
|
+
|
|
37
|
+
## Disproof checklist
|
|
38
|
+
|
|
39
|
+
Attempt each before concluding:
|
|
40
|
+
|
|
41
|
+
1. **Call chain** — trace callers and callees; does the dangerous path actually execute?
|
|
42
|
+
2. **Data flow** — is input attacker-controlled at the sink?
|
|
43
|
+
3. **Tests** — read (or run if feasible) tests covering this path
|
|
44
|
+
4. **Framework mitigations** — middleware, ORM parameterization, framework defaults
|
|
45
|
+
5. **Deployment boundary** — internal-only API, LAN trust model, ADR-accepted risk
|
|
46
|
+
6. **Project docs** — `docs/adr/`, `AGENTS.md`, prior security reviews
|
|
47
|
+
7. **Intent** — comment, type guard, or early return that negates the claim
|
|
48
|
+
|
|
49
|
+
## Verdict (initial review)
|
|
50
|
+
|
|
51
|
+
| Verdict | When |
|
|
52
|
+
| ------- | ---- |
|
|
53
|
+
| `confirmed` | Issue is real at stated or higher severity |
|
|
54
|
+
| `false_positive` | Claim does not hold after investigation |
|
|
55
|
+
| `downgraded` | Real issue but lower severity — set `severity` and `original_severity` |
|
|
56
|
+
| `needs_decision` | Architectural/policy choice; not a clear defect |
|
|
57
|
+
|
|
58
|
+
**Requirements:**
|
|
59
|
+
|
|
60
|
+
- `verdict_reason` must cite specific evidence (file:line, test name, ADR id).
|
|
61
|
+
- "Looks fine" without evidence is invalid.
|
|
62
|
+
- Upgrade severity only with **new** evidence not in the scout packet.
|
|
63
|
+
|
|
64
|
+
## Risk-weighted second opinion
|
|
65
|
+
|
|
66
|
+
A single skeptic returning `false_positive` is itself a single point of failure — it can quietly bury a real bug. The orchestrator dispatches a **second independent skeptic** (no history, blind to the first verdict) when the finding is in the **dangerous quadrant**:
|
|
67
|
+
|
|
68
|
+
- `severity` is `critical`/`important` **and** the first verdict is `false_positive`, or
|
|
69
|
+
- `phase1_confidence: high` **and** the first verdict is `false_positive` (scout/skeptic disagreement), or
|
|
70
|
+
- `phase1_confidence: low` **and** `severity: critical` (high-stakes, low-certainty).
|
|
71
|
+
|
|
72
|
+
If you are the second skeptic, verify independently and return your verdict in the `second_opinion` block. When the two skeptics disagree, the orchestrator keeps the higher-severity outcome or routes to `needs_decision` — a disagreement is never silently resolved in favour of dismissal.
|
|
73
|
+
|
|
74
|
+
## Verdict (reverify mode)
|
|
75
|
+
|
|
76
|
+
When `MODE` is `reverify`, the finding was previously `confirmed` or `downgraded`. Read **current** code at `location`.
|
|
77
|
+
|
|
78
|
+
| Verdict | When |
|
|
79
|
+
| ------- | ---- |
|
|
80
|
+
| `resolved` | Fix fully addresses the issue |
|
|
81
|
+
| `still_open` | Issue persists unchanged |
|
|
82
|
+
| `partially_fixed` | Improved but incomplete |
|
|
83
|
+
| `regressed` | Fix introduced new problem or made it worse |
|
|
84
|
+
|
|
85
|
+
Include `verdict_reason` with before/after comparison.
|
|
86
|
+
|
|
87
|
+
## Output
|
|
88
|
+
|
|
89
|
+
Return one structured block **per finding** for synthesis:
|
|
90
|
+
|
|
91
|
+
```yaml
|
|
92
|
+
id: F-001
|
|
93
|
+
lens: security
|
|
94
|
+
location: path:line
|
|
95
|
+
claim: ...
|
|
96
|
+
severity: critical | important | minor
|
|
97
|
+
original_severity: ... # required if downgraded
|
|
98
|
+
verdict: confirmed | false_positive | downgraded | needs_decision | resolved | still_open | partially_fixed | regressed
|
|
99
|
+
verdict_reason: ...
|
|
100
|
+
evidence: ...
|
|
101
|
+
second_opinion: # only for dangerous-quadrant findings
|
|
102
|
+
verdict: ...
|
|
103
|
+
verdict_reason: ...
|
|
104
|
+
agrees: true | false
|
|
105
|
+
```
|