test: migrate workflow service imports#220
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’s original goal is to migrate a bounded first batch of test-only KapiService compatibility imports to the semantic WorkflowService name while leaving larger clusters for follow-up. The semantic scope is narrow: mechanical test import/constructor/type-reference renaming plus an audit doc update. There is no prior kapi-agent review on this head, so no fix ping-pong was required.
What changed
- Updated 27 small service-related test files to import and instantiate
WorkflowService. - Left
test/service-store.test.tsandtest/autoresearch-validation.test.tsonKapiServiceintentionally for later dedicated slices. - Updated
docs/product-name-audit.mdto document the reduced compatibility-import surface and remaining follow-up work.
Why this is correct
The implementation class already exists as WorkflowService, and KapiService is only a compatibility alias. These changes move tests toward the semantic API without changing runtime behavior, serialized workflow IDs, storage paths, or external kapi-agent/kapi-review integration contracts. The remaining KapiService references are concentrated exactly where the PR body and audit say they should be.
Evidence
- Verifier gate: PASS —
npm ci && npm run verifyexited 0. - Size gate: PASS — 176 changed lines, below the 200-line review threshold.
- Revision-explanation status: not required; found.
- Ilchul review harness gate: PASS — neutral/comment result with 0 blocking findings.
- Inspected evidence included the changed-file list, diff/stat, current audit doc content, and a direct
git grepfor remainingKapiServicereferences.
Remaining risks and approval rationale
Remaining risk is limited to follow-up debt: the compatibility alias still exists for the two large test clusters. That is explicitly documented and intentionally out of scope. Approval is justified because the current slice is test-only plus documentation, mechanically consistent, verified by the full project gate, and preserves the artifact/workflow compatibility contract.
Blocking issues
None.
Warnings / risks
src/application/workflow-service.tsstill exportsWorkflowService as KapiService, andtest/service-store.test.ts/test/autoresearch-validation.test.tsstill consume it. This is acceptable for this slice because the PR documents those as the remaining large clusters.
Suggestions
- In the follow-up PRs, consider migrating one large cluster at a time and then removing the compatibility alias only after
git grep -n "KapiService"confirms no remaining intended consumers.
Looks good
- The change is tightly scoped and avoids mixing alias migration with source behavior changes.
- The audit doc remains aligned with implementation state.
- Remaining compatibility surfaces are explicit rather than hidden.
Verification notes
- Verifier gate status: PASS.
- Size gate status: PASS.
- Revision-explanation status: not required; found.
- PR evidence reports full verification via
npm ci && npm run verify, including tests, type/check gates, unused checks, and quality budgets.
Engine: pi
There was a problem hiding this comment.
kapi-agent review
Verdict: APPROVE
Final approval summary
Review journey
The PR’s original goal is to continue issue #209 by reducing internal product-name leakage after the service rename from KapiService to WorkflowService. The semantic scope is intentionally narrow: migrate a first batch of small service tests to the semantic WorkflowService import/constructor while leaving the two large remaining clusters for follow-up. There was no prior kapi-agent review on this PR, so no unresolved kapi-agent feedback remains.
What changed
- Updated 27 small test files from
KapiServicetoWorkflowService. - Updated
docs/product-name-audit.mdto document that remaining compatibility-import work is limited to:test/service-store.test.tstest/autoresearch-validation.test.ts
- Left
src/application/workflow-service.tscompatibility alias intact for the remaining clusters.
Why this is correct
The code changes are mechanical import/type/constructor renames against the same source module, preserving runtime behavior while reducing dependency on the temporary compatibility alias. The audit now matches the current repository state: KapiService remains only as the alias plus the two documented test clusters and a negative architecture assertion.
Evidence
- Verifier gate: PASS —
npm ci && npm run verifyexited 0. - Size gate: PASS — 176 changed lines, under the 200-line review threshold.
- Revision-explanation status: not required, but found.
- Ilchul harness gate: PASS — neutral/comment, no blocking findings.
- Inspected evidence:
- PR diff summary at
HEAD docs/product-name-audit.md- remaining
KapiServicereferences viagit grep - verifier output and review harness result
- PR diff summary at
Remaining risks and approval rationale
Remaining risk is intentionally deferred compatibility debt in test/service-store.test.ts and test/autoresearch-validation.test.ts. That risk is documented and bounded, and the alias remains in place, so this slice does not break those tests. Approval is justified because the change is low-risk, test-only plus documentation, mechanically consistent, verified, and aligned with the stated migration plan.
Blocking issues
None.
Warnings / risks
KapiServicecompatibility usage still exists intest/service-store.test.tsandtest/autoresearch-validation.test.ts; this is documented as follow-up debt.- Local verification appears to have left a mode-only working tree change on
src/cli/kapi-review-cli.ts, but that mode change is not part ofHEADfor this PR.
Suggestions
- In the next slice, migrate one of the two large remaining clusters at a time to keep review scope similarly bounded.
- After both clusters are migrated, remove
export { WorkflowService as KapiService }and add/adjust a guard to prevent reintroducing compatibility imports.
Looks good
- The migration is behavior-preserving: same module path, semantic exported class name, no source logic changes.
- Documentation accurately narrows the remaining compatibility surface.
- The PR avoids mixing alias removal with test migration, which reduces regression risk.
Verification notes
Verifier gate: PASS — npm ci && npm run verify exited 0.
Size gate: PASS — 176 changed lines, below the configured threshold.
Revision-explanation status: not required; explanation found.
Ilchul review harness: PASS — no blocking findings.
Engine: pi
Summary
KapiServicecompatibility export to the semanticWorkflowServiceimport/class name.docs/product-name-audit.mdso the audit now identifies only the largeservice-storeandautoresearch-validationtest clusters as remaining compatibility-import work.devand leaves the compatibility alias in place for the remaining clusters.Linked issue
Refs #209
Problem
Issue #209 is removing reusable internal
kapiproduct-name identifiers while preserving intentional external or serialized compatibility surfaces. PR #219 renamed the source-facing service class toWorkflowService, but many tests still imported and constructed the temporaryKapiServicealias.For this slice, the problematic surface was test-only import/use leakage:
Options considered
service-store,autoresearch-validation, and all small tests at once.KapiServicecompatibility import debt temporarily.Selected approach
Selected option 2.
This PR migrates the low-risk small test files first, keeps the temporary alias for the two large clusters, and updates the audit so the remaining work is explicit. It deliberately avoids broad source changes or alias removal in this slice.
Implementation
test/*KapiServicetoWorkflowServiceimports and constructors/type references.test/service-store.test.tsandtest/autoresearch-validation.test.tsunchanged for dedicated follow-up slices.docs/product-name-audit.mdWorkflowService.KapiServicecompatibility-import work to the two large clusters.Why this fixes it
The small test files no longer depend on the temporary
KapiServicecompatibility export, so the remaining service alias consumers are concentrated and auditable. This reduces internal product-name leakage without touching serialized/kapi-*workflow IDs, public compatibility contracts, or externalkapi-agentreview surfaces.QA / Verification
npm test -- test/architecture.test.ts test/worker-dispatch-guard.test.ts test/target-resolution.test.ts test/artifact-list.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.Residual scan summary:
KapiServiceremains insrc/application/workflow-service.tsonly as the temporary alias.KapiServiceuses remain intest/service-store.test.tsandtest/autoresearch-validation.test.ts.test/architecture.test.tskeeps a negative assertion for absentcreateLocalKapiService.Anomalies observed
npm test -- ...still ran the full suitetsx --test test/*.test.ts; output showed 521 testssrc/cli/kapi-review-cli.tsexecutable modegit diff -- src/cli/kapi-review-cli.tsshowed mode-only churnchmod 644before commitRisks / Follow-up
test/service-store.test.ts.test/autoresearch-validation.test.ts.export { WorkflowService as KapiService }after the final compatibility consumers are gone.kapi-agent review
@kapi-agent review.9d40dd4675a7fc517243745382aca10a11c1fbb1.