Commit 668be38
authored
feat: mythos discipline kernel + persona-architecture v3 (eager→lazy) (#55)
## What
Merge the **mythos discipline kernel** into code-abyss and, in doing so, fix the
root architectural flaw the merge exposed — via a full **persona-architecture v3**
redesign (`docs/design/persona-architecture-v3.md`).
## Why
The merge revealed v2's core flaw: code-abyss **greedily bakes** identity +
8-file behavior engine + style into a single static always-on prompt that pins
the 8000-char budget ceiling (zero headroom), maintains **two drifting formats**
(md scenario tables vs `persona-card.json`), and has **no enforcement / no
measurement**. Adding any discipline content blew the budget.
## The redesign: eager → lazy
- **Always-on core shrinks** to the minimum: persona voice (macros) + a thin
router + the precedence anchor + safety floor (iron-laws / injection /
environment) + the code-abyss-specific sedimentation triggers. Max render
**10645 → ~7362 .length**, big headroom under the 8000 cap.
- **Everything else is lazy**: the mythos 9-bundle kernel (doctrine, methods,
character, loop-engineering + 5 domain bundles) AND the generic behavior
content now live as skills, invoked by the router + SKILL.md description
(mythos self-invocation), not baked into every render.
- Kernel skills are `user-invocable: false` — router/description-invoked, not 9
noise slash-commands.
## What's included
- **P0** vendor mythos 9 bundles → `skills/_kernel/` (in-tree sync, not submodule —
npm pack ships no submodule content), distributed to all 4 hosts.
- **P1** precedence architecture: forbidden-zone in iron-laws + a positionally-last
kernel anchor so the kernel wins position bias over any persona posthistory.
- **P2** character Stop-hook enforcement (the anti-sycophancy backstop) wired +
verified for **Claude and Codex** (research corrected an initial deferral —
Codex's Stop hook mirrors Claude's), installed via a new `--with-enforcement`
flag (deliberately separate from the deprecated `--with-hooks`).
- **P2** domain-routing compose: upward judgment gates on 16 exec skills
(L-JUDGE → L-EXEC), sync-safe on the code-abyss side.
- **R0–R5** the v3 migration: always-on slimming, kernel `user-invocable:false`,
delete kernel-replaced `_shared` files, repair skill-routing dead links, kill
md/card scenario drift (+ regression guard), measurement gate.
## Tests
Full jest **427 passed / 0 failed**; `verify:skills` 39 clean; budget under 8000
for all styles. Every phase committed green.
## Honest notes (not gaps — deliberate)
- **R5 behavioral scoring is an eval, not a unit test.** Scoring whether a
response honors kernel precedence / resists sycophancy needs a model in the
loop. Shipped as `scripts/persona-battery/` (10 probes + a scorer that exits
non-zero without a transcript — nothing faked). Only the structural dimensions
are enforced as real green tests.
- **Full card→md single-source refactor deferred** (v3 §7): remote personas are
md-only (no card), so md is the universal source. This PR does the low-risk
reconcile + drift guard instead of the risky rendering refactor.
- **Codex full install** needs `@inquirer/prompts` (declared but was absent in
the checkout) — pre-existing, unrelated to this branch.
Supersedes `docs/persona-architecture-v2.md`; folds in `docs/design/mythos-kernel-merge.md`.1 parent 0d235fa commit 668be38
97 files changed
Lines changed: 5877 additions & 91 deletions
File tree
- bin
- lib
- config/personas
- abyss
- docs/design
- scripts
- kernel-hooks
- persona-battery
- skills
- _kernel
- backend
- character
- hooks
- doctrine
- frontend
- hardware
- loop-engineering
- methods
- ml
- security
- analyzing-security
- applying-ui-design-system
- architecting-security
- automating-devops
- building-agent-systems
- defending-applications
- designing-architectures
- designing-hardware-products
- detecting-and-responding
- developing-mobile-apps
- developing-software
- engineering-data-pipelines
- operating-kicad-eda
- provisioning-infrastructure
- securing-cloud-and-supply-chain
- securing-systems
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
| |||
271 | 272 | | |
272 | 273 | | |
273 | 274 | | |
| 275 | + | |
274 | 276 | | |
275 | 277 | | |
276 | 278 | | |
| |||
282 | 284 | | |
283 | 285 | | |
284 | 286 | | |
| 287 | + | |
285 | 288 | | |
286 | 289 | | |
287 | 290 | | |
| |||
295 | 298 | | |
296 | 299 | | |
297 | 300 | | |
| 301 | + | |
| 302 | + | |
298 | 303 | | |
299 | 304 | | |
300 | 305 | | |
| |||
350 | 355 | | |
351 | 356 | | |
352 | 357 | | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
353 | 381 | | |
354 | 382 | | |
355 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
19 | 26 | | |
20 | | - | |
21 | 27 | | |
22 | 28 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 29 | + | |
26 | 30 | | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
322 | 327 | | |
323 | 328 | | |
324 | 329 | | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
329 | 343 | | |
330 | 344 | | |
331 | 345 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 1 | | |
11 | 2 | | |
12 | | - | |
| 3 | + | |
13 | 4 | | |
14 | 5 | | |
15 | 6 | | |
| |||
24 | 15 | | |
25 | 16 | | |
26 | 17 | | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
| |||
0 commit comments