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).
Approach
Section titled “Approach”- Create
packages/ts/pr-updatefollowing the S-0015 standalone CLI shape and thepackages/ts/waypostprecedent, with binpr-update. - Move
strategy.ts,ops/survey.ts,ops/update.ts,update/{execute,resolvers,tui}.tsxand their ~1,500 lines of tests into it. - Replace the injectable
SdlcConfigwith a plainPrUpdateConfigobject, 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). - Layer standalone config: CLI flags, then
.pr-update.yaml, then built-in defaults; keepsdlc pr survey/sdlc pr updateas thin wrappers loading sdlc.yaml’spr_update:block into the same shape. - Add a
--strategy rebase|mergeflag and report each unresolved conflict with its paths and the base head SHA it was measured against — already resolved locally as part of the existinggit 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. - Point
pr-tools:check-prat the new package.
| Area | Note |
|---|---|
packages/ts/pr-update/ | New package |
solutions/ontological/lib/services/pr/ | Source of the move |
pr-tools/check-pr | Repointed at the new package |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1:
pr-updateruns standalone (no sdlc.yaml, no sdlc CLI) against a repo given aPrUpdateConfigobject or.pr-update.yaml. - AC-2:
sdlc pr survey/sdlc pr updatebehave 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.
Out of scope
Section titled “Out of scope”- the Forge port itself (
T-DVLT) — pr-update can proceed with its current direct@sksizer/easy-ghusage until T-DVLT lands, then switch
Dependencies
Section titled “Dependencies”- none to start; wires to
T-DVLTonce the Forge port exists