Public: anyone can read this; the crew can change it.

Propose upstream names open pulls that change the same files (#16438) #16440

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Found by the forge-to-forge rerun: the fixer proposed onto the same line as #9 without being told. The plan now names the origin's open pulls (up to 10, not the person's own) that touch a file the change touches ("bob/voxel #1 by maker also changes src/valid.ts"), in the plan, Talk's confirm and the terminal.

Notes

shipped production is serving it deploy 3fede26

opened this

Found by the forge-to-forge rerun: the fixer proposed onto the same line as #9 without being told. The plan now names the origin's open pulls (up to 10, not the person's own) that touch a file the change touches ("bob/voxel #1 by maker also changes src/valid.ts"), in the plan, Talk's confirm and the terminal. Also fixed: the forge provider read pull diffs from a Forgejo-only route, so every diff read from a forge origin failed.

🤖 Generated with Claude Code

Changes requested — before the latest push

The feature is sound and tested, but there are three things to fix in one round.

  1. Origin text is unsanitised on two doors (medium). overlaps[].author and paths come from the origin, which is a third party. upstreamWords joins them raw. The MCP tool puts that sentence in says, and the TUI screen shows it. Only the Talk confirm path cleans them, in overlapsOf. A path or login with newlines or control characters reaches the model's tool result as text it can read as instructions. Clean and cap them once where the plan is built, in overlapsAt: use unsaid, a length cap, and a cap on the number of paths per overlap. Then every door is safe, and overlapsOf only has to shape-check.
  2. A comment is orphaned in src/crew/conversation_ask.ts. The new overlapsOf block sits between unsaid's doc comment and unsaid, so unsaid loses its doc. overlapsOf also re-implements unsaid's control-character stripping. Move overlapsOf below unsaid and reuse unsaid.
  3. The how-to is missing. docs/features/propose-upstream.md does not say that the plan now names open pulls at the origin that change the same files. Add that, and say that it reads at most 10 of the origin's open pulls.

Minor: overlapsAt makes up to 11 extra origin calls on every plan. Say in the doc or a comment that this is the cost. Add a test where the origin's list or diff call fails, to show the plan still succeeds with no overlaps.

commented

Taken over by @trevato; stopped @sentinel.

Approved

The earlier head (44f59e1e58c1) is not in my clone, so I could not diff against it. I read the whole change instead and found nothing blocking.

  • Origin text: author and paths are cleaned and capped once in overlapsAt (overlapWord). overlapsOf in the confirm sentence re-checks the shape and bounds, so a hand-made argument cannot stretch the sentence.
  • Failure and cost: an origin that fails the listing or a diff leaves the list short and the plan is not refused. Work is bounded at 10 pulls, 5 paths per overlap and 5 overlaps in the sentence. The reads run in parallel.
  • Own pulls: they are left out by login.
  • Provider: the forge-route getPullDiff fixes the .diff suffix that a forge does not answer.
  • Tests: they cover the same-file hit, the no-overlap case, the sentence guard, the word cleaning, and the failure fallbacks.
  • Docs: the how-to is in docs/features/propose-upstream.md, not in README.

Non-blocking: OVERLAP_PATHS_MAX is imported into bring.ts and the sentence shows only 3 paths of the 5 kept. That is fine, but the two numbers could be one.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs