Skip to content

fix: guard ungrounded research when discovery finds no URLs; refresh deploy docs - #4

Merged
arwazarish merged 8 commits into
mainfrom
fix/research-guard-and-deploy-docs
Aug 12, 2026
Merged

fix: guard ungrounded research when discovery finds no URLs; refresh deploy docs#4
arwazarish merged 8 commits into
mainfrom
fix/research-guard-and-deploy-docs

Conversation

@arwazarish

Copy link
Copy Markdown
Contributor

Review-fix pass for the unmerged main changes (Gemini 3.x re-routing + two-step discovery→url_context pipeline + setup docs).

Bug fix

  • researchIdea retries Flash-Lite URL discovery once when it returns zero candidates, then throws a retryable AppError — instead of running url_context grounding with nothing to fetch, which let the model answer from memory and pass self-authored citations off as verified sources (src/agents/research.js).
  • Dropped the unused requirement param from discoverySystemFor (src/agents/prompts.js).
  • 2 new tests (suite now 55): retry-once path + fail-loudly path.

Deploy docs refreshed (were contradicted by the change set)

  • Corrected the wrong wrangler pages deploy src command (static files live at repo root) → wrangler pages deploy . --project-name zarishdocs --branch main --commit-dirty=true in AGENTS.md/SETUP.md/TechDesign §13.
  • Replaced stale "not yet deployed" / placeholder claims with the real live endpoints (zarishdocs-proxy.zarishsphere.workers.dev, zarishdocs.pages.dev) in AGENTS.md, README.md, SETUP.md, REPOSITORY-INVENTORY.md, .github/copilot-instructions.md, agent_docs/tech_stack.md, worker/wrangler.toml.
  • MEMORY.md current-state/known-issues updated; worker test fixture now uses the real origin.

Supersedes PR #3 (its commits 96bb095/65f391f are included in this branch).

…kflow docs

- Bump all actions to exact latest stable versions across 9 workflows:
  checkout@v7.0.1, codeql-action@v4.37.6, github-script@v9.0.0,
  osv-scanner-action@v2.5.0, release-please-action@v5.0.0,
  setup-python@v7.0.0, lychee-action@v2.9.0, scorecard-action@v2.4.4,
  action-semantic-pull-request@v6.1.1, stale@v11.0.0
- Fix repo-lint stale-reference check self-match and KhazP/Reddit-to-AI false positive
- Fix labels.yml stale 'Vibe-coding' workflow label description
- Add tool adapters for opencode, gemini-cli, copilot, windsurf, lovable
- Add .claude skills, templates/, examples/, scripts/validate.py, CITATION.cff
- Update AGENTS/MEMORY/agent_docs for Gemini 3.x model routing correction
- Ignore session-ses_0*.md
- Click-by-click setup for GitHub settings, Gemini key, Cloudflare Worker
  secret (GEMINI_API_KEY), ALLOWED_ORIGIN var, Pages deploy, and code
  placeholders, so the first push runs green
- Fix broken github.com/zarishsphere links in docs (org is zsdotcom)
- Ignore wrangler's .dev.vars local secret file
…deploy docs

- researchIdea retries Flash-Lite discovery once, then throws a retryable
  AppError instead of running url_context grounding with zero candidate URLs
  (which let the model answer from memory and fabricate 'verified' citations)
- drop unused requirement param from discoverySystemFor
- correct pages deploy command (repo root, not src/) in AGENTS.md/SETUP.md/TechDesign
- replace stale not-deployed/placeholder claims with live endpoints in
  AGENTS/README/SETUP/REPOSITORY-INVENTORY/copilot-instructions/tech_stack
- real ALLOWED_ORIGIN in worker test fixture and wrangler.toml comment
- add 2 research tests (suite now 55); update MEMORY.md state
@arwazarish arwazarish mentioned this pull request Aug 12, 2026
5 tasks
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 111 files, which is 11 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 651353e5-7522-4ccc-a7b7-1cc649a85653

📥 Commits

Reviewing files that changed from the base of the PR and between 1c4339c and f47588e.

📒 Files selected for processing (111)
  • .claude/README.md
  • .claude/settings.json
  • .claude/skills/zsdocs-agents/SKILL.md
  • .claude/skills/zsdocs-build/SKILL.md
  • .claude/skills/zsdocs-prd/SKILL.md
  • .claude/skills/zsdocs-research/SKILL.md
  • .claude/skills/zsdocs-techdesign/SKILL.md
  • .claude/skills/zsdocs-workflow/SKILL.md
  • .github/CODEOWNERS
  • .github/CODE_OF_CONDUCT.md
  • .github/CONTRIBUTING.md
  • .github/DISCUSSION_TEMPLATE/governance.yml
  • .github/FAQ.md
  • .github/FUNDING.yml
  • .github/GOVERNANCE.md
  • .github/ISSUE_TEMPLATE/bug_report.yml
  • .github/ISSUE_TEMPLATE/config.yml
  • .github/ISSUE_TEMPLATE/feature_request.yml
  • .github/ISSUE_TEMPLATE/showcase_submission.md
  • .github/MCP-SETUP.md
  • .github/PULL_REQUEST_TEMPLATE.md
  • .github/SECURITY.md
  • .github/SUPPORT.md
  • .github/copilot-instructions.md
  • .github/labels.yml
  • .github/workflows/codeql.yml
  • .github/workflows/greetings.yml
  • .github/workflows/osv-scanner.yml
  • .github/workflows/pr-size-labeler.yml
  • .github/workflows/release-please.yml
  • .github/workflows/repo-lint.yml
  • .github/workflows/scorecard.yml
  • .github/workflows/semantic-pr.yml
  • .github/workflows/stale.yml
  • .gitignore
  • AGENTS.md
  • CITATION.cff
  • MEMORY.md
  • README.md
  • REPOSITORY-INVENTORY.md
  • SETUP.md
  • agent_docs/code_patterns.md
  • agent_docs/product_requirements.md
  • agent_docs/project_brief.md
  • agent_docs/tech_stack.md
  • agent_docs/testing.md
  • docs/TechDesign-ZarishDocs-MVP.md
  • docs/research-ZarishDocs.md
  • examples/README.md
  • examples/reddit-to-ai/AGENTS.md
  • examples/reddit-to-ai/MEMORY.md
  • examples/reddit-to-ai/PRD-reddit-to-ai-MVP.md
  • examples/reddit-to-ai/TechDesign-reddit-to-ai-MVP.md
  • examples/reddit-to-ai/research-reddit-to-ai.md
  • scripts/validate.py
  • src/agents/architect.test.js
  • src/agents/profiler.test.js
  • src/agents/prompts.js
  • src/agents/research.js
  • src/agents/research.test.js
  • src/agents/writer.test.js
  • src/api.js
  • src/api.test.js
  • templates/AGENTS.md
  • templates/MEMORY.md
  • templates/REVIEW-CHECKLIST.md
  • templates/agent_docs/code_patterns.md
  • templates/agent_docs/product_requirements.md
  • templates/agent_docs/project_brief.md
  • templates/agent_docs/tech_stack.md
  • templates/agent_docs/testing.md
  • templates/tool-adapters/CLAUDE.md
  • templates/tool-adapters/README.md
  • templates/tool-adapters/antigravity/rules/zsdocs.md
  • templates/tool-adapters/antigravity/workflows/zsdocs-agents.md
  • templates/tool-adapters/antigravity/workflows/zsdocs-build.md
  • templates/tool-adapters/antigravity/workflows/zsdocs-prd.md
  • templates/tool-adapters/antigravity/workflows/zsdocs-research.md
  • templates/tool-adapters/antigravity/workflows/zsdocs-techdesign.md
  • templates/tool-adapters/antigravity/workflows/zsdocs-workflow.md
  • templates/tool-adapters/codex/README.md
  • templates/tool-adapters/codex/prompts/zsdocs-agents.md
  • templates/tool-adapters/codex/prompts/zsdocs-build.md
  • templates/tool-adapters/codex/prompts/zsdocs-prd.md
  • templates/tool-adapters/codex/prompts/zsdocs-research.md
  • templates/tool-adapters/codex/prompts/zsdocs-techdesign.md
  • templates/tool-adapters/codex/prompts/zsdocs-workflow.md
  • templates/tool-adapters/copilot/README.md
  • templates/tool-adapters/copilot/copilot-instructions.md
  • templates/tool-adapters/cursor/commands/zsdocs-agents.md
  • templates/tool-adapters/cursor/commands/zsdocs-build.md
  • templates/tool-adapters/cursor/commands/zsdocs-prd.md
  • templates/tool-adapters/cursor/commands/zsdocs-research.md
  • templates/tool-adapters/cursor/commands/zsdocs-techdesign.md
  • templates/tool-adapters/cursor/commands/zsdocs-workflow.md
  • templates/tool-adapters/cursor/rules/zsdocs.mdc
  • templates/tool-adapters/gemini-cli/GEMINI.md
  • templates/tool-adapters/gemini-cli/README.md
  • templates/tool-adapters/lovable/README.md
  • templates/tool-adapters/opencode/README.md
  • templates/tool-adapters/opencode/commands/zsdocs-agents.md
  • templates/tool-adapters/opencode/commands/zsdocs-build.md
  • templates/tool-adapters/opencode/commands/zsdocs-prd.md
  • templates/tool-adapters/opencode/commands/zsdocs-research.md
  • templates/tool-adapters/opencode/commands/zsdocs-techdesign.md
  • templates/tool-adapters/opencode/commands/zsdocs-workflow.md
  • templates/tool-adapters/windsurf/README.md
  • templates/tool-adapters/windsurf/rules/zsdocs.md
  • worker/index.js
  • worker/index.test.js
  • worker/wrangler.toml

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

Comment thread src/agents/research.test.js Dismissed
Comment thread src/agents/research.test.js Dismissed
Comment thread src/agents/research.test.js Dismissed

@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: eee6e4848a

ℹ️ 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 thread src/agents/research.js
Comment on lines +156 to +159
const response = await callLLM(
buildResearchPayload(requirement, candidateUrls),
options,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Require grounding chunks before accepting research

When discovery returns syntactically valid but unfetchable URLs, the new url_context call can come back without groundingMetadata.groundingChunks; this path still accepts the response and parseResearchResponse can merge the model's self-reported citation URLs, so a 404/blocked candidate source is emitted as verified research instead of failing or retrying. Check for at least one citation from citationsFromResponse(response) before accepting the finding so the no-ungrounded-research guard also covers failed URL Context fetches.

Useful? React with 👍 / 👎.

Comment on lines +18 to +20
permissions:
security-events: write # to upload SARIF results
id-token: write # to sign artifacts with fulcio

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 Grant contents read to the Scorecard job

In this Scorecard workflow, the job-level permissions block overrides the top-level read-all; GitHub's workflow syntax says unspecified permissions are set to none when any are listed (https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#permissions). In private/internal repos or orgs that require token-authenticated checkout, the following actions/checkout step will not have contents: read and the Scorecard job can fail before producing SARIF, so include contents: read alongside these write scopes.

Useful? React with 👍 / 👎.

Comment thread .claude/settings.json
"hooks": [
{
"type": "command",
"command": "node -e \"const fs=require('fs'); const d=JSON.parse(fs.readFileSync(0,'utf8')); const p=d.tool_input?.file_path||''; if(/\\.(ts|tsx|js|jsx)$/.test(p) && fs.existsSync('node_modules/.bin/prettier')) { require('child_process').execSync('npx prettier --write \\\"'+p+'\\\"', {stdio:'inherit'}); }\"",

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 Avoid shelling out with an unescaped hook path

When a prompt or skill causes Claude to Write/Edit a JS/TS file whose path contains a quote and shell metacharacters, this hook interpolates file_path into a string passed to execSync, so the path can break out of the quoted npx prettier argument and run arbitrary commands on the developer machine. Invoke Prettier with an argument-vector API such as execFileSync/spawnSync, or safely escape the path before using a shell.

Useful? React with 👍 / 👎.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@codeandbrain codeandbrain 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.

LGTM — all required checks pass (CodeQL, OSV-Scanner, Repo Lint, CodeRabbit). Discovery retry/guard and deploy-doc refresh look correct.

@arwazarish
arwazarish enabled auto-merge (rebase) August 12, 2026 04:35
GitHub names checks after the job key, so 'Repo Lint' produced 'validate'
and 'Semantic PR title' never ran (pull_request_target + job 'main').
Rename the jobs so the required checks exist. Switch semantic-pr to
pull_request so it runs on PR branches, not the base.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@arwazarish
arwazarish merged commit 2e24b6c into main Aug 12, 2026
9 checks passed
@arwazarish
arwazarish deleted the fix/research-guard-and-deploy-docs branch August 12, 2026 05:02
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.

3 participants