Skip to content

stella-observatory: surface context.db's self-improvement plane — promotion audit trail, episodes, selection health #1871

Description

@macanderson

Problem

The dashboard's self-improvement view reads reflections.jsonl, the store's reflections/execution_reflection tables, and .stella/skills files — but nothing reads context.db, where the actual self-improvement machinery leaves its audit trail:

  • context_records (crates/stella-context/src/store/schema.rs, v8; kinds in crates/stella-core/src/context_record/kind.rs): append-only observationrecord_proposalpromotion_event lineage — the full story of how a recurring lesson became a skill, with ABORT triggers guaranteeing immutability.
  • episode rows (summary, files_touched, outcome, salience) — episodic memory with no dashboard surface.
  • Selection health / retirement (crates/stella-cli/src/memory/uses.rs::selection_health, retirement.rs) — which injected context is earning its tokens.

The Sessions tab now shows skills used per session; the lifecycle that created those skills is invisible.

Build

A read-only context.db module in the observatory (same SQLITE_OPEN_READ_ONLY + is_missing_schema degradation as db.rs; path <root>/.stella/private/context.db): a promotions timeline (context_records folded by lineage_id), an episodes list, and a proposals/cooldown view. Surface on the Self-improve tab. Note schema_conformance.rs gains a second real-schema gate: build context.db through stella-context's real migration path (dev-dependency, same bargain as stella-store).

Verify

Witness: seed an observation → proposal → promotion_event lineage via the real write API, assert the route returns the lineage — fails on main (route absent). Empty/missing context.db degrades to empty payloads.

Constraints

Episode↔execution linkage is by summary-tag convention only (see crates/stella-cli/src/memory.rs #1042 trace pointer note) — do not invent a join that does not exist; render what is there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Polish — worth doing, not urgentarea:observatorystella-observatory — telemetry dashboard, fsviewfeatureNew capability or improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions