Skip to content

feat: rename diagnose to tune and add rich ANSI rendering for reflect#27

Merged
Lawouach merged 4 commits intomainfrom
feat/reflect-tune-render
Feb 28, 2026
Merged

feat: rename diagnose to tune and add rich ANSI rendering for reflect#27
Lawouach merged 4 commits intomainfrom
feat/reflect-tune-render

Conversation

@Lawouach
Copy link
Copy Markdown
Contributor

Summary

  • Renames --mode diagnose to --mode tune everywhere (CLI, narrative prompts, inspect output, comments) — clearer that it targets agent behaviour improvement, not generic diagnosis
  • Adds render_reflect(): a dedicated ANSI renderer for unlost reflect output with:
    • Mode badge at the top (blue for coach, magenta for tune, cyan for both)
    • Section headers in mode colour (bold)
    • Bullet points with cyan dash leader
    • Score values coloured green ≥ 0.65, yellow 0.35–0.65, red < 0.35
    • (low confidence) markers highlighted in yellow
    • turn N references dimmed cyan
    • Backtick code spans reuse existing colourizer

Changelog

  • unlost reflect --mode diagnose--mode tune: The agent-facing persona is now called tune throughout — CLI, prompts, inspect output, and comments — to make it clear the target is agent behaviour improvement, not problem diagnosis.
  • unlost reflect output now uses a dedicated ANSI renderer with coloured section headers, score colouring (green/yellow/red by value), confidence markers, and turn N reference highlighting.

Closes #26

@Lawouach
Copy link
Copy Markdown
Contributor Author

unlost found 5 recorded decisions from the coding session. unlost captures decisions made during a coding session and surfaces them at PR time so the team stays close to the code.

unlost context

What Changed

We added a new unlost reflect command that summarizes session quality from structured TurnEval telemetry and renders the report with richer ANSI output, while also renaming the agent persona from diagnose to tune. We also wired TurnEval reads and outcome backfill so reflect and recall paths can rely on populated per-turn metadata.

What we were navigating

We wanted reflect-time narratives that require no raw transcript, so we leaned on deterministic TurnEval and outcome hints plus an LLM only for narrative stitching, not data extraction as described in CHANGELOG.md. There was real uncertainty here around reconciling prior branch conflicts and making the rename pervasive without missing a CLI or prompt surface, as hinted by the recorded conflict history.

Behavioral Impact

  • New CLI surface area and flags for reflect via src/cli.rs.
  • Reflect output defaults to ANSI rendering with an opt-out path (--plain or --output plain) in src/cli.rs.
  • Sessions may show revised te_outcome_hint after checkpoints due to retroactive updates described in CHANGELOG.md.

Risks / Trade-offs

  • Backfilling outcomes via database UPDATE can change previously observed reflect results for the same session, which is intentional but can surprise downstream consumers. Cannot confirm from history -- would need the exact implementation in src/storage.rs or src/storage_checkpoint.rs.
  • Correctness-sensitive fallback or retry behavior was modified. Cannot confirm from history -- would need the specific diff hunk in src/commands/reflect.rs or src/commands/inspect.rs.

Ripple effects

  • The rename to tune affects any scripts, docs, or muscle memory that previously invoked diagnose mode, per the behavior note in CHANGELOG.md.
  • Automatic TurnEval backfill during reindex means historical sessions become reflectable without extra flags, changing what unlost reindex accomplishes. Cannot confirm from history -- would need the exact logic in src/commands/reindex.rs.

Left open

  • Pre-v0.13 tune channels are zeroed with a version marker because governor EMA state is unrecoverable from JSONL alone, per CHANGELOG.md. If we need higher fidelity, we will need an artifact that persists governor state snapshots.

Re-read this

  • CLI surface and defaults for reflect mode and output selection in src/cli.rs.
  • The reflect report generation and ANSI rendering implementation in src/commands/reflect.rs.

unlost -- local-first session memory.

@Lawouach Lawouach merged commit 38b7787 into main Feb 28, 2026
1 check passed
@Lawouach Lawouach deleted the feat/reflect-tune-render branch February 28, 2026 11:47
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.

feat: rename diagnose to tune + rich reflect rendering

1 participant