Skip to content

authz/v1: production-profile qualification, exact-capability issuance, provenance bound to measured code (#626) - #41

Merged
arybach merged 6 commits into
mainfrom
test/authz-v1-exact-capability-issuance
Nov 10, 2026
Merged

arybach merged 6 commits into
mainfrom
test/authz-v1-exact-capability-issuance

Conversation

@arybach

@arybach arybach commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Merged into main as 6721062ce3a2 at 15:39:26Z on 2026-11-10 — merge commit, parents d739c19 + 1c8e936, tree 9538e2c6…, method chosen deliberately so the six cited commit SHAs stay reachable. Gate evidence on head 1c8e936: pytest / docs / gitleaks all pass (run 42844906121, pytest 1817 passed / 83 skipped); main push run 42846631752 also green. Merge was pinned to the verified head SHA. The source branch is retained at 1c8e936, so every reproduction command still resolves.

What this branch is

The authz/v1 contract, qualified under production profiles, with the checkout provenance bound to the code that was actually measured — for redevops-io/agentic-os#626 (shared authorization-contract suite gating both editions, E-8).

Six commits:

Commit What it does
ad1d951 The contract: 7 invariants × 2 editions, the qualification matrix, negative controls (mutant + reference variants), pinned expectations in qualification.json.
2df123a Production-profile qualification + provenance binding.
15f02e3 Review follow-up: envelope grants become exact capabilities, and a machine with no checkout reports BLOCKED instead of FAIL.
15e7a5e Docs only: the kernel evidence is cited as inline path:line code rather than as links into a scratch directory (5 lines, no reflow).
035cb18 Docs only: that evidence is re-cited at published commits, and the document says in plain terms which of its own SHAs cannot be fetched and how to reconstruct them.
1c8e936 CI only: .github/workflows/tests.yml gains one entry in its pull_request: branches: filter, so PRs based on this branch get a pytest gate again (+9 / −1, one file).

Why a CI commit belongs here

.github/workflows/tests.yml triggered pull_request for branches: ["main"] only, and that filter is evaluated
against the base branch. #42 is stacked on this branch, so retargeting it here removed its pytest gate entirely:
its head carried docs and gitleaks check runs and nothing else. The filter lives on the base branch, so the
correction can only land here — a PR cannot restore a gate for PRs based on it by editing its own copy.

The fix names the one branch that needs it rather than using a test/** wildcard, so no other current or future
branch picks up the trigger by accident. No test, config, implementation or other workflow file is touched.

Run Head Result
42844906121 1c8e936 (synchronize) pytest pass — 1817 passed / 83 skipped; docs pass; gitleaks pass

The commit moves nothing in the suite: 1c8e936 re-measures 1825 passed / 75 skipped locally and 1817 / 83 in
CI, byte-for-byte the same posture as its own parent 035cb18. With it in place, #42's head ran pytest in CI as
run 42845291820 — 1817 passed /
91 skipped — checked out as the merge of 0be2950 into 1c8e936.

1. Envelope issuance: exact capabilities, no families (review request)

The production fixture used to expand Mission.policy_refs into family wildcards (billing.read → billing.*). That rule is not the kernel's rule at this seam: authority.evaluate fnmatch-matches Grant.capability against node.capability, so billing.* handed every mission billing.delete and any other name in the family, registered or not. It is gone.

Issuance now names capabilities one at a time, from two sources only:

  • every policy_ref verbatim — Grant("billing.read") covers a capability literally called billing.read and nothing else, so a permission name buys no provider;
  • each capability the runtime's own registry declares whose demanded permissions (CapabilitySpec.permissions, the operator's declaration that the policy plane enforces) the mission holds in full — billing.invoice is issued because the deployment registered it under billing.read, which the mission declares.

A family pattern reaches an envelope only where a policy_ref spells one out, and that case is now tested on its own terms. The measured gap between the two: exact issuance reaches both registered billing.read capabilities by name and stops at billing.delete, a name no operator registered; a policy that says billing.* reaches billing.delete too, and still stops at reports.monthly. Unknown refs, unheld permissions and foreign families earn nothing, and a mission that declares no authority is issued an envelope that authorizes nothing.

The authorized-edge scenario did not need a wider grant. permitted_edges_survive passes for both editions on exact grants, and secret.exfiltrate is refused by the envelope (guard.check → deny / out_of_scope), not merely filtered by the harness.

2. Contract verdict changes: none

Matrix Before this commit After
Default profile (pinned, 14 cells) 7 PASS / 5 FAIL / 2 UNSUPPORTED / 0 BLOCKED identical, authz_matrix.py --check exit 0
Production profile + durable stores + issued envelopes (14 cells) 7 PASS / 5 FAIL / 2 UNSUPPORTED / 0 BLOCKED, 0 deviations from the default posture, 8 envelopes issued identical verdicts and cell details; the regenerated artifact differs only in per-run random grant ids (g-…)
Retrieval (#627, redevops-rag 6e50d6d) 21 collected: 14 PASS / 7 XFAIL (strict) unchanged

Default-profile pinned qualification and production-profile measured qualification remain separate artifacts: tests/authz_contract/qualification.json (pinned, default profile, what --check enforces) vs docs/evidence/authz_production_matrix.json (measured, production profile, never compared against or written into the pinned file).

3. A correction to the previous record

The reviewed commit stated "1875 passed / 24 skipped with no checkouts configured". That run was taken in a shell that still had AGENTIC_OS_ROOT / AGENTIC_OS_ENTERPRISE_ROOT exported, so it had checkouts: the row described a posture that had never been measured. Unsetting them properly exposed a real defect — 11 failures in the negative controls, because "no known-bad variant survived to be compared" and "this edition is not checked out here" were the same empty list. Fixed: ADAPTER_REFERENCE names each edition's adapter, BUILD_FAILURES keeps its build error, and those controls skip BLOCKED naming the edition. The anti-vacuity assertion is untouched and still fails when the editions are present and a mutant is missing. docs/AUTHZ_QUALIFICATION.md now quotes the no-checkout commands with env -u and re-measured numbers.

4. Verification (macOS, Python 3.12, /tmp/kernel-e2-venv)

Command Result
env AGENTIC_OS_ROOT=… AGENTIC_OS_ENTERPRISE_ROOT=… REDEVOPS_RAG_ROOT=… python -m pytest -q 1890 passed / 3 skipped / 7 xfailed
env -u AGENTIC_OS_ROOT -u AGENTIC_OS_ENTERPRISE_ROOT -u REDEVOPS_RAG_ROOT python -m pytest -q 1825 passed / 75 skipped / 0 failed (was 11 failed)
python scripts/authz_matrix.py --check exit 0, no verdict drift
python scripts/authz_production_matrix.py --json docs/evidence/authz_production_matrix.json 7 PASS / 5 FAIL / 2 UNSUPPORTED / 0 BLOCKED, 0 deviations, durable_replay=SqliteReplayGuard, authority_store=SqliteEnvelopeStore, 8 envelopes issued
REDEVOPS_RAG_ROOT=… python -m pytest tests/authz_contract/test_retrieval_baseline.py -q 14 passed / 7 strict xfailed
tests/authz_contract/test_negative_controls.py with checkouts 18 passed / 3 skipped (pre-existing "no documented gap" skips)

Implementations measured at the SHAs qualification.json records: agentic-os c453cd16, agentic-os-enterprise d88b9adf; redevops-rag 6e50d6db (no cell credited to it). test_provenance.py fails if a plane's imported HEAD differs from the recorded SHA, so these numbers cannot be reprinted from a different checkout.

Those two edition SHAs are not in their remotes. c453cd16 and d88b9adf return 404 from
GET /repos/<repo>/git/commits/<sha>; the branches they were pushed to were deleted. They remain the correct record
of what was measured, but they are no longer fetchable, and the test that binds a cell to a SHA cannot be satisfied
by anyone who does not still have those trees. 035cb18 therefore rewrites the citation the other way round: the
defects are cited at the published bases — agentic-os 130fcf9d, agentic-os-enterprise 048b42ed, where the
lines in question are present today (1192/1195 rather than the 1251/1254 an earlier draft quoted) — so a reviewer can
see the defect without any private state. The fix efficacy stays measured-but-not-independently-reproducible;
docs/AUTHZ_QUALIFICATION.md has a section, "Can these commits be reproduced?", with patch hashes and the
reconstruction commands, and the packet carries e2-kernel.patch / e2-enterprise.patch (verify by tree hash
8ebdd04e… / ade83e64…, since replaying a patch yields a different commit SHA).

5. What this PR deliberately does not do

  • Does not merge, and does not close Shared authorization-contract suite (tests/authz_contract/) gating both editions (E-8) agentic-os#626 — review decides. The matrix verdicts are the findings: cross_tenant_denied (kernel FAIL), authorization_before_limit and adapter_error_fails_closed (both editions FAIL), stale_epoch_refusal (both UNSUPPORTED). E-1/E-3/E-5 remediation belongs to the products.
  • Does not enable multi-tenant indexing. The #627 retrieval lane stays 7 strict xfailed against redevops-rag 6e50d6d; retrieval implementation work is a separate branch and must not merge before the full authorization contract passes.
  • Does not touch the #45 test-agent gate. The five posture tests and the LLM-driven test-agent deployment gate live on the agentic-tests track and are reported there, not folded into this qualification.

Refs redevops-io/agentic-os#626 · refs redevops-io/agentic-os#627 (measured only)

Alex Mats added 3 commits November 9, 2026 17:22
…e production-profile fixtures

runtime_contracts/authz: the decision envelope, the seven invariants, the suite runner that reports BLOCKED separately from a verdict, and the qualification matrix with its pinned expectations.

Adapters for the agentic-os kernel, the agentic-os-enterprise overlay and redevops-rag retrieval, each with the deliberately-broken mutants and the reference_* witnesses, so every unmet criterion carries a satisfiability proof and every passing one carries a guard that can see it broken.

tests/authz_contract: qualification.json pins the #627 baseline (kernel cross_tenant_denied and authorization_before_limit FAIL, enterprise authorization_before_limit FAIL, adapter_error_fails_closed FAIL both, stale_epoch_refusal UNSUPPORTED both); test_provenance.py records the checkout each verdict was measured against; test_durable_profile.py with durable_stores.py pins the production profile, where AGENTIC_OS_REPLAY_DB and AGENTIC_OS_AUTHORITY_DB are configuration the product refuses without — a configuration refusal is never reported as a pass and never in the language of authorization.

docs/AUTHZ_QUALIFICATION.md and the generated matrix in docs/evidence. Verified: 1868 passed, 24 skipped; scripts/authz_matrix.py --check exits 0; the durable-profile tests pass in both the default and the production profile.
…e to measured code

Follow-up to ad1d951 from the #626 review. Nothing here moves a pinned verdict: the
default-profile matrix in qualification.json is unchanged and authz_matrix.py --check
still exits 0.

- adapters/_implementations.py: import_module applies the configured checkout
  (AGENTIC_OS_ROOT / AGENTIC_OS_ENTERPRISE_ROOT / REDEVOPS_RAG_ROOT) before importing.
  Those variables were documentation only, so an installed copy answered and the
  retrieval lane skipped with a message naming a variable nothing read. Adds
  imported_root(), which resolves the checkout a plane actually came from.
- tests/authz_contract/test_provenance.py: a recorded checkout_commit is checked against
  the imported code's git HEAD, and base_commit against its ancestry, so a machine
  measuring a different checkout fails instead of reprinting SHAs it never ran.
- tests/authz_contract/durable_stores.py: the production fixture performs the composition
  root's other job — issuing each mission its AuthorityEnvelope through the product's own
  EnvelopeStore.put, derived only from that mission's policy_refs, with a documented
  tenant default for the contract's tenant-neutral principals.
- tests/authz_contract/test_production_authority.py (new): with issued authority the
  permitted edges dispatch and end succeeded; secret.exfiltrate never dispatches and is
  refused by the envelope itself (guard check deny/out_of_scope); revoking the envelope
  stops the permitted edge again (deny/revoked, durable across store instances); a mission
  with no issued envelope is still refused no_authority. This replaces the two
  permitted_edges_survive deviations with a measurement instead of reclassifying them.
- scripts/authz_production_matrix.py (new): measures all 14 cells under
  AGENTIC_OS_PROFILE=production with durable stores and issued envelopes and prints the
  comparison with the default profile without writing into it. Result: 7 PASS / 5 FAIL /
  2 UNSUPPORTED / 0 BLOCKED, no deviations.
- docs: qualification record for 2026-11-09 — the three matrices (default profile,
  production with durable stores, #627 retrieval against redevops-rag 6e50d6d), the exact
  commands, the environment, the SHAs and the remaining gaps. #45 stays on its own track.

Suites: 1875 passed / 24 skipped with no checkouts configured; 1889 passed / 3 skipped /
7 xfailed with both planes and redevops-rag configured; retrieval lane 21 collected ->
14 passed / 7 strict xfailed / 0 failed.
…ssing checkout BLOCKED

Review follow-up to 2df123a for redevops-io/agentic-os#626. No pinned verdict moves:
scripts/authz_matrix.py --check still exits 0, and the production artifact is unchanged apart from the
per-run random grant ids.

- tests/authz_contract/durable_stores.py: the fixture's implicit policy_refs -> family-wildcard expansion
  (billing.read -> billing.*) is gone. Grants are exact capability names: every policy_ref verbatim (a
  permission name fnmatch-matches only a capability of that name, so it buys no provider), plus each
  capability the runtime's own registry declares whose demanded permissions (CapabilitySpec.permissions,
  the operator's own declaration) the mission holds in full. A family pattern reaches an envelope only
  where a policy_ref states one. Adds capability_grants() and registry_fixture();
  issue_mission_envelope() takes the runtime's registry and nothing else. The expansion was never the
  kernel's rule at this seam: authority.evaluate matches Grant.capability against node.capability, so
  billing.* handed every mission billing.delete as well.
- tests/authz_contract/test_production_authority.py: issuance is asserted exact -- the registry's two
  billing.read capabilities are named one by one, while an unregistered name, a capability demanding an
  unheld permission and a foreign family are all refused out_of_scope. Wildcard issuance is tested on its
  own terms, only where policy spells the pattern out, and the measured gap is billing.delete: the name
  exact issuance cannot reach and a delegated family can. permitted_edges_survive still passes for both
  editions on exact grants, so no authorized edge needed a wider grant to survive.
- scripts/authz_production_matrix.py: issuance gets the runtime's registry, so the script and pytest
  measure one posture.
- tests/authz_contract/{implementations,test_negative_controls}.py: a machine with no checkout reported
  11 FAILURES, because "no known-bad variant survived to be compared" and "this edition is not checked
  out here" were the same empty list. ADAPTER_REFERENCE now names each edition's adapter and
  BUILD_FAILURES keeps the reason, so the two controls skip BLOCKED naming the edition and its build
  error, while the anti-vacuity assertion still fails when the editions are present and a mutant is
  missing. File with checkouts: 18 passed / 3 skipped (the pre-existing "no documented gap" skips).
- docs/AUTHZ_QUALIFICATION.md: the issuance rule as measured, the exact-capability/wildcard split, and a
  corrected measurement table. The previous "89 passed / 24 skipped, no checkouts configured" row was
  taken in a shell that still had AGENTIC_OS_ROOT and AGENTIC_OS_ENTERPRISE_ROOT exported, so it
  described a posture that had never been run; the rows are quoted with env -u and re-measured.

Suites: 1890 passed / 3 skipped / 7 xfailed with both planes and redevops-rag configured; 1825 passed /
75 skipped / 0 failed with no checkouts configured (was 11 failed); default-profile matrix --check exit
0; production-profile matrix 7 PASS / 5 FAIL / 2 UNSUPPORTED / 0 BLOCKED, 0 deviations from the default
posture, 8 envelopes issued; #627 retrieval lane 21 collected -> 14 passed / 7 strict xfailed / 0 failed.

Refs redevops-io/agentic-os#626 (contract), redevops-io/agentic-os#627 (retrieval, measured only).
…h directory

Five citations in the #626 failure analysis were Markdown links whose target was a local scratch
checkout (`../../tmp/kernel-e2/...`, `../../tmp/ent/...`). Nothing outside this repository can resolve
them, so `docs-check` failed on all five and the document was unrenderable as a reference.

The provenance was always in the display text — `path:line`, plus the commit recorded in the provenance
table above — so each citation becomes inline code and nothing else changes: five lines, no reflow, no
prose edit, no line-count change. This matches how the rest of this document cites out-of-tree code
(E-5's `agentic_os/mission/registry.py:183`, and the profile call sites below it).

A permalink was not available for these five: no kernel source is tracked in this repository, the kernel
commit named in the provenance table returns 422 from redevops-io/agentic-os, and
agentic-os-enterprise is private. Pointing at an unverifiable URL would have traded a visible broken
link for an invisible wrong one, so the paths are stated as text instead.

`python scripts/docs_check.py` now reports 0 problems.
@arybach

arybach commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

docs-check repaired — five dead citations, documentation only

15e7a5e fixes the only red check on this PR. All five failures came from ad1d951 here: citations written as
Markdown links into a scratch directory (../../tmp/kernel-e2/..., ../../tmp/ent/...) that nothing outside the
author's machine can resolve.

Each citation already carried its provenance in the display text — agentic_os/permissions.py:1251 and so on — so
each is now inline path:line code. Five lines, 5 insertions and 5 deletions, no reflow, no prose edit, no line
count change
(the file stays at 425 lines), matching how this document already cites out-of-tree code in the
remediation list and the profile section. scripts/docs_check.py reports 0 problems.

A permalink would have been better provenance, and it is not available:

  • no kernel source is tracked in this repository, so there is no in-repo target;
  • redevops-io/agentic-os is public, but the kernel commit recorded in this document's own provenance table,
    c453cd16dcb196cc15a0249a6e3da98fa7e3e98e, returns 422 No commit found from the commits API;
  • agentic-os-enterprise is private, so its recorded commit is not checkable without access.

Pointing at a URL that cannot be resolved against a known commit would replace a visibly broken link with a
plausible wrong one, so the paths are stated as text.

Flagging the second bullet as an independent finding, not part of this repair: if that kernel commit is not
fetchable by others, then every qualification row attributed to it — including the FAIL cells for
cross_tenant_denied and adapter_error_fails_closed — cannot be re-verified by anyone who was not in the
original environment. Worth either publishing the measured commit or relabelling those rows as "measured in a
non-public tree". That is a decision for a reviewer, not something to fold into a link repair, so it is recorded
here and left alone in the diff.

CI on 15e7a5e: docs pass, pytest pass (1,817 / 83), gitleaks pass.

arybach and others added 2 commits November 10, 2026 09:26
…ot be reproduced

The repair at 15e7a5e removed links into a scratch directory and left the citations as inline path:line. Honest, but it left the evidence unverifiable, and checking it properly turned up more than a link problem.

Both candidate commits (agentic-os c453cd16, enterprise d88b9adf, both on fix/e2-explicit-privileged-grants) are absent from their remotes: the branch is deleted and /git/commits/<sha> is 404 for each. They were measured in local trees. Their base commits are published and still current (agentic-os 130fcf9d, enterprise 048b42ed), so each candidate is base plus a recorded patch: kernel sha256 7412308c31349b77 (8 files, +216/-22, tree 8ebdd04e), enterprise sha256 0e5b05bcb2afd48f (5 files, +439/-34, tree ade83e64). Both patches reverse-apply onto the published base cleanly.

Every citation was re-checked against the published base. execution_context.py:127 and mission/registry.py:183/185 are byte-identical there (8898c24a53f1 / 02f013a158d4), as is enterprise mission/runtime.py:93 (d5a0e375bf23). permissions.py is the one file the overlay rewrote: the same two defects sit at 1192 and 1195 on the base rather than 1251/1254, so the document cites the base lines and links permalinks to the base commit.

Retrieval lane, same shape: baseline 6e50d6db resolves as an object in redevops-rag; the lane commits 0245d8fe and c1092403 do not, branch and pull request deleted.

Citations now resolve for anyone with repository access, the tested table says which commits are unpublished, and a new section marks what is measured-but-not-independently-reproducible instead of letting it read as ordinary provenance. docs_check: 0 problems.
GitHub matches the pull_request `branches` filter against the pull request's BASE branch, not its
head branch. PR #42 is stacked on test/authz-v1-exact-capability-issuance, so with "main" as the only
listed base it lost its pytest run when it was retargeted off main: head 0be2950 carries docs-check
and secret-scan check runs and nothing else, where the pre-retarget head 018e1a6 ran pytest and
passed (1,817 passed / 91 skipped).

List that branch by name. No wildcard, and the push trigger stays main-only, so the gated base set is
exactly the two branches with a pull request in flight. Runner, Python version, GITHUB_TOKEN
permissions and the `python -m pytest -q` command are untouched -- this changes when the suite runs,
never what it runs.
@arybach
arybach merged commit 6721062 into main Nov 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shared authorization-contract suite (tests/authz_contract/) gating both editions (E-8)

1 participant