Skip to content

docs: architecture.md refresh + docs/ideas untrack + showcase Part A expected output#23

Merged
justi merged 2 commits into
mainfrom
docs/architecture-and-ideas-cleanup
Apr 23, 2026
Merged

docs: architecture.md refresh + docs/ideas untrack + showcase Part A expected output#23
justi merged 2 commits into
mainfrom
docs/architecture-and-ideas-cleanup

Conversation

@justi
Copy link
Copy Markdown
Owner

@justi justi commented Apr 23, 2026

Three small documentation cleanups.

1. architecture.md refresh

The class tree in docs/architecture.md was stale. Updated to match the current code:

  • Added Step::RetryPolicy (DSL-level config; distinct from Step::RetryExecutor).
  • Added Pipeline::Result.
  • Added Eval::AggregatedReport, Eval::BaselineDiff, Eval::PromptDiffComparator, Eval::EvalHistory, Eval::RetryOptimizer.
  • Replaced the outdated Eval::TraitEvaluator entry with Eval::ExpectationEvaluator (the actual class name).
  • Added OptimizeRakeTask alongside RakeTask.

2. docs/ideas/ untracked

Already in .gitignore (line 14), but docs/ideas/10_eval_defaults.md was committed before the ignore rule landed, so git kept tracking it. git rm --cached removes it from version control without deleting it on disk. The other 11 idea files were already ignored.

3. Showcase 11 Part A expected output in examples/README.md

examples/README.md showed only Part B (the "after" trace with retry success) but omitted Part A (schema-only pain point). Readers scrolling the examples index on GitHub saw the fix but not the problem the fix solves, which is the whole reason Part A exists in the script. Both sections now verified byte-identical to ruby examples/11_fallback_showcase.rb.

No version bump

Docs-only change; gem stays at 0.7.2.

architecture.md — updated to reflect the current class layout. Additions
reflect code that landed across recent releases but was never added to the
diagram:

- Step::RetryPolicy (DSL-level config object, distinct from RetryExecutor)
- Pipeline::Result (per-step outputs + aggregated trace)
- Eval::AggregatedReport, Eval::BaselineDiff, Eval::PromptDiffComparator,
  Eval::EvalHistory, Eval::RetryOptimizer
- Eval::ExpectationEvaluator (replaces the outdated Eval::TraitEvaluator
  entry — that class no longer exists)
- OptimizeRakeTask alongside RakeTask

docs/ideas/ is already in .gitignore but docs/ideas/10_eval_defaults.md
was committed before the ignore rule landed, so git kept tracking it.
Untracked via `git rm --cached` — file stays on disk locally, no future
idea notes will be committed by accident.

No version bump.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 23, 2026 04:41
examples/README.md showed only Part B (the "after" trace with retry success)
but omitted Part A (schema-only pain point). Readers scrolling the examples
index on GitHub saw the fix but not the problem the fix solves, which is
the whole reason Part A exists in the script.

Both sections now verified byte-identical to `ruby examples/11_fallback_showcase.rb`.

No version bump.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@justi justi changed the title docs: refresh architecture.md + untrack docs/ideas/ docs: architecture.md refresh + docs/ideas untrack + showcase Part A expected output Apr 23, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refreshes documentation to reflect the current ruby_llm-contract class layout and removes an accidentally-tracked “ideas” note from version control.

Changes:

  • Updated docs/architecture.md class tree to include newer pipeline/step/eval/rake components and remove stale entries.
  • Removed docs/ideas/10_eval_defaults.md from git tracking (so docs/ideas/ remains ignored going forward).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
docs/ideas/10_eval_defaults.md Deleted previously-tracked idea note so the ignored docs/ideas/ directory stays untracked.
docs/architecture.md Updated architecture/class tree to match current codebase structure and tooling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/architecture.md
Comment on lines 19 to 22
├── Contract::Definition # parse strategy + validates
│ ├── Contract::Parser # :json / :text (auto-inferred from output type)
│ ├── Contract::Validator # runs parse + schema + validates
│ ├── Contract::Validator # runs parse + schema + validates + observations
│ └── Contract::SchemaValidator # JSON Schema validation (nested)
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

The architecture tree lists Contract::Definition, Contract::Parser, Contract::Validator, and Contract::SchemaValidator, but these constants don’t exist under a Contract:: namespace. In code they are RubyLLM::Contract::Definition, RubyLLM::Contract::Parser, RubyLLM::Contract::Validator, and RubyLLM::Contract::SchemaValidator. Updating the names (either fully-qualify them or drop the Contract:: prefix) would avoid misleading readers.

Copilot uses AI. Check for mistakes.
Comment thread docs/architecture.md
├── Eval::Report # score, pass_rate, per-case results
├── Eval::AggregatedReport # merged reports across models or runs
├── Eval::CaseResult # value object (name, passed?, output, expected, mismatches, cost)
├── Eval::ExpectationEvaluator # expected / expected_traits / evaluator proc
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

Eval::ExpectationEvaluator is described as handling expected_traits, but trait evaluation is implemented separately in RubyLLM::Contract::Eval::TraitEvaluator (and ExpectationEvaluator only selects evaluators for expected values like Hash/Regexp/exact). Consider updating this description and/or adding Eval::TraitEvaluator to the tree so the responsibilities match the current code.

Suggested change
├── Eval::ExpectationEvaluator # expected / expected_traits / evaluator proc
├── Eval::ExpectationEvaluator # expected matching (Hash / Regexp / exact)
├── Eval::TraitEvaluator # expected_traits evaluation

Copilot uses AI. Check for mistakes.
@justi justi merged commit 5c064d2 into main Apr 23, 2026
1 check passed
justi added a commit that referenced this pull request Apr 24, 2026
Adoption-friction release. No runtime behavior changes — every delta is in `docs/`, `examples/`, or `spec/integration/` (plus version.rb / Gemfile.lock bumps). Upgrading from 0.7.2 picks up the expanded guide set, the consolidated runnable showcases, and one extra integration spec.

Consolidates 7 merged PRs (#21#27) into one release:

- #21 Guide rewrite + adoption friction (why.md, "Do I need this?", outcome labels, TL;DR boxes)
- #22 Runnable aha-moment showcases (fallback + retry variants)
- #23 architecture.md refresh + docs/ideas untracked
- #24 Schema pitfall fix (5 example files) + expected output coverage
- #25 Examples consolidation — drop Reddit, renumber 00-06, restore pipeline + real-LLM minimal
- #26 Rails integration FAQ guide (7 pre-emptive questions)
- #27 Pipeline-level run_eval coverage — closes the "09 STEP 5" known issue from 0.7.2

Copilot review of the CHANGELOG itself flagged two inaccuracies before merge:
- "No gem-level code changes" replaced with "No runtime behavior changes" so version.rb / Gemfile.lock bumps are not misrepresented.
- Stale `examples/09_eval_dataset.rb` reference updated to current `05_eval_dataset.rb` after the renumber.

Verification: 1287 specs pass, 6/6 test-adapter examples run clean, bundle install resolves 0.7.3.

Full changelog entry on main in CHANGELOG.md.
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