Skip to content

T-4AQN-extract-pr-update-into-packages-ts-pr-update

State: closed/done · Impact: high · Complexity: large

pr-update (~1,850 lines across strategy.ts, ops/survey.ts, ops/update.ts, update/execute.ts, update/resolvers.ts, update/tui.tsx) lives inside sdlc’s lib/services/pr/ today, coupled to sdlc only through an injectable SdlcConfig type and five direct imports. simple-dispatch-plan.html’s P1 phase extracts it into its own package so it can run standalone and take a Forge port dependency, ahead of the Router routing its conflicts as feedback (T-9Q4A).

  1. Create packages/ts/pr-update following the S-0015 standalone CLI shape and the packages/ts/waypost precedent, with bin pr-update.
  2. Move strategy.ts, ops/survey.ts, ops/update.ts, update/{execute,resolvers,tui}.tsx and their ~1,500 lines of tests into it.
  3. Replace the injectable SdlcConfig with a plain PrUpdateConfig object, and put repo location plus the post-update verb hook behind injected ports (replacing the five direct imports: repo/locate, config/trust, config/verbs, arm-worktree, defineOp).
  4. Layer standalone config: CLI flags, then .pr-update.yaml, then built-in defaults; keep sdlc pr survey/sdlc pr update as thin wrappers loading sdlc.yaml’s pr_update: block into the same shape.
  5. Add a --strategy rebase|merge flag and report each unresolved conflict with its paths and the base head SHA it was measured against — already resolved locally as part of the existing git merge-tree-based conflict check, this step only adds it to the output — in JSON output, so the Router (T-9Q4A) can key a conflict’s delivery signature on it.
  6. Point pr-tools:check-pr at the new package.
AreaNote
packages/ts/pr-update/New package
solutions/ontological/lib/services/pr/Source of the move
pr-tools/check-prRepointed at the new package
  • AC-1: pr-update runs standalone (no sdlc.yaml, no sdlc CLI) against a repo given a PrUpdateConfig object or .pr-update.yaml.
  • AC-2: sdlc pr survey/sdlc pr update behave identically to today, now as thin wrappers.
  • AC-3: An unresolved conflict appears in JSON output with its paths and the base head SHA it was measured against, and existing pr-update tests pass unchanged in the new location.
  • the Forge port itself (T-DVLT) — pr-update can proceed with its current direct @sksizer/easy-gh usage until T-DVLT lands, then switch
  • none to start; wires to T-DVLT once the Forge port exists

← Back to Tasks