# Changelog

## 0.6.0 (2026-05-16)

### Operating-system loop
- Good Life governance is now part of the engine loop, with lane-level posture, policy modes, bounded action cards, commitments, trends, and dashboard/operator API surfaces.
- Live problems are verifier-backed and user-actionable: deterministic checks, remediation logs, escalation state, manual intervention receipts, and re-check flow are exposed instead of stale status narration.
- Brain persistence and temporal retrieval were hardened with JSONL sidecars, brain snapshots, high-water protection, temporal state snapshots, and resolution receipts.
- Runtime posture now includes maintenance, memory topology, scheduler outcomes, publishing readiness, and substrate/claim-verification signals.

### Dashboard and agent surfaces
- Dashboard Home now includes Good Life/operator visibility, Workers, Query, Brain Map, live problem panels, brain storage visibility, and current update status from package metadata.
- Agent tools expanded to 49 registered tools, including COSMO research tools, brain query/export/graph tools, workers, skills, cron, media/TTS, and governed memory promotion.
- Worker packs and shared skills are exposed as reusable operator capabilities rather than one-off helper scripts.

### Bundled systems
- COSMO23 Query/PGS behavior was repaired: small completed brains use direct Query and one-partition PGS skips fake cross-partition synthesis.
- Evobrew brain discovery now inherits Home23-managed and external roots so generated config does not narrow the picker.
- Provider/catalog work continued across Anthropic, OpenAI Codex, MiniMax, xAI, Ollama Cloud, image generation, and media tooling.

### Documentation
- README, manifest, package metadata, and dashboard welcome/version surfaces were refreshed so the public repo describes the current app instead of the April-era v0.5.5/v0.1.0 surfaces.

## 0.5.5 (2026-04-14)

### Mobile-first /home23/chat page (iOS Safari)
The standalone chat page was rewritten for mobile without touching the chat
interaction logic — `home23-chat.js`, the tile on the home dashboard, and the
expand-to-overlay behavior are all unchanged. Only the standalone `/home23/chat`
shell was replaced.

- 100dvh root + `visualViewport` listener lifts the input bar above the
  on-screen keyboard on iOS Safari
- Safe-area insets for notch, home indicator, and landscape sides
- Compact header: hamburger + tappable agent/model title + new-conversation
- Bottom sheet for agent + model selectors (iOS-style)
- Slide-in history drawer from the left with backdrop dim / tap-to-close
- 17px message text, 48×48 send button, 16px input font-size to prevent
  iOS zoom-on-focus
- PWA meta (`apple-mobile-web-app-capable`, `theme-color`) so Add to Home
  Screen gives a fullscreen app with no Safari chrome
- Particles kept at all sizes; scales up to 880px centered on tablet/desktop

### Per-slot cognitive model assignments UI
Every place the engine calls out to a model is now user-selectable from
Settings → Models → Cognitive Assignments, with optional fallback chains.
Closes the gap where the only dashboard control was the blunt Engine Roles
sweep (thought/consolidation/dreaming/query) which rewrote every
`modelAssignments` key uniformly.

- `engine/src/core/config-loader.js` — new `applyInstanceModelAssignments()`
  deep-merges per-slot overrides from `instances/<agent>/config.yaml →
  modelAssignments` onto the base. Runs AFTER the sweep so per-slot wins.
- `GET/PUT /api/settings/model-assignments` — returns effective assignments
  + provider→models catalog; PUT persists only keys that diverge from base
  (keeps config clean), then pm2-restarts the target agent's engine.
- New Cognitive Assignments section in the Models tab — 15 slots grouped
  by purpose (Cognition / Agents / Coordination / Goals / Default). Each
  row: human-readable label + raw key, a `?` info button with per-slot
  "what this slot does" + "Pick:" guidance on model trade-offs, primary
  provider + model selects (model list repopulates on provider change),
  and an add/remove fallback chain.

Known caveat (left intentionally): the old Engine Roles "thought" dropdown
still runs first as a sweep. Users going per-slot should park the four
Engine Roles dropdowns on "Use Default" so the sweep doesn't mask
untouched slots. Removing the sweep is a follow-up.

### Pi sensor integration + sauna usage logging
- New `engine/src/core/integrations/pi-sensor.js` — client for the Pi
  (jtrpi/Axiom) dashboard API pulling barometric pressure, temperature,
  and external data.
- `sensors.js` polls pressure on a 5-min interval, caches it, and surfaces
  it in `getSensorContext()` for CHAOS MODE overlays.
- Sauna state-transition detection — appends `start`/`stop` events to
  `~/.sauna_usage_log.jsonl` from both `sensors.js` and `home23-tiles.js`
  so usage patterns are reconstructable regardless of which poll path saw
  the change first.

### Operational
Diagnosed the "No content received from GPT-5.2" errors in the live
cosmo23-jtr agent (runs from `/Users/jtr/_JTR23_/cosmo-home_2.3/`, not this
release repo). Root cause cascade: ollama-cloud 429 rate limits → no
fallback configured for `quantumReasoner.*` → falls through to parent
GPT5Client → expired `OPENAI_API_KEY` (401). Key was rotated and the
cosmo-home_2.3 engine processes (cosmo23-jtr, cosmo23-terrapin + their
dash/feeder) stopped in favor of migrating to this release. The live
agents (cosmo23-edison, coz, home, tick) remain running for incremental
migration.

## 0.5.4 (2026-04-14)

### Engine-side Anthropic stealth headers for OAuth tokens
UnifiedClient's Anthropic provider now sends the same stealth headers the
TS harness already uses (src/agent/loop.ts getStealthHeaders). Without
these, `sk-ant-oat*` tokens are rejected with "OAuth authentication is
currently not supported." The engine Anthropic path now mirrors the
harness exactly — Claude-family models (claude-sonnet-4-6, claude-opus-4-6)
work as PGS synthesis providers, as compiler models, and anywhere else
UnifiedClient routes to Anthropic.

Headers added when the auth token starts with `sk-ant-oat`:
- accept: application/json
- anthropic-dangerous-direct-browser-access: true
- anthropic-beta: claude-code-20250219,oauth-2025-04-20,
  interleaved-thinking-2025-05-14,extended-cache-ttl-2025-04-11
- user-agent: claude-cli/2.1.32 (external, cli)
- x-app: cli

The TS harness (src/agent/loop.ts) and engine UnifiedClient must stay in
sync on this header set. A comment in both files calls this out.

## 0.5.3 (2026-04-14)

### PGS works with any model + dual-model sweep/synthesis control
Initial PGS implementation hardcoded gpt-5-mini for sweep + synthesis. Now:

- `/api/pgs` accepts `sweepModel`, `synthesisModel`, `sweepProvider`,
  `synthesisProvider` — caller picks the model per phase.
- Provider is auto-resolved from model name via home.yaml lookup
  (MiniMax-M2.7 → minimax, claude-sonnet-4-6 → anthropic, etc.).
- Provider-specific generate method called directly (bypasses
  getModelAssignment which returned null for pgsEngine.*). Supports
  minimax / anthropic / openai / openai-codex / xai / ollama-cloud / local.
- Dashboard server now loads the full engine config (base-engine.yaml +
  home.yaml providers + secrets.yaml keys) on /api/pgs so UnifiedClient
  can init all provider SDKs. Previously only OpenAI was initialized.
- `brain_pgs` tool surfaces sweepModel/synthesisModel/sweepProvider/
  synthesisProvider args. Tool description calls out the dual-model
  design (cheap/fast for many parallel sweeps, stronger for single synthesis).
- Response metadata now reports which sweep + synthesis models actually
  ran so the caller can see what was used.

Verified live:
- MiniMax-M2.7-highspeed sweep + MiniMax-M2.7 synthesis: end-to-end synthesis
- MiniMax-M2.7-highspeed sweep + grok-4-0709 synthesis: cross-provider routing
- claude-sonnet-4-6 synthesis surfaces a separate Anthropic OAuth-auth
  issue (Home23 uses sk-ant-oat* tokens which need stealth headers; the
  direct Anthropic SDK rejects them). Tracked separately.

## 0.5.2 (2026-04-14)

### Full brain-tier access for Jerry (all query layers exposed)
Jerry previously had 3 brain tools with 2 of 9 query modes. Now has 6 tools
covering every layer of brain access.

- **brain_query** expanded to all 9 QueryEngine modes: fast / normal / deep /
  raw / report / innovation / consulting / grounded / executive. Each mode
  trades context breadth for reasoning depth. `executive` mode accepts a
  baseAnswer for compression of prior answers.
- **brain_memory_graph** (new): structural view via GET /api/memory —
  cluster sizes, top-activated nodes, tag histogram. Use for "what's the
  shape of the brain right now".
- **brain_synthesize** (new): triggers POST /api/synthesis/run for
  meta-cognition. action="run" then action="status" (async ~30s).
- **brain_pgs** (new): Progressive Graph Search via new POST /api/pgs
  endpoint. Partition (Louvain) → route → parallel LLM sweeps → synthesize.
  Coverage-optimized; reports absences and cross-domain connections. Uses
  cosmo23/pgs-engine library with a UnifiedClient shim as sweep + synthesis
  providers. Lazy-loaded so it doesn't affect startup.

### Context-assembly no longer lies when brain is busy
Previously, context-assembly's 5s brain probe would time out during heavy
engine activity (coordinator review), mark the brain DEGRADED, and inject
"Brain unreachable. Treat prior context as unverified" into Jerry's system
prompt. Jerry read his own prompt and told users "brain not connected" —
which was false.

Now:
- Probe timeout raised to 20s (brain searches 26k+ nodes during stress can
  exceed 5s).
- If the probe still times out, the degraded branch now loads domain
  surfaces (cheap local reads, unaffected) and tells the agent "brain
  probe skipped this turn — call brain_status / brain_search / brain_query
  directly if you need brain data" instead of declaring unreachability.

### /api/state (v0.5.1 carried forward)
Lightweight projection + 30s mtime-invalidated cache (was serving the full
~185MB state file on every request, causing timeouts).

## 0.5.0 (2026-04-14)

### Tool-capable quantum reasoner (Phase 2 of thoughts→action)
Cognitive cycles can now call tools mid-thought to ground their reasoning in
real data instead of working from cached memory alone.

**New module** `engine/src/cognition/cycle-tools.js` — exposes a curated set of
tools to the quantum reasoner via Anthropic tool-use format:
- `read_surface` — read TOPOLOGY.md / PROJECTS.md / PERSONAL.md / DOCTRINE.md /
  RECENT.md / BRAIN_INDEX.md / SOUL.md / MISSION.md / COZ.md / HEARTBEAT.md
- `query_brain` — search brain memory for relevant nodes
- `get_recent_thoughts` — see the agent's recent cognitive output
- `get_active_goals` — view goals the agent is pursuing
- `get_pending_notifications` — check actions the agent has already queued

**Tool-use continuation loop** in `quantum-reasoner.js` — the branch LLM call
now iterates: emit tool_use → execute → feed result back via tool_result →
repeat until the model produces a final text answer. Preserves the full
content array (text + thinking + tool_use) across turns for proper Anthropic
multi-turn semantics. Aggregated thinking from all tool-use turns is returned
as the final reasoning.

**unified-client.js** returns `rawContent` alongside parsed text/thinking/toolCalls
so downstream callers can reconstruct the conversation accurately.

**Safety:** no hard call limit (per explicit design direction). A safety
ceiling of 20 iterations exists as a runaway guard for bugs, not policy.
Per-result truncation at 4KB to avoid blowing the context window on huge
surface reads.

**Live verified** (cycle 1976 analyst): branch made 5 tool calls over 3
iterations (read RECENT.md, PROJECTS.md, BRAIN_INDEX.md, MISSION.md,
HEARTBEAT.md), then produced a grounded thought about jtr's actual work:
  "The natural next build is the correlation analysis view — all three
  streams (pressure, health, sauna) now land on the Mac..."
Zero mention of loop closure or Home23 internals. The brain is now operating
on jtr's world.

## 0.4.1 (2026-04-13)

### Redirect cognitive cycles toward jtr's world
After v0.4.0, personas successfully absorbed loop-closure reframing but then
got stuck on meta-reflection — every INVESTIGATE was "investigate the enforcer
mechanism further." System-internals became a local attractor.

- Self-diagnosis moved from prompt OPENING to a terse footer. Still visible
  for audit but no longer primes reflection.
- Focus Directive added at top of every role prompt: "Your job is to produce
  thought that helps jtr — his projects, his interests, his real world.
  DO NOT reflect on Home23's cognitive architecture."
- curiosity/analyst/critic/proposal role prompts rewritten to target jtr's
  world with explicit Forbidden Topics list.
- First post-fix cycle (1973 curator) immediately shifted focus: "For Home23's
  user (jtr), the priority should be whether these hypotheses have resolved
  or need manual grounding."

## 0.4.0 (2026-04-13)

### Thoughts → Action (Phase 1 of 2)
Cognitive cycles now produce real consequences instead of just journal entries.
The brain stops talking to itself and starts doing things.

**Role prompts rewritten (A)** — curiosity, analyst, critic now require a
structured action tag appended to each thought:
  - `INVESTIGATE: <specific thing>` — spawns a research agent task
  - `NOTIFY: <message>` — queues a user notification
  - `TRIGGER: <condition>` — adds a standing monitor
  - `NO_ACTION` — thought was reflection only (allowed)

**Thought-action parser (new module `engine/src/cognition/thought-action-parser.js`)**
parses structured tags from the thought's hypothesis and routes:
  - Notifications → `instances/<agent>/brain/notifications.jsonl`
  - Triggers → `instances/<agent>/brain/trigger-index.json`
  - Investigations → spawns a research agent (falls back to notification)

**5th cognitive role: PROPOSAL (B)** — explicitly tasked with producing one
concrete action given recent cognitive output. Never produces NO_ACTION.
Rotates alongside the other four roles.

**Notifications queue + dashboard UI (D)** — new endpoints:
  - `GET /api/notifications` — list pending actions
  - `POST /api/notifications/:id/ack` — acknowledge one
  - `POST /api/notifications/ack-all` — acknowledge all
Pulse bar shows badge (🔔 N) when pending actions exist, click opens a panel
to review/acknowledge.

**Standing triggers (E)** — thoughts that emit `TRIGGER:` append to the
existing `trigger-index.json`, leveraging the reactivation infrastructure
already in place (Step 20 situational awareness engine).

**Quantum reasoner user message tuned** — the generic "One concise insight"
user message was undercutting the role prompt's action-tag instruction.
Updated to reinforce the action-tag requirement from the role prompt.

### Still TODO (Phase 2, next session)
- **Tool-capable quantum reasoner (C)** — let cycles make tool calls mid-thought.
  Requires multi-turn tool_use loop in the reasoner, which is a significant
  refactor of its parallel-branch architecture.

## 0.3.3 (2026-04-13)

### Self-diagnosis at cycle start + reframe note
- Self-diagnosis block now fires at the very top of every cycle (after run_id
  generation), before any cognitive work or conditionals. No early-return path
  can bypass it.
- Verdict is stated up front as `COMPLETE — durable learning proven` because
  the enforcer in the finally block structurally guarantees closure. The
  diagnosis is an assertion of the mechanism, not a probabilistic validation.
- Added `note` field reframing the enforcer as a strength rather than a
  limitation: "Enforcer fallback guarantees every stage always closes. This is
  not a limitation — it is the mechanism that makes learning provably durable
  every cycle." This responds to personas starting to describe the enforcer
  as a "self-limiting pattern" in cycle 1967.

## 0.3.2 (2026-04-13)

### Evidence loop hardening (final)
- Self-diagnosis block now injects into ALL four role prompts (previously only
  curator + analyst). Curiosity + critic were pulling 100+ cycles of stale
  "loop incomplete" brain context and regurgitating it; they now see the
  current closure verdict before thinking.
- Bulletproof try/finally: evidence setup (generateRunId, loadPrevRunId) moved
  inside the try block. If setup throws, the finally-block enforcer still runs
  with a freshly-generated run_id as safety net.
- Fallback cycle_error receipt written if the enforcer itself throws — the
  chain never silently drops a cycle.
- `learning_proven_durable` verdict decoupled from historical chain breaks —
  each cycle reports its own closure on stages + fixture + no divergence.
- Report unique stages covered (5/5) instead of total receipt count (6/5) —
  audit stage fires twice on natural completion.
- Diagnosis format matches spec: JSON block + human-readable verdict line
  ("All stages accounted for. The living brain loop is closed and durable.")

## 0.3.1 (2026-04-13)

### MiniMax-M2.7 integration pass
- Streaming: harness now uses `messages.stream()` instead of `messages.create()`.
  Text and interleaved thinking deltas arrive in the dashboard chat as MiniMax
  generates them — TTFT drops from 5–15s to ~500ms. Tool loop semantics
  preserved via `stream.finalMessage()`.
- Dashboard chat accumulates thinking deltas into a single rendered block
  instead of spawning one `<div>` per delta event
- Cache hit-rate improved by raising engine-side threshold from 1024 → 4096
  chars. Engine has many small per-call prompts that would write without ever
  being re-read — writes cost 1.25× base, so net-negative without hits. The
  harness identity prefix (~11k tokens) still caches aggressively.
- `AgentEvent` type extended with `cache` variant — dashboard surfaces token
  read/write economics per turn.

## 0.3.0 (2026-04-13)

### Cognitive Evidence Schema (Step 23)
- New `engine/src/core/evidence-receipt.js` — cryptographic run_id/prev_id chain
- Five stage receipts per cycle: ingest, reflect, memory_write, behavior_use, audit
- Canonical nonzero fixture guarantees at least one inspectable artifact per cycle
- Side-by-side audit compares control metadata vs workspace vs registry to catch divergence
- Full-loop enforcer in orchestrator `finally` block fills any missing stages with
  `no_change_detected` fallback — guarantees closure even when cycles error or early-return
- Self-diagnosis block injected into curator/analyst prompts and logged visibly as
  `COMPLETE — durable learning proven` / `INCOMPLETE`
- Receipts persisted to `instances/<agent>/brain/evidence-receipts.jsonl`

### Feeder Hardening
- Concurrency-limited compile queue (default 3 parallel) eliminates 429 rate-limit
  avalanches on bulk folder ingestion
- Compiler supports dual SDK — Anthropic messages API for minimax/anthropic providers,
  OpenAI chat completions for everyone else
- Reasoning-model content-block handling (MiniMax-M2.7 returns `thinking` + `text` blocks,
  compiler now extracts the `text` block correctly)
- Fixed `home.yaml` path resolution for provider lookup
- `updateModel()` on the running compiler — hot-apply from Settings UI actually takes effect

### Settings UI
- Compiler Model and Vision Model are now select dropdowns populated from all provider
  `defaultModels` (previously free-text inputs with no guidance)
- Hot-apply endpoint calls `compiler.updateModel()` so dashboard changes update the
  running instance without a restart

## 0.2.0 (2026-04-13)

### Provider Authority
- Home23 is the single authority for all provider configuration
- Guided onboarding wizard for first-run (Providers -> Agent Create -> Launch)
- COSMO 2.3 and evobrew show "Managed by Home23" UI when running under Home23
- Single encryption key flows from secrets.yaml to all subsystems
- OAuth wiring fixed — ENCRYPTION_KEY and DATABASE_URL reach cosmo23 via PM2

### Update System
- `home23 update` — one command updates everything (code, deps, build, migrate, restart)
- Semantic versioning with tagged releases
- Self-healing `ensureSystemHealth()` runs on every start
- Migration system for breaking changes between versions
- Dashboard shows notification when updates are available
- `evobrew update` and `cosmo23 update` deprecated — bundled systems update with core

### Infrastructure
- COSMO 2.3 health watchdog in dashboard — auto-restarts if process dies
- Dashboard COSMO tab shows actionable offline state with restart button

## 0.1.0 (2026-04-07)
- Initial release — cognitive engine, agent harness, dashboard, evobrew, cosmo23
- Telegram channel integration
- Document ingestion with LLM-powered compiler
- Intelligence synthesis agent
- Brain map visualization
- Agent research toolkit (11 COSMO tools)
- Situational awareness engine
