diff --git a/README.md b/README.md index dad3828..e8d4c56 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ **Controlled execution for AI-agent tool calls.** -Built on [REMORA](https://github.com/darklordVirtual/REMORA-research), consumed -as a hash-pinned release rather than a dependency on its `master`. +Powered by [REMORA](https://github.com/darklordVirtual/REMORA-research). Assured Agent Execution (AAE) governs how AI agents interact with tools and operational systems. @@ -112,23 +111,12 @@ To try to get past these controls yourself, see ## REMORA integration -AAE consumes a versioned REMORA release through pinned artifacts: +AAE runs REMORA's governance engine, consumed as a fixed set of released +artifacts rather than from its main branch. Every artifact is verified before +anything uses it, and the install refuses on a mismatch. -* REMORA wheel -* release manifest -* OpenAPI specification -* public SDK contract -* execution lifecycle schema -* ToolSpec schema -* postcondition schema - -The active release is defined in: - -```text -product/core-artifact-lock.json -``` - -Every artifact is verified before installation and use. +Which artifacts, the current values, and how to move to a newer release: +[The pinned core](docs/pinned-core.md). ## Repository structure @@ -163,6 +151,7 @@ python run.py reset # Stop and remove all volumes ## Documentation * [Architecture](docs/architecture.md) — components, data flow and boundaries +* [The pinned core](docs/pinned-core.md) — what is pinned, and how it is verified * [Security model](docs/security-model.md) — what is enforced, and by what * [Limitations](docs/limitations.md) — known gaps * [Operations](docs/operations.md) — signing, backup, evidence and upgrades diff --git a/docs/architecture.md b/docs/architecture.md index 905a3e5..8e4f874 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -29,9 +29,9 @@ **Control plane** — REMORA's `servers.api`, run from the pinned wheel. AAE supplies the configuration, the ToolPack and the deployment profile; it does -not reimplement decision semantics. See -[adr/0001-pinned-remora-artifacts.md](adr/0001-pinned-remora-artifacts.md) and -[adr/0004-control-plane-boundary.md](adr/0004-control-plane-boundary.md). +not reimplement decision semantics. What is pinned and how it is verified: [pinned-core.md](pinned-core.md). Why +it is done this way: [adr/0001](adr/0001-pinned-remora-artifacts.md) and +[adr/0004](adr/0004-control-plane-boundary.md). **ToolPack** — everything specific to this integration. Four declarations, split because they are owned differently: diff --git a/docs/operations.md b/docs/operations.md index 895ba54..7dc702b 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -140,16 +140,5 @@ python run.py reset # stop AND destroy the volumes, chain included ## Upgrading the pinned core -```bash -# edit product/core-artifact-lock.json: tag, commit, wheel digest -gh release download -R darklordVirtual/REMORA-research \ - -D dist -p core-release-manifest.json --clobber -cp dist/core-release-manifest.json product/core-release-manifest.json -python scripts/verify_core_pin.py --out dist -python run.py check # the lock and manifest must agree field by field -python run.py up && python run.py verify -``` - -`test_pin_manifest_agreement.py` compares the hand-written lock against the -release-generated manifest and runs on JSON only, so a disagreement fails -before anything is downloaded or built. +The procedure, the current values and what each check protects against are in +[The pinned core](pinned-core.md#upgrading). diff --git a/docs/pinned-core.md b/docs/pinned-core.md new file mode 100644 index 0000000..b769174 --- /dev/null +++ b/docs/pinned-core.md @@ -0,0 +1,131 @@ +# The pinned core + +AAE runs REMORA's governance engine. It consumes it as a versioned, hash-identified +artifact set — never from `master`, never as a submodule, never vendored. + +This document is the whole story: what is pinned, what the current values are, +how they are verified, and what changing them involves. + +## Why pin at all + +REMORA is a research repository under active change. Installing from its main +branch would make this product an unstable fork of it: research changes would +arrive unannounced, and the product's behaviour would move with them. + +A pin makes an upgrade a deliberate, reviewable act. The reasoning is recorded +in [adr/0001-pinned-remora-artifacts.md](adr/0001-pinned-remora-artifacts.md). + +## What is pinned + +Seven artifacts, each by SHA-256, in +[`product/core-artifact-lock.json`](../product/core-artifact-lock.json): + +| Artifact | What it fixes | +|---|---| +| `remora-0.10.0-py3-none-any.whl` | the engine and the SDK | +| `core-release-manifest.json` | the core's own description of what it shipped | +| `openapi.json` | the REST contract | +| `public_api_v1.json` | the SDK's public surface — 36 symbols | +| `execution_lifecycle_v1.yaml` | the states a proposal can be in | +| `tool_spec_v1.yaml` | what a ToolSpec is | +| `postcondition_contract_v1.yaml` | what an effect status means | + +The three contracts are pinned alongside the code deliberately. Agreeing on the +wheel while disagreeing about what a ToolSpec is, or what `EFFECT_MISMATCH` +means, is exactly the drift a pin exists to prevent. + +## Current pin + +``` +release core-candidate-2026.08.06.3 (prerelease, deliberately) +commit aff4edf7ec61a29c6db4c56204284938a788780f +version REMORA 0.10.0 +``` + +`prerelease` is not an oversight. The release is pinnable, not blessed: no +external review has run against that build, and there is no signed image or +build provenance. The lock records why in `release_status_reason`, and +`verify_core_pin.py` prints it on every run rather than letting it pass +unnoticed. + +## How the pin is verified + +```bash +python scripts/verify_core_pin.py --out dist +``` + +It downloads the release assets and **refuses on any hash mismatch** — a pin +nobody verifies is a comment, not a control. It also verifies the copy of the +release manifest checked into this tree, because verifying only the download +left the in-tree file free to rot, and it did for two pin bumps. + +Exit codes distinguish the two failures that matter: `1` means the artifact is +not what was pinned, `2` means the release could not be reached. A network +outage must never read as a tampered artifact. + +Two more checks run without any network at all, as part of `python run.py check`: + +- `test_pin_manifest_agreement.py` compares the hand-written lock against the + release-generated manifest field by field — commit, version, every digest, + the symbol count three ways, and the consumer contract. That test exists + because the two disagreed for two pin bumps and nothing compared them. +- `test_sdk_contract.py` asserts every promised SDK symbol is importable, that + both clients carry every required operation, and that no product file imports + a namespace the lock classifies as internal. + +The control-plane image verifies the wheel's digest a **third** time, inside +the build, against the lock it also copies in. That is not redundant: the first +check gates the download, and the second makes the image self-describing — an +image built from an unverified wheel fails its own build rather than shipping. + +## Digests are content, not bytes + +`verify_core_pin.py` normalises CRLF to LF before hashing text artifacts, so a +Windows checkout and a Linux one agree. The wheel is binary and hashed raw. + +This makes the text digests *content* digests rather than digests of the exact +published bytes. `.gitattributes` forces LF throughout, so in practice the two +coincide — but if byte-level provenance is ever required, that distinction is +where to start. + +## Upgrading + +```bash +# 1. edit product/core-artifact-lock.json: release_tag, commit, wheel digest +# 2. take the release's own manifest, and pin its digest too +gh release download -R darklordVirtual/REMORA-research \ + -D dist -p core-release-manifest.json --clobber +cp dist/core-release-manifest.json product/core-release-manifest.json + +# 3. verify before anything is built +python scripts/verify_core_pin.py --out dist +python run.py check # the lock and the manifest must agree +python run.py up && python run.py verify +``` + +Step 2 is the one people skip. The manifest is the core's own account of what +it published; without pinning its digest, the copy in this tree can drift from +the release it names — which is precisely what happened before the agreement +test existed. + +## The one dependency that is not pinned this way + +`toolpacks/work_order/bundle.py` imports nine types from `remora.toolcall.*` to +declare what this deployment's tools mean. That namespace is not `remora.sdk`, +is not in the public-API snapshot, and is therefore not covered by the pin's +drift gate — no equivalent exists in the SDK, so a deployment cannot author its +own semantics without it. + +`test_toolpack_authoring_surface.py` pins the exact symbols and their +constructor keywords, so an upstream rename fails in CI on a pin bump rather +than in a deployment as "every proposal abstains". Its last test asserts that +`remora.sdk` does **not** yet offer them: when that fails, it is the signal to +move the imports and delete the file. + +## What the pin does not give you + +The REMORA wheel is byte-pinned. The rest of this product's build is not: base +images are tags rather than digests, and the Python dependencies are floors +rather than a lockfile. `python run.py sbom` records what a given build actually +contained, which is a record, not reproducibility. See +[limitations.md](limitations.md). diff --git a/tests/compatibility/test_pin_manifest_agreement.py b/tests/compatibility/test_pin_manifest_agreement.py index d8ec0ce..b776a82 100644 --- a/tests/compatibility/test_pin_manifest_agreement.py +++ b/tests/compatibility/test_pin_manifest_agreement.py @@ -121,3 +121,46 @@ def test_a_prerelease_pin_says_why() -> None: assert LOCK.get("release_status_reason", "").strip(), ( "a non-stable pin must record why it is not stable" ) + + +# ── The document that quotes the pin ─────────────────────────────────────── + +def test_the_pinned_core_document_quotes_the_current_pin() -> None: + """docs/pinned-core.md names a release, a commit and a version. + + A reference document that quotes values goes stale the moment they move, + and a stale one is worse than none: it looks authoritative. This binds it + to the lock, so a pin bump that forgets the document fails here rather + than misleading the next reader. + """ + doc = (ROOT / "docs" / "pinned-core.md").read_text(encoding="utf-8") + for field, value in ( + ("release_tag", LOCK["release_tag"]), + ("remora_core_commit", LOCK["remora_core_commit"]), + ("remora_core_version", LOCK["remora_core_version"]), + ("wheel filename", LOCK["wheel"]["filename"]), + ): + assert value in doc, ( + f"docs/pinned-core.md does not name the current {field} " + f"({value}). Update the document with the pin.") + + +def test_the_pinned_core_document_names_every_pinned_artifact() -> None: + """Seven digests in the lock, seven artifacts in the table.""" + doc = (ROOT / "docs" / "pinned-core.md").read_text(encoding="utf-8") + for filename in ("core-release-manifest.json", "openapi.json", + "public_api_v1.json", "execution_lifecycle_v1.yaml", + "tool_spec_v1.yaml", "postcondition_contract_v1.yaml"): + assert filename in doc, f"{filename} is pinned but not documented" + + declared = sum(1 for key in LOCK if key.endswith("_sha256")) + 1 + assert f"{declared} artifacts" in doc or "Seven artifacts" in doc, ( + f"the lock pins {declared} artifacts; the document does not say so") + + +def test_the_document_states_the_prerelease_status() -> None: + """A reader must not have to open the lock to learn the pin is not blessed.""" + if LOCK.get("release_status") == "stable": + pytest.skip("the pin is stable; nothing to disclose") + doc = (ROOT / "docs" / "pinned-core.md").read_text(encoding="utf-8") + assert "prerelease" in doc.lower()