feat(spec-sync): WEEEK API spec-drift detector + tool drift fixes#2
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…reen Adds scripts/spec-sync/allowlist.ts with 11 pre-verified entries (8 pagination params on 4 list endpoints, dueDate on create_task, description+userId on update_task). check-drift.ts now partitions findings into accepted/active, prints accepted with reasons, and gates the exit code only on active findings. spec:check exits 0 with 11 accepted / 0 active. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add "Spec-drift detector" section to CLAUDE.md (after Plugin layer) and "Keeping in sync with the WEEEK API" note to README.md under Development. Also fix lint issues across all spec-sync files introduced in this branch: sort interface fields alphabetically (perfectionist/sort-interfaces), use \w instead of [A-Za-z0-9_] (regexp/prefer-w), remove zero-width spaces and non-breaking spaces from weeek-openapi.json (no-irregular-whitespace), and apply prettier formatting throughout. All checks green: 30 test files / 177 tests, typecheck (src + scripts), lint exit=0, spec:check 11 accepted / 0 active / exit=0. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rmatters Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…oader-trust note Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🎉 This PR is included in version 1.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Adds an automated WEEEK API spec-drift detector so the class of bug fixed in
d3417da(MCP tools sending request shapes that don't match the WEEEK API) is caught automatically instead of by manual live probing.How it works
weeek.yaml-<hash>.jsexportingschema/slugs).scripts/spec-sync/load-spec.tsdiscovers + imports it; the normalized doc is committed atspec/weeek-openapi.json(+meta.json).capture-contract.tsdrives the real tool handlers against aRecordingClient(fake MCP server + registry) to capture every{method, path, query, body}the code actually sends — no production-code changes for capture.allowlist.tsrecords divergences verified valid against the live API but absent from WEEEK's (incomplete) spec. Allowlisted findings are printed ([accepted]) but don't fail CI. Structural findings (endpoint-missing,body-missing-required) can never be allowlisted — enforced at the type level.Real bugs this found (and fixes, verified against the live API)
list_taskslimitperPagelist_tasksisCompleted(bool)completed(1/0)create_taskdateEnddueDateupdate_taskdateEnddueDateThe remaining 11 divergences (pagination params undocumented on some list ops;
dueDateon create;description/userIdon update) were confirmed valid against the live API and are allowlisted.CI (
.github/workflows/spec-drift.yml)pr-drift(PR + push):pnpm spec:check— offline, code ↔ committed snapshot, fails on new drift.upstream-drift(nightly + manual):pnpm spec:check:upstream— live ↔ snapshot; opens/updates aspec-driftissue when WEEEK changes.Commands
pnpm spec:fetch— refresh the committed snapshot from live WEEEK.pnpm spec:check— code ↔ snapshot (offline; the PR gate).pnpm spec:check:upstream— live ↔ snapshot.Verification
tscclean for bothsrcandscripts; lint clean.pnpm spec:check→ 11 accepted / 0 active / exit 0.developers.weeek.net(integration test, opt-in).Design + implementation plan:
docs/superpowers/specs/2026-06-30-spec-drift-detector-design.md,docs/superpowers/plans/2026-06-30-spec-drift-detector.md.🤖 Generated with Claude Code