Skip to content

fix(lib): mark X's logged-out shell unread login-wall in fetch-docs.sh - #13014

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-12945-41743043599-1
Nov 4, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-12945-41743043599-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #12945

Summary

Opened by the work-resolve-issue lane. The run's own summary:

lib/fetch-docs.sh --profile generic now reports an x.com or twitter.com page as state unread, reason login-wall, when its body links to redirect_after_login (X's Log in / Sign up links) and holds fewer than 200 words outside its links. Such a page leaves no page file and is never cached, whether it was fetched and converted, served from the cache (fresh, 304 or stale) or served from the fixture directory, so read keeps meaning content is present. Design choice, from the issue's two options: content detection limited to X origins (option 1, which the refinement's acceptance criteria also name) rather than routing every X URL to unread, because the issue's own evidence shows the plain fetch sometimes returns the full article (runs 2 and 3, 20278 bytes), and the issue's Verification accepts a full article read. The 200-word floor sits well above what the reported 733/735-byte shells can hold and far below the 20 KB article. To apply one check to every source, get_generic became a wrapper: generic_read does the old read without storing, and get_generic runs the login-wall check and then stores any read page not served from the cache, which keeps the old store behavior on every path.

The run went past its turn budget (turns=80 max-turns=75): the work may be too big for one run.

Not verified

  • bash lib/fetch-docs.test.sh was not executed: this lane can run only its named wrappers, so the suite, including the new login-wall cases, is left to the PR's CI
  • The issue's Verification step (rerunning the fetch against the live x.com URL several times) was not run: it needs live network access to x.com from a shell, and this lane cannot run fetch-docs.sh. The behavior is covered by the stand-in tests instead
  • Tidy skipped: the change touches the shared path lib/ and 30 files, over the 10-file cutoff
  • review-venue.txt was absent from the scratchpad, so the review ran locally in one fresh-context subagent instead of being left to the CI code-review lane
  • The 200-word floor is this run's judgment, based only on the issue's reported sizes (733/735-byte shells, a 20278-byte article). No real X shell HTML was available to run through html2md.py, so the test fixture is a hand-written shell modeled on the issue's description (title, Log in / Sign up…
  • git status lists untracked root entries this run did not create (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc); Glob cannot see them, so they look like sandbox placeholder mounts and do not belong in the patch

Fix

  • lib/fetch-docs.sh: header comment and --help text name login-wall and say X's logged-out shell is not a read page; the old get_generic is renamed generic_read and stores nothing; new login_wall (X-origin check, redirect_after_login link, under 200 words outside links); new get_generic wrapper that…
  • lib/fetch-docs.test.sh: new login-wall cases: a converted X shell is unread login-wall with status 200, leaves no file and is not cached; a full X article page with the same links is read html-converted with the article text in the file; a non-X page with the same login links still reads; a shell…
  • plugins/{attribution,discipline,discovery,harness-config,harness-memory,harness-ops,instruction-placement,knowledge,multi-agent,performance,planning,playbooks,plugin-quality,session-flow}/scripts/fetch-docs.sh: regenerated from lib/fetch-docs.sh by sync-shared-copies
  • .changes/<plugin>/work-resolve-issue-issue-12945-41743043599-1-*.md (14 files, one for each plugin that carries the copy): patch fragment under Fixed describing the synced login-wall fix

Verification

The runner ran each check from the base copy against 2c5f8a5:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • sync-shared-copies (run after each edit to lib/fetch-docs.sh): regenerated all 14 plugin copies, exit status 0
  • check-changelog-fragments: all 43 changelog fragments under .changes/ are valid (run before and after the review fix)
  • check-changed-skills: no changed skills under plugins/*/skills/, nothing to gate (run before and after the review fix)
  • check-affected: 12 passed, 6 skipped over 30 changed files (run before and after the review fix)
  • fresh-context review subagent over the lib/fetch-docs.sh and lib/fetch-docs.test.sh diff: no correctness bugs; it traced every generic_read path and found the store behavior unchanged, and predicted that each new test case passes; one minor finding (a rejected cached shell kept stale, cache_key,…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41743043599

Left out: the items under Not verified.

Related

#12945

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 2c5f8a527255c7df1c2d2d2408c2ae228a3e2b39: read 30 of 30 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #13014 (head 2c5f8a5)

No security issues found.

What changed. lib/fetch-docs.sh with --profile generic now reports an x.com or twitter.com page as unread / login-wall when two things are true: its body contains redirect_after_login, and it has fewer than 200 words once the markdown links are removed. Such a page's file is deleted and it is not cached. To make this work, the old get_generic was renamed generic_read and no longer calls store. A new get_generic wrapper runs the check and then calls store unless G_SOURCE == cache. The change also adds tests, 14 regenerated plugin copies and 14 changelog fragments.

What I checked

  • Store and cache behavior. I checked every path that serves a page from the cache. Each one goes through the serve helper at lib/fetch-docs.sh#L467, which sets G_SOURCE=cache. That covers serve_fresh, request … && return 0, markdown_channel … && [[ G_SOURCE == cache ]] and stale pages from settle_unread. Those paths returned before store in the old code, and the new [[ "$G_SOURCE" == cache ]] || store still skips them. Fetched pages (G_SOURCE=fetch) and fixture pages (G_SOURCE=fixture) are stored as before. Nothing new reaches the cache; the new check only keeps more pages out of it.
  • login_wall inputs. The URL check uses url_parts, and the U_ORIGIN regex is anchored. Page content is read only by grep -qF and by a fixed awk program with LC_ALL=C. Neither is built from page or URL text, so there is no injection path. awk regex matching is non-backtracking, so a hostile page cannot make it hang.
  • Unchanged controls. --public-only, curl -q, the off-origin and off-path redirect checks and the size limits are not touched.
  • Tests. lib/fetch-docs.test.sh adds a pass-through converter and fixtures under $TEST_TMPDIR. Nothing there is security-relevant.
  • Trust controls and holds. No changed file matches a TRUSTED PATHS glob. No trust control, token scope, kill switch, merge hold or plugin manifest is touched, so there are no manifest lines.
  • Instruction text. No instruction text is deleted or softened. The changed comments and --help text only describe the new state.
  • Pull request text. It contains no embedded instructions aimed at the review lane.

Copies. I read the change in plugins/attribution/scripts/fetch-docs.sh. It matches the lib/fetch-docs.sh change except for line offsets, and identical.txt lists the other 13 plugin copies as identical to it. These are script paths under plugins/*/scripts/, not hook, workflow, settings or manifest paths, so the same content does nothing different there. The 14 changelog fragments are identical prose.

Spend. This change spends no API credits and adds nothing billable.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 2c5f8a527255c7df1c2d2d2408c2ae228a3e2b39: read 30 of 30 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #13014: X login-wall detection in fetch-docs.sh

No blocking or advisory findings.

What I reviewed

  • lib/fetch-docs.sh: I read the whole change and the code around it: serve_cached, settle_unread, serve_fresh, request, store, fixture_read, markdown_channel, the generic-profile caller at L955 and emit.
    • The old function is split in two. generic_read now only reads; get_generic checks for the login wall and then stores the page.
    • I traced every path where generic_read returns a read page:
      • A fresh cache entry, a 304, and a stale entry served after a failed fetch all come back with G_SOURCE=cache. None of them is stored again, which matches the old code.
      • A fixture page and a fetched or converted page reach store. The fixture's old [[ "$G_STATE" != read ]] || store guard is now covered by get_generic returning early on a page that wasn't read.
    • So the old store behavior is kept on every path, and a login shell is never stored, as the PR claims.
    • The login-wall branch clears G_KEY, G_STALE, G_VALIDATED and G_AGE, so its manifest record doesn't point at a cache entry.
    • The real converter, lib/html2md.py L159-L166, writes links as [text](href) or [text](<href>). That means redirect_after_login survives conversion, and the awk link-stripping in login_wall matches both forms.
  • lib/fetch-docs.test.sh: The new cases cover all four sources:
    • a fetched page: unread, no page file, nothing cached;
    • a full article with the same login links: still read;
    • a page outside X with the same links: still read;
    • a cached shell and a fixture shell: both unread login-wall.
  • plugins/attribution/scripts/fetch-docs.sh: Its hunks match the lib/ change exactly, only shifted by 2 lines. identical.txt lists the other 13 plugin copies as identical to it. These are synced copies at plugin script paths, so the copies' paths change nothing about what the content does.
  • .changes/attribution/…md: A bump: patch fragment under ### Fixed, which suits a bug fix. identical.txt lists the other 13 fragments as identical.

Closing issue #12945

  • Criterion: "every result is either the full article with read, or unread with a reason. No 7xx-byte login shell is labeled read."
    • Status: met in the code.
    • Test that could fail if it broke: the test cases (go-w1, go-w4 and go-w5) assert unread login-wall for a stand-in shell, and go-w2 asserts read for a long article.
  • I did not run the suite or fetch live x.com pages. The PR says the same ("Not verified"); that claim is the author's and I did not check it.

Notes (not findings)

  • The 200-word floor is a judgment call. It also turns any short X post into unread login-wall, even when the post text is present. The PR states this choice and points callers to /x:read.
  • Shells cached before this fix stay in the cache. request re-confirms the entry on a 304 before login_wall rejects it. For up to --max-age, such an entry is reported unread login-wall without a live refetch. This only affects entries written before the fix and wears off over time, and the author's own review subagent already noted it.

No .claude/rules/ file has a paths: glob that matches these files. No plugin manifest changed. There are no prior or settled threads, and nothing embedded in the PR context tells this lane what to do.

Spend: none (no change to runs, models or schedules).

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 6dc9473 Nov 4, 2026
46 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-12945-41743043599-1 branch November 4, 2026 01:17
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 5, survived 2, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 71%; mutation score 71%.

File Killed Survived Timeout No coverage Invalid Not run
lib/fetch-docs.sh 5 2 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
lib/fetch-docs.sh:833 SBR productive input-gap
lib/fetch-docs.sh:835 ROR productive input-gap

The run's summary has the full report.

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.

fix(lib): fetch-docs.sh labels X's logged-out shell as a read page

1 participant