Skip to content

Commit f071354

Browse files
Kurt Overmierclaude
andcommitted
docs: sync from source repos — charter, edgestack, ecosystem
Synced 3 pages via docs-sync pipeline: - getting-started.md: streamlined from charter repo - compass-governance-api.md: expanded route taxonomy from edgestack_v2 - ecosystem.md: updated to 3-piece architecture (engine merged into Stackbilder) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 25b6917 commit f071354

File tree

3 files changed

+213
-413
lines changed

3 files changed

+213
-413
lines changed

src/content/docs/compass-governance-api.md

Lines changed: 146 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -7,102 +7,175 @@ color: "#22d3ee"
77
tag: "08"
88
---
99

10-
# Compass Governance
10+
# Compass Governance API
1111

12-
Compass is an internal governance service accessed via Cloudflare Service Binding from the Stackbilder flow pipeline. It is **not a public API** — there are no HTTP endpoints, no MCP server, and no admin surface.
12+
Compass is the governance system behind StackBilt. This page documents the current Compass API surface and route taxonomy implemented in the `DigitalCSA` worker.
1313

14-
## Architecture
14+
Base URL (production): accessed via Stackbilder service binding (not a public subdomain)
1515

16-
Compass is a lightweight RPC service (`compass` worker) bound to EdgeStack via `CSA_SERVICE` service binding. It provides governance guidance, quality assessment, and decision persistence for the 6-mode flow pipeline.
16+
## What This Covers
1717

18-
```
19-
EdgeStack (FlowDO)
20-
21-
├── fetchGuidance(mode, tier) → constraints + quality thresholds
22-
23-
├── mode execution (LLM)
24-
25-
├── assessQuality(artifact) → score + pass/fail
26-
27-
└── persistDecisions(decisions) → ledger write (SPRINT mode only)
28-
```
18+
- Compass MCP endpoints (`/mcp`, `/mcp/info`, legacy compatibility paths)
19+
- Canonical admin/domain route taxonomy
20+
- JWT + JWKS auth routes
21+
- Core governance APIs (ledger, patterns, requests, triage, validation, exhibits, agent ops)
2922

30-
## RPC Methods
23+
This page is a route map and integration reference, not a full schema-level endpoint spec.
3124

32-
All calls go through `POST /rpc` with JSON-RPC payload. Requires `scope` object with `projectId`, `flowId`, `mode`, `tier`, `effectiveGovernanceMode`.
25+
## Authentication Model
3326

34-
### compass.fetchGuidance
27+
Compass uses scoped API auth for most `/api/*` routes and enforces tenant/domain boundaries in the worker:
3528

36-
Returns governance context and quality thresholds for a flow mode. Called before each mode execution.
29+
- ecosystem scope (`ecosystem_id`)
30+
- optional domain/project scope (`domain_id` / `project_id`)
31+
- payload scope enforcement on write requests (`POST` / `PATCH` / `PUT`)
3732

38-
```json
39-
{
40-
"method": "compass.fetchGuidance",
41-
"params": {
42-
"scope": {
43-
"projectId": "...",
44-
"flowId": "...",
45-
"mode": "ARCHITECT",
46-
"tier": "pro",
47-
"effectiveGovernanceMode": "ADVISORY"
48-
}
49-
}
50-
}
51-
```
33+
### MCP Authentication (`/mcp`)
5234

53-
### compass.assessQuality
35+
Compass MCP supports:
5436

55-
Scores a generated artifact against quality thresholds. Called after artifact generation.
37+
- JWT Bearer token (primary)
38+
- session-based follow-up requests via `mcp-session-id`
39+
- query-token compatibility mode (deprecated; can be warn/block mode)
5640

57-
```json
58-
{
59-
"method": "compass.assessQuality",
60-
"params": {
61-
"scope": { "..." },
62-
"artifact": "...",
63-
"mode": "ARCHITECT"
64-
}
65-
}
66-
```
41+
If no valid JWT and no session is present, Compass rejects the request.
6742

68-
### compass.persistDecisions
43+
### JWT / JWKS Routes
6944

70-
Stores ADRs and architectural decisions in the governance ledger. Called at end of SPRINT mode only.
45+
| Endpoint | Method | Notes |
46+
|---|---|---|
47+
| `/api/.well-known/jwks.json` | `GET` | Public JWKS for JWT verification |
48+
| `/api/auth/token` | `POST` | Issue Compass JWT (requires valid API key) |
49+
| `/api/auth/revoke` | `POST` | Revoke JWTs (admin only) |
7150

72-
```json
73-
{
74-
"method": "compass.persistDecisions",
75-
"params": {
76-
"scope": { "..." },
77-
"decisions": [{ "..." }]
78-
}
79-
}
80-
```
51+
## MCP Endpoints
8152

82-
## Governance Modes by Plan
53+
| Endpoint | Method | Purpose |
54+
|---|---|---|
55+
| `/mcp/info` | `GET` | Public server info / capabilities summary |
56+
| `/mcp` | `GET` | SSE stream (session-capable) |
57+
| `/mcp` | `POST` | MCP JSON-RPC requests |
58+
| `/mcp` | `DELETE` | End MCP session |
59+
| `/mcp/*` | `GET/POST` | MCP path variants routed through the same handler |
60+
| `/mcp-client/*` | varies | Admin-only MCP client routes (feature flagged) |
8361

84-
| Plan | Max Mode | Behavior |
85-
|------|----------|----------|
86-
| Free | `PASSIVE` | Log only — never blocks |
87-
| Pro | `ADVISORY` | Warn on issues, flow continues |
88-
| Enterprise | `ENFORCED` | Block on FAIL, require remediation |
62+
## Canonical Route Taxonomy
8963

90-
## Integration
64+
Compass uses a canonical route structure for admin, domain registry, and domain-scoped governance operations.
9165

92-
EdgeStack creates a `CompassExchangeClient` per flow (cached, 5-min TTL). The client calls Compass via service binding with a 10-second timeout.
66+
### Admin Routes (`/api/admin/*`)
9367

94-
```toml
95-
# edgestack-v2/wrangler.toml
96-
[[services]]
97-
binding = "CSA_SERVICE"
98-
service = "compass"
99-
```
68+
Primary admin surfaces include:
10069

101-
## Future Direction
70+
- `/api/admin/keys`
71+
- `/api/admin/domains`
72+
- `/api/admin/repo-keys`
73+
- `/api/admin/repo-keys/:keyId/rotate`
74+
- `/api/admin/repo-keys/:keyId/revoke`
75+
- `/api/admin/repo-keys/:keyId/events`
76+
- `/api/admin/repos/:repoId/revoke-all-keys`
10277

103-
Compass governance logic is being consolidated into the Stackbilder Engine (`stackbilt-engine`), which already handles blessed pattern enforcement, compatibility scoring, and tier gating deterministically. See [edgestack#32](https://github.com/Stackbilt-dev/edgestack_v2/issues/32) for the migration plan.
78+
These routes require admin auth and apply scope checks before writes.
79+
80+
### Domain Registry Routes (`/api/domains`)
81+
82+
Admin-manageable domain registry endpoints:
83+
84+
- `GET/POST /api/domains`
85+
- `GET/PATCH /api/domains/:domainId`
86+
87+
### Domain-Scoped Governance Routes (`/api/domains/:domainId/*`)
88+
89+
These routes enforce domain ownership and payload scoping.
90+
91+
| Endpoint Pattern | Methods | Purpose |
92+
|---|---|---|
93+
| `/api/domains/:domainId/ledger` | `GET`, `POST` | Ledger entries |
94+
| `/api/domains/:domainId/tickets` | `GET`, `POST` | Governance requests/tickets |
95+
| `/api/domains/:domainId/chat/threads` | `GET`, `POST` | Domain chat threads |
96+
| `/api/domains/:domainId/chat/threads/:id` | `GET`, `PATCH`, `DELETE` | Thread lifecycle |
97+
| `/api/domains/:domainId/chat/threads/:id/messages` | `POST` | Send message |
98+
| `/api/domains/:domainId/patterns` | `GET`, `POST` | Pattern catalog |
99+
| `/api/domains/:domainId/patterns/:id` | `GET`, `PATCH`, `DELETE` | Pattern management |
100+
| `/api/domains/:domainId/protocols` | `GET`, `POST` | Protocols |
101+
| `/api/domains/:domainId/protocols/:id` | `DELETE` | Protocol delete |
102+
103+
## Core Governance APIs (Top-Level)
104+
105+
Compass also exposes top-level scoped APIs (with `ecosystem_id` / `project_id` query support in many cases) for compatibility and operational workflows.
106+
107+
### Ledger, Patterns, Requests
108+
109+
- `/api/ledger`
110+
- `/api/ledger/:id`
111+
- `/api/ledger/temporal/valid-at`
112+
- `/api/ledger/temporal/approaching-review`
113+
- `/api/ledger/:id/temporal`
114+
- `/api/patterns`
115+
- `/api/patterns/:id`
116+
- `/api/requests`
117+
- `/api/requests/:id`
118+
- `/api/requests/:id/resolve`
119+
- `/api/requests/:id/notes`
120+
121+
### Triage, Audit, Validation
122+
123+
- `/api/triage/run`
124+
- `/api/triage/commit` (admin)
125+
- `/api/triage/history`
126+
- `/api/triage/entropy`
127+
- `/api/triage/detect`
128+
- `/api/triage/scope`
129+
- `/api/audit/report`
130+
- `/api/validate`
131+
- `/api/validate/history` (admin)
132+
- `/api/git/validate`
133+
- `/api/git/validations` (admin)
134+
135+
### Submission + Chat
136+
137+
- `/api/submit`
138+
- `/api/submit/my`
139+
- `/api/submit/status/:id`
140+
- `/api/chat/threads`
141+
- `/api/chat/threads/:id`
142+
- `/api/chat/threads/:id/messages`
143+
144+
### Exhibits (Constitution / Policy Content)
145+
146+
- `/api/exhibits`
147+
- `/api/exhibits/active/:projectId`
148+
- `/api/exhibits/:id`
149+
- `/api/exhibits/:id/sections`
150+
- `/api/exhibits/:exhibitId/sections/:sectionId`
151+
152+
### Agent Operations (Admin)
153+
154+
- `/api/agent/request-action`
155+
- `/api/agent/status/:actionId`
156+
- `/api/agent/approve/:actionId`
157+
- `/api/agent/audit/:actionId`
158+
- `/api/agent/kill-switch`
159+
- `/api/agent/actions`
160+
- `/api/agent/operations`
161+
- `/api/agent/cancel/:actionId`
162+
- `/api/agent/execute/:actionId`
163+
164+
### Miscellaneous Operational Endpoints
165+
166+
- `/api/heartbeat` (proactive governance health checks)
167+
- `/api/llm` (primary LLM route)
168+
- `/api/gemini` (deprecated compatibility route)
169+
170+
## Integration Notes
171+
172+
- Prefer the canonical domain-scoped routes (`/api/domains/:domainId/*`) for new integrations.
173+
- Use JWT auth for MCP clients and reuse the session header for follow-up requests.
174+
- Treat query-token MCP auth as deprecated and migrate to header-based auth.
175+
- For public key verification across services, use Compass JWKS (`/api/.well-known/jwks.json`).
104176

105177
## Related Docs
106178

107179
- [Ecosystem](/ecosystem)
108-
- [Platform](/platform) (Stackbilder flow pipeline)
180+
- [MCP Integration](/mcp) (StackBilt MCP server)
181+
- [API Reference](/api-reference) (StackBilt platform API)

src/content/docs/ecosystem.md

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,46 @@ tag: "01"
99

1010
# Ecosystem
1111

12-
Stackbilt is a unified developer platform with four complementary systems spanning the full development lifecycle — from stack selection to governed deployment.
12+
StackBilt is three complementary tools that enforce governance across the full development lifecycle.
1313

14-
## The Four Pieces
14+
## The Three Pieces
1515

1616
| Tool | License | Role |
1717
|------|---------|------|
18-
| **Charter** (`@stackbilt/cli`) | Apache-2.0 (open source) | Local + CI governance runtime, ADF context compiler, CLI gateway to the engine |
19-
| **Stackbilder Engine** | Commercial | Deterministic tech stack builder — 52-primitive catalog, compatibility scoring, scaffold generation. Zero LLM. |
20-
| **Stackbilder Platform** | Commercial | AI-powered architecture generation, 6-mode flow pipeline, structured artifacts |
18+
| **Charter** (`@stackbilt/cli`) | Apache-2.0 (open source) | Local + CI governance runtime with ADF context compiler |
19+
| **Stackbilder** | Commercial | Architecture generation, scaffold engine, structured artifacts |
2120
| **Compass** | Commercial | Governance policy brain, institutional memory, ADR ledger |
2221

23-
Charter is the open-source CLI. The engine, platform, and Compass are commercial services.
22+
Charter is the open-source foundation. Stackbilder and Compass are commercial services.
2423

2524
## Service Map
2625

27-
| Service | URL / Worker | Purpose |
26+
| Service | URL | Purpose |
2827
|---------|-----|---------|
29-
| **Stackbilt Platform** | `stackbilt.dev` | Architecture generation, MCP server, flow pipeline |
30-
| **Stackbilt Engine** | `stackbilt-engine` | Deterministic stack builder (52-card tech deck, compatibility matrix, scaffold templates) |
31-
| **Compass** | via service binding | Governance enforcement, blessed patterns, ADR ledger |
32-
| **Auth** | `auth.stackbilt.dev` | Centralized auth — API keys, JWT, SSO, Stripe billing, PAYG credit packs |
33-
| **img-forge** | `imgforge.stackbilt.dev` | AI image generation API (multi-model, MCP + OAuth 2.1) |
34-
| **AEGIS** | `aegis.stackbilt.dev` | Persistent cognitive agent — memory, goals, task pipeline, dreaming cycle |
28+
| **StackBilt** | `stackbilt.dev` | Architecture generation, MCP server, scaffold engine |
29+
| **Compass** | via Stackbilder service binding | Governance enforcement, blessed patterns, ADR ledger |
30+
| **Auth Worker** | `auth-tenant-v2` | Authentication service (Better Auth + D1, OAuth, SSO) |
31+
| **img-forge** | `imgforge.stackbilt.dev` | AI image generation for documentation |
3532

3633
## How They Fit Together
3734

3835
```
3936
IDEA
4037
4138
42-
Engine: build(description) → deterministic stack selection (zero LLM)
43-
│ 52-primitive catalog, compatibility scoring, scaffold template
44-
45-
4639
Compass: governance("Can we build X?")
4740
4841
├── REJECTED ──► Stop
4942
5043
▼ APPROVED
51-
Platform: runFullFlowAsync(idea + engine stack)
44+
Stackbilder: runFullFlowAsync(idea)
5245
→ PRODUCT → UX → RISK → ARCHITECT → TDD → SPRINT
5346
5447
5548
Compass: red_team(architecture) → security review
5649
5750
58-
Platform: getFlowScaffold(flowId) → deployable project
51+
Stackbilder: getFlowScaffold(flowId) → deployable project
5952
6053
6154
Charter: validate + drift → commit and stack compliance
@@ -79,7 +72,6 @@ npx charter adf init # scaffold .ai/ context directory
7972

8073
**Governance commands:** `validate`, `drift`, `audit`, `classify`, `hook install`.
8174
**ADF commands:** `adf init`, `adf fmt`, `adf patch`, `adf bundle`, `adf sync`, `adf evidence`.
82-
**Engine commands:** `login`, `architect`, `scaffold` — generate and write tech stacks via the Stackbilder Engine.
8375

8476
For quantitative analysis of ADF's impact on autonomous system architecture, see the [Context-as-Code white paper](https://github.com/stackbilt-dev/charter-kit/blob/main/papers/context-as-code-v1.1.md).
8577
<!-- DOCSYNC:END:charter-oss-ecosystem -->
@@ -171,7 +163,7 @@ For automated pipelines, each service has its own token:
171163

172164
```json
173165
{
174-
"stackbilder": { "url": "https://stackbilt.dev/mcp", "token": "STACKBILDER_MCP_TOKEN" },
166+
"edgestack": { "url": "https://stackbilt.dev/mcp", "token": "EDGESTACK_MCP_TOKEN" },
175167
"compass": { "url": "https://stackbilt.dev/mcp", "transport": "service_binding", "token": "CSA_MCP_TOKEN" },
176168
"imgforge": { "url": "https://imgforge.stackbilt.dev/mcp", "token": "IMGFORGE_MCP_TOKEN" }
177169
}

0 commit comments

Comments
 (0)