Skip to content

Doc-fix sweep — close 7 Track-E blockers + non-blocker doc drift (comprehensive review follow-up) - #13

Merged
cemililik merged 4 commits into
mainfrom
track-e-doc-fix-sweep
May 6, 2026
Merged

Doc-fix sweep — close 7 Track-E blockers + non-blocker doc drift (comprehensive review follow-up)#13
cemililik merged 4 commits into
mainfrom
track-e-doc-fix-sweep

Conversation

@cemililik

@cemililik cemililik commented May 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes the doc-state-vs-code drift that the 2026-05-06 comprehensive multi-agent code review surfaced as Track E: Request changes — 7 blocker-class items + ~10 non-blocker drift items. None of the items requires a code change; all are factual statements that fell out of sync with the code at HEAD as Phase A → B0 → B1 progressed and individual edits were missed in the doc sweep that should have followed each landing.

This is the α in the post-B1 fix-arc plan (α = Track E doc fixes; β = bulk URL + Yüksek sweep; γ = code-side small polish; then B1 closure trio; then B2 prep). β / γ follow in their own PRs.

Commits

  1. d2a4ab1 docs(architecture,glossary) — closes the 7 Track-E blockers:

    • overview.md BSP table: GICv3 → GICv2 (with a one-line clarifier on -machine gic-version=3).
    • hal.md Mermaid box: BIrq["GICv3 / GIC-400 impl"]"GICv2 / GIC-400 impl".
    • hal.md BSP table interrupt-controller row: GICv3 → GICv2.
    • hal.md Timer subsection: unimplemented!() framing replaced with the post-T-012 reality + ADR-0010 §Revision notes citation + UNSAFE-2026-0021 cross-reference.
    • scheduler.md two passages: idle body spin_loop framing → wait_for_interrupt reality post-T-012 + UNSAFE-2026-0019/0020/0021 citations.
    • security-model.md Open question on DAIF mask: closed by T-013 / ADR-0024 / UNSAFE-2026-0017 (boot.s now masks DAIF as the literal first instruction).
    • glossary.md ADR-0023 dead-link replaced with prose ("see ADR-0023 (accept-deferred per Phase B0 closure)").
  2. 16ba195 docs(root) — refresh root docs for post-B1 reality:

    • README.md repository-layout tree adds kernel/, hal/, test-hal/, bsp-qemu-virt/, tools/ + the docs/ subdirectories with crate-name annotations; the "Source code layout will be added after the architecture phase" closing sentence is replaced with a real status-of-the-tree note.
    • CONTRIBUTING.md "no source code to extend or refactor meaningfully yet" → realistic guidance pointing readers at current.md for active milestone scope.
    • SECURITY.md "no runnable kernel yet" + "(planned, Phase 2)" threat-model qualifiers replaced with the actual status (kernel boots end-to-end on QEMU; security-model.md is Accepted).
  3. f710881 docs(standards,decisions,guides) — non-blocker doc-drift cluster:

    • standards/README.md adds the missing bsp-boot-checklist.md row.
    • decisions/README.md adds the missing ADR-0023 row (Status: Deferred, no file link) so the index no longer jumps 0022 → 0024.
    • decisions/template.md adds a comment block enumerating the five recognised status values (incl. Deferred).
    • architecture/overview.md "(final form documented in hal.md, planned)" → "Accepted".
    • guides/two-task-demo.md expected-output table gains the post-T-009 timer ready and boot-to-end elapsed lines + an idle/fallback-slot mention; per-line table gains rows for both new lines.
    • standards/infrastructure.md §CI Required gates now annotates each as conditional or maintainer-launched; §Configuration files split into "Present at HEAD" + "Planned (when first extern dep lands)" with a code-style.md §Lints back-pointer for sync.

Diff stat

13 files changed, 56 insertions(+), 21 deletions(-)

No code changes. No source compilation impact.

Test plan

  • Reviewer reads each blocker fix in commit d2a4ab1 and confirms the new prose matches the actual source-of-truth file (bsp-qemu-virt/src/gic.rs for GIC version, bsp-qemu-virt/src/main.rs:276 for idle WFI, bsp-qemu-virt/src/boot.s:84 for the DAIF mask, etc.).
  • cargo fmt --check clean (verified — no Rust changes; doc-only PR).
  • cargo host-test, cargo +nightly miri test, cargo kernel-build, cargo host-clippy, cargo kernel-clippy all expected to remain green (no source changes).
  • Reviewer confirms decisions/README.md's new ADR-0023 row matches phase-b.md's ADR ledger (both should now agree on Deferred state).

Out of scope (deferred to subsequent PRs)

  • β PR — bulk URL + Yüksek sweep (J-NB1, J-NB2): 60+ stale cemililik/TyrneOS rustdoc/manifest URLs across 27 files → cemililik/Tyrne; 7 YüksekHigh in committed English docs. Mechanical, single sweep commit each.
  • γ PR — code-side small polish: Aarch64TaskContext size guard, SchedQueue<0> const_assert, CAP_TABLE_CAPACITY const-block migration, ContextSwitch +Send+Sync, three obj-test lint-allow blocks, irq_entry redundant fence + _frame doc + kernel_entry defensive loop, vectors.s ↔ TrapFrame size-assert cross-reference comment. ~9 files, kernel/host-test/miri rerun required.
  • B1 closure trio: opens once α / β / γ all merge — business retrospective + consolidated security review + performance baseline.
  • δ — ADR-0023 placeholder file write (or de-link decision codified): single-ADR work, can run in parallel with γ.
  • B2 prep — ADR-0027 (kernel virtual memory layout) drafting: starts after B1 closure trio.

The 7 doc-drift blockers + non-blocker cluster in this PR are the single largest doc-side debt the comprehensive review identified. Code-side findings (Tier 4 small polish) and bulk URL/Yüksek sweep (Tier 3) are explicitly out of scope here to keep this PR reviewable doc-only.

🤖 Generated with Claude Code

Summary by Sourcery

Align documentation with current post-B1 kernel reality and architecture decisions without changing code.

New Features:

  • Document the current Rust workspace layout, kernel boot status, and roadmap locations in the README, CONTRIBUTING, and SECURITY docs.
  • Expand the two-task demo guide with timer readiness output, end-to-end timing, and idle-dispatch behavior details.

Enhancements:

  • Update HAL, BSP, scheduler, and security-model docs to reflect GICv2 usage, timer IRQ implementation, WFI-based idle, and closed DAIF-masking decisions, with cross-references to ADRs and unsafe-audit entries.
  • Clarify CI infrastructure standards by annotating which gates are conditional or maintainer-run and by distinguishing present vs. planned configuration files with links to lint policy.
  • Add ADR index entry and template guidance for ADR status values, and refresh glossary references to the deferred cross-table capability revocation policy.
  • Extend standards and architecture indices to include the BSP boot checklist and other accepted documents.

Summary by CodeRabbit

  • Documentation
    • Updated project status documentation to reflect end-to-end kernel boot on QEMU aarch64 with a two-task IPC demo.
    • Expanded repository structure and workspace layout documentation.
    • Enhanced architectural design and security model documentation with decision records and references.
    • Updated demo execution guides with detailed output traces and step-by-step sequencing.
    • Refreshed contributor guidelines and infrastructure standards.

cemililik and others added 3 commits May 7, 2026 00:33
Address all seven blocker-class items from Track E of the 2026-05-06
comprehensive code review. Each is a factual statement that fell out
of sync with the code at HEAD; none requires a code change. Fixes
land docs-vs-code consistency at HEAD `9cbf578`.

## docs/architecture/overview.md (Track-E §Blocker #1)

- BSP table row for `bsp-qemu-virt` corrected: GICv3 → GICv2. The
  QEMU `virt` machine defaults to GICv2; the BSP ships a v2-only
  driver per ADR-0011 + UNSAFE-2026-0019. GICv3 requires
  `-machine gic-version=3` and is out of scope for v1.

## docs/architecture/hal.md (Track-E §Blockers #2, #3, #4)

- Mermaid box label: `BIrq["GICv3 / GIC-400 impl"]` →
  `"GICv2 / GIC-400 impl"`. There is no GICv3 impl in tree; the
  bsp-pi4 row at line 198 already correctly notes GIC-400 (a v2
  subset).
- BSP table interrupt-controller row: GICv3 → GICv2.
- Timer subsection: the "`arm_deadline` / `cancel_deadline` are
  `unimplemented!()` in QEMU virt's BSP today" assertion is now
  stale — T-012 (Done 2026-04-28) implemented both bodies under
  UNSAFE-2026-0021. Subsection rewritten to state the real status,
  cite ADR-0010 §Revision notes, and note the smoke-verification
  gap (no v1 caller arms a deadline; `Pending QEMU smoke` notation
  on UNSAFE-2026-0021 records this).

## docs/architecture/scheduler.md (Track-E §Blocker #5)

- Two passages still framed `wait_for_interrupt` activation as a
  *future* T-012 deliverable. T-012 landed 2026-04-28; the BSP's
  `idle_entry` body uses `cpu.wait_for_interrupt(); yield_now(...)`
  per UNSAFE-2026-0019/0020/0021. Both passages updated to state the
  current shape, cite the audit entries, and reference ADR-0022
  §Revision notes 2026-04-28's first-rider Sub-rider closure.

## docs/architecture/security-model.md (Track-E §Blocker #6)

- *Open questions* §"Early IRQ masking in BSP reset vectors" closed
  by T-013 (Done 2026-04-27, ADR-0024, UNSAFE-2026-0017): `boot.s`
  begins `_start` with `msr daifset, #0xf` as the literal first
  instruction, and the BSP boot checklist §1a now records the rule.
  Bullet rewritten as a closure-rider with citations.

## docs/glossary.md (Track-E §Blocker #7)

- CDT entry's live Markdown link to `decisions/0023-...md` (a file
  that does not exist — ADR-0023 is reserved-empty / accept-deferred
  per Phase B0 closure) was a 404 every other reference avoided.
  Replaced with prose only ("see ADR-0023 (accept-deferred per
  Phase B0 closure; no file at HEAD, tracked in `phase-b.md` ADR
  ledger and the B0 closure security review)") so a Markdown reader
  no longer follows the link to a missing file.

Refs: comprehensive-review-2026-05-06, ADR-0010, ADR-0011, ADR-0022,
ADR-0024, ADR-0026
Audit: UNSAFE-2026-0017, UNSAFE-2026-0019, UNSAFE-2026-0020, UNSAFE-2026-0021

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Close three non-blocker drift items from Track E of the 2026-05-06
comprehensive code review. Each was a Phase-A-era framing that no
longer matches the post-B1 tree.

## README.md

Repository-layout tree previously listed only `docs/` + root-level
files and ended with "Source code layout … will be added after the
architecture phase." Phase A and B0/B1 are closed; the Rust
workspace contains four crates totalling ~9 590 LOC. Replaced with
the actual top-level layout (kernel/, hal/, test-hal/,
bsp-qemu-virt/, tools/, plus the docs/ subdirectories — audits,
analysis, roadmap), with crate-name annotations and pointers to
ADR-0006, the two-task-demo guide, and current.md.

## CONTRIBUTING.md

"There is no source code to extend or refactor meaningfully yet"
is no longer accurate. Reframed to describe the actual contribution
expectation: source PRs welcome but should align with the active
milestone in current.md to avoid premature rewrites; the kernel
boots end-to-end on QEMU virt today.

## SECURITY.md

"There is no runnable kernel yet" is stale (kernel boots end-to-end
on QEMU and runs the two-task IPC demo). The "(planned, Phase 2)"
qualifier on the threat-model document is also stale —
`docs/architecture/security-model.md` is Accepted at HEAD. Sentence
rewritten to acknowledge current state while preserving the
"pre-alpha; no production guarantees" framing.

Refs: comprehensive-review-2026-05-06, ADR-0006

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closes the remaining Track-E + Track-H + Track-I non-blocker doc
drift items the comprehensive code review at HEAD `9cbf578`
identified. All single-edit clarifications; no policy change.

## docs/standards/README.md

Standards index missed `bsp-boot-checklist.md`. The file exists, is
in active use (referenced from `unsafe-policy.md §5a`,
`security-model.md §Open questions`, T-013 review-history), and is
genuinely a `Accepted` standard — only the index row was missing.
Added.

## docs/decisions/README.md

ADR index jumped 0022 → 0024 with no row for ADR-0023, while
`phase-b.md`'s ADR ledger and prose elsewhere reference ADR-0023 as
accept-deferred. The two indices disagreed on whether a
deferred-without-file ADR appears as a row. Added an ADR-0023 row
in the index (Status: Deferred, no file link) so a future reader
scanning the README does not miss the deferred slot.

## docs/decisions/template.md

The template's status enum implicitly listed only Proposed /
Accepted / Deprecated / Superseded by NNNN. ADR-0018 and ADR-0023
both use a real `Deferred` state introduced by ADR-0025-era
governance amendments. Added a comment block after the frontmatter
documenting the five recognised status values, including Deferred.

## docs/architecture/overview.md

The "(final form documented in `hal.md`, planned)" parenthetical on
the HAL trait surface is stale — hal.md is Accepted and shipped.
Replaced "planned" with "Accepted" so `overview.md`'s framing
matches `hal.md`'s actual status.

## docs/guides/two-task-demo.md

Expected-output table previously omitted two production lines
emitted by `bsp-qemu-virt::main.rs` post-T-009: `tyrne: timer
ready (...)` and `tyrne: boot-to-end elapsed = ... ns`. Added both
to the trace block with a note that the values are
QEMU-default-dependent. Execution-trace prose now mentions idle's
fallback-slot registration per ADR-0026, replacing the obsolete
"a dedicated `wfe`-based idle path is Phase B work" line — that
work landed in T-012, and T-014 / ADR-0026 then moved idle out of
the FIFO into a fallback slot. Per-line table gains rows for the
timer-ready and boot-to-end-elapsed lines.

## docs/standards/infrastructure.md

Two doc-vs-state mismatches the comprehensive review surfaced:

1. **§Continuous integration → Required gates** listed `cargo audit`
   / `cargo vet check` / "QEMU smoke" as merge-blockers, but
   `.github/workflows/ci.yml` does not run any of the three
   (Cargo.lock has zero external entries, so the supply-chain
   gates would be no-ops; the QEMU smoke is maintainer-launched).
   Each gate now carries an inline parenthetical noting the
   conditional ("currently dormant: zero external dependencies"
   / "maintainer-launched only; no `qemu-smoke` CI job yet").
2. **§Configuration files** previously listed `supply-chain/config.toml`,
   `supply-chain/audits.toml`, and `.github/dependabot.yml` as if
   present; none exist at HEAD. Split the table into "Present at
   HEAD" and "Planned (when first extern dep lands)" sub-headings,
   added the trigger pointer to `add-dependency` skill, and added
   a sentence noting that the lint set is canonical at
   `code-style.md §Lints` so the two standards stay obviously in
   sync. The Present table also picks up a one-line note that
   `miri` is added on-demand by the CI job, not declared in
   `rust-toolchain.toml`'s components array.

Refs: comprehensive-review-2026-05-06, ADR-0018, ADR-0023, ADR-0025,
ADR-0026

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

@sourcery-ai

sourcery-ai Bot commented May 6, 2026

Copy link
Copy Markdown

Reviewer's Guide

Doc-only PR that brings architecture, glossary, standards, guides, and root docs back in sync with the current kernel/ HAL/ BSP implementation after T-009/T-012/T-013/B0/B1, mainly correcting GIC version, timer/idle behavior, DAIF masking status, ADR indices/status, and top-level project status and layout.

File-Level Changes

Change Details Files
Align architecture docs with current BSP HAL implementation for timer, IRQ, idle, and GIC version.
  • Update HAL mermaid diagram and BSP table to describe QEMU virt using a GICv2 implementation and explicitly scope out GICv3
  • Rewrite timer trait section to reflect that arm_deadline/cancel_deadline are now fully implemented in the QEMU virt BSP, with references into ADR-0010 and UNSAFE-2026-0021
  • Clarify that the IRQ-armed timer paths are compiled and audited but not yet exercised by the cooperative demo, with smoke-testing deferred to future work
  • Update scheduler ADR summary and idle-task sections to describe the WFI-based idle body (via cpu.wait_for_interrupt(); yield_now) as the production shape post-T-012, with audit-log cross-references
  • Adjust architecture overview HAL section to mark the trait surface as Accepted, and document bsp-qemu-virt as a GICv2-based BSP with links to gic.rs, ADR-0011, and UNSAFE-2026-0019
docs/architecture/hal.md
docs/architecture/overview.md
docs/architecture/scheduler.md
Close previously open architecture/security questions by recording completed work and tying it to tasks, ADRs, and unsafe-audit entries.
  • Mark the early-IRQ-masking question in the security model as closed by T-013/ADR-0024, with DAIF masking now the first instruction in boot.s and boot checklist requirements updated
  • Reference UNSAFE-2026-0017 as the audit trail for the DAIF masking change and describe the new structural requirement for future BSPs
docs/architecture/security-model.md
Bring guides and glossary in line with the timer, idle, and ADR ledger realities after recent tasks.
  • Extend the two-task demo expected output with the timer ready and boot-to-end elapsed lines and explain their typical values and dependence on host performance
  • Update the demo narrative to explain how idle is registered via the separate fallback slot and how it uses WFI once both tasks are spinning
  • Adjust the per-line table to account for timer and elapsed-time lines and describe what each confirms about the system
  • Update the CDT glossary entry to explain that cross-table transitivity is deferred with ADR-0023 in an Accept-Deferred state, tracked in the roadmap and security review
docs/guides/two-task-demo.md
docs/glossary.md
Refresh root-level project docs to reflect that the Rust workspace and booting kernel now exist and to steer contributors toward current roadmap scope.
  • Expand the README repository tree to enumerate the four workspace crates and new docs subdirectories, including brief annotations for each
  • Replace the placeholder "source layout after architecture" text with a description of the existing four-crate workspace and links to the two-task demo and current roadmap
  • Relax CONTRIBUTING to allow code PRs within the active milestone scope, pointing contributors to docs/roadmap/current.md before opening substantial changes
  • Update SECURITY to note that the kernel now boots end-to-end on QEMU virt and runs the IPC demo, while still providing no production guarantees and pointing to the now-Accepted security model doc
README.md
CONTRIBUTING.md
SECURITY.md
Fix ADR and standards index drift and clarify ADR status semantics.
  • Add ADR-0023 to the decisions index as Deferred with a note that there is no file at HEAD and that it is tracked in the Phase B ADR ledger
  • Update the ADR template with a commented list of allowed status values including Deferred and Superseded
  • Add the missing bsp-boot-checklist standard into the standards index with a summary of its DAIF/EL-drop/vector/GIC rules
docs/decisions/README.md
docs/decisions/template.md
docs/standards/README.md
Clarify infrastructure standards around CI gates, conditional supply-chain checks, and configuration files present vs. planned.
  • Annotate CI Required gates to clarify that QEMU smoke is maintainer-launched only and that cargo audit/cargo vet are conditional until external dependencies are introduced
  • Restructure the configuration-files section into Present vs Planned, aligning it with the current state of the repo and the add-dependency skill
  • Add detail on Miri installation expectations and list active GitHub workflow jobs at HEAD
  • Clarify that the future supply-chain/ directory is not present yet and is created when the first external dependency is added
docs/standards/infrastructure.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 May 6, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@cemililik has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 45 minutes and 37 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 84c15dde-be8a-43b3-be66-d64a5bb9aea2

📥 Commits

Reviewing files that changed from the base of the PR and between f710881 and a30fb25.

📒 Files selected for processing (4)
  • docs/architecture/scheduler.md
  • docs/architecture/security-model.md
  • docs/guides/two-task-demo.md
  • docs/standards/infrastructure.md
📝 Walkthrough

Walkthrough

Documentation updates across multiple files to reflect current project status (end-to-end boot on QEMU aarch64 with two-task IPC demo), refined architectural details (GICv2-based HAL, WFI-idle scheduler), new decision records, glossary expansions, and expanded execution guides.

Changes

Documentation Updates

Layer / File(s) Summary
Project Status & Overview
CONTRIBUTING.md, README.md, SECURITY.md
Contributor guidelines updated to reference milestone-scoped PRs and roadmap. README expanded to document four-crate Rust workspace (kernel, hal, test-hal, bsp-qemu-virt) per ADR-0006. SECURITY.md revised to reflect Phase A + B0/B1 closure: end-to-end boot on QEMU aarch64, two-task IPC demo, non-userspace state with Accepted threat-model reference.
Architectural Refinements
docs/architecture/hal.md, docs/architecture/overview.md, docs/architecture/scheduler.md
HAL documentation updated: IRQ controller changed from GICv3 to GICv2 (GIC-400), Timer trait IRQ-armed path marked fully implemented in QEMU virt as of T-012. Overview expanded with GICv2 default behavior and v2-only driver details. Scheduler documentation revised to describe WFI-based idle task and wake-source prerequisites (replacing spin_loop model).
Security Model & Open Questions
docs/architecture/security-model.md
Three new open questions added: IOMMU/SMMU policy per target, concrete quota bounds, cross-table CDT. Early IRQ masking entry closed by T-013, describing new reset-vector prologue with DAIF masking and audit trail.
Decision Records & References
docs/decisions/README.md, docs/decisions/template.md, docs/glossary.md
New ADR-0023 entry added for "Cross-table capability revocation policy" with Deferred status. Template.md gains Status enum documentation. CDT glossary entry expanded to detail transitivity, per-table scope, and ADR-0023 references.
Execution Guides & Standards
docs/guides/two-task-demo.md, docs/standards/README.md, docs/standards/infrastructure.md
Two-task demo guide expanded with detailed timer readiness, elapsed timing, and step-by-step IPC sequencing trace. Standards index gains bsp-boot-checklist entry. Infrastructure.md adds explicit CI gates (QEMU smoke, cargo-audit, cargo vet) and new Configuration files section documenting present-at-HEAD and planned supply-chain files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • cemililik/Tyrne#6: Main PR documents the raw-pointer scheduler IPC-bridge and idle-task/code changes introduced in PR #6 through ADR and architecture updates.
  • cemililik/Tyrne#8: Both PRs interact with HAL timer: main PR documents Timer trait implementation (CNTV_* wiring, cached CNTFRQ/CNTVCT) that PR #8 lands in hal/src/timer.rs.
  • cemililik/Tyrne#10: Main PR documents GICv2 driver, WFI idle task, CNTV_* timer wiring, and EL1 vector trampolines that PR #10 implements.

Poem

📚 A rabbit hops through pages long,
Documenting truth and right and wrong,
Four crates now dance in harmony, ✨
With GICv2 and WFI spree,
The demo runs—two tasks in glee! 🐇

🚥 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 pull request title accurately summarizes the main objectives: a documentation-only change addressing Track-E blockers and documentation drift across multiple files, as confirmed by the comprehensive file-level changes in README, CONTRIBUTING, SECURITY, and architecture documentation.
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 track-e-doc-fix-sweep

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.

❤️ Share

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 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/standards/infrastructure.md" line_range="72" />
<code_context>
-- `cargo audit` — fails on known advisories. `cargo-audit` database is updated weekly in CI.
-- `cargo vet check` — fails if any dependency is not audited.
+- QEMU smoke — kernel boots under `qemu-system-aarch64 -machine virt` and reaches the success marker. *(As of 2026-05: maintainer-launched only; no `qemu-smoke` CI job yet — tracked as a B2-or-later roadmap follow-up.)*
+- `cargo audit` — fails on known advisories. `cargo-audit` database is updated weekly in CI. *(Conditional — currently dormant: `Cargo.lock` carries zero external dependencies, so the gate would be a no-op. The job is wired in once the first extern dep lands per [add-dependency](../../.claude/skills/add-dependency/SKILL.md).)*
+- `cargo vet check` — fails if any dependency is not audited. *(Same conditional — see `cargo audit` above.)*

</code_context>
<issue_to_address>
**suggestion (typo):** Consider spelling out “extern dep” as “external dependency” for clarity.

In this sentence, the shorthand stands out against the otherwise consistent use of “dependency/dependencies.” Using “the first external dependency” here would keep terminology consistent and be clearer, especially for new readers.

```suggestion
- `cargo audit` — fails on known advisories. `cargo-audit` database is updated weekly in CI. *(Conditional — currently dormant: `Cargo.lock` carries zero external dependencies, so the gate would be a no-op. The job is wired in once the first external dependency lands per [add-dependency](../../.claude/skills/add-dependency/SKILL.md).)*
```
</issue_to_address>

### Comment 2
<location path="docs/standards/infrastructure.md" line_range="156" />
<code_context>
 | `.cargo/config.toml` | Target triples, linker flags per target. |
+| `.github/workflows/*.yml` | CI pipelines. Active jobs at HEAD: `lint-and-host-test`, `kernel-build`, `miri`, `coverage`. |
+
+### Planned (when first extern dep lands)
+
+| File | Purpose |
</code_context>
<issue_to_address>
**suggestion (typo):** Clarify “extern dep” in the heading by expanding it to “external dependency”.

Prefer the full phrase “external dependency” (e.g., “when the first external dependency lands”) to avoid confusing readers who may not recognize the abbreviation.
</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/standards/infrastructure.md Outdated
Comment thread docs/standards/infrastructure.md Outdated
| `.cargo/config.toml` | Target triples, linker flags per target. |
| `.github/workflows/*.yml` | CI pipelines. Active jobs at HEAD: `lint-and-host-test`, `kernel-build`, `miri`, `coverage`. |

### Planned (when first extern dep lands)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (typo): Clarify “extern dep” in the heading by expanding it to “external dependency”.

Prefer the full phrase “external dependency” (e.g., “when the first external dependency lands”) to avoid confusing readers who may not recognize the abbreviation.

@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 updates the project documentation to reflect the completion of Phase A and B0/B1 milestones, specifically the successful end-to-end kernel boot on QEMU virt. Key changes include updating the workspace layout in the README, refining HAL and scheduler documentation to reflect the implementation of timer IRQs and WFI-based idle tasks, and closing security model items related to early IRQ masking. Feedback focuses on improving documentation maintainability by removing hardcoded commit hashes and line numbers, and correcting a description of task behavior in the cooperative scheduler to ensure it accurately reflects the need for yielding to avoid starvation.

Comment thread docs/architecture/scheduler.md Outdated
- [ADR-0019: Scheduler shape](../decisions/0019-scheduler-shape.md) — cooperative single-core FIFO; ready queue is a fixed-capacity bounded `SchedQueue` indexed against a per-task arena. Capacity is `TASK_ARENA_CAPACITY` (currently 16).
- [ADR-0020: `ContextSwitch` trait and `Cpu` v2](../decisions/0020-cpu-trait-v2-context-switch.md) — register save/restore is a HAL primitive; the scheduler holds the per-task context array and never inspects its contents.
- [ADR-0022: Idle task and typed scheduler deadlock error](../decisions/0022-idle-task-and-typed-scheduler-deadlock.md) — the BSP registers an idle task at boot so the FIFO is never structurally empty; `SchedError::Deadlock` survives as a defensive return for preemption / SMP / a misconfigured BSP. ADR-0022's first rider clarifies that the idle task's body uses `core::hint::spin_loop` until [T-012](../analysis/tasks/phase-b/T-012-exception-and-irq-infrastructure.md) wires the timer IRQ.
- [ADR-0022: Idle task and typed scheduler deadlock error](../decisions/0022-idle-task-and-typed-scheduler-deadlock.md) — the BSP registers an idle task at boot so the FIFO is never structurally empty; `SchedError::Deadlock` survives as a defensive return for preemption / SMP / a misconfigured BSP. The idle task's body uses `cpu.wait_for_interrupt()` followed by `yield_now`; the time-source half (T-009) and IRQ-delivery half (T-012) of ADR-0010 are both live, so WFI is the production form. The interim `core::hint::spin_loop()` shape ADR-0022's first rider introduced was retired by T-012 (commit `b4ed68c`); see ADR-0022 §Revision notes 2026-04-28 for the closure of the first rider's *Sub-rider* under [UNSAFE-2026-0019](../audits/unsafe-log.md) / [UNSAFE-2026-0020](../audits/unsafe-log.md) / [UNSAFE-2026-0021](../audits/unsafe-log.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

Hardcoding commit hashes in architectural documentation creates a maintenance burden and can lead to broken or misleading links if the repository history is rewritten (e.g., via rebase). It is generally safer to refer to stable identifiers like Task IDs (T-012) or ADRs.

Suggested change
- [ADR-0022: Idle task and typed scheduler deadlock error](../decisions/0022-idle-task-and-typed-scheduler-deadlock.md) — the BSP registers an idle task at boot so the FIFO is never structurally empty; `SchedError::Deadlock` survives as a defensive return for preemption / SMP / a misconfigured BSP. The idle task's body uses `cpu.wait_for_interrupt()` followed by `yield_now`; the time-source half (T-009) and IRQ-delivery half (T-012) of ADR-0010 are both live, so WFI is the production form. The interim `core::hint::spin_loop()` shape ADR-0022's first rider introduced was retired by T-012 (commit `b4ed68c`); see ADR-0022 §Revision notes 2026-04-28 for the closure of the first rider's *Sub-rider* under [UNSAFE-2026-0019](../audits/unsafe-log.md) / [UNSAFE-2026-0020](../audits/unsafe-log.md) / [UNSAFE-2026-0021](../audits/unsafe-log.md).
- [ADR-0022: Idle task and typed scheduler deadlock error](../decisions/0022-idle-task-and-typed-scheduler-deadlock.md) — the BSP registers an idle task at boot so the FIFO is never structurally empty; `SchedError::Deadlock` survives as a defensive return for preemption / SMP / a misconfigured BSP. The idle task's body uses `cpu.wait_for_interrupt()` followed by `yield_now`; the time-source half (T-009) and IRQ-delivery half (T-012) of ADR-0010 are both live, so WFI is the production form. The interim `core::hint::spin_loop()` shape ADR-0022's first rider introduced was retired by T-012; see ADR-0022 §Revision notes 2026-04-28 for the closure of the first rider's *Sub-rider* under [UNSAFE-2026-0019](../audits/unsafe-log.md) / [UNSAFE-2026-0020](../audits/unsafe-log.md) / [UNSAFE-2026-0021](../audits/unsafe-log.md).

Comment thread docs/architecture/scheduler.md Outdated
### Idle task and structural non-emptiness

ADR-0022 mandates that the BSP register a single, lowest-priority idle task at boot. Its presence makes the FIFO ready queue structurally non-empty for the lifetime of the kernel. The idle task's body in v1 is `core::hint::spin_loop()` followed by `yield_now`, not `wait_for_interrupt`, because no IRQ source is configured before [T-012](../analysis/tasks/phase-b/T-012-exception-and-irq-infrastructure.md). When T-012 lands, the body switches to `cpu.wait_for_interrupt(); yield_now(...)` and the scheduler's behaviour is unchanged from the outside.
ADR-0022 mandates that the BSP register a single, lowest-priority idle task at boot. Its presence makes the FIFO ready queue structurally non-empty for the lifetime of the kernel. The idle task's body is `cpu.wait_for_interrupt()` followed by `yield_now` — the production form ADR-0022's *Decision outcome* originally specified. T-012 (commit `b4ed68c`, Done 2026-04-28) closed ADR-0022's first rider's *Sub-rider* by landing both halves of the wake-source precondition (T-009's `CNTVCT_EL0` time source and T-012's GIC v2 + `VBAR_EL1` IRQ delivery), so WFI is now safe to issue under v1; the interim `core::hint::spin_loop()` shape the first rider introduced is retired. Audit citations: [UNSAFE-2026-0019](../audits/unsafe-log.md) (GIC MMIO), [UNSAFE-2026-0020](../audits/unsafe-log.md) (vector table), [UNSAFE-2026-0021](../audits/unsafe-log.md) (timer compare-register writes). See [`docs/architecture/exceptions.md` §"Idle's `wfi` activation"](exceptions.md) for the cross-cutting picture.

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

As noted previously, hardcoding commit hashes in documentation is prone to becoming stale. Consider removing the specific hash and relying on the Task ID (T-012) and date for reference.

Suggested change
ADR-0022 mandates that the BSP register a single, lowest-priority idle task at boot. Its presence makes the FIFO ready queue structurally non-empty for the lifetime of the kernel. The idle task's body is `cpu.wait_for_interrupt()` followed by `yield_now` — the production form ADR-0022's *Decision outcome* originally specified. T-012 (commit `b4ed68c`, Done 2026-04-28) closed ADR-0022's first rider's *Sub-rider* by landing both halves of the wake-source precondition (T-009's `CNTVCT_EL0` time source and T-012's GIC v2 + `VBAR_EL1` IRQ delivery), so WFI is now safe to issue under v1; the interim `core::hint::spin_loop()` shape the first rider introduced is retired. Audit citations: [UNSAFE-2026-0019](../audits/unsafe-log.md) (GIC MMIO), [UNSAFE-2026-0020](../audits/unsafe-log.md) (vector table), [UNSAFE-2026-0021](../audits/unsafe-log.md) (timer compare-register writes). See [`docs/architecture/exceptions.md` §"Idle's `wfi` activation"](exceptions.md) for the cross-cutting picture.
ADR-0022 mandates that the BSP register a single, lowest-priority idle task at boot. Its presence makes the FIFO ready queue structurally non-empty for the lifetime of the kernel. The idle task's body is `cpu.wait_for_interrupt()` followed by `yield_now` — the production form ADR-0022's *Decision outcome* originally specified. T-012 (Done 2026-04-28) closed ADR-0022's first rider's *Sub-rider* by landing both halves of the wake-source precondition (T-009's `CNTVCT_EL0` time source and T-012's GIC v2 + `VBAR_EL1` IRQ delivery), so WFI is now safe to issue under v1; the interim `core::hint::spin_loop()` shape the first rider introduced is retired. Audit citations: [UNSAFE-2026-0019](../audits/unsafe-log.md) (GIC MMIO), [UNSAFE-2026-0020](../audits/unsafe-log.md) (vector table), [UNSAFE-2026-0021](../audits/unsafe-log.md) (timer compare-register writes). See [`docs/architecture/exceptions.md` §"Idle's `wfi` activation"](exceptions.md) for the cross-cutting picture.

Comment thread docs/architecture/security-model.md Outdated
- **Concrete bounds** for the quotas under *Bounded kernel resources*: numeric defaults for each, per-target tuning policy, and how upgrades change them without invalidating running systems.
- **Cross-table capability derivation tree (CDT).** Whether IPC-transferred capabilities should retain a parent-child link to the sender's entry so that the sender can revoke the copy post-transfer, and — if so — how per-task-table CDT storage scales. seL4's answer is a whole-system CDT; Phase B needs to decide before the first multi-task system uses transfer as a revoke-retained grant. See the v1 qualification on *Revocation is transitive* above.
- **Early IRQ masking in BSP reset vectors.** v1's `boot.s` on QEMU `virt` does not explicitly `msr daifset, #0xf` before stack / BSS setup the reset state happens to leave interrupts effectively masked (no IRQ source is configured and the GIC is untouched), but this is a per-platform accident rather than a guarantee. Future BSPs should adopt "mask DAIF first, everything else after" as a standard reset-vector prologue; add the instruction to the [BSP boot checklist](../standards/bsp-boot-checklist.md) and audit the existing checklist at that time.
- **Early IRQ masking in BSP reset vectors.** ✅ **Closed by [T-013](../analysis/tasks/phase-b/T-013-el-drop-to-el1.md) (Done 2026-04-27, ADR-0024, [UNSAFE-2026-0017](../audits/unsafe-log.md)).** `bsp-qemu-virt/src/boot.s:84` now begins `_start` with `msr daifset, #0xf` as the **literal first instruction** before stack/BSS setup, and the [BSP boot checklist §1a](../standards/bsp-boot-checklist.md) records "mask DAIF first" as a standard reset-vector prologue every future BSP must observe. The previous "per-platform accident" framing is retired; DAIF masking is now a structural property of every Tyrne reset vector, with the audit trail captured under UNSAFE-2026-0017's first Amendment block. Future BSPs (`bsp-pi4`, etc.) inherit the rule via the boot checklist.

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

Hardcoding line numbers in documentation is prone to drift. Since the instruction is at the beginning of the _start symbol, it is more robust to refer to the symbol itself rather than a specific line number in boot.s.

Suggested change
- **Early IRQ masking in BSP reset vectors.****Closed by [T-013](../analysis/tasks/phase-b/T-013-el-drop-to-el1.md) (Done 2026-04-27, ADR-0024, [UNSAFE-2026-0017](../audits/unsafe-log.md)).** `bsp-qemu-virt/src/boot.s:84` now begins `_start` with `msr daifset, #0xf` as the **literal first instruction** before stack/BSS setup, and the [BSP boot checklist §1a](../standards/bsp-boot-checklist.md) records "mask DAIF first" as a standard reset-vector prologue every future BSP must observe. The previous "per-platform accident" framing is retired; DAIF masking is now a structural property of every Tyrne reset vector, with the audit trail captured under UNSAFE-2026-0017's first Amendment block. Future BSPs (`bsp-pi4`, etc.) inherit the rule via the boot checklist.
- **Early IRQ masking in BSP reset vectors.****Closed by [T-013](../analysis/tasks/phase-b/T-013-el-drop-to-el1.md) (Done 2026-04-27, ADR-0024, [UNSAFE-2026-0017](../audits/unsafe-log.md)).** The `_start` symbol in `bsp-qemu-virt/src/boot.s` now begins with `msr daifset, #0xf` as the **literal first instruction** before stack/BSS setup, and the [BSP boot checklist §1a](../standards/bsp-boot-checklist.md) records "mask DAIF first" as a standard reset-vector prologue every future BSP must observe. The previous "per-platform accident" framing is retired; DAIF masking is now a structural property of every Tyrne reset vector, with the audit trail captured under UNSAFE-2026-0017's first Amendment block. Future BSPs (`bsp-pi4`, etc.) inherit the rule via the boot checklist.

Comment thread docs/guides/two-task-demo.md Outdated
```

After printing "all tasks complete", Task A enters a `core::hint::spin_loop()`. The kernel halts in this state; QEMU continues running but produces no further output. The specific instruction the hint lowers to is up to the compiler and is not load-bearing — a dedicated `wfe`-based idle path is Phase B work (see ADR-0019 open questions). Terminate with **Ctrl-A x** (QEMU monitor quit).
The frequency in `timer ready` (`62500000 Hz`) and the elapsed-time figure on the last line are QEMU-default values; on real hardware the frequency varies (see [ADR-0010 §References](../decisions/0010-timer-trait.md)) and the elapsed time depends on the host's QEMU performance — single-digit-millisecond order is typical on modern laptops. After printing "all tasks complete" and the boot-to-end timing line, Task A enters a `core::hint::spin_loop()`. Idle is registered separately via [`register_idle`](../../kernel/src/sched/mod.rs) per [ADR-0026](../decisions/0026-idle-dispatch-fallback.md), so once both application tasks are stuck in their spin tails the dispatcher's fallback resolves to idle, which issues `wait_for_interrupt` (`WFI`); QEMU continues running but produces no further serial output. Terminate with **Ctrl-A x** (QEMU monitor quit).

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

In a cooperative scheduler, a task entering a core::hint::spin_loop() without yielding will starve the system, preventing the dispatcher from ever reaching the idle task. The description of the fallback resolving to idle implies that the application tasks must yield in their "spin tails". Consider updating the description to clarify that these tasks yield.

Suggested change
The frequency in `timer ready` (`62500000 Hz`) and the elapsed-time figure on the last line are QEMU-default values; on real hardware the frequency varies (see [ADR-0010 §References](../decisions/0010-timer-trait.md)) and the elapsed time depends on the host's QEMU performance — single-digit-millisecond order is typical on modern laptops. After printing "all tasks complete" and the boot-to-end timing line, Task A enters a `core::hint::spin_loop()`. Idle is registered separately via [`register_idle`](../../kernel/src/sched/mod.rs) per [ADR-0026](../decisions/0026-idle-dispatch-fallback.md), so once both application tasks are stuck in their spin tails the dispatcher's fallback resolves to idle, which issues `wait_for_interrupt` (`WFI`); QEMU continues running but produces no further serial output. Terminate with **Ctrl-A x** (QEMU monitor quit).
The frequency in `timer ready` (`62500000 Hz`) and the elapsed-time figure on the last line are QEMU-default values; on real hardware the frequency varies (see [ADR-0010 §References](../decisions/0010-timer-trait.md)) and the elapsed time depends on the host's QEMU performance — single-digit-millisecond order is typical on modern laptops. After printing "all tasks complete" and the boot-to-end timing line, Task A enters a loop that calls `yield_now()`. Idle is registered separately via [`register_idle`](../../kernel/src/sched/mod.rs) per [ADR-0026](../decisions/0026-idle-dispatch-fallback.md), so once both application tasks are stuck in their yielding spin tails the dispatcher's fallback resolves to idle, which issues `wait_for_interrupt` (`WFI`); QEMU continues running but produces no further serial output. Terminate with **Ctrl-A x** (QEMU monitor quit).

@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: 1

🤖 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/architecture/scheduler.md`:
- Line 11: Update the ADR-0022 passage so it describes the idle task as a
separate fallback consulted only when the ready FIFO is empty (per ADR-0026's
model `ready.dequeue().or(s.idle)`), not as making the FIFO structurally
non-empty; rephrase sentences that currently state the BSP registers an idle
task "so the FIFO is never structurally empty" to instead state the BSP
registers an idle fallback slot used when the ready queue is empty, and apply
the same rewording to the other occurrence noted (line 73); keep references to
`SchedError::Deadlock`, `cpu.wait_for_interrupt()`, `yield_now`, and the retired
`core::hint::spin_loop()` comment intact but ensure they no longer imply FIFO
residency.
🪄 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: 71369e3d-50c5-48fc-8f62-dac0e74b8da5

📥 Commits

Reviewing files that changed from the base of the PR and between 298b5d2 and f710881.

📒 Files selected for processing (13)
  • CONTRIBUTING.md
  • README.md
  • SECURITY.md
  • docs/architecture/hal.md
  • docs/architecture/overview.md
  • docs/architecture/scheduler.md
  • docs/architecture/security-model.md
  • docs/decisions/README.md
  • docs/decisions/template.md
  • docs/glossary.md
  • docs/guides/two-task-demo.md
  • docs/standards/README.md
  • docs/standards/infrastructure.md

Comment thread docs/architecture/scheduler.md Outdated
…etation)

Address inline + bot comments on PR #13. Each finding verified
against current code; 7 applied, 1 applied with corrected
interpretation (the suggested fix did not match the source).

## Applied

1. **scheduler.md line 11 + line 73** — Idle is a fallback slot, not a
   FIFO resident.
   (User inline comment + coderabbitai-bot + gemini-code-assist-bot.)
   Both passages now describe idle per ADR-0026: "lives in a dedicated
   `Scheduler::idle: Option<TaskHandle>` fallback slot — not in the
   FIFO ready queue — and the dispatcher consults it only when the
   ready queue is empty (`ready.dequeue().or(s.idle)`)". The
   "structurally non-empty FIFO" framing was inherited from ADR-0022
   Option A and contradicted the same file's later §Revision notes
   that already records the ADR-0026 supersession. Both passages also
   drop the hardcoded commit `b4ed68c` per gemini's suggestion (commit
   hashes drift when history is rewritten; T-012 + Done date is the
   stable identifier).

2. **security-model.md line 330** — Replace `boot.s:84` line ref with
   `_start` symbol reference.
   (gemini-code-assist-bot.) Line numbers in `boot.s` drift on every
   asm edit; the `_start` symbol is stable and the rule is "literal
   first instruction of `_start`", so the reference now reads "The
   `_start` symbol in `bsp-qemu-virt/src/boot.s` now begins with
   `msr daifset, #0xf` as the **literal first instruction**".

3. **two-task-demo.md line 47** — Honestly describe what happens after
   "all tasks complete".
   (gemini-code-assist-bot, with **corrected interpretation**.)
   gemini's suggested fix said "Task A enters a loop that calls
   `yield_now()`" — but that does not match the actual source.
   `bsp-qemu-virt/src/main.rs:486` ends task_a with
   `loop { core::hint::spin_loop(); }` (no `yield_now`). Under a
   cooperative scheduler this means Task A holds the CPU forever and
   idle is **structurally never dispatched** in this demo. Doc text
   updated to match: "Task A enters `loop { core::hint::spin_loop()
   }`. The cooperative scheduler does not preempt; Task A never
   yields out of this loop, so the CPU stays parked there
   indefinitely … idle is structurally unreached and the WFI path
   stays cold." Idle's fallback-slot wiring is still correctly
   described per ADR-0026 — it is reachable in principle, just not
   exercised by this demo's tail behaviour.

4. **infrastructure.md line 72 + line 156** — Spell out "extern dep" as
   "external dependency".
   (sourcery-ai-bot ×2 + matches user's inline message.)
   Two occurrences in the file (line 72's `cargo audit` conditional
   note and line 156's "Planned" sub-heading); both replaced via a
   `replace_all` substitution. The body of the Planned section
   already said "external dependency" / "external dependencies"
   consistently; the abbreviation was an outlier.

## Verification

`cargo fmt --check` clean (no source changes); doc-only PR. Diff
stat: 4 files, +6/-6.

Refs: PR #13, comprehensive-review-2026-05-06, ADR-0026

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cemililik
cemililik merged commit cfc4924 into main May 6, 2026
6 checks passed
cemililik added a commit that referenced this pull request May 7, 2026
…2 prep activated

Closes B1 — Drop to EL1 + exception infrastructure. The fresh
closure trio replaces the 2026-04-28 trio's load-bearing role:
that trio approved B1 implementation-complete based on host-test
+ miri + paper-review evidence; the maintainer-side QEMU smoke
(still `Pending QEMU smoke verification` on UNSAFE-2026-0019/0020/0021
at the time) had not run. When the maintainer ran it on 2026-05-06,
the smoke surfaced an idle-dispatch regression. T-014 fixed the
regression; the comprehensive multi-agent code review (also
2026-05-06) generated α/β/γ doc-polish PRs; today's trio records
what B1 actually is once smoke-verified end-to-end.

## Three new review artefacts

- docs/analysis/reviews/business-reviews/2026-05-07-B1-closure.md
  — Period 2026-04-28 → 2026-05-07. What landed (T-014 + ADR-0026 +
  PRs #12 / #13 / #14 / #15); what changed in the plan (B1
  reopen → T-014 fix → fresh closure; B2 prep reactivated; ADR-0026
  repurposed); what we learned (smoke is the project's only end-to-
  end liveness oracle; ADR analysis must simulate, not just argue;
  comprehensive review's blind spot was "did you actually run the
  program?"; bot-driven review-rounds are productive when findings
  are factual-mechanical, less so when stylistic). Adjustments
  include "no closure-trio without recorded smoke", write-adr
  skill simulation-table check, comprehensive-review Track K — Live
  execution.

- docs/analysis/reviews/security-reviews/2026-05-07-B1-closure.md
  — Eight axes, all OK. ADR-0026 / T-014 introduce no new attack
  surface, capability widening, memory-safety hazard, or threat-
  model shift. UNSAFE-2026-0014 third Amendment for register_idle;
  UNSAFE-2026-0019/0020 partial-verification + post-T-014 smoke
  Amendments; UNSAFE-2026-0021 no-verification Amendment. Eight
  inherited forward-flagged items unchanged at original severity.
  Verdict: Approve.

- docs/analysis/reviews/performance-optimization-reviews/2026-05-07-B1-closure.md
  — Re-baseline. Net footprint-neutral vs 2026-04-28: .text 21,792
  bytes (-116), .rodata 2,928 (+144), .bss 22,256 (+8). The +144
  .rodata is panic-message clarity strings; the +8 .bss is
  idle: Option<TaskHandle>. Smoke 5.5–6.5 ms boot-to-end, zero
  events. 11 P-numbered proposals from Track D remain queued (P3
  partially landed by γ; P1 / P10 / P4 highest-ROI near-term). No
  proposals to merge this cycle. Verdict: Merge.

## Status flips + index updates

- T-014 In Review → Done. T-014 user-story file's review-history
  gains row 4 recording the maintainer's independent verification
  and the closure trio's landing.
- docs/analysis/tasks/phase-b/README.md — T-014 row to Done.
- docs/roadmap/phases/phase-b.md — sub-breakdown item 7 (T-014)
  flipped to Done; B1 status block rewritten ("B1 closed 2026-05-07")
  with citations to the three new review artefacts.
- docs/roadmap/current.md — top callout rewritten to record B1
  truly closed (2026-05-07); active phase remains B; active
  milestone advances to B2 (MMU activation); active task
  cleared (B2 prep / ADR-0027 drafting opens next per ADR-0025
  §Rule 1); audit status footnote gains the 2026-05-07 update.
- The three review-folder README index tables (business / security /
  performance) gain 2026-05-07-B1-closure rows.

## Verification recap

- cargo fmt --check, cargo host-clippy -D warnings, cargo
  kernel-clippy -D warnings, cargo kernel-build — all clean.
- cargo host-test 25 + 93 + 34 = 152/152.
- cargo +nightly miri test 152/152 clean.
- QEMU smoke at HEAD e9fa019 reproduces the full demo trace + the
  boot-to-end elapsed = ... line; -d int,unimp,guest_errors
  empty for the entire ~5.8 ms run.

## What stays open for δ + B2 prep

- δ — write ADR-0023 placeholder file with Status: Deferred body
  (the README index gained the row in α; the file body is δ's job).
- δ — endpoint rollback / ipc_cancel_recv ADR before B2 lands the
  first userspace destroy path (Track A non-blocker; SchedError::Deadlock
  rollback leaves endpoint in RecvWaiting).
- B2 prep — ADR-0027 (kernel virtual memory layout) drafting +
  docs/architecture/memory-management.md design-first. The ADR's
  Dependency chain opens T-015 in the same commit per ADR-0025
  §Rule 1.

Refs: ADR-0026, ADR-0022, ADR-0025, T-014, B1 closure trio
Audit: UNSAFE-2026-0014, UNSAFE-2026-0019, UNSAFE-2026-0020, UNSAFE-2026-0021

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cemililik added a commit that referenced this pull request May 7, 2026
Closes δ.1 of the post-B1-closure follow-up arc. ADR-0023's slot was
recorded as "accept-deferred" at the B0 closure (2026-04-27), but the
file did not exist; the README index gained a no-link row in α (PR
#13), and the glossary's CDT entry pointed at the missing path. This
commit lands the placeholder body so:

- The in-tree references that mention ADR-0023 (glossary, phase-b.md
  ledger, decisions/README.md index, the B0 closure security review
  prose) resolve to a citable artefact instead of a 404.
- The deferral conditions are recorded at the slot itself rather
  than scattered across review prose; future agents recognise when
  the trigger fires (multi-task server arc; first userspace driver
  with sub-cap delegation; threat-model escalation).
- The four-option sketch (whole-system CDT, per-table + back-pointer,
  explicit revoke-token, indefinite defer to userspace) gives a
  future ADR author a starting analysis instead of a blank page.

Status remains `Deferred`. The body is a placeholder, not a load-
bearing decision; when a trigger fires, the body gets rewritten in
place with a Status flip from `Deferred` to `Proposed` (then
`Accepted`). The append-only rule that protects original Accepted
bodies does not apply to Deferred placeholders.

## Files changed

- docs/decisions/0023-cross-table-capability-revocation-policy.md
  (new) — placeholder body with deferral conditions, options sketch,
  references.
- docs/decisions/README.md — index row gains the file link (was a
  prose-only no-link row from α).
- docs/glossary.md — CDT entry's "no file at HEAD" qualification
  removed; clean link to the placeholder.

Refs: ADR-0023, ADR-0014, ADR-0017, B0 closure security review
2026-04-27

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cemililik
cemililik deleted the track-e-doc-fix-sweep branch May 25, 2026 12:49
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