Repository navigation
authz/v1: production-profile qualification, exact-capability issuance, provenance bound to measured code (#626) - #41
Conversation
…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.
|
…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.
What this branch is
The
authz/v1contract, 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:
ad1d951qualification.json.2df123a15f02e315e7a5epath:linecode rather than as links into a scratch directory (5 lines, no reflow).035cb181c8e936.github/workflows/tests.ymlgains one entry in itspull_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.ymltriggeredpull_requestforbranches: ["main"]only, and that filter is evaluatedagainst the base branch. #42 is stacked on this branch, so retargeting it here removed its pytest gate entirely:
its head carried
docsandgitleakscheck runs and nothing else. The filter lives on the base branch, so thecorrection 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 futurebranch picks up the trigger by accident. No test, config, implementation or other workflow file is touched.
428449061211c8e936(synchronize)The commit moves nothing in the suite:
1c8e936re-measures 1825 passed / 75 skipped locally and 1817 / 83 inCI, byte-for-byte the same posture as its own parent
035cb18. With it in place, #42's head ran pytest in CI asrun
42845291820— 1817 passed /91 skipped — checked out as the merge of
0be2950into1c8e936.1. Envelope issuance: exact capabilities, no families (review request)
The production fixture used to expand
Mission.policy_refsinto family wildcards (billing.read→billing.*). That rule is not the kernel's rule at this seam:authority.evaluatefnmatch-matchesGrant.capabilityagainstnode.capability, sobilling.*handed every missionbilling.deleteand any other name in the family, registered or not. It is gone.Issuance now names capabilities one at a time, from two sources only:
policy_refverbatim —Grant("billing.read")covers a capability literally calledbilling.readand nothing else, so a permission name buys no provider;CapabilitySpec.permissions, the operator's declaration that the policy plane enforces) the mission holds in full —billing.invoiceis issued because the deployment registered it underbilling.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.readcapabilities by name and stops atbilling.delete, a name no operator registered; a policy that saysbilling.*reachesbilling.deletetoo, and still stops atreports.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_survivepasses for both editions on exact grants, andsecret.exfiltrateis refused by the envelope (guard.check→deny / out_of_scope), not merely filtered by the harness.2. Contract verdict changes: none
authz_matrix.py --checkexit 0g-…)6e50d6d)Default-profile pinned qualification and production-profile measured qualification remain separate artifacts:
tests/authz_contract/qualification.json(pinned, default profile, what--checkenforces) vsdocs/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_ROOTexported, 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_REFERENCEnames each edition's adapter,BUILD_FAILURESkeeps 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.mdnow quotes the no-checkout commands withenv -uand re-measured numbers.4. Verification (macOS, Python 3.12,
/tmp/kernel-e2-venv)env AGENTIC_OS_ROOT=… AGENTIC_OS_ENTERPRISE_ROOT=… REDEVOPS_RAG_ROOT=… python -m pytest -qenv -u AGENTIC_OS_ROOT -u AGENTIC_OS_ENTERPRISE_ROOT -u REDEVOPS_RAG_ROOT python -m pytest -qpython scripts/authz_matrix.py --checkpython scripts/authz_production_matrix.py --json docs/evidence/authz_production_matrix.jsondurable_replay=SqliteReplayGuard,authority_store=SqliteEnvelopeStore, 8 envelopes issuedREDEVOPS_RAG_ROOT=… python -m pytest tests/authz_contract/test_retrieval_baseline.py -qtests/authz_contract/test_negative_controls.pywith checkoutsImplementations measured at the SHAs
qualification.jsonrecords: agentic-osc453cd16, agentic-os-enterprised88b9adf; redevops-rag6e50d6db(no cell credited to it).test_provenance.pyfails if a plane's importedHEADdiffers from the recorded SHA, so these numbers cannot be reprinted from a different checkout.Those two edition SHAs are not in their remotes.
c453cd16andd88b9adfreturn 404 fromGET /repos/<repo>/git/commits/<sha>; the branches they were pushed to were deleted. They remain the correct recordof 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.
035cb18therefore rewrites the citation the other way round: thedefects are cited at the published bases — agentic-os
130fcf9d, agentic-os-enterprise048b42ed, where thelines 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.mdhas a section, "Can these commits be reproduced?", with patch hashes and thereconstruction commands, and the packet carries
e2-kernel.patch/e2-enterprise.patch(verify by tree hash8ebdd04e…/ade83e64…, since replaying a patch yields a different commit SHA).5. What this PR deliberately does not do
cross_tenant_denied(kernel FAIL),authorization_before_limitandadapter_error_fails_closed(both editions FAIL),stale_epoch_refusal(both UNSUPPORTED). E-1/E-3/E-5 remediation belongs to the products.6e50d6d; retrieval implementation work is a separate branch and must not merge before the full authorization contract passes.Refs redevops-io/agentic-os#626 · refs redevops-io/agentic-os#627 (measured only)