v0.5.0-kaizen — Hephaestus Kaizen Engine
Explore freely. Prove ruthlessly. The loop now improves itself.
This is the largest release since the project rebrand. The Kaizen Engine turns
Hephaestus from a hypothesis-driven improvement loop into a self-improving system
by adding a third face (Reflector), a belief workspace (Global Workspace analog),
containment for new deadlock modes, four idea channels that supply diversity at
volume, and crash-safe runtime infrastructure.
All 21 v0.5 issues (#52–#72) closed via PR #73.
191 tests pass. Praxis evidence bundle: .praxis/runs/v05-full-evidence.jsonl.
Highlights
- Belief workspace (
beliefs.yaml) — narrow, capacity-limited, single-writer
(Reflector). Hard cap 12 active beliefs. Every belief carries akill_criterion
(falsifiability contract). Capacity competition for entry. - Reflector agent — the third face. Shared-assumption extraction, relaxation
probe, perspective tour. Decorrelated model family from orchestrator. Runs
offline (idle / plateau), like human sleep consolidation. Writes only
beliefs.yamlandnarrative.md— never code, never hypotheses. relies_onfield + blame propagation — the load-bearing change. When a
hypothesis FAILs, blame propagates upward to every belief it relied on. Three
failures on B-X → B-X becomes a suspect. Schema-breaking: required on all
new hypotheses from this release forward.- Containment engine — authority matrix (28 role pairs, terminal referee
for every pair), suspect TTL (no permanent lockout), curiosity exemption
(Red Team blocks MERGE, never RUN), belief min-residency + eviction evidence,
frame-shift cooldown + ratchet hysteresis. - Four idea channels — analogy (cross-project lessons + casting), random-leap
(bisociation replay + dream mode + external entropy), affect (Brier calibration- mood modulation + boredom rotation), context (whisper inbox + morning
briefing + regime detector). All independently feature-flagged, default
disabled, separate daily budgets. Disabled = zero spend, zero artifacts.
- mood modulation + boredom rotation), context (whisper inbox + morning
- Provenance tagging — every hypothesis + merge carries a
provenancetag.
Per-channel hit-rate reports. A merge without provenance fails schema validation. - Tick transaction journal — durable, atomic write-and-rename, phase tracking,
operation-key idempotency, stale-lock recovery. Proves idempotent across
worker dispatch, blame propagation, merges, lessons, provenance, spend
accounting, channel output, and reflector consolidation. - Canary suite — 11 end-to-end scenarios: belief capacity 12/13, TTL expiry,
direct blame, authority coverage failure, ratchet restart, prompt-injection
isolation, disabled-channel zero side effects, deadlock recovery, eviction,
reflector shadow isolation, duplicate-tick idempotency, crash recovery.
Phase 0 — debt cleared (#52, #53, #54, #55)
- T2 Challenger / T3 Arbiter personas —
templates/SOUL.challenger.md(read-only,
blind, decorrelated, one rebuttal round) andtemplates/SOUL.arbiter.md(raw-evidence-
only, binding merge/reject, falsifiability). Bootstrap wiring. - Self-grade diff gate —
templates/scripts/self-grade-diff.py. Orchestrator
verdict cannot be more optimistic than mechanical evidence verdict. Wired into tick. - Pre-registration lock —
templates/scripts/prereg-lock.py. Locks metric,
threshold, direction,relies_onat dispatch. SHA-256 tamper detection. - Repo hygiene —
schema/tests_tmp/removed; tests promoted toschema/tests/;
.gitignoretripwires for Windows path artifacts.
Phase 1 — Belief workspace + Reflector (#56–#60)
schema/beliefs.schema.json— capacity cap 12,kill_criterion,blamed_by,
historical_beliefs[].relies_onon hypotheses → blame propagation → suspect detection.narrative.md— one-page project story, rewritten each consolidation.SOUL.reflector.md+reflector-dispatch.sh— three questions per run.- Stagnation / momentum signals in
state.json; suspect-belief hard rule in
orchestrator SOUL andprompts/tick.md.
Phase 2 — Containment (#61–#64)
- Authority matrix — 28 role pairs, every blocking state has a terminal referee
with timeout + safe-default HOLD. - Suspect TTL (default 5 ticks) — no permanent frame lockout.
- Curiosity exemption — belief-test hypotheses run from protected budget.
- Belief min-residency (M=3) + eviction audit log.
- Frame-shift cooldown (K=8) + ratchet hysteresis (one notch per R-window,
direction reversal requires full window of evidence).
Phase 3 — Idea channels (#65–#68)
- Analogy —
~/.hermes/lessons.jsonlcross-project corpus with dual writing
(concrete + denominalized abstract) + casting sessions. - Random-leap — bisociation replay (mid-distance ledger pairs), dream mode
(seeded entropy, generation/filtering separated), external entropy (arXiv/HN). - Affect — Brier calibration (confidently-wrong is costly, agreement NOT
rewarded), mood as parameter modulation, boredom → family rotation. - Context —
whispers/inbox (30s, weakest evidence), morning briefing,
regime detector. Security: external streams earn workspace entry through
capacity + competition, never write tobeliefs.yamldirectly.
Phase 4 — Provenance + measurement (#69)
provenancefield on hypothesis + merge records (elimination | analogy | replay | whisper | external | relaxation).- Per-channel section in
reports/<date>-tick.mdtemplate. - Rolling hit-rate aggregator script.
- A merge without
provenancefails schema validation.
Phase 5 — Runtime reliability (#70, #71, #72)
feature-flags.py— gradual rollout with safe defaults (shadow mode). Active
blocked untilreadiness-check.pypasses.tick-journal.py— durable transaction journal. Atomic write-and-rename,
phase tracking, operation-key idempotency, stale-lock recovery.channel-budget.py— atomic daily idempotent accounting with file locking,
stable operation keys, UTC reset.tick-runtime.pydeterministic wrapper with journal phase transitions;
tick-gate.shcallstick-runtime.py initas mandatory pre-tick hook.channel-dispatch.py— deterministic channel dispatcher..github/workflows/v05-ci.yml— full test matrix on every PR.- Canary suite — 11 scenarios, 19 assertions.
Bootstrap integration
bootstrap.sh—DF_REFLECTOR_*defaults, adapter extraction, template vars,
reflector profile install, v0.5 script copy, extra ledger dirs, registry update.bootstrap.ts—AdapterConfig.reflector_model/chain, decorrelation check
against orchestrator, profile install, v0.5 script copy, registry update.adapters/v7-alphaforge/project.yaml—reflector_model/reflector_chain
fields (deepseek ≠ claude orchestrator, satisfies decorrelation invariant).templates/prompts/tick.md— Phase 4 channel dispatch + reflector dispatch.
Invariants (enforced by tests)
- 191 tests pass across
schema/tests/(41 correction + 19 canary + 131 legacy). - A merge without
provenancefails schema validation. bootstrap.shbash syntax verified (bash -nclean).- Disabled channel =
0USD spend,0artifacts,0proposals. - Reflector writes only
beliefs.yamlandnarrative.md. - Authority matrix covers all role pairs; new profiles fail bootstrap without entry.
- Provider-chain decorrelation: orchestrator ≠ worker ≠ challenger ≠ arbiter ≠
reflector (bootstrapvalidateChainDecorrelation()fail-closed).
Migration from v0.4
bash migrate-ledger.sh .alphaforge/orchestrator/state.json --backupmigrate-ledger.sh converts v1 hypothesis files (empty relies_on) into v0.5
schema. The relies_on field is required (may be empty []) on all new
hypotheses from this release forward.
Install / upgrade
# Fresh install
curl -fsSL https://raw.githubusercontent.com/ddawnlll/hephaestus/main/install.sh | bash
# Upgrade existing
cd ~/.hephaestus && git pull && bash bootstrap.sh /path/to/project --adapter v7-alphaforgeWhat's next
- v0.6: channel dispatch hardening (deterministic pre-commit + cron-side enforcement).
- v0.6: reflector active-mode rollout (default shadow until readiness passes for
30 consecutive ticks across all deployed projects). - v0.6: cross-project lessons.jsonl consolidation endpoint.
Known limitations
- Reflector active mode requires readiness check + containment verified; default
is shadow mode (reflector_proposals.yaml, never touchesbeliefs.yaml). - Channel dispatch is wired in the tick prompt; deterministic channel-dispatch
scripting (pre-commit hooks, cron-side enforcement) is a hardening opportunity. bootstrap.shregistry update uses a Python heredoc — bashbash -npasses,
but preferbootstrap.ts(Bun) for new adapter work.
Full Changelog: https://github.com/ddawnlll/hephaestus/blob/v0.5.0-kaizen/CHANGELOG.md
PR: #73
Praxis Evidence: .praxis/runs/v05-full-evidence.jsonl