Skip to content

refactor: shared contract package, consistent API errors, and release hardening - #145

Merged
caiopizzol merged 23 commits into
mainfrom
chore/cleanup-dx
Jul 6, 2026
Merged

refactor: shared contract package, consistent API errors, and release hardening#145
caiopizzol merged 23 commits into
mainfrom
chore/cleanup-dx

Conversation

@caiopizzol

Copy link
Copy Markdown
Owner

Consolidates the codebase around a single API contract and closes the gaps that made the four surfaces (API, MCP, CLI, web) drift apart. The driver: types, client code, and validators were hand-copied across packages and had already diverged, and the two published packages were never typechecked in CI.

  • New internal packages/contract holds the canonical types, HTTP client, and validators; MCP, CLI, and web consume it. Published packages bundle its source at prepack, so npm consumers never see a workspace dependency.
  • API errors are now a uniform JSON envelope, deploy orchestration moved out of the route layer into a tested service, and the blind try/catch SQLite migrations became an ordered user_version runner that fails loudly.
  • The 3,100-line MCP entrypoint is split into per-domain tool modules with first test coverage, and the README tool table is generated from source (CI fails if stale).
  • GitHub URL validation is strict (exact github.com/www.github.com, https only) and identical across API and clients; the old check accepted lookalike hosts.
  • Release semantics: semantic-release-monorepo filters commits to each package directory, so contract-only commits would have released nothing while silently changing bundled output. A local shareable config widens the filter to include packages/contract. Trade-off: it imports semantic-release-monorepo internals, so bumping that dependency needs a release-path test first.
  • docs/architecture.md records the surface hierarchy and the decision that self-update, drain, backup, and cleanup are core agent-ops features, not scope creep.

caiopizzol added 23 commits July 6, 2026 13:24
@caiopizzol
caiopizzol marked this pull request as ready for review July 6, 2026 16:52
@caiopizzol
caiopizzol merged commit 942e36f into main Jul 6, 2026
3 checks passed
@caiopizzol
caiopizzol deleted the chore/cleanup-dx branch July 6, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant