Skip to content

Suggestions panel — the user-facing output of the contextualizer #83

@smorchj

Description

@smorchj

Context

Final user-facing piece of the contextualizer pivot (#77). Everything else feeds this. The learning model (#80, #81) produces scores; the session-end trigger (#82) converts score deltas into concrete suggestions; this issue renders them so the user can approve or dismiss in one click.

UI

New right-side panel in the main layout, sibling of TreeView and GraphView. Toggleable from the top bar. Shows an urgency-sorted list of pending suggestions.

Each suggestion card:

  • Title (human-readable): `packages/core/analyzer consistently missed by routing`
  • Severity (urgency score, color-coded): red/orange/yellow bar on the left edge
  • Reason (why the contextualizer thinks this): `Claude had to grep 3 times across 4 sessions before finding extractJsExports. 12 reads across 6 sessions, but the routing from root never sent it here.`
  • Affected node: click to highlight on graph
  • Proposed change: a preview of the CONTEXT.md diff (added/removed lines)
  • Actions: `Approve` (writes the edit and removes the suggestion), `Dismiss` (removes without writing), `Snooze 7d` (hides until next week)

Suggestion types

Backed by the learning model outputs:

  1. Add routing hint — a folder is consistently missed. Propose adding its name and key exports to the parent CONTEXT.md.
  2. Remove stale hint — a folder has zero reads in N sessions despite being in the routing. Propose removing or downgrading.
  3. Document tool — a bash command recurs without being mentioned in any CONTEXT.md. Propose adding it.
  4. Fix Claude's grep path — Claude repeatedly greps for a symbol that should be a direct reference. Propose adding a `symbol → file` pointer.
  5. Split overloaded node — a folder that gets 50+ reads per session across many files. Propose splitting into sub-nodes with more specific CONTEXT.md routing.

Each type is a strategy module: `packages/core/src/contextualizer/suggestions/{add-routing,remove-stale,document-tool,...}.ts`. Pure functions of `(learningState, graph) → Suggestion[]`.

Persistence

`.klonode/suggestions.jsonl` append-only. Status per suggestion: pending / approved / dismissed / snoozed-until. Loaded into the panel on startup.

Safety

  • Never auto-apply. Always user-approved.
  • Show the exact diff before approval.
  • Approval is revertible via git history like any manual edit.

Out of scope

Dependencies

Blocked by #79, #80, #81, #82. This is the last of the pivot line.

Part of the #77 pivot roadmap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions