← Back to Pull requests

test(#310): the boot guest reads its PCRs only after systemd-pcrphase measured ready, and says so #313

Merged
jobordu merged 3 files (38 lines) on Oct 04, 2026 01:44 UTC
View on GitHub
jobordu jobordu commented on Oct 04, 2026 01:29 UTC
Author

Closes #310. Root cause by regalia-kms-d9 (on #310): the guest's report unit could read PCR 11 before systemd-pcrphase.service measured ready. The printed value was exactly the initrd value extended by leave-initrd and sysinit, one phase short of the record's pcr11.system.

Changes:

  • e2e/lib/boot-guest/regalia-e2e-report.service: After=systemd-pcrphase.service. It's already in the transaction through sysinit.target, so this only orders and adds nothing. This is the fix.

  • Guard (regalia-kms-24): e2e-report prints REGALIA-E2E-PCRPHASE systemd-pcrphase.service=<ActiveState> <Result> before the PCRs. The test reads the PCR line only through booted_pcrs(), which fails with "the PCRs were read before systemd-pcrphase measured ready (#310)" unless the guest saw active success. If the race ever returns, it fails by name instead of as an unexplained PCR 11 mismatch.

  • No change to the image, the measurements, the record or any PCR assertion.
  • Checked locally: sh -n passes on the script. The helper accepts active success and refuses activating or a missing phase line. The module still skips without a guest. The QEMU run in CI is the real proof.

    Read by regalia-kms-d9 at b4d8893, nothing further. d9's blocker is fixed: systemctl show -p ActiveState,Result --value prints in systemd's own order, so the script now uses two -P calls. The guard raises instead of asserting, and the docstring says it checks ordering only.

    🤖 Generated with Claude Code

    Diff: 38 lines (+31 / -7) across 3 files Reviewer: copilot-pull-request-reviewer[bot] Review duration: 15m
    All Vouch review confidence checks passed
    Residual risk 0.07 = Change Risk (0.28) × (1 − Review Confidence (0.74)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.28 · 38 lines diff across 3 files
    0.28
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.57 · 2 substantive comment(s)
    0.57
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    73%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.219
    Real PR Conversation Timeline
    7 items
    coderabbitai[bot] coderabbitai[bot] commented on Oct 04, 2026 01:29 UTC
    Bot

    <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
    <!-- This is an auto-generated comment: rate limited by coderabbit.ai -->

    [!WARNING]

    ## Review limit reached

    > You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

    > Next included review available in 48 minutes.

    > Check out review usage here.

    > <details>

    <summary>View limit details</summary>

    > Limit details: You’ve used the included review currently available.

    > Learn how review limits work.

    > Review configuration:

    > <details>

    <summary>⚙️ Run configuration</summary>

    > - Configuration used: defaults

    - Review profile: CHILL

    - Plan: Advanced

    - Run ID: 78bdac51-18be-4689-8949-6530601e018a

    > </details>

    > <details>

    <summary>📥 Commits</summary>

    > Reviewing files that changed from the base of the PR and between 635e187df72efdc1b4972ef2afce76bae192ddb1 and b4d88939df39353e97461f45f80f7b75ab8efde3.

    > </details>

    > <details>

    <summary>📒 Files selected for processing (3)</summary>

    > e2e/lib/boot-guest/e2e-report

    e2e/lib/boot-guest/regalia-e2e-report.service

    * tests/test_baremetal_unlock_boot.py

    > </details>

    > </details>

    <!-- end of auto-generated comment: rate limited by coderabbit.ai -->

    <!-- autopilot:start -->

  • <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autopilot</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

  • <!-- autopilot:end -->
    <!-- tips_start -->

    ---

    Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

    <details>
    <summary>❤️ Share</summary>

  • X

  • Mastodon

  • Reddit

  • LinkedIn
  • </details>

    <sub>Comment @coderabbitai help to get the list of available commands.</sub>

    <!-- tips_end -->

    gitar-bot[bot] gitar-bot[bot] commented on Oct 04, 2026 01:29 UTC
    Bot

    <kbd><img src="https://raw.githubusercontent.com/gitarcode/.github/main/assets/gitar-spin.svg" align="texttop" height="14"> Gitar is working</kbd>

    <sub>Gitar</sub>

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Oct 04, 2026 01:29 UTC
    Reviewer

    Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Oct 04, 2026 01:31 UTC
    Reviewer

    Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

    sentinel-by-digital-frontier[bot] sentinel-by-digital-frontier[bot] approved these changes on Oct 04, 2026 01:33 UTC
    Approved Reviewer

    🛡️ Sentinel review — clean. No findings on changed lines.

    <!-- sentinel-pr-review engine=4f28185e72a56658a0a5c68cead30c12f60eea85-main -->
    <!-- sentinel:scan-report -->
    <details><summary>📊 Scan report — every finding in the changed files, ranked, plus the scan summary</summary>

    🛡️ Sentinel PR review

    3 file(s) changed · 0 introduced by this diff (secrets+SAST) · dependencies unchanged — SCA/CVE not re-scanned. _Advisory — the fail-closed gate is the post-merge pentest._

    Findings — ranked by criticality

    _No issues found on the changed surface._

    🤖 Code review (Flynn)

    No issues found.

    <details><summary>Scan summary</summary>

    | Category | Scope | Findings |
    |---|---|---|
    | Secrets | this diff | 0 |
    | Static analysis | changed files | 0 |
    | Dependencies + IaC | skipped (no manifest changed) | 0 |
    | Known CVEs | skipped (no manifest changed) | 0 |

    </details>

    </details>

    sentinel-by-digital-frontier[bot] sentinel-by-digital-frontier[bot] approved these changes on Oct 04, 2026 01:33 UTC
    Approved Reviewer

    🛡️ Sentinel review — clean. No findings on changed lines.

    <!-- sentinel-pr-review engine=4f28185e72a56658a0a5c68cead30c12f60eea85-main -->
    <!-- sentinel:scan-report -->
    <details><summary>📊 Scan report — every finding in the changed files, ranked, plus the scan summary</summary>

    🛡️ Sentinel PR review

    3 file(s) changed · 0 introduced by this diff (secrets+SAST) · dependencies unchanged — SCA/CVE not re-scanned. _Advisory — the fail-closed gate is the post-merge pentest._

    Findings — ranked by criticality

    _No issues found on the changed surface._

    🤖 Code review (Flynn)

    No issues found.

    <details><summary>Scan summary</summary>

    | Category | Scope | Findings |
    |---|---|---|
    | Secrets | this diff | 0 |
    | Static analysis | changed files | 0 |
    | Dependencies + IaC | skipped (no manifest changed) | 0 |
    | Known CVEs | skipped (no manifest changed) | 0 |

    </details>

    </details>

    Assignees
    jobordu jobordu
    Labels
    risk: low confidence: 74.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 27.8% (LOW) · Higher = larger blast radius
    27.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 74.0% · Lower = rushed or shallow review
    74.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 7.2% · Safe to merge
    7.2%