Skip to content

docs(closure): Phase B closure — B6 step 7 (guide, perf baseline, security review, retrospective)#43

Merged
cemililik merged 4 commits into
mainfrom
b6-closure
Jun 1, 2026
Merged

docs(closure): Phase B closure — B6 step 7 (guide, perf baseline, security review, retrospective)#43
cemililik merged 4 commits into
mainfrom
b6-closure

Conversation

@cemililik

@cemililik cemililik commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Phase B closure — milestone B6 step 7 (the closure quartet)

This PR files the Phase B closure quartet (step 7 of milestone B6), closing Phase B. All B6 functional steps (1–6, through the merged T-028 EL0 wire-up) were already on main; this is the documentation/retrospective closure + one doc-only kernel clarification.

What's in here

1. First-userspace guidedocs/guides/first-userspace.md (c8792cf)
What B6 demonstrates, how to run it, an annotated +0x400 EL0→EL1 trace, the build pipeline, the wire-up, and the three gates + high-half isolation table.

2. Perf baseline2026-06-01-B6-closure.md (bcb1f13)
Boot-to-end band p10/p50/p90 = 13.143 / 15.507 / 18.469 ms, with a same-host control (rebuilt the pre-EL0 commit 9551a33 back-to-back) proving running the first EL0 task adds no measurable boot-to-end cost (the EL0 round-trip is sub-floor; the raw B6<B5 drop is session drift, the control confirms it). Footprint +2.7 KiB text (incl. the embedded image) / +13.6 KiB .bss (RAM). Per-op EL0/IPC/ctx-switch micro-measurements deferred to T-029 (Draft, opened here) — they need feature-gated CNTVCT instrumentation deserving its own gate + audit pass, not a closure-tail addition.

3. Security review (consolidated seam)2026-06-01-phase-b-closure.md (eac69d2)
The integrated B0–B6 surface reviewed now that a real EL0 task is attacker-observable: 5 lenses / 29 agents with per-finding skeptic verification across the eight master-plan axes. Approve, 0 confirmed exploitable defects (17 findings: 12 refuted, 5 nits). Phase-gates that the "panic-free dispatcher" property is syscall-input-scoped (distinct from EL0 execution-time faults — K3-4) and records the preemption/SMP + loader-trust forward-flags. The matching dispatch::dispatch doc clarification is doc-only (kernel binary byte-identical).

4. Phase B retrospective2026-06-01-phase-b-closure.md (bcb1f13)
The B0–B6 arc, headline numbers (366 host tests, Miri 0 UB), what-changed/what-we-learned (gate-by-gate EL0 discipline; adversarial+Miri; the same-host perf control is now load-bearing), and the Phase C carry-forwards.

+ Roadmap: phase-b.md step 7 DONE + §closure CLOSED / Phase C active; current.md Phase-B-closed capstone banner.

Carry-forwards to Phase C (all confirmed non-exploitable in v1)

  • Object lifecycle on exit (SEC-T024-01 / SEC-T028-01) — terminal task state + reclamation.
  • EL0 non-SVC fault containment (K3-4, Phase E) — currently a denial-of-self panic.
  • Per-section userspace W^X (ADR-0034).
  • Preemption/SMP hazards (gate-Development #3 non-atomic context resolution, ipc_send unreachable!, IRQ-under-task-TTBR0).
  • T-029 perf micro-bench.

Validation

🤖 Generated with Claude Code

Summary by Sourcery

Document Phase B closure with first-userspace guidance, performance baseline, security seam review, and retrospective, and clarify syscall panic-freedom scope while updating roadmaps to mark Phase B as complete and Phase C as active.

Enhancements:

  • Clarify that the syscall dispatcher’s panic-free guarantee is scoped to syscall register input and does not cover non-SVC EL0 execution-time faults.

Documentation:

  • Add a first-userspace guide documenting how the initial EL0 task is built, wired, executed, and validated across the EL0↔EL1 boundary.
  • Record a B6 performance baseline including boot-to-end timing, footprint impact, test coverage, and a same-host control showing the EL0 task adds no measurable boot-to-end cost.
  • Add a consolidated Phase B security seam review covering the integrated EL0 boundary, capability system, MMU, and fault-handling properties with forward flags for future hardening.
  • Add a Phase B business retrospective summarizing milestones B0–B6, headline metrics, process learnings, and carry-forward adjustments into Phase C.
  • Introduce a draft T-029 task document defining a feature-gated micro-benchmark plan for EL0 round-trip, IPC, and context-switch micro-measurements.
  • Update the Phase B roadmap to mark milestone B6 step 7 (closure) as done and to describe the completed “closure quartet” artifacts.
  • Update the current roadmap banner to declare Phase B closed, link the new closure documents, and enumerate key metrics and Phase C carry-forwards.

Summary by CodeRabbit

  • Documentation

    • Added Phase B closure retrospective documenting microkernel completion and first EL0 userspace task run, milestones, lessons, and carry‑forward items.
    • Added performance-baseline review with boot-to-end timing, image-size and test-count comparisons.
    • Added security review approving Phase B closure and listing forward‑flagged security items.
    • Added first-userspace guide with run/build steps and expected output.
    • Added perf micro-benchmark task spec (T-029) for syscall/IPC/context-switch measurements.
  • Chores

    • Updated roadmap to mark Phase B closed (2026-06-01) and activate Phase C.

cemililik and others added 3 commits June 1, 2026 10:20
docs/guides/first-userspace.md: what the first real EL0 task demonstrates, how to run it, the annotated +0x400 round-trip trace, the build pipeline, the wire-up, and the three gates + high-half isolation that make the boundary safe.

Refs: B6 closure

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tive (legs 2+4)

Perf baseline (2026-06-01-B6-closure): boot-to-end band + footprint + test-count vs B5, with a same-host control proving the first EL0 task adds no measurable boot-to-end cost (delta sub-floor). Per-op micro-measurements (EL0 round-trip / IPC / ctx-switch) deferred to T-029 (a focused feature-gated CNTVCT instrumentation task) per the no-rushing discipline. Phase B retrospective (2026-06-01-phase-b-closure): the B0-B6 arc, headline numbers, what-changed, what-we-learned (gate-by-gate EL0 discipline; adversarial+Miri; the same-host perf control is now load-bearing), prior-Adjustments closure, and carry-forwards to Phase C.

Refs: B6 closure

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…admap (legs 3/4 + close)

Closes the Phase B closure quartet (step 7 of milestone B6):

- Consolidated Phase-B seam security review (B0–B6 integrated surface):
  5 lenses / 29 agents with per-finding skeptic verification across the
  eight master-plan axes. Approve, 0 confirmed exploitable defects (17
  findings: 12 refuted, 5 nits). The seam review's job: catch a defect
  the per-task reviews could miss at the boundaries between subsystems —
  none found. Phase-gates that the 'panic-free dispatcher' property is
  syscall-input-scoped (distinct from EL0 execution-time faults, the
  deferred K3-4 item) and records the preemption/SMP + loader-trust
  forward-flags.

- dispatch::dispatch doc: scope 'panic-free' to syscall input explicitly;
  note that a non-SVC EL0 sync fault is a denial-of-self routed to the
  panic handler in v1 (K3-4 / Phase E), not handled here. Doc-only;
  kernel binary byte-identical.

- Roadmap: phase-b.md step 7 marked DONE with links to the four closure
  artifacts (guide, perf baseline, both security reviews, retrospective)
  + the T-029 micro-bench deferral; §'Phase B closure' marked CLOSED and
  Phase C active; current.md Phase-B-closed capstone banner.

Gates: fmt clean, kernel-clippy -D warnings clean.

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

sourcery-ai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Reviewer's Guide

Documentation-only Phase B closure PR that adds a first-userspace guide, perf baseline, consolidated security review, and Phase B retrospective, updates roadmap banners to mark Phase B as closed and Phase C active, and clarifies via a doc-comment that the syscall dispatcher’s panic-freedom is scoped to syscall inputs (not general EL0 faults).

Sequence diagram for EL0 syscall vs non-SVC fault handling (panic scope clarification)

sequenceDiagram
    actor EL0Task
    participant SyscallEntry
    participant SyscallDispatcher
    participant Scheduler
    participant KernelPanic

    alt SVC_syscall
        EL0Task->>SyscallEntry: SVC #n
        SyscallEntry->>SyscallDispatcher: dispatch(ctx, args)
        SyscallDispatcher-->>SyscallEntry: SyscallEffect / SyscallError
        SyscallEntry->>Scheduler: task_exit_current (on Terminate)
        Scheduler-->>EL0Task: task terminated
    else non_SVC_EL0_fault
        EL0Task-)KernelPanic: [non-SVC sync fault routes to panic handler]
        KernelPanic-->>EL0Task: task killed (denial-of-self)
    end
Loading

File-Level Changes

Change Details Files
Clarify syscall dispatcher panic-freedom scope in kernel docs without changing behavior.
  • Refine the dispatch function rustdoc to state it is panic-free on syscall inputs, not all EL0 behavior.
  • Explain that non-SVC EL0 synchronous faults currently route to the kernel panic handler and are treated as denial-of-self, not escalation.
  • Document linkage of this behavior to the deferred K3-4 / Phase E fault-containment work item.
kernel/src/syscall/dispatch.rs
Add a comprehensive guide for running and understanding the first EL0 userspace task.
  • Introduce docs/guides/first-userspace.md describing what the first userspace task proves, how to run the smoke/integration tests, and expected QEMU output.
  • Document the userland program structure, build pipeline from Rust crate to raw flat image, and embedding via include_bytes!.
  • Explain the EL0 wire-up path, including load_image, task_create_from_image, capability seeding, scheduler behavior, and the three EL0 boundary gates plus high-half isolation.
  • Call out known v1 limitations and reference relevant ADRs and tasks across the B6 arc.
docs/guides/first-userspace.md
Record the B6 performance baseline and methodology, including a same-host control proving EL0 cost is sub-floor.
  • Create 2026-06-01-B6-closure.md perf review capturing concern, scope, and adversarial hypothesis about EL0 cost.
  • Detail methodology for boot-to-end measurements and same-host control against pre-EL0 commit.
  • Report image size, bss growth, test-count changes, and boot-to-end bands for B6 vs control with interpretation of drift vs real effects.
  • Explicitly defer EL0/IPC/context-switch micro-measurements to a dedicated feature-gated instrumentation task T-029.
docs/analysis/reviews/performance-optimization-reviews/2026-06-01-B6-closure.md
Add Phase B closure business retrospective summarizing milestones, learnings, and carry-forwards.
  • Introduce business review document outlining what Phase B built across B0–B6 with key ADR references.
  • Summarize headline metrics at closure (tests, footprint, perf band, security status, ADRs, audit log).
  • Describe plan adjustments during Phase B and key lessons (gate-by-gate EL0 discipline, adversarial review, perf controls).
  • Enumerate closure status of prior adjustments and list Phase C carry-forwards such as object lifecycle, fault containment, per-section permissions, and SMP hazards.
docs/analysis/reviews/business-reviews/2026-06-01-phase-b-closure.md
Add consolidated Phase B security seam review covering integrated B0–B6 surface.
  • Create security review doc defining subject, method (5 lenses / 29 agents), and axes aligned with the master plan.
  • Summarize per-axis verdicts on capability correctness, trust boundaries, memory safety, kernel-mode discipline, secrets/logging, dependencies, and threat-model impact.
  • Clarify that the panic-free dispatcher property is syscall-input-scoped and distinguish from non-SVC EL0 fault handling.
  • Forward-flag non-exploitable but important future work (EL0 fault containment K3-4, object lifecycle, non-atomic context resolution, loader trust, W^X, stack bounds/IRQ invariants).
docs/analysis/reviews/security-reviews/2026-06-01-phase-b-closure.md
Open a perf instrumentation task (T-029) for feature-gated micro-benchmarks of EL0 round-trip, IPC, and context switches.
  • Add task doc describing user story for per-operation timing using CNTVCT_EL0 without exposing a timing channel to EL0.
  • Define acceptance criteria for feature-gated benchmark code paths in the BSP, context-switch and IPC measurements, and EL0 syscall round-trip timing.
  • Specify that the feature must be compiled out of production builds and require unsafe audit entries for new timer reads.
  • Note that optimization of primitives is out of scope and that the task must update the B6 perf baseline with micro-measurement results.
docs/analysis/tasks/phase-b/T-029-perf-microbench.md
Mark Phase B as closed and Phase C as active in roadmap docs, linking to closure artifacts.
  • Update Phase B roadmap milestone B6 step 7 from planned closure to completed, linking to guide, perf baseline, security reviews, retrospective, and T-029 task.
  • Append a closure note to phase-b.md summarizing what Phase B delivered and listing Phase C carry-forwards.
  • Add a prominent banner to current.md announcing Phase B closure, summarizing guide/perf/security/business artifacts, and restating carry-forwards.
  • Retain and demote previous banners (e.g., first-userspace milestone) as historical context while clarifying supersession.
docs/roadmap/phases/phase-b.md
docs/roadmap/current.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

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1d9f8077-39cf-4efe-8cee-b1d393ae7176

📥 Commits

Reviewing files that changed from the base of the PR and between eac69d2 and fa0673b.

📒 Files selected for processing (6)
  • docs/analysis/reviews/security-reviews/2026-06-01-phase-b-closure.md
  • docs/analysis/tasks/phase-b/T-029-perf-microbench.md
  • docs/guides/first-userspace.md
  • docs/roadmap/current.md
  • docs/roadmap/phases/phase-b.md
  • kernel/src/syscall/dispatch.rs
✅ Files skipped from review due to trivial changes (5)
  • kernel/src/syscall/dispatch.rs
  • docs/analysis/reviews/security-reviews/2026-06-01-phase-b-closure.md
  • docs/analysis/tasks/phase-b/T-029-perf-microbench.md
  • docs/roadmap/current.md
  • docs/roadmap/phases/phase-b.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/guides/first-userspace.md

📝 Walkthrough

Walkthrough

This PR adds Phase B6 closure artifacts (business, perf, security reviews), a first-userspace guide, a T-029 perf micro-bench task, roadmap updates marking Phase B closed and Phase C active, and clarifies the syscall dispatch panic-free documentation.

Changes

Phase B6 Closure and Phase C Activation

Layer / File(s) Summary
Phase B6 Closure Reviews
docs/analysis/reviews/business-reviews/2026-06-01-phase-b-closure.md, docs/analysis/reviews/performance-optimization-reviews/2026-06-01-B6-closure.md, docs/analysis/reviews/security-reviews/2026-06-01-phase-b-closure.md
Business retrospective documents B6 milestones (B0–B6), closure metrics (test counts, release footprint, boot-to-end timings), plan changes, and lessons learned. Performance baseline reports image size, test-count, and boot-to-end timing deltas and defers µs micro-benchmarks to T-029. Security audit records an Approve verdict with scope clarifications (dispatcher panic-free rule vs. EL0 synchronous faults).
First Userspace Task Guide
docs/guides/first-userspace.md
End-to-end technical guide for the B6 deliverable: userland/hello EL0 program, build pipeline and embedding (hello.bin), boot-time wiring (address space, capability seeding, dispatch), syscall safety gates and high-half kernel protection, expected debug output, and v1 limitations.
Phase Transition and Forward Work
docs/analysis/tasks/phase-b/T-029-perf-microbench.md, docs/roadmap/current.md, docs/roadmap/phases/phase-b.md, kernel/src/syscall/dispatch.rs
Adds T-029 task spec for feature-gated EL0↔EL1/IPC/context-switch micro-benchmarks (counter not exposed to EL0), updates roadmaps to mark Phase B closed and Phase C active with carry-forwards, and strengthens dispatch docs to state unrecognized syscalls and register input failures return typed SyscallError without panics (scope limited to SVC-frame dispatch).

Sequence Diagram(s)

sequenceDiagram
  participant Boot as Boot/BSP
  participant Kernel as EL1 Kernel
  participant Task as EL0 Task
  participant Console as Console

  Boot->>Kernel: load hello.bin & seed capabilities
  Kernel->>Task: create task, set TTBR, dispatch
  Task->>Kernel: SVC (console_write)
  Kernel->>Console: write bytes
  Console-->>Kernel: ack
  Kernel-->>Task: return from SVC
  Task->>Kernel: SVC (task_exit)
  Kernel->>Kernel: cleanup / schedule next
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • HodeTech/Tyrne#40: Related changes clarifying the syscall dispatch panic-free behavior and typed SyscallError semantics.

Poem

🐰 Phase B hops to its close, with gates and guards in place,
A tiny hello runs in EL0, hopping through the space.
Perf saw no extra weight, security gave its nod,
Phase C wakes to stitch the seams—more careful work, by God! 🛡️

🚥 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 accurately describes the main change: filing the Phase B closure documentation quartet (guide, perf baseline, security review, retrospective) for B6 step 7.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch b6-closure

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The expanded dispatch doc comment now mixes behavioural guarantees with a lot of phase/planning context; consider tightening it to the essential behavioural contract and linking to the security review for historical details instead of embedding that text here.
  • The Phase B closure summary is repeated at length in both phase-b.md and current.md; you might want to centralize the detailed narrative in one place and keep the other as a shorter pointer to reduce future maintenance overhead.
  • The long, dense blockquote banner in current.md packs many concepts into a single paragraph; consider splitting it into shorter paragraphs or a small bullet list to improve scan-ability for readers tracking the current phase status.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The expanded `dispatch` doc comment now mixes behavioural guarantees with a lot of phase/planning context; consider tightening it to the essential behavioural contract and linking to the security review for historical details instead of embedding that text here.
- The Phase B closure summary is repeated at length in both `phase-b.md` and `current.md`; you might want to centralize the detailed narrative in one place and keep the other as a shorter pointer to reduce future maintenance overhead.
- The long, dense blockquote banner in `current.md` packs many concepts into a single paragraph; consider splitting it into shorter paragraphs or a small bullet list to improve scan-ability for readers tracking the current phase status.

## Individual Comments

### Comment 1
<location path="docs/guides/first-userspace.md" line_range="80-81" />
<code_context>
+
+## What the program does
+
+[`userland/hello/src/main.rs`](../../userland/hello/src/main.rs) is a
+`#![no_std] #![no_main]` aarch64 program whose entire body is:
+
+```rust
</code_context>
<issue_to_address>
**nitpick (typo):** Consider capitalizing “AArch64” for consistency with typical architecture naming and the rest of the docs.

```suggestion
[`userland/hello/src/main.rs`](../../userland/hello/src/main.rs) is a
`#![no_std] #![no_main]` AArch64 program whose entire body is:
```
</issue_to_address>

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.

Comment thread docs/guides/first-userspace.md Outdated

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

Copy link
Copy Markdown

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 Phase B of the Tyrne microkernel development, introducing comprehensive retrospective documentation, performance baselines, security reviews, and guides for running the first EL0 userspace task. It also clarifies in the syscall dispatcher documentation that its panic-free guarantees are scoped to syscall inputs rather than execution-time faults. The review feedback identifies two broken relative links in the newly added documentation files (2026-06-01-phase-b-closure.md and T-029-perf-microbench.md) that need to be corrected.

# Security review 2026-06-01 — Phase B closure (consolidated, B0–B6)

- **Subject:** the **integrated** Phase B kernel surface, now that a real EL0 userspace task is attacker-observable (B6). Each Phase B task was individually security-reviewed (T-022 high-half = Approve; T-025/T-026 adversarial passes; [T-028 EL0-boundary](2026-06-01-T-028-el0-userspace-wireup.md) = Approve, 0 confirmed exploitable). This consolidated pass is the **seam review**: does the *combination* of the Phase B subsystems — capability system, IPC, MMU/AddressSpace/PMM, the high-half regime, the syscall boundary, and the EL0 transition — introduce a defect a per-task review could miss at the boundaries between tasks?
- **Reviewer:** @cemililik (+ Claude Opus 4.8 (1M context) agent, adversarial across the eight axes of the [master plan](master-plan.md) via a 5-lens / 29-agent workflow with per-finding skeptic verification). Performed **2026-06-01** at the B6-closure HEAD.

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 master-plan.md is broken because master-plan.md is located in the performance-optimization-reviews directory, not in security-reviews. It should be updated to ../performance-optimization-reviews/master-plan.md.

Suggested change
- **Reviewer:** @cemililik (+ Claude Opus 4.8 (1M context) agent, adversarial across the eight axes of the [master plan](master-plan.md) via a 5-lens / 29-agent workflow with per-finding skeptic verification). Performed **2026-06-01** at the B6-closure HEAD.
- **Reviewer:** @cemililik (+ Claude Opus 4.8 (1M context) agent, adversarial across the eight axes of the [master plan](../performance-optimization-reviews/master-plan.md) via a 5-lens / 29-agent workflow with per-finding skeptic verification). Performed **2026-06-01** at the B6-closure HEAD.

- **Status:** Draft (opened in the B6-closure commit; the [B6 closure perf review](../../reviews/performance-optimization-reviews/2026-06-01-B6-closure.md) defers the per-op micro-measurements here)
- **Created:** 2026-06-01
- **Author:** @cemililik (+ Claude Opus 4.8 agent)
- **Dependencies:** the timer ([ADR-0010](../../../decisions/0010-timer-abstraction.md) — `Cpu::now_ns` / `CNTVCT_EL0`); the scheduler (`yield_now` / `context_switch`), IPC (`ipc_send`/`ipc_recv`), and the EL0 syscall path ([T-028](T-028-el0-userspace-wireup.md)).

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 0010-timer-abstraction.md is broken because the ADR file is named 0010-timer-trait.md (as referenced in current.md). It should be updated to 0010-timer-trait.md.

Suggested change
- **Dependencies:** the timer ([ADR-0010](../../../decisions/0010-timer-abstraction.md)`Cpu::now_ns` / `CNTVCT_EL0`); the scheduler (`yield_now` / `context_switch`), IPC (`ipc_send`/`ipc_recv`), and the EL0 syscall path ([T-028](T-028-el0-userspace-wireup.md)).
- **Dependencies:** the timer ([ADR-0010](../../../decisions/0010-timer-trait.md)`Cpu::now_ns` / `CNTVCT_EL0`); the scheduler (`yield_now` / `context_switch`), IPC (`ipc_send`/`ipc_recv`), and the EL0 syscall path ([T-028](T-028-el0-userspace-wireup.md)).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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/security-reviews/2026-06-01-phase-b-closure.md`:
- Line 13: The table row in the docs contains inline code with unescaped pipe
characters (e.g. USER|EXECUTE, USER|WRITE) which break markdown table parsing;
edit the table cell text to escape the pipes (for example USER\|EXECUTE and
USER\|WRITE) or rewrite the phrases to avoid using '|' so the Mmu::translate,
TTBR0, UXN/PXN, W^X and task_exit_current references stay intact and the row
renders as a single cell.

In `@docs/roadmap/current.md`:
- Around line 7-9: The roadmap has conflicting "current focus" banners — both
"PHASE B CLOSED: B6 Done" / "PHASE B" entries and "Phase C is now active."
remain; reconcile by keeping a single authoritative current-state banner (e.g.,
retain the "PHASE B CLOSED" paragraph that ends with "Phase C is now active.")
and remove or update downstream entries such as the "FIRST USERSPACE TASK RUNS"
banner and any B6/Phase B "Active phase/milestone/task" lines so they no longer
claim Phase B is current; search for the exact strings "PHASE B CLOSED", "Phase
C is now active.", and "FIRST USERSPACE TASK RUNS" to locate and edit the
conflicting sections.

In `@docs/roadmap/phases/phase-b.md`:
- Around line 299-300: Update the closure sentence for Phase B to explicitly
state that per-operation IPC/context-switch micro-measurements were
intentionally deferred to T-029 so that acceptance expectations align; amend the
paragraph that currently reads "Phase B delivered..." / "Phase C is now active"
to append a brief qualifier referencing T-029 (and optionally K3-4/T-029
carry-forward) clarifying that those fine-grained perf micro-benchmarks are
postponed to the T-029 perf micro-bench, ensuring the closure note reconciles
deferred perf acceptance text.
🪄 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: c0184445-bb2c-40c4-a470-86166a33c889

📥 Commits

Reviewing files that changed from the base of the PR and between 0040f23 and eac69d2.

📒 Files selected for processing (8)
  • docs/analysis/reviews/business-reviews/2026-06-01-phase-b-closure.md
  • docs/analysis/reviews/performance-optimization-reviews/2026-06-01-B6-closure.md
  • docs/analysis/reviews/security-reviews/2026-06-01-phase-b-closure.md
  • docs/analysis/tasks/phase-b/T-029-perf-microbench.md
  • docs/guides/first-userspace.md
  • docs/roadmap/current.md
  • docs/roadmap/phases/phase-b.md
  • kernel/src/syscall/dispatch.rs

Comment thread docs/analysis/reviews/security-reviews/2026-06-01-phase-b-closure.md Outdated
Comment thread docs/roadmap/current.md
Comment thread docs/roadmap/phases/phase-b.md Outdated
…rrent.md, tighten dispatch doc

Standing methodology (verify each finding vs current code; fix valid, skip
invalid with reason; minimal):

VALID — fixed:
- F1 GFM table pipes: escape USER\|EXECUTE / USER\|WRITE inside the
  'Memory safety' table cell of the consolidated Phase-B security review
  (unescaped '|' inside inline code still breaks GFM table parsing).
- F2 current.md banner conflict: the status block (Active phase/milestone/
  task + last-completed/working-branch/in-review) was stale from T-024 and
  contradicted the new 'PHASE B CLOSED / Phase C active' banner. Reconciled:
  Active phase -> C; Active milestone/task -> none (B6 + T-022..T-028 Done);
  In review -> PR #43; Working branch -> b6-closure; Last milestone -> B6;
  Last task -> T-028. Historical detail preserved (demoted, not deleted);
  B6 future-tense ('must close gates before a real EL0 task runs') -> past.
- F3 phase-b.md §closure: explicit qualifier that per-op EL0/IPC/ctx-switch
  micro-measurements are intentionally deferred to T-029 and are NOT a
  Phase B acceptance gate.
- F4 dispatch doc: trimmed the phase/date planning prose, kept the
  syscall-input-scoped boundary + the denial-of-self clarification + the
  greppable K3-4 anchor (behavioural contract, not a planning log). Doc-only;
  kernel binary byte-identical.
- aarch64 -> AArch64 in first-userspace.md L81 (repo prose convention; the
  doc's other prose uses already say AArch64; L103 stays the target triple).
- F9 T-029 timer ADR link: 0010-timer-abstraction.md -> 0010-timer-trait.md
  (the only broken relative link across all 7 closure docs; verified by an
  exhaustive link sweep).

SKIPPED — not valid / declined with reason:
- master-plan.md link in the security review: NOT broken — the file exists
  in security-reviews/ where the link points (the reviewer confused it with
  the perf-dir master-plan). Verified on disk.
- Overall: 'centralize the closure narrative' / 'split the dense banner' —
  declined: current.md's convention is self-contained dated superseding
  banners; the bold sub-labels (Guide/Performance/Security/Business) already
  give scan anchors. Centralizing would break the append-only banner model.

Gates: fmt clean, kernel-clippy -D warnings clean, link sweep 0 broken.

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

Copy link
Copy Markdown
Collaborator Author

Thanks — addressed in fa0673b. Verified each finding against the current code; fixed the valid ones (minimal changes), skipped the rest with a reason.

Fixed

  • GFM table pipes (security-reviews/2026-06-01-phase-b-closure.md L13) — escaped USER\|EXECUTE / USER\|WRITE inside the Memory safety cell; confirmed an unescaped | inside inline code still splits a GFM table cell.
  • current.md conflicting banners — the Active phase / milestone / task block (and the last-completed / working-branch / in-review lines) was stale from T-024 time and contradicted the new “PHASE B CLOSED / Phase C active” banner. Reconciled: Active phase → C; Active milestone/task → none (B6 + T-022…T-028 all Done); In review → PR docs(closure): Phase B closure — B6 step 7 (guide, perf baseline, security review, retrospective) #43; Working branch → b6-closure; Last milestone → B6; Last task → T-028. Historical detail is demoted (marked Historical / Earlier), not deleted; the B6 future-tense (“must close the gates before a real EL0 task runs”) is corrected to past tense.
  • phase-b.md §closure — added an explicit qualifier that the per-op EL0/IPC/context-switch micro-measurements are intentionally deferred to T-029 and are not a Phase B acceptance gate.
  • dispatch doc — trimmed the phase/date planning prose; kept the syscall-input-scoped boundary, the denial-of-self not escalation clarification, and a greppable K3-4 anchor (behavioural contract, not a planning log). Doc-only; the kernel binary is byte-identical.
  • aarch64AArch64 (first-userspace.md L81) — matches the repo prose convention (the guide’s other prose already uses AArch64); L103 stays the aarch64-unknown-none target triple.
  • T-029 timer ADR link0010-timer-abstraction.md0010-timer-trait.md. An exhaustive relative-link sweep across all 7 closure docs found this was the only broken link.

Skipped (with reason)

  • master-plan.md link in the security reviewnot broken. docs/analysis/reviews/security-reviews/master-plan.md exists and is exactly where the link points (it’s the security master plan that defines the 8 axes; the perf dir has its own master-plan.md). Verified on disk.
  • “Centralize the closure narrative” / “split the dense banner” (overall) — declined: current.md’s established convention is self-contained, dated, append-only superseding banners, and the bold sub-labels (Guide / Performance / Security / Business) already provide scan anchors. Centralizing into a pointer would break that model and the per-banner historical-snapshot guarantee.

Gates after the round: cargo fmt --all --check clean, cargo kernel-clippy (-D warnings) clean, link sweep 0 broken.

@cemililik cemililik merged commit ca932ac into main Jun 1, 2026
7 checks passed
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