refactor(mothership): reconcile canonical /mint contract, archive sprawl#20
Conversation
Harden ChittyID's canonical role and eliminate competing docs/code:
- Docs reconciled to reality: CHARTER/CHITTY/README documented
/api/v2/chittyid/* endpoints that are served NOWHERE. Replaced with the
actual canonical POST /mint + /api/validate + /api/spec, and documented
the deprecated 308-redirect aliases (/v1/mint, /generate, /api/get-chittyid)
with their 2027-05-27 sunset.
- Client lib (chittyid.js) was calling the dead v2 endpoints; repointed to
/mint ({entityType}) and /api/validate ({id}) to match worker.js.
- package.json "main" pointed at chittyid-service-worker.js (already archived);
fixed to worker.js (matches wrangler.jsonc).
- Archived 13 stale Mar-16 status/summary docs superseded by the canonical
triad, and the dead demo-MCP cluster (mcp-handler, demo-mcp-sync,
mcp-project-sync, *-config, test-mcp-langchain) + superseded chitty-cli.js.
- eslint.config: drop archived-file ignore, ignore .archive dir.
Deferred to follow-up (called out to prevent re-discovery as sprawl):
_worker.js vs worker.js, wrangler.hybrid.toml + deploy:hybrid* + HYBRID_SYSTEM.md,
chittyid-client.js (0 refs).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
chittyid | ea4e11e | May 28 2026, 07:19 AM |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (27)
📝 WalkthroughWalkthroughThe PR migrates API documentation and client code from v2 endpoints ( ChangesAPI Endpoint Migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea4e11e083
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| region, | ||
| jurisdiction, | ||
| entity: entityType, | ||
| trustLevel, |
There was a problem hiding this comment.
Preserve mint parameters when switching endpoints
When generate(region, jurisdiction, entityType, trustLevel) uses the new POST /mint route, the worker only reads entityType from the JSON body and takes region, jurisdiction, and trust from query parameters before forwarding to ChittyMint (worker.js lines 128-150). As a result, callers that pass explicit geography or trust level through this SDK now silently mint with defaults/inferred values instead of the requested region, jurisdiction, and trustLevel.
Useful? React with 👍 / 👎.
| - `GET /generate` → use `POST /mint` with `{entityType:"P"}` | ||
| - `GET /api/get-chittyid` → use `POST /mint` |
There was a problem hiding this comment.
Don't document GET aliases as compatible redirects
The current worker returns a 308 for /generate and /api/get-chittyid, and 308 preserves the original HTTP method, while the canonical /mint route only handles POST (worker.js lines 467-497). Any client following the documented GET /generate alias will therefore arrive at GET /mint and get a 404 instead of minting, so these aliases are not backward-compatible as described.
Useful? React with 👍 / 👎.
Summary
Hardens ChittyID's role as the canonical identity mothership by eliminating competing direction across docs, code, config, and deploy models. Two root problems fixed:
/api/v2/chittyid/*endpoints served nowhere — canonical isPOST /mint(feat(mint): canonical /mint + 308-redirect deprecated aliases (E1) #19).Live
id.chitty.cc/healthreturns worker.js's exact signature (chittyid-mothership2.0.0), confirming worker.js + wrangler.jsonc + deploy-production.yml is canonical.Commit 1 — contract + doc/code sprawl
CHARTER.md/CHITTY.md/README.md: phantom/api/v2/chittyid/*+/api/v2/fallback/*→ realPOST /mint,POST /api/validate({id}),GET /api/spec,GET /health; documented deprecated 308 aliases (/v1/mint,/generate,/api/get-chittyid) sunset2027-05-27.chittyid.jsclient repointed off the dead v2 endpoints to/mint+/api/validate.package.jsonmainfixed (pointed at an already-archived file) →worker.js.chitty-cli.js.Commit 2 — single deploy path (resolves competing deploy models)
.github/workflows/deploy.yml(competing Pages deploy; live is a Worker).wrangler.hybrid.toml(separate deploy to an inaccessible account; routes already served by worker.js),_worker.js(stale 164-line duplicate of worker.js),wrangler-pages.toml(0 refs),scripts/deploy.sh(built the dead_worker.js).package.json: droppeddeploy:hybrid*,dev:workers,test:hybrid(dead).CLAUDE.md/setup-env.sh: removed staledeploy:pages/deploy.shdocs →npm run deploy.src/hybrid/ontology-controller.js(imported by worker.js).Verification
grepforapi/v2/chittyid,v2/fallback,chittyid-service-worker,wrangler.hybrid,deploy:hybrid,_worker.js,wrangler-pagesacross live surfaces → CLEAN.node --check worker.js chittyid.js+package.jsonparse → OK.id.chitty.cc/healthconfirms canonical Worker is deployed.🤖 Generated with Claude Code