Skip to content

chore: move the remaining plugin page reads onto the shared docs cache - #18598

Merged
melodic-automation-lanes[bot] merged 5 commits into
mainfrom
work-resolve-issue/issue-18306-45278122799-1
Nov 24, 2026
Merged

melodic-automation-lanes[bot] merged 5 commits into
mainfrom
work-resolve-issue/issue-18306-45278122799-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #18306

Summary

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

Part 1 of #18298 wrote an inventory (docs/audits/docs-cache-web-reads.md). It marks six reads in four plugins as moved: discovery, external-agents, harness-ops and session-flow. This change makes those six moves. The five markdown reads now call each plugin's scripts/fetch-docs.sh --cache instead of WebFetch or curl. external-agents update reads the provider config reference through a new readCachedPage(), which runs the plugin's new fetch-docs.sh copy with --cache --profile generic. The tests inject a readPage stub, and two new tests drive the real script in fixture mode. I spawn plain bash for this, the same way the plugin's config.mjs already runs its convention-home helper, rather than vendoring the exec-bash resolver. The rows for kept reads are untouched, and so are the plugins with no moved read.

Not verified

  • The external-agents node test suite (tests/update.test.mjs, including the two new fixture-mode tests) and the discovery, harness-ops and session-flow suites were not executed: this lane's Bash runs only the named wrappers, and check-affected ran without --tests. Left to the PR's CI.
  • plugins/discovery/scripts/check-hook-registration.sh and plugins/multi-agent/scripts/check-hook-registration.sh were not run: no hook registration or agent tool list changed in this diff, and the lane cannot run them directly. Left to the PR's CI.
  • Tidy skipped: the change touches scripts/shared-copies.txt, a listed shared path, and spans more than one area (plugins/discovery, plugins/external-agents, plugins/harness-ops, plugins/session-flow, docs/audits, scripts).
  • Review fixes were confirmed by re-running the checks, not by a second review pass.
  • Untracked root files appeared in the working tree that this run did not create (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc); they look like sandbox mount points and should not be part of the patch.

Fix

  • plugins/external-agents/scripts/lib/update.mjs: new readCachedPage(url, env) runs scripts/fetch-docs.sh --cache --profile generic, reads manifest.json and returns the page text, or throws with the unread reason; checkKeys reads the config reference through opts.readPage ?? readCachedPage instead of…
  • plugins/external-agents/tests/update.test.mjs: the web() stub supplies readPage for the config reference; update calls spread its opts; new tests show readCachedPage reads through fetch-docs.sh and the docs cache in fixture mode, and throws fixture-missing for an absent page
  • plugins/external-agents/scripts/fetch-docs.sh, docs-cache.sh, fetch-docs-generic.sh, html2md.py: new copies generated by scripts/sync-shared-copies.sh
  • scripts/shared-copies.txt: registers the four external-agents copies next to the multi-agent entries (fetch-docs-generic.sh is included because fetch-docs.sh sources it)
  • plugins/external-agents/prerequisites.json: declares curl and jq as optional, each with its degrade
  • plugins/discovery/skills/research/context/source-categories.md: with no docs MCP server, the docs site is read through <plugin-root>/scripts/fetch-docs.sh --cache per docs-lookup-procedure.md, not WebFetch
  • plugins/discovery/skills/research/context/discipline.md: the recency gate's raw CHANGELOG.md form is now fetch-docs.sh --cache --profile generic, not WebFetch
  • plugins/harness-ops/skills/changelog/SKILL.md: research subagents read a changelog entry through fetch-docs.sh --cache --profile generic; a GitHub issue is still read with curl, as the inventory requires
  • plugins/harness-ops/skills/audit-plugin-landscape/SKILL.md: without the discovery plugin, pages are read through fetch-docs.sh --cache --profile generic, not WebFetch; the Limits bullet now names what that writes
  • plugins/session-flow/skills/workflow/context/continuation.md: without the discovery plugin, each docs pointer is fetched with the plugin's scripts/fetch-docs.sh --cache per reference/docs-lookup-procedure.md, not WebFetch
  • docs/audits/docs-cache-web-reads.md: the moved-reads section no longer says external-agents lacks a fetch-docs.sh copy
  • .changes/discovery, .changes/harness-ops, .changes/session-flow, .changes/external-agents: one patch fragment per changed plugin describing its move

Verification

The runner ran each check from the base copy against db0ae48:

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

The run reports:

  • sync-shared-copies --check: All 1069 registered copies match their canonical sources (exit 0)
  • check-changelog-fragments: all 21 fragments under .changes/ are valid
  • check-changed-skills: 4 skills checked (research, audit-plugin-landscape, changelog, workflow), 0 failed, warnings only
  • check-affected: 18 passed, 9 skipped (typos not installed, comment-hygiene fetch blocked, size-check script missing, two scripts absent from this repo, three validate-plugins rows and changed-skills that run checked-tree code)
  • fresh-context review subagent over the whole diff: 2 high findings (an un-spread fetch: web(...).opts in one update test; the fixture used dotted host learn.chatgpt.com, but generic_slug turns dots into hyphens) and 4 low findings (an undefined <plugin-root> in session-flow's workflow…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/45278122799

Left out: the items under Not verified.

Related

#18306

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

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #18598 (blocking only)

No CRITICAL or IMPORTANT security issues found. This lane already reviewed an earlier head, so this pass reports blocking findings only and drops SUGGESTION-level ones. I read every hunk of all 18 changed files in the full diff. None of them matches a trusted-path glob.

What I checked

  • plugins/external-agents/scripts/lib/update.mjs (readCachedPage).
    • It runs spawnSync("bash", [script, "--cache", "--profile", "generic", "--out", out, url]) with an argument array and no shell, so the URL cannot inject a command. A URL starting with - would hit fetch-docs.sh's -*) die branch, not be read as a flag.
    • The URL is record.config_reference from the provider record. Before this change ctx.fetch fetched the same URL directly, so no new destination is reachable.
    • It reads the page file only from the manifest the script writes into a fresh mkdtemp directory, and deletes that directory in finally.
    • Page text is still used only to check that config keys exist. A read that fails leaves the keys unverified, as before.
  • New fetch-docs.sh, docs-cache.sh, fetch-docs-generic.sh and html2md.py copies. Each carries the generated header, and each is registered in scripts/shared-copies.txt beside the existing multi-agent entries. The PR's check output reports all registered copies match their sources (sync-shared-copies --check exit 0). Fetches stay limited to HTTPS (--proto =https --proto-redir =https), curl -q ignores ~/.curlrc, and fixture bytes never reach the default cache.
  • Skill and context text in discovery (discipline.md, source-categories.md), harness-ops (changelog, audit-plugin-landscape) and session-flow (continuation.md). The edits switch a page-read tool from WebFetch or curl to the plugin's fetch-docs.sh --cache. Under the instruction-surface lens, no standing guardrail is removed: the "Untrusted content" framing in audit-plugin-landscape is unchanged, and no hook, allowlist or deny rule is touched. I did not open the instruction exception register (docs/contracts/instruction-exception-register/README.md); I judged by consequence.
  • plugins/external-agents/prerequisites.json adds curl and jq as optional CLI prerequisites. This is not a plugin manifest (.claude-plugin/plugin.json or marketplace.json) and installs or runs nothing.
  • No trust control is touched. The trusted-trigger check, the lane token, the kill switch, the broker, merge holds and .github/actions/ are all unchanged.

Dropped under blocking only (SUGGESTION, not counted): the new generic-profile fallback reads leave out --public-only. That flag is what fetch-docs.sh documents for URLs taken from untrusted text, and discovery's docs-raw.sh passes it. The affected reads are audit-plugin-landscape Step 3 at SKILL.md#L90 and the recency-gate form at discipline.md#L68. These reads now run curl on the operator's machine, where they used to run WebFetch. The fetch is HTTPS-only, and the page bytes go only into the operator's own session. I found no path from there to a leak, a compromise or a charge, so the risk is below IMPORTANT.

Embedded text: none found in the PR context, the prior findings or the changed files telling the lane to pass the PR, skip a check or drop a finding.

Prior findings: the one prior entry is a summary comment that reported no issues, so nothing needs reposting.

Spend: none. The change spends no API credits; the new page reads are local curl fetches.

critical-findings: 0

@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head caedeab5e959a1925b11c1c1856ed994aed67eac. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: whole pull request at caedeab5, blocking findings only

This review found no blocking problems. The prior-findings file says blocking only: yes, so only blocking findings were in scope this time. I read every hunk of all 18 changed files in .claude-lane/pr.diff. That includes the four generated copies in external-agents: fetch-docs.sh, docs-cache.sh, fetch-docs-generic.sh and html2md.py.

What I checked

  • readCachedPage in update.mjs:
    • pluginRoot comes from config.mjs:8, and it resolves to the plugin directory. So scripts/fetch-docs.sh and the cwd both point at the new copy.
    • The function throws when bash fails to start, when the script exits with a nonzero code, or when the manifest records the page as unread. checkKeys turns each of these into the existing unverified line, so how an unread page is reported has not changed.
  • The two new fixture tests:
    • generic_slug turns https://learn.chatgpt.com/docs/config-file/config-reference.md into learn-chatgpt-com/docs/config-file/config-reference. That matches the fixture path the test writes.
    • DOCS_CACHE_DIR is set, so --cache together with FETCH_DOCS_FIXTURE_DIR passes the script's guard against writing fixture data into the machine's real cache.
    • When the page is missing, fixture_read records the reason fixture-missing, which is the text the second test asserts.
    • I worked these through by reading the code. I could not run the tests.
  • Changes to the existing update tests: each call now passes ...web().opts, which carries both fetch and readPage. No assertion changed.
  • Closing issue chore: move every plugin's page fetches onto the shared docs cache - part 2 of 2 #18306:
    • discovery, harness-ops and session-flow already have fetch-docs.sh, docs-cache.sh, html2md.py and fetch-docs-generic.sh registered in scripts/shared-copies.txt (lines 28–86). The PR adds all four for external-agents. The generic copy is needed because the new docs tell callers to use --profile generic.
    • Both reference/docs-lookup-procedure.md files the new docs text cites exist in discovery and session-flow.
    • Each changed plugin has exactly one bump: patch changelog fragment.
    • The remaining WebFetch mentions are reads the inventory keeps, or pointers to the WebFetch docs.
    • Two items are left to CI and are not verified here: "sync-shared-copies.sh --check exits 0" and "the test suite of every changed plugin passes". The author reports both as passing or left to CI; I have no shell to run them.

Not verified: the author's verification claims (the sync check passing, the changelog fragments being valid, check-changed-skills) are unverified by me. I ran nothing.

Loosened checks: the prompt has no loosened_check_verdict: or loosened_check_patterns: line, so the default applies (fail, no consumer entries). There is no loosened_check_decision_record: line, so I did not check the citation requirement. No changed file loosens a check: in the test changes, the fetch stub's handling of the config page moves into the readPage stub, and every expected value stays the same. Loosened checks would be marked: fail (default); patterns: 0.

Spend: update now runs fetch-docs.sh once per run, with up to a 30 s timeout. That spends local time and network only, so it is not a hold.

No plugin manifest changed, so there are no manifest lines.

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Run 45285331139

pr-unblock/apply-patch, attempt 1

Field Value
Model rung 0
Leg base
Run job failure
Activity step skipped
Commits pushed none recorded

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

A lane run on this pull request's head failed because the token broker refused it as workflow-modified: .github/workflows/pr-unblock.yml changed on main after the run's event, and a rerun keeps the old file. pr-merge pushes an empty commit so the next pr-unblock run uses main's files. It does this once per version of that file, so if a run fails the same way again, a person looks at it. The push starts no run itself: the conflict-resolution run starts at the next push to main or half-hourly pr-unblock-dispatch tick, or when a listed person runs it by hand, and an address-feedback run can start after both review lanes review the new head, if an unresolved thread is left for it.

The token broker refused a lane run on the previous head as workflow-modified (.github/workflows/pr-unblock.yml). This commit changes no file.
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 24, 2026
@kyle-sexton

Copy link
Copy Markdown
Member

Held with the do-not-merge label for an owner decision: the new required copy plugins/external-agents/scripts/docs-cache.sh has 1,375 non-blank lines against the 1,000-line size reference, and a size-check exclusion is the owner's call (owner-decisions L274/L276). The owner's word on the route releases it.

@kyle-sexton

Copy link
Copy Markdown
Member

Hold lifted: the size-check route this PR waited on is decided. Owner-decisions row 390 (recorded on #18683) exempts a copy only when scripts/shared-copies.txt lists it, and #18671 implements that rule. Removing the do-not-merge label so the lane can resolve this branch's conflict; Lint Repo stays red here until #18671 merges, which gates the merge on its own.

@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 24, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path is about to arm native auto-merge at head caedeab5e959a1925b11c1c1856ed994aed67eac, the head its arming checks judged. The arm fails if the head moves first.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=caedeab5e959a1925b11c1c1856ed994aed67eac rubric=10.10.3 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 4b1e950 Nov 24, 2026
82 of 83 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-18306-45278122799-1 branch November 24, 2026 05:36
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 3, survived 4, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 43%; mutation score 43%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/external-agents/scripts/docs-cache.sh 0 1 0 0 0 0
plugins/external-agents/scripts/fetch-docs-generic.sh 0 1 0 0 0 0
plugins/external-agents/scripts/fetch-docs.sh 0 1 0 0 0 0
plugins/external-agents/scripts/html2md.py 0 1 0 0 0 0
plugins/external-agents/scripts/lib/update.mjs 3 0 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/external-agents/scripts/fetch-docs.sh:543 ROR productive input-gap
plugins/external-agents/scripts/docs-cache.sh:692 ROR productive input-gap
plugins/external-agents/scripts/fetch-docs-generic.sh:335 ROR productive input-gap
plugins/external-agents/scripts/html2md.py:150 AOR productive input-gap

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 4b1e950674c9bb877fa486ffd3d3dee5280c3c97; later checks count it verified from this comment.

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.

chore: move every plugin's page fetches onto the shared docs cache - part 2 of 2

1 participant