Fix What the First Partner Test Found
Five fixes from the first partner's session in Claude: a lean list_deals, a sentence for deals with no URL, trading names, a whoami tool, and steps on imported deals that actually get their inputs.
- Path
- plans/Fix-What-the-First-Partner-Test-Found.md
- Authors
- Michael Staton
- Augmented with
- Claude Code on Claude Opus 5.5
- Tags
- Plan · Connector · Partner-Test · Claude
Fix What the First Partner Test Found
The five items under “What needs fixing before other partners use it” in [[First-Partner-Test-of-the-Connector-from-Claude]]. Each one is small and has its own test. Work them in order, run the connector suite (uv run pytest tests/connector) after each, and check it off here.
1. A lean list_deals
Now: summarise() in src/connector/tools/list_deals.py returns every entry in state["skips"]. An imported deal has 26–36 of them, all with the same “Already applied in the local pipeline run…” reason.
Change:
- Return
skips_countandskips_by_reason(each distinct reason once, with its count) by default. - Add an input
include_skips: bool = Falsethat returns the full list as now. - Update the tool’s docs and examples (
_examples.py,docs_build.pyoutput) and regenerate the docs.
Test (tests/connector/test_deals.py): a deal with 30 identical skips lists one reason with count 30. With include_skips=True the full list comes back.
- Done (2026-11-21,
connector/fix-partner-test). The existing tests that read the per-skip list now passinclude_skips: true; their assertions are unchanged.
2. A sentence for a deal with no URL
Now: render_instruction() in src/connector/flow.py substitutes "the company's website (not given)" for {{url}}. Four step files (research.section, research.sources, materials.brief, enhance.fact_check) then read “The only correct company is at the company’s website (not given).”
Change:
- When
urlis missing, lead the instruction with a fixed notice: “This deal has no company website on record. Before researching, ask the partner for the company’s URL, and don’t research until you have it. A company with a similar name is a common wrong match.” Use the same lead-in mechanism as the existing tell-the-partner notice. - Replace
{{url}}with"its website (ask the partner)"so the sentences stay readable. - Better still: the step returns
needs_partnerwith the question, so Claude can’t skip it. Use that if the flow already supportsneeds_partneron research steps. Otherwise do the notice now and note the follow-up.
Test (tests/connector/test_flow.py): render research.section for a deal without a URL. The output has no “(not given)” and starts with the ask-for-the-URL notice.
- Done (2026-11-21) as the notice:
needs_partneris the approval flag and carries no question, so a step that returns the question itself is a follow-up. The notice leads every step whose instruction names{{url}}(research.section, research.sources, materials.brief, enhance.fact_check).
3. The deal’s name is the trading name
Now: scripts/upload_firm.py (line ~323) sets company = cfg.get("legal_name") or cfg.get("name"). A company that has been renamed shows its former legal name, while its slug comes from the current domain.
Change:
- Deal configs get an optional
trading_name. The uploader setscompanytotrading_name, thenname, thenlegal_name, and keepslegal_nameas its own field indeal.json. list_dealsreturns bothcompanyandlegal_name(when they differ), so a search by either name finds the deal.- Fix the one known config in the first firm’s folder, and look for others where
legal_namediffers fromnameor the domain.
Test (tests/test_upload_firm.py): a config with legal_name and trading_name stages a deal whose company is the trading name.
- Done (2026-11-21) in the uploader and
list_deals. Not done: fixing the known config in the first firm’s folder and looking for others, because engineers don’t touchio/; that is an operator task before the next upload.
4. A whoami tool
Change: a read-only tool, whoami, over MCP and REST (GET /v1/whoami). It returns the signed-in account (name, email), the firm in use and its display name, every firm the account can use, and the connector version. Register it with the other tools and docs, and mention it in the server instructions (“If the partner works with more than one firm, call whoami first”).
Test (tests/connector/test_auth.py): a token for an account on two firms returns both, with the active one marked. A static key returns the firm it’s bound to.
- Done (2026-11-21): tool, REST route, docs entry, spec row. The server-instructions mention is left to the engineer who owns that string (Serve-the-Method-from-the-Server, CONN-SKL-01).
5. Steps on imported deals get their inputs
Cause, found 2026-11-21: two things together.
- The uploader records
materials.briefas skipped (“Already applied…”), butresearch.sectionreads only[materials.brief]. So the research step for an imported deal resolves no inputs, beyond its own earlier submission when that exists under the same key. - Imported binaries weren’t recorded as materials, so
reads: materialsfound nothing. [[Apply-the-Deal-Folder-Uploader]] fixes this part.
Change:
- When the uploader skips
materials.briefon a finished deal, it writes a brief instead: a short text listing the deal’s materials, its finished memo version and the local run it came from, saved as thematerials.briefartifact. Steps that read the brief then get something real. gather_inputs()inflow.py: when a step read resolves to nothing because the step was skipped, add an input that says so (“The materials brief was skipped:”). An empty inputslist should never reach Claude silently.- Check that each imported deal’s research artifacts land under the keys
research.sectionlooks up, so “Your previous submission for this step” appears when a revision reopens research.
Test (tests/connector/test_flow.py and tests/test_upload_firm.py): an imported, finished deal’s research.section step has at least the brief and its previous research among its inputs.
- Done (2026-11-21): the uploader writes the brief for finished deals, and
gather_inputs()adds a skipped-step input. The other half (binaries as materials) is [[Apply-the-Deal-Folder-Uploader]].
Done when
- All five are checked off, with tests passing, and the connector is redeployed.
- A partner repeats the first test in Claude:
list_dealsfits in a few hundred tokens per deal,whoamianswers, and a research step on an imported deal lists inputs. - The issue’s five items are marked fixed in [[First-Partner-Test-of-the-Connector-from-Claude]].
Related
- [[Apply-the-Deal-Folder-Uploader]]: the other half of item 5
- [[MemoPop-Connector-API]]