This repository was archived by the owner on Jul 8, 2026. It is now read-only.
fix: P1 — repair demo, honest docs, control-plane auth + scoped CORS#2
Merged
Conversation
…e auth + CORS - Fix the broken "runnable" demo: examples/formbridge-demo.ts referenced a nonexistent r.matchedTerms (→ r.matchedCapabilities); fix the matching README line. Add tsconfig.typecheck.json (noEmit) covering examples/ and chain it into `build` so the example is type-checked going forward (the original tsc only covered src/). - Docs: delegation is HTTP POST /task, not the advertised MCP /mcp + handle_task — rewrite the README delegation section + example endpoints to the real contract. Remove the LoreDiscoveryEngine / "semantic search" claims that don't exist; describe discovery honestly as keyword/token-overlap matching. - Security: add Bearer-token auth on /v1/* (constant-time compare via crypto.timingSafeEqual; token from MESH_TOKEN). Fail-closed: unset token → all /v1/* return 401. Replace wildcard CORS with a configurable origin (MESH_CORS_ORIGIN, never '*'); /health stays open for liveness. build clean (incl. the now-typechecked example); pnpm test green (5 new auth tests). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes the mesh correctness/doc/security gaps the review flagged.
examples/formbridge-demo.tsreferenced nonexistentr.matchedTerms(real field:r.matchedCapabilities); fixed it + the README. Addedtsconfig.typecheck.jsoncoveringexamples/and chained it intobuild, so the demo is type-checked (the originaltsconly coveredsrc/, which is why this slipped through).POST /task, not the advertised MCP/mcp+handle_task. Rewrote the delegation section + example endpoints to the real contract. Removed theLoreDiscoveryEngine/ "semantic search" claims that don't exist in code; described discovery honestly as keyword/token-overlap./v1/*(crypto.timingSafeEqual, token fromMESH_TOKEN). Fail-closed: unset token → all/v1/*401. Replaced wildcard CORS with a configurable origin (MESH_CORS_ORIGIN, never*);/healthstays open.Build clean (including the newly type-checked example);
pnpm testgreen with 5 new auth tests.🤖 Generated with Claude Code