refactor: rename workflow service files#211
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
The PR’s original goal is to remove remaining product-name leakage from internal workflow service filenames while preserving exported symbols and compatibility surfaces for later slices. The semantic scope is narrow: filename/import-path cleanup for the application service and adapter factory, plus tests/docs/autoresearch probes that reference those paths. There was no prior kapi-agent review on this head, and the PR body includes a clear revision/QA explanation.
What changed
src/application/kapi-service.tswas renamed tosrc/application/workflow-service.ts.src/adapters/kapi-service-factory.tswas renamed tosrc/adapters/workflow-service-factory.ts.- Source, tests, and runtime probe imports were updated to the new paths.
test/architecture.test.tsnow guards against reintroducing the old service filenames and asserts the semantic filenames exist.docs/product-name-audit.md,docs/harness-module-registry.md, andautoresearch.shwere aligned with the rename.
Why this is correct
This is a path-level refactor with no intended runtime behavior change. The implementation preserves exported names such as KapiService and createLocalKapiService, reducing compatibility risk while still removing the filename-level leakage targeted by this slice. The architecture guard makes the contract durable by failing if the old filenames return.
Evidence
- Verifier gate: PASS —
npm ci && npm run verifyexited 0. - Size gate: PASS — 142 changed lines, under the 200-line semantic review threshold.
- Revision-explanation status: not required, and present.
- Ilchul review harness gate: PASS — neutral/comment, no blocking findings.
- Inspected changed source/docs/test paths and confirmed no stale
kapi-serviceimport references remain outside the intentional architecture assertions.
Remaining risks and approval rationale
Remaining risk is limited to downstream consumers importing internal, non-package-exported paths directly; this repository is private and the PR intentionally keeps symbol names stable. No blocking correctness, safety, workflow-contract, or regression issues were found, and the verification evidence is sufficient for approval.
Blocking issues
None.
Warnings / risks
- Direct external imports of the old internal paths, if any exist outside this repository, would break. This appears acceptable for an internal implementation rename and is mitigated by preserving exported symbols.
Suggestions
- In a later compatibility slice, consider renaming exported symbols (
KapiService,createLocalKapiService, etc.) with aliases or migration notes if they are used outside the repo.
Looks good
- The path rename is focused and avoids mixing in symbol/API renames.
- Runtime probes in
autoresearch.shwere updated, avoiding stale dynamic import failures. - The architecture test now enforces both absence of old filenames and presence of the new semantic files.
- Documentation reflects the new residual product-name audit state.
Verification notes
- Verifier gate status: PASS —
npm ci && npm run verifycompleted successfully. - Size gate status: PASS — 142 changed lines, below threshold.
- Revision-explanation status: not required for this first kapi-agent review; explanation found in PR body.
- PR evidence includes full test/check/unused/quality-budget verification and residual scans.
Engine: pi
Summary
kapi-*filenames to semanticworkflow-servicepaths.Linked issue
Refs #209
Problem
Issue #209 tracks removal of historical
kapiproduct-name leakage from reusable internal code while preserving intentional compatibility/product surfaces.After PR #210, the remaining non-fixture
src/filename leakage included the application service boundary:Those files implement generic workflow service/factory behavior. Keeping
kapiin their filenames made the service boundary look product-specific even though the runtime direction is semantic internal naming.Options considered
KapiService→WorkflowService,FileKapiStore→ follow-up store names, and factory function names in one PR.KapiService,createLocalKapiService, and store-related identifiers remain for later work.kapi-review-cli.kapi-reviewis an intentional external integration name, while service filenames were generic implementation leakage.Selected approach
Selected option 2.
This PR handles only the application service filename/import boundary. It does not rename exported classes/functions yet, because those names have many test/source consumers and should be handled as a separate compatibility slice.
Implementation by file/surface
src/application/kapi-service.ts→src/application/workflow-service.tssrc/adapters/kapi-service-factory.ts→src/adapters/workflow-service-factory.tsautoresearch.sh./src/application/workflow-service.ts.kapi-servicetoworkflow-serviceso autoresearch metrics still include the renamed service.test/architecture.test.tsworkflow-servicefilenames exist.docs/product-name-audit.mdanddocs/harness-module-registry.mdWhy this fixes it
The service implementation can no longer be imported through
kapi-servicepaths. The architecture guard now fails if the old application/factory filenames reappear, and the residual filename scan is reduced to fixture/history plus the intentional externalkapi-reviewCLI.This is still a partial #209 slice, so this PR uses
Refs #209rather thanCloses #209.QA / Verification
npm test -- test/architecture.test.ts test/service-store.test.ts test/deep-interview-child-rpc.test.ts test/presentation-command-behavior.test.ts— pass; package script ran the full suite, 519 tests, 508 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 scans:
Changed-line count:
Independent review:
autoresearch.shimports; fixed and re-reviewed successfully.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 unstaged mode-only change before cleanup.autoresearch.shservice imports../src/application/kapi-service.tsimports.Risks / Follow-up
KapiService,createLocalKapiService,KapiStore,KapiRegistryEntry, andKapiAgentPrReviewStateremain for later Remove remaining kapi identifiers from internal codebase #209 slices.src/cli/kapi-review-cli.tsremains intentional for the literal externalkapi-review/kapi-agentintegration.kapi-ralph,kapi-autoresearch, and/kapi-*remain compatibility contracts.kapi-agent review
@kapi-agent review.REQUEST_CHANGES, orCOMMENT, request re-review with a same-comment current-head revision explanation.