kodelyth-ecc 2.5.4 → 2.7.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/CHANGELOG.md +115 -0
- package/VERSION +1 -1
- package/bin/kodelyth-ecc.js +137 -0
- package/commands/arena.md +101 -0
- package/commands/evil-mode.md +106 -0
- package/commands/god-mode.md +85 -0
- package/package.json +1 -1
- package/scripts/arena/arena.js +280 -0
- package/scripts/arena/contract.js +169 -0
- package/scripts/arena/evil.js +175 -0
- package/scripts/arena/god.js +208 -0
- package/scripts/arena/state.js +195 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,121 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to Kodelyth ECC are documented here.
|
|
4
4
|
|
|
5
|
+
## v2.7.0 — The Arena: GOD vs EVIL loop (phase 3) (August 2026)
|
|
6
|
+
|
|
7
|
+
The two crews now fight. GOD builds, EVIL attacks, verified findings return to GOD as mandatory work, and the loop repeats **until the attacker gives up**.
|
|
8
|
+
|
|
9
|
+
### Added — `scripts/arena/arena.js` + `/arena`
|
|
10
|
+
|
|
11
|
+
A **state machine**, not an agent dispatcher — it decides what happens next and grades what comes back, so the entire loop is testable without spending a token. Agent invocation is driven by the AI through `/arena`.
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
round N: god_build → evil_hunt → evil_verify → round_close
|
|
15
|
+
│
|
|
16
|
+
converged / out of budget / out of rounds? ──→ report
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- **`nextAction(run)`** — the loop's brain. Returns the next step, its briefs, and a token estimate the budget can veto.
|
|
20
|
+
- **Findings carry forward.** Round 1 builds; every later round *fixes what EVIL proved*, with the findings injected into GOD's brief as mandatory items. **Refuted findings are never carried** — a false positive can no longer consume an entire fix round.
|
|
21
|
+
- **Later EVIL rounds know what's already known** and are told to hunt what the last pass missed.
|
|
22
|
+
- **Phase guards** — submitting out of order throws instead of silently corrupting a run.
|
|
23
|
+
- **`affordOrAbort()`** — aborts cleanly *before* an unaffordable step. A readable partial result beats a surprise bill.
|
|
24
|
+
- **Resumable** — a crash mid-loop reloads from disk with phase and spend intact.
|
|
25
|
+
- **`buildReport()`** — markdown report with the trend histogram, per-round detail, still-open findings ranked by real risk, and a refuted section so the same false positive is never re-litigated.
|
|
26
|
+
|
|
27
|
+
### Added — CLI
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
kodelythecc arena start --task "harden the webhook" --scope src/ --max-rounds 3
|
|
31
|
+
kodelythecc arena next <run-id> # what the loop wants next (JSON)
|
|
32
|
+
kodelythecc arena report <run-id> --md # full markdown report
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Verified end-to-end
|
|
36
|
+
|
|
37
|
+
Simulated a realistic run at true cost (~191k tokens/round):
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
round 1 3 new ████████████████████████
|
|
41
|
+
round 2 1 new ████████
|
|
42
|
+
round 3 0 new ·
|
|
43
|
+
round 4 0 new ·
|
|
44
|
+
**Converged** — two consecutive rounds surfaced nothing new.
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
- Convergence fires on 2 quiet rounds; a fresh finding **restarts** the streak
|
|
48
|
+
- Rounds where GOD left an artifact unproven or a critical unaddressed are flagged **incomplete** in the report
|
|
49
|
+
- A refuting verdict zeroed the finding and kept `openRisk` honest
|
|
50
|
+
- **The budget guard fired for real** — an earlier run at the 400k default aborted at round 3 with a clean partial report, exactly as designed
|
|
51
|
+
- **463 tests, 0 failures** across 33 files (up from 444) — 19 new arena-loop tests
|
|
52
|
+
|
|
53
|
+
### Honest cost note
|
|
54
|
+
|
|
55
|
+
~200k tokens per round (GOD ≈ 90k + EVIL ≈ 96k + verification). Defaults are deliberately conservative: **3 rounds, 400k tokens, 45 min**. Use `/god-mode` or `/evil-mode` alone when you don't need the full loop — the arena is for work that must not break.
|
|
56
|
+
|
|
57
|
+
### Assets
|
|
58
|
+
|
|
59
|
+
`social/card-arena.svg`; SVG badges → v2.7.0; 8K PNGs re-rendered.
|
|
60
|
+
|
|
61
|
+
## v2.6.0 — GOD mode + EVIL mode v2 (Arena phases 0-2) (August 2026)
|
|
62
|
+
|
|
63
|
+
The foundation of the **adversarial arena**: two opposed crews that will eventually fight each other until the attacker gives up. Phases 0-2 of 6 — the contract, the adversary, and the builder. The arena loop itself lands in a later release, only once it is verified end-to-end.
|
|
64
|
+
|
|
65
|
+
### Added — Phase 0: the contract (`scripts/arena/`)
|
|
66
|
+
|
|
67
|
+
- **`contract.js`** — the shared schema GOD and EVIL exchange. `Finding` (severity × confidence × exploitability → risk), `Artifact`, `RoundVerdict`, stable FNV-1a fingerprints so the same issue dedupes across rounds even when wording drifts, and `hasConverged()`.
|
|
68
|
+
- **Refuted findings carry zero effective risk** — verification can genuinely zero out a false positive.
|
|
69
|
+
- Certainty outweighs raw severity: a *confirmed/high/trivial* outranks a *speculative/critical/theoretical*, so noise sinks.
|
|
70
|
+
- **`state.js`** — resumable run state in `~/.kodelythecc/arena/`. Rounds are appended, so a crash or budget abort never loses rounds already paid for.
|
|
71
|
+
- **Hard stops, not advisory:** max rounds, token budget, wall-clock. `canAffordRound()` refuses *before* spending.
|
|
72
|
+
|
|
73
|
+
### Added — Phase 1: EVIL mode v2 (`scripts/arena/evil.js`, `/evil-mode`)
|
|
74
|
+
|
|
75
|
+
The 8 adversarial agents already hunted well; what they lacked was judgment.
|
|
76
|
+
|
|
77
|
+
- **Scoring** — every finding gets a risk score instead of landing in a flat pile.
|
|
78
|
+
- **Adversarial verification** — each top finding is challenged by a fresh agent told to **REFUTE it**, defaulting to refuted when uncertain. False positives die before they can waste GOD mode's next round.
|
|
79
|
+
- **Loop-until-dry** — later rounds tell each agent what is already known and to hunt what the last pass *missed*.
|
|
80
|
+
- `selectForVerification()` is budget-bounded (default 12) and skips settled or near-zero-risk findings.
|
|
81
|
+
- `/devil-mode` still works — `/evil-mode` is the upgraded entry point.
|
|
82
|
+
|
|
83
|
+
### Added — Phase 2: GOD mode (`scripts/arena/god.js`, `/god-mode`)
|
|
84
|
+
|
|
85
|
+
Not "fire nine agents at once" — that is `/project-launch`. A six-stage pipeline with three things the parallel commands lack:
|
|
86
|
+
|
|
87
|
+
| Stage | Agents |
|
|
88
|
+
|---|---|
|
|
89
|
+
| **Recall** | — (memory lookup; never invents a memory) |
|
|
90
|
+
| **Design** ∥ | `architect` + `code-architect` |
|
|
91
|
+
| **Build** → | `pair-programmer` + `tdd-guide` |
|
|
92
|
+
| **Self-critique** ∥ | `type-design-analyzer` + `api-guardian` + `ux-reviewer` |
|
|
93
|
+
| **Harden** ∥ | `performance-optimizer` + `refactor-cleaner` |
|
|
94
|
+
| **Prove** | — (runs the verification command) |
|
|
95
|
+
|
|
96
|
+
- **It recalls before it builds.**
|
|
97
|
+
- **Proof gate:** `verifyArtifacts()` marks work verified only when a command actually ran and exited clean — a truthy claim is explicitly not proof.
|
|
98
|
+
- **`roundComplete()` blocks** on any unverified artifact or unaddressed critical/high finding. A refuted finding never blocks.
|
|
99
|
+
|
|
100
|
+
### Added — CLI
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
kodelythecc god --task "add rate limiting" # plan + cost estimate
|
|
104
|
+
kodelythecc evil src/auth --all # crew + cost estimate
|
|
105
|
+
kodelythecc arena list # past runs
|
|
106
|
+
kodelythecc arena report <run-id> # rounds, trend, open risk
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Verified
|
|
110
|
+
|
|
111
|
+
- **444 tests, 0 failures** across 32 files (up from 388) — 56 new arena tests
|
|
112
|
+
- Simulated a 4-round run: new-findings trend **[2, 1, 0, 0] → converged**, stop reason *"attacker gave up"*
|
|
113
|
+
- Both CLI surfaces render real plans with real cost estimates
|
|
114
|
+
- Traversal-safe run ids, budget refusal, and convergence-streak reset all covered by tests
|
|
115
|
+
|
|
116
|
+
### Assets
|
|
117
|
+
|
|
118
|
+
- `social/card-god.svg` + `social/card-evil.svg`; SVG badges → v2.6.0; 8K PNGs re-rendered.
|
|
119
|
+
|
|
5
120
|
## v2.5.4 — Memory: direct capture CLI + aggressive auto-capture (July 2026)
|
|
6
121
|
|
|
7
122
|
Two memory improvements after an end-to-end verification pass confirmed the pipeline works but only captured when the user said "thanks".
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.7.0
|
package/bin/kodelyth-ecc.js
CHANGED
|
@@ -424,6 +424,143 @@ if (args[0] === 'memory') {
|
|
|
424
424
|
} catch (e) { process.stderr.write(`[memory] ${e.message}\n`); process.exit(1); }
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
+
// ── Subcommand: god / evil / arena (the adversarial arena) ──────────────────
|
|
428
|
+
// Usage:
|
|
429
|
+
// kodelythecc god --task "<task>" [--json] plan a GOD-mode build
|
|
430
|
+
// kodelythecc evil [scope] [--all|--license|...] plan an EVIL-mode sweep
|
|
431
|
+
// kodelythecc arena list list past arena runs
|
|
432
|
+
// kodelythecc arena report <run-id> show a run's report
|
|
433
|
+
if (args[0] === 'god' || args[0] === 'evil' || args[0] === 'arena') {
|
|
434
|
+
const mode = args[0];
|
|
435
|
+
const rest = args.slice(1);
|
|
436
|
+
const w = (m) => process.stdout.write(m + '\n');
|
|
437
|
+
const wantJson = rest.includes('--json');
|
|
438
|
+
function flag(name, dflt) {
|
|
439
|
+
const i = rest.indexOf('--' + name);
|
|
440
|
+
return i >= 0 && rest[i + 1] && !rest[i + 1].startsWith('--') ? rest[i + 1] : dflt;
|
|
441
|
+
}
|
|
442
|
+
try {
|
|
443
|
+
if (mode === 'god') {
|
|
444
|
+
const god = require(path.join(ROOT, 'scripts', 'arena', 'god.js'));
|
|
445
|
+
const task = flag('task') || rest.find(a => !a.startsWith('--'));
|
|
446
|
+
if (!task) { process.stderr.write('usage: kodelythecc god --task "<what to build>"\n'); process.exit(2); }
|
|
447
|
+
const plan = god.planBuild({ task });
|
|
448
|
+
if (wantJson) { w(JSON.stringify(plan, null, 2)); process.exit(0); }
|
|
449
|
+
w('');
|
|
450
|
+
w(`\x1b[1mGOD mode\x1b[0m — ${plan.task}`);
|
|
451
|
+
w('─'.repeat(60));
|
|
452
|
+
for (const s of plan.stages) {
|
|
453
|
+
const agents = s.agents.length ? s.agents.join(', ') : '(no agent — local operation)';
|
|
454
|
+
w(`\x1b[32m${String(s.id).padEnd(9)}\x1b[0m ${s.label.padEnd(14)} ${s.parallel ? '∥' : '→'} ${agents}`);
|
|
455
|
+
}
|
|
456
|
+
w('─'.repeat(60));
|
|
457
|
+
w(`${plan.stages.length} stages · est. ~${(plan.estimatedTokens / 1000).toFixed(0)}k tokens`);
|
|
458
|
+
w(`Run it in your AI tool with: \x1b[36m/god-mode ${plan.task}\x1b[0m`);
|
|
459
|
+
w('');
|
|
460
|
+
process.exit(0);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
if (mode === 'evil') {
|
|
464
|
+
const evil = require(path.join(ROOT, 'scripts', 'arena', 'evil.js'));
|
|
465
|
+
const scope = rest.find(a => !a.startsWith('--')) || '.';
|
|
466
|
+
const plan = evil.planSweep({ scope, flags: rest.filter(a => a.startsWith('--')) });
|
|
467
|
+
if (wantJson) { w(JSON.stringify(plan, null, 2)); process.exit(0); }
|
|
468
|
+
w('');
|
|
469
|
+
w(`\x1b[1mEVIL mode\x1b[0m — adversarial sweep of \x1b[33m${scope}\x1b[0m`);
|
|
470
|
+
w('─'.repeat(60));
|
|
471
|
+
for (const agent of plan.crew) {
|
|
472
|
+
w(`\x1b[31m✗\x1b[0m ${agent.padEnd(26)} ${evil.CREW[agent].hunts}`);
|
|
473
|
+
}
|
|
474
|
+
w('─'.repeat(60));
|
|
475
|
+
w(`${plan.crew.length} hunters · est. ~${(plan.estimatedTokens / 1000).toFixed(0)}k tokens`);
|
|
476
|
+
w('Findings are scored (severity × confidence × exploitability) and');
|
|
477
|
+
w('adversarially verified — unreproducible findings get refuted.');
|
|
478
|
+
w(`Run it in your AI tool with: \x1b[36m/evil-mode ${scope}\x1b[0m`);
|
|
479
|
+
w('');
|
|
480
|
+
process.exit(0);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
// arena
|
|
484
|
+
const state = require(path.join(ROOT, 'scripts', 'arena', 'state.js'));
|
|
485
|
+
const arena = require(path.join(ROOT, 'scripts', 'arena', 'arena.js'));
|
|
486
|
+
const sub = rest[0] || 'list';
|
|
487
|
+
|
|
488
|
+
if (sub === 'start') {
|
|
489
|
+
const task = flag('task') || rest.slice(1).find(a => !a.startsWith('--'));
|
|
490
|
+
if (!task) { process.stderr.write('usage: kodelythecc arena start --task "<goal>" [--scope src/] [--max-rounds 3] [--budget 400000]\n'); process.exit(2); }
|
|
491
|
+
const limits = {};
|
|
492
|
+
if (flag('max-rounds')) limits.maxRounds = Number(flag('max-rounds'));
|
|
493
|
+
if (flag('budget')) limits.tokenBudget = Number(flag('budget'));
|
|
494
|
+
const run = arena.startArena({
|
|
495
|
+
task,
|
|
496
|
+
scope: flag('scope', '.'),
|
|
497
|
+
flags: rest.filter(a => ['--all', '--license', '--theft', '--jailbreak', '--chaos', '--pre-public', '--pre-launch'].includes(a)),
|
|
498
|
+
limits,
|
|
499
|
+
});
|
|
500
|
+
const first = arena.nextAction(run);
|
|
501
|
+
if (wantJson) { w(JSON.stringify({ run: state.summarize(run), next: first }, null, 2)); process.exit(0); }
|
|
502
|
+
w('');
|
|
503
|
+
w(`\x1b[1mArena started\x1b[0m — ${run.task}`);
|
|
504
|
+
w(` run id: \x1b[36m${run.runId}\x1b[0m`);
|
|
505
|
+
w(` scope: ${run.scope}`);
|
|
506
|
+
w(` limits: ${run.limits.maxRounds} rounds · ${run.limits.tokenBudget.toLocaleString()} tokens · ${Math.round(run.limits.wallClockMs / 60000)} min`);
|
|
507
|
+
w(` next: \x1b[32m${first.action}\x1b[0m (round ${first.round}, ~${((first.estimatedTokens || 0) / 1000).toFixed(0)}k tokens)`);
|
|
508
|
+
w('');
|
|
509
|
+
w(`Drive the loop in your AI tool: \x1b[36m/arena ${run.task}\x1b[0m`);
|
|
510
|
+
w(`Inspect anytime: kodelythecc arena report ${run.runId}`);
|
|
511
|
+
w('');
|
|
512
|
+
process.exit(0);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
if (sub === 'next') {
|
|
516
|
+
const runId = rest[1];
|
|
517
|
+
if (!runId) { process.stderr.write('usage: kodelythecc arena next <run-id>\n'); process.exit(2); }
|
|
518
|
+
const run = state.load(runId);
|
|
519
|
+
if (!run) { process.stderr.write(`no such run: ${runId}\n`); process.exit(1); }
|
|
520
|
+
const action = arena.nextAction(run);
|
|
521
|
+
w(JSON.stringify(action, null, 2));
|
|
522
|
+
process.exit(0);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
if (sub === 'list') {
|
|
526
|
+
const runs = state.listRuns();
|
|
527
|
+
if (!runs.length) { w('No arena runs yet.'); process.exit(0); }
|
|
528
|
+
w('');
|
|
529
|
+
w(`\x1b[1mArena runs\x1b[0m (${runs.length})`);
|
|
530
|
+
for (const r of runs.slice(0, 20)) {
|
|
531
|
+
const icon = r.status === 'converged' ? '\x1b[32m✓\x1b[0m' : r.status === 'running' ? '\x1b[33m•\x1b[0m' : '\x1b[31m✗\x1b[0m';
|
|
532
|
+
w(` ${icon} ${r.runId} ${String(r.rounds).padStart(2)} rounds risk ${String(r.openRisk).padStart(6)} ${r.task.slice(0, 40)}`);
|
|
533
|
+
}
|
|
534
|
+
w('');
|
|
535
|
+
process.exit(0);
|
|
536
|
+
}
|
|
537
|
+
if (sub === 'report') {
|
|
538
|
+
const runId = rest[1];
|
|
539
|
+
if (!runId) { process.stderr.write('usage: kodelythecc arena report <run-id>\n'); process.exit(2); }
|
|
540
|
+
const run = state.load(runId);
|
|
541
|
+
if (!run) { process.stderr.write(`no such run: ${runId}\n`); process.exit(1); }
|
|
542
|
+
const s = state.summarize(run);
|
|
543
|
+
if (wantJson) { w(JSON.stringify({ summary: s, rounds: run.rounds }, null, 2)); process.exit(0); }
|
|
544
|
+
if (rest.includes('--md')) { w(arena.buildReport(run)); process.exit(0); }
|
|
545
|
+
w('');
|
|
546
|
+
w(`\x1b[1mArena report\x1b[0m — ${s.runId}`);
|
|
547
|
+
w(` task: ${s.task}`);
|
|
548
|
+
w(` status: ${s.status}${s.stopReason ? ` (${s.stopReason})` : ''}`);
|
|
549
|
+
w(` rounds: ${s.rounds}`);
|
|
550
|
+
w(` new/round: ${s.trend.join(' → ') || '—'} ${s.trend.length > 1 && s.trend[s.trend.length - 1] === 0 ? '\x1b[32m(attacker gave up)\x1b[0m' : ''}`);
|
|
551
|
+
w(` open issues: ${s.openFindings} (${s.confirmed} confirmed) · open risk ${s.openRisk}`);
|
|
552
|
+
w(` tokens: ${s.tokensSpent.toLocaleString()}`);
|
|
553
|
+
w('');
|
|
554
|
+
process.exit(0);
|
|
555
|
+
}
|
|
556
|
+
process.stderr.write('unknown arena subcommand. try: list | report <run-id>\n');
|
|
557
|
+
process.exit(2);
|
|
558
|
+
} catch (e) {
|
|
559
|
+
process.stderr.write(`[${mode}] ${e.message}\n`);
|
|
560
|
+
process.exit(1);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
|
|
427
564
|
if (args[0] === 'doctor') {
|
|
428
565
|
const { run, PASS, WARN, FAIL } = require(path.join(ROOT, 'scripts', 'doctor-health.js'));
|
|
429
566
|
const report = run();
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: The Arena — GOD builds, EVIL attacks, repeat until the attacker gives up. The adversarial loop with scored findings, verification, convergence detection, and hard budget stops.
|
|
3
|
+
argument-hint: "<goal> [--scope src/] [--max-rounds 3] [--all]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /arena — GOD vs EVIL, until the attacker gives up
|
|
7
|
+
|
|
8
|
+
The two crews fight over your code. GOD builds and hardens. EVIL attacks and tries to break it. Verified findings go back to GOD. Repeat until **two consecutive rounds surface nothing new** — then you ship, knowing an adversary already tried and failed.
|
|
9
|
+
|
|
10
|
+
> **This is the expensive one.** ~200k tokens per round (GOD ≈ 90k + EVIL ≈ 96k + verification). Defaults are 3 rounds / 400k tokens, and the budget guard aborts *before* overspending. Use `/god-mode` or `/evil-mode` alone when you don't need the full loop.
|
|
11
|
+
|
|
12
|
+
## The loop
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
round N: GOD builds/fixes → EVIL hunts → EVIL verifies → close round
|
|
16
|
+
│
|
|
17
|
+
converged? out of budget? out of rounds? ─┤
|
|
18
|
+
no → round N+1 │
|
|
19
|
+
yes → report
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Convergence = the win condition.** Not "zero findings" — findings may remain open and accepted. It means attacking harder stopped yielding anything new.
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
/arena harden the payment webhook
|
|
28
|
+
/arena add rate limiting --scope src/api --max-rounds 2
|
|
29
|
+
/arena prepare this repo for open-source --all
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Start and inspect from the terminal:
|
|
33
|
+
```bash
|
|
34
|
+
kodelythecc arena start --task "harden the webhook" --scope src/ --max-rounds 3
|
|
35
|
+
kodelythecc arena next <run-id> # what the loop wants next (JSON)
|
|
36
|
+
kodelythecc arena report <run-id> --md # full markdown report
|
|
37
|
+
kodelythecc arena list
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Instructions to the assistant
|
|
41
|
+
|
|
42
|
+
### 0. Start the run
|
|
43
|
+
```bash
|
|
44
|
+
kodelythecc arena start --task "<goal>" --scope "<path>" [--max-rounds N]
|
|
45
|
+
```
|
|
46
|
+
Capture the **run id**. Every step below is driven by:
|
|
47
|
+
```bash
|
|
48
|
+
kodelythecc arena next <run-id>
|
|
49
|
+
```
|
|
50
|
+
which returns the next action, its briefs, and a token estimate. **Follow it — do not improvise the order.**
|
|
51
|
+
|
|
52
|
+
### 1. `god_build`
|
|
53
|
+
Run the GOD-mode stages from the action's `stages` array (see `/god-mode`). Round 1 builds; later rounds **fix what EVIL proved** — those findings arrive in the brief as mandatory work items.
|
|
54
|
+
|
|
55
|
+
Finish by reporting artifacts, each with a `verifyCommand` you **actually ran**.
|
|
56
|
+
|
|
57
|
+
### 2. `evil_hunt`
|
|
58
|
+
Launch the crew from `briefs` **in parallel** via the Task tool. On round 2+, agents are told what's already known and to hunt what the last pass missed.
|
|
59
|
+
|
|
60
|
+
### 3. `evil_verify`
|
|
61
|
+
For each target, launch a **fresh** agent with the supplied refute-brief. Its job is to **disprove** the finding. Default to `refuted` when uncertain.
|
|
62
|
+
|
|
63
|
+
### 4. `round_close`
|
|
64
|
+
Record the round. The state machine decides whether to loop again or stop.
|
|
65
|
+
|
|
66
|
+
### 5. `report`
|
|
67
|
+
When the action is `report`, print the full markdown:
|
|
68
|
+
```bash
|
|
69
|
+
kodelythecc arena report <run-id> --md
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Rules that keep this honest
|
|
73
|
+
|
|
74
|
+
- **Never skip verification.** Unverified findings waste GOD's next entire round — that's the expensive failure mode this design exists to prevent.
|
|
75
|
+
- **Never claim a fix you didn't prove.** An artifact counts only when its command exited clean. A round with an unverified artifact is flagged incomplete in the report.
|
|
76
|
+
- **Never invent findings to look thorough.** An empty confirmed list is a good result.
|
|
77
|
+
- **Respect the budget guard.** If it aborts, report the partial result — a readable partial beats a surprise bill.
|
|
78
|
+
- Convergence is the goal, not zero findings. Accepted risk, stated plainly, is a legitimate outcome.
|
|
79
|
+
|
|
80
|
+
## Reading the report
|
|
81
|
+
|
|
82
|
+
The trend line is the whole story:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
round 1 12 new ████████████████████████
|
|
86
|
+
round 2 4 new ████████
|
|
87
|
+
round 3 0 new ·
|
|
88
|
+
round 4 0 new ·
|
|
89
|
+
**Converged** — two consecutive rounds surfaced nothing new.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Falling to zero means the attacker ran out of ideas. A flat or rising line means **stop and think** — either the code has deep problems, or EVIL is finding new surface each pass because the scope is too broad.
|
|
93
|
+
|
|
94
|
+
## When to use which
|
|
95
|
+
|
|
96
|
+
| Situation | Command |
|
|
97
|
+
|---|---|
|
|
98
|
+
| Build something properly | `/god-mode` |
|
|
99
|
+
| Audit what already exists | `/evil-mode` |
|
|
100
|
+
| Ship something that must not break | `/arena` |
|
|
101
|
+
| Before open-sourcing | `/arena --all` |
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: EVIL mode — adversarial sweep with scored findings, adversarial verification, and loop-until-dry. The upgrade of /devil-mode — unreproducible findings get refuted instead of padding the report.
|
|
3
|
+
argument-hint: "[scope] [--all|--license|--theft|--jailbreak|--chaos|--pre-public|--pre-launch]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /evil-mode — Attack Your Own Code
|
|
7
|
+
|
|
8
|
+
Eight red-team specialists hunt your repository the way an attacker would. Unlike a plain sweep, EVIL mode **grades its own findings** and then **tries to disprove them** — so what reaches you is what survived scrutiny, not everything anyone thought of.
|
|
9
|
+
|
|
10
|
+
> Findings will be uncomfortable. That is the point. This attacks **your own** codebase so real attackers find nothing left.
|
|
11
|
+
|
|
12
|
+
## What makes this different from a one-shot scan
|
|
13
|
+
|
|
14
|
+
| | Plain sweep | EVIL mode |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| Output | Flat list | Scored: severity × confidence × exploitability |
|
|
17
|
+
| False positives | You triage them | **Adversarially refuted** before you see them |
|
|
18
|
+
| Coverage | One pass | **Loops until two rounds find nothing new** |
|
|
19
|
+
| Handoff | Prose | Structured findings `/god-mode` can consume |
|
|
20
|
+
|
|
21
|
+
## The crew
|
|
22
|
+
|
|
23
|
+
**Core (always):** `prompt-injection-hunter` · `supply-chain-auditor` · `secret-hunter` · `backdoor-hunter`
|
|
24
|
+
|
|
25
|
+
**Opt-in:** `--license` · `--theft` · `--jailbreak` · `--chaos` · `--all`
|
|
26
|
+
|
|
27
|
+
**Presets:** `--pre-public` (license + theft) · `--pre-launch` (jailbreak + chaos)
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
/evil-mode # core 4 on the whole repo
|
|
33
|
+
/evil-mode src/auth # focus a module
|
|
34
|
+
/evil-mode --all # all 8 hunters
|
|
35
|
+
/evil-mode --pre-public # before open-sourcing
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Preview crew and cost first:
|
|
39
|
+
```bash
|
|
40
|
+
kodelythecc evil src/auth --all
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Instructions to the assistant
|
|
44
|
+
|
|
45
|
+
### Stage 1 — Hunt (parallel)
|
|
46
|
+
Launch the selected crew **simultaneously** via the Task tool. Give each agent its scope and tell it:
|
|
47
|
+
|
|
48
|
+
- `evidence` must **quote the actual offending code**, not describe it.
|
|
49
|
+
- `repro` must be concrete steps or a command.
|
|
50
|
+
- Only claim `confirmed` when you have actually reproduced it.
|
|
51
|
+
- **Do not pad.** Five confirmed findings beat forty guesses.
|
|
52
|
+
|
|
53
|
+
Each finding comes back as:
|
|
54
|
+
```json
|
|
55
|
+
{ "title", "severity": "critical|high|medium|low|info",
|
|
56
|
+
"confidence": "confirmed|likely|suspected|speculative",
|
|
57
|
+
"exploitability": "trivial|moderate|hard|theoretical",
|
|
58
|
+
"file", "line", "evidence", "repro", "fix" }
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Stage 2 — Verify (the part that matters)
|
|
62
|
+
Take the top findings by risk and, for each, launch a **fresh** agent whose job is to **REFUTE it**:
|
|
63
|
+
|
|
64
|
+
1. Read the actual code — does the evidence match reality?
|
|
65
|
+
2. Do guards, framework behaviour, or callers already neutralise it?
|
|
66
|
+
3. Try to reproduce it.
|
|
67
|
+
|
|
68
|
+
Return `confirmed` / `refuted` / `needs_context`. **Default to `refuted` when uncertain.** A finding that cannot be demonstrated is not a finding.
|
|
69
|
+
|
|
70
|
+
Refuted findings stay in the record (so the same false positive isn't re-litigated) but count as **zero risk**.
|
|
71
|
+
|
|
72
|
+
### Stage 3 — Loop until dry
|
|
73
|
+
If this is an arena run, sweep again — telling each agent which findings are already known and to hunt what the last pass **missed**. Stop when two consecutive rounds surface nothing new.
|
|
74
|
+
|
|
75
|
+
### Stage 4 — Report
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
EVIL MODE — <scope> — round <n>
|
|
79
|
+
swept: <agents>
|
|
80
|
+
found: <n> · confirmed <n> · refuted <n>
|
|
81
|
+
open risk: <sum of surviving risk>
|
|
82
|
+
|
|
83
|
+
CONFIRMED (fix these)
|
|
84
|
+
[risk] title — file:line
|
|
85
|
+
repro: <command or steps>
|
|
86
|
+
fix: <what to change>
|
|
87
|
+
|
|
88
|
+
REFUTED (checked, not real)
|
|
89
|
+
title — why it is not exploitable
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Order strictly by risk. Never lead with a `speculative` finding.
|
|
93
|
+
|
|
94
|
+
## Rules
|
|
95
|
+
|
|
96
|
+
- **Never invent findings to look thorough.** An empty confirmed list is a valid, good result.
|
|
97
|
+
- **Never report a finding you could not reproduce** without marking it `speculative`.
|
|
98
|
+
- This is for auditing **code you own or are authorised to test**. It is a defensive tool.
|
|
99
|
+
|
|
100
|
+
## Handoff
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
/god-mode fix the confirmed findings from the EVIL sweep
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
GOD mode treats confirmed findings as mandatory work items — each must be fixed or explicitly accepted as risk.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: GOD mode — the constructive crew. Recalls past solutions, designs, builds test-first, self-critiques, hardens, and proves the work with a command that actually runs.
|
|
3
|
+
argument-hint: "<what to build or harden>"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /god-mode — Build It Properly
|
|
7
|
+
|
|
8
|
+
Nine specialists in a six-stage pipeline. This is **not** `/project-launch` (which fires everyone at once) — GOD mode is sequential where sequence matters, parallel where it doesn't, and it refuses to call anything done that it hasn't proven.
|
|
9
|
+
|
|
10
|
+
## The pipeline
|
|
11
|
+
|
|
12
|
+
| Stage | Agents | What happens |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| **Recall** | — | Search local memory for prior solutions to this problem |
|
|
15
|
+
| **Design** ∥ | `architect` + `code-architect` | Blueprint: files, interfaces, data flow, build order |
|
|
16
|
+
| **Build** → | `pair-programmer` + `tdd-guide` | Implement test-first; tests must actually run |
|
|
17
|
+
| **Self-critique** ∥ | `type-design-analyzer` + `api-guardian` + `ux-reviewer` | Attack our own work before anyone else can |
|
|
18
|
+
| **Harden** ∥ | `performance-optimizer` + `refactor-cleaner` | Hot spots and dead weight, no behaviour change |
|
|
19
|
+
| **Prove** | — | Run the verification commands |
|
|
20
|
+
|
|
21
|
+
∥ = parallel · → = sequential
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
/god-mode add rate limiting to the payments API
|
|
27
|
+
/god-mode harden the webhook signature verification
|
|
28
|
+
/god-mode # asks what to build
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Preview the plan and cost from the terminal first:
|
|
32
|
+
```bash
|
|
33
|
+
kodelythecc god --task "add rate limiting to the payments API"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Instructions to the assistant
|
|
37
|
+
|
|
38
|
+
Run the stages **in order**. Do not skip Recall and do not skip Prove.
|
|
39
|
+
|
|
40
|
+
### Stage 1 — Recall (do this first, always)
|
|
41
|
+
Search local memory for prior work on this problem:
|
|
42
|
+
- Use the `recall_memory` MCP tool, or `kodelythecc memory recall "<task>"`.
|
|
43
|
+
- For each relevant hit, state: the past problem, the approach that worked, and whether it applies here.
|
|
44
|
+
- **If nothing relevant exists, say so plainly.** Never invent a memory.
|
|
45
|
+
|
|
46
|
+
### Stage 2 — Design (parallel)
|
|
47
|
+
Launch `architect` and `code-architect` together via the Task tool. Produce one concrete blueprint: exact files, interfaces, data flow, build order. No hand-waving.
|
|
48
|
+
|
|
49
|
+
### Stage 3 — Build (sequential)
|
|
50
|
+
Launch `pair-programmer` and `tdd-guide`. Write the test first, watch it fail, implement, watch it pass. Report which files you created or changed.
|
|
51
|
+
|
|
52
|
+
### Stage 4 — Self-critique (parallel)
|
|
53
|
+
Launch `type-design-analyzer`, `api-guardian`, and `ux-reviewer` together. Be genuinely adversarial about your own output — it is far cheaper to find a problem here than to let `/evil-mode` find it later.
|
|
54
|
+
|
|
55
|
+
### Stage 5 — Harden (parallel)
|
|
56
|
+
Launch `performance-optimizer` and `refactor-cleaner`. Improve without changing behaviour. Tests must stay green.
|
|
57
|
+
|
|
58
|
+
### Stage 6 — Prove (mandatory)
|
|
59
|
+
**Run the verification command.** A test suite, a build, a benchmark — something that exits 0.
|
|
60
|
+
|
|
61
|
+
- If it passes: report the command and its output.
|
|
62
|
+
- If it fails: **the round is not complete.** Fix it and re-run. Do not report success.
|
|
63
|
+
- "Should work" / "looks correct" is a failure of this stage.
|
|
64
|
+
|
|
65
|
+
## The output contract
|
|
66
|
+
|
|
67
|
+
End every GOD-mode run with:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
GOD MODE — <task>
|
|
71
|
+
files: <what you created or changed>
|
|
72
|
+
verified: <the command you ran> → <pass/fail + evidence>
|
|
73
|
+
memory: <what you recalled, or "no prior art">
|
|
74
|
+
open: <anything you deliberately did not do, and why>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Handoff
|
|
78
|
+
|
|
79
|
+
When the work touches security, auth, payments, user input, or dependencies, follow with:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
/evil-mode <the files you changed>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
That is the adversarial half — it will try to break exactly what you just built.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kodelyth-ecc",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Production-grade AI coding toolkit — 70 agents (incl. devil-mode adversarial crew), 194 skills, 97 commands, parallel multi-agent commands, semantic intent routing, self-learning memory, and a built-in MCP server (16 tools / 6 prompts / 377 resources) that bridges to Claude Desktop, LangGraph, AutoGen, CrewAI, and OpenAI Agents SDK. Works with Claude Code, Windsurf, Cursor, Codex, Antigravity, OpenCode, Cline, RooCode, Aider, Kimi, and Gemini CLI.",
|
|
5
5
|
"author": "Kodelyth <github.com/sifxprime>",
|
|
6
6
|
"license": "MIT",
|