Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,22 @@ Open source · Local first · Provider neutral · Zero mandatory runtime depende

MARGINAL does not assume that more calls are wasteful. Missing or ambiguous evidence fails open.

## Install for Codex
## Current integrations

| Engine | Capability | Integration |
|---|---|---|
| **Codex** | **Tool Enforcement** | Native plugin. Shadow Mode by default; enforcement requires local Earned Enforcement evidence. |
| **Claude Code** | **Observe** | Native plugin using Claude Code hooks. Records engine-declared success/failure without changing the next model action. |
| **OpenCode** | **Observe** | In-process JavaScript plugin with a persistent stdio bridge to the provider-neutral runtime. |
| **PrivacyCode** | **Observe** | OpenCode-compatible install target with a distinct engine identity, ledger root, and trust evidence. |

`Observe` integrations record evidence and recommendations but cannot block. A compatible install target
may share an adapter, but it never shares earned trust: **same adapter does not mean same enforcement
evidence**.

## Native integrations

### Codex

Install the native plugin from the repository:

Expand Down Expand Up @@ -61,6 +76,43 @@ marginal install codex --autopilot-consent
Installation alone never enables enforcement. Earned Enforcement requires verified evidence and
explicit promotion.

### Claude Code

With the Python CLI installed:

```bash
marginal install claude-code
marginal uninstall claude-code
```

Claude Code is **Observe-only** today. Its hooks expose separate success and failure events, so those
outcomes are engine-declared rather than inferred from tool output.

### OpenCode

```bash
marginal install opencode
marginal uninstall opencode
```

OpenCode is **Observe-only**. The JavaScript plugin runs in the engine process and communicates with one
long-running local MARGINAL bridge over stdio. Shell exit codes can prove shell success/failure; outcomes
without a reliable engine signal remain `unknown`.

### PrivacyCode

```bash
marginal install privacycode
marginal uninstall privacycode
```

PrivacyCode reuses the OpenCode plugin contract but keeps a distinct engine label, installation path,
ledger root, and evidence history. Compatibility is validated, not assumed permanently; a protocol
divergence requires a separate adapter.

See the [integration overview](docs/integrations/overview.md), [Claude Code guide](docs/integrations/claude-code.md),
and [OpenCode / PrivacyCode guide](docs/integrations/opencode.md).

## How Autopilot works

1. **Observe.** Hooks collect derived state, outcome, and coverage signals in Shadow Mode.
Expand Down Expand Up @@ -200,6 +252,8 @@ evidence semantics. See the [architecture guide](docs/product/architecture.md).
| Getting started | [Quickstart](docs/getting-started/quickstart.md) |
| Product | [Concepts](docs/product/concepts.md) · [Architecture](docs/product/architecture.md) |
| Codex | [Plugin guide](docs/integrations/codex.md) · [Benchmark readiness](docs/integrations/codex-benchmark-readiness.md) |
| Claude Code | [Observe plugin](docs/integrations/claude-code.md) |
| OpenCode / PrivacyCode | [Observe plugin and compatible targets](docs/integrations/opencode.md) |
| Evaluation | [Benchmarking](docs/evaluation/benchmarking.md) · [Public benchmarks](docs/evaluation/public-benchmarks.md) |
| Operations | [Privacy](docs/operations/privacy.md) · [Governance](docs/project/governance.md) |
| Reference | [API](docs/reference/api.md) · [Roadmap](ROADMAP.md) |
Expand Down
19 changes: 15 additions & 4 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This roadmap is milestone-driven rather than date-driven. GitHub Issues and pull
| **v0.2 — Learning Loop Foundation** | Complete | Universal protocol, non-blocking observation, versioned evidence, privacy and replay |
| **Community hardening** | In progress | Governance tax, false-stop accounting, diminishing-return control and clearer evidence UX |
| **v0.3 — Codex Reference Integration** | Validation | Native plugin, one-command install, Earned Enforcement, and measured smoke |
| **v0.4 — Multi-Engine Developer Preview** | Planned | Shared core across materially different coding agents |
| **v0.4 — Multi-Engine Developer Preview** | In progress | Codex, Claude Code and OpenCode-family surfaces sharing one governance core |
| **v0.5 — One-Command Universal Installation** | Planned | Detection, installation, diagnostics and rollback across engines |
| **v0.6 — Adaptive and Causal Allocation** | Planned | Calibrated learning, exploration and stronger identification strategies |
| **v0.7 — Ecosystem and Operational Scale** | Planned | Persistence, observability, team controls and more engines |
Expand Down Expand Up @@ -196,11 +196,22 @@ See [Codex benchmark readiness](docs/integrations/codex-benchmark-readiness.md).

## v0.4 — Multi-Engine Developer Preview

**Status:** Planned
**Status:** In progress

The multi-engine layer is now real rather than roadmap-only:

Build OpenCode, Claude Code and GitHub Copilot integrations where official control surfaces permit them. Reuse the same protocol, policy, governance accounting, privacy boundaries and reports. Publish a capability matrix and label each engine as Observe, Tool Enforcement or Full Compute Enforcement.
- [x] Claude Code native plugin, labeled **Observe**, mapped through the engine-neutral hook core.
- [x] OpenCode plugin, labeled **Observe**, using one persistent stdio bridge for interleaved sessions.
- [x] PrivacyCode supported as an OpenCode-compatible target with separate engine identity and ledger state.
- [x] Keep economic policy in `UniversalRuntime`; adapters normalize native events and declare only capabilities they can prove.
- [x] Preserve fail-open behavior and record unavailable/unknown evidence instead of inventing measurements.
- [ ] Migrate older duplicated hook logic onto the shared integration core only after conformance coverage is sufficient.
- [ ] Add another materially different engine surface where its official API supports a defensible adapter.
- [ ] Publish cross-engine conformance and paired evidence before expanding enforcement claims.

**Exit criteria:** at least four environments pass protocol conformance; economic logic remains centralized; at least two integrations support real enforcement; each engine documents limitations and fail-open behavior.
**Exit criteria:** at least four environments pass protocol conformance; economic logic remains centralized;
at least two integrations support real enforcement backed by engine-specific Earned Enforcement evidence;
each engine documents outcome limits, privacy boundaries and fail-open behavior.

---

Expand Down
21 changes: 20 additions & 1 deletion docs/getting-started/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# Quickstart

## Install
## Native agent integrations

MARGINAL starts conservatively. Codex installs in Shadow Mode before any earned tool enforcement;
Claude Code, OpenCode, and PrivacyCode are **Observe-only** and cannot block.

```bash
# Codex native plugin
codex plugin marketplace add SignalLayerLabs/Marginal --ref main
codex plugin add marginal@marginal

# With the MARGINAL Python CLI installed
marginal install claude-code
marginal install opencode
marginal install privacycode
```

Remove an integration with its matching uninstall command. See the
[integration overview](../integrations/overview.md) for capability and evidence limits.

## Python library / development install

```bash
python -m pip install -e ".[dev]"
Expand Down
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ MARGINAL documentation is organized by user intent instead of keeping every guid

- [Integration overview](integrations/overview.md)
- [Codex plugin](integrations/codex.md)
- [Claude Code plugin](integrations/claude-code.md)
- [OpenCode and PrivacyCode](integrations/opencode.md)
- [Codex benchmark readiness](integrations/codex-benchmark-readiness.md)

## Evaluation and research
Expand Down
6 changes: 6 additions & 0 deletions docs/integrations/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ child process over pipes. Its outcome evidence is weaker than Claude Code's: the
exit code, most other tools prove nothing, and those outcomes stay `unknown`. See
[OpenCode plugin](opencode.md).

PrivacyCode is an **Observe** install target for the same OpenCode adapter because its validated plugin
surface is currently compatible. It keeps a distinct engine label, configuration path, ledger root, and
evidence history. Target compatibility does not transfer Earned Enforcement authority: trust remains
engine-specific. If the plugin/event contract diverges, PrivacyCode becomes a separate adapter rather
than accumulating target-specific governance semantics.

GitHub Copilot remains roadmap work. Codex is labeled Tool Enforcement,
not Full Compute Enforcement, because specialized and hosted tool paths can fall outside local
hook coverage.
Expand Down
36 changes: 30 additions & 6 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>MARGINAL — Evidence-Driven Compute Governance for AI Agents</title>
<meta name="description" content="MARGINAL is an open-source, local-first compute governance layer for AI agents that measures net value, governance overhead, diminishing returns and false stops.">
<meta name="keywords" content="AI agents, coding agents, compute governance, token optimization, Codex, agent observability, AI FinOps, LLM cost optimization">
<meta name="keywords" content="AI agents, coding agents, compute governance, Codex, Claude Code, OpenCode, PrivacyCode, agent observability, AI FinOps, LLM cost optimization">
<meta name="author" content="SignalLayer Labs">
<meta name="robots" content="index,follow">
<link rel="canonical" href="https://signallayerlabs.github.io/Marginal/">
Expand All @@ -29,6 +29,7 @@
<button class="nav-toggle" type="button" aria-expanded="false" aria-controls="nav-links">Menu</button>
<div class="nav-links" id="nav-links">
<a href="#benchmark">Benchmark</a>
<a href="#integrations">Integrations</a>
<a href="#trace">Concrete trace</a>
<a href="#proof">Proof standard</a>
<a href="#irrelevance">Graceful irrelevance</a>
Expand Down Expand Up @@ -94,6 +95,29 @@ <h2 class="hero-title">The next action should add evidence, not just activity.</
</div>
</section>

<section class="section shell" id="integrations">
<div class="section-heading">
<p class="eyebrow">Multi-engine runtime</p>
<h2>One governance core. Engine-specific evidence boundaries.</h2>
<p>Adapters translate native lifecycle events into the same provider-neutral runtime. Capability labels stay conservative: sharing an adapter never transfers earned trust between engines.</p>
</div>
<div class="metric-grid">
<article class="accent-card"><span>Codex</span><h3>Tool Enforcement</h3><p>Native plugin. Shadow Mode first; narrow blocking requires repository-local Earned Enforcement evidence.</p></article>
<article><span>Claude Code</span><h3>Observe</h3><p>Native hooks with engine-declared success/failure events. Recommendations go to the ledger and never alter the next model action.</p></article>
<article><span>OpenCode</span><h3>Observe</h3><p>JavaScript plugin plus a persistent stdio bridge. Shell exit codes are provable; unsupported outcomes remain unknown.</p></article>
<article><span>PrivacyCode</span><h3>Observe</h3><p>OpenCode-compatible target with its own engine label, install path, ledger root and evidence history.</p></article>
</div>
<div class="evidence-banner">
<span class="evidence-key">Current rule</span>
<strong>Same adapter ≠ same trust. Enforcement evidence stays engine- and repository-specific.</strong>
</div>
<div class="benchmark-links">
<a href="https://github.com/SignalLayerLabs/Marginal/blob/main/docs/integrations/overview.md">Integration matrix</a>
<a href="https://github.com/SignalLayerLabs/Marginal/blob/main/docs/integrations/claude-code.md">Claude Code</a>
<a href="https://github.com/SignalLayerLabs/Marginal/blob/main/docs/integrations/opencode.md">OpenCode / PrivacyCode</a>
</div>
</section>

<section class="section thesis" id="trace"><div class="shell split compact-gap">
<div>
<p class="eyebrow">The actual thesis</p>
Expand Down Expand Up @@ -173,11 +197,11 @@ <h2>What if GPT-5.7 — or any future model — is already efficient?</h2>
</section>

<section class="section roadmap-section"><div class="shell">
<div class="section-heading"><p class="eyebrow">Measured milestone</p><h2>Codex Reference Integration</h2><p>The auditable adapter and first matched smoke are implemented. The next evidence gate is a preregistered repeated canary large enough to estimate trajectory variance.</p></div>
<div class="section-heading"><p class="eyebrow">Current milestone</p><h2>Multi-Engine Developer Preview</h2><p>Codex, Claude Code, OpenCode and PrivacyCode now reach the same governance core through capability-aware integrations. The next gate is cross-engine conformance and causal intervention evidence, not broader claims.</p></div>
<div class="roadmap-line">
<div class="done"><span>v0.2</span><b>Learning Loop Foundation</b><small>universal protocol · ledger · privacy · replay</small></div>
<div class="current"><span>Hardening</span><b>Net-value evidence layer</b><small>governance tax · false stops · diminishing returns</small></div>
<div class="done"><span>v0.3 foundation</span><b>Codex integration smoke</b><small>pinned runtime · telemetry · matched OFF/ON · Modal verification</small></div>
<div class="done"><span>v0.3</span><b>Codex reference integration</b><small>Tool Enforcement · evidence receipts · matched smoke</small></div>
<div class="done"><span>Multi-engine</span><b>Observe surfaces landed</b><small>Claude Code · OpenCode · PrivacyCode</small></div>
<div class="current"><span>Next</span><b>Counterfactual validation</b><small>paired continuations · regret · engine-specific earned trust</small></div>
</div>
<div class="center"><a class="button button-secondary" href="https://github.com/SignalLayerLabs/Marginal/blob/main/ROADMAP.md">Read the roadmap</a></div>
</div></section>
Expand All @@ -186,7 +210,7 @@ <h2>What if GPT-5.7 — or any future model — is already efficient?</h2>
<p class="eyebrow">Build the evidence first</p>
<h2>Observe. Measure. Let intervention earn enforcement.</h2>
<div class="hero-actions center">
<a class="button" href="https://github.com/SignalLayerLabs/Marginal#install">Install for Codex</a>
<a class="button" href="https://github.com/SignalLayerLabs/Marginal#native-integrations">Install MARGINAL</a>
<a class="button button-secondary" href="https://github.com/SignalLayerLabs/Marginal/issues">Challenge the project</a>
</div>
</div></section>
Expand Down