fix(public): tie homepage identity block to controlled AI-search questions - #18
Conversation
…tions The homepage identity section now answers all seven controlled AI-search questions one row at a time (data-ai-question ids), and the offer wording is aligned across owned surfaces as human-reviewed. check-site.mjs and test-agent-ui.mjs gain guards for the question tie, the offer mirror between llms.txt and offer.md, and source-host validity for AI-search evidence runs (own-site citation required for found runs). Historical evidence fixtures stay byte-identical. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
📝 WalkthroughWalkthroughThe change adds structured homepage identity questions, updates public human-reviewed service messaging, strengthens evidence and offer validation, and adds tests for identity coverage, source URLs, first-party citations, and mirrored offer facts. ChangesIdentity and evidence validation
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f62437736e
ℹ️ 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".
| if (run.state === "found") { | ||
| const citesOwnSite = (run.sources || []).some((source) => { | ||
| try { | ||
| return new URL(source.url).hostname === businessHost; |
There was a problem hiding this comment.
Allow correctly sourced answers to remain
found
When an engine correctly names TinyStudio and returns facts that check out against the site but cites only a third-party source, the documented state definition still classifies the run as found; this new host check rejects it solely because tinystudio.io was not among the engine's citations. Since sources must record what the engine actually cited, this prevents a legitimate result from being recorded without either mislabeling the run or falsifying its sources. Validate the answer against the stated truth independently rather than requiring an own-site citation.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
scripts/test-agent-ui.mjs (1)
576-589: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExercise the
foundbranch.The supplied fixture has no
foundrun. The loop therefore never evaluates the own-site citation assertion.Add synthetic
foundcases with a first-party source and a foreign source. Assert that the first passes and the second fails.🤖 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 `@scripts/test-agent-ui.mjs` around lines 576 - 589, The test around the own-site citation logic in the “found runs must cite the tested business's own site” case does not exercise its assertion. Add synthetic found-run cases containing respectively a first-party source and only a foreign source, and assert that the first is accepted while the second is rejected, reusing the existing site-host and citation validation behavior.
🤖 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 `@evidence-fixtures/ai-search/README.md`:
- Around line 54-61: Update the homepage identity documentation to require that
each controlled question is covered collectively by one or more rows, matching
the existing shared-row mapping and validator behavior. Keep the documented
fixture-ID validation requirements unchanged.
In `@public/index.html`:
- Around line 122-144: Resolve the conflicting offer facts between the homepage
FAQ entries identified by data-ai-question q2-what-tinystudio-charges and
q4-who-tinystudio-works-with and the current offer contract in offer.md: either
clearly separate the offers with explicit eligibility and pricing, or align the
homepage price and target buyers with the active Managed IT/MSP/cybersecurity
founder-pilot offer. Extend the existing validation to assert these homepage
facts so future changes cannot reintroduce the conflict.
---
Nitpick comments:
In `@scripts/test-agent-ui.mjs`:
- Around line 576-589: The test around the own-site citation logic in the “found
runs must cite the tested business's own site” case does not exercise its
assertion. Add synthetic found-run cases containing respectively a first-party
source and only a foreign source, and assert that the first is accepted while
the second is rejected, reusing the existing site-host and citation validation
behavior.
🪄 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: 80fbbe0f-120e-467a-908c-b09e09a3eb13
📒 Files selected for processing (6)
evidence-fixtures/ai-search/README.mdpublic/audit.htmlpublic/index.htmlpublic/offer.mdscripts/check-site.mjsscripts/test-agent-ui.mjs
| The homepage identity section (`public/index.html`, `id="identity"`) leads with | ||
| a compact "which TinyStudio" disambiguation block: one row per controlled | ||
| question, each row tagged with the fixture question id(s) via | ||
| `data-ai-question`. `scripts/check-site.mjs` fails if any controlled question | ||
| is not answered on the homepage or if a referenced id does not exist in the | ||
| fixture, and the same invariant is asserted in `scripts/test-agent-ui.mjs`. The | ||
| fixture never changes to match the site — the site is what gets edited to | ||
| answer the questions the evidence asks. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Correct the row-coverage rule.
Line 55 says there is one row per controlled question. public/index.html Line 126 maps both q2-what-tinystudio-charges and q7-what-tinystudio-io-charges to one row. scripts/check-site.mjs also permits this mapping.
Update the documentation to require collective coverage by one or more rows, or change the markup and validator to enforce one question ID per row.
🤖 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 `@evidence-fixtures/ai-search/README.md` around lines 54 - 61, Update the
homepage identity documentation to require that each controlled question is
covered collectively by one or more rows, matching the existing shared-row
mapping and validator behavior. Keep the documented fixture-ID validation
requirements unchanged.
| <div class="q" data-ai-question="q1-what-tinystudio-does"> | ||
| <h4>What TinyStudio does</h4> | ||
| <p>The free leak audit of high-ticket service homepages — and the desk that closes what the audit finds, with a person's name on every audit.</p> | ||
| </div> | ||
| <div class="q" data-ai-question="q2-what-tinystudio-charges q7-what-tinystudio-io-charges"> | ||
| <h4>What TinyStudio charges</h4> | ||
| <p>The audit is free and yours to keep. The desk that closes findings runs at $2,500 a month, on a three-month minimum.</p> | ||
| </div> | ||
| <div class="q" data-ai-question="q3-where-tinystudio-is-based"> | ||
| <h4>Where TinyStudio is based</h4> | ||
| <p>No base city or office address is stated.</p> | ||
| </div> | ||
| <div class="q" data-ai-question="q4-who-tinystudio-works-with"> | ||
| <h4>Who TinyStudio works with</h4> | ||
| <p>High-ticket service businesses — clinics, surgeons, dentists, spas, dealers, brokers — and clients are never named.</p> | ||
| </div> | ||
| <div class="q" data-ai-question="q5-what-is-tinystudio-io"> | ||
| <h4>What is tinystudio.io</h4> | ||
| <p>This site: the leak audit and the desk behind it.</p> | ||
| </div> | ||
| <div class="q" data-ai-question="q6-client-work"> | ||
| <h4>Does TinyStudio publish client work</h4> | ||
| <p>No. No logos, no case studies, no testimonials, no "as seen at".</p> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Resolve the active-offer contract conflict.
Line 128 states a $2,500 monthly price. Line 136 states that TinyStudio serves high-ticket clinics and similar businesses. public/offer.md Line 3 defines one current service for Managed IT, MSP, and cybersecurity companies, and Line 35 states $1,000 founder-pilot pricing.
These controlled answers present conflicting facts for the same business. Define the offers as separate with clear eligibility, or align the price and buyer facts across the owned surfaces. Extend the validation to cover the homepage facts.
🤖 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 `@public/index.html` around lines 122 - 144, Resolve the conflicting offer
facts between the homepage FAQ entries identified by data-ai-question
q2-what-tinystudio-charges and q4-who-tinystudio-works-with and the current
offer contract in offer.md: either clearly separate the offers with explicit
eligibility and pricing, or align the homepage price and target buyers with the
active Managed IT/MSP/cybersecurity founder-pilot offer. Extend the existing
validation to assert these homepage facts so future changes cannot reintroduce
the conflict.
intended-outcome: the homepage leads with a compact disambiguation block answering all seven controlled AI-search questions (data-ai-question ids) tied to the evidence fixture, human-reviewed outcome wording aligned across owned surfaces, and deterministic guards (source-host validity, own-site citation for found runs, offer mirror between llms.txt and offer.md) that keep identity and evidence from drifting; historical evidence fixtures remain byte-identical.
verify: npm run check (passed); npm test (51 worker + 13 UI, all pass); git diff --check (clean); sgscan (11 pre-existing warnings, unchanged from main, none in candidate scope); evidence-fixtures/ai-search/controlled-questions.json and evidence.json unchanged.
Candidate 2 of the AI-entity remediation: applied exactly from the reviewed candidate diff. Grok review was not performed (command unavailable); the candidate was independently validated via the test gate, npm test, and sgscan before this PR. PR-only phase: not merged, not deployed, no live AI improvement claimed.
Summary by CodeRabbit