Skip to content

docs(architecture): add bare-metal Thread-Per-Core blueprint (HLD/LLD/migration matrix) - #1858

Merged
lavkushry merged 1 commit into
mainfrom
feat/architecture-blueprint-docs
Jul 12, 2026
Merged

docs(architecture): add bare-metal Thread-Per-Core blueprint (HLD/LLD/migration matrix)#1858
lavkushry merged 1 commit into
mainfrom
feat/architecture-blueprint-docs

Conversation

@lavkushry

Copy link
Copy Markdown
Owner

Summary

A blueprint/documentation deliverable (not a runtime implementation) proposing a bare-metal, Thread-Per-Core architecture direction, explicitly benchmark-gated: <1ms p99 covers warm deterministic authorization compute only — protected actions still await durable approval/receipt commits, which remain a separate, out-of-scope path in this document.

  • ARCHITECTURE.md — Thread-Per-Core HLD, SPSC topology, NUMA/copy budgets, capacity equations, and the benchmark contract.
  • docs/LLD.md — HCMT physical format, WAL/recovery, Gorilla/Roaring encodings, CoreReactor/SPSC skeletons, Aho/HNSW/PQ/ONNX/eBPF/UI designs, protobuf and FlatBuffer schemas, exact Cargo pins.
  • MIGRATION_MATRIX.md — repository-backed audit, concurrency inventory, component mappings, preservation ledger, deletion gates, cutover sequence.
  • README.md/CONTRIBUTING.md/ROADMAP.md — bare-metal product positioning (targets kept explicitly separate from measured SQLite performance), ADR/unsafe-Rust/lock-free/SIMD/zero-copy/benchmark/security requirements, a 36-week phased program.
  • docs/architecture.md, AGENTS.md, CLAUDE.md, doc indexes, MkDocs nav, and validation tooling aligned to the new documents.

Rebased onto current main (includes the merged tool-broker extraction #1856 and node-sensor real-host proof #1857). bins/aegis-node-sensor/tests/real_host_integration.rs had been incidentally swept into the original commit this was cherry-picked from — it's deliberately left untouched here at its already-merged (5-test) version; this PR only touches architecture/documentation files.

This completes the requested architectural blueprint — not the subsequent 36-week runtime implementation it describes.

Test plan

  • Documentation validator (scripts/validate-docs.mjs): 0 errors, 0 warnings
  • Documentation quality report current
  • Local link and code-fence validation
  • Confirmed no .rs/Cargo.toml files are touched (docs-only change)
  • Arrow Flight 59.1.0 / tonic 0.14.1 isolation from the current tonic 0.12 control service (verified in design only, not yet implemented)
  • Strict MkDocs build (MkDocs not installed in this environment — flagged, not silently skipped)

🤖 Generated with Claude Code

…/migration matrix)

Cherry-picked from the parallel architecture/documentation pass, rebased
onto current main (includes the merged tool-broker extraction and
node-sensor real-host proof) -- bins/aegis-node-sensor/tests/real_host_integration.rs
is intentionally left untouched at its already-merged (5-test) version;
this commit only touches architecture/documentation files.

- ARCHITECTURE.md: Thread-Per-Core HLD, SPSC topology, NUMA/copy budgets,
  capacity equations, and benchmark contract (<1ms p99 covers warm
  deterministic authorization compute; durable approval/receipt commits
  are a separate, explicitly out-of-scope path).
- docs/LLD.md: HCMT physical format, WAL/recovery, Gorilla/Roaring
  encodings, CoreReactor/SPSC skeletons, Aho/HNSW/PQ/ONNX/eBPF/UI designs,
  protobuf and FlatBuffer schemas, exact Cargo pins.
- MIGRATION_MATRIX.md: repository-backed audit, concurrency inventory,
  component mappings, preservation ledger, deletion gates, cutover
  sequence.
- README.md/CONTRIBUTING.md/ROADMAP.md: bare-metal product positioning
  (targets kept explicitly separate from measured SQLite performance),
  ADR/unsafe-Rust/lock-free/SIMD/zero-copy/benchmark/security
  requirements, 36-week phased program.
- docs/architecture.md, AGENTS.md, CLAUDE.md, doc indexes, MkDocs nav,
  and validation tooling aligned to the new documents.

This is a blueprint/documentation deliverable, not the runtime
implementation described in it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 12, 2026 16:21

Copilot AI 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.

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

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@lavkushry, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 57b17282-40ac-41bc-a4a4-1dd1ece39c81

📥 Commits

Reviewing files that changed from the base of the PR and between 236fc6c and 5f8bdf9.

📒 Files selected for processing (18)
  • AGENTS.md
  • ARCHITECTURE.md
  • CLAUDE.md
  • CONTRIBUTING.md
  • MIGRATION_MATRIX.md
  • README.md
  • ROADMAP.md
  • docs/AegisAgent_World_Class_HLD.md
  • docs/AegisAgent_World_Class_LLD.md
  • docs/Documentation_Index.md
  • docs/Documentation_Quality_Report.md
  • docs/LLD.md
  • docs/README.md
  • docs/architecture-map.json
  • docs/architecture.md
  • mkdocs.yml
  • scripts/audit-doc-quality.mjs
  • scripts/validate-docs.mjs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/architecture-blueprint-docs

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.

@ecc-tools

ecc-tools Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@lavkushry
lavkushry merged commit 9762230 into main Jul 12, 2026
28 of 29 checks passed
@lavkushry
lavkushry deleted the feat/architecture-blueprint-docs branch July 12, 2026 16:22

@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 introduces a comprehensive architectural transition for AegisAgent toward a performance-first v2 target, featuring thread-per-core reactors, SPSC rings, and Hybrid Columnar Merge Trees (HCMT). The changes are detailed in the newly added ARCHITECTURE.md, MIGRATION_MATRIX.md, and docs/LLD.md files, alongside updates to core documentation, contributing guidelines, and the project roadmap. The review feedback highlights critical inconsistencies within the new low-level design (docs/LLD.md), specifically naming discrepancies for the tenant snapshot struct, conflicting trait definitions for the authorization service, and a missing constant definition for MAX_BROWSER_BATCH_BYTES in the limits section.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread docs/LLD.md
pub policy_set: cedar_policy::PolicySet,
pub aho_generation: u64,
pub emergency_epoch: u64,
pub expires_mono_ns: u64,

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

There is a naming inconsistency for the snapshot struct. In section 6, it is defined as TenantPolicySnapshot, but in section 25.1 and the class diagram, it is referred to as TenantControlSnapshot. Please unify the struct name across all sections to maintain consistency.

Comment thread docs/LLD.md
Comment on lines +352 to +358
pub trait AuthorizeService {
fn authorize(
&mut self,
ctx: &AuthenticatedContext,
request: &AuthorizeCommand,
deadline: Deadline,
) -> Result<AuthorizeOutcome, AegisError>;

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

There are two different trait definitions for the authorization service in this document: AuthorizationService (defined in section 4.2 as an async trait returning AuthorizeResponse) and AuthorizeService (defined in section 7 as a synchronous trait returning AuthorizeOutcome). Please clarify their distinct roles or unify them into a single trait to prevent implementation drift.

Comment thread docs/LLD.md
# Browser WASM
wasm-bindgen = "=0.2.126"
js-sys = "=0.3.103"
web-sys = "=0.3.103"

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 constant MAX_BROWSER_BATCH_BYTES is used here to validate the input length, but it is missing from the 2. Constants and hard limits section. Please add it to the constants list in section 2 to ensure all hard limits are documented in one place.

lavkushry added a commit that referenced this pull request Jul 13, 2026
macOS resolves Installation.md case-insensitively, the Linux CI runner
does not — these three links failed the demo-guardrails docs validation
on every PR since #1858 landed.
lavkushry added a commit that referenced this pull request Jul 13, 2026
…9) (#1862)

* feat(event): add failure-atomic slab/ring admission boundary (ADR-0009)

Composite volatile admission channel binding one published-prefix page to
one SPSC descriptor ring, under Proposed ADR-0009:

- try_admit publishes page-then-ring with no fallible work between the
  page publication and ring publication phases; a caught unwind closes the
  page, Release-stores FAULTED, closes the ring, and resumes the panic so
  a retained producer is terminal, never an atomically open poisoned lane
- consumer validation fails closed: sequence gap/duplicate/reorder, arena
  identity, payload range, and CRC faults withhold the tail, disconnect
  the producer, and poison the consumer; ring invariant errors
  Release-close the ring before surfacing
- malformed terminal closure states (clean-without-page-close, unknown
  raw state, count mismatches in either direction) never report CleanEnd
- endpoints are Send but deliberately not Sync; frame leases are neither
  Send nor Sync (compile_fail doc-tests enforce all of it)

Evidence: retained-producer caught-unwind tests at every publication
phase, corrupt-descriptor and terminal-state fixtures, Loom models
including a validation-failure vs reserved-publication race, full Miri,
ASan/TSan clean on the final state, zero-allocation admission bench, and
CI lanes extended for the admission suite. Status honesty: ADR-0009 is
Proposed; the fabric remains target, unwired, with no performance claims
(Implementation_Status ledger, MIGRATION_MATRIX delta, ROADMAP, LLD
updated in the same change).

* docs: fix case-sensitive installation.md links in World-Class HLD/LLD

macOS resolves Installation.md case-insensitively, the Linux CI runner
does not — these three links failed the demo-guardrails docs validation
on every PR since #1858 landed.

* ci(sast): scope the unsafe-usage gate — block repo-wide except lib/event

Replace the community blanket rust.lang.security.unsafe-usage rule
(excluded via --exclude-rule) with rust-unsafe-outside-reviewed-crates,
which still blocks any unsafe outside lib/event. The event-fabric crates
(ADR-0006..0009) carry isolated, SAFETY-documented unsafe gated by the
event-concurrency, event-miri and event-sanitizers CI lanes, per the
CONTRIBUTING unsafe evidence standard and docs/architecture.md §8.

Verified with semgrep 1.169 locally: the scoped rule fires on unsafe
outside lib/event, stays silent inside it, and --exclude-rule suppresses
the registry rule (finding count 1 -> 0 on a synthetic case).

Approved by operator (scoped rule swap chosen over per-site nosemgrep
annotations).
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.

2 participants