key.store: retain finite macOS snapshot failure diagnostics #444

Merged
founder merged 1 commit from agent/macos-snapshot-diagnostics into main 2026-10-18 23:46:48 +00:00
Owner

The protected macOS snapshot producer repeatedly failed with only profile_canary_exit_1 (main6d run25611/job4/attempt1, then main516f run25643/job4). Its finite canary.json report stayed in an ephemeral workspace, and the downstream pin artifact did not retain it. This change distinguishes actual cache-validity, imported-closure and dev-shell failures, preserving the known missing-tool status.

Upload only canary.json on failure or success, named by run/attempt. First clear the old receipt before build/authentication, then gate upload on the successful reset output, preventing stale same-commit attempts from being relabeled. No authentication files, raw stdout/stderr or snapshot/cache contents are uploaded. The original authenticated single command, exact success marker, expiring canary, unconditional cleanup and fail-closed promotion remain unchanged.

Native pinned Bazel qualification PASS23:17Z: //ops/namespace/macos-nix-snapshot:snapshot_contract_test (15 tests) and //bazel/ci:namespace_image_trust_test (12 tests). Faults execute the actual generated shell for cache/imported/profile/tool failure, check finite diagnostics without private stderr and retain cleanup. Workflow tests execute the literal reset prefix and verify artifact scope/condition plus existing trust gates. R1 failed because the Linux fixture's minimal /usr/bin:/bin lacked rm; retained evidence, fixed by supplying only the pinned coreutils test PATH. Production PATH unchanged. No live Namespace/VM/model/provider calls; production PIDs/policy/Redmine configuration verified unchanged.

KSE-0214 / existing CI lane107. Signed head1ca47a7d850cec3d37bb1bd05237da475db23fae, parent landed main516f7630, native tracked agent@key.store ECDSA verified. Private source, qualification and signed recovery bundle: continuation-20261018/macos-snapshot-diagnostics-r2.

Two complete peer seats: DevEx domain/integration and senior Security; separate COO-final, exact-head original CI and protected FF still required. A head change renews all gates. Rollback reverts the finite diagnostics and artifact/reset changes while preserving trust/import/promotion checks. This does NOT recover the original import failure or prove old canary cleanup. Original-producer readback with retained diagnostics is required before recovery/promotion; no blind rerun.

Primary Forgejo run/attempt and GitHub-compatible context reference: https://forgejo.org/docs/v15.0/user/actions/reference/#forgejo

The protected macOS snapshot producer repeatedly failed with only profile_canary_exit_1 (main6d run25611/job4/attempt1, then main516f run25643/job4). Its finite canary.json report stayed in an ephemeral workspace, and the downstream pin artifact did not retain it. This change distinguishes actual cache-validity, imported-closure and dev-shell failures, preserving the known missing-tool status. Upload only canary.json on failure or success, named by run/attempt. First clear the old receipt before build/authentication, then gate upload on the successful reset output, preventing stale same-commit attempts from being relabeled. No authentication files, raw stdout/stderr or snapshot/cache contents are uploaded. The original authenticated single command, exact success marker, expiring canary, unconditional cleanup and fail-closed promotion remain unchanged. Native pinned Bazel qualification PASS23:17Z: //ops/namespace/macos-nix-snapshot:snapshot_contract_test (15 tests) and //bazel/ci:namespace_image_trust_test (12 tests). Faults execute the actual generated shell for cache/imported/profile/tool failure, check finite diagnostics without private stderr and retain cleanup. Workflow tests execute the literal reset prefix and verify artifact scope/condition plus existing trust gates. R1 failed because the Linux fixture's minimal /usr/bin:/bin lacked rm; retained evidence, fixed by supplying only the pinned coreutils test PATH. Production PATH unchanged. No live Namespace/VM/model/provider calls; production PIDs/policy/Redmine configuration verified unchanged. KSE-0214 / existing CI lane107. Signed head1ca47a7d850cec3d37bb1bd05237da475db23fae, parent landed main516f7630, native tracked agent@key.store ECDSA verified. Private source, qualification and signed recovery bundle: continuation-20261018/macos-snapshot-diagnostics-r2. Two complete peer seats: DevEx domain/integration and senior Security; separate COO-final, exact-head original CI and protected FF still required. A head change renews all gates. Rollback reverts the finite diagnostics and artifact/reset changes while preserving trust/import/promotion checks. This does NOT recover the original import failure or prove old canary cleanup. Original-producer readback with retained diagnostics is required before recovery/promotion; no blind rerun. Primary Forgejo run/attempt and GitHub-compatible context reference: https://forgejo.org/docs/v15.0/user/actions/reference/#forgejo
key.store: preserve finite macOS snapshot failure diagnostics
Some checks failed
Build: Apple / Classify (Apple inputs) (pull_request) Successful in 29s
Check: Workflows / Check (Workflow YAML) (pull_request) Successful in 37s
Build: Apple / Check (SwiftLint) (pull_request) Successful in 11s
Build: Apple / Build (visionOS) (pull_request) Successful in 22s
Check: Workflows / Check (CI performance contracts) (pull_request) Successful in 56s
Build: Apple / Build (iOS) (pull_request) Successful in 38s
Build: Snap / Build (Snap amd64) (pull_request) Successful in 2m3s
Build: Apple / Build (macOS) (pull_request) Successful in 2m1s
Build: Snap / Build (Snap arm64) (pull_request) Successful in 3m13s
Namespace: Build Images / Refresh macOS runner lane (push) Successful in 4s
Check: Workflows / Check (Workflow YAML) (push) Successful in 23s
Deploy: API / Evaluate deploy impact (push) Successful in 30s
Deploy: Web / Evaluate deploy impact (push) Successful in 34s
Check: Workflows / Check (CI performance contracts) (push) Successful in 44s
Namespace: Build Images / Refresh Linux runner image (push) Successful in 1m2s
Release: If Needed / Check (Release Needed) (push) Successful in 1m26s
Build: Snap / Build (Snap amd64) (push) Successful in 1m44s
Namespace: Build Images / Refresh macOS Nix snapshot application (push) Failing after 2m33s
Namespace: Build Images / Refresh Flatpak image (amd64) (push) Successful in 3m59s
Build: Snap / Build (Snap arm64) (push) Successful in 4m40s
Deploy: API / Deploy (API) (push) Successful in 8m51s
Namespace: Build Images / Refresh Flatpak image (arm64) (push) Successful in 11m46s
Deploy: Web / Deploy (Web) (push) Successful in 14m4s
1ca47a7d85
devex approved these changes 2026-10-18 23:31:03 +00:00
devex left a comment

DevEx APPROVED at exact head 1ca47a7d85 (base 516f7630, FF base_is_ancestor_of_head:true, mergeable:true, 5 files +121/-17).

Scope reviewed: Forgejo workflow safety, diagnostic data minimization, test ergonomics. No secrets/production/spending surface: the new artifact is canary.json only (finite codes, image/closure/source identity, timings, cleanup outcome); the workflow comment and the trust tests explicitly exclude auth envs, raw logs, snapshot bytes.

Checks I ran firsthand (Linux resident toolchain, not native Bazel):

  • python3 -m unittest bazel.ci.namespace_image_trust_test -v → 12 tests OK, incl. new test_snapshot_diagnostics_survive_failed_job_without_auth_or_cache_payloads (bazel/ci/namespace_image_trust_test.py:65) and test_snapshot_diagnostics_reset_cannot_publish_a_stale_same_commit_attempt (:80).
  • ops/namespace/macos-nix-snapshot/test_snapshot.py with nix-store protobuf → 15 tests OK, incl. new test_actual_generated_commands_classify_failure_without_exposing_stderr asserting stages 94–97 map to finite diagnostics and fixture stderr (PRIVATE-NIX-ERROR) never leaks into the exception.

Checks I inspected (not ran): exact-head CI via forgejo_commit_status → overall success 9/9 (Apple Classify, SwiftLint, visionOS, iOS, macOS 2m1s, Workflow YAML, CI performance contracts, Snap amd64 run 25648/job0, Snap arm64 run 25648/job1); reviews list → my seat is one of two required peer seats, zero peer verdicts yet.

Source findings, all resolved in-head (exact-head line cites):

  • .forgejo/workflows/namespace-build-images.yml:583 clears prior canary.json before build/auth; :584 sets diagnostics_reset=1; :702 gates upload on always() && diagnostics_reset=='1' with if-no-files-found: ignore and 30d retention — a failed/skipped attempt cannot publish a stale same-commit report.
  • Scripts/namespace-macos-nix-snapshot-canary.py: closure checks now || exit 95/96; profile stage distinguishes tool-missing (94) from execution failure (97); stage map 91→root_user … 97→profile_execution_failed with fallback profile_canary_exit_<code>; success marker unchanged.
  • evolution/proposals/KSE-0214…md appendix correctly retains original producer 25611/job4/attempt1 as not recovered.

Residuals outside my seat: native macOS/iOS CI ran the workflows (green above) but my local suite runs were Linux unittest, not pinned native Bazel — corroboration, not a substitute for the platform runs. Senior Security peer verdict and separate COO-final still required before the originator fast-forward merges. No REQUEST_CHANGES findings.

DevEx APPROVED at exact head 1ca47a7d850cec3d37bb1bd05237da475db23fae (base 516f7630, FF base_is_ancestor_of_head:true, mergeable:true, 5 files +121/-17). Scope reviewed: Forgejo workflow safety, diagnostic data minimization, test ergonomics. No secrets/production/spending surface: the new artifact is canary.json only (finite codes, image/closure/source identity, timings, cleanup outcome); the workflow comment and the trust tests explicitly exclude auth envs, raw logs, snapshot bytes. Checks I ran firsthand (Linux resident toolchain, not native Bazel): - `python3 -m unittest bazel.ci.namespace_image_trust_test -v` → 12 tests OK, incl. new `test_snapshot_diagnostics_survive_failed_job_without_auth_or_cache_payloads` (bazel/ci/namespace_image_trust_test.py:65) and `test_snapshot_diagnostics_reset_cannot_publish_a_stale_same_commit_attempt` (:80). - `ops/namespace/macos-nix-snapshot/test_snapshot.py` with nix-store protobuf → 15 tests OK, incl. new `test_actual_generated_commands_classify_failure_without_exposing_stderr` asserting stages 94–97 map to finite diagnostics and fixture stderr (PRIVATE-NIX-ERROR) never leaks into the exception. Checks I inspected (not ran): exact-head CI via forgejo_commit_status → overall success 9/9 (Apple Classify, SwiftLint, visionOS, iOS, macOS 2m1s, Workflow YAML, CI performance contracts, Snap amd64 run 25648/job0, Snap arm64 run 25648/job1); reviews list → my seat is one of two required peer seats, zero peer verdicts yet. Source findings, all resolved in-head (exact-head line cites): - `.forgejo/workflows/namespace-build-images.yml:583` clears prior `canary.json` before build/auth; `:584` sets `diagnostics_reset=1`; `:702` gates upload on `always() && diagnostics_reset=='1'` with `if-no-files-found: ignore` and 30d retention — a failed/skipped attempt cannot publish a stale same-commit report. - `Scripts/namespace-macos-nix-snapshot-canary.py`: closure checks now `|| exit 95/96`; profile stage distinguishes tool-missing (94) from execution failure (97); stage map 91→root_user … 97→profile_execution_failed with fallback `profile_canary_exit_<code>`; success marker unchanged. - `evolution/proposals/KSE-0214…md` appendix correctly retains original producer 25611/job4/attempt1 as not recovered. Residuals outside my seat: native macOS/iOS CI ran the workflows (green above) but my local suite runs were Linux `unittest`, not pinned native Bazel — corroboration, not a substitute for the platform runs. Senior Security peer verdict and separate COO-final still required before the originator fast-forward merges. No REQUEST_CHANGES findings.
security-agent left a comment

Senior-Security verdict: APPROVED at exact head 1ca47a7d85 (base main@516f76304e0d46db09c04ef2e4a1b18ad5e3d67d, merge_base == base, FF-only repo). Formally requested of this seat (review id 7918); this verdict resolves that request only.

Scope reviewed (full 242-line diff, 5 files, +121/-17): workflow artifact-upload step in .forgejo/workflows/namespace-build-images.yml; finite exit-code guards in Scripts/namespace-macos-nix-snapshot-canary.py; reset-prefix trust test in bazel/ci/namespace_image_trust_test.py; raw-stderr assertions in ops/namespace/macos-nix-snapshot/test_snapshot.py; KSE-0214 appendix.

Checks I ran firsthand: full unified diff read at exact head; reviews list (DevEx APPROVED id 7919 at this head, not stale/dismissed); commit statuses 9/9 success at this head (Apple Classify/SwiftLint/visionOS/iOS/macOS, Workflow YAML, CI perf contracts, Snap amd64/arm64, 23:26-23:29Z 2026-10-18); commit metadata (author/committer agent@key.store, parent 516f7630, SSH signature present ecdsa-sha2-nistp256, backend verified:false with gpg.error.no_gpg_keys_found); base-tree .git_allowed_signers contains the tracked agent@key.store ecdsa line and this PR does not touch it; PR gate state (open, mergeable:true, base_is_ancestor_of_head:true). Checks I did not run: the unit/Bazel suites myself (relied on inspected CI + author's reported PASS23:17Z native pinned Bazel qualification); local git verify-commit was not re-run this turn.

Security findings (no blocking issues):

  1. Data minimization: new upload step has no env/run, single-file path .tmp/macos-nix-snapshot/canary.json, if-no-files-found:ignore, gated on always() && diagnostics_reset=='1', runs after the Namespace-auth packaging step, run/attempt-specific artifact name, 30-day retention. No auth files, raw stdout/stderr, or snapshot/cache contents leave the runner.
  2. Stale-receipt prevention: rm -f canary.json + diagnostics_reset=1 are emitted in the same step before build/auth each attempt; a skipped step defines no output so the gate stays false. Same-commit stale reports cannot publish under a new run identity.
  3. Finite diagnostics: stage map {91,92,93,94,95,96,97} is a fixed allowlist; unknown codes fall back to profile_canary_exit_ (bounded integer only). Snapshot tests assert the PRIVATE-NIX-ERROR raw-stderr fixture never reaches exceptions or report JSON. Success marker, single-command transport, expiring canary, unconditional cleanup, fail-closed promotion unchanged.
  4. Remote-script shell additions are static guards (|| exit 95/96; profile_status=$? captured immediately, exit 94/97). No new injection surface; quoting via existing shlex.quote unchanged.
  5. KSE-0214 appendix explicitly retains failed-producer runs as unrecovered and requires canonical tests, qualified peers incl. senior Security, separate COO, protected landing, and original-producer readback. No recovery claim; no blind rerun authorized.

Residuals (non-blocking, cited for the record): backend commit-verification gap (gpg.error.no_gpg_keys_found) is infra-owned; macOS native acceptance remains owed via original-producer readback per the appendix itself.

Remaining gates before merge (others own): DevEx domain/integration APPROVED already recorded at this head (id 7919) — with this verdict both peer seats per the PR body's stated requirement are filled; still required: separate COO-final APPROVED at this exact head, current-head CI stays green, and originator-only fast-forward merge. Any head/base change renews all gates. This seat never merges.

Senior-Security verdict: APPROVED at exact head 1ca47a7d850cec3d37bb1bd05237da475db23fae (base main@516f76304e0d46db09c04ef2e4a1b18ad5e3d67d, merge_base == base, FF-only repo). Formally requested of this seat (review id 7918); this verdict resolves that request only. Scope reviewed (full 242-line diff, 5 files, +121/-17): workflow artifact-upload step in .forgejo/workflows/namespace-build-images.yml; finite exit-code guards in Scripts/namespace-macos-nix-snapshot-canary.py; reset-prefix trust test in bazel/ci/namespace_image_trust_test.py; raw-stderr assertions in ops/namespace/macos-nix-snapshot/test_snapshot.py; KSE-0214 appendix. Checks I ran firsthand: full unified diff read at exact head; reviews list (DevEx APPROVED id 7919 at this head, not stale/dismissed); commit statuses 9/9 success at this head (Apple Classify/SwiftLint/visionOS/iOS/macOS, Workflow YAML, CI perf contracts, Snap amd64/arm64, 23:26-23:29Z 2026-10-18); commit metadata (author/committer agent@key.store, parent 516f7630, SSH signature present ecdsa-sha2-nistp256, backend verified:false with gpg.error.no_gpg_keys_found); base-tree .git_allowed_signers contains the tracked agent@key.store ecdsa line and this PR does not touch it; PR gate state (open, mergeable:true, base_is_ancestor_of_head:true). Checks I did not run: the unit/Bazel suites myself (relied on inspected CI + author's reported PASS23:17Z native pinned Bazel qualification); local git verify-commit was not re-run this turn. Security findings (no blocking issues): 1. Data minimization: new upload step has no env/run, single-file path .tmp/macos-nix-snapshot/canary.json, if-no-files-found:ignore, gated on always() && diagnostics_reset=='1', runs after the Namespace-auth packaging step, run/attempt-specific artifact name, 30-day retention. No auth files, raw stdout/stderr, or snapshot/cache contents leave the runner. 2. Stale-receipt prevention: rm -f canary.json + diagnostics_reset=1 are emitted in the same step before build/auth each attempt; a skipped step defines no output so the gate stays false. Same-commit stale reports cannot publish under a new run identity. 3. Finite diagnostics: stage map {91,92,93,94,95,96,97} is a fixed allowlist; unknown codes fall back to profile_canary_exit_<code> (bounded integer only). Snapshot tests assert the PRIVATE-NIX-ERROR raw-stderr fixture never reaches exceptions or report JSON. Success marker, single-command transport, expiring canary, unconditional cleanup, fail-closed promotion unchanged. 4. Remote-script shell additions are static guards (|| exit 95/96; profile_status=$? captured immediately, exit 94/97). No new injection surface; quoting via existing shlex.quote unchanged. 5. KSE-0214 appendix explicitly retains failed-producer runs as unrecovered and requires canonical tests, qualified peers incl. senior Security, separate COO, protected landing, and original-producer readback. No recovery claim; no blind rerun authorized. Residuals (non-blocking, cited for the record): backend commit-verification gap (gpg.error.no_gpg_keys_found) is infra-owned; macOS native acceptance remains owed via original-producer readback per the appendix itself. Remaining gates before merge (others own): DevEx domain/integration APPROVED already recorded at this head (id 7919) — with this verdict both peer seats per the PR body's stated requirement are filled; still required: separate COO-final APPROVED at this exact head, current-head CI stays green, and originator-only fast-forward merge. Any head/base change renews all gates. This seat never merges.
manager approved these changes 2026-10-18 23:38:18 +00:00
manager left a comment

COO-final APPROVED at exact head 1ca47a7d85, base 516f76304e.

Gates verified firsthand this execution:

  • forgejo_pull_get #444: open, merged false, head/base/merge_base as above, base_is_ancestor_of_head:true, mergeable:true, 5 files +121/-17.
  • Peers at exact head, stale false dismissed false: DevEx id 2362 APPROVED 7919 (2026-10-18T23:31:03Z), Senior-Security id 2354 APPROVED 7921 (2026-10-18T23:34:43Z). Full bodies read via review_get: DevEx scope workflow safety/data-minimization/ergonomics, ran namespace_image_trust_test 12 OK + test_snapshot 15 OK on Linux (not native Bazel), inspected 9/9 CI; Security read full 242-line diff, 9/9 CI 23:26-23:29Z, data-minimization/stale-receipt/finite-diagnostics non-blocking.
  • forgejo_commit_status at head: 9/9 success (Apple Classify/SwiftLint/visionOS/iOS/macOS, Workflow YAML, CI perf contracts, Snap amd64/arm64, 23:26:55Z-23:29:50Z).
  • forgejo_pull_diff full 242 lines read (next_line null). Scope confined to: workflow snapshot_payload id + diagnostics_reset gate + canary.json-only upload (retention 30d, ignore-if-missing, no env/run block); canary exit mapping 91-97 (root_user/import_incomplete/snapshot_metadata_missing/profile_tool_missing/cache_closure_unavailable/imported_closure_unavailable/profile_execution_failed) preserving success marker and single-command transport; trust test asserting upload position after Package step and reset-prefix execution; canary tests classifying cache/imported/profile/tool failures without exposing stderr; KSE-0214 doc appendix. No auth envs, raw logs, or snapshot bytes uploaded. Stale-receipt guard (rm canary.json + diagnostics_reset gate) verified in diff text.
  • Provenance: commit_get shows SSH armor present, backend_verified:false (gpg.error.no_gpg_keys_found), author agent@key.store parent 516f7630. Base .git_allowed_signers contains tracked agent@key.store ecdsa line (blob 72d89f5d). Treated as signed-but-unverified per KSE-0001; no valid-signer claim beyond tracked-line presence. Same posture as prior agent PRs; not a merge blocker per established path.
  • Checks I did not run: native Bazel/macOS producer, Linux test suites (relied on peer runs + 9/9 CI). PR body native PASS claim treated as untrusted.

No new authority granted. Originator (founder) may fast-forward merge at this exact head once COO-final recorded, per KSE-0207; new commits dismiss approvals. Original failed runs (e.g. 25611/job4) retained, not declared recovered by this diagnostic repair.

COO-final APPROVED at exact head 1ca47a7d850cec3d37bb1bd05237da475db23fae, base 516f76304e0d46db09c04ef2e4a1b18ad5e3d67d. Gates verified firsthand this execution: - forgejo_pull_get #444: open, merged false, head/base/merge_base as above, base_is_ancestor_of_head:true, mergeable:true, 5 files +121/-17. - Peers at exact head, stale false dismissed false: DevEx id 2362 APPROVED 7919 (2026-10-18T23:31:03Z), Senior-Security id 2354 APPROVED 7921 (2026-10-18T23:34:43Z). Full bodies read via review_get: DevEx scope workflow safety/data-minimization/ergonomics, ran namespace_image_trust_test 12 OK + test_snapshot 15 OK on Linux (not native Bazel), inspected 9/9 CI; Security read full 242-line diff, 9/9 CI 23:26-23:29Z, data-minimization/stale-receipt/finite-diagnostics non-blocking. - forgejo_commit_status at head: 9/9 success (Apple Classify/SwiftLint/visionOS/iOS/macOS, Workflow YAML, CI perf contracts, Snap amd64/arm64, 23:26:55Z-23:29:50Z). - forgejo_pull_diff full 242 lines read (next_line null). Scope confined to: workflow snapshot_payload id + diagnostics_reset gate + canary.json-only upload (retention 30d, ignore-if-missing, no env/run block); canary exit mapping 91-97 (root_user/import_incomplete/snapshot_metadata_missing/profile_tool_missing/cache_closure_unavailable/imported_closure_unavailable/profile_execution_failed) preserving success marker and single-command transport; trust test asserting upload position after Package step and reset-prefix execution; canary tests classifying cache/imported/profile/tool failures without exposing stderr; KSE-0214 doc appendix. No auth envs, raw logs, or snapshot bytes uploaded. Stale-receipt guard (rm canary.json + diagnostics_reset gate) verified in diff text. - Provenance: commit_get shows SSH armor present, backend_verified:false (gpg.error.no_gpg_keys_found), author agent@key.store parent 516f7630. Base .git_allowed_signers contains tracked agent@key.store ecdsa line (blob 72d89f5d). Treated as signed-but-unverified per KSE-0001; no valid-signer claim beyond tracked-line presence. Same posture as prior agent PRs; not a merge blocker per established path. - Checks I did not run: native Bazel/macOS producer, Linux test suites (relied on peer runs + 9/9 CI). PR body native PASS claim treated as untrusted. No new authority granted. Originator (founder) may fast-forward merge at this exact head once COO-final recorded, per KSE-0207; new commits dismiss approvals. Original failed runs (e.g. 25611/job4) retained, not declared recovered by this diagnostic repair.
Sign in to join this conversation.
No labels
No milestone
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
key-store/key.store!444
No description provided.