Skip to content

docs: describe what the first Intelligent Contract example actually checks - #810

Open
ygd58 wants to merge 1 commit into
genlayerlabs:mainfrom
ygd58:docs/first-contract-describe-substring-check
Open

ygd58 wants to merge 1 commit into
genlayerlabs:mainfrom
ygd58:docs/first-contract-describe-substring-check

Conversation

@ygd58

@ygd58 ygd58 commented Nov 3, 2026 •

Copy link
Copy Markdown

Summary

Fixes #802. The "Your First Intelligent Contract" tutorial says the example verifies that the page has a link to the owner, but both code examples only return 'iana' in web_data. This PR makes the prose describe what the code does. The code examples are unchanged.

Change

first-intelligent-contract.mdx, two lines:

  • the intro now says the example checks whether the lowercase text iana appears anywhere in the HTML, and that it neither looks for a link nor checks where a link points or who owns the page
  • item 4 no longer claims HTML mode is needed "because we want text from a link"; it says the check runs on the markup, that 'iana' in web_data is a plain case-sensitive substring test matching anywhere in the returned HTML (visible text, an attribute value such as an href), and that it does not parse <a> elements or validate href values

The wording follows the replacement text proposed in the issue (thanks to its author for the precise report), with one deliberate difference: I did not write that the check can match HTML comments. The issue itself notes that GenVM's rendering semantics were not tested, and the SDK docs for web.render(mode='html') do not say what the returned HTML contains, so I kept to what follows from the code: in on the returned string.

Checked

I evaluated the predicate on literal strings before writing each claim: it returns True for body text only, for a link to another site whose href merely contains iana, and for a plain attribute value with no <a> at all; it returns False for IANA in uppercase on its own (so "case-sensitive" and "lowercase" are accurate). The same wording appears nowhere else in pages/. The MDX compiles with @mdx-js/mdx. I did not run the contract against GenVM or Studio.

Summary by CodeRabbit

  • Documentation
    • Updated the simple example to check for the case-sensitive text “iana” in rendered HTML, clarifying that it does not validate links or their destinations.

…hecks

The tutorial says the example "verifies that it has a link to the
owner", and explains the HTML mode with "we want text from a link".
Both code examples only return `'iana' in web_data`, a case-sensitive
substring test on the returned HTML. It matches `iana` in visible text
or in an attribute value, and it never looks for an `<a>` element or at
its `href`.

Describe what the example does and where it stops, and leave both code
examples unchanged. A parser-based example that really verifies an
owner link would be a separate change.

Fixes genlayerlabs#802
@netlify

netlify Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for genlayer-docs ready!

Name Link
🔨 Latest commit 8e3c4c3
🔍 Latest deploy log https://app.netlify.com/projects/genlayer-docs/deploys/6ae9c1f8ce90340b3fd648c5
😎 Deploy Preview https://deploy-preview-810--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

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The tutorial now describes its example as a case-sensitive search for iana anywhere in the returned HTML. It clarifies that the check does not parse links or validate their href values.

Changes: Tutorial wording

Layer / File(s) Summary
Describe the substring check
pages/developers/intelligent-contracts/first-intelligent-contract.mdx
The example description and explanation now state that the check searches for lowercase iana anywhere in the HTML. They clarify that it does not parse links or validate href values.

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

Change: Other · Severity of issue fixed: Low

Possibly related issues

  • Issue 802: The tutorial wording addresses the same objective by describing the substring check and its limits.

Suggested reviewers: acastellana

Merge Risk: Minimal · up to 8e3c4

This documentation-only change is ready to merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title uses the required Conventional Commits format and clearly describes the documentation change: it explains what the first Intelligent Contract example actually checks.
Description check Passed The description is detailed, on-topic, and includes the change summary, linked issue, validation performed, and known testing limits. It uses headings different from the template, but it provides the …
Linked Issues check Passed Issue #802 requires a documentation correction and unchanged code examples. The diff updates the introduction to describe a lowercase iana substring check and states that it does not verify links or…
Out of Scope Changes check Passed The diff changes only the two documentation statements required by issue #802. It adds no parser implementation, runtime behavior change, dependency, or unrelated content.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Description check

Explanation

The description is detailed, on-topic, and includes the change summary, linked issue, validation performed, and known testing limits. It uses headings different from the template, but it provides the required description content and is mostly complete.

Full details: Linked Issues check

Explanation

Issue #802 requires a documentation correction and unchanged code examples. The diff updates the introduction to describe a lowercase iana substring check and states that it does not verify links or page ownership. Item 4 explains the case-sensitive test, matching against returned HTML, and the lack of &lt;a&gt; parsing or href validation. The two code examples are unchanged.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 39cbb61a-0eab-4d3d-ad24-71271605bf82
Commits

Reviewing files that changed from the base of the PR and between 65d920c and 8e3c4c3.

Files selected for processing: 1
  • pages/developers/intelligent-contracts/first-intelligent-contract.mdx

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

This branch has not been deployed

No deployments
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.

Clarify that the first Intelligent Contract example checks a substring, not a link

1 participant