refactor: remove workflow service compatibility alias#221
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 completes the issue #209 cleanup for the workflow service naming surface. The semantic scope is narrow: migrate the last active in-repo test consumers from the temporary KapiService compatibility alias to WorkflowService, remove that alias from src/application/workflow-service.ts, and update the product-name audit documentation.
There was no prior kapi-agent review on this PR, so no unresolved ping-pong feedback remains.
What changed
src/application/workflow-service.ts- Removed
export { WorkflowService as KapiService };.
- Removed
test/service-store.test.ts- Replaced
KapiServiceimports/usages/type references withWorkflowService.
- Replaced
test/autoresearch-validation.test.ts- Replaced
KapiServiceimports/usages/type references withWorkflowService.
- Replaced
docs/product-name-audit.md- Updated the audit to state that active service/store tests now use
WorkflowServiceand the temporary service alias is gone.
- Updated the audit to state that active service/store tests now use
Why this is correct
The implementation already exposes WorkflowService as the primary semantic class. The PR removes only the product-named compatibility re-export after migrating the remaining in-repo active consumers. A residual scan shows no active src/test dependency on KapiService; remaining occurrences are documentation context and a negative architecture assertion for createLocalKapiService.
This preserves external/persisted Kapi contracts such as workflow IDs and review integration names while removing an internal reusable-code alias, which matches the stated product-name audit policy.
Evidence
- Verifier gate: PASS —
npm ci && npm run verifyexited 0. - Size gate: PASS — 102 changed lines, below the 200-line review threshold.
- Revision-explanation status: not required; explanation found.
- Ilchul review harness gate: PASS — neutral/comment, no blocking findings.
- Inspected files:
src/application/workflow-service.tstest/service-store.test.tstest/autoresearch-validation.test.tsdocs/product-name-audit.md
- Additional local inspection:
- Confirmed
WorkflowServiceremains exported. - Confirmed the
KapiServicealias is absent from the service module. - Confirmed
git grepfinds no active source/testKapiServiceconsumers beyond docs and the existing negative architecture assertion.
- Confirmed
Remaining risks and approval rationale
Remaining risk is limited to out-of-tree consumers importing the temporary internal KapiService alias. The PR body calls this out, and the alias appears intentionally internal/temporary rather than a public contract. Approval is justified because the change is small, semantically coherent, documented, verified by the full project gate, and does not alter persisted workflow IDs or external Kapi integration literals.
Blocking issues
None.
Warnings / risks
src/application/workflow-service.ts: removingKapiServicecan break out-of-tree imports if anyone depended on the temporary internal alias. This is acceptable given the PR’s stated cleanup goal, but it is the main compatibility risk.- Verification appears to leave a local mode-only change on
src/cli/kapi-review-cli.tsduring test execution. This is not part of the committed PR diff, but the test-suite side effect is worth tracking separately if it recurs in CI/workspaces.
Suggestions
- Consider adding or keeping an architecture guard that directly prevents reintroducing
export { WorkflowService as KapiService }if this naming cleanup is important long-term.
Looks good
- The source change is minimal and targeted.
- Test changes are mechanical renames from
KapiServicetoWorkflowService. - Documentation was updated alongside the implementation, keeping the product-name audit aligned with the current code.
- External/persisted
kapi-*contracts are intentionally left unchanged.
Verification notes
- Verifier gate status: PASS —
npm ci && npm run verifyexited 0. - Size gate status: PASS — 102 changed lines < 200.
- Revision-explanation status: not required; found.
- Ilchul harness status: PASS — no blocking findings.
- PR evidence includes full test/check/unused/budget verification and residual
KapiServicescanning.
Engine: pi
Summary
KapiServicecompatibility export to the semanticWorkflowServiceclass.export { WorkflowService as KapiService }alias fromsrc/application/workflow-service.ts.docs/product-name-audit.mdso the service/store surface recordsWorkflowServiceas the active internal contract.Linked issue
Refs #209
Problem
Issue #209 is normalizing reusable internal identifiers away from product names while preserving intentional external compatibility surfaces. Earlier slices renamed the source service to
WorkflowServiceand migrated most tests, but two large active test clusters still imported and constructedKapiServicethrough a temporary alias.That left the final reusable service compatibility alias in active source even though the semantic class name already existed.
Options considered
KapiServiceservice-surface cleanup while staying well below the size gate.Selected approach
Selected option 2.
The final active consumers were only two test clusters, and the total diff is small enough for one reviewable PR. Public serialized
kapi-*workflow IDs, slash-command contracts, andkapi-agentreview integration literals remain unchanged.Implementation
test/service-store.test.tsKapiServiceimport, constructor calls, type annotations, andReturnTypereferences withWorkflowService.test/autoresearch-validation.test.tsKapiServiceimport, constructor calls, and helper type annotations withWorkflowService.src/application/workflow-service.tsWorkflowService as KapiServiceexport alias.docs/product-name-audit.mdWorkflowServiceand the temporary alias is gone.Why this fixes it
The active service/store surface no longer exposes or consumes the product-named
KapiServiceidentifier. Tests now exercise the same class through its semantic export, and removing the alias prevents new reusable internal code from depending on the retired compatibility name.QA / Verification
npm test -- test/service-store.test.ts test/autoresearch-validation.test.ts— pass; package script runs the full suite shape, 521 tests, 510 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.git grep -n "KapiService" -- ':!node_modules' ':!references' ':!.kapi' ':!.hermes/plans'— only docs explaining removal and the existingcreateLocalKapiServicenegative architecture assertion remain.Anomalies observed
npm test -- ...still ran the full suitetsx --test test/*.test.ts; output showed 521 testssrc/cli/kapi-review-cli.tsexecutable modegit diff --summaryshowed100644 => 100755chmod 644before commitRisks / Follow-up
KapiServicealias would need to update toWorkflowService; no active in-repo consumers remain./kapi-*workflow IDs, storage compatibility references, or externalkapi-agentreview literals.kapi-agent review
@kapi-agent review.63f6b5a.