2026-08-22 15:36:37 +02:00
|
|
|
"""Explicit lane-to-workload join tests (WARDEN-WP-0032 / RMGR-WP-0010-T06)."""
|
|
|
|
|
from pathlib import Path
|
2026-10-17 21:30:12 +02:00
|
|
|
import hashlib
|
|
|
|
|
import json
|
2026-08-22 15:36:37 +02:00
|
|
|
|
|
|
|
|
import yaml
|
|
|
|
|
|
|
|
|
|
from scripts.report_workload_join import build
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_repo_catalog_uses_only_explicit_workload_references():
|
2026-10-17 21:30:12 +02:00
|
|
|
report = build(ROOT / "registry/routing/catalog.yaml",
|
|
|
|
|
ROOT / "tests/fixtures/workload-coverage")
|
2026-08-22 15:36:37 +02:00
|
|
|
assert report["ok"] is True
|
2026-10-03 12:55:08 +02:00
|
|
|
assert len(report["resolved"]) == 4
|
2026-10-09 19:59:49 +02:00
|
|
|
assert len(report["unknown"]) == 22
|
Revert the npm field, re-measure coverage, and hold the layer divergence
Five inbox items worked, none of which changed a credential value or moved a
secret.
whynot-design-npm-publish: field reverted npm_token -> NPM_AUTH_TOKEN and the
path confirmed, on railiance-platform's attended, read-only, no-value field
enumeration (their docs/evidence/2026-09-10-npm-lane-field-resolution.json).
Exactly one field is present at the governed path. The 2026-09-09 change was
adopted from a coordination message and would have failed at the WP-0037-T03
rotation. The ungoverned second location is recorded as an explicit non-lane,
not deleted and not tidied away.
pep-stance coverage: published figures were stale by eight lanes (unknown
18->20, not_applicable 12->15) while resolved stayed at 3 — the denominator
moved, the classification did not. Caught by the test that asserts the published
block equals what report_coverage.py measures. tests/test_workload_join.py held
the same stale counts; both now measure the same populations.
rapp-qonto-keycape-client: blocker character updated — authority exists and is
unexercised by owner decision ("not yet", offer open), which is not the same as
no authority existing. Reopen triggers are events, never elapsed time.
flex-auth -> access-engine rename (WARDEN-IN-0003): access-engine added to the
policy-check lane's keywords so routing resolves under both names from today.
owner_repo deliberately not flipped — policy.py sends it as resource.system on
every /v1/check, and FLEX-DEC-2026-013 keeps runtime names as flex-auth.
layer declaration: INTENT.md says Staff, layer.yaml says staff, section 11 does
not say which governs. Neither changed; gate-house holds the ruling. Position in
docs/layer-declaration-precedence.md, wait in WARDEN-WP-0034-T06, and a comment
in layer.yaml telling the next session not to "fix" it — the divergence is the
evidence the ruling is made against.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 63291@bnt-lap001
Assistant-Session: 8bd77868-ca68-4f49-bb1e-d539ecc0d703
2026-09-21 02:16:33 +02:00
|
|
|
# 15 since 2026-09-21: the layer-declaration route is repository conformance
|
|
|
|
|
# guidance, not a workload delivery lane, and the two NetKingdom SSO lanes
|
|
|
|
|
# (c374d41) remain provider/control-plane credentials. Lanes added after
|
|
|
|
|
# 2026-09-09 moved the denominator without moving `resolved`; these counts
|
|
|
|
|
# and pep-stance.yaml's classification_coverage measure the same populations
|
2026-10-05 13:21:22 +02:00
|
|
|
# and must be updated together. 16 since 2026-10-05: the
|
|
|
|
|
# openbao-structure-survey pointer (WARDEN-WP-0042) is a builder survey
|
2026-10-08 23:25:22 +02:00
|
|
|
# under a founder-minted grant, not a workload credential. 17 since
|
|
|
|
|
# 2026-10-08: platform-supplier-credentials (WARDEN-WP-0043) is a generic
|
|
|
|
|
# supplier-account path pattern; concrete consumers keep their own lanes.
|
2026-10-09 19:59:49 +02:00
|
|
|
# unknown 22 since 2026-10-09: fluid-telegram-operator (MASON-WP-0005-T06)
|
|
|
|
|
# names fluid-telegram, which has published no workload declaration.
|
2026-10-10 10:24:51 +02:00
|
|
|
# not_applicable 18 since 2026-10-10: keycape-client-secret-generate is a
|
|
|
|
|
# per-case generation lane; each case's consumer gets its own entry.
|
feat(case): KERNEL-2/3 lane resolution and mode-aware admission; CATALOG-1 draft lanes
nk48 1.3 owner review (owner-review-ops-warden.json):
- KERNEL-2: Executor.admit parses catalog_source and resolves descriptor.lane;
refuses a missing, non-active, undelegated or ungraded lane, an owner outside
owner_repo, and a mint/change effect on a lane not graded risk high.
catalog-routing-acceptance still covers the whole catalog digest.
- KERNEL-3: dispatch mode is read from the type's follow_through step
(warden_executes/attended). The step must declare both booleans and a lane
and agree with the descriptor's lane and owner. Attended: human actor,
WARDEN_AGENT_ID unset, parent-session revocation scope, caller lane equal to
the step lane. Owner: native delegation, owner_repo == descriptor.owner, no
Warden-executed lane and no Warden-brokered mint.
- CATALOG-1: draft entries keycape-attended-case-change (OW-1.3-C1),
platform-secret-delivery, consumer-owner-deployment, apps-consumer-handover.
Not promoted; promotion waits for owner confirmation.
- Fixture catalogs and type steps in tests; published routing_lanes coverage
and the workload-join count follow the four new not-applicable lanes.
PARAMETER_PINS untouched (PIN-1 waits for founder acknowledgment).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 903097@bnt-lap001
Assistant-Session: aa320c8f-c3fa-46e7-8541-0b58e1e45d23
2026-10-17 12:08:49 +02:00
|
|
|
# not_applicable 22 since 2026-10-17: the four CATALOG-1 draft lanes
|
|
|
|
|
# (nk48 1.3 owner review) are per-case lanes like the one above.
|
2026-10-20 13:46:28 +02:00
|
|
|
assert len(report["not_applicable"]) == 23
|
2026-08-22 15:36:37 +02:00
|
|
|
assert {row["lane"] for row in report["resolved"]} == {
|
|
|
|
|
"ops-warden-warden-sign-token",
|
|
|
|
|
"issue-core-ingestion-api-key",
|
|
|
|
|
"rapp-qonto-keycape-client",
|
2026-10-03 12:55:08 +02:00
|
|
|
"core-hub-forgejo-source-read", # CCR-2026-0031, 2026-10-03
|
2026-08-22 15:36:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_invalid_exact_deployable_resolves_unknown(tmp_path):
|
|
|
|
|
rapp = tmp_path / "rapp-x" / "declarations"
|
|
|
|
|
rapp.mkdir(parents=True)
|
|
|
|
|
(rapp / "rapp.yaml").write_text(yaml.safe_dump({
|
|
|
|
|
"rapp_id": "rapp-x",
|
|
|
|
|
"workload_identity": {"name": "x"},
|
|
|
|
|
"composition": {"member_repos": [{"deployables": ["api"]}]},
|
|
|
|
|
}))
|
|
|
|
|
catalog_dir = tmp_path / "ops-warden" / "registry" / "routing"
|
|
|
|
|
catalog_dir.mkdir(parents=True)
|
|
|
|
|
catalog = catalog_dir / "catalog.yaml"
|
|
|
|
|
catalog.write_text(yaml.safe_dump({"entries": [{
|
|
|
|
|
"id": "x",
|
|
|
|
|
"workload_ref": {
|
|
|
|
|
"applicability": "applicable",
|
|
|
|
|
"rapp_id": "rapp-x",
|
|
|
|
|
"name": "x",
|
|
|
|
|
"deployable": "missing",
|
|
|
|
|
},
|
|
|
|
|
}]}))
|
|
|
|
|
posture = catalog_dir.parent / "policy"
|
|
|
|
|
posture.mkdir()
|
|
|
|
|
(posture / "security-posture.yaml").write_text("dataclass_floor: {}\n")
|
|
|
|
|
|
|
|
|
|
report = build(catalog, tmp_path)
|
|
|
|
|
assert not report["resolved"]
|
|
|
|
|
assert report["unknown"][0]["lane"] == "x"
|
|
|
|
|
assert "deployable" in report["unknown"][0]["reason"]
|
2026-10-17 21:30:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_public_workload_projection_matches_provenance():
|
|
|
|
|
base = ROOT / 'tests/fixtures/workload-coverage'
|
|
|
|
|
provenance = json.loads((base / 'provenance.json').read_text())
|
|
|
|
|
expected = {'rapp-core-hub', 'rapp-issue-core', 'rapp-qonto'}
|
|
|
|
|
assert len(provenance) == len(expected)
|
|
|
|
|
assert {row['repo'] for row in provenance} == expected
|
|
|
|
|
for row in provenance:
|
|
|
|
|
projection = base / row['repo'] / 'declarations/rapp.yaml'
|
|
|
|
|
assert hashlib.sha256(projection.read_bytes()).hexdigest() == row['projection_sha256']
|