Repository navigation
feat(link-health): stdlib Python link checker as default (was lychee) - #24
Conversation
Vendor the engine from rossoctl/automation (feat/stdlib-link-checker, PR rossoctl/automation#123): link-check.py joins the vendored set (scripts/vendor-engine.sh extras + regression-test coverage), and the scanner, extractor, and automation-health dashboard updates land with it. LINK_CHECKER=python is the default, so link-health needs only python3/gh/jq/bash and runs on a basic agent image; egress-proxy refusals are classified as unchecked and never open or auto-close issues. Rewrite the link-health-scanner SKILL.md for the python-default contract (link checker selection, unchecked bucket, shadow mode, .lychee.toml subset) and note the dashboard's unchecked rows. The vendored repoman-setup.sh header reverts the doc-drift fixer's rossoctl#22 edit: vendored bytes must track the engine source, and the set-requirements header fix lands at the source in rossoctl/automation#141 instead. Closes rossoctl#3 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jim Cadden <[email protected]>
Re-run scripts/vendor-engine.sh against automation@main now that rossoctl/automation#123 and #141 are merged, replacing the pre-merge branch-tip stamp (e1ebdcb) with main's tip. Convergence changes beyond the stamp: repoman-setup.sh header now lists set-requirements (automation#141), plus engine updates to dep-bump, github-api (throttling), link-health, and pr-review scripts that landed on main after the original vendoring branch point. Validation: bash tests/test-vendor-engine.sh (19/19 PASS); vendored bytes verified identical to automation@main. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jim Cadden <[email protected]>
clawgenti
left a comment
There was a problem hiding this comment.
Summary
This PR vendors the stdlib Python link checker (link-check.py) and makes it the link-health default, and brings in the related engine updates from automation main: the unchecked/egress-refusal split, re-injection of prior findings for failed repos, the dep-bump dedup regex, the linkless attribution footer, and file-based diff_map handling in the PR-review fixer. The changes hang together. I found no blocking issues, so there are no must-fix items. There are two suggestions about how egress refusals and private-host redirects get classified in link-check.py, plus one nit.
Author: jimcadden (CONTRIBUTOR — returning external)
Areas reviewed: Python, Shell, Docs, Tests
Agent/IDE config (.claude/.vscode): none
Commits: 2 commits, all signed-off: yes
CI status: passing (DCO, shellcheck, pr-title-check)
Generated by RepoMan github-pr-review@235a7f7 (https://github.com/rossoctl/agent-skills/blob/235a7f7620139ee3e4ab0872b8439591fe52e8c1/skills/github-pr-review/SKILL.md).
rubambiza
left a comment
There was a problem hiding this comment.
A few suggested changes. Some should probably be encoded in the CLAUDE.md of the project.
AI-assisted review will come next.
| - Opt-in fallback: `LINK_CHECKER=lychee` (requires `lychee` >= 0.23.0 on PATH; | ||
| do not pass `--include-verbatim` — the scanner relies on excluding URLs | ||
| inside code blocks, which the python checker does by default too). | ||
| - **Unchecked (egress refusals):** links the egress proxy refused to fetch are |
There was a problem hiding this comment.
Makes it specific so that it's clear the program can run under a host with no proxy involved.
| - **Unchecked (egress refusals):** links the egress proxy refused to fetch are | |
| - **Unchecked (egress refusals):** When running under an egress proxy, links that the proxy refused to fetch are |
| # [ "$n" = "0" ] || echo "skip (already commented, or status unknown)" | ||
| # | ||
| # Args: | ||
| # $1 - full repo name (e.g., "kagenti/adk") |
There was a problem hiding this comment.
| # $1 - full repo name (e.g., "kagenti/adk") | |
| # $1 - full repo name (e.g., "rossoctl/repoman") |
There was a problem hiding this comment.
This is a change for automations, i think
| sha=$(jq -r '.version // empty' "$meta_file" 2>/dev/null) | ||
| if [ -n "$sha" ]; then | ||
| local stored_source | ||
| stored_source=$(jq -r '.source // empty' "$meta_file" 2>/dev/null) |
There was a problem hiding this comment.
Nit: I've noticed a lot of assignments like this that redirect to 2>/dev/null. As a matter of preference in building repoman (based on some pain experienced earlier), I make it a policy to Claude Code to capture the return codes of such statements so that they don't get swallowed, especially in cases where another script called this one and needs to know any errors that could have happened downstream.
A vague example I recall from memory: a PAT token check should distinguish for the caller whether there's a transient GitHub error vs the user simply does not have the right permissions.
| # SKILL_SOURCE_REPO is STALE (the default flipped underneath it): the pinned | ||
| # SHA belongs to the old source and would 404 under the new one. Treat it like | ||
| # a corrupt file -- fall through to re-resolution, which rewrites both version | ||
| # and source on success (automation#131 — the default flip must not strand |
There was a problem hiding this comment.
Since this is fresh in my mind, I encountered the same pattern in llm-d-benchmark PRs. See llm-d/llm-d-benchmark#2157 (comment) for a concrete example + suggestion.
| DIFF_MAP=$("$SCRIPT_DIR/parse-diff-map.sh" "$TMPDIR/pr-${number}.diff") | ||
| line_count=$(echo "$DIFF_MAP" | jq '[.[].hunks[].lines[]] | length') | ||
| [ "$VERBOSE" = true ] && echo " Parsed diff_map: $line_count lines across $(echo "$DIFF_MAP" | jq 'length') files" >&2 | ||
| "$SCRIPT_DIR/parse-diff-map.sh" "$TMPDIR/pr-${number}.diff" > "$diff_map_file" |
There was a problem hiding this comment.
I think this already landed in one of the recent PRs, no? Just flagging in case it may bite as a conflict to be resolved.
There was a problem hiding this comment.
Checked — false alarm for repoman main: a grep for MAX_ARG_STRLEN at fbd0c4b (current main tip) has no hits, so the diff-map-to-file hunk is new here. What you're remembering is likely the automation-repo PR it came from — this PR vendors it in (the hunk is byte-identical to automation@4f284d0). #26 didn't touch skills/repoman/scripts/, so there's nothing to conflict with.
| @@ -0,0 +1,1017 @@ | |||
| #!/usr/bin/env python3 | |||
There was a problem hiding this comment.
Leaving this one for the AI-assisted pass.
clawgenti
left a comment
There was a problem hiding this comment.
AI Review — vendored Python link checker (rebase needed)
Verdict: No blocking issues on the vendored content — ready to rebase + land. Base is stale (main@fbd0c4b after #26), so this needs a rebase before merge.
Checked:
_vendor.jsonstampsrossoctl/automation@4f284d0(post-#123 + #136 + #141) withlink-check.pyin files — matchesmainHEAD, and PR body claims byte-identical (verified via automation side; not re-diffed here but stamp is correct).scripts/vendor-engine.shchange (+link-check.py to EXTRA_FILES) is the only plugin-side logic change — minimal, reviewed, matches automation's vendor manifest.- Engine updates (scanner/shadow mode, extractor unchecked token, dashboard rows, fixer dedup) are engine-vendored — per repo topology, not to be edited here (
jimcaddenIGNORE comments correct). CHANGELOG.mdUnreleased entry andSKILL.mddocs correctly describe python-default, unchecked bucket, and shadow mode.- Commits signed + DCO pass, shellcheck + pr-title pass,
bash -nclaimed clean.
Notes / nits (non-blocking):
- Clawgenti flagged upstream
link-check.pyedge cases (http egress-refusal path, redirect-to-private classification, WARN header stream). Since file lives inrossoctl/automation, fixes belong there and will re-vendor — no action here. - After rebase, re-run
tests/test-vendor-engine.shonce to confirm 28-file stamp still passes (pre-merge CI did, post-rebase may need re-run).
Apply rubambiza's review suggestion on PR rossoctl#24: make the Unchecked (egress refusals) bullet specific about running under an egress proxy, so it's clear the program can also run on a host with no proxy. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jim Cadden <[email protected]>
…rects Reviewer suggestions from rossoctl/repoman#24 (clawgenti), fixed at the source per the vendoring topology: 1. Plain-http egress refusals were reported broken. Egress-refusal detection only matched the CONNECT-tunnel failure text, which fires for https:// URLs only. For http:// links urllib sends an absolute-URI request to the proxy, and the gateway's refusal arrives as an ordinary 403 in the HTTPError branch: reported broken 403 (or silently accepted when 403 is in the accept list), breaking the contract that egress refusals never open issues. A 403 now classifies as unchecked when a proxy is configured for the URL's scheme and the response carries a gateway signature (GATEWAY_403_MARKERS, extendable via LINK_CHECK_GATEWAY_MARKERS), before the GET fallback and the accept list. no_proxy hosts are honored via urllib's own env bypass check. 2. A public URL redirecting to a private host under --exclude-all-private raised URLError('redirect to private host'), which _classify_exception mapped to Network error: retried, then reported broken. lychee excludes such links. The redirect handler now raises a dedicated _RedirectToPrivateError that the check paths turn into a success status (excluded, no finding, not retried). Tests: http 403 with gateway signature is unchecked (with and without 403 in the accept list); a markerless 403 through a proxy stays broken; LINK_CHECK_GATEWAY_MARKERS extension; _proxy_for_url scheme and no_proxy resolution; an http refusal lands in the unchecked bucket, not errors; a private redirect is excluded and served exactly once even with retries available. Signed-off-by: Jim Cadden <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]>
Apply rubambiza's review suggestion on PR rossoctl#24: make the Unchecked (egress refusals) bullet specific about running under an egress proxy, so it's clear the program can also run on a host with no proxy. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jim Cadden <[email protected]>
53aba31 to
a98ee00
Compare
|
Thanks @rubambiza — all addressed in a98ee00 (plus the inline reply on Applied in this PR:
Routed to the engine source (these files are vendored output here, so per repo topology the fixes land in automation and re-vendor):
Once those two merge, one re-vendor pass ( |
rubambiza
left a comment
There was a problem hiding this comment.
LGTM. The rest is being addressed in rossoctl/automation#142 and rossoctl/automation#143
Signed-off-by: Jim Cadden <[email protected]>
Co-authored-by: Gloire Rubambiza <[email protected]> Signed-off-by: Jim Cadden <[email protected]>
Co-authored-by: Gloire Rubambiza <[email protected]> Signed-off-by: Jim Cadden <[email protected]>
Apply rubambiza's review suggestion on PR rossoctl#24: make the Unchecked (egress refusals) bullet specific about running under an egress proxy, so it's clear the program can also run on a host with no proxy. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jim Cadden <[email protected]>
…84d0) The standalone dirs were resynced by rossoctl#26 at c138e5f while the plugin dir moved to 4f284d0 in this PR, leaving the repo shipping two engine versions — the exact problem rossoctl#27 describes. Re-run vendor-engine.sh --skills to converge the stamps; the vendored bytes were already identical (the c138e5f..4f284d0 delta touches repoman-setup.sh, which is not in the standalone sets), so only the _vendor.json sha/timestamp fields change. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jim Cadden <[email protected]>
a98ee00 to
fcbcfe4
Compare
Encode in CLAUDE.md that citations of issues/PRs from other repos (e.g. repoman while working in automation) must use the full URL rather than bare shorthand like repoman#24, so references stay traceable outside GitHub's auto-linking (raised in rossoctl/repoman#24 (comment)). Linkify the bare cross-repo refs this PR itself introduced: the repoman#10 citations in the attribution-footer spec and the repoman#24 comment in tests/test-skill-meta.sh. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jim Cadden <[email protected]>
…rects (#143) * fix(link-check): classify plain-http egress refusals and private redirects Reviewer suggestions from rossoctl/repoman#24 (clawgenti), fixed at the source per the vendoring topology: 1. Plain-http egress refusals were reported broken. Egress-refusal detection only matched the CONNECT-tunnel failure text, which fires for https:// URLs only. For http:// links urllib sends an absolute-URI request to the proxy, and the gateway's refusal arrives as an ordinary 403 in the HTTPError branch: reported broken 403 (or silently accepted when 403 is in the accept list), breaking the contract that egress refusals never open issues. A 403 now classifies as unchecked when a proxy is configured for the URL's scheme and the response carries a gateway signature (GATEWAY_403_MARKERS, extendable via LINK_CHECK_GATEWAY_MARKERS), before the GET fallback and the accept list. no_proxy hosts are honored via urllib's own env bypass check. 2. A public URL redirecting to a private host under --exclude-all-private raised URLError('redirect to private host'), which _classify_exception mapped to Network error: retried, then reported broken. lychee excludes such links. The redirect handler now raises a dedicated _RedirectToPrivateError that the check paths turn into a success status (excluded, no finding, not retried). Tests: http 403 with gateway signature is unchecked (with and without 403 in the accept list); a markerless 403 through a proxy stays broken; LINK_CHECK_GATEWAY_MARKERS extension; _proxy_for_url scheme and no_proxy resolution; an http refusal lands in the unchecked bucket, not errors; a private redirect is excluded and served exactly once even with retries available. Signed-off-by: Jim Cadden <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> * fix(link-check): narrow gateway-403 marker defaults to gateway-specific signatures Review feedback on #143 (clawgenti): the 'access denied' and 'egress' default markers are broad enough that a CDN origin 403 relayed through the gateway (Akamai's standard 403 body says 'Access Denied') would classify as unchecked, silently hiding a real result on an allowlisted plain-http host. Remove both from GATEWAY_403_MARKERS, keeping only the gateway-specific defaults (X-Squid-Error header, 'blocked by your network/organization/policy' wording, allowlist phrases); deployments opt broader phrases in via LINK_CHECK_GATEWAY_MARKERS as before. Also note per rubambiza's review that the 4 KB body cap in _egress_refusal_403 is intentional (gateway denial pages are small; headers are searched in full), so a future reader doesn't widen it expecting unbounded matching. Tests: add a regression test that a markerless CDN-style 'Access Denied' 403 through a proxy stays a real broken result, and that the phrase still classifies as a refusal when opted in via LINK_CHECK_GATEWAY_MARKERS. standing-orders/link-health.md updated to match the narrowed defaults. Signed-off-by: Jim Cadden <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jim Cadden <[email protected]> --------- Signed-off-by: Jim Cadden <[email protected]>
* fix: Address review nits from rossoctl/repoman#24 Applies the engine-script review feedback from rossoctl/repoman#24: - github-api.sh: bring the fixer_comment_count usage/Args doc examples to the rossoctl era (rossoctl/repoman), matching the vendored copy in repoman#24 byte-for-byte so the next vendoring converges. - github-api.sh: resolve_skill_meta no longer discards gh's stderr and exit code behind 2>/dev/null -- the gh api provenance lookup now captures both and distinguishes an auth/permission failure (HTTP 401/403/404 that is not a rate limit) from a transient one, so a wrong PAT no longer reads as a GitHub hiccup. Both classes stay non-fatal. - link-health-scanner.sh: the three WARN: headers paired with a stderr excerpt now go to stderr themselves, so header and excerpt land in the same place when streams are captured separately (cron logs). - CLAUDE.md: encode the error-handling policy (no silently swallowed exit codes behind 2>/dev/null; keep transient vs. permission error classes distinguishable) per reviewer request. - test-skill-meta.sh: Branch 7 regression coverage for the new failure classification (bare 403 = permission, 403 rate limit and network errors = transient). Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jim Cadden <[email protected]> * docs: Require full URLs for cross-repo references Encode in CLAUDE.md that citations of issues/PRs from other repos (e.g. repoman while working in automation) must use the full URL rather than bare shorthand like repoman#24, so references stay traceable outside GitHub's auto-linking (raised in rossoctl/repoman#24 (comment)). Linkify the bare cross-repo refs this PR itself introduced: the repoman#10 citations in the attribution-footer spec and the repoman#24 comment in tests/test-skill-meta.sh. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jim Cadden <[email protected]> * fix: Pin the gh stderr shapes used to class provenance failures resolve_skill_meta still classifies permission vs transient failures from gh's human stderr, because gh has no stable machine-readable error code (GH_ERROR_FORMAT is an open design). Note that next to the grep, and pin gh 2.89's "gh: <message> (HTTP 403)" shape in Branch 7 so a reword fails the test instead of classing a permission refusal as transient. Drop the leftover bare repoman#24 in that test header; cross-repo citations use the full URL. Assisted-by: Cursor <[email protected]> Signed-off-by: Jim Cadden <[email protected]> Co-authored-by: Cursor <[email protected]> --------- Signed-off-by: Jim Cadden <[email protected]> Co-authored-by: Cursor <[email protected]>
…b-pr-review Mirror of rossoctl/agent-skills#53 for the deployed pr-review program, which is what missed the two must-fix bugs on rossoctl/cortex#1658 and #1659 that motivated the change: - §3.11 Claims Check: verify every fix a PR claims in its exact target case and sibling variants; the new test must assert what the user sees. - §3.12 Behavioral Probes: concrete-case rule (no case, no finding) and opportunistic head-vs-base probes that run only with tooling already on PATH — never installed mid-review. The recipe is self-cleaning (worktree trap) and states its $LOG_DIR precondition. - must-fix is defined positively: the user-visible behavior is wrong. 'Not a regression vs main' does not downgrade it. - The review summary carries an auditable 'Not checked:' list naming what was skipped and why. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Jim Cadden <[email protected]>
Picks up the two follow-ups this PR was waiting on, both now merged to rossoctl/automation main: - automation#142: github-api.sh captures gh stderr and distinguishes refused (permanent) from transient provenance lookups; link-health WARN headers go to stderr. - automation#143: link-check.py classifies plain-http egress refusals as unchecked and excludes public-to-private redirects under --exclude-all-private. One --dest pass and one --skills pass, so the plugin dir and the four standalone skill dirs ship the same engine version. Vendored bytes are identical to automation@ef8a26f per file; tests/test-vendor-engine.sh passes. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Clawgenti <[email protected]>
a01ed11 mirrored an earlier revision of rossoctl/agent-skills#53. The merged version reorders the worktree trap before the first `add` and adds the documented-intent exception to the stricter-rejection rule. This brings the deployed copy to agent-skills main (9672454), keeping only the repoman-specific Phase 5 footer sentence as a divergence. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Clawgenti <[email protected]>
…ecks Expands [Unreleased] so the next release notes cover everything this PR lands: - Added: the stdlib Python link checker default (existing entry) and the github-pr-review claims check / head-vs-base probes mirrored from agent-skills#53. - Changed: the engine is vendored from automation ef8a26f (automation#123 plus #141-#143), and provenance lookups now separate refused tokens from transient failures. - Fixed: plain-http egress refusals are unchecked, private redirects are excluded under --exclude-all-private, and link-health WARN diagnostics go to stderr. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Clawgenti <[email protected]>
|
This is in good enough shape to by-pass and merge so that the changes can be consumed in |
Summary
Closes #3. Closes #27. Vendored side of the lychee → stdlib Python link checker switch, built from rossoctl/automation's
feat/stdlib-link-checkerbranch (rossoctl/automation#123).link-check.pyjoins the vendored engine set (scripts/vendor-engine.shextras, with regression-test coverage: copy, stamp listing, missing-source failure).link-health-scanner.sh(LINK_CHECKER toggle, unchecked split/reporting, no auto-close of unchecked previously-broken links, shadow mode),extract-broken-links.sh(uncheckedstatus token),automation-health-dashboard.sh(unchecked count + top-hosts rows), plus doc-drift-precheck/pr-review-fixer updates from automation main.skills/link-health-scanner/SKILL.mdrewritten for the python-default contract: prerequisites (python3>= 3.8, lychee opt-in),LINK_CHECKER, the unchecked egress-refusal bucket (never opens or auto-closes issues),LINK_HEALTH_SHADOW_OUTshadow mode, and the.lychee.tomlsubset (exclude,exclude_path,accept).skills/automation-health-dashboard/SKILL.mdnotes the new unchecked rows; CHANGELOG gets an Unreleased entry.main@4f284d0with bytes verified identical) also brings the plugin dir fully current with automationmain, resolving Re-vendor the plugin engine dir to current automation main #27 (re-vendor the plugin engine dir).Re-vendor and agent-skills sync
chore(vendor): Re-vendor engine from automation ef8a26f— one--dest+ one--skillspass picks up automation#142 (github-api.shstderr/error classification,WARN:to stderr) and automation#143 (link-check.pyplain-httpegress refusals asunchecked, private-redirect exclusion).github-pr-reviewSKILL.mdsynced to rossoctl/agent-skillsmain@9672454(agent-skills#53: §3.11 claims check, §3.12 head-vs-base probes, auditableNot checked:list). The only divergence from upstream is the repoman-specific Phase 5 footer sentence, retained deliberately.Why the vendored repoman-setup.sh header changed back
The doc-drift fixer's #22 edit documented
set-requirementsin the vendored copy's header — but vendored bytes must track the engine source, so this vendoring reverts it. The fix lands at the source in rossoctl/automation#141 (wording matches, so the next vendoring converges the copies byte-for-byte).Validation
bash tests/test-vendor-engine.sh: all 41 checks pass (plugin-dir and--skillsmodes: stamp shas, file sets, idempotency, dirty/non-git source rejection, prune safety).python3 skills/repoman/scripts/link-check.py --helpplus a functional smoke run (good/bad URL classification, JSON output) from both vendored locations.ef8a26fper file (diff -r, both plugin dir and standalone dirs). The earliergithub-api.shusage-comment divergence converged when automation#142 landed.shellcheck --severity=warningclean on the CI-checked tooling;bash -nclean on changed scripts.Review follow-ups (post-review commits)
SKILL.mdwording suggestions: the description line (enrolled set or whole org) and the Unchecked bullet now says "when running under an egress proxy".skills/*/scripts/stamps with the plugin dir (4f284d0, bytes already identical), so the repo ships one engine version — the two-versions problem Re-vendor the plugin engine dir to current automation main #27 describes.github-api.shusage-comment nit is applied in the vendored copy here; the source-side fix rides fix: Address review nits from rossoctl/repoman#24 automation#142 (byte-identical line, so the next re-vendor converges source and copy). #142 also carries the flagged2>/dev/nullerror-class fix, theWARN:header → stderr change inlink-health-scanner.sh, and the error-handling policy encoded in automation's CLAUDE.md.link-check.pyedge cases (plain-httpegress refusals classifiedunchecked, redirect-to-private excluded under--exclude-all-private) are fixed at the source in fix(link-check): classify plain-http egress refusals and private redirects automation#143 — not editable here per repo topology.pr-review-fixer.sh:153concern was checked and is a false alarm for repomanmain(the diff-map hunk is new here; it came from the automation repo this PR vendors — replied inline).Signed-off-by(history rewritten with identical trees;git diffbetween old and new heads is empty).Before merging (follow-ups)
main(one--dest+ one--skillspass) — done in 3a9506f, vendored from automationmain@ef8a26f(bytes identical per file;tests/test-vendor-engine.sh41/41).Before merging
scripts/vendor-engine.shfrom automationmainto refresh the_vendor.jsonstamp (the current stamp points at the pre-merge branch tipe1ebdcb)Assisted-By: Claude Code