refactor: rename local workflow service factory#212
Conversation
|
@kapi-agent review Revision explanation for current head What changed:
Why this closes the prior feedback:
Verification:
|
There was a problem hiding this comment.
kapi-agent review
Verdict: APPROVE
Final approval summary
Review journey
This PR is a bounded refactor for issue #209. The semantic scope is intentionally narrow: rename the internal local workflow service factory export from createLocalKapiService to createLocalWorkflowService, update direct consumers, and add a guard against reintroducing the old export name. There was no prior kapi-agent review on this head, so no ping-pong fixes were required.
What changed
src/adapters/workflow-service-factory.tsnow exportscreateLocalWorkflowService.src/presentation/pi-extension.tsimports and calls the new factory name.- Tests using the local service factory were updated.
test/architecture.test.tsnow guards against the old export name.docs/product-name-audit.mdrecords this as a completed bounded slice while leaving remaining product-prefixed service/store names for follow-up work.
Why this is correct
The change is a mechanical internal export rename with direct call-site updates. It does not alter factory construction behavior, persistence contracts, serialized workflow IDs, public CLI names, or GitHub integration surfaces. The added architecture test makes the intended boundary explicit and helps prevent regression.
Evidence
- Verifier gate: PASS.
- Size gate: PASS, 27 changed lines under the semantic review threshold.
- Revision-explanation status: not required; found.
- Ilchul review harness gate: PASS, neutral/comment, no blocking findings.
npm ci && npm run verifypassed.- Inspected source references confirm no active
srcusage ofcreateLocalKapiService; remaining mentions are documentation and the negative architecture assertion.
Remaining risks and approval rationale
Remaining risk is low. Existing product-prefixed identifiers such as KapiService, KapiStore, and related serialized/external Kapi surfaces remain intentionally out of scope. Approval is justified because the PR is narrowly scoped, tested, documented, and does not appear to change runtime behavior beyond the internal factory export name.
Blocking issues
None.
Warnings / risks
- The review workspace showed mode-only churn on
src/cli/kapi-review-cli.tsafter verification. This appears consistent with the PR’s noted existing verification anomaly rather than this diff’s semantic change, but it remains worth cleaning up separately so local verification does not leave tracked files dirty.
Suggestions
- Consider a follow-up issue or small PR to prevent verification/setup scripts from toggling the executable bit on
src/cli/kapi-review-cli.ts.
Looks good
- The rename is applied consistently across production and test call sites.
- The architecture guard is appropriate for preventing the old factory export name from returning.
- Documentation accurately frames this as a partial product-name cleanup slice, not a broad compatibility migration.
Verification notes
Verifier gate status: PASS. Size gate status: PASS. Revision-explanation status: not required; found. PR evidence reports npm ci && npm run verify passed, including tests, type checks, unused checks, and quality budgets; Ilchul harness reported no blocking findings.
Engine: pi
Summary
createLocalKapiServicetocreateLocalWorkflowService.Linked issue
Refs #209
Problem
Issue #209 is removing historical
kapiproduct-name leakage from reusable internal code while preserving intentional compatibility/product surfaces.After PR #211 moved the service/factory files to semantic
workflow-servicefilenames, the local factory export still used the product-prefixed name:That name describes a generic local workflow service factory, not an external
kapi-agentintegration or serialized workflow contract.Options considered
KapiService,KapiStore, and registry type names remain for later slices.KapiServiceand factory export together.Selected approach
Selected option 1.
This PR only renames the local factory export and its direct consumers. The service class/store/type names stay intentionally unchanged for later bounded slices.
Implementation by file/surface
src/adapters/workflow-service-factory.tscreateLocalKapiService→createLocalWorkflowService.src/presentation/pi-extension.tstest/presentation-command-behavior.test.tscreateLocalWorkflowService.test/deep-interview-child-rpc.test.tscreateLocalWorkflowService.test/architecture.test.tsdocs/product-name-audit.mdWhy this fixes it
The active implementation no longer exports or imports
createLocalKapiService. The remaining old-name references are limited to documentation and a negative architecture assertion, while runtime code usescreateLocalWorkflowService.This is still a partial #209 slice, so this PR uses
Refs #209rather thanCloses #209.QA / Verification
npm test -- test/architecture.test.ts test/presentation-command-behavior.test.ts test/deep-interview-child-rpc.test.ts— pass; package script ran the full suite, 520 tests, 509 pass, 11 skipped.npm run check— pass.npm run check:unused— pass.npm run quality:budgets— pass with existing non-failingcode_smells=52warning.git diff --check— pass.Residual active-source scan:
Changed-line count:
Independent review:
Anomalies observed
npm test -- <files>runs the full suite because the package script istsx --test test/*.test.ts.src/cli/kapi-review-cli.tsexecutable-bit churn recurred during verification.git statusshowed mode-only churn before cleanup.Risks / Follow-up
KapiService,KapiStore,KapiRegistryEntry, andKapiAgentPrReviewStateremain for later Remove remaining kapi identifiers from internal codebase #209 slices.kapi-review,kapi-agent,/kapi-*, and serializedkapi-*workflow IDs remain intentional compatibility/external integration surfaces.kapi-agent review
@kapi-agent review.REQUEST_CHANGES, orCOMMENT, request re-review with a same-comment current-head revision explanation.