Skip to content

feat: web dashboard for browsing and managing memories#537

Open
ryanhill4L wants to merge 20 commits intotoejough:mainfrom
ryanhill4L:ryanhill/add-frontend
Open

feat: web dashboard for browsing and managing memories#537
ryanhill4L wants to merge 20 commits intotoejough:mainfrom
ryanhill4L:ryanhill/add-frontend

Conversation

@ryanhill4L
Copy link
Copy Markdown

Summary

  • Adds engram serve CLI subcommand that starts an HTTP server on 127.0.0.1:3001 with browser auto-open
  • Creates internal/server/ package with full REST API: list/detail/stats/projects/surface/activity endpoints plus update/delete mutations — all using dependency injection, no direct I/O
  • Builds a Vite + React 19 + TypeScript + shadcn/ui + Tailwind 4 dashboard in frontend/ with:
    • Dashboard: stat cards, quadrant donut chart, effectiveness histogram, sortable/filterable memory table
    • Memory detail: SBIA display, effectiveness metrics, edit form, delete with confirmation
    • Surface simulator: enter a prompt, see scored results with near-misses
    • Project overview: per-project stats and quadrant breakdowns
    • Activity timeline: derived from memory TOML timestamps, paginated
    • Polish: empty states, loading skeletons, error boundaries, keyboard navigation
  • Adds Effectiveness() and Quadrant() computed methods to the memory package
  • Renames internal/contextinternal/sessionctx to avoid stdlib collision

Implementation notes

  • 19 commits covering US-001 through US-016 from the frontend initiative spec
  • All Go code follows existing DI patterns — server takes injected MemoryLister/Surfacer interfaces
  • targ check-full passes (lint, coverage, nilaway, dead code, thin-api, decl order)
  • npm run build and npm run lint pass clean
  • Frontend proxies /api/* to the Go server in dev; production builds are static assets

Test plan

  • targ check-full — all Go checks pass
  • cd frontend && npm run build — TypeScript + Vite build clean
  • cd frontend && npm run lint — ESLint clean
  • Manual: engram serve opens browser, dashboard renders with real memory data
  • Manual: edit a memory via the form, confirm TOML file updates
  • Manual: delete a memory, verify soft-delete behavior
  • Manual: surface simulator returns scored results for a prompt
  • Manual: empty data directory shows empty states on all pages

🤖 Generated with Claude Code

ryanhill4L and others added 20 commits April 7, 2026 13:54
…y package

Add Effectiveness() and Quadrant() methods to Stored type for computing
memory impact metrics. Effectiveness returns followed/total ratio.
Quadrant classifies into working/hidden-gem/leech/noise/insufficient-data
based on effectiveness threshold (50%) and surfaced count vs median.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ects)

Add GET /api/memories/{slug} with path traversal validation, 404 handling,
and pending evaluations array. Add GET /api/stats with aggregate counts,
avg effectiveness, and quadrant distribution. Add GET /api/projects with
per-project stats sorted alphabetically. Add PendingEvaluations field to
memory.Stored and wire through ToStored for detail endpoint access.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 'serve' case to cli.go dispatch switch with --port flag (default
3001) and --data-dir flag. Wire real Retriever into Server, bind HTTP
listener to 127.0.0.1:{port}, open browser on startup (open/xdg-open),
and graceful shutdown on SIGINT/SIGTERM via signalContext().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implement memory detail at /memories/:slug with SBIA sections, effectiveness
metrics, metadata (including createdAt piped from TOML), pending evaluations
table, 404 handling, and back navigation to dashboard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add PUT /api/memories/{slug}, DELETE /api/memories/{slug}, and
POST /api/memories/{slug}/restore endpoints with DI-injected
dependencies (MemoryModifier, FileOps interfaces) for testability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add GET /api/surface?q=...&project=... endpoint that runs BM25 scoring
and returns structured results with scores. Uses thin wrapper approach
calling retriever + BM25 directly from server package, avoiding surface
pipeline stages (haiku gate, transcript suppression, etc.) irrelevant to
the API. Returns JSON with matches and nearMisses arrays, each with slug,
bm25Score, finalScore, situation, and action fields.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add GET /api/activity endpoint that synthesizes events from memory
timestamps (created_at, updated_at, pending_evaluations[].surfaced_at).
Events sorted newest-first with page/limit pagination. Frontend page
shows paginated event list with colored type badges and Load more button.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add skeleton loading placeholders, error boundaries with retry buttons,
and keyboard navigation across all frontend pages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The targ check-full suite had 5 failing checks (lint-full, coverage,
deadcode, check-thin-api, check-nils). This commit addresses the
issues within our control:

- Add frontend/go.mod to exclude node_modules from Go tooling.
  The flatted npm package ships Go source files that triggered 59
  lint issues and all 7 check-thin-api failures. A module boundary
  stops all standard Go tools; check-thin-api still needs a targ
  update to respect go.mod boundaries.
- Rename internal/context to internal/sessionctx to avoid conflict
  with the stdlib context package (revive var-naming violation).
- Fix varnamelen (pe -> pendingEval, ts -> timestamp), wsl
  whitespace, and wrapcheck (wrap os.* errors in serve.go DI
  wrappers) lint violations.
- Suppress gosec G117 on APIToken/AccessToken struct fields that
  are CLI flag structs and keychain payloads, not logged secrets.
- Remove dead error-handling branch in resolveToken — the
  tokenresolver.Resolve method never returns a non-nil error.
- Add tests for anthropic.Client.Caller, osFileOps (MkdirAll,
  Rename, Stat), and surface recordInstrumentation error paths
  to satisfy the 80% per-function coverage threshold.

AI-Used: [claude]
Add nilaway nil guards in test files for gomega+nilaway compatibility,
suppress react-refresh lint on shadcn/ui variant exports, and add
postinstall script to remove flatted's Go bindings from node_modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e removal)

Update field access from flat Behavior/Impact/Action to Content.Behavior
etc., replace removed retrieve package with listerAdapter wrapping
memory.Lister, and update all test struct literals.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ryanhill4L ryanhill4L force-pushed the ryanhill/add-frontend branch from a1f6b09 to 14148f1 Compare April 7, 2026 18:08
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