Skip to content

docs: add 'How It Actually Works' tutorial - #116

Merged
SHA888 merged 7 commits into
mainfrom
docs/how-it-works-tutorial
Aug 1, 2026
Merged

docs: add 'How It Actually Works' tutorial#116
SHA888 merged 7 commits into
mainfrom
docs/how-it-works-tutorial

Conversation

@SHA888

@SHA888 SHA888 commented Jul 31, 2026

Copy link
Copy Markdown
Owner

What

Add a step-by-step tutorial walking through a single EVOSEAL evolution cycle, from initialization through validation.

Why

The TODO item 'Add a How It Actually Works tutorial' calls for lowering the barrier for new contributors by showing the runtime flow with real code references instead of requiring them to read the source cold.

What's covered

  • Pipeline initialization and safety setup
  • The 7-stage iteration loop (analyze → generate → adapt → evaluate → validate)
  • Safety wraparound with checkpoints and rollback
  • Resilience, circuit breakers, and error recovery
  • Continuous daemon mode and the bidirectional loop
  • What's still TODO vs. what's real

Changes

  • — new tutorial (10.8 KB)
  • — added link to tutorial in the Getting Started section
  • — checked the item, updated tracking table (P3: 16→17, Total: 64→65)

Verification

  • ✅ (402 files formatted)

Closes TODO.md item: 'Add a How It Actually Works tutorial'

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive “How It Actually Works” tutorial covering EVOSEAL’s runtime flow, evolution stages, evaluation, safety checks, rollback, resilience, and continuous operation.
    • Added a Getting Started link with a step-by-step explanation of an EVOSEAL evolution cycle.
  • Chores
    • Updated project completion tracking to mark the tutorial complete and reflect 17 completed P3 items and 65 completed items overall.

Walk through a single evolution cycle step by step, covering:
- Pipeline initialization and safety setup
- The 7-stage iteration loop (analyze → generate → adapt → evaluate → validate)
- Safety wraparound with checkpoints and rollback
- Resilience and error recovery
- Continuous daemon mode and the bidirectional loop

Closes TODO.md item: 'Add a How It Actually Works tutorial'
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 5 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 Plus

Run ID: e8ba29bb-5ad5-4b28-a3c6-41560385e6aa

📥 Commits

Reviewing files that changed from the base of the PR and between 7a783b4 and ec14ac0.

📒 Files selected for processing (1)
  • TODO.md
📝 Walkthrough

Walkthrough

The PR adds a tutorial for EVOSEAL’s runtime evolution flow, links it from the documentation index, and updates TODO tracking to mark the tutorial complete.

Changes

Runtime documentation

Layer / File(s) Summary
Pipeline entry and iteration flow
docs/tutorials/how_it_works.md, docs/index.md
Documents prerequisites, CLI entry points, pipeline initialization, iteration stages, safety checks, metrics, validation, budgets, and termination. Adds the tutorial to Getting Started.
Generation, adaptation, and validation
docs/tutorials/how_it_works.md
Documents analysis, candidate generation, SEAL adaptation, isolated evaluation, metric comparison, checkpoints, and rollback.
Runtime lifecycle and completion references
docs/tutorials/how_it_works.md, TODO.md
Documents events, dashboard delivery, daemon mode, resilience handling, known TODOs, and related references. Marks the tutorial complete and updates tracking counts.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • SHA888/EVOSEAL#67: The tutorial documents the runtime evolution pipeline implemented in this PR.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main documentation change: adding the “How It Actually Works” tutorial.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/how-it-works-tutorial

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.

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

🤖 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/tutorials/how_it_works.md`:
- Around line 60-67: Update every fenced code block in
docs/tutorials/how_it_works.md, including the blocks around
EvolutionPipeline.__init__ and the referenced sections, with an explicit
language identifier. Use text for diagram blocks and python for the daemon loop,
preserving their existing contents.
- Around line 69-71: The tutorial presents contradictory safety guidance between
the safety-layer explanation and the run_evolution_cycle_with_safety section.
Reconcile the documentation around run_evolution_cycle() and
run_evolution_cycle_with_safety() by clearly stating which entry point applies
checkpoints and rollback, whether SafetyIntegration is mandatory, and which
function callers must use; update both affected sections consistently.
- Around line 188-201: Clarify the `_validate_improvement` documentation to
describe the fewer-than-two-metrics path as baseline establishment, explicitly
noting that the first iteration bypasses
`ImprovementValidator.validate_improvement`; only change the implementation if
the intended contract requires first candidates to pass that gate.
- Around line 122-124: The tutorial’s description of the evolutionary search
overstates the current implementations of _generate_improvements() and
_evaluate_version(). Update the relevant section to describe these methods as
placeholders returning empty/default results, or otherwise accurately explain
the adapter-driven workflow only where it is implemented.

In `@TODO.md`:
- Around line 282-284: Do not mark the “How It Actually Works” tutorial complete
in TODO.md until docs/tutorials/how_it_works.md includes a real CLI dry-run log
transcript alongside its walkthrough and payload examples. Add the transcript,
or revise the TODO requirement to match the tutorial’s actual content before
updating any completion counts.
🪄 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 Plus

Run ID: 5695a0f7-889a-4a9a-bef0-9a778085a7a0

📥 Commits

Reviewing files that changed from the base of the PR and between 5aa70f1 and 2017de5.

📒 Files selected for processing (3)
  • TODO.md
  • docs/index.md
  • docs/tutorials/how_it_works.md

Comment thread docs/tutorials/how_it_works.md Outdated
Comment thread docs/tutorials/how_it_works.md Outdated
Comment thread docs/tutorials/how_it_works.md Outdated
Comment on lines +188 to +201
This is the gate. The `ImprovementValidator` compares the current iteration's
metrics against the previous iteration's metrics. If the new version
regresses on any critical dimension, the improvement is rejected and the
cycle stops (`should_continue=False`).

```python
# From _validate_improvement (simplified):
metrics = self.metrics_tracker.get_metrics_history(test_type)

if len(metrics) < 2:
return True # first iteration, nothing to compare against

result = self.validator.validate_improvement(baseline_id, comparison_id, test_type)
return result.passed

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Clarify first-iteration validation.

Lines 197-198 return True when fewer than two metrics exist. The first iteration therefore bypasses ImprovementValidator.validate_improvement at Line 200. Describe this as baseline establishment, or change the implementation if the first candidate must pass the validation gate.

🤖 Prompt for 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.

In `@docs/tutorials/how_it_works.md` around lines 188 - 201, Clarify the
`_validate_improvement` documentation to describe the fewer-than-two-metrics
path as baseline establishment, explicitly noting that the first iteration
bypasses `ImprovementValidator.validate_improvement`; only change the
implementation if the intended contract requires first candidates to pass that
gate.

Comment thread TODO.md
Comment on lines +282 to 284
- [x] **Add a "How It Actually Works" tutorial**
- Walk through a single evolution cycle step by step with real logs
- Lower the barrier for new contributors

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Do not mark the tutorial complete before meeting its stated criteria.

The TODO requires a walkthrough “with real logs.” docs/tutorials/how_it_works.md contains snippets and example payloads, but no real CLI log transcript. Add a dry-run transcript or revise the TODO wording before updating the completion counts.

Also applies to: 311-312

🤖 Prompt for 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.

In `@TODO.md` around lines 282 - 284, Do not mark the “How It Actually Works”
tutorial complete in TODO.md until docs/tutorials/how_it_works.md includes a
real CLI dry-run log transcript alongside its walkthrough and payload examples.
Add the transcript, or revise the TODO requirement to match the tutorial’s
actual content before updating any completion counts.

SHA888 added 2 commits July 31, 2026 16:48
…torial

- Step 2 comment: relabel from _run_single_iteration to run_evolution_cycle
  (the snippet is the loop body of run_evolution_cycle, not the inner method)
- __init__ line number: ~140 → ~95
- SandboxedTestRunner line number: ~630 → ~595
- Rewrite Steps 4-6 to clarify that pipeline methods are stubs and real
  logic lives in integration adapters (Controller, SEAL, SandboxedTestRunner),
  matching the 'What's Still TODO' section framing
- Remove all line number references (line ~N) from Key file annotations
  to prevent drift from misleading new contributors
- Add 'Illustrative' disclaimers to all pseudo-code blocks that are not
  exact source excerpts
- Update 'What's Still TODO' section to cross-reference the adapter
  descriptions in Steps 4-6 instead of contradicting them
- Further Reading links all verified to exist — no changes needed
@SHA888

SHA888 commented Jul 31, 2026

Copy link
Copy Markdown
Owner Author

Addressed all four review points in 01b4872:

1. Steps vs. TODO contradiction (Steps 4-6): Rewrote Steps 4, 5, and 6 to match the adapter-centric framing. Each now explicitly states the pipeline method is a stub/passthrough and describes where the real logic lives (Controller.run_generation for generation, SEAL adapter for adaptation, SandboxedTestRunner for evaluation). The 'What's Still TODO' section now cross-references these same adapter descriptions instead of contradicting them.

2. Line number references: Removed all annotations from Key file references. The function/class names remain. Line numbers were accurate at time of writing but will drift.

3. Further Reading links: Verified all four paths exist on disk — no changes needed:

4. Code snippet disclaimers: Added explicit / comments to all pseudo-code blocks (Steps 2, 4, 7, 8, 10) that aren't exact source excerpts.

@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/tutorials/how_it_works.md`:
- Around line 329-336: Update the documentation around the pipeline methods to
distinguish their extension points: generation and adaptation delegate to the
DGM, OpenEvolve, and SEAL integration adapters, while evaluation is implemented
by SandboxedTestRunner. Avoid stating that all real logic resides only in the
integration adapters.
🪄 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 Plus

Run ID: 14baa77e-ee30-431e-8a9c-a46691c57de4

📥 Commits

Reviewing files that changed from the base of the PR and between 2017de5 and 01b4872.

📒 Files selected for processing (1)
  • docs/tutorials/how_it_works.md

Comment thread docs/tutorials/how_it_works.md Outdated
SHA888 added 4 commits July 31, 2026 17:50
Address PR #116 review feedback:

- Clarify that Controller.run_generation is a separate code path, not
  called by _generate_improvements() or on the pipeline's execution
  path. Remove misleading 'independent inner loop' framing.
- Resolve safety mandatory/optional contradiction: Step 1's
  SafetyIntegration is always initialized; Step 8's checkpoint/rollback
  wrapping is a separate optional variant (run_evolution_cycle_with_safety).
- Add language identifiers to all fenced code blocks (text/python).
- Distinguish extension points in What's Still TODO: generation and
  adaptation use integration adapters; evaluation uses SandboxedTestRunner.
- Update Key file reference for Step 4 to reflect both pipeline stub and
  Controller as separate code path.
Run ruff format to remove trailing whitespace on line 281 that was
causing the 'Lint and Type Check' CI job to fail.
…ks tutorial

- Fix STAGE_STARTED/STAGE_COMPLETED → PIPELINE_STAGE_STARTED/PIPELINE_STAGE_COMPLETED
  (verified against events.py lines 117-118)
- Standardize all illustrative code block comments to 'Illustrative — see ...' format
@SHA888
SHA888 merged commit 470f491 into main Aug 1, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant