Skip to content

Commit 4696aea

Browse files
authored
Seal prepared request capabilities for v0.4.4 (#29)
1 parent 4c8182a commit 4696aea

24 files changed

Lines changed: 962 additions & 124 deletions

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,39 @@
33
All notable changes are documented here. MRMA follows semantic versioning for the CLI and uses an
44
independent version in each machine-readable evidence schema.
55

6+
## 0.4.4 - 2026-08-07
7+
8+
### Prepared Request Boundary
9+
10+
- Replace the public raw HTTPX request field with an opaque prepared capability that preserves the
11+
existing import name while exposing only reservation metadata. An adapter-local HMAC seal binds
12+
request identity, authorization identity, mutation delta, arm, round, and accounting values.
13+
- Recompute the final method, URL, ordered raw fields, buffered content and send stream, extensions,
14+
effective `Host`, and represented size immediately before network I/O. Mutation, malformed
15+
buffering, cross-adapter use, and capability metadata changes fail before `ATTEMPT_STARTED`.
16+
- Require the buffered content and actual HTTPX send stream to have identical lengths and digests
17+
before a request can be reserved.
18+
- Bind each prepared capability to one observation session and consume it before the network call,
19+
preventing stale-session and repeated-lease replay.
20+
21+
### Mutation And Evidence Precision
22+
23+
- Enforce one-dimensional header experiments: method, target, declared HTTP version, target form,
24+
and body must remain identical. Unsupported mutation families fail closed instead of receiving a
25+
generic fingerprint binding, while unchanged exploratory control sends remain valid.
26+
- Add `changed_dimensions` to mutation validation and bind it into the deterministic local delta
27+
digest under `authorization-policy/2.1`.
28+
- Replace deterministic mutation-delta values in journals with adapter-local HMAC fingerprints and
29+
declare those identifiers as run-local in v8 evidence without changing the frozen schema.
30+
31+
### Validation And Governance
32+
33+
- Synchronize architecture, budget, API, evidence, and validation documentation with the
34+
prepare-reserve-revalidate-send capability boundary.
35+
- Require the `semantic-mutation` and `benchmark` jobs in the protected `main` ruleset alongside the
36+
existing matrix, audit, distribution, container, evidence-quality, and CodeQL checks.
37+
- Expand the suite to 348 tests and the committed critical-policy catalog to 39 mutants, all killed.
38+
639
## 0.4.3 - 2026-08-07
740

841
### Authorization Precision

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
verifiable evidence.
1717
</p>
1818

19-
> **Current release: v0.4.3.** MRMA uses semantic HTTP through HTTPX. It does not claim wire-exact
19+
> **Current release: v0.4.4.** MRMA uses semantic HTTP through HTTPX. It does not claim wire-exact
2020
> replay, prove exploitability, assign severity, or identify a proprietary component from
2121
> black-box behavior.
2222
@@ -74,7 +74,7 @@ Comparison + fixed-sample conclusion
7474
## Install
7575

7676
```bash
77-
python -m pip install mrma==0.4.3
77+
python -m pip install mrma==0.4.4
7878
mrma --version
7979
```
8080

@@ -83,8 +83,8 @@ MRMA is tested on Python 3.10 and 3.13 across Linux, Windows, and macOS.
8383
The published container supports Linux AMD64 and ARM64:
8484

8585
```bash
86-
docker pull ghcr.io/0xmrma/mrma:0.4.3
87-
docker run --rm ghcr.io/0xmrma/mrma:0.4.3 --version
86+
docker pull ghcr.io/0xmrma/mrma:0.4.4
87+
docker run --rm ghcr.io/0xmrma/mrma:0.4.4 --version
8888
```
8989

9090
## Start without network traffic

docs/API.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ declared aggregate capacity, target/mutation/hook authorization, and request bou
7575
consuming repetition or budget. `PlanSummary.approval_plan_digest` is a deterministic local identity;
7676
`PlanSummary.to_dict()` deliberately excludes it from shared evidence.
7777

78+
`SemanticHttpAdapter.prepare()` returns an opaque adapter-issued capability exposing reservation
79+
metadata such as `represented_bytes`; it does not expose the mutable HTTPX request. Pass that
80+
capability directly to `send_prepared()` after reserving its exact represented size. Capabilities
81+
are bound to one adapter and observation session, are single-use, and are revalidated immediately
82+
before network I/O.
83+
7884
## Evidence APIs
7985

8086
- `build_experiment_v8`: convert an `OracleRunResult` plus provenance into strict evidence.

docs/ARCHITECTURE.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Product boundary
44

5-
MRMA v0.4.3 has one confirmatory engine and one shared network policy kernel. The CLI parses input,
5+
MRMA v0.4.4 has one confirmatory engine and one shared network policy kernel. The CLI parses input,
66
selects workflow policy, and renders output. It does not own transport authorization decisions.
77

88
```text
@@ -14,7 +14,9 @@ ExperimentPlan + ComparisonPolicy
1414
v
1515
ExperimentOracle
1616
| authorization -> AuthorizedRequestContext
17-
| budget -> BudgetLease
17+
| prepare -> opaque, adapter-sealed request capability
18+
| budget -> BudgetLease for the prepared representation
19+
| revalidate -> authorization + prepared capability
1820
| journal -> EvidenceContext
1921
|
2022
v
@@ -26,10 +28,19 @@ CapturedResponse -> experiment analysis -> v8 evidence -> bundle
2628

2729
## Enforced boundaries
2830

29-
`SemanticHttpAdapter.send()` requires all three unforgeable-in-normal-use capability objects:
30-
an accepted `AuthorizedRequestContext`, an active `BudgetLease`, and an `EvidenceContext`. The
31-
adapter revalidates context identity, records `ATTEMPT_STARTED`, performs one semantic HTTP
32-
attempt, commits actual bounded cost, and records completion. It cannot be called with only a URL.
31+
`SemanticHttpAdapter.prepare()` builds the final HTTPX request and returns an opaque capability with
32+
safe accounting metadata; the mutable HTTPX object is not exported. The capability is sealed with
33+
an adapter-local key over the authorization identity, arm, round, accounting values, mutation
34+
delta, and a digest of the final method, URL, ordered raw fields, buffered content and stream,
35+
extensions, effective `Host`, and represented size.
36+
37+
`SemanticHttpAdapter.send_prepared()` requires that capability plus an accepted
38+
`AuthorizedRequestContext`, active `BudgetLease`, and matching `EvidenceContext`. Immediately before
39+
network I/O it recomputes the request digest, verifies the adapter seal, repeats method/URL/`Host`
40+
authorization checks, and compares actual body and representation sizes with the reservation. A
41+
changed, stale-session, or already-consumed capability fails before `ATTEMPT_STARTED`. `send()` is
42+
the single-call convenience path through the same prepare and send-prepared boundary; neither
43+
method can be called with only a URL.
3344

3445
`ExperimentOracle` owns retries, redirect traversal, setup/reset hooks, schedules, observations,
3546
and partial-run conversion. One observation session owns redirect/retry cookie state and its
@@ -41,7 +52,8 @@ HTTPX-built request so eligible cookie-jar state cannot bypass raw-field filteri
4152

4253
- `mrma.engine`: typed plan and confirmatory oracle.
4354
- `mrma.policy`: authorization, budgets, comparison, method risk, and protocol interfaces.
44-
- `mrma.transport`: semantic HTTP adapter and request-byte estimator.
55+
- `mrma.transport`: semantic HTTP adapter, opaque prepared capability, and request-byte estimator.
56+
The capability preserves the public type name but does not expose a public HTTPX request field.
4557
- `mrma.evidence`: append-only journal, v8 model, schema validation, bundles, and verification.
4658
- `mrma.workflows`: candidate manifests and guarded legacy exploratory dispatch.
4759
- `mrma.core`: comparison, statistical experiment, HTTP semantics, request model, and retained

docs/BUDGET_MODEL.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ For each network attempt MRMA:
1313

1414
1. authorizes the immutable request and any declared mutation delta;
1515
2. asks HTTPX to build the final request, including cookie-jar and generated fields;
16-
3. measures that prepared representation and checks effective method, target, and `Host` again;
16+
3. measures and seals that prepared representation after checking method, target, and `Host`;
1717
4. atomically reserves counters, bytes, timeout, and concurrency;
1818
5. revalidates authorization and records `BUDGET_RESERVED` plus `ATTEMPT_STARTED`;
19-
6. sends the exact prepared request object once;
19+
6. recomputes the prepared digest, verifies the adapter seal and authorization fields, then sends
20+
the exact request object once;
2021
7. commits bounded actual bytes and elapsed duration, or releases the lease;
2122
8. records `BUDGET_UPDATED`.
2223

docs/EVIDENCE_MODEL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ summary and digest, not the executable authorization manifest. Raw credentials,
4747
authorization tokens, environment values, mutation secrets, and local paths are forbidden by model
4848
and tests. Version 8 declares cross-run correlation as partial because authorization digests,
4949
original-source digests, and journal target, origin, address-set, and effective-authority
50-
identifiers are deterministic.
50+
identifiers are deterministic. Mutation-delta identifiers written to the journal are run-local
51+
HMAC fingerprints; the deterministic local delta digest remains inside the authorization and
52+
transport capability boundary.
5153

5254
## Bundle
5355

docs/RELEASE_SECURITY.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ Install a current GitHub CLI, authenticate it, download both distributions, and
2222
GitHub-signed build provenance before installation:
2323

2424
```bash
25-
gh release verify v0.4.3 -R 0xmrma/mrma
26-
gh release download v0.4.3 -R 0xmrma/mrma \
27-
--pattern 'mrma-0.4.3-py3-none-any.whl' \
28-
--pattern 'mrma-0.4.3.tar.gz'
29-
gh release verify-asset v0.4.3 ./mrma-0.4.3-py3-none-any.whl -R 0xmrma/mrma
30-
gh release verify-asset v0.4.3 ./mrma-0.4.3.tar.gz -R 0xmrma/mrma
31-
gh attestation verify ./mrma-0.4.3-py3-none-any.whl \
25+
gh release verify v0.4.4 -R 0xmrma/mrma
26+
gh release download v0.4.4 -R 0xmrma/mrma \
27+
--pattern 'mrma-0.4.4-py3-none-any.whl' \
28+
--pattern 'mrma-0.4.4.tar.gz'
29+
gh release verify-asset v0.4.4 ./mrma-0.4.4-py3-none-any.whl -R 0xmrma/mrma
30+
gh release verify-asset v0.4.4 ./mrma-0.4.4.tar.gz -R 0xmrma/mrma
31+
gh attestation verify ./mrma-0.4.4-py3-none-any.whl \
3232
-R 0xmrma/mrma \
3333
--signer-workflow 0xmrma/mrma/.github/workflows/release.yml \
34-
--source-ref refs/tags/v0.4.3
35-
gh attestation verify ./mrma-0.4.3.tar.gz \
34+
--source-ref refs/tags/v0.4.4
35+
gh attestation verify ./mrma-0.4.4.tar.gz \
3636
-R 0xmrma/mrma \
3737
--signer-workflow 0xmrma/mrma/.github/workflows/release.yml \
38-
--source-ref refs/tags/v0.4.3
38+
--source-ref refs/tags/v0.4.4
3939
```
4040

4141
Release v0.4.0 predates repository release-immutability enablement. Its protected signed tag and
@@ -47,18 +47,18 @@ release-level attestation when published.
4747
Verify the container's GitHub-signed provenance and require the publishing workflow and tag ref:
4848

4949
```bash
50-
gh attestation verify oci://ghcr.io/0xmrma/mrma:0.4.3 \
50+
gh attestation verify oci://ghcr.io/0xmrma/mrma:0.4.4 \
5151
-R 0xmrma/mrma \
5252
--signer-workflow 0xmrma/mrma/.github/workflows/package.yml \
53-
--source-ref refs/tags/v0.4.3
53+
--source-ref refs/tags/v0.4.4
5454
```
5555

5656
The image also carries BuildKit provenance and SBOM manifests. Resolve the immutable OCI index
5757
digest and pin deployments to `ghcr.io/0xmrma/mrma@sha256:...` rather than relying only on a
5858
mutable semantic-version tag:
5959

6060
```bash
61-
docker buildx imagetools inspect ghcr.io/0xmrma/mrma:0.4.3
61+
docker buildx imagetools inspect ghcr.io/0xmrma/mrma:0.4.4
6262
```
6363

6464
Verification establishes artifact identity and build origin. It does not replace source review,

docs/RESEARCH_POSITION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ MRMA should treat every finding as an experiment, not an anomaly row:
3838
7. Minimize the responsible input using the same repeated oracle.
3939
8. Export a versioned evidence object that another engineer can replay and audit.
4040

41-
Version 0.4.3 implements steps 1-6 for a single mutation in `mrma experiment`, including explicit
41+
Version 0.4.4 implements steps 1-6 for a single mutation in `mrma experiment`, including explicit
4242
state and connection modes, fixed-sample confidence decisions, canonical redirect and field-aware
4343
header semantics, ambiguity-preserving cache comparison, typed retry subtypes, multidimensional
4444
assurance, bounded observations, authorization, central budgets, recoverable evidence, and manual

docs/ROADMAP.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,16 @@ adding more mutation families.
112112
- [x] Add a deterministic local approval-plan digest without exposing it in shared evidence
113113
- [x] Disable new v7 generation while retaining verification of existing v7 documents
114114

115-
Version 0.4.3 is the maintained 0.4 baseline. The items below are optional research directions,
115+
## 0.4.4 - SDK boundary freeze
116+
117+
- [x] Seal prepared HTTPX request identity and capability metadata; bind capabilities to one session
118+
- [x] Recompute request, stream, extension, authority, and accounting identity before send
119+
- [x] Restrict header experiments to header-only deltas and reject unsupported families
120+
- [x] Make journal mutation-delta identifiers run-local
121+
- [x] Require benchmark and semantic-mutation checks on protected `main`
122+
- [x] Synchronize SDK, architecture, budget, evidence, and validation contracts
123+
124+
Version 0.4.4 is the maintained 0.4 baseline. The items below are optional research directions,
116125
not commitments or current product claims.
117126

118127
## Possible 0.5 - Product-wide evidence oracle

docs/VALIDATION.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Exact claim
44

5-
MRMA v0.4.3 is an authorization-enforcing, budgeted, recoverable HTTP trust-influence
5+
MRMA v0.4.4 is an authorization-enforcing, budgeted, recoverable HTTP trust-influence
66
tool. It uses semantic HTTP replay and fixed-sample differential experiments.
77

88
## Non-claims
@@ -56,7 +56,10 @@ may vary; conclusions must all pass. See [BENCHMARKS.md](BENCHMARKS.md).
5656
- No stable connected-address, peer-certificate, cipher, or ALPN evidence on the supported adapter.
5757
- `impact` and other legacy workflows are policy guarded but remain statistically exploratory.
5858
- The CLI is not fully decomposed; the stable engine/policy/evidence APIs are separate.
59-
- Request sent-byte accounting is conservative estimation, not wire telemetry.
59+
- Plan request bytes are a conservative preflight estimate. Every attempt reserves the measured
60+
final HTTPX request representation, including generated and cookie fields, after preparation and
61+
verifies the sealed representation again immediately before sending. Neither value is wire
62+
telemetry.
6063
- Hash chains provide integrity detection, not organizational identity.
6164
- No signed authorization grants, encrypted evidence store, distributed budgets, or multi-user
6265
governance.

0 commit comments

Comments
 (0)