Skip to content

Commit a1b9965

Browse files
authored
Harden authority and evidence boundaries for v0.4.1 (#16)
Authorization v2 binds URL, Host, SNI, CONNECT, query, and header-mutation scope. Redirect observations preserve state, cross-origin forwarding is deny by default, and plan/evidence identities are corrected for v0.4.1.
1 parent cac2e39 commit a1b9965

43 files changed

Lines changed: 3249 additions & 267 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
- run: python -m pip install --upgrade pip && python -m pip install -e ".[dev]"
9494
- name: Validate packaged release baseline
9595
run: python -m pytest tests/test_benchmark.py::test_packaged_release_benchmark_is_schema_valid_and_passed
96-
- name: Run loopback expert benchmark
96+
- name: Run loopback benchmark
9797
run: python -c "from mrma.cli import main; main()" benchmark --out-json benchmark-result.json
9898

9999
runtime-audit:
@@ -142,7 +142,7 @@ jobs:
142142
/tmp/mrma-wheel/bin/python -m pip check
143143
cd /tmp
144144
/tmp/mrma-wheel/bin/mrma --version
145-
/tmp/mrma-wheel/bin/python -c "from importlib.resources import files; root=files('mrma.schemas'); assert all(root.joinpath(f'experiment-v{v}.schema.json').is_file() for v in (2,3,4,5,6,7)); assert root.joinpath('authorization-v1.schema.json').is_file(); assert root.joinpath('benchmark-v1.schema.json').is_file(); assert files('mrma').joinpath('benchmarks', 'release-baseline.json').is_file(); assert 'site-packages' in str(root)"
145+
/tmp/mrma-wheel/bin/python -c "from importlib.resources import files; root=files('mrma.schemas'); assert all(root.joinpath(f'experiment-v{v}.schema.json').is_file() for v in (2,3,4,5,6,7,8)); assert all(root.joinpath(f'authorization-v{v}.schema.json').is_file() for v in (1,2)); assert all(root.joinpath(f'benchmark-v{v}.schema.json').is_file() for v in (1,2)); assert files('mrma').joinpath('benchmarks', 'release-baseline.json').is_file(); assert 'site-packages' in str(root)"
146146
cd /tmp
147147
/tmp/mrma-wheel/bin/python -c "import json; from importlib.resources import files; from mrma.evidence import validate_benchmark_document; validate_benchmark_document(json.loads(files('mrma').joinpath('benchmarks', 'release-baseline.json').read_text()))"
148148

CHANGELOG.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@
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.1 - 2026-07-20
7+
8+
### Policy Boundaries
9+
10+
- Added strict `mrma.authorization/v2` authority policy. URL authority, `Host`, TLS SNI, and proxy
11+
CONNECT routing are bound before each attempt; duplicate `Host` fields are rejected and deliberate
12+
virtual-host mutations require an exact allowlist.
13+
- Added per-rule query-key policy and exact header mutation name, operation, and value-size limits.
14+
- Replaced cross-origin credential-name filtering with deny-by-default header forwarding. Redirects
15+
that change to `GET` also remove content, digest, trailer, and message-signature metadata.
16+
17+
### Observation And Evidence Correctness
18+
19+
- Scoped cookie and fresh-connection state to a complete logical observation so redirect and retry
20+
hops retain required state without leaking it into the next isolated observation.
21+
- Added `mrma.plan/v2`, which binds effective requests, duplicate header order, bodies, experiment,
22+
comparison, retry, redirect, hook, transport, and authorization policy into one digest.
23+
- Added strict `mrma.experiment/v8` with the effective plan and an accurate partial-correlation
24+
declaration. Experiment schemas v2-v7 and authorization v1 are byte-locked.
25+
- Added neutral `mrma.benchmark/v2` and `trust-influence-loopback/2.0` identifiers.
26+
27+
### Verification
28+
29+
- Expanded the critical semantic mutation baseline from 12 to 18 invariants, including effective
30+
authority, query scope, cross-origin fields, observation state, and plan body identity.
31+
- Regenerated the 22-case local benchmark under the v2 contract: all expected conclusions passed
32+
across 942 authorized attempts.
33+
- Expanded the suite to 292 tests. The local branch-coverage gate reports 94.77% across critical
34+
runtime modules and 86.11% across the corrected core, with every critical module above 90%.
35+
636
## 0.4.0 - 2026-07-15
737

838
### Authorization-First Runtime
@@ -162,7 +192,7 @@ independent version in each machine-readable evidence schema.
162192
as immutable. V4 removes the scalar confidence grade and requires a multidimensional assurance
163193
profile.
164194
- Results now include structured limitations with stable code, severity, scope, message, and
165-
remediation fields for CI policy and external review.
195+
remediation fields for CI policy and independent validation.
166196
- Added authoritative `exploratory`, `research`, and `forensic` assurance presets. Research mode
167197
selects fresh connections, isolated response state, disabled retries, a 20-round bracketed
168198
design, standard privacy, and full body retention within the response bound.

README.md

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,39 @@ MRMA is an authorization-enforcing, budgeted, recoverable HTTP trust-influence r
44
It runs repeated control/mutation experiments to test whether one request property reproducibly
55
changes an observed HTTP outcome.
66

7-
> **Status: v0.4.0 research preview and expert-review candidate.** MRMA uses a semantic HTTPX
8-
> transport. It does not provide wire-exact replay, prove exploitability, identify a proprietary
9-
> component from black-box behavior, or claim enterprise readiness.
7+
> **Status: v0.4.1 research release.** MRMA uses a semantic HTTPX transport. It does not provide
8+
> wire-exact replay, prove exploitability, or identify a proprietary component from black-box
9+
> behavior.
1010
11-
## What v0.4.0 enforces
11+
## What v0.4.1 enforces
1212

13-
- Every network attempt requires an accepted `mrma.authorization/v1` decision, a central budget
13+
- Every network attempt requires an accepted authorization decision, a central budget
1414
lease, and journal context.
15-
- Redirects are followed manually and reauthorized at every hop. Retries and setup/reset hooks are
16-
separate charged attempts.
15+
- `mrma.authorization/v2` binds URL, `Host`, TLS SNI, and proxy CONNECT authority policy; it also
16+
constrains query keys and exact header mutation operations.
17+
- Redirects are followed manually, reauthorized, and charged at every hop. Cross-origin request
18+
fields use a deny-by-default forwarding policy, and redirect cookies live only for one logical
19+
observation under isolated state.
1720
- Research assurance uses isolated state, fresh observation clients, disabled retries, bounded
1821
bodies, and a predeclared fixed sample.
1922
- Partial or resource-limited work returns `INCONCLUSIVE` with structured limitations.
20-
- `mrma.experiment/v7` evidence records policy, budget, journal, comparison, semantic, transport,
21-
and runtime provenance without embedding the executable authorization grant.
23+
- `mrma.experiment/v8` evidence binds the effective plan and accurately distinguishes run-local
24+
fingerprints from deterministically linkable policy identifiers.
2225
- Deterministic evidence bundles include the result, append-only hash-chained journal, schema,
2326
release benchmark, runtime manifest, digests, and replay instructions.
2427

2528
## Install
2629

2730
```bash
28-
python -m pip install mrma==0.4.0
31+
python -m pip install mrma==0.4.1
2932
mrma --version
3033
```
3134

3235
Python 3.10 and 3.13 are tested on Linux, Windows, and macOS (six CI environments).
3336

3437
## Start locally
3538

36-
Run the loopback-only expert benchmark; it sends no traffic to public targets:
39+
Run the loopback validation corpus; it sends no traffic to public targets:
3740

3841
```bash
3942
mrma benchmark --out-json benchmark.json
@@ -58,7 +61,7 @@ mrma experiment \
5861
--dry-run
5962
```
6063

61-
Remove `--dry-run` to execute and create a review bundle:
64+
Remove `--dry-run` to execute and create an evidence bundle:
6265

6366
```bash
6467
mrma experiment \
@@ -92,16 +95,16 @@ initialized.
9295

9396
## Workflow status
9497

95-
| Workflow | v0.4 status |
98+
| Workflow | Current status |
9699
|---|---|
97-
| `experiment` | Confirmatory fixed-sample `ExperimentOracle`; strict v7 result |
100+
| `experiment` | Confirmatory fixed-sample `ExperimentOracle`; strict v8 result |
98101
| `impact` | Exploratory ranking through the policy kernel; emits a candidate manifest |
99102
| `run`, `diff`, `discover`, `isolate`, profiles, report | Authorization/budget/journal guarded, but statistically exploratory |
100103
| Candidate confirmation | Independent `experiment` run bound to one candidate-manifest digest |
101104

102105
## Documentation
103106

104-
- [Expert review](docs/EXPERT_REVIEW.md)
107+
- [Validation](docs/VALIDATION.md)
105108
- [Architecture](docs/ARCHITECTURE.md)
106109
- [Threat model](docs/THREAT_MODEL.md)
107110
- [Authorization](docs/AUTHORIZATION.md)
@@ -121,12 +124,6 @@ state-changing methods, path scope, redirect destinations, CIDRs, rates, byte li
121124
narrow as the research design permits. Report security defects through GitHub's private Security
122125
Advisory flow as described in [SECURITY.md](SECURITY.md).
123126

124-
## Positioning
125-
126-
MRMA v0.4.0 is an authorization-enforcing, budgeted, recoverable HTTP trust-influence research
127-
platform prepared for external expert evaluation. It remains a semantic-HTTP research tool; full
128-
product-wide oracle migration and protocol-exact HTTP backends are separate future milestones.
129-
130127
## Author
131128

132129
Mohamed Abdelaal / [0xMRMA](https://0xmrma.com)

RELEASE_CHECKLIST.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# MRMA v0.4.0 release checklist
1+
# MRMA v0.4.1 release checklist
22

33
## Correctness and security
44

55
- [ ] Every network command is covered by the architectural policy-boundary test.
66
- [ ] Authorization, budget, redirect, retry, hook, journal, privacy, and partial-result adversarial tests pass.
7-
- [ ] `mrma.experiment/v7`, authorization v1, benchmark v1, and all negative fixtures validate.
8-
- [ ] Experiment schemas v2-v6 match committed immutable SHA-256 fixtures.
7+
- [ ] `mrma.experiment/v8`, authorization v2, benchmark v2, and all negative fixtures validate.
8+
- [ ] Experiment schemas v2-v7 and authorization v1 match immutable SHA-256 fixtures.
99
- [ ] The 22-case loopback benchmark passes with zero false positives/negatives.
10-
- [ ] Critical semantic mutation gate kills all 12 committed mutants.
10+
- [ ] Critical semantic mutation gate kills all 18 committed mutants.
1111
- [ ] No unresolved P0/P1 correctness, authorization, evidence, or secret-exposure issue remains.
1212

1313
## Quality gates
@@ -24,18 +24,18 @@
2424

2525
## Distribution and container
2626

27-
- [ ] Version is `0.4.0` in package metadata, import, CLI, wheel, and container.
27+
- [ ] Version is `0.4.1` in package metadata, import, CLI, wheel, and container.
2828
- [ ] Wheel and sdist build from a clean tree and pass `twine check`.
2929
- [ ] Clean wheel install passes `pip check` outside the source tree.
30-
- [ ] Clean wheel contains experiment v2-v7, authorization v1, benchmark v1, and release baseline.
30+
- [ ] Clean wheel contains experiment v2-v8, authorization v1-v2, benchmark v1-v2, and release baseline.
3131
- [ ] Non-root container builds from digest-pinned base and hash-locked dependencies.
3232
- [ ] Container smoke, local authorized experiment, bundle creation, and offline verification pass.
3333
- [ ] Multi-architecture OCI publication includes provenance and SBOM; final digest is recorded.
3434

3535
## Documentation and governance
3636

37-
- [ ] README, SECURITY, ROADMAP, CHANGELOG, expert guide, and all model docs agree.
38-
- [ ] Product claim remains a research platform/expert-review candidate, not enterprise-ready.
37+
- [ ] README, SECURITY, ROADMAP, CHANGELOG, validation guide, and all model docs agree.
38+
- [ ] Product claims remain limited to implemented and verified behavior.
3939
- [ ] Semantic HTTP, unsigned authorization, DNS/socket binding, exploratory legacy, and hash-chain trust limitations are explicit.
4040
- [ ] Protected PR checks and review complete without weakening rules.
4141
- [ ] Release commit is clean; annotated tag is SSH-signed and accepted by release signer policy.
@@ -45,4 +45,4 @@
4545
## Final report
4646

4747
- [ ] Record release commit/tag, test/coverage/mutation results, dependency checks, wheel/sdist hashes,
48-
OCI digest, evidence verification, migration status, deferred work, and exact conservative positioning.
48+
OCI digest, evidence verification, migration status, deferred work, and exact release claims.

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Supported versions
44

5-
MRMA is a research preview. Only the latest patch release receives security fixes.
5+
MRMA is a research tool. Only the latest patch release receives security fixes.
66

77
## Reporting a vulnerability
88

docs/API.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ consuming repetition or budget.
7676

7777
## Evidence APIs
7878

79-
- `build_experiment_v7`: convert an `OracleRunResult` plus provenance into strict evidence.
79+
- `build_experiment_v8`: convert an `OracleRunResult` plus provenance into strict evidence.
8080
- `validate_result_document`: JSON Schema and semantic cross-field verification.
8181
- `create_evidence_bundle`: deterministic atomic bundle creation from public evidence and journal.
8282
- `verify_evidence`, `verify_evidence_bundle`, `verify_journal`: offline integrity verification.
8383
- `validate_benchmark_document`: benchmark schema verification.
8484

8585
## Compatibility
8686

87-
The v0.4 SDK surface is typed and strict-mypy clean, but MRMA is still a research preview. Schema
87+
The v0.4 SDK surface is typed and strict-mypy clean, but MRMA remains a research tool. Schema
8888
versions are stronger compatibility contracts than Python object internals. No API accepts an
8989
authorization bypass, and transport does not accept a bare URL/request.

docs/ARCHITECTURE.md

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

33
## Product boundary
44

5-
MRMA v0.4.0 has one confirmatory engine and one shared network policy kernel. The CLI parses input,
5+
MRMA v0.4.1 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
@@ -21,7 +21,7 @@ ExperimentOracle
2121
SemanticHttpAdapter (HTTPX, follow_redirects=False)
2222
|
2323
v
24-
CapturedResponse -> experiment analysis -> v7 evidence -> bundle
24+
CapturedResponse -> experiment analysis -> v8 evidence -> bundle
2525
```
2626

2727
## Enforced boundaries
@@ -32,15 +32,16 @@ adapter revalidates context identity, records `ATTEMPT_STARTED`, performs one se
3232
attempt, commits actual bounded cost, and records completion. It cannot be called with only a URL.
3333

3434
`ExperimentOracle` owns retries, redirect traversal, setup/reset hooks, schedules, observations,
35-
and partial-run conversion. HTTPX redirect following is always disabled. Every hop becomes a new
35+
and partial-run conversion. One observation session owns redirect/retry cookie state and its
36+
fresh-observation client. HTTPX redirect following is always disabled. Every hop becomes a new
3637
authorization decision and budget lease.
3738

3839
## Packages
3940

4041
- `mrma.engine`: typed plan and confirmatory oracle.
4142
- `mrma.policy`: authorization, budgets, comparison, method risk, and protocol interfaces.
4243
- `mrma.transport`: semantic HTTP adapter and request-byte estimator.
43-
- `mrma.evidence`: append-only journal, v7 model, schema validation, bundles, and verification.
44+
- `mrma.evidence`: append-only journal, v8 model, schema validation, bundles, and verification.
4445
- `mrma.workflows`: candidate manifests and guarded legacy exploratory dispatch.
4546
- `mrma.core`: comparison, statistical experiment, HTTP semantics, request model, and retained
4647
legacy algorithms.
@@ -64,7 +65,7 @@ policy guarded but do not yet use the fixed-sample verdict oracle.
6465
- Supported HTTPX APIs do not reliably expose the connected address, peer certificate, TLS cipher,
6566
or ALPN for every transport. Evidence records `null` plus limitations instead of inspecting
6667
unstable internals.
67-
- Authorization manifests are unsigned v1 policy documents. Organizational signing and trust
68+
- Authorization manifests are unsigned policy documents. Organizational signing and trust
6869
roots are deferred.
6970
- The CLI remains a large module. Further decomposition is deferred while the network boundary is
7071
enforced and tested.

docs/AUTHORIZATION.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
## Manifest contract
44

5-
Research networking requires a strict `mrma.authorization/v1` JSON manifest. Unknown fields,
5+
Research networking requires a strict authorization JSON manifest. New manifests should use
6+
`mrma.authorization/v2`; v1 remains readable for compatibility. Unknown fields,
67
duplicate keys, non-finite numbers, malformed tokens, wildcards, invalid time windows, and an
78
incorrect optional digest are rejected.
89

910
The manifest contains engagement, issuer, subject, issue/expiry times, exact schemes/hosts/ports,
1011
segment-bounded path prefixes, case-sensitive method tokens, operation kinds, CIDRs, body limits,
1112
method repetition policy, proxy/redirect policy, mutation families/risk classes, and the central
12-
budget. It must not contain secrets.
13+
budget. Version 2 additionally defines query-key rules, effective authority rules, exact header
14+
mutation operations, and cross-origin header forwarding. A manifest must not contain secrets.
1315

1416
HTTP methods are case-sensitive under [RFC 9110 section 9.1](https://www.rfc-editor.org/rfc/rfc9110#section-9.1).
1517
`GET` and `get` are different tokens. Lowercase standard-looking methods are unknown extensions and
@@ -19,18 +21,21 @@ require explicit authorization and repetition limits.
1921

2022
1. Validate the authorization validity window.
2123
2. Canonicalize the semantic target and reject URL userinfo.
22-
3. Match exact scheme, IDNA host, effective port, path segment, method, operation kind, and body
23-
bound.
24-
4. Resolve all A/AAAA answers and require every address to fall inside an allowed CIDR.
25-
5. Validate explicit proxy name, port, and every proxy address when proxy use is enabled.
26-
6. Enforce the higher of method risk and declared mutation risk.
27-
7. Enforce idempotency-key and per-method repetition policy.
28-
8. Return an `AuthorizedRequestContext` containing only private canonical target data and public
24+
3. Resolve the effective URL, `Host`, TLS SNI, and proxy CONNECT authorities. Reject duplicate
25+
`Host` fields and require every mismatch to be explicitly authorized.
26+
4. Match exact scheme, IDNA host, effective port, path segment, query policy, method, operation
27+
kind, and body bound.
28+
5. Resolve all A/AAAA answers and require every address to fall inside an allowed CIDR.
29+
6. Validate explicit proxy name, port, and every proxy address when proxy use is enabled.
30+
7. Enforce the higher of method risk and declared mutation risk.
31+
8. Enforce idempotency-key, per-method repetition, and header mutation policy.
32+
9. Return an `AuthorizedRequestContext` containing only private canonical target data and public
2933
fingerprints.
30-
9. Revalidate expiry, target DNS, and proxy DNS immediately before transport.
34+
10. Revalidate expiry, target DNS, and proxy DNS immediately before transport.
3135

32-
Redirect destinations repeat the sequence. Same-origin and cross-origin behavior is selected by the
33-
manifest; credentials are stripped cross-origin unless explicit policy permits forwarding.
36+
Redirect destinations repeat the sequence. Cross-origin hops retain only `Accept`,
37+
`Accept-Language`, and `User-Agent` by default. Additional fields require an explicit v2 allowlist.
38+
When redirect semantics change a method to `GET`, body and content/signature metadata are removed.
3439

3540
## Hooks and state-changing methods
3641

@@ -49,4 +54,4 @@ CA digests, not values or paths.
4954

5055
Keep manifests short-lived and generated under an external approval process. Restrict paths,
5156
methods, operation kinds, CIDRs, and budgets to the exact design. The local example authorizes only
52-
loopback port 8000. Authorization v1 is not signed and does not establish legal authority.
57+
loopback port 8000. Authorization manifests are not signed and do not establish legal authority.

0 commit comments

Comments
 (0)