Skip to content

docs(roadmap): B4 milestone closure trio (business + security + performance) + master-review remediation verification#33

Merged
cemililik merged 3 commits into
mainfrom
b4-closure-trio
May 29, 2026
Merged

docs(roadmap): B4 milestone closure trio (business + security + performance) + master-review remediation verification#33
cemililik merged 3 commits into
mainfrom
b4-closure-trio

Conversation

@cemililik
Copy link
Copy Markdown
Collaborator

@cemililik cemililik commented May 29, 2026

B4 milestone closure trio

Closes the B4 (Task loader) milestone: implementation-complete (T-019, 2026-05-16, PR #31; ADR-0029 Accepted 2026-05-14, PR #30) → Closed, via the standard closure trio modelled on the 2026-05-14 B3 closure.

Artifacts

  • Business retrospectivedocs/analysis/reviews/business-reviews/2026-05-28-B4-closure.md
  • Consolidated security reviewdocs/analysis/reviews/security-reviews/2026-05-28-B4-closure.mdverdict: Approve (eight axes pass)
  • Performance baselinedocs/analysis/reviews/performance-optimization-reviews/2026-05-28-B4-closure.md (re-baseline) + docs/analysis/reports/perf-baseline-2026-05-28-B4-closure.md

Master-review remediation verification

The period included the 2026-05-22 full-tree master review (APPROVE the shipped kernel; issues clustered in CI/doc/ADR — 0 kernel-correctness/security Blockers) and its remediation PR #32. All 24 Blocker+Major findings were re-verified adversarially against the live tree: 23 confirmed-fixed, 1 partial (MR-009). MR-009 is now fully closed in-branchphase-b.md gains a "Miri green = Phase-B exit prerequisite" note (the CI-gate half was already in PR #32).

Closing metrics (reproduced live, HEAD 3ab029f, pinned nightly)

Gate Result
cargo host-test 286 / 286 (43 hal + 187 kernel + 53 test-hal + 3 doc-tests)
fmt / host-clippy / kernel-clippy / kernel-build clean
QEMU smoke full demo → tyrne: all tasks complete; -d int,unimp,guest_errors 629 events (100 % pre-existing PL011 noise, zero fault classes)
Release perf band p10/p50/p90 15.641 / 17.587 / 19.150 ms (+5.3–5.7 ms vs B3 — one-time loader boot cost under QEMU TCG; real-hardware projection ~40 µs)
Audit log 28 entries (UNSAFE-2026-0027 + 0028 added; 0025/0026 Pending QEMU smoke verification notes lifted by T-019)

Side-effects (per the conduct-review skill)

  • current.md → B4 Closed, active milestone B5, test count 260 → 286, trio added to Last reviews.
  • 3 review-type README indexes updated; perf-baseline report added.

Correctly deferred (not left behind)

B5 (ADR-0030 syscall ABI + ADR-0031 initial syscall set) is the next milestone (maintainer-sequenced). Trigger-deferred carry-forwards — B5+ MemoryRegion cap, PL011 init BSP task, BSP host-test crate, ADR-0033/0034 placeholders — remain open with their unfired triggers (documented in the business retro §Adjustments).

Docs-only changeset; 305 / 305 relative links verified resolving.

🤖 Generated with Claude Code

Summary by Sourcery

Close the B4 task-loader milestone via its full business, security, and performance closure trio, record the associated master-review remediation status and metrics, and advance the roadmap and documentation toward the B5 syscall boundary work.

Documentation:

  • Document the B4 closure business retrospective, consolidated security review, and performance baseline, including a new perf report and updates to review indexes.
  • Update the roadmap to mark B4 as Closed, B5 as the next active milestone, capture final B4 metrics, and codify Miri as a Phase-B exit prerequisite.
  • Record the 2026-05-22 full-tree master review and its remediation outcome in the roadmap’s recent reviews section.

Summary by CodeRabbit

  • Documentation
    • B4 milestone (task loader) formally closed with a business retrospective, approved security review, and performance baselines
    • Canonical boot-time and kernel image-size baselines added for regression tracking
    • Roadmap updated: B4 closed, B5 (syscall boundary) now active
    • Phase B exit-quality prerequisite: Miri host-test run required before milestone exit
    • Phase A milestones A4/A6 marked completed; small docs and README indices updated
    • CI workflow comments clarified runtime expectations

Review Change Stack

…view remediation

B4 (Task loader) flips implementation-complete -> Closed via the closure
trio (business retrospective + consolidated security review [Approve] +
performance baseline), modelled on the 2026-05-14 B3 closure. T-019 merged
2026-05-16 (PR #31); ADR-0029 Accepted 2026-05-14 (PR #30).

The period under review included the 2026-05-22 full-tree master review
(verdict: APPROVE the shipped kernel -- 0 code-correctness/security
Blockers; issues clustered in CI/doc/ADR) and its remediation PR #32.
All 24 Blocker+Major findings were re-verified adversarially against the
live tree: 23 confirmed-fixed, 1 partial (MR-009). MR-009 is now fully
closed in-branch -- phase-b.md gains a "Miri green = Phase-B exit
prerequisite" note (the CI-gate half was already done by PR #32).

Closing metrics (reproduced live, HEAD 3ab029f, pinned nightly):
- cargo host-test 286/286 (43 hal + 187 kernel + 53 test-hal + 3 doc-tests;
  was 260 at the T-019 merge, +26 from PR #32); fmt/clippy/kernel-build clean.
- QEMU smoke runs the full demo through "tyrne: all tasks complete" with the
  new "tyrne: image loaded (...)" line; -d int,unimp,guest_errors = 629
  events, 100% pre-existing PL011 noise, zero fault classes.
- Release perf band p10/p50/p90 = 15.641/17.587/19.150 ms (+5.3-5.7 ms vs B3
  -- one-time boot cost of the loader's first post-bootstrap cap_map walks
  under QEMU TCG; real-hardware projection ~40 us).
- Audit log 28 entries (UNSAFE-2026-0027 + 0028 added; 0025/0026
  Pending-smoke notes lifted by T-019).

Side-effects: current.md refreshed (B4 Closed, milestone -> B5, 260->286,
trio in Last reviews); 3 review-type README indexes updated; perf-baseline
report added. Next milestone: B5 (syscall boundary) -- ADR-0030 + ADR-0031.

Refs: ADR-0013, ADR-0029, ADR-0036

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 29, 2026

Reviewer's Guide

Documents-only PR to close milestone B4 (Task loader) by adding its closure trio artefacts (business, security, performance), updating roadmap state and phase-B exit criteria, and wiring the new reviews into the various indexes and perf-reporting docs, including fixing test-count drift and codifying Miri as a Phase-B exit prerequisite.

File-Level Changes

Change Details Files
Update roadmap current-status file to mark B4 Closed, promote B5 as the active milestone, and incorporate master-review and closure-trio metrics and pointers.
  • Add a new 2026-05-28 top banner that describes B4 closure via its business, security, and performance reviews and summarizes master-review context, gates, perf band, audit-log entries, and next-steps
  • Change the Active milestone/task/working-branch/last-milestone/next-task/next-review sections to indicate B4 is closed, B5 (syscall boundary) is next, and there are currently no active tasks or in-review PRs
  • Refresh closing metrics in the Last completed milestone section to use the closure-trio source of truth (286 tests, 629 QEMU events, perf band, audit-log count) instead of the earlier 260-test implementation-complete snapshot
  • Extend the Last reviews list with links and summaries for the B4 business/security/perf closure docs and the 2026-05-22 full-tree master review
docs/roadmap/current.md
Tighten Phase-B exit criteria by explicitly making a green Miri run a Phase-B exit prerequisite in addition to being a CI gate.
  • Add a short paragraph to the Phase B overview stating that a green cargo +nightly miri test run over the host-test suite is a Phase-B exit prerequisite, with emphasis on scheduler and IPC code and reference to the relevant unsafe invariants and infrastructure documentation
docs/roadmap/phases/phase-b.md
Register the B4 closure business, security, and performance reviews in their respective indexes and add the perf-harness report and full review artefacts.
  • Append a B4 row to the business-reviews README describing the B4 closure retrospective scope and linking to the new business-review document
  • Append a B4 row to the performance-optimization-reviews README describing the new baseline’s footprint, perf band, and QEMU fault-class status, and link it to the new perf review
  • Append a B4 row to the security-reviews README summarizing the consolidated security verdict and key unsafe-log changes, and link it to the new security review document
  • Create the detailed B4 performance baseline review capturing methodology, ELF size trajectory, test-count evolution, boot-to-end perf statistics, hotspots analysis, regression checks, and forward flags
  • Create the B4 business retrospective describing the B4 arc, master-review interlude, audit-log evolution, test counts, smoke trace, perf/ELF metrics, plan changes, learnings, adjustments, and next steps
  • Create the B4 consolidated security review that evaluates T-019 plus remediation across the eight security axes, cross-references unsafe-log entries, reconciles with the master review, and records forward-flagged items
  • Add a perf-harness report file holding the raw 20-iteration boot-to-end timing band and methodology for the B4 baseline
docs/analysis/reviews/business-reviews/README.md
docs/analysis/reviews/performance-optimization-reviews/README.md
docs/analysis/reviews/security-reviews/README.md
docs/analysis/reviews/performance-optimization-reviews/2026-05-28-B4-closure.md
docs/analysis/reviews/business-reviews/2026-05-28-B4-closure.md
docs/analysis/reviews/security-reviews/2026-05-28-B4-closure.md
docs/analysis/reports/perf-baseline-2026-05-28-B4-closure.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 418432bc-0e44-4f77-b602-2ef4c79a580c

📥 Commits

Reviewing files that changed from the base of the PR and between ad61156 and 8234100.

📒 Files selected for processing (5)
  • .github/workflows/ci.yml
  • docs/analysis/tasks/phase-a/T-003-ipc-primitives.md
  • docs/analysis/tasks/phase-a/T-004-cooperative-scheduler.md
  • docs/roadmap/phases/phase-a.md
  • docs/roadmap/phases/phase-b.md

📝 Walkthrough

Walkthrough

This PR records B4 (Task loader) closure via business, performance, and security review documents, updates index/readme entries, and advances the roadmap to mark B4 Closed and activate B5 with a Phase B Miri exit-quality prerequisite.

Changes

B4 Closure Trio and Roadmap Progression

Layer / File(s) Summary
B4 Business Closure Review
docs/analysis/reviews/business-reviews/2026-05-28-B4-closure.md, docs/analysis/reviews/business-reviews/README.md
Documents what landed in B4, new UNSAFE entries, test-count deltas, CI gate reproduction, release smoke trace, perf-band and ELF footprint vs B3, plan changes from the master review, learnings, and B4 closure adjustments including MR-009 closure and B5 forward flags.
B4 Performance Baseline and Optimization Closure
docs/analysis/reports/perf-baseline-2026-05-28-B4-closure.md, docs/analysis/reviews/performance-optimization-reviews/2026-05-28-B4-closure.md, docs/analysis/reviews/performance-optimization-reviews/README.md
Adds the canonical B4 performance baseline and optimization-closure report: ELF section deltas, host test-count totals and decomposition, boot-to-end timing percentiles and perf-harness band, hotspot analysis attributing timing increase to loader address-space population, regression-check checklist, and forward-flagged perf items.
B4 Security Closure Review
docs/analysis/reviews/security-reviews/2026-05-28-B4-closure.md, docs/analysis/reviews/security-reviews/README.md
Consolidates the B4 security pass: new UNSAFE entries (UNSAFE-2026-0027/0028), audit status updates, trust-boundary notes, kernel-mode discipline assertions, threat-model reconciliation, approve verdict, and forward flags for B5/B6.
Roadmap Progression and Phase B Exit Prerequisite
docs/roadmap/current.md, docs/roadmap/phases/phase-b.md, docs/roadmap/phases/phase-a.md
Marks B4 Closed via the closure trio, shifts the active milestone to B5 (syscall boundary), adds a Phase B exit-quality prerequisite requiring a passing cargo +nightly miri test run with emphasis on scheduler and IPC code paths, and records Phase A milestone completions.
Misc docs, CI comments, and cross-reference fixes
.github/workflows/ci.yml, docs/analysis/tasks/phase-a/T-003-ipc-primitives.md, docs/analysis/tasks/phase-a/T-004-cooperative-scheduler.md
Minor editorial updates: CI miri job comment rewording and ADR/hyperlink corrections in Phase A task docs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 I hopped through docs and charts so neat,
B4's wrapped up, its metrics complete.
Perf and safety penned with care,
Roadmap points to B5 — onward, fair!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: closing the B4 milestone with a closure trio (business, security, performance reviews) plus master-review remediation verification, which directly reflects the changeset's primary purpose.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch b4-closure-trio

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The new 2026-05-28 banner in current.md is extremely dense and repeats a lot of detail that’s already captured in the three B4 closure docs; consider trimming it to a short summary and linking to the business/security/perf artifacts to keep current.md maintainable over time.
  • A lot of the same B4 metrics (test counts, perf band, QEMU event counts, audit-log size) are now reproduced in several places (current.md, business review, perf review, security review); where possible, prefer a single canonical table plus brief references elsewhere to reduce the risk of future drift.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new 2026-05-28 banner in `current.md` is extremely dense and repeats a lot of detail that’s already captured in the three B4 closure docs; consider trimming it to a short summary and linking to the business/security/perf artifacts to keep `current.md` maintainable over time.
- A lot of the same B4 metrics (test counts, perf band, QEMU event counts, audit-log size) are now reproduced in several places (current.md, business review, perf review, security review); where possible, prefer a single canonical table plus brief references elsewhere to reduce the risk of future drift.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request formally closes the B4 milestone (Task loader) by introducing the B4 closure retrospective reviews (business, security, and performance baseline) and updating the roadmap documentation to reflect the transition to B5 (Syscall boundary). The updates record the post-remediation metrics, including an increased test count of 286 and the performance baseline under QEMU TCG. Feedback on the security review document suggests simplifying a relative link to the task loader document for consistency with sibling reviews.

@@ -0,0 +1,116 @@
# Security review 2026-05-28 — B4 closure consolidated pass (post-T-019 + master-review remediation)

- **Change:** the B4 arc on `main` — [T-019 task loader](../../../analysis/tasks/phase-b/T-019-task-loader.md) merged via PR #31 ([merge `7f876af`](https://github.com/HodeTech/Tyrne/commit/7f876af); 7 bisectable commits `911f2ad`/`5711756`/`ae31bc8`/`196d3fb`/`164522d`/`5b1f153`/`95efd62` + doc/round-fix commits `74694d4`/`5078944`/`eb14c51`), preceded by [ADR-0029](../../../decisions/0029-initial-userspace-image-format.md) (Initial userspace image format, `Accepted` 2026-05-14, PR #30 [merge `e09755d`](https://github.com/HodeTech/Tyrne/commit/e09755d)) — *plus* the **master-review remediation** PR #32 ([merge `50bffe9`](https://github.com/HodeTech/Tyrne/commit/50bffe9)) that closed the 2026-05-22 full-tree review's Blocker+Major backlog (commits `a6e909d` MR-001 / `8063ee2` MR-006/005/019/020 + ADR-0036 / `fbc3d3f` MR-002/003/007/008/009 CI honesty / `59f9309` MR-005/011/017/018 / `57bc2e6` MR-010/018 / `348971e` MR-022/017/018 / `24530fb` MR-012/013/014 / `4e241d9` MR-016/019 / `4141158` MR-015/004 / `a2e7257` D3-005/006/007 + review-round commits `ae8fbd7`/`8ceb4fb`/`c843ecd`), the org migration `cd4cb6e` (cemililik/Tyrne → HodeTech/Tyrne), and the README clarity pass `3ab029f` (HEAD). Period under review: 2026-05-14 → 2026-05-28.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The relative link to the task loader document can be simplified for consistency and directness. Since this file is located at docs/analysis/reviews/security-reviews/2026-05-28-B4-closure.md, we can reference the task loader file using ../../tasks/phase-b/T-019-task-loader.md instead of going up three levels to the docs/ root and then back down. This matches the link structure used in the sibling business and performance reviews.

Suggested change
- **Change:** the B4 arc on `main` — [T-019 task loader](../../../analysis/tasks/phase-b/T-019-task-loader.md) merged via PR #31 ([merge `7f876af`](https://github.com/HodeTech/Tyrne/commit/7f876af); 7 bisectable commits `911f2ad`/`5711756`/`ae31bc8`/`196d3fb`/`164522d`/`5b1f153`/`95efd62` + doc/round-fix commits `74694d4`/`5078944`/`eb14c51`), preceded by [ADR-0029](../../../decisions/0029-initial-userspace-image-format.md) (Initial userspace image format, `Accepted` 2026-05-14, PR #30 [merge `e09755d`](https://github.com/HodeTech/Tyrne/commit/e09755d)) — *plus* the **master-review remediation** PR #32 ([merge `50bffe9`](https://github.com/HodeTech/Tyrne/commit/50bffe9)) that closed the 2026-05-22 full-tree review's Blocker+Major backlog (commits `a6e909d` MR-001 / `8063ee2` MR-006/005/019/020 + ADR-0036 / `fbc3d3f` MR-002/003/007/008/009 CI honesty / `59f9309` MR-005/011/017/018 / `57bc2e6` MR-010/018 / `348971e` MR-022/017/018 / `24530fb` MR-012/013/014 / `4e241d9` MR-016/019 / `4141158` MR-015/004 / `a2e7257` D3-005/006/007 + review-round commits `ae8fbd7`/`8ceb4fb`/`c843ecd`), the org migration `cd4cb6e` (cemililik/Tyrne → HodeTech/Tyrne), and the README clarity pass `3ab029f` (HEAD). Period under review: 2026-05-14 → 2026-05-28.
- **Change:** the B4 arc on `main` — [T-019 task loader](../../tasks/phase-b/T-019-task-loader.md) merged via PR #31 ([merge `7f876af`](https://github.com/HodeTech/Tyrne/commit/7f876af); 7 bisectable commits `911f2ad`/`5711756`/`ae31bc8`/`196d3fb`/`164522d`/`5b1f153`/`95efd62` + doc/round-fix commits `74694d4`/`5078944`/`eb14c51`), preceded by [ADR-0029](../../../decisions/0029-initial-userspace-image-format.md) (Initial userspace image format, `Accepted` 2026-05-14, PR #30 [merge `e09755d`](https://github.com/HodeTech/Tyrne/commit/e09755d)) — *plus* the **master-review remediation** PR #32 ([merge `50bffe9`](https://github.com/HodeTech/Tyrne/commit/50bffe9)) that closed the 2026-05-22 full-tree review's Blocker+Major backlog (commits `a6e909d` MR-001 / `8063ee2` MR-006/005/019/020 + ADR-0036 / `fbc3d3f` MR-002/003/007/008/009 CI honesty / `59f9309` MR-005/011/017/018 / `57bc2e6` MR-010/018 / `348971e` MR-022/017/018 / `24530fb` MR-012/013/014 / `4e241d9` MR-016/019 / `4141158` MR-015/004 / `a2e7257` D3-005/006/007 + review-round commits `ae8fbd7`/`8ceb4fb`/`c843ecd`), the org migration `cd4cb6e` (cemililik/Tyrne → HodeTech/Tyrne), and the README clarity pass `3ab029f` (HEAD). Period under review: 2026-05-14 → 2026-05-28.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/analysis/reviews/business-reviews/2026-05-28-B4-closure.md`:
- Line 206: Update the MR-009 bullet so its final state is unambiguous: choose
either “closed” or “pending” and make the whole sentence consistent (e.g., if
closed, remove the clause that says the phase-b exit-bar text is still missing;
if pending, remove the “closed in-branch 2026-05-28” tag). Ensure the text
references MR-009 and the phase-b exit-bar change to phase-b.md consistently and
keep the note about where the exit prerequisite should appear (the
§"Exit-quality prerequisite — Miri" paragraph) or remove that note if marking
MR-009 as pending.

In
`@docs/analysis/reviews/performance-optimization-reviews/2026-05-28-B4-closure.md`:
- Line 223: Update the MR-009 status wording in the Phase-B exit narrative to
reflect that the Miri-as-Phase-B-exit-bar change has been completed in-branch:
edit the sentence that currently says "not yet written" to state that the
Phase-B exit checklist now includes Miri as a blocking CI gate (or add an
explicit historical timestamp noting when the pre-fix wording applied); ensure
you reference MR-009 and the corresponding gate entry in infrastructure.md and
adjust the Phase-B exit bar / phase-b.md text to read as a completed action
rather than pending.

In `@docs/analysis/reviews/security-reviews/2026-05-28-B4-closure.md`:
- Line 105: The MR-009 adjustment text in docs/analysis/... states that the
Phase-B Miri prerequisite ("Miri green = Phase-B exit prerequisite") is not yet
written into phase-b.md, but the PR/cohort indicates this was already added;
update the Adjustment text to match the merged state by editing the MR-009 entry
to reflect that the Phase-B exit checklist in roadmap/phases/phase-b.md now
includes the Miri requirement, remove or mark the "not yet written" note, and
add a brief reference to the merge/commit that closed it (or mark as closed) so
future audits do not reopen this item.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b749c579-9868-49e9-a36a-fbd01e33d51d

📥 Commits

Reviewing files that changed from the base of the PR and between 3ab029f and 1a4181f.

📒 Files selected for processing (9)
  • docs/analysis/reports/perf-baseline-2026-05-28-B4-closure.md
  • docs/analysis/reviews/business-reviews/2026-05-28-B4-closure.md
  • docs/analysis/reviews/business-reviews/README.md
  • docs/analysis/reviews/performance-optimization-reviews/2026-05-28-B4-closure.md
  • docs/analysis/reviews/performance-optimization-reviews/README.md
  • docs/analysis/reviews/security-reviews/2026-05-28-B4-closure.md
  • docs/analysis/reviews/security-reviews/README.md
  • docs/roadmap/current.md
  • docs/roadmap/phases/phase-b.md

Comment thread docs/analysis/reviews/business-reviews/2026-05-28-B4-closure.md Outdated
Comment thread docs/analysis/reviews/performance-optimization-reviews/2026-05-28-B4-closure.md Outdated
Comment thread docs/analysis/reviews/security-reviews/2026-05-28-B4-closure.md Outdated
cemililik and others added 2 commits May 29, 2026 04:23
- security review: make the T-019 link direct (../../../analysis/tasks ->
  ../../tasks/phase-b/T-019-task-loader.md), matching the business/performance
  sibling reviews.

- MR-009 consistency: the Miri-as-Phase-B-exit-prerequisite item was closed
  in-branch (phase-b.md gained the "Exit-quality prerequisite -- Miri"
  paragraph), but several artifacts still described it as "not yet written" /
  a "standing residual". Reconcile every mention to the closed state -- business
  §What-we-learned + §Adjustments (and the section heading), security §4 +
  Verdict + Adjustment heading + the audit-log bullet, performance forward-flag,
  and both README index rows -- so future audits do not reopen it. The
  remediation now reads 24/24 throughout.

- current.md: trim the dense 2026-05-28 banner to a short summary that links the
  closure trio (the canonical metrics source) instead of reproducing every
  number, and trim the Last-completed-milestone bullet's metric reproduction to
  a one-line headline + canonical-source pointer. Reduces future drift risk
  (overall review comments 1 + 2).

Docs-only changeset; 305/305 relative links verified resolving.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cemililik cemililik merged commit 003738a into main May 29, 2026
6 of 7 checks passed
cemililik added a commit that referenced this pull request May 29, 2026
current.md + T-021 task file cite PR #34 (base main, 9 commits, bundles T-020 +
T-021 in one combined review per the maintainer's call). Matches the project's
PR-reference convention (cf. T-019/PR #31, B4/PR #33).

Refs: ADR-0030, ADR-0031
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cemililik added a commit that referenced this pull request May 29, 2026
…-021) (#34)

* docs(adr): propose ADR-0030/0031 — syscall ABI + initial syscall set

ADR-0030 settles the EL0->EL1 syscall calling convention (x8 = number,
x0-x5 args, x0 status + x1-x7 payload, SVC #0), the dedicated-status
error encoding, and the K2-5 split of IpcError::InvalidCapability into
StaleHandle / WrongObjectKind / MissingRight (with the per-subject-cap
security argument and the arena-staleness ordering caveat). ADR-0031
fixes the v1 syscall set (send, recv, console_write [capability-gated +
release debug-gated], task_yield, task_exit), reserves number 0 as
invalid, and pins each call's register layout; every object-naming
syscall performs a capability check (P1/P4).

Opens T-020 (error taxonomy + Capability/CapObject Debug redaction — the
pure-Rust foundation, In Progress) and T-021 (SVC trap trampoline +
panic-free dispatcher + copy-from/to-user — Ready, the security-critical
hardware-facing half) to ground both ADRs' dependency chains per ADR-0025
Rule 1. Both ADRs land at Proposed; Accept follows in a separate commit.

Refs: ADR-0030, ADR-0031

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(adr): accept ADR-0030/0031 after careful re-read + maintainer review

Flip ADR-0030 and ADR-0031 Proposed -> Accepted in a commit separate from
the propose draft, per write-adr skill section 10. The careful re-read plus
a same-day maintainer review surfaced and corrected several drafting issues
*before* this Accept — all folded into the proposed bodies above, so the
Accepted text is correct from the start (no post-Accept body edit):
  - an SVC from a B5 EL1 kernel-stub takes the current-EL (VBAR_EL1+0x200)
    sync vector, not the lower-EL (+0x400) EL0 vector, so the real EL0
    round-trip is runtime-verified in B6, not B5;
  - console_write is capability-gated on a debug-console capability (it was
    ambient authority, a P1/P4 violation); the release debug-gate is a
    separate, independent defense-in-depth gate;
  - the syscall numbers 1..5 are a fixed decision (tests regression-verify
    them), and the payload registers are x1..x7.
Adds the additive ADR-0017 revision rider recording that the IpcError
taxonomy is refined (not superseded) and the three-primitive surface is
unchanged.

Refs: ADR-0030, ADR-0031

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(ipc): split IpcError::InvalidCapability into three typed variants

Per ADR-0030's K2-5 bundle, replace the collapsed IpcError::InvalidCapability
with StaleHandle / WrongObjectKind / MissingRight so the in-kernel and the
future userspace error spaces agree and each failure is a distinct, handleable
case. Validation now resolves in the order resolve -> type-check -> authority
(kind before rights), matching CapError's InvalidHandle/WrongKind/
InsufficientRights shape, across validate_ep_cap, validate_notif_cap, and
sched::resolve_ep_cap; the four arena-staleness sites map to StaleHandle.
Revealing which check failed is safe for a per-subject, unforgeable capability
table (ADR-0030 security argument). Remaps the existing rights/stale test
assertions and adds 5 new tests pinning each variant (incl. wrong-kind-with-
right, proving kind-before-rights, and a destroyed-endpoint StaleHandle).
InvalidTransferCap is intentionally left intact (note C3-008). Updates
docs/architecture/ipc.md taxonomy section.

Security-relevant (capabilities + IPC). fmt / host-test (194 kernel) /
host-clippy / kernel-clippy / kernel-build / miri (no UB) all green.

Refs: ADR-0030

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(cap): redact Capability and CapObject Debug to hide object identity

Per ADR-0030 "Security of the taxonomy split" / B5 sub-item 6 (K3-9, security
review section 6): a userspace-reachable log path (the future console_write
syscall) must never disclose the kernel object a capability names. Replace the
derived Debug on Capability with a hand-written impl that shows rights but
prints the object as <redacted>, and redact CapObject likewise (kind-only
Debug, hiding the wrapped slot index + generation). The individual kernel-
object handle types keep their derived Debug for kernel-internal diagnostics
(they never cross to userspace; T-021's console_write review gates that). Two
host tests pin both redaction layers. Broadens security-model.md's
"no unredacted Debug/Display" rule to capabilities.

The CapObject redaction was folded in from an adversarial self-review that
flagged it as a latent defense-in-depth gap (no current production formatter,
but conservative per CLAUDE.md rule 1). Security-relevant.

Refs: ADR-0030

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(ipc): pin StaleHandle + WrongObjectKind on ipc_cancel_recv

Add two tests so ipc_cancel_recv pins all three split variants
(it already had MissingRight): a Task cap carrying RECV proves the
kind-before-rights ordering (WrongObjectKind), and a cap whose endpoint
was destroyed exercises the arena-staleness branch (StaleHandle). This
makes ADR-0030's row-3 verification mapping accurate for cancel_recv
(it previously over-claimed cancel coverage). Kernel host tests 194 -> 196.

Refs: ADR-0030
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(roadmap): T-020 In Review; narrow B5 acceptance to current-EL proxy

Address the remaining maintainer-review findings (the ADR append-only fix
landed via the propose/accept rebase; this commit covers the rest):

- Major: phase-b §B5 acceptance over-promised a real EL0->EL1 round-trip,
  which ADR-0030 shows is impossible at B5 (an EL1 kernel-stub SVC takes
  the current-EL 0x200 vector, not the lower-EL 0x400 EL0 vector). Narrow
  B5 to "dispatch mechanism verified via the current-EL kernel-stub" and
  move the real EL0 0x400 round-trip to the B6 acceptance criteria.
- Minor: current.md banner said "In Progress" while the fields said
  "In Review"; fix the banner and the two broken T-021 links (../).
- Move T-020 to In Review in the task index + task doc; record the
  maintainer-review round and the row-to-verification mapping (now incl.
  the two new cancel_recv variant tests) in T-020's review history.
- Add EL0/EL1, SVC, Syscall, and Syscall ABI glossary entries and note
  the taxonomy split on the ipc.md architecture status row.

Refs: ADR-0030, ADR-0031
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(ipc): make wrong-kind tests actually prove kind-before-rights

Second-round review found the four *_wrong_object_kind tests handed the
cap the operation's own right, so they returned WrongObjectKind under
*both* the chosen kind-first order and a hypothetical rights-first
regression — i.e. ordering-agnostic, proving nothing (a rights-first flip
would not fail them). Fix: each test now uses a wrong-kind cap that also
LACKS the required right (CapRights::empty()), the only input that
discriminates the order (WrongObjectKind under kind-first, MissingRight
under rights-first), so a regression to rights-first now fails the tests.
Updates the section comment and T-020 AC#4 to state what each test
actually proves; corrects T-020's stale test counts (AC#6 194 -> 196;
review history "8 new" -> "9 new").

(The stale-variant references in the Turkish technical-analysis IPC
chapter were also refreshed on disk for local reference, but that tree is
gitignored, so it is not part of this commit / the repo.)

No production code change; fmt / host-test 196 / clippy / build / miri
(no UB) all green.

Refs: ADR-0030
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(syscalls): EL0→EL1 SVC dispatch — trampoline, panic-free dispatcher, copy-user

Land the security-critical hardware-facing half of B5 (T-021): the EL0→EL1
SVC trap path that instantiates ADR-0030's calling convention and ADR-0031's
five-syscall v1 set.

New architecture-agnostic, panic-free, host-tested kernel `syscall` module:
- error.rs: SyscallError composing CapError/IpcError via From, with a stable
  numeric status encoding (0 = Ok; 1-3 top-level; 0x10x = Cap; 0x20x = Ipc).
- abi.rs: SyscallNumber decode (release debug-gate on console_write via
  cfg!(debug_assertions)), the register frame types, value↔register packing
  for Message/outcomes, and the Option<CapHandle> null-handle sentinel.
- user_access.rs: UserAccessWindow + validated copy_from_user/copy_to_user
  (range-check-then-copy; wrap and zero-length handled; never derefs an
  unvalidated user pointer).
- dispatch.rs: the panic-free dispatcher + per-syscall handlers + the
  debug-console capability check; control-plane syscalls (task_yield/exit)
  return a SyscallEffect directive rather than touching the scheduler.

Capability surface: CapObject::DebugConsole (singleton, no handle) +
CapRights::CONSOLE_WRITE (bit 7, added to KNOWN_BITS) + CapHandle::from_raw
(ABI-decode constructor; reconstructed handles are validated by lookup).

BSP (hardware-facing): tyrne_sync_trampoline in vectors.s installed at both
VBAR_EL1+0x200 (current-EL, the B5 path) and +0x400 (lower-EL AArch64, the B6
EL0 path) — saves the full x0-x30 + SP_EL0 + ELR_EL1 + SPSR_EL1 frame, routes
ESR_EL1.EC==SVC64 to a Rust syscall_entry, else to the existing panic path.
SyscallTrapFrame (272 B, #[repr(C)], const-asserted to match the asm).
kernel_entry runs an EL1 kernel-stub SVC smoke (console_write + bad-number).

Gates: fmt / host-clippy / kernel-clippy / kernel-build clean; host tests 236
(+40); cargo test --release green (the debug-gate release-path tests);
cargo miri test --workspace --exclude tyrne-bsp-qemu-virt clean (43+236+53).
QEMU smoke (debug): two SVCs taken at the current-EL vector (ESR 0x15/SVC64,
EL1→EL1), clean ERET; console_write emits its buffer via the syscall path
(status 0x0, 63 bytes); a reserved-invalid number returns BadSyscallNumber
(0x1); -d int,unimp,guest_errors shows no new fault class; the cooperative
demo still runs to "tyrne: all tasks complete".

The real EL0 +0x400 round-trip (EL0↔EL1 transition + copy-user against a
separate userspace TTBR0_EL1) is wired but runtime-verified in B6 per
ADR-0030 §Simulation.

Refs: ADR-0030, ADR-0031
Audit: UNSAFE-2026-0029, UNSAFE-2026-0030
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(syscalls): T-021 review-round follow-up — dispatch tests + compile-time payload guard

Apply the actionable findings from the T-021 adversarial review-round (which
confirmed no live B5 defect). All changes are test coverage, a behavior-
preserving defensive refactor, and B6 forward-gate tracking — no production
behavior change (QEMU trace byte-stable; the const-generic emits identical
register values).

Test coverage (+4 dispatch-level tests; host tests 236 -> 240) closing gaps the
review surfaced:
- send_with_transfer_cap_then_recv_returns_cap_in_x6 — the x5 transfer-handle
  decode -> ipc_send cap_take AND ipc_recv -> encode_recv_outcome x6 cap-pack,
  end-to-end through dispatch (previously untested; verified non-vacuous via a
  mutation check — breaking the x6 pack makes it fail).
- send_with_stale_transfer_handle_returns_invalid_transfer_cap — status 0x205.
- recv_with_no_sender_returns_pending_packing — Pending packing (x1=pending,
  x2..x7 zeroed).
- console_write_exactly_one_chunk_emits_all_bytes — the len == CONSOLE_WRITE_CHUNK
  loop boundary (debug-gated).

Hardening (nit): SyscallReturn::with_payload is now a const-generic
with_payload::<IDX> with `const { assert!(IDX < 7) }`, turning the (already
unreachable-from-untrusted-input) runtime index panic into a compile-time error
at the call site — matching the kernel's compile-time-guard idiom. Call sites
updated to the ::<N> turbofish.

Clarity: the three scattered "unreachable re-validation" comments in
sys_console_write consolidated into one inequality-chain proof.

Docs: phase-b.md §B6 gains an explicit "T-021 carry-forward gates" list (per-task
console_write window + per-page user-VA translation returning FaultAddress not
panic; SP_EL1 init on the +0x400 entry; SYSCALL_STUB_TABLE -> current-task table)
so B6 cannot miss them; T-021 review history records the round.

Gates re-run green: fmt / host-clippy / kernel-clippy / kernel-build clean;
host-test 240; test --release green; miri --workspace excl BSP clean (43+240+53,
0 UB); QEMU smoke round-trip byte-stable.

Refs: ADR-0030, ADR-0031
Audit: UNSAFE-2026-0029, UNSAFE-2026-0030
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs(roadmap): record PR #34 (combined T-020 + T-021 B5 review)

current.md + T-021 task file cite PR #34 (base main, 9 commits, bundles T-020 +
T-021 in one combined review per the maintainer's call). Matches the project's
PR-reference convention (cf. T-019/PR #31, B4/PR #33).

Refs: ADR-0030, ADR-0031
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(syscalls): T-021 review-round 2 — overlap-safe copy-user + scope/guard fixes

Address the second review-round on PR #34. Fix only still-valid issues; one
finding (release-wrap of a const) was refuted but its requested guard kept as a
clearer compile-time tripwire; one (test-scaffolding helper) skipped.

Soundness (headline): copy_from_user / copy_to_user are SAFE `pub fn`s, so they
must be sound for every input — but `UserAccessWindow::validate` proves *bounds*,
not *disjointness*, and under the v1 identity map (VA == PA) a caller could pass
a user_ptr range that aliases the kernel-owned dst/src slice, making
`copy_nonoverlapping`'s non-overlap precondition violable from safe code (UB).
Switch both moves to `core::ptr::copy` (memmove), which is correct for any
overlap; drop the unprovable "source and destination are disjoint" claim from
the SAFETY comments and document why `copy` (not `copy_nonoverlapping`) is the
sound choice. Behaviour is identical for the non-overlapping case (all current
callers are disjoint), so QEMU/Miri/host evidence is unchanged. UNSAFE-2026-0030
gains an append-only Amendment recording the change (title/anchor preserved).

Hardening (compile-time guards, no runtime cost):
- abi.rs: a `const _: () = assert!(NULL_CAP_HANDLE > max-packable-handle-word)`
  locks the sentinel-collision-freedom invariant — a future CapHandle widening
  that could push a packed word into the sentinel's bit range fails the build.
- bsp syscall.rs: an explicit `const _: () = assert!(PMM_EXTENT_END >=
  PMM_EXTENT_START)` with a clear message in front of SYSCALL_USER_WINDOW_LEN.
  (The reviewer's "wraps in release" premise is incorrect — the subtraction is a
  `const`, and const-eval rejects underflow at build time, never wraps — but the
  named assert gives a clearer failure than a raw const-eval overflow error.)

Docs:
- T-021 §Informs: scope the ADR-0030 §Simulation discharge — rows 2/4 in full +
  the mechanism half of rows 0/1/5 via the EL1-stub proxy at the current-EL
  +0x200 vector; the EL0-runtime half of rows 0/1/5 (the +0x400 vector, the
  EL0↔EL1 transition, copy-user vs a separate userspace TTBR0_EL1) is deferred to
  B6, not discharged here.
- current.md: remove the blank lines between adjacent banner paragraphs so they
  form one contiguous `>` blockquote (matches the file's existing multi-paragraph
  style; resolves markdownlint MD028).

Skipped: extracting a SyscallContext test-builder — the scaffolding verbosity is
largely forced by the borrow structure (tests declare + later inspect the
borrowed locals), so a helper saves only the struct-literal line per test and
isn't worth churning the just-reviewed test suite on an in-review PR.

Gates re-run green: fmt / host-clippy / kernel-clippy / kernel-build; host-test
240; test --release 233; miri --workspace excl BSP clean (0 UB); QEMU smoke
round-trip byte-stable.

Refs: ADR-0030, ADR-0031
Audit: UNSAFE-2026-0030
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* audit(syscalls): correct UNSAFE-2026-0030 amendment — disjointness is the soundness basis

Review-round on PR #34 (two findings; each verified against current code):

1. UNSAFE-2026-0030 amendment (docs/audits/unsafe-log.md) — VALID, fixed. The
   amendment added in 2c713c0 (a) lacked the commit SHA the audit-log format
   wants and (b) over-claimed that switching to `core::ptr::copy` makes the copy
   "overlap-tolerant". An empirical Miri probe disproved that: an overlapping
   (user_ptr, kernel-slice) pair is UB *regardless* of the copy primitive —
   `copy_from_user`'s `dst: &mut [u8]` (and `copy_to_user`'s `src: &[u8]`)
   parameter is exclusive / shared, so an aliasing access through the exposed
   `user_ptr` violates that borrow (Stacked Borrows: "not granting access to tag
   <wildcard> … strongly protected"). The amendment now carries SHA 2c713c0,
   marks the original `copy_nonoverlapping` §Operation / invariant(3) /
   rejected-alternatives wording as superseded, and states the true soundness
   basis: the user/kernel **disjointness** invariant (user_ptr = userspace,
   kernel slice = distinct allocation in v1 / separate AS in B6), under which
   both `copy` and `copy_nonoverlapping` are sound. `core::ptr::copy` is kept as
   the conservative primitive. The copy_from_user / copy_to_user SAFETY comments
   are corrected to match (invariant 3 = disjointness, not "overlap-tolerant").

2. Add overlapping-copy regression tests — SKIPPED, with reason. The requested
   tests assert "overlapping copies are allowed", but overlap is UB here (see
   above — Miri-confirmed via a temporary probe, now removed), independent of
   `copy` vs `copy_nonoverlapping`. Such tests would (a) break the Miri gate and
   (b) codify an unsound expectation. The real invariant is disjointness, which
   the existing tests + the structural user/kernel split already cover; an
   overlapping call correctly fails under Miri's borrow model.

No code-behaviour change (the `core::ptr::copy` calls are unchanged; only SAFETY
comments + the audit amendment text). Gates: fmt / host-clippy / kernel-clippy /
kernel-build clean; host-test 240; miri (syscall) 0 UB. Production code is
byte-identical to 2c713c0, already validated with full miri + test --release +
QEMU smoke.

Refs: ADR-0030, ADR-0031
Audit: UNSAFE-2026-0030
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant