Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

fix(governance): block prerelease on credential containment

rcourtmand45e597dbb7d
diff --git a/docs/release-control/internal/CONTROL_PLANE.md b/docs/release-control/internal/CONTROL_PLANE.md
index ef66f8b6de..129ba0d394 100644
--- a/docs/release-control/internal/CONTROL_PLANE.md
+++ b/docs/release-control/internal/CONTROL_PLANE.md
@@ -63,6 +63,12 @@ model that active and future release profiles reuse.
must declare the minimum evidence tier needed for closure, and the audit
layer must treat lower-tier evidence as rehearsal only rather than as
high-confidence completion.
+ When a gate carries a typed closure contract, raw `passed` status and prose
+ evidence are also insufficient: the audit must keep the gate blocking until
+ every required typed record is present, independently verified, and at the
+ gate's minimum tier. Destructive history remediation must remain a separate
+ nonblocking action when containment, rather than history shape, is the
+ release truth.
10. Direction changes must be normalized.
When the user states a durable product truth or changes the current product
priority, the agent must classify that direction as a readiness assertion,
diff --git a/docs/release-control/v6/internal/CANONICAL_DEVELOPMENT_PROTOCOL.md b/docs/release-control/v6/internal/CANONICAL_DEVELOPMENT_PROTOCOL.md
index 6506b9fe02..4ebf920507 100644
--- a/docs/release-control/v6/internal/CANONICAL_DEVELOPMENT_PROTOCOL.md
+++ b/docs/release-control/v6/internal/CANONICAL_DEVELOPMENT_PROTOCOL.md
@@ -147,6 +147,11 @@ linkage, typed decision records, and derived evidence health. It also enforces
canonical list ordering inside `status.json` so repo scope, lanes, readiness
assertions, evidence references, and decision timelines do not drift into
noisy, hand-arranged variants.
+Release gates with typed closure contracts are fail-closed: a raw `passed`
+status cannot become effective until the audit verifies complete subject
+coverage, required record evidence at the gate's minimum tier, and any
+contract-specific consistency rules. Prose-only closure is never sufficient
+for such a gate.
`scripts/release_control/registry_audit.py --check` is the machine audit entry
point for validating subsystem ownership, proof routing, registry lane
bindings, canonical ordering for unordered registry lists, and path-policy
diff --git a/docs/release-control/v6/internal/HIGH_RISK_RELEASE_VERIFICATION_MATRIX.md b/docs/release-control/v6/internal/HIGH_RISK_RELEASE_VERIFICATION_MATRIX.md
index 5b8bba8b07..e88dd6463c 100644
--- a/docs/release-control/v6/internal/HIGH_RISK_RELEASE_VERIFICATION_MATRIX.md
+++ b/docs/release-control/v6/internal/HIGH_RISK_RELEASE_VERIFICATION_MATRIX.md
@@ -25,6 +25,50 @@ Companion drill:
`docs/release-control/v6/COMMERCIAL_CANCELLATION_REACTIVATION_E2E_TEST_PLAN.md`
and attach the resulting record to the applicable gate evidence.
+## Gate: `historical-credential-containment`
+
+- Why this is risky:
+ Historically reachable credential identities remain a live release-security
+ risk until the owning provider or control plane proves each old identity
+ dead. A different current value, a repository-secret timestamp, a successful
+ request with a replacement, or an approval paragraph does not establish
+ revocation.
+- Governed evidence surfaces:
+ `docs/release-control/v6/internal/status.json`
+ `docs/release-control/v6/internal/records/historical-credential-containment-open-2026-08-08.md`
+ `pulse-pro/docs/credential-containment-runbook.md`
+- Automated governance proof:
+ `python3 scripts/release_control/status_audit_test.py`
+ `python3 scripts/release_control/status_audit.py --check --pretty`
+- Owner action:
+ 1. Execute the approved provider and deployment procedures without reading,
+ testing, printing, or comparing a historical credential.
+ 2. For every redacted `closure_contract.subject_ids` entry, record one
+ authoritative provider/control-plane disposition and one
+ replacement-deployment validation or verified-retirement disposition.
+ 3. Keep provider object identifiers and operational exports in the approved
+ restricted evidence location; commit only reviewed, sanitized evidence
+ references and metadata.
+ 4. Have an independent verifier record each typed row at the required
+ `production-observed` evidence tier.
+ 5. Run the status audit and confirm provider and replacement coverage both
+ equal the declared subject count before changing the gate to `passed`.
+- Pass when:
+ The typed closure contract covers every declared redacted subject exactly
+ once in both record sets, every record has present production-observed
+ evidence and a verifier timestamp, any `not-applicable-retired` replacement
+ row is paired with provider-side decommissioning, and the audit derives
+ `closure_contract_complete=true`.
+- Block release if:
+ Any subject is missing either record, evidence is missing or below the
+ required tier, provider death is inferred only from prose/current-value
+ differences/timestamps, or a retired replacement row lacks decommissioning
+ proof. Setting the raw gate status to `passed` while closure is incomplete
+ derives `closure-incomplete` and remains prerelease-blocking.
+- History rewrite:
+ Optional destructive history remediation is explicitly nonblocking and may
+ start only after containment. It cannot close or substitute for this gate.
+
## Gate: `hosted-signup-billing-replay`
- Why this is risky:
diff --git a/docs/release-control/v6/internal/PRE_RELEASE_CHECKLIST.md b/docs/release-control/v6/internal/PRE_RELEASE_CHECKLIST.md
index e208d82307..09797b8ed9 100644
--- a/docs/release-control/v6/internal/PRE_RELEASE_CHECKLIST.md
+++ b/docs/release-control/v6/internal/PRE_RELEASE_CHECKLIST.md
@@ -13,9 +13,11 @@ Use this as the final gate before cutting a Pulse v6 pre-release.
## Current Status
- Automated command-driven checks completed on 2026-03-06 are marked `[x]` below.
- `status.json` is no longer overclaiming threshold-unmet gates as passed.
-- There are no remaining `rc-ready` high-risk release-gate blockers, and the
- explicit `rc-publication-judgment` was approved on 2026-04-09 for the first
- governed Pulse v6 RC.
+- Historical credential containment is an `owner-action` `rc-ready` gate across
+ Pulse and Pulse Pro. It remains blocked at zero of fifteen provider-closure
+ records and zero of fifteen replacement-deployment or verified-retirement
+ records. The separate self-hosted commercial owner decision also remains
+ open.
- The latest RC publication judgment packet is
`docs/release-control/v6/internal/records/rc-publication-judgment-packet-2026-04-09.md`.
It now records approval, not a proof blocker.
@@ -37,6 +39,10 @@ Use this as the final gate before cutting a Pulse v6 pre-release.
- High-risk release confidence now lives in `docs/release-control/v6/internal/HIGH_RISK_RELEASE_VERIFICATION_MATRIX.md` and should be cleared alongside this checklist.
## Promotion Policy
+- [ ] Confirm `python3 scripts/release_control/status_audit.py --check --pretty`
+ reports the `historical-credential-containment` gate as effectively passed,
+ with complete provider and replacement record coverage. A raw `passed`
+ value, prose approval, or optional history rewrite is insufficient.
- [ ] For a routine stable patch, run `./scripts/trigger-stable-patch.sh --dry-run <version>` from the exact pushed candidate SHA, wait for the whole run including `Verify Current Stable Demo Path (No Mutation)` to pass, then run `./scripts/trigger-stable-patch.sh <version>` once.
- [ ] Confirm a routine stable patch has no same-version RC and no diff in the RC-required authentication/tenant, licensing/billing, persisted-data/migration, relay/mobile-trust, or installer/update/rollback boundaries. Otherwise use RC promotion or record the emergency hotfix reason.
- [ ] Treat `Release Activation Commit Verdict` as the irreversible GitHub release result, and follow its exact linked `Release Convergence` run until `Customer Promotion Convergence Verdict` is green. A red convergence run is retriable customer-surface debt, not evidence that the committed release returned to draft.
diff --git a/docs/release-control/v6/internal/RELEASE_PROMOTION_POLICY.md b/docs/release-control/v6/internal/RELEASE_PROMOTION_POLICY.md
index 5148cbb9ba..1f17a859e3 100644
--- a/docs/release-control/v6/internal/RELEASE_PROMOTION_POLICY.md
+++ b/docs/release-control/v6/internal/RELEASE_PROMOTION_POLICY.md
@@ -411,6 +411,12 @@ TLS-unverified receipts leave the claim at `implemented` or
10. For v6 GA, attach the dated RC issue-closure record for the candidate so
the final issue set and its dispositions are explicit in the promotion
packet rather than implied.
+11. Attach the sanitized historical-credential containment closure packet.
+ Every declared Pulse and Pulse Pro redacted subject must have typed
+ provider/control-plane closure plus replacement-deployment or
+ verified-retirement evidence at the governed minimum tier. A raw gate
+ status, narrative approval, current-value difference, or optional history
+ rewrite cannot substitute for those records.
## Authority
diff --git a/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md b/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md
index 2dbf4d6e14..79b995629b 100644
--- a/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md
+++ b/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md
@@ -300,6 +300,13 @@ Assertion design rules:
High-risk release gates must declare the minimum evidence tier required for
closure, and rehearsal evidence below that tier must remain blocking even
when a dated record already exists.
+ A gate with a typed closure contract must additionally satisfy every
+ machine-audited record requirement. Narrative approval, a generic dated
+ record, or raw `passed` status cannot override missing typed evidence.
+ Historical credential containment requires provider/control-plane closure
+ plus replacement-deployment or verified-retirement evidence per redacted
+ subject; optional history rewriting stays separate and nonblocking after
+ containment.
8. When a user states a durable product truth, normalize it into a readiness
assertion, release gate, or open decision rather than leaving it as chat.
9. Treat casual user language about consistency, seamlessness, drift, bypass
diff --git a/docs/release-control/v6/internal/records/historical-credential-containment-open-2026-08-08.md b/docs/release-control/v6/internal/records/historical-credential-containment-open-2026-08-08.md
new file mode 100644
index 0000000000..3e8ee23be5
--- /dev/null
+++ b/docs/release-control/v6/internal/records/historical-credential-containment-open-2026-08-08.md
@@ -0,0 +1,60 @@
+# Historical Credential Containment — Open
+
+Recorded: 2026-08-08.
+
+This record contains redacted identity labels and repository metadata only. It
+contains no credential values, fragments, prefixes, fingerprints, derived
+values, request material, or authentication results.
+
+## Current finding
+
+Historical credential containment is not complete and remains a prerelease
+blocker across `pulse` and `pulse-pro`.
+
+The public Pulse inventory has ten stable redacted identities:
+
+- `PBS-01`
+- `PBS-02`
+- `PULSE-01`
+- `PULSE-02`
+- `PULSE-03`
+- `PULSE-04`
+- `PXM-01`
+- `PXM-02`
+- `SLACK-01`
+- `TELEGRAM-01`
+
+Those identities remain reachable through 244 affected tag refs, with 225
+attached GitHub Releases. No provider-side death evidence is recorded for any
+of them.
+
+The private Pulse Pro containment scope uses five redacted role identities:
+
+- `PRO-CLOUDFLARE-01`
+- `PRO-DIGITALOCEAN-01`
+- `PRO-LICENSE-ADMIN-01`
+- `PRO-RESEND-01`
+- `PRO-STRIPE-WEBHOOK-01`
+
+At the reviewed Pulse Pro runbook revision
+`cf30c40a8ba96fca363b41af1bda85a64554f16a`, the current Resend and
+license-admin roles still matched reachable history. Historical DigitalOcean,
+Stripe webhook, and Cloudflare revocation remained unproven.
+
+## Closure rule
+
+The gate stays blocking until every redacted identity has both:
+
+1. authoritative provider or owning-control-plane evidence that the historical
+ identity was revoked, expired, decommissioned, or is absent from a fresh
+ inventory; and
+2. verified replacement deployment evidence, or verified retirement evidence
+ when the consumer no longer exists.
+
+A narrative approval, a different current value, a file or secret update
+timestamp, repository-secret metadata, or a successful request with a current
+credential cannot satisfy either typed record set by itself.
+
+History rewriting is a separate, optional, destructive follow-up after
+containment. It is not a prerequisite for provider containment and cannot be
+used as a substitute for it.
diff --git a/docs/release-control/v6/internal/status.json b/docs/release-control/v6/internal/status.json
index a04c1b5961..85d783a14e 100644
--- a/docs/release-control/v6/internal/status.json
+++ b/docs/release-control/v6/internal/status.json
@@ -8008,6 +8008,54 @@
}
]
},
+ {
+ "id": "historical-credential-containment",
+ "summary": "Contain every historically reachable credential identity across Pulse and Pulse Pro before prerelease: record authoritative provider revocation, expiry, decommissioning, or fresh inventory absence plus replacement-deployment or verified-retirement evidence for every redacted subject. Repository prose, approval, current-value differences, and optional history rewriting cannot close this gate.",
+ "owner": "release-owner-and-provider-owners",
+ "blocking_level": "rc-ready",
+ "minimum_evidence_tier": "production-observed",
+ "status": "owner-action",
+ "verification_doc": "docs/release-control/v6/internal/HIGH_RISK_RELEASE_VERIFICATION_MATRIX.md",
+ "lane_ids": [
+ "L1",
+ "L2",
+ "L14"
+ ],
+ "evidence": [
+ {
+ "repo": "pulse",
+ "path": "docs/release-control/v6/internal/records/historical-credential-containment-open-2026-08-08.md",
+ "kind": "file",
+ "evidence_tier": "production-observed"
+ }
+ ],
+ "closure_contract": {
+ "kind": "historical-credential-containment",
+ "subject_ids": [
+ "PBS-01",
+ "PBS-02",
+ "PRO-CLOUDFLARE-01",
+ "PRO-DIGITALOCEAN-01",
+ "PRO-LICENSE-ADMIN-01",
+ "PRO-RESEND-01",
+ "PRO-STRIPE-WEBHOOK-01",
+ "PULSE-01",
+ "PULSE-02",
+ "PULSE-03",
+ "PULSE-04",
+ "PXM-01",
+ "PXM-02",
+ "SLACK-01",
+ "TELEGRAM-01"
+ ],
+ "provider_closure_records": [],
+ "replacement_deployment_records": [],
+ "history_rewrite": {
+ "blocking": false,
+ "status": "optional-after-containment"
+ }
+ }
+ },
{
"id": "hosted-signup-billing-replay",
"summary": "Confirm hosted signup, org provisioning, billing-admin visibility, and webhook replay succeed in the real checkout path.",
diff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.md
index de16d2d943..0c03e488b4 100644
--- a/docs/release-control/v6/internal/subsystems/security-privacy.md
+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md
@@ -608,9 +608,27 @@ tokens, and path-normalization variants.
`public` payload as authoritative for `hasAuthentication` only; only a
`privileged` payload supports the full assessment. Absent posture fields
must not be read as disabled controls.
+15. Historical credential containment remains release governance, not a prose
+ security sign-off. Keep the rc-ready release gate fail-closed until every
+ redacted Pulse and Pulse Pro subject has typed provider/control-plane
+ closure plus replacement-deployment or verified-retirement evidence at the
+ required tier. Keep optional history rewriting separate and nonblocking
+ after containment.
## Current State
+### Historical credential containment is prerelease-blocking
+
+The `historical-credential-containment` release gate now owns the cross-repo
+containment boundary for the stable redacted Pulse identities and the redacted
+Pulse Pro credential roles. Its `owner-action` state blocks `rc_ready`, and the
+status audit refuses to make a raw `passed` state effective until both typed
+record sets cover every declared subject with production-observed evidence.
+The opening sanitized inventory is recorded in
+`docs/release-control/v6/internal/records/historical-credential-containment-open-2026-08-08.md`.
+History rewrite remains an optional post-containment operation and cannot
+satisfy the gate.
+
### Custom metric source authority is local-only and fail-closed
`pulse-agent` may load site-defined probes only from the absolute path
diff --git a/docs/release-control/v6/status.schema.json b/docs/release-control/v6/status.schema.json
index 315d6f73f2..e20c56f941 100644
--- a/docs/release-control/v6/status.schema.json
+++ b/docs/release-control/v6/status.schema.json
@@ -864,6 +864,7 @@
"enum": [
"pending",
"blocked",
+ "owner-action",
"passed"
]
},
@@ -886,6 +887,150 @@
"items": {
"$ref": "#/$defs/evidence_reference"
}
+ },
+ "closure_contract": {
+ "$ref": "#/$defs/release_gate_closure_contract"
+ }
+ }
+ },
+ "release_gate_closure_contract": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "kind",
+ "subject_ids",
+ "provider_closure_records",
+ "replacement_deployment_records",
+ "history_rewrite"
+ ],
+ "properties": {
+ "kind": {
+ "type": "string",
+ "const": "historical-credential-containment"
+ },
+ "subject_ids": {
+ "type": "array",
+ "minItems": 1,
+ "uniqueItems": true,
+ "items": {
+ "type": "string",
+ "minLength": 1
+ }
+ },
+ "provider_closure_records": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/credential_provider_closure_record"
+ }
+ },
+ "replacement_deployment_records": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/credential_replacement_deployment_record"
+ }
+ },
+ "history_rewrite": {
+ "$ref": "#/$defs/credential_history_rewrite_posture"
+ }
+ }
+ },
+ "credential_provider_closure_record": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "subject_id",
+ "disposition",
+ "recorded_at",
+ "verifier",
+ "evidence"
+ ],
+ "properties": {
+ "subject_id": {
+ "type": "string",
+ "minLength": 1
+ },
+ "disposition": {
+ "type": "string",
+ "enum": [
+ "revoked",
+ "inventory-absent",
+ "expired",
+ "decommissioned"
+ ]
+ },
+ "recorded_at": {
+ "type": "string",
+ "format": "date-time",
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})$"
+ },
+ "verifier": {
+ "type": "string",
+ "minLength": 1
+ },
+ "evidence": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "$ref": "#/$defs/evidence_reference"
+ }
+ }
+ }
+ },
+ "credential_replacement_deployment_record": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "subject_id",
+ "disposition",
+ "recorded_at",
+ "verifier",
+ "evidence"
+ ],
+ "properties": {
+ "subject_id": {
+ "type": "string",
+ "minLength": 1
+ },
+ "disposition": {
+ "type": "string",
+ "enum": [
+ "validated",
+ "not-applicable-retired"
+ ]
+ },
+ "recorded_at": {
+ "type": "string",
+ "format": "date-time",
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(Z|[+-][0-9]{2}:[0-9]{2})$"
+ },
+ "verifier": {
+ "type": "string",
+ "minLength": 1
+ },
+ "evidence": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "$ref": "#/$defs/evidence_reference"
+ }
+ }
+ }
+ },
+ "credential_history_rewrite_posture": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": [
+ "blocking",
+ "status"
+ ],
+ "properties": {
+ "blocking": {
+ "type": "boolean",
+ "const": false
+ },
+ "status": {
+ "type": "string",
+ "const": "optional-after-containment"
}
}
},
diff --git a/internal/repoctl/canonical_development_protocol_test.go b/internal/repoctl/canonical_development_protocol_test.go
index f41cbc5609..c788a993b9 100644
--- a/internal/repoctl/canonical_development_protocol_test.go
+++ b/internal/repoctl/canonical_development_protocol_test.go
@@ -735,6 +735,7 @@ func TestV6ControlDocsReferenceCanonicalDevelopmentProtocol(t *testing.T) {
matrix := readRepoFile(t, "docs/release-control/v6/internal/HIGH_RISK_RELEASE_VERIFICATION_MATRIX.md")
assertContainsAll(t, "docs/release-control/v6/internal/HIGH_RISK_RELEASE_VERIFICATION_MATRIX.md", matrix, []string{
"status.json.release_gates",
+ "historical-credential-containment",
"hosted-signup-billing-replay",
"paid-feature-entitlement-gating",
"rc-to-ga-promotion-readiness",
@@ -772,6 +773,14 @@ func TestStatusSchemaExistsAndDeclaresTypedStatusContract(t *testing.T) {
"\"proof_type\"",
"\"open_decision\"",
"\"resolved_decision\"",
+ "\"owner-action\"",
+ "\"release_gate_closure_contract\"",
+ "\"historical-credential-containment\"",
+ "\"credential_provider_closure_record\"",
+ "\"credential_replacement_deployment_record\"",
+ "\"provider_closure_records\"",
+ "\"replacement_deployment_records\"",
+ "\"optional-after-containment\"",
"\"lane_ids\"",
"\"direct-repo-sessions\"",
"\"const\": \"bounded-residual\"",
diff --git a/scripts/release_control/status_audit.py b/scripts/release_control/status_audit.py
index 4d30e1019e..9a6060d6bd 100644
--- a/scripts/release_control/status_audit.py
+++ b/scripts/release_control/status_audit.py
@@ -168,6 +168,19 @@ def _blocker_detail(
detail["highest_evidence_tier"] = item["highest_evidence_tier"]
if "minimum_evidence_tier" in item:
detail["minimum_evidence_tier"] = item["minimum_evidence_tier"]
+ if item.get("closure_contract_kind"):
+ detail["closure_contract_kind"] = item["closure_contract_kind"]
+ detail["closure_contract_complete"] = item["closure_contract_complete"]
+ detail["closure_subject_count"] = item["closure_subject_count"]
+ detail["provider_closure_count"] = item["provider_closure_count"]
+ detail["replacement_deployment_count"] = item["replacement_deployment_count"]
+ detail["missing_provider_closure_subject_ids"] = list(
+ item["missing_provider_closure_subject_ids"]
+ )
+ detail["missing_replacement_deployment_subject_ids"] = list(
+ item["missing_replacement_deployment_subject_ids"]
+ )
+ detail["history_rewrite_blocking"] = item["history_rewrite_blocking"]
return detail
@@ -1275,13 +1288,34 @@ def validate_release_gates(
valid_evidence_tiers=valid_evidence_tiers,
errors=errors,
)
+ closure_report = validate_release_gate_closure_contract(
+ raw.get("closure_contract"),
+ context=f"{context}.closure_contract",
+ active_repos=active_repos,
+ allowed_kinds=allowed_kinds,
+ valid_evidence_tiers=valid_evidence_tiers,
+ minimum_evidence_tier=minimum_evidence_tier,
+ errors=errors,
+ )
+ highest_evidence_tier = _highest_evidence_tier(
+ [
+ tier
+ for tier in [
+ evidence_report["highest_evidence_tier"],
+ closure_report["highest_evidence_tier"],
+ ]
+ if tier
+ ]
+ )
evidence_threshold_met = _evidence_tier_meets_minimum(
- evidence_report["highest_evidence_tier"],
+ highest_evidence_tier,
minimum_evidence_tier,
)
if status == "passed":
- if not evidence_report["all_evidence_present"]:
+ if not evidence_report["all_evidence_present"] or not closure_report["all_evidence_present"]:
effective_status = "evidence-missing"
+ elif closure_report["declared"] and not closure_report["complete"]:
+ effective_status = "closure-incomplete"
elif not evidence_threshold_met:
effective_status = "threshold-unmet"
else:
@@ -1292,7 +1326,9 @@ def validate_release_gates(
if gate_id and summary and owner and blocking_level and minimum_evidence_tier and status and verification_doc:
repo_ids = _derived_repo_ids_for_lane_refs(lane_refs, lane_repo_ids=lane_repo_ids)
repo_ids = sorted(
- set(repo_ids) | {repo for repo, _, _ in evidence_report["evidence_refs"]},
+ set(repo_ids)
+ | {repo for repo, _, _ in evidence_report["evidence_refs"]}
+ | {repo for repo, _, _ in closure_report["evidence_refs"]},
key=_repo_sort_key,
)
records.append(
@@ -1306,11 +1342,28 @@ def validate_release_gates(
"effective_status": effective_status,
"verification_doc": verification_doc,
"lane_ids": lane_refs,
- "all_evidence_present": evidence_report["all_evidence_present"],
- "evidence_count": len(evidence_report["resolved_evidence"]),
- "highest_evidence_tier": evidence_report["highest_evidence_tier"],
+ "all_evidence_present": evidence_report["all_evidence_present"]
+ and closure_report["all_evidence_present"],
+ "evidence_count": len(evidence_report["resolved_evidence"])
+ + closure_report["evidence_count"],
+ "highest_evidence_tier": highest_evidence_tier,
"evidence_threshold_met": evidence_threshold_met,
- "missing_evidence": evidence_report["missing_evidence"],
+ "missing_evidence": evidence_report["missing_evidence"]
+ + closure_report["missing_evidence"],
+ "closure_contract_kind": closure_report["kind"],
+ "closure_contract_complete": closure_report["complete"],
+ "closure_subject_count": closure_report["subject_count"],
+ "provider_closure_count": closure_report["provider_closure_count"],
+ "replacement_deployment_count": closure_report[
+ "replacement_deployment_count"
+ ],
+ "missing_provider_closure_subject_ids": closure_report[
+ "missing_provider_closure_subject_ids"
+ ],
+ "missing_replacement_deployment_subject_ids": closure_report[
+ "missing_replacement_deployment_subject_ids"
+ ],
+ "history_rewrite_blocking": closure_report["history_rewrite_blocking"],
"repo_ids": repo_ids,
"cross_repo": len(repo_ids) > 1,
}
@@ -1324,6 +1377,205 @@ def validate_release_gates(
return records
+def validate_release_gate_closure_contract(
+ raw_contract: Any,
+ *,
+ context: str,
+ active_repos: set[str],
+ allowed_kinds: set[str],
+ valid_evidence_tiers: set[str],
+ minimum_evidence_tier: str | None,
+ errors: list[str],
+) -> dict[str, Any]:
+ empty_report = {
+ "declared": False,
+ "kind": None,
+ "complete": True,
+ "all_evidence_present": True,
+ "evidence_count": 0,
+ "evidence_refs": [],
+ "missing_evidence": [],
+ "highest_evidence_tier": None,
+ "subject_count": 0,
+ "provider_closure_count": 0,
+ "replacement_deployment_count": 0,
+ "missing_provider_closure_subject_ids": [],
+ "missing_replacement_deployment_subject_ids": [],
+ "history_rewrite_blocking": None,
+ }
+ if raw_contract is None:
+ return empty_report
+ if not isinstance(raw_contract, dict):
+ errors.append(f"{context} must be an object when declared")
+ return {**empty_report, "declared": True, "complete": False}
+
+ kind = _require_string(raw_contract, "kind", errors, context=context)
+ if kind and kind != "historical-credential-containment":
+ errors.append(
+ f"{context}.kind must be 'historical-credential-containment', got {kind!r}"
+ )
+ subject_ids = _require_string_list(raw_contract, "subject_ids", errors, context=context)
+ if not subject_ids:
+ errors.append(f"{context}.subject_ids must be a non-empty list")
+ if len(subject_ids) != len(set(subject_ids)):
+ errors.append(f"{context}.subject_ids must not contain duplicates")
+ if subject_ids != sorted(subject_ids):
+ errors.append(f"{context}.subject_ids must be sorted lexicographically")
+ subject_id_set = set(subject_ids)
+
+ valid_provider_dispositions = {"revoked", "inventory-absent", "expired", "decommissioned"}
+ valid_replacement_dispositions = {"validated", "not-applicable-retired"}
+
+ def validate_records(
+ field: str,
+ *,
+ valid_dispositions: set[str],
+ ) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]:
+ raw_records = raw_contract.get(field)
+ if not isinstance(raw_records, list):
+ errors.append(f"{context}.{field} must be a list")
+ return [], []
+ records: list[dict[str, Any]] = []
+ evidence_reports: list[dict[str, Any]] = []
+ for index, raw_record in enumerate(raw_records):
+ record_context = f"{context}.{field}[{index}]"
+ if not isinstance(raw_record, dict):
+ errors.append(f"{record_context} must be an object")
+ continue
+ subject_id = _require_string(raw_record, "subject_id", errors, context=record_context)
+ disposition = _require_string(raw_record, "disposition", errors, context=record_context)
+ recorded_at = _require_string(raw_record, "recorded_at", errors, context=record_context)
+ verifier = _require_string(raw_record, "verifier", errors, context=record_context)
+ if subject_id and subject_id not in subject_id_set:
+ errors.append(f"{record_context} references unknown subject_id {subject_id!r}")
+ if disposition and disposition not in valid_dispositions:
+ errors.append(f"{record_context} has invalid disposition {disposition!r}")
+ if recorded_at and not TIMESTAMP_RE.fullmatch(recorded_at):
+ errors.append(f"{record_context}.recorded_at must be an RFC3339 timestamp")
+ evidence_report = audit_evidence_refs(
+ raw_record.get("evidence"),
+ context=record_context,
+ active_repos=active_repos,
+ allowed_kinds=allowed_kinds,
+ valid_evidence_tiers=valid_evidence_tiers,
+ errors=errors,
+ )
+ record_tier_met = _evidence_tier_meets_minimum(
+ evidence_report["highest_evidence_tier"], minimum_evidence_tier
+ )
+ if subject_id and disposition and recorded_at and verifier:
+ records.append(
+ {
+ "subject_id": subject_id,
+ "disposition": disposition,
+ "record_tier_met": record_tier_met,
+ "all_evidence_present": evidence_report["all_evidence_present"],
+ }
+ )
+ evidence_reports.append(evidence_report)
+ record_ids = [record["subject_id"] for record in records]
+ if len(record_ids) != len(set(record_ids)):
+ errors.append(f"{context}.{field} must not contain duplicate subject_id records")
+ if record_ids != sorted(record_ids):
+ errors.append(f"{context}.{field} must be sorted by subject_id")
+ return records, evidence_reports
+
+ provider_records, provider_evidence = validate_records(
+ "provider_closure_records", valid_dispositions=valid_provider_dispositions
+ )
+ replacement_records, replacement_evidence = validate_records(
+ "replacement_deployment_records", valid_dispositions=valid_replacement_dispositions
+ )
+
+ provider_by_subject = {record["subject_id"]: record for record in provider_records}
+ replacement_by_subject = {record["subject_id"]: record for record in replacement_records}
+ for subject_id, replacement_record in replacement_by_subject.items():
+ if replacement_record["disposition"] != "not-applicable-retired":
+ continue
+ provider_record = provider_by_subject.get(subject_id)
+ if provider_record and provider_record["disposition"] != "decommissioned":
+ errors.append(
+ f"{context}.replacement_deployment_records subject {subject_id!r} may use "
+ "'not-applicable-retired' only with provider disposition 'decommissioned'"
+ )
+
+ history_rewrite = raw_contract.get("history_rewrite")
+ history_rewrite_valid = False
+ history_rewrite_blocking: bool | None = None
+ if not isinstance(history_rewrite, dict):
+ errors.append(f"{context}.history_rewrite must be an object")
+ else:
+ history_rewrite_blocking = history_rewrite.get("blocking")
+ history_rewrite_status = history_rewrite.get("status")
+ if history_rewrite_blocking is not False:
+ errors.append(f"{context}.history_rewrite.blocking must be false")
+ if history_rewrite_status != "optional-after-containment":
+ errors.append(
+ f"{context}.history_rewrite.status must be 'optional-after-containment'"
+ )
+ history_rewrite_valid = (
+ history_rewrite_blocking is False
+ and history_rewrite_status == "optional-after-containment"
+ )
+
+ provider_ids = set(provider_by_subject)
+ replacement_ids = set(replacement_by_subject)
+ missing_provider_ids = sorted(subject_id_set - provider_ids)
+ missing_replacement_ids = sorted(subject_id_set - replacement_ids)
+ all_record_evidence = provider_evidence + replacement_evidence
+ complete = (
+ kind == "historical-credential-containment"
+ and bool(subject_ids)
+ and not missing_provider_ids
+ and not missing_replacement_ids
+ and provider_ids == subject_id_set
+ and replacement_ids == subject_id_set
+ and all(record["all_evidence_present"] and record["record_tier_met"] for record in provider_records)
+ and all(
+ record["all_evidence_present"] and record["record_tier_met"]
+ for record in replacement_records
+ )
+ and all(
+ record["disposition"] != "not-applicable-retired"
+ or provider_by_subject.get(record["subject_id"], {}).get("disposition") == "decommissioned"
+ for record in replacement_records
+ )
+ and history_rewrite_valid
+ )
+ return {
+ "declared": True,
+ "kind": kind,
+ "complete": complete,
+ "all_evidence_present": all(
+ report["all_evidence_present"] for report in all_record_evidence
+ ),
+ "evidence_count": sum(len(report["resolved_evidence"]) for report in all_record_evidence),
+ "evidence_refs": [
+ evidence_ref
+ for report in all_record_evidence
+ for evidence_ref in report["evidence_refs"]
+ ],
+ "missing_evidence": [
+ missing
+ for report in all_record_evidence
+ for missing in report["missing_evidence"]
+ ],
+ "highest_evidence_tier": _highest_evidence_tier(
+ [
+ report["highest_evidence_tier"]
+ for report in all_record_evidence
+ if report["highest_evidence_tier"]
+ ]
+ ),
+ "subject_count": len(subject_ids),
+ "provider_closure_count": len(provider_ids),
+ "replacement_deployment_count": len(replacement_ids),
+ "missing_provider_closure_subject_ids": missing_provider_ids,
+ "missing_replacement_deployment_subject_ids": missing_replacement_ids,
+ "history_rewrite_blocking": history_rewrite_blocking,
+ }
+
+
def validate_proof_commands(raw_commands: Any, *, context: str, errors: list[str]) -> list[dict[str, Any]]:
if raw_commands is None:
return []
@@ -3178,6 +3430,17 @@ def parse_args(argv: list[str]) -> argparse.Namespace:
def render_pretty(report: dict[str, Any]) -> str:
lines: list[str] = []
+
+ def append_closure_summary(gate: dict[str, Any], *, indent: str) -> None:
+ if not gate.get("closure_contract_kind"):
+ return
+ lines.append(
+ f"{indent}closure={gate['closure_contract_kind']} "
+ f"complete={gate['closure_contract_complete']} "
+ f"provider={gate['provider_closure_count']}/{gate['closure_subject_count']} "
+ f"replacement={gate['replacement_deployment_count']}/{gate['closure_subject_count']} "
+ f"history_rewrite_blocking={gate['history_rewrite_blocking']}"
+ )
control_plane = report.get("control_plane", {})
if control_plane:
active_target = control_plane.get("active_target", {})
@@ -3380,6 +3643,7 @@ def render_pretty(report: dict[str, Any]) -> str:
f"repos={','.join(gate['repo_ids']) or '-'} "
f"lanes={','.join(gate['lane_ids']) or '-'}"
)
+ append_closure_summary(gate, indent=" ")
readiness = report.get("readiness", {})
overclosed_release_gates = readiness.get("overclosed_release_gates", [])
if overclosed_release_gates:
@@ -3434,6 +3698,7 @@ def render_pretty(report: dict[str, Any]) -> str:
f"subsystems={','.join(subsystem_ids) or '-'} "
f"repos={','.join(gate['repo_ids']) or '-'}"
)
+ append_closure_summary(gate, indent=" ")
current_target_workstreams = readiness.get("current_target_workstreams", [])
if current_target_workstreams:
lines.append("current_target_workstreams:")
@@ -3505,6 +3770,7 @@ def render_pretty(report: dict[str, Any]) -> str:
f"repos={','.join(gate['repo_ids']) or '-'} "
f"lanes={','.join(gate['lane_ids']) or '-'}"
)
+ append_closure_summary(gate, indent=" ")
if readiness.get("release_blockers"):
lines.append("release_blockers:")
for blocker in readiness["release_blockers"]:
@@ -3538,6 +3804,7 @@ def render_pretty(report: dict[str, Any]) -> str:
f"repos={','.join(gate['repo_ids']) or '-'} "
f"lanes={','.join(gate['lane_ids']) or '-'}"
)
+ append_closure_summary(gate, indent=" ")
if report.get("warnings"):
lines.append("warnings:")
for warning in report["warnings"]:
diff --git a/scripts/release_control/status_audit_test.py b/scripts/release_control/status_audit_test.py
index d50578c8e7..735223a4ee 100644
--- a/scripts/release_control/status_audit_test.py
+++ b/scripts/release_control/status_audit_test.py
@@ -156,6 +156,57 @@ def work_claim(
}
+def credential_containment_contract(
+ *,
+ subject_id: str = "REDACTED-01",
+ complete: bool = False,
+) -> dict[str, object]:
+ contract: dict[str, object] = {
+ "kind": "historical-credential-containment",
+ "subject_ids": [subject_id],
+ "provider_closure_records": [],
+ "replacement_deployment_records": [],
+ "history_rewrite": {
+ "blocking": False,
+ "status": "optional-after-containment",
+ },
+ }
+ if complete:
+ contract["provider_closure_records"] = [
+ {
+ "subject_id": subject_id,
+ "disposition": "revoked",
+ "recorded_at": "2026-08-08T09:00:00Z",
+ "verifier": "security-verifier",
+ "evidence": [
+ {
+ "repo": "pulse",
+ "path": "docs/provider-closure.md",
+ "kind": "file",
+ "evidence_tier": "production-observed",
+ }
+ ],
+ }
+ ]
+ contract["replacement_deployment_records"] = [
+ {
+ "subject_id": subject_id,
+ "disposition": "validated",
+ "recorded_at": "2026-08-08T09:15:00Z",
+ "verifier": "deployment-verifier",
+ "evidence": [
+ {
+ "repo": "pulse",
+ "path": "docs/replacement-validation.md",
+ "kind": "file",
+ "evidence_tier": "production-observed",
+ }
+ ],
+ }
+ ]
+ return contract
+
+
def non_completed_target_id(*preferred_ids: str) -> str:
candidate_ids = preferred_ids or ("v6-ga-promotion", "v6-product-lane-expansion")
for target_id in candidate_ids:
@@ -339,6 +390,32 @@ class StatusAuditTest(unittest.TestCase):
self.assertTrue(args.check)
self.assertTrue(args.staged)
+ def test_status_schema_types_fail_closed_credential_containment(self) -> None:
+ schema = status_audit.DEFAULT_STATUS_SCHEMA_CONTRACT["schema"]
+ definitions = schema["$defs"]
+ self.assertIn("owner-action", definitions["release_gate"]["properties"]["status"]["enum"])
+ self.assertEqual(
+ definitions["release_gate"]["properties"]["closure_contract"]["$ref"],
+ "#/$defs/release_gate_closure_contract",
+ )
+ closure = definitions["release_gate_closure_contract"]
+ self.assertEqual(
+ closure["properties"]["kind"]["const"], "historical-credential-containment"
+ )
+ self.assertEqual(
+ set(closure["required"]),
+ {
+ "kind",
+ "subject_ids",
+ "provider_closure_records",
+ "replacement_deployment_records",
+ "history_rewrite",
+ },
+ )
+ history_rewrite = definitions["credential_history_rewrite_posture"]["properties"]
+ self.assertIs(history_rewrite["blocking"]["const"], False)
+ self.assertEqual(history_rewrite["status"]["const"], "optional-after-containment")
+
def test_audit_status_payload_resolves_sibling_repos_from_linked_worktree(self) -> None:
with tempfile.TemporaryDirectory() as tmpdir:
workspace = Path(tmpdir) / "workspace"
@@ -591,6 +668,99 @@ class StatusAuditTest(unittest.TestCase):
)
self.assertEqual(report["readiness"]["current_target_workstreams"], [])
+ def test_rc_ready_gate_owner_action_blocks_prerelease(self) -> None:
+ with tempfile.TemporaryDirectory() as tmp:
+ pulse = Path(tmp) / "pulse"
+ pulse.mkdir()
+ write_file(pulse, "docs/lane-proof.md")
+ write_file(pulse, "docs/proof_test.go")
+ write_file(pulse, "docs/hybrid_test.go")
+
+ with mock.patch.dict(os.environ, {"PULSE_REPO_ROOT_PULSE": str(pulse)}, clear=False), mock.patch(
+ "status_audit.load_subsystem_rules",
+ return_value=[],
+ ):
+ report = audit_status_payload(base_payload(release_gate_status="owner-action"))
+
+ self.assertEqual(report["errors"], [])
+ self.assertTrue(report["summary"]["repo_ready"])
+ self.assertFalse(report["summary"]["rc_ready"])
+ self.assertFalse(report["summary"]["release_ready"])
+ self.assertEqual(report["release_gates"][0]["effective_status"], "owner-action")
+ self.assertIn(RC_RELEASE_GATES_BLOCKER, report["readiness"]["rc_blockers"])
+
+ def test_credential_containment_cannot_be_closed_by_prose_evidence_alone(self) -> None:
+ with tempfile.TemporaryDirectory() as tmp:
+ pulse = Path(tmp) / "pulse"
+ pulse.mkdir()
+ write_file(pulse, "docs/lane-proof.md")
+ write_file(pulse, "docs/proof_test.go")
+ write_file(pulse, "docs/hybrid_test.go")
+
+ payload = base_payload()
+ gate = payload["release_gates"][0]
+ gate["minimum_evidence_tier"] = "production-observed"
+ gate["evidence"][0]["evidence_tier"] = "production-observed"
+ gate["closure_contract"] = credential_containment_contract()
+
+ with mock.patch.dict(os.environ, {"PULSE_REPO_ROOT_PULSE": str(pulse)}, clear=False), mock.patch(
+ "status_audit.load_subsystem_rules",
+ return_value=[],
+ ):
+ report = audit_status_payload(payload)
+
+ self.assertEqual(report["errors"], [])
+ self.assertFalse(report["summary"]["rc_ready"])
+ self.assertFalse(report["summary"]["release_ready"])
+ credential_gate = report["release_gates"][0]
+ self.assertEqual(credential_gate["status"], "passed")
+ self.assertEqual(credential_gate["effective_status"], "closure-incomplete")
+ self.assertFalse(credential_gate["closure_contract_complete"])
+ self.assertEqual(credential_gate["closure_subject_count"], 1)
+ self.assertEqual(credential_gate["provider_closure_count"], 0)
+ self.assertEqual(credential_gate["replacement_deployment_count"], 0)
+ self.assertEqual(
+ credential_gate["missing_provider_closure_subject_ids"], ["REDACTED-01"]
+ )
+ self.assertEqual(
+ credential_gate["missing_replacement_deployment_subject_ids"], ["REDACTED-01"]
+ )
+ self.assertFalse(credential_gate["history_rewrite_blocking"])
+ pretty = render_pretty(report)
+ self.assertIn("effective=closure-incomplete", pretty)
+ self.assertIn("provider=0/1 replacement=0/1", pretty)
+ self.assertIn("history_rewrite_blocking=False", pretty)
+
+ def test_credential_containment_passes_only_with_complete_typed_evidence(self) -> None:
+ with tempfile.TemporaryDirectory() as tmp:
+ pulse = Path(tmp) / "pulse"
+ pulse.mkdir()
+ write_file(pulse, "docs/lane-proof.md")
+ write_file(pulse, "docs/proof_test.go")
+ write_file(pulse, "docs/hybrid_test.go")
+ write_file(pulse, "docs/provider-closure.md")
+ write_file(pulse, "docs/replacement-validation.md")
+
+ payload = base_payload()
+ gate = payload["release_gates"][0]
+ gate["minimum_evidence_tier"] = "production-observed"
+ gate["evidence"][0]["evidence_tier"] = "production-observed"
+ gate["closure_contract"] = credential_containment_contract(complete=True)
+
+ with mock.patch.dict(os.environ, {"PULSE_REPO_ROOT_PULSE": str(pulse)}, clear=False), mock.patch(
+ "status_audit.load_subsystem_rules",
+ return_value=[],
+ ):
+ report = audit_status_payload(payload)
+
+ self.assertEqual(report["errors"], [])
+ self.assertTrue(report["summary"]["rc_ready"])
+ credential_gate = report["release_gates"][0]
+ self.assertEqual(credential_gate["effective_status"], "passed")
+ self.assertTrue(credential_gate["closure_contract_complete"])
+ self.assertEqual(credential_gate["provider_closure_count"], 1)
+ self.assertEqual(credential_gate["replacement_deployment_count"], 1)
+
def test_release_ready_gate_pending_blocks_only_release_ready(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
pulse = Path(tmp) / "pulse"