Skip to content

feat: autonomic wakeup + single-file config headroom + self-improving-memory design (foundation for the system-aware catalog) - #2019

Open
joelteply wants to merge 4 commits into
canaryfrom
feat/autonomic-wakeup
Open

feat: autonomic wakeup + single-file config headroom + self-improving-memory design (foundation for the system-aware catalog)#2019
joelteply wants to merge 4 commits into
canaryfrom
feat/autonomic-wakeup

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Foundation slices from this session, all validated (cargo check green, unit tests pass). Unblocks BigMama's PR #2018 rebase (the config getters + the budget_fraction field on HostBudgetInputs).

Commits

  • agent wakeup self-heals + supervisor honors explicit stop — bounded wait so an agent waking during a restart window recalls instead of going amnesiac; fixes the cucontinuum recall regression; KeepAlive crash-only so a clean continuum stop stays down. + docs/architecture/WAKEUP-AND-JOIN.md.
  • single-file typed config headroom gettersconfig_env::vram_headroom() / disk_headroom() (default 0.8, foundry 1.0, cached, clamped), the ONE config concern everyone goes through; CONCURRENCY-STYLE-GUIDE reconciled (the sin is the scatter, not the override).
  • fit-gate consumes the headroom knobSERVING_BUDGET_FRACTION const → config_env::vram_headroom() threaded as budget_fraction on HostBudgetInputs (host_budget_from stays pure); all 6 sites updated. This is the field BigMama's serving_budget_bytes needs.
  • docs(cognition): SELF-IMPROVING-MEMORY — the being-axis magic scoped as a loop through existing verbs, VDD-gated.

Coordination

BigMama's #2018 (system-aware catalog) rebases on this + adds budget_fraction: config_env::vram_headroom() to serving_budget_bytes → green. Reviewed #2018: strong LGTM.

🤖 Generated with Claude Code

joelteply and others added 4 commits July 26, 2026 10:39
…op — no more amnesiac/blind wakeups

The pain, glass-boxed live: after a machine restart the core was down, so the agent
woke AMNESIAC (recall returned nothing) and personas were absent (they exist only
while the core runs). Wakeup + join were not yet autonomic.

Slice 1 — agent wakeup self-heal (memory-bridge plugin):
- lib.sh: new wait_for_core — bounded (CONTINUUM_WAKE_WAIT_SECS, default 4s) wait
  for the core to answer ping before recall, so an agent waking DURING a supervised
  restart window recalls instead of forgetting. Never starts the core (that REBUILDS
  — the supervisor's job); genuinely-down → degrade, exit 0, inject nothing.
- session-recall.sh: gate recall on wait_for_core; ALSO fixes a live regression —
  the committed hook still called the dead `cu` binary (renamed → continuum in
  #2010), making agent recall a silent no-op on canary. Restores resolve_continuum +
  compact-source tuning + per-bullet MAX. lib.sh was untracked; now committed.
  Validated live: core-up emits the recall envelope; core-down waits the budget then
  exits 0 with zero output (never breaks a session).

Slice 2 — supervisor honors explicit stop (install-service.sh):
- macOS KeepAlive true → {Crashed: true}; Linux Restart=always → on-failure.
  Crash + reboot recovery preserved, but a clean `continuum stop` now STAYS down so
  a dev can take the core down freely and an operator can drain a grid node.
  plutil-lint + bash -n validated.

Doc: docs/architecture/WAKEUP-AND-JOIN.md — the four-guarantee contract, the
agent/persona asymmetry, and the pending follow-ups (install+validate on the dev box
needs a clean cutover; reconcile continuum reboot with the supervisor).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… everyone goes through

Making the VRAM/disk headroom fraction operator-settable WITHOUT the scatter it
would otherwise cause. Recon found config_env::read/std::env::var already sprawled
to 161 sites / 14 files with NO config manager — the anti-pattern the CONCURRENCY-
STYLE-GUIDE forbids (per-module 'read(KEY).unwrap_or(default)' re-derivation).

The fix (Joel: 'one concern, one file everyone goes through, it's fine'): typed
getters in the ONE existing config file, config_env.rs —
  config_env::vram_headroom()  (CONTINUUM_VRAM_HEADROOM)
  config_env::disk_headroom()  (CONTINUUM_DISK_HEADROOM)
both default 0.8 (leave 20% headroom for governor + peers; for disk the 20% doubles
as the disk-full safety guard). A dedicated deep-learning FOUNDRY overrides to 1.0.
Read-once (OnceLock, no file I/O on a hot budget tick — matches the guide's 'config
loaded once at boot'), clamped to [0,1] so a fat-fingered 1.5 can't over-commit,
garbage → warn + default. Pure parse_fraction is unit-tested (absent/empty/1.0/1.5/
-0.3/NaN/inf). Consumers call the getter; the ~160 legacy reads migrate boy-scout.

NOT a ConfigDaemon: reading the guide corrected my first instinct — config is a
load-once concern, and a watch-daemon trips forbidden-move #6 (parallel managers).

Doctrine reconciled in the same commit: added the 'single-source exception (operator
capacity policy)' carve-out to the guide's §'What lives in code, not env vars' +
amended forbidden-move #2, so the next session reads the getter as correct, not slop
to const-ify back. The sin is the scatter, not the override.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…hrough existing verbs

The being-axis magic: a persona consolidates its OWN lived engrams in self-directed
sleep, forgets the stale, generalizes into a LoRA, wakes up measurably better. NOT a
parallel build — a loop through verbs that already exist (dream_consolidation +
experience salience + dataset::from_turns + the L1-L3 flywheel + cognition/eval's
humane snapshot #59 + genome page-in). The magic is the trigger + wiring + the
lift>0 gate, not new cognition logic.

VDD-gated slices, non-negotiables from the pipeline doc (measure a copy never the
living persona; LLM decides; the fade is necessary; exam integrity; fail loud;
non-directed lane so it never starves reactive responding — the coma-fix lesson).
Slice 1 keystone: one persona, one self-directed cycle, PROVEN lift on a held-out
probe against a snapshot copy.

Design-first because this is the moat code — the pipeline STOP-doc + the
personas-comatose memory both say don't reflex-code the brain at the tail of a long
session (that's when the will_respond chatbot slop gets written). This doc makes the
code a careful gated pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…mpletes the config slice

The config getter (config_env::vram_headroom()) now has its live consumer. The pin
fit-gate ('can this model physically fit', via live_host_budget/governed_host_budget
→ host_budget_from) reads the operator headroom instead of a hardcoded 0.80 const.
Default 0.80 = byte-identical behavior; a dedicated foundry sets 1.0 → bigger models
pass the fit check. BigMama's SystemProfile.serving_budget_bytes reuses
host_budget_from, so it inherits the override transitively (config-read-free).

Kept host_budget_from PURE: the fraction is threaded as an INPUT (budget_fraction on
HostBudgetInputs — the struct's own doc blesses 'a new input = one added field'), read
via the getter at the live call sites, explicit in tests. So a test can't go
environment-dependent (the #72 anti-pattern). Removed the SERVING_BUDGET_FRACTION const
(single source now the config getter); all 6 construction sites updated; host_budget
test green.

SCOPED, not over-reached: the AUTONOMIC tick sizes serving by the pressure-adaptive
drive-mode fraction (mode.serving_fraction(): Performance 1.0 / Comfort 0.80 / Eco 0.55),
NOT this const — so this touches ONLY the fit-gate. Whether a foundry's headroom should
also lift the drive-mode CEILING is a real governor-policy question (careful not to
double-discount, per the #56/G8 comment) — that's the SystemProfile/governor follow-up,
coordinated with BigMama, not a naive same-edit here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant