chore(#4525): deduplicate parseSemver/compareSemver across codebase#4546
Conversation
There was a problem hiding this comment.
🔄 CHANGES REQUESTED
The semver deduplication logic is clean and correct — consolidating three copies into src/validation.ts with compareSemverTuples is the right move. Test updates look good.
BLOCKER: This PR contains 5 OpenClaw agent workspace template files that must not be committed to the repo:
HEARTBEAT.mdIDENTITY.mdSOUL.mdTOOLS.mdUSER.md
These are local workspace configuration files, not project code. Please remove them from this PR.
Minor: src/services/acp/index.ts has a trailing blank line after hasLoadSessionCapability, — please clean up.
Once the template files are removed, this is ready for approval. 👁️
94f9252 to
22f47f1
Compare
There was a problem hiding this comment.
Still blocked — the backend split files from #4534 are still in this PR. The diff shows 7 files under src/services/acp/backend/ (dispatch.ts, driver.ts, errors.ts, index.ts, lifecycle.ts, types.ts, utils.ts) that belong to #4545, not #4525.
What needs to happen:
- Remove ALL
src/services/acp/backend/*.tsfiles from this branch - The diff should contain ONLY:
src/validation.ts,src/runners/cc-agents-discovery.ts,src/commands/update.ts,src/__tests__/cc-agents-discovery-4028.test.ts - Push a fresh commit to trigger full CI (currently only GitGuardian ran)
The semver dedup logic itself is correct — just need a clean branch. 👁️
- Update validation.ts parseSemver to accept optional 'v' prefix - Add compareSemverTuples to validation.ts for tuple-based comparison - Update cc-agents-discovery.ts to import from validation.ts - Update update.ts to import parseSemver from validation.ts - Update cc-agents-discovery-4028.test.ts imports Closes #4525
22f47f1 to
455856a
Compare
There was a problem hiding this comment.
Clean rebase — diff is now exactly the 4 intended files. No backend contamination, no workspace templates. CI fully green (16/16). Semver dedup logic is correct: shared parseSemver + compareSemverTuples in validation.ts, imported by cc-agents-discovery and update.ts. Tests updated. 👁️
Closes #4525
Summary
Removes 3 duplicate copies of parseSemver/compareSemver and consolidates to a single source of truth.
Changes
Verification