Skip to content

docs: add reservation-core third-engine plan#115

Merged
skel84 merged 2 commits intomainfrom
feat/reservation-core-plan
Mar 26, 2026
Merged

docs: add reservation-core third-engine plan#115
skel84 merged 2 commits intomainfrom
feat/reservation-core-plan

Conversation

@skel84
Copy link
Owner

@skel84 skel84 commented Mar 26, 2026

Summary

  • add the reservation-core third-engine plan and v1 semantics boundary
  • index the new docs and update status to stage M11
  • seed GitHub/Taskwarrior tracking around the third-engine experiment

Why

quota-core proved a second deterministic engine in-repo, but it was not enough to justify runtime extraction. reservation-core is the next pressure test for the library thesis because it stresses expiry, terminal-state transitions, and recovery more directly.

Scope

  • docs/reservation-engine-plan.md
  • docs/reservation-semantics.md
  • docs index and status updates
  • tracking only; no engine code yet

Issue links

Verification

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

@coderabbitai
Copy link

coderabbitai bot commented Mar 26, 2026

Summary by CodeRabbit

  • Documentation
    • Added new planning and semantic specification documents for a reservation engine experiment and added them to the engineering reading list.
    • Updated milestone/status pages to include a new M11 third-engine planning milestone and clarified current focus and next-engine recommendation.

Walkthrough

Adds documentation for a new third-engine experiment "reservation-core": a detailed architecture plan, a formal v1 semantic contract for pools/holds and their lifecycle, README index entries, and an updated project status milestone (M11).

Changes

Cohort / File(s) Summary
Documentation Index
docs/README.md
Added two reading-list entries linking to the reservation engine plan and semantics docs.
Engine Architecture and Semantics
docs/reservation-engine-plan.md, docs/reservation-semantics.md
Added a phased architecture plan for a reservation-core experiment and a formal v1 semantic contract: domain models (Pool, Hold), command lifecycle (CreatePool, PlaceHold, ConfirmHold, ReleaseHold, ExpireHold), state transitions, invariants, idempotency rules, non-goals, and extraction hypothesis.
Status Tracking
docs/status.md
Updated milestone list to add M11 third-engine planning staged, adjusted M10 summary phrasing, and added next-engine recommendation pointing to reservation-core.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the primary change: adding the reservation-core third-engine plan documentation.
Description check ✅ Passed The description provides clear summary, rationale, scope, issue links, and verification steps that align well with the template structure and requirements.
Linked Issues check ✅ Passed The PR fully meets the objectives of issue #110 by delivering explicit v1 lifecycle operations, non-goals, and extraction hypothesis in the two canonical documentation files.
Out of Scope Changes check ✅ Passed All changes are in scope: new documentation files, docs index updates, and status tracking for M11 align with the stated objectives of freezing the reservation-core boundary.
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/reservation-core-plan

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.

Copy link

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

🧹 Nitpick comments (2)
docs/reservation-semantics.md (1)

99-99: Optional: Consider minor style improvements.

Static analysis flagged a few style refinements:

  • Line 99: "Returns... back" may be redundant (consider "Returns a previously held quantity to availability")
  • Line 145: "all of the following" could be "all the following"
  • Line 166: "logical-slot based" should be hyphenated as "logical-slot-based" (compound adjective)

These are minor and don't affect clarity, but would align with common style conventions.

Also applies to: 145-145, 166-166

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/reservation-semantics.md` at line 99, Replace the three minor style
issues in reservation-semantics.md: change the phrase "Returns a previously held
quantity back to availability" to "Returns a previously held quantity to
availability", change "all of the following" to "all the following", and
hyphenate "logical-slot based" to "logical-slot-based" so the compound adjective
is consistent; update the exact occurrences shown in the diff/notes to preserve
meaning.
docs/reservation-engine-plan.md (1)

72-72: Optional: Consider minor style improvements.

Static analysis suggested:

  • Line 72: "all of the following" could be simplified to "all the following"
  • Line 294: "on top of that" might be replaced with "using" or "with"

These are minor and don't impact clarity.

Also applies to: 294-294

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/reservation-engine-plan.md` at line 72, Replace the phrase "all of the
following" with the simpler "all the following" where it appears (search for the
exact string "all of the following") and replace instances of "on top of that"
with a more concise alternative such as "using" or "with" (search for the exact
string "on top of that") in the document; update those two textual occurrences
to improve style while keeping meaning unchanged.
🤖 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/reservation-semantics.md`:
- Line 192: The Commands section is missing minimal read operations; update it
to explicitly list the required read APIs (at least GetPool and GetHold) or add
a short subsection “Minimal Read Surface” that names and briefly describes these
calls (e.g., GetPool(poolID) returns current pool state; GetHold(holdID) returns
hold details) so tests and recovery have a clear contract; reference the
existing Commands section and include these unique symbols GetPool and GetHold
in the text.
- Line 89: The phrase "command slot" is inconsistent with the document's
terminology; update the text at that location to use request_slot (e.g., change
"hold is not overdue at the command slot" to "hold is not overdue at the request
slot" or, more precisely, "`request_slot < deadline_slot`") so it matches other
references like ExpireHold and Time Rules; ensure any surrounding examples or
formulas use `request_slot` consistently.

---

Nitpick comments:
In `@docs/reservation-engine-plan.md`:
- Line 72: Replace the phrase "all of the following" with the simpler "all the
following" where it appears (search for the exact string "all of the following")
and replace instances of "on top of that" with a more concise alternative such
as "using" or "with" (search for the exact string "on top of that") in the
document; update those two textual occurrences to improve style while keeping
meaning unchanged.

In `@docs/reservation-semantics.md`:
- Line 99: Replace the three minor style issues in reservation-semantics.md:
change the phrase "Returns a previously held quantity back to availability" to
"Returns a previously held quantity to availability", change "all of the
following" to "all the following", and hyphenate "logical-slot based" to
"logical-slot-based" so the compound adjective is consistent; update the exact
occurrences shown in the diff/notes to preserve meaning.
🪄 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: ef400742-abc8-4bb3-ba02-dd5803e4c89f

📥 Commits

Reviewing files that changed from the base of the PR and between 37c29e1 and e7229bb.

📒 Files selected for processing (4)
  • docs/README.md
  • docs/reservation-engine-plan.md
  • docs/reservation-semantics.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/reservation-semantics.md
  • docs/status.md
  • docs/reservation-engine-plan.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)
📚 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
📚 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: Use the GitHub Project `AllocDB` as the operational work board. Keep planned work on the board, not only in milestone pages or local docs.

Applied to files:

  • docs/status.md
🪛 LanguageTool
docs/reservation-semantics.md

[style] ~99-~99: Using “back” with the verb “return” may be redundant.
Context: ...old Returns a previously held quantity back to availability. Success requirements:...

(RETURN_BACK)


[style] ~145-~145: Consider removing “of” to be more concise
Context: ...## Invariants The engine must preserve all of the following: - 0 <= held_capacity - `0...

(ALL_OF_THE)


[grammar] ~166-~166: Use a hyphen to join words.
Context: ...y twice under retry. ## Time Rules All time behavior is logical-slot based. Al...

(QB_NEW_EN_HYPHEN)


[grammar] ~166-~166: Use a hyphen to join words.
Context: ...Rules All time behavior is logical-slot based. Allowed: - request_slot - per...

(QB_NEW_EN_HYPHEN)

docs/reservation-engine-plan.md

[style] ~72-~72: Consider removing “of” to be more concise
Context: ...iteria The experiment is successful if all of the following become true: - `reservation-...

(ALL_OF_THE)


[style] ~294-~294: ‘on top of that’ might be wordy. Consider a shorter alternative.
Context: ...ting now - would building quota/credits on top of that shared runtime be materially simpler R...

(EN_WORDINESS_PREMIUM_ON_TOP_OF_THAT)

🔇 Additional comments (4)
docs/reservation-semantics.md (1)

66-79: Clarify deadline_slot validation for PlaceHold.

The PlaceHold command accepts a deadline_slot (per the Hold domain model at line 46), but the success requirements don't specify any validation for this field. Should the engine reject holds where deadline_slot <= request_slot (already expired), or are such holds allowed? This should be made explicit to avoid ambiguity during implementation.

Consider adding a success requirement such as:

  • deadline_slot > request_slot (if creating already-expired holds should be rejected)

OR clarify in the Non-Goals section (line 179+) if immediate-expiry holds are intentionally permitted.

docs/README.md (1)

27-28: LGTM: New doc links added correctly.

The new entries for Reservation Engine Plan and Reservation Engine Semantics are properly formatted and logically placed after the quota-engine documentation, reflecting the progression from second-engine to third-engine experiments.

docs/status.md (1)

3-3: LGTM: Status updates accurately reflect M11 planning stage.

The updates correctly capture:

  • M11 third-engine planning as "staged" with implementation not yet started (lines 3, 18)
  • The five v1 commands (CreatePool, PlaceHold, ConfirmHold, ReleaseHold, ExpireHold) matching the semantic contract in reservation-semantics.md
  • The strategic rationale (expiry/terminal-state/recovery seam pressure) consistent with reservation-engine-plan.md
  • The M10 conclusion that shared runtime extraction remains premature

These changes fulfill the guideline to keep status.md current when milestone state or next steps materially change.

Based on learnings: Keep docs/status.md current as the single-file progress snapshot for the repository.

Also applies to: 18-18, 219-220

docs/reservation-engine-plan.md (1)

1-323: LGTM: Comprehensive and consistent architecture plan.

The document provides a well-structured path from boundary freeze through implementation to seam evaluation. Key strengths:

  • Clear rationale for reservation-core as the third-engine test (lines 31-54)
  • Explicit success/failure criteria (lines 70-90) and stop conditions (lines 310-318)
  • Phased approach that separates concerns (boundary freeze → lifecycle → expiry → recovery → evaluation)
  • Consistent with the semantic contract in reservation-semantics.md (verified commands, results, invariants, and time rules all match)
  • Recommended issue breakdown (lines 303-308) maps cleanly to the phase structure

The plan appropriately frames this as an architecture experiment rather than product commitment, maintaining focus on the library extraction question.

Copy link

@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.

🧹 Nitpick comments (4)
docs/reservation-semantics.md (4)

99-99: Minor: Consider removing redundant "back".

The phrase "Returns a previously held quantity back to availability" could be simplified to "Returns a previously held quantity to availability."

As per coding guidelines, documentation should be clear and concise.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/reservation-semantics.md` at line 99, Edit the documentation sentence
that reads "Returns a previously held quantity back to availability" and remove
the redundant word "back" so it reads "Returns a previously held quantity to
availability"; locate the exact sentence in reservation-semantics.md (the phrase
"Returns a previously held quantity back to availability") and replace it with
the simplified version to make the doc clearer and more concise.

155-155: Minor: Simplify "all of the following".

The phrase "preserve all of the following" could be simplified to "preserve the following."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/reservation-semantics.md` at line 155, Replace the phrase "preserve all
of the following:" with the simpler wording "preserve the following:" in the
document text (the sentence that currently reads "The engine must preserve all
of the following:") so the heading reads "The engine must preserve the
following:" to improve clarity and concision.

70-74: Optional: Explicitly define available capacity calculation.

The success requirement "enough available capacity exists" is implicit but never formally defined. Consider adding a brief note that available capacity is calculated as:

available_capacity = total_capacity - held_capacity - consumed_capacity

This would make the capacity accounting model fully explicit, though it is derivable from the invariants in lines 157-159.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/reservation-semantics.md` around lines 70 - 74, Add an explicit
definition of "available capacity" to the Success requirements by stating:
available_capacity = total_capacity - held_capacity - consumed_capacity; update
the text near the "enough available capacity exists" bullet (and optionally add
a one-line note referencing the invariants around lines 157-159) so readers see
the exact capacity accounting formula and how it maps to held/consumed capacity.

176-176: Minor: Add hyphen to compound adjective.

The phrase "logical-slot based" should be hyphenated as "logical-slot-based" when used as a compound adjective.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/reservation-semantics.md` at line 176, Update the phrase "All time
behavior is logical-slot based." to use a hyphenated compound adjective: change
it to "All time behavior is logical-slot-based." — look for the exact sentence
"All time behavior is logical-slot based." in the docs/reservation-semantics.md
and replace it with the hyphenated form.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/reservation-semantics.md`:
- Line 99: Edit the documentation sentence that reads "Returns a previously held
quantity back to availability" and remove the redundant word "back" so it reads
"Returns a previously held quantity to availability"; locate the exact sentence
in reservation-semantics.md (the phrase "Returns a previously held quantity back
to availability") and replace it with the simplified version to make the doc
clearer and more concise.
- Line 155: Replace the phrase "preserve all of the following:" with the simpler
wording "preserve the following:" in the document text (the sentence that
currently reads "The engine must preserve all of the following:") so the heading
reads "The engine must preserve the following:" to improve clarity and
concision.
- Around line 70-74: Add an explicit definition of "available capacity" to the
Success requirements by stating: available_capacity = total_capacity -
held_capacity - consumed_capacity; update the text near the "enough available
capacity exists" bullet (and optionally add a one-line note referencing the
invariants around lines 157-159) so readers see the exact capacity accounting
formula and how it maps to held/consumed capacity.
- Line 176: Update the phrase "All time behavior is logical-slot based." to use
a hyphenated compound adjective: change it to "All time behavior is
logical-slot-based." — look for the exact sentence "All time behavior is
logical-slot based." in the docs/reservation-semantics.md and replace it with
the hyphenated form.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 855b7059-5d01-4591-8a5f-21a694971221

📥 Commits

Reviewing files that changed from the base of the PR and between e7229bb and e9986c5.

📒 Files selected for processing (1)
  • docs/reservation-semantics.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 (1)
**/*.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/reservation-semantics.md
🪛 LanguageTool
docs/reservation-semantics.md

[style] ~99-~99: Using “back” with the verb “return” may be redundant.
Context: ...old Returns a previously held quantity back to availability. Success requirements:...

(RETURN_BACK)


[style] ~155-~155: Consider removing “of” to be more concise
Context: ...## Invariants The engine must preserve all of the following: - 0 <= held_capacity - `0...

(ALL_OF_THE)


[grammar] ~176-~176: Use a hyphen to join words.
Context: ...y twice under retry. ## Time Rules All time behavior is logical-slot based. Al...

(QB_NEW_EN_HYPHEN)


[grammar] ~176-~176: Use a hyphen to join words.
Context: ...Rules All time behavior is logical-slot based. Allowed: - request_slot - per...

(QB_NEW_EN_HYPHEN)

🔇 Additional comments (6)
docs/reservation-semantics.md (6)

1-23: LGTM! Clear purpose and appropriate scoping.

The document establishes a narrow, well-defined semantic boundary for the third-engine experiment. The explicit constraint to "one logical pool" and the five-operation lifecycle prevent scope drift into broader commerce/ticketing concerns.


24-58: LGTM! Clean and minimal domain model.

The Pool and Hold models are well-defined with only essential fields. The explicit distinction between the single active state (held) and the three terminal states is crucial for implementation clarity.


60-125: LGTM! Clear command specifications with precise state transitions.

Each command has well-defined success requirements and effects. The complementary time conditions for ConfirmHold (request_slot < deadline_slot) and ExpireHold (request_slot >= deadline_slot) are particularly clear.


126-134: LGTM! Addresses previous review feedback.

This section appropriately defines the minimal read surface required for tests and recovery, directly addressing the earlier review comment. The clarification that these reads are informational and don't widen the mutation scope is helpful.


153-187: LGTM! Precise invariants and clear time model.

The invariants correctly capture both mathematical bounds and business rules. The logical-slot-based time model with explicit prohibition of wall-clock and background timers is crucial for deterministic engine behavior.


189-209: LGTM! Comprehensive non-goals and clear experimental intent.

The non-goals section effectively constrains v1 scope and now explicitly references the minimal read surface (line 202), addressing previous feedback. The Extraction Intent section appropriately frames this as a third-engine pressure test for evaluating potential runtime extraction.

@skel84 skel84 merged commit d7fd66b 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.

M11-T01: Freeze reservation-core boundary and v1 scope

1 participant