AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
Python ai-promptsai-skillblueskyclaudeclaude-codeclawhubdeep-researchhackernewsinstagramopenclawpolymarketrecencyredditresearchsocial-mediatiktoktrendstwitterweb-searchyoutube
fix(skill): Grok Bot / Cursor agent chat is a hidden-link citation host (LAW 8 detects CURSOR_AGENT) (#1095)
Matt Van Horn56ba5ace27e4
diff --git a/changelog.d/1095.fixed.md b/changelog.d/1095.fixed.mdnew file mode 100644index 00000000..242f6730--- /dev/null+++ b/changelog.d/1095.fixed.md@@ -0,0 +1 @@+Grok Bot / Cursor agent chat is now a hidden-link citation host: LAW 8 detects it via `CURSOR_AGENT` (alongside `CLAUDECODE` for Claude Code) and inline-links every cited r/sub, u/name comment author, @handle, GitHub repo, and creator with URLs copied verbatim from the engine evidence. Codex, Gemini CLI, and raw CLI keep the plain-label regime, so no URL soup returns.diff --git a/skills/last30days/SKILL.md b/skills/last30days/SKILL.mdindex e7645419..27169082 100644--- a/skills/last30days/SKILL.md+++ b/skills/last30days/SKILL.md@@ -207,10 +207,10 @@ Named-entity topics (capitalized proper nouns, product names, person names, proj**LAW 8 - CITE READABLY FOR THE CURRENT HOST. INLINE-LINK ON HIDDEN-LINK HOSTS; PLAIN LABELS ON VISIBLE-URL HOSTS. NEVER A RAW URL STRING. NEVER URL SOUP.** Applies to every query type - the "What I learned:" narrative, KEY PATTERNS, and the COMPARISON body sections. There are two rendering regimes and the host picks which one you use:-- **Hidden-link hosts (Claude Code) - inline-link every citation.** Claude Code renders `[text](url)` as blue CMD-clickable text: the URL is hidden, only the label shows. Wrap every cited @handle, r/subreddit, publication, YouTube channel, TikTok creator, Instagram creator, and Polymarket market as `[name](url)` at first mention. The URL comes from the raw research dump (every engine item carries one; WebSearch supplements carry their own). This rich-citation form is the default and must not regress.-- **Visible-URL hosts (Codex, Cursor, Gemini CLI, raw CLI) - plain source labels, no narrative Markdown links.** These hosts render `[label](url)` as `label (https://...)` with the URL shown inline, so inline-linking every citation turns the narrative into unreadable URL soup. Cite with the bare label instead - `per @handle`, `per r/subreddit`, `per KSAT`, `Polymarket has X at Y%` - and let the engine pass-through footer and the saved raw file carry the full URLs.+- **Hidden-link hosts (Claude Code; Grok Bot / Cursor agent chat) - inline-link every citation.** These hosts render `[text](url)` as blue clickable text: the URL is hidden, only the label shows. Wrap every cited @handle, r/subreddit, u/name comment author, publication, YouTube channel, TikTok creator, Instagram creator, GitHub repo, and Polymarket market as `[name](url)` at first mention. The URL comes from the raw research dump (every engine item carries one; WebSearch supplements carry their own): a u/name cite takes the comment URL from that comment's own row in `## Top Community Comments` or the item evidence, and a GitHub cite takes the URL from the engine evidence block with a label that matches what that URL opens - `[owner/repo](url)` only when the evidence URL is the repository root; when the evidence row carries an issue, PR, or release URL, label the link as that item (e.g. `[owner/repo#123](url)`) instead of pairing an `owner/repo` label with an item URL, and never trim an item URL down to a guessed repo root. Never guess, reconstruct, or reassemble a URL. This rich-citation form is the default and must not regress.+- **Visible-URL hosts (Codex, Gemini CLI, raw CLI) - plain source labels, no narrative Markdown links.** These hosts render `[label](url)` as `label (https://...)` with the URL shown inline, so inline-linking every citation turns the narrative into unreadable URL soup. Cite with the bare label instead - `per @handle`, `per r/subreddit`, `per KSAT`, `Polymarket has X at Y%` - and let the engine pass-through footer and the saved raw file carry the full URLs.-**Host detection is deterministic - do not guess.** If the `CLAUDECODE` environment variable is set, you are on a hidden-link host: inline-link. If it is unset, treat the host as visible-URL: plain labels. This is the same split the Step 0 platform branch already draws (modal hosts are Claude Code; non-modal are Codex/Cursor/Gemini CLI/raw CLI); the env signal just pins it so it cannot drift. When genuinely unsure, prefer plain labels - a missing link is readable, URL soup is not.+**Host detection is deterministic - do not guess.** If the `CLAUDECODE` environment variable is set (Claude Code) or the `CURSOR_AGENT` environment variable is set (Grok Bot / Cursor agent chat), you are on a hidden-link host: inline-link. If both are unset, treat the host as visible-URL: plain labels (Codex, Gemini CLI, raw CLI). This is NOT the Step 0 setup split - Cursor stays a non-modal setup host, but its agent chat hides markdown URLs the way Claude Code does, so the citation renderer is a different axis from the modal/non-modal setup axis. The env signals pin the renderer choice so it cannot drift. When genuinely unsure, prefer plain labels - a missing link is readable, URL soup is not.The stats footer (emoji-tree block) is engine-emitted per LAW 5 and passes through verbatim on every host - do NOT reformat its links yourself.@@ -219,14 +219,14 @@ The stats footer (emoji-tree block) is engine-emitted per LAW 5 and passes throu**BAD (raw URL, any host):** `per https://www.rollingstone.com/music/music-news/kanye-west-bully-1235506094/`**BAD (URL soup on a visible-URL host):** `per [Rolling Stone](https://www.rollingstone.com/...)` when the host prints it as `Rolling Stone (https://...)`**BAD (broken empty link):** `per [Rolling Stone]()`-**GOOD on hidden-link hosts (Claude Code):** `per [Rolling Stone](https://www.rollingstone.com/music/music-news/kanye-west-bully-1235506094/)`, `per [@honest30bgfan_](https://x.com/honest30bgfan_)`, `[r/hiphopheads](https://reddit.com/r/hiphopheads)`+**GOOD on hidden-link hosts (Claude Code, Grok Bot / Cursor agent chat):** `per [Rolling Stone](https://www.rollingstone.com/music/music-news/kanye-west-bully-1235506094/)`, `per [@honest30bgfan_](https://x.com/honest30bgfan_)`, `[r/hiphopheads](https://reddit.com/r/hiphopheads)`, `[u/dramabeats](https://reddit.com/r/hiphopheads/comments/abc123/comment/def456/)` (the comment row's own URL), `[anthropics/claude-code](https://github.com/anthropics/claude-code)` (evidence URL is the repo root) or `[anthropics/claude-code#512](https://github.com/anthropics/claude-code/issues/512)` (evidence URL is an issue, so the label names the issue)**GOOD on visible-URL hosts (Codex):** `per Rolling Stone`, `per @honest30bgfan_`, `per r/hiphopheads`-**Observed LAW 8 need (2026-04-20 inline-links saga; renderer split 2026-06-25):** the citation rule originally lived in the CITATION PRIORITY block around line 1224 - below the chunked-read window - and four consecutive runs (Matt Van Horn, Peter Steinberger, Best Headphones, OpenClaw vs Hermes) skipped it because the model read lines 1-1000 and stopped ("I never reached line 1224"). Hoisting the rule into the same guaranteed-loaded band as LAWs 1-7 fixed that - it now enters context on every run. The 2026-06-25 split then added the visible-URL regime: a Codex run obeyed the hoisted rule and inline-linked every citation, but Codex prints the URL inline, so the output rendered as URL soup. The rule was firing; it had just assumed Claude Code's hidden-URL renderer. Same hoist pattern that solved v3.0.6 (invented titles), disaster #2 (stripped bold), disaster #3 (trailing Sources), and the Hermes 2026-04-19 evidence-dump disaster.+**Observed LAW 8 need (2026-04-20 inline-links saga; renderer split 2026-06-25):** the citation rule originally lived in the CITATION PRIORITY block around line 1224 - below the chunked-read window - and four consecutive runs (Matt Van Horn, Peter Steinberger, Best Headphones, OpenClaw vs Hermes) skipped it because the model read lines 1-1000 and stopped ("I never reached line 1224"). Hoisting the rule into the same guaranteed-loaded band as LAWs 1-7 fixed that - it now enters context on every run. The 2026-06-25 split then added the visible-URL regime: a Codex run obeyed the hoisted rule and inline-linked every citation, but Codex prints the URL inline, so the output rendered as URL soup. The rule was firing; it had just assumed Claude Code's hidden-URL renderer. Same hoist pattern that solved v3.0.6 (invented titles), disaster #2 (stripped bold), disaster #3 (trailing Sources), and the Hermes 2026-04-19 evidence-dump disaster. A third miss surfaced 2026-09-01 on Grok Bot: Cursor agent chat hides markdown URLs exactly like Claude Code, but this rule had lumped Cursor with Codex, so an obedient run printed unclickable plain `r/sub` / `u/name` labels while a rule-ignoring run the day before produced the clickable links users wanted. Grok Bot / Cursor agent chat (`CURSOR_AGENT` set) is a hidden-link host.-**Post-synthesis self-check (do this BEFORE emitting your response):** branch by host. On a hidden-link host (`CLAUDECODE` set), scan your drafted "What I learned:" and KEY PATTERNS for the `[name](url)` pattern - if zero inline links appear and the raw dump has URLs for the @handles, r/subs, and publications you cited as plain text, regenerate ONCE with inline links added. On a visible-URL host (`CLAUDECODE` unset), scan for `label (https://...)` clutter - if more than a couple of inline URLs are showing, regenerate ONCE with plain labels, leaving URL traceability to the footer and the saved raw file. Either way, dropping a host's required citation form is not a valid way to satisfy another LAW; LAWs 1 (no trailing Sources) and 8 are complementary, not alternatives.+**Post-synthesis self-check (do this BEFORE emitting your response):** branch by host - this self-check is the env-branching gate (`CLAUDECODE` or `CURSOR_AGENT`); the PRE-PRESENT SELF-CHECK later is an extra sweep, not a substitute for running this one. On a hidden-link host (`CLAUDECODE` or `CURSOR_AGENT` set), scan your drafted "What I learned:" and KEY PATTERNS for the `[name](url)` pattern - if zero inline links appear and the raw dump has URLs for the @handles, r/subs, u/names, and publications you cited as plain text, regenerate ONCE with inline links added. On a visible-URL host (both `CLAUDECODE` and `CURSOR_AGENT` unset - Codex, Gemini CLI, raw CLI), scan for `label (https://...)` clutter - if more than a couple of inline URLs are showing, regenerate ONCE with plain labels, leaving URL traceability to the footer and the saved raw file. Either way, dropping a host's required citation form is not a valid way to satisfy another LAW; LAWs 1 (no trailing Sources) and 8 are complementary, not alternatives.-**LAW 9 - WEAVE THE COMMUNITY VOICE; NEVER NARRATE THE TOOLING.** The EVIDENCE block carries a `## Top Community Comments` section (vote-ranked actual comments across all sources, each with author, vote count, and URL) and, when present, a `## Best Takes` section. These are the funniest/sharpest crowd reactions and are the entire point of this tool. **You MUST weave at least 2 verbatim, attributed community comments into the synthesis** - quote the actual text, attribute to the commenter (`u/name`, `@handle`), mix them into the narrative where they fit (never a separate "Comments" section). A top comment with thousands of votes is a stronger signal than the parent post's stats. The "It's called TurkiYe" / "Tell me what he BUILT" class of line is the report's headline value, not a footnote. When you inline-link a comment on a hidden-link host, copy its URL verbatim from the block - NEVER reconstruct or guess a status id (a wrong link looks authoritative; reconstructing one is a LAW 8 violation); on a visible-URL host, attribute the comment plainly (`u/name`, `@handle`) and leave the URL to the saved raw file. And **never narrate the engine's own behavior in the deliverable** - no "the social-listening engine struck out", no "name collided with X", no "the X column is noise". Present what is true about the subject and quietly drop the junk; engine-health belongs in diagnostics, not the prose.+**LAW 9 - WEAVE THE COMMUNITY VOICE; NEVER NARRATE THE TOOLING.** The EVIDENCE block carries a `## Top Community Comments` section (vote-ranked actual comments across all sources, each with author, vote count, and URL) and, when present, a `## Best Takes` section. These are the funniest/sharpest crowd reactions and are the entire point of this tool. **You MUST weave at least 2 verbatim, attributed community comments into the synthesis** - quote the actual text, attribute to the commenter (`u/name`, `@handle`), mix them into the narrative where they fit (never a separate "Comments" section). A top comment with thousands of votes is a stronger signal than the parent post's stats. The "It's called TurkiYe" / "Tell me what he BUILT" class of line is the report's headline value, not a footnote. When you inline-link a comment on a hidden-link host (Claude Code; Grok Bot / Cursor agent chat), copy its URL verbatim from the block - NEVER reconstruct or guess a status id (a wrong link looks authoritative; reconstructing one is a LAW 8 violation); on a visible-URL host (Codex, Gemini CLI, raw CLI), attribute the comment plainly (`u/name`, `@handle`) and leave the URL to the saved raw file. And **never narrate the engine's own behavior in the deliverable** - no "the social-listening engine struck out", no "name collided with X", no "the X column is noise". Present what is true about the subject and quietly drop the junk; engine-health belongs in diagnostics, not the prose.**Observed LAW 9 need (2026-06-17):** five consecutive runs (Kanye, Steinberger, Kevin Rose, Lan Xuezhao, Matt-vs-Trevin) shipped news-shaped reports that missed every funny comment, fabricated one citation URL, and leaked tooling meta-commentary - because the comment-weaving rule lived at line ~1189/1245, below the chunked-read window, and `## Best Takes` was empty (no in-subprocess fun scorer). The fix is two-part: the engine now always surfaces `## Top Community Comments` regardless of fun scoring, and this LAW hoists the weave-the-comments gate into the guaranteed-loaded band. Same hoist that fixed LAW 8.@@ -1732,7 +1732,7 @@ Read the research output carefully. Pay attention to:**ANTI-PATTERN TO AVOID**: If user asks about "clawdbot skills" and research returns ClawdBot content (self-hosted AI agent), do NOT synthesize this as "Claude Code skills" just because both involve "skills". Read what the research actually says.-**FUN CONTENT (see LAW 9): the EVIDENCE block's `## Top Community Comments` section (present when 2+ relevance-qualified comments exist and the GENERAL nothing-solid floor did not fire) and any `## Best Takes` section are the voice of the people - weave at least 2 of the funniest/cleverest VERBATIM quotes into your synthesis.** A 1,338-upvote comment that says "Where's the limewire link" tells you more about the cultural moment than a news article. Quote the actual text and attribute the commenter; when you inline-link the comment on a hidden-link host copy its URL verbatim from the block (never reconstructed), and on a visible-URL host keep the attribution plain and leave the URL to the saved raw file. Don't put fun content in a separate section - mix it into the narrative where it fits naturally. This is what makes the report feel alive rather than like a news summary. Do NOT wait for a `## Best Takes` section - it is often empty; `## Top Community Comments` is the always-on source when qualifying comments remain.+**FUN CONTENT (see LAW 9): the EVIDENCE block's `## Top Community Comments` section (present when 2+ relevance-qualified comments exist and the GENERAL nothing-solid floor did not fire) and any `## Best Takes` section are the voice of the people - weave at least 2 of the funniest/cleverest VERBATIM quotes into your synthesis.** A 1,338-upvote comment that says "Where's the limewire link" tells you more about the cultural moment than a news article. Quote the actual text and attribute the commenter; when you inline-link the comment on a hidden-link host (Claude Code; Grok Bot / Cursor agent chat) copy its URL verbatim from the block (never reconstructed), and on a visible-URL host (Codex, Gemini CLI, raw CLI) keep the attribution plain and leave the URL to the saved raw file. Don't put fun content in a separate section - mix it into the narrative where it fits naturally. This is what makes the report feel alive rather than like a news summary. Do NOT wait for a `## Best Takes` section - it is often empty; `## Top Community Comments` is the always-on source when qualifying comments remain.**ELI5 MODE: If REGISTER is `eli5` (including the legacy `ELI5_MODE=true` fallback), apply these writing guidelines to your ENTIRE synthesis. Otherwise skip this block completely and write normally.**@@ -1968,7 +1968,7 @@ CITATION RULE: Cite sources sparingly to prove research is real.- Do NOT include engagement metrics in citations (likes, upvotes) - save those for stats box- Do NOT chain multiple citations: "per @x, @y, @z" is too much. Pick the strongest one.-**URL formatting is governed by LAW 8** in the VOICE CONTRACT block above: inline `[name](url)` on hidden-link hosts (Claude Code), plain source labels on visible-URL hosts (Codex/Cursor/Gemini CLI/raw CLI). Raw URL strings are forbidden either way. Re-read LAW 8 now if you skipped it. The stats footer is engine-emitted per LAW 5 and passes through verbatim.+**URL formatting is governed by LAW 8** in the VOICE CONTRACT block above: inline `[name](url)` on hidden-link hosts (Claude Code; Grok Bot / Cursor agent chat), plain source labels on visible-URL hosts (Codex/Gemini CLI/raw CLI). Raw URL strings are forbidden either way. Re-read LAW 8 now if you skipped it. The stats footer is engine-emitted per LAW 5 and passes through verbatim.CITATION PRIORITY (most to least preferred). Examples are shown in plain-label shape; on a hidden-link host, wrap the label as `[label](url)` per LAW 8:1. @handles from X - `per @handle` (these prove the tool's unique value)@@ -1986,7 +1986,7 @@ When both a web article and an X post cover the same fact, cite the X post.(These narrative examples illustrate LAW 8 from the VOICE CONTRACT. On a hidden-link host the labels become `[label](url)`; on a visible-URL host they stay plain.)**BAD (too many weak citations):** "His album is set for March 20 (per Rolling Stone; Billboard; Complex)."-**GOOD on hidden-link hosts (Claude Code):** "His album BULLY drops March 20 - fans on X are split on the tracklist, per [@honest30bgfan_](https://x.com/honest30bgfan_)"+**GOOD on hidden-link hosts (Claude Code, Grok Bot / Cursor agent chat):** "His album BULLY drops March 20 - fans on X are split on the tracklist, per [@honest30bgfan_](https://x.com/honest30bgfan_)"**GOOD on visible-URL hosts (Codex):** "His album BULLY drops March 20 - fans on X are split on the tracklist, per @honest30bgfan_"**OK** (web, only when Reddit/X don't have it): "The Hellwatt Festival runs July 4-18 at RCF Arena, per Billboard" (inline-linked on a hidden-link host)@@ -2124,7 +2124,7 @@ Close with `I have all the links to the {N} {source list} I pulled from. Just as1. **Bold headlines present.** Every narrative paragraph in "What I learned" starts with `**Headline phrase** -` (single hyphen with spaces, NOT em-dash). If any paragraph opens with plain prose, regenerate with bold headlines.2. **Per-source emoji headers in the stats footer.** Every active source returned by the engine has a `├─` or `└─` line with its emoji, counts, and engagement numbers. No active source is silently dropped; no source with 0 results is displayed; no `⚠` or outcome text appears on any line.-3. **Community voice woven in (LAW 9).** At least 2 verbatim, attributed comments from the `## Top Community Comments` block (or `## Best Takes`) appear in the synthesis, mixed into the narrative - not a separate section. When a comment is inline-linked on a hidden-link host, its URL is copied verbatim from the block (never reconstructed); on a visible-URL host the attribution stays plain and the URL is left to the saved raw file. If the block has comments and your draft has zero, regenerate. Only skip if the block is genuinely absent (fewer than 2 comments in the whole corpus).+3. **Community voice woven in (LAW 9).** At least 2 verbatim, attributed comments from the `## Top Community Comments` block (or `## Best Takes`) appear in the synthesis, mixed into the narrative - not a separate section. When a comment is inline-linked on a hidden-link host (`CLAUDECODE` or `CURSOR_AGENT` set), its URL is copied verbatim from the block (never reconstructed); on a visible-URL host (both unset) the attribution stays plain and the URL is left to the saved raw file. If the block has comments and your draft has zero, regenerate. This sweep supplements the LAW 8 post-synthesis self-check; it does not replace it. Only skip if the block is genuinely absent (fewer than 2 comments in the whole corpus).3b. **No tooling meta-commentary (LAW 9).** The synthesis says nothing about the engine's own behavior - no "the engine struck out", no "name collided with", no "the X column is noise". If present, strip it and present only what is true about the subject.4. **Polymarket block present if markets were returned.** If the engine surfaced Polymarket markets, the synthesis includes specific percentages and directional movement. If no markets were surfaced, skip.5. **Coverage footer matches the actual output.** `✅ All agents reported back!` line followed by per-source `├─`/`└─` tree exactly as the engine provided.diff --git a/tests/test_codex_host_contract.py b/tests/test_codex_host_contract.pyindex bfccdf29..f9b964c4 100644--- a/tests/test_codex_host_contract.py+++ b/tests/test_codex_host_contract.py@@ -2,6 +2,7 @@from __future__ import annotations+import refrom pathlib import PathROOT = Path(__file__).resolve().parents[1]@@ -93,7 +94,10 @@ def test_law8_is_renderer_aware_with_both_regimes():# plain-label branch for visible-URL hosts. Codex rendered every inline link# as `label (https://...)`, so a single-renderer LAW 8 produced URL soup.law8 = _law8_block()- assert "Hidden-link hosts (Claude Code)" in law8+ # Hidden-link hosts are Claude Code AND Grok Bot / Cursor agent chat: the+ # 2026-09-01 Grok Bot brief showed Cursor agent chat hides markdown URLs+ # like Claude Code, so lumping it with Codex produced unclickable cites.+ assert "Hidden-link hosts (Claude Code; Grok Bot / Cursor agent chat)" in law8assert "Visible-URL hosts (Codex" in law8assert "URL soup" in law8# Hidden-link default must remain inline `[name](url)` (no Claude Code regression).@@ -103,10 +107,76 @@ def test_law8_is_renderer_aware_with_both_regimes():def test_law8_host_detection_is_deterministic_via_claudecode():law8 = _law8_block()assert "CLAUDECODE" in law8+ # CURSOR_AGENT is the second deterministic hidden-link signal (Grok Bot /+ # Cursor agent chat). Dropping it regresses those chats to plain labels.+ assert "CURSOR_AGENT" in law8+ assert "Grok Bot" in law8# The detection must be stated as deterministic, not left to the model guessing.assert "do not guess" in law8+def test_law8_visible_url_hosts_exclude_cursor_and_split_from_step0():+ # Grok Bot / Cursor agent chat hides markdown URLs, so Cursor must not be+ # named a visible-URL citation host anywhere. Cursor stays a NON-MODAL+ # SETUP host (see test_non_modal_hosts_are_named) - the citation renderer+ # is a different axis, and LAW 8 must not claim it is the Step 0 split.+ text = SKILL_MD.read_text(encoding="utf-8")+ visible_lists = re.findall(r"[Vv]isible-URL hosts? \(([^)]*)\)", text)+ assert visible_lists, "no visible-URL host list found"+ assert any("Codex" in hosts for hosts in visible_lists)+ for hosts in visible_lists:+ assert "Cursor" not in hosts, f"Cursor named as visible-URL host: {hosts!r}"+ law8 = _law8_block()+ assert "Gemini CLI, raw CLI" in law8+ assert "is the same split" not in law8+++def test_law8_wrap_list_includes_u_name_and_github_repo_first_mentions():+ # u/name comment authors and GitHub repos must be in the wrap-every-citation+ # list, with URLs copied from the comment row / engine evidence block.+ law8 = _law8_block()+ assert "u/name" in law8+ assert "GitHub repo" in law8+ assert "never guess" in law8.lower()+ # GitHub evidence can carry an issue/PR URL, not the repo root: the label+ # must match what the URL opens - never `[owner/repo]` over an item URL,+ # and never an item URL trimmed to a guessed repo root.+ assert "a label that matches what that URL opens" in law8+ assert "never trim an item URL down to a guessed repo root" in law8+++def test_law8_post_synthesis_self_check_branches_on_both_env_signals():+ # The post-synthesis self-check is the env-branching gate; it must branch+ # on CLAUDECODE or CURSOR_AGENT, and PRE-PRESENT is a supplemental sweep.+ law8 = _law8_block()+ start = law8.index("Post-synthesis self-check")+ self_check = law8[start:]+ assert "`CLAUDECODE` or `CURSOR_AGENT` set" in self_check+ assert "both `CLAUDECODE` and `CURSOR_AGENT` unset" in self_check+ assert "not a substitute" in self_check+++def test_citation_renderer_host_list_is_mirrored_outside_law8():+ # LAW 9, FUN CONTENT, CITATION PRIORITY, and the PRE-PRESENT sweep must+ # carry the same renderer split - Grok Bot / Cursor agent chat hidden-link,+ # Codex/Gemini CLI/raw CLI visible-URL - so a chunked read of any one+ # section cannot resurrect "Cursor is visible-URL".+ text = SKILL_MD.read_text(encoding="utf-8")+ law9_start = text.index("**LAW 9 -")+ law9 = text[law9_start : text.index("**LAW 10 -", law9_start)]+ assert "hidden-link host (Claude Code; Grok Bot / Cursor agent chat)" in law9+ fun_start = text.index("**FUN CONTENT")+ fun = text[fun_start : fun_start + 2000]+ assert "Grok Bot / Cursor agent chat" in fun+ citation_start = text.index("**URL formatting is governed by LAW 8**")+ citation = text[citation_start : citation_start + 1500]+ assert "hidden-link hosts (Claude Code; Grok Bot / Cursor agent chat)" in citation+ assert "Codex/Gemini CLI/raw CLI" in citation+ pre_present_start = text.index("## PRE-PRESENT SELF-CHECK")+ pre_present = text[pre_present_start:]+ assert "`CLAUDECODE` or `CURSOR_AGENT` set" in pre_present++def test_plan_invocation_warns_against_bash_lc_apostrophe_wrapper():# Codex aborted its first engine run by wrapping the query-plan heredoc in# `bash -lc '...'`; the outer single quote ended at the first apostrophe in a