Skip to content

docs: write runtime vs engine contract#137

Merged
skel84 merged 1 commit intomainfrom
feat/runtime-vs-engine-contract
Mar 26, 2026
Merged

docs: write runtime vs engine contract#137
skel84 merged 1 commit intomainfrom
feat/runtime-vs-engine-contract

Conversation

@skel84
Copy link
Copy Markdown
Owner

@skel84 skel84 commented Mar 26, 2026

Summary

  • add the focused M13 runtime-vs-engine contract note
  • name the exact shared runtime crates, exact deferred seams, and exact engine-local surfaces
  • update the docs index and status so future engine work can cite one short contract doc

Test plan

  • scripts/check_repo.sh
  • push preflight: cargo fmt --all --check
  • push preflight: cargo clippy --all-targets --all-features -- -D warnings
  • push preflight: cargo test

Closes #126
Refs #120

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 26, 2026

Summary by CodeRabbit

  • Documentation
    • Added new engineering documentation file to the reading list.
    • Updated roadmap status to reflect new documentation publication.

Walkthrough

This PR adds documentation defining the internal contract governing whether future code should reside in the shared runtime substrate or engine-local areas. It introduces runtime-vs-engine-contract.md, updates the documentation index in README.md, and notes the contract's publication in the M13 roadmap status.

Changes

Cohort / File(s) Summary
Runtime vs Engine Contract Definition
docs/runtime-vs-engine-contract.md
New comprehensive documentation specifying shared runtime responsibilities (retirement bookkeeping, WAL mechanics), engine-local ownership (command surfaces, domain config, recovery semantics), placement rules for new code, and module mappings.
Documentation Index & Status Updates
docs/README.md, docs/status.md
Added contract link to Engineering Docs reading list in README; updated M13 roadmap status to note publication of the runtime-vs-engine-contract reference.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'docs: write runtime vs engine contract' is specific and directly reflects the main change: adding documentation that defines the runtime-vs-engine contract.
Description check ✅ Passed The description clearly summarizes changes, links to related issues (#126, #120), and provides a comprehensive test plan covering repo checks, formatting, linting, and tests.
Linked Issues check ✅ Passed All acceptance criteria from issue #126 are met: the contract doc is added under docs/, it names shared modules and engine-local surfaces, and it serves as the authoring boundary reference.
Out of Scope Changes check ✅ Passed All changes are scoped to the requirements: adding the contract document, updating the docs index (README.md), and updating the status roadmap (status.md) as planned.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 feat/runtime-vs-engine-contract

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

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/runtime-vs-engine-contract.md (1)

44-50: Clarify “commands” to avoid conflict with generic WAL record typing.

Line 44 is a bit broad; consider narrowing this to “engine command semantics/payload schemas” so it stays consistent with substrate-level record typing.

Suggested wording tweak
-- commands
+- engine command semantics and payload schemas
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/runtime-vs-engine-contract.md` around lines 44 - 50, The word "commands"
in the bullet list is too broad and conflicts with generic WAL record typing;
update the bullet to a more precise phrase like "engine command
semantics/payload schemas" (or similar) so it clearly refers to the engine-level
command payloads and schemas rather than generic WAL record types—modify the
item currently reading "commands" in the list that includes "result codes",
"resources, buckets, pools, holds, reservations, or leases", etc., replacing it
with the clarified phrasing and ensure surrounding wording remains consistent
with substrate-level record typing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/status.md`:
- Line 220: The status line referencing M13 and the planned publishing of
`runtime-vs-engine-contract` is stale; update the `docs/status.md` entry that
mentions `M13`/`runtime-vs-engine-contract` to past tense (indicating the
contract is published) and replace the forward-looking sentence with the actual
next actionable step so the single-file progress snapshot remains current,
ensuring the phrase `runtime-vs-engine-contract` reflects completed status and
the file only contains the next recommended action.

---

Nitpick comments:
In `@docs/runtime-vs-engine-contract.md`:
- Around line 44-50: The word "commands" in the bullet list is too broad and
conflicts with generic WAL record typing; update the bullet to a more precise
phrase like "engine command semantics/payload schemas" (or similar) so it
clearly refers to the engine-level command payloads and schemas rather than
generic WAL record types—modify the item currently reading "commands" in the
list that includes "result codes", "resources, buckets, pools, holds,
reservations, or leases", etc., replacing it with the clarified phrasing and
ensure surrounding wording remains consistent with substrate-level record
typing.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 23322c85-8aac-4552-861b-1c28f74250b5

📥 Commits

Reviewing files that changed from the base of the PR and between 84ae948 and c29d1c7.

📒 Files selected for processing (3)
  • docs/README.md
  • docs/runtime-vs-engine-contract.md
  • docs/status.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: semgrep-cloud-platform/scan
🧰 Additional context used
📓 Path-based instructions (2)
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Keep documentation up to date with the code and design. If a change affects behavior, invariants, failure modes, operational semantics, testing strategy, or implementation sequencing, update the relevant docs in the same task or PR.

Files:

  • docs/README.md
  • docs/status.md
  • docs/runtime-vs-engine-contract.md
docs/status.md

📄 CodeRabbit inference engine (AGENTS.md)

Keep docs/status.md current as the single-file progress snapshot for the repository. Update it whenever milestone state, implementation coverage, or the recommended next step materially changes.

Files:

  • docs/status.md
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: skel84/allocdb PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T15:18:53.086Z
Learning: Applies to **/*.md : Keep documentation up to date with the code and design. If a change affects behavior, invariants, failure modes, operational semantics, testing strategy, or implementation sequencing, update the relevant docs in the same task or PR.
📚 Learning: 2026-03-12T15:18:53.086Z
Learnt from: CR
Repo: skel84/allocdb PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T15:18:53.086Z
Learning: Applies to docs/status.md : Keep [`docs/status.md`](./docs/status.md) current as the single-file progress snapshot for the repository. Update it whenever milestone state, implementation coverage, or the recommended next step materially changes.

Applied to files:

  • docs/status.md
📚 Learning: 2026-03-12T15:18:53.086Z
Learnt from: CR
Repo: skel84/allocdb PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-12T15:18:53.086Z
Learning: Applies to **/*.md : Keep documentation up to date with the code and design. If a change affects behavior, invariants, failure modes, operational semantics, testing strategy, or implementation sequencing, update the relevant docs in the same task or PR.

Applied to files:

  • docs/status.md
🪛 LanguageTool
docs/runtime-vs-engine-contract.md

[style] ~159-~159: This adverb was used twice in the sentence. Consider removing one of them or replacing them with a synonym.
Context: ...cally 3. copy new runtime-adjacent code locally if the seam is still uncertain 4. extra...

(ADVERB_REPETITION_PREMIUM)

🔇 Additional comments (1)
docs/README.md (1)

32-32: Good index update for discoverability.

Adding this link keeps the docs reading list aligned with the new contract note.

- PR `#107` merged the `M10` quota-engine proof on `main`, and PRs `#116`, `#117`, and `#118` merged the full `M11` reservation-core chain on `main`: the repository now has a second and third deterministic engine with bounded command sets, logical-slot refill/expiry, and snapshot/WAL recovery proofs
- PRs `#132`, `#133`, and `#134` merged the first `M12` runtime extractions on `main`: `retire_queue`, `wal`, and `wal_file` are now shared internal substrate instead of copied engine-local modules, while `M12-T04` closed as a defer decision because `snapshot_file` is still only a clean seam inside the `quota-core` / `reservation-core` pair and `allocdb-core` keeps the simpler file format
- the next roadmap step is now `M13`: define the internal engine authoring boundary in `runtime-extraction-roadmap.md` and stop extraction pressure until that contract is written down; the authoring rule is to keep shared runtime below the semantic line and keep command surfaces, snapshot schemas, recovery entry points, and state-machine meaning engine-local
- the next roadmap step is now `M13`: define the internal engine authoring boundary in `runtime-extraction-roadmap.md` and stop extraction pressure until that contract is written down; the authoring rule is to keep shared runtime below the semantic line and keep command surfaces, snapshot schemas, recovery entry points, and state-machine meaning engine-local, then publish the focused `runtime-vs-engine-contract` note as the shorter authoring reference for future engine work
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Update this status line to reflect that the contract is now published.

Line 220 still frames writing/publishing runtime-vs-engine-contract as future work, but this PR already completed it. Please switch this to past tense and keep only the next actionable step as forward-looking.
As per coding guidelines, "docs/status.md current as the single-file progress snapshot... update whenever milestone state or recommended next step materially changes."

Suggested edit
-- the next roadmap step is now `M13`: define the internal engine authoring boundary in `runtime-extraction-roadmap.md` and stop extraction pressure until that contract is written down; the authoring rule is to keep shared runtime below the semantic line and keep command surfaces, snapshot schemas, recovery entry points, and state-machine meaning engine-local, then publish the focused `runtime-vs-engine-contract` note as the shorter authoring reference for future engine work
+- `M13-T01` is now documented: the internal runtime-vs-engine authoring boundary is published in `runtime-vs-engine-contract.md` as the short reference for future engine work; continue to hold extraction pressure unless a seam is proven under that contract
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- the next roadmap step is now `M13`: define the internal engine authoring boundary in `runtime-extraction-roadmap.md` and stop extraction pressure until that contract is written down; the authoring rule is to keep shared runtime below the semantic line and keep command surfaces, snapshot schemas, recovery entry points, and state-machine meaning engine-local, then publish the focused `runtime-vs-engine-contract` note as the shorter authoring reference for future engine work
- `M13-T01` is now documented: the internal runtime-vs-engine authoring boundary is published in `runtime-vs-engine-contract.md` as the short reference for future engine work; continue to hold extraction pressure unless a seam is proven under that contract
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/status.md` at line 220, The status line referencing M13 and the planned
publishing of `runtime-vs-engine-contract` is stale; update the `docs/status.md`
entry that mentions `M13`/`runtime-vs-engine-contract` to past tense (indicating
the contract is published) and replace the forward-looking sentence with the
actual next actionable step so the single-file progress snapshot remains
current, ensuring the phrase `runtime-vs-engine-contract` reflects completed
status and the file only contains the next recommended action.

@skel84 skel84 merged commit b6ba59d into main Mar 26, 2026
3 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.

M13-T01: Write the internal runtime-vs-engine contract

1 participant