Skip to content

docs: Clarify validator verification#422

Merged
MuncleUscles merged 1 commit into
mainfrom
codex/independent-validator-docs
Jun 2, 2026
Merged

docs: Clarify validator verification#422
MuncleUscles merged 1 commit into
mainfrom
codex/independent-validator-docs

Conversation

@MuncleUscles
Copy link
Copy Markdown
Member

@MuncleUscles MuncleUscles commented Jun 2, 2026

Description

Clarifies the Equivalence Principle docs so validator functions must verify leader outputs using independent evidence rather than leader-output-only checks.

The update aligns the public docs with the improved skill guidance by reframing non-comparative validation as source-grounded verification, warning against schema-only validators, and steering decision/classification/scoring tasks toward comparative validation.

Validation

  • git diff --check
  • npx next build

Summary by CodeRabbit

  • Documentation
    • Enhanced consensus validation guidance with clearer requirements for independent evidence and validator responsibilities.
    • Added practical warnings and best practices for writing secure validators, including examples of common validation mistakes.
    • Expanded parameter documentation with detailed criteria descriptions and improved usage guidance for validator implementations.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 2, 2026

Deploy Preview for genlayer-docs ready!

Name Link
🔨 Latest commit 9582ebe
🔍 Latest deploy log https://app.netlify.com/projects/genlayer-docs/deploys/6a1ea31cd44e9e0008f8fdf4
😎 Deploy Preview https://deploy-preview-422--genlayer-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR refines the equivalence principle documentation to clarify consensus validation requirements. It emphasizes that validators must independently verify leader output using non-leader evidence and source-based criteria, clarifies Pattern 4 as "Source-Grounded Non-Comparative Validation," adds explicit security warnings against schema-only checks, and provides concrete examples of both secure and insecure validator patterns with updated API guidance.

Changes

Validator Independence and Consensus Validation Clarity

Layer / File(s) Summary
Core Validation Principles and Independent Verification
pages/developers/intelligent-contracts/equivalence-principle.mdx
Added quick-reference guidance on the default validation approach (independent evidence via rerun with tolerances) and expanded the "Independent Verification Is Required" section, establishing that validators must verify substance using non-leader evidence and that non-comparative validation still requires criteria-based judgment.
Pattern 4 Clarification and Schema Check Warning
pages/developers/intelligent-contracts/equivalence-principle.mdx
Renamed and clarified Pattern 4 as "Source-Grounded Non-Comparative Validation," adjusted explanatory text to reflect that validators do not write their own final answer but execute the input function to judge leader output against source data and criteria, and added a warning against using non-comparative validation as a schema check.
API Reference and Secure Validator Examples
pages/developers/intelligent-contracts/equivalence-principle.mdx
Updated prompt_non_comparative parameter documentation with expanded criteria guidance and contrasting messaging, added a "bad validator" example that demonstrates schema-only checking without source verification, and replaced the "Writing Secure Validators" guidelines with explicit first principles on never trusting the leader and tolerating nondeterminism.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • genlayerlabs/genlayer-docs#416: Both PRs modify pages/developers/intelligent-contracts/equivalence-principle.mdx to clarify leader vs validator consensus validation and what validators must independently verify.
  • genlayerlabs/genlayer-docs#224: Both PRs update the same equivalence-principle.mdx documentation section on leader/validator consensus validation—adjusting how validator functions are described and exemplified.

Suggested reviewers

  • cristiam86
  • dohernandez
  • rasca

Poem

🐰 A rabbit hops through consensus land,
Saying "trust not the leader's hand!"
Verify with thresholds, criteria clear,
And source-grounded judgment, my dear.
Schema checks alone? A security fear! 🔐

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'docs: Clarify validator verification' directly relates to the main change—clarifying validator verification requirements in the documentation.
Description check ✅ Passed The description covers the core changes (clarifying validator verification with independent evidence, reframing non-comparative validation, warning against schema-only validators) and validation steps performed.
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.

✏️ 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 codex/independent-validator-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 and usage tips.

Copy link
Copy Markdown
Contributor

@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

🤖 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 `@pages/developers/intelligent-contracts/equivalence-principle.mdx`:
- Line 556: The sentence currently favors "comparative validation" too narrowly;
update the phrasing to prefer "patterns 1-3" instead and broaden the guidance to
note that for tasks like classification, scoring, extraction, authenticity,
safety, ranking, or settlement decisions the default is often an independent
rerun with deterministic field/tolerance comparison (pattern 1–2) or other
pattern 3 approaches rather than only LLM-comparative validation; specifically
replace the clause mentioning "comparative validation" with wording that
recommends "patterns 1–3" as the preferred default and add a brief note that
independent reruns and deterministic checks are often the safer fit when they
can verify decisions from source data.
🪄 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

Run ID: 700332d9-51d0-4844-9644-868bea2cfa04

📥 Commits

Reviewing files that changed from the base of the PR and between e405cff and 9582ebe.

📒 Files selected for processing (1)
  • pages/developers/intelligent-contracts/equivalence-principle.mdx

- **`criteria`** — rules the validator's LLM uses to judge the leader's output against the input data

**Use when:** the task is subjective (NLP, classification, extraction) and you want validators to judge output quality rather than reproduce it.
**Use when:** the output is open-ended and validity can be judged against the input/source data without producing a second candidate output. Summaries are the clearest example: many different summaries can be valid, but the validator can still check faithfulness, coverage, hallucinations, and constraints. For classification, scoring, extraction, authenticity, safety, ranking, or settlement decisions, prefer comparative validation unless you can clearly explain how the validator independently verifies the decision from source data.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Prefer “patterns 1-3” here, not specifically “comparative validation.”

This sentence is narrower than the rest of the page. For classification, scoring, extraction, and similar decision tasks, the best default is often an independent rerun plus deterministic field/tolerance comparison, not necessarily LLM-comparative validation. As written, this can steer readers away from patterns 1-2 even when they are the safer fit.

✏️ Suggested wording
-**Use when:** the output is open-ended and validity can be judged against the input/source data without producing a second candidate output. Summaries are the clearest example: many different summaries can be valid, but the validator can still check faithfulness, coverage, hallucinations, and constraints. For classification, scoring, extraction, authenticity, safety, ranking, or settlement decisions, prefer comparative validation unless you can clearly explain how the validator independently verifies the decision from source data.
+**Use when:** the output is open-ended and validity can be judged against the input/source data without producing a second candidate output. Summaries are the clearest example: many different summaries can be valid, but the validator can still check faithfulness, coverage, hallucinations, and constraints. For classification, scoring, extraction, authenticity, safety, ranking, or settlement decisions, prefer patterns 1-3 over non-comparative validation. In most cases, validators should independently reproduce or derive the decision, then compare the relevant fields, score buckets, or tolerated ranges.
🤖 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 `@pages/developers/intelligent-contracts/equivalence-principle.mdx` at line
556, The sentence currently favors "comparative validation" too narrowly; update
the phrasing to prefer "patterns 1-3" instead and broaden the guidance to note
that for tasks like classification, scoring, extraction, authenticity, safety,
ranking, or settlement decisions the default is often an independent rerun with
deterministic field/tolerance comparison (pattern 1–2) or other pattern 3
approaches rather than only LLM-comparative validation; specifically replace the
clause mentioning "comparative validation" with wording that recommends
"patterns 1–3" as the preferred default and add a brief note that independent
reruns and deterministic checks are often the safer fit when they can verify
decisions from source data.

@MuncleUscles MuncleUscles merged commit a47f211 into main Jun 2, 2026
8 checks passed
@MuncleUscles MuncleUscles deleted the codex/independent-validator-docs branch June 2, 2026 09:37
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