MemoPop Connector API, Phase 5: Enhancements, Compile, and the Full Flow
Every enhancement becomes a step that can skip, compile turns sections into a branded PDF, and a scripted client walks the whole memo.
- Path
- plans/MemoPop-Connector-API-Phase-5-Enhancements-Compile-and-Flow.md
- Authors
- Michael Staton
- Augmented with
- Claude Code on Claude Opus 5.5 (1M context)
- Tags
- Plan · MemoPop · Claude-Connector · TDD
MemoPop Connector API, Phase 5: Enhancements, Compile, and the Full Flow
Read the spec (§The step registry, §First mapping, §Deal state, §The tools →
compile, §Errors on skipped, §Tests → Enhancements) and the loop doc.
Phase 1 is merged into development. Runs in parallel with phases 4 and 6.
Your files
src/connector/tools/compile.py, src/connector/compile/, the enhancement
and compile.assemble steps and their instruction files,
tests/connector/test_enhancements*.py, test_compile*.py, test_flow*.py.
Steps
- Failing tests for the nine owned IDs.
CONN-ENH-02is parametrized over every optional step. - Enhancement instructions: one file per enhancement step in the spec’s mapping, adapted from its source agent’s prompt with every model and API call removed, ending with how to submit. Each declares what it reads (the saved sections) and produces, with checks.
- Skips end to end: a disabled step (
enabled: false, settable by envMEMOPOP_DISABLED_STEPS) and an optional server step that raises both record a skip on the deal and the flow continues.next_stepreportsskipped_since_last_call;list_dealsshows skips. compile: assemble the sections in outline order, then the server steps from §First mapping (citation consolidation and renumbering, spacing, table of contents, deck images if any, finalize). Reuse the existing functions insrc/agents/citation_assembly.py,citation_spacing.py,toc_generator.pyand the export code incli/export_branded.py; call their pure parts, and where one is tangled withMemoStateorPath("io"), extract a pure function beside it rather than duplicating it. HTML and PDF (WeasyPrint) go to the firm’s bucket undercompiled/; return signed links that expire after seven days. Past a time budget (default 200 s, env overridable for tests), return ajob_id.- The scripted client (
tests/connector/fake_claude.py): walksfixture-cofrom creation to compile using canned artifacts, over MCP (CONN-FLOW-01) and REST (CONN-FLOW-02). - Docs for
compilecomplete, with executing examples.
Rules and done
As in Phase 1. Done when scripts/check.sh passes, the owned IDs are GREEN,
everything previously green still is, a changelog entry is written, and the
branch is pushed. Report the ledger output and suite counts.