feat(cartridges): add k9iser-mcp — central K9 contract regeneration - #73
Conversation
Reference implementation of the -iser regeneration-cartridge pattern. Wraps the k9iser generator so generated/k9iser/*.k9 are regenerated centrally on trigger instead of run ad hoc + hand-committed (the drift that broke Dogfood Gate estate-wide — k9iser#8, idaptik#77). Mirrors ssg-mcp structure: cartridge.json (5 tools, ADR-0006 ffi symbols), mod.js MCP bridge (backend :7743), abi/ Idris2 pipeline state machine + safety GADT (no apply-without-validate, no validate-without- generate), ffi/ Zig C-ABI + boj_cartridge_invoke dispatch, three- protocol adapter, Panll panels. Verified: ffi `zig build test` 16/16 pass (state machine + invariants + ADR-0006 dispatch); adapter builds on Zig 0.15.2 (adapter/build.zig uses the modern root_module API — the ssg-mcp exemplar's is stale). Grade D Alpha: invoke returns shaped stubs; live path additionally needs the backend service + the BoJ REST runtime (pending Elixir rewrite), exactly as ssg-mcp/boj-build.yml are today. Refs hyperpolymath/k9iser#8. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… contract - adapter: ONE internal/loopback listener, protocol-routed (REST + SSE + GraphQL + gRPC-compat) into a SINGLE dispatch → the one Zig ABI. Replaces the ssg-era 3-parallel-port pattern (the anti-pattern). - Transaction gate runs before every dispatch (exposureGate), mirroring the new Idris2 SafeK9iser.exposureSatisfied contract — no gatekeeperless path to the ABI (estate interface-safety policy). Explicitly internal-only, behind the http-capability-gateway per ADR-0004. - abi: add Exposure / requiredExposure / exposureSatisfied + k9_exposure_satisfied FFI. `idris2 --check` passes. - ffi: mark boj_cartridge_invoke `pub` so the unified adapter calls the one ABI directly (consistent with the other 4 ADR-0006 symbols). - adapter/build.zig: add test step. zig: ffi 16/16 + adapter 5/5 pass. Refs hyperpolymath/k9iser#8. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- router: add POST /cartridge/:name/sse — same trust-gated dispatch as
/invoke, streamed as text/event-stream (open→result|error→done) on the
SAME single Cowboy listener (not a parallel server). +2 tests; full
suite 177/0.
- Reconcile docs that contradicted the verified runtime:
* elixir/README.adoc: "skeleton / invoke 501 / Phase 2 pending" →
REST/SSE wired through the unified Zig ABI, trust-gated; Phase 2
DONE; Phase 3 gateway = accepted-but-tracked (ADR-0004, ~8–12wk).
* mcp-bridge/api-clients.js: "not deployed (pending Elixir rewrite)" →
accurate "core implemented; unreachable here / gateway not wired".
* OPERATOR-QUICKSTART.md: 7700/7701/7702 are facets of one unified
gated core; sole governed public ingress = http-capability-gateway
(ADR-0004), cartridge adapters internal-only.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 28 issues detected
View findings[
{
"reason": "Stale AI session file -- delete",
"type": "stale",
"file": "GEMINI.md",
"action": "delete",
"rule_module": "root_hygiene",
"severity": "medium"
},
{
"reason": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/sanctify-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/academic-workflow-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/fireflag-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/ephapax-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/bofig-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/hesiod-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
The inline `python3 -c` block placed Python source at column 1 inside a `run: |` block scalar. YAML terminated the scalar at the first under- indented line, so Dogfood Gate failed at startup (0s, no jobs) on every branch incl. main. Since 'Dogfood Gate' is a required check, no PR in the repo could merge. Moved the validator to .github/scripts/ and call it. Refs #73 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
CI root-cause + fix (Refs #73) Pushed
Remaining blocker (not repo-local): GitHub Actions is runner-starved estate-wide — 49 runs queued, 0 in-progress repo-wide. The required checks physically cannot execute until that clears. Holding the squash-merge until checks actually run and pass (no This pattern is templated, so other consumer repos likely carry the same silent |
One coherent 2026-05-18 record covering the k9iser-mcp feature (cartridge, unified transaction-gated adapter, boj-rest SSE, ADR-0004 doc reconciliation) and the dogfood-gate.yml CI root-cause fix. Keeps human + machine state consistent — no half-logged PR. Refs #73 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| @@ -0,0 +1,36 @@ | |||
| #!/usr/bin/env python3 | |||
🔍 Hypatia Security ScanFindings: 29 issues detected
View findings[
{
"reason": "Stale AI session file -- delete",
"type": "stale",
"file": "GEMINI.md",
"action": "delete",
"rule_module": "root_hygiene",
"severity": "medium"
},
{
"reason": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Python file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/.github/scripts/validate-eclexiaiser.py",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/sanctify-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/academic-workflow-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/fireflag-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/ephapax-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/boj-server/boj-server/cartridges/bofig-mcp/adapter/mod.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
Reference implementation of the -iser regeneration-cartridge pattern, now hardened to BoJ standards.
Scope (expanded)
exposureSatisfiedcontract — no gatekeeperless path. Internal-only, behindhttp-capability-gatewayper ADR-0004.POST /cartridge/:name/sseon the same single Cowboy listener, same trust-gated dispatch,text/event-stream.elixir/README.adoc,mcp-bridge/api-clients.js,OPERATOR-QUICKSTART.mdcorrected to the verified runtime + ADR-0004 tiered model (they wrongly said "skeleton/501/pending rewrite").Verification
/invoke+/sseproven through the Zig.so.idris2 --check K9iserMcp/SafeK9iser.idrpasses.Not in scope (tracked)
http-capability-gateway production-wiring (ADR-0004 tier-2; ~8–12wk programme) and the iseriser-scaffold rollout (standards epic). The runtime stays internal/loopback until the gateway lands.
Refs hyperpolymath/k9iser#8.
🤖 Generated with Claude Code