MVP client-demo readiness: correctness fixes, SQLite drafts, HTTP API, web UI - #1
Open
denl95 wants to merge 20 commits into
Open
MVP client-demo readiness: correctness fixes, SQLite drafts, HTTP API, web UI#1denl95 wants to merge 20 commits into
denl95 wants to merge 20 commits into
Conversation
…oints Wraps the compiled LangGraph pipeline in a Hono server: src/runManager.ts drives runs in-memory and streams progress events; src/server.ts exposes POST/GET /runs, GET /runs/:id/events (SSE), /drafts endpoints, and POST /drafts/:id/publish. Also calls resetSearchCount(threadId) once a run reaches a terminal state so the per-thread search-counter map in src/tools/search.ts doesn't grow unbounded across the server's lifetime.
… reappear after approval
…ng, run cleanup, topic validation
CostTracker (and any other graph-level callback) was silently dropped because each node built a fresh RunnableConfig for its inner .invoke() call instead of merging the config passed into the node. Verified via a live end-to-end run: cost_usd was 0 before this fix, non-zero after.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the plan in
docs/superpowers/plans/2026-07-15-mvp-client-demo.md(spec:docs/superpowers/specs/2026-07-15-mvp-client-demo-design.md) to makecontent-creator-agentdemo-ready for prospective agency clients.Correctness fixes
word_count/channel(previously missing, making the "±10%" rule unenforceable) and the Editor now judges tone against retrieved brand-style excerpts instead of blindNew capabilities
CostTracker)src/db.ts,bun:sqlite) as the source of truth; Notion publishing is now optional/on-demand rather than the only record, and./output/files are opt-in viaWRITE_OUTPUT_FILESsrc/server.ts,src/runManager.ts): run creation/status/resume, SSE progress streaming, drafts list/get/publishpublic/index.html): brief form, live pipeline progress, plan-approval card, results, drafts libraryPost-implementation hardening (found during final review and live end-to-end testing with real API keys, not just unit tests):
innerHTMLinsertionCostTrackernever actually capturing tokens from live LLM calls — each graph node built a freshRunnableConfigfor its inner LLM invocation instead of merging the parent config, silently dropping the graph-level callback. Confirmed via a live run:cost_usdwas0before the fix, a real non-zero value after.Test plan
bun run typecheck— cleanbun run test:unit— 19/19 passingbunx biome ci .— 0 errors