Skip to content

test: guard methodology /check mentions stay clickable, never plain text - #108

Merged
nish3451 merged 4 commits into
mainfrom
seo-fix-kit/lane1-methodology-check-cta-guard
Aug 12, 2026
Merged

nish3451 merged 4 commits into
mainfrom
seo-fix-kit/lane1-methodology-check-cta-guard

Conversation

@nish3451

@nish3451 nish3451 commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

What

Scout item (2026-08-09, rank 2): "Turn the plain-text /check URL on /methodology into a real clickable CTA."

Investigation showed the instance fix is already merged — PR #90 (dbb088d, merged 2026-08-11, after the scout's observation) turned every /check mention on the methodology page into links, including a Check one page now CTA. Verified on origin/main:

  • Rendered methodologyHtml: 5 mentions of the check URL, 3 as href, 2 as anchor text — 0 plain text.
  • Existing tests (lines 39-48) assert the links exist.

What's missing and what this PR adds

The existing tests only assert the links exist — nothing fails if a plain-text /check mention regresses back in. This PR adds the missing detector per the standing rule (fix the instance AND the detector): a guard asserting every /check mention on the methodology page is either a link href or a link's anchor text. Proven to catch a simulated regression (tampered HTML with a plain-text mention fails the guard).

Validation

  • npm run test:public-pages: 8/8 pass
  • Guard verified against a tampered page: fails as intended

Summary by CodeRabbit

  • Tests
    • Added regression coverage to verify that all /check URL mentions on the methodology page are clickable.

The scout item (plain-text /check on /methodology) was already fixed by #90,
but no test failed if a plain-text mention regressed back in. Add a guard
asserting every /check mention on the methodology page is a link href or a
link's anchor text.

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

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request adds a regression test for /check URL mentions on the methodology page. The test verifies that each mention is clickable through a matching link href or anchor text.

Changes

Methodology link validation

Layer / File(s) Summary
Methodology link regression test
worker/routes/pages.test.mjs
The test requires at least one anonymous check URL and verifies that every URL mention appears in a link href or anchor text.

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

🚥 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 identifies the regression test that keeps methodology page /check mentions clickable instead of plain text.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch seo-fix-kit/lane1-methodology-check-cta-guard

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cc6e4d1bce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const checkUrl = `${origin}/check`;
const totalMentions = methodology.split(checkUrl).length - 1;
const hrefMentions = methodology.split(`href="${checkUrl}"`).length - 1;
const linkTextMentions = methodology.split(`>${checkUrl}<`).length - 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require URL text to be inside an anchor

The >${checkUrl}< count treats the URL as clickable inside any element, so changing one existing <a href="…">https://…/check</a> to <span>https://…/check</span> still satisfies this equality. The earlier exact-anchor assertion also continues to pass because the methodology page contains another identical anchor, leaving the new regression detector unable to catch precisely this plain-text regression; inspect actual anchor elements or check for URL text remaining after anchors are removed instead.

Useful? React with 👍 / 👎.

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

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb99e80759

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const checkUrl = `${origin}/check`;
const totalMentions = methodology.split(checkUrl).length - 1;
const hrefMentions = methodology.split(`href="${checkUrl}"`).length - 1;
const linkTextMentions = methodology.split(`>${checkUrl}<`).length - 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Ensure displayed check URLs point to the check route

If one displayed URL is changed to an anchor targeting another route, such as <a href=".../packages">https://seofixkit.com/check</a>, this guard still passes because linkTextMentions counts the text without verifying its enclosing anchor's destination; the earlier exact-anchor assertion also passes while the other identical anchor remains. This therefore misses a regression where users click a displayed /check URL but are sent to the wrong page, so each displayed URL should be validated together with its anchor's href.

Useful? React with 👍 / 👎.

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

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ffabfd7617

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +54 to +55
const totalMentions = methodology.split(checkUrl).length - 1;
const hrefMentions = methodology.split(`href="${checkUrl}"`).length - 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Accept clickable check URLs with suffixes

When a legitimate link adds a query string or fragment, such as href="https://seofixkit.com/check?source=methodology", totalMentions still counts the /check prefix but hrefMentions requires the closing quote immediately after it, so this guard fails even though the mention remains clickable. Count parsed anchors whose resolved URL targets the check route, or otherwise allow URL suffixes, to avoid blocking valid tracking parameters and fragments.

Useful? React with 👍 / 👎.

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

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3d7833e6e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +53 to +54
const checkUrl = `${origin}/check`;
const totalMentions = methodology.split(checkUrl).length - 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Count relative /check mentions in the guard

If an existing absolute-URL anchor is replaced with visible plain text such as /check, this guard still passes because it counts only ${origin}/check; both totalMentions and the clickable counts simply decrease together, while the other identical anchor satisfies the earlier assertion. The test therefore does not enforce its stated invariant for relative mentions of the same route, so it should inspect rendered text for both absolute and relative /check references.

Useful? React with 👍 / 👎.

@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 `@worker/routes/pages.test.mjs`:
- Around line 54-60: Update the mention-counting assertions around
totalMentions, hrefMentions, and linkTextMentions to inspect only actual anchor
elements. Use an HTML parser or scoped anchor matcher to count matching href
attributes and anchor contents, excluding plain-text occurrences such as
paragraph text, while preserving the existing validation that the methodology
mentions the check.
🪄 Autofix

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: 898f8ae9-e710-4429-b691-6968c6b1c875

📥 Commits

Reviewing files that changed from the base of the PR and between 3e46651 and b3d7833.

📒 Files selected for processing (1)
  • worker/routes/pages.test.mjs

Comment on lines +54 to +60
const totalMentions = methodology.split(checkUrl).length - 1;
const hrefMentions = methodology.split(`href="${checkUrl}"`).length - 1;
const linkTextMentions = methodology.split(`>${checkUrl}<`).length - 1;
assert.ok(totalMentions > 0, "methodology must mention the anonymous one-page check");
assert.equal(
totalMentions,
hrefMentions + linkTextMentions,

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

Count mentions inside actual anchor elements.

linkTextMentions matches any >${checkUrl}< sequence, including <p>${checkUrl}</p>. A non-clickable mention can therefore pass when another occurrence contributes a matching href count. Extract actual <a> elements with an HTML parser or a scoped matcher, then count only their href values and contents.

🤖 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 `@worker/routes/pages.test.mjs` around lines 54 - 60, Update the
mention-counting assertions around totalMentions, hrefMentions, and
linkTextMentions to inspect only actual anchor elements. Use an HTML parser or
scoped anchor matcher to count matching href attributes and anchor contents,
excluding plain-text occurrences such as paragraph text, while preserving the
existing validation that the methodology mentions the check.

@nish3451
nish3451 merged commit 1714ac0 into main Aug 12, 2026
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