Skip to content
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
amitpaz1 merged 1 commit into
mainfrom
fix/p1-correctness
Jun 19, 2026
Merged

fix: P1 — repair demo, honest docs, control-plane auth + scoped CORS#2
amitpaz1 merged 1 commit into
mainfrom
fix/p1-correctness

Conversation

@amitpaz1

Copy link
Copy Markdown
Member

Fixes the mesh correctness/doc/security gaps the review flagged.

  • Broken demoexamples/formbridge-demo.ts referenced nonexistent r.matchedTerms (real field: r.matchedCapabilities); fixed it + the README. Added tsconfig.typecheck.json covering examples/ and chained it into build, so the demo is type-checked (the original tsc only covered src/, which is why this slipped through).
  • Misleading docs — delegation actually uses HTTP POST /task, not the advertised MCP /mcp + handle_task. Rewrote the delegation section + example endpoints to the real contract. Removed the LoreDiscoveryEngine / "semantic search" claims that don't exist in code; described discovery honestly as keyword/token-overlap.
  • Open control plane (security) — added Bearer-token auth on /v1/* (crypto.timingSafeEqual, token from MESH_TOKEN). Fail-closed: unset token → all /v1/* 401. Replaced wildcard CORS with a configurable origin (MESH_CORS_ORIGIN, never *); /health stays open.

Build clean (including the newly type-checked example); pnpm test green with 5 new auth tests.

🤖 Generated with Claude Code

…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>
@amitpaz1
amitpaz1 merged commit 6967c59 into main Jun 19, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant