Repository navigation
Description
Finding (architecture:improve deepening scan, no human interview run — see below)
This repo has two sharing worlds with different mechanics:
- Composite actions (post-checkout) — can
sourcea shared repo file..github/actions/_shared/install-release.shis the working example, consumed by 8 lanes. - Reusable workflows — ship standalone, SHA-pinned, run with only the workflow file present on a caller's repo. Inline bash cannot
sourcea repo-relative lib. The repo's answer is render-time codegen: canonical logic in.github/scripts/*.sh, inlined into workflow YAML viarender-*.cjsbetween# BEGIN GENERATEDmarkers, with a--checkdrift guard.
The gap: the render mechanism inlines exactly one source per block — no composition/include capability. Any primitive shared between bundled scripts structurally can't be extracted the way install-release.sh was, without either (a) giving render-*.cjs a compose step, or (b) accepting duplication as the price of standalone shippability.
Three symptoms of this one root, verified via nested byte-diff investigation:
1a. SARIF-to-annotation logic — osv-scan-guard.sh and zizmor-sarif-guard.sh's annotate_findings share ~95-100 of ~120 lines byte-identical (4 nested helpers incl. a 51-line URI decoder are identical save 1 line); only ~6-8 lines are tool-specific. govulncheck-sarif-guard.sh intentionally has no per-finding annotation stage — excluded, forcing it in would add behavior it deliberately omits. A sarif-to-annotations.sh (SARIF_PATH + TOOL_LABEL + level-mode + runs-selector) would absorb osv+zizmor cleanly, in install-release.sh's env-contract style — IF the render layer can compose it in.
1b. gh-bounded-read retry helper — hand-copied 5+ times, 2 variants (not the 3 originally suspected): byte-identical gh_read() command-substitution variant in queue-monitor-liveness.yml, tool-version-drift-check.yml, AND link-check.yml; temp-file variant in pulumi-version-drift.sh, tool-drift's bounded_read, and pulumi-deploy-guard/guard.sh. Fixed 1s retry (not exponential, despite network-timeout-policy.test.cjs's naming). install-release.sh can't absorb this — its retry is curl-native, wrapping curl not gh api; different seam. Governance smell: network-timeout-policy.test.cjs is an occurrence-count test that currently freezes the duplication rather than forbidding it.
1c. render-*.cjs clone family — all 5 render-*.cjs scripts are byte-identical after normalizing filenames/markers. A single data-driven render.cjs + a manifest of {source, workflow, markers} absorbs all five.
Why this needs a human decision, not an autonomous fix
1c is safe to do independently (pure JS tooling, no behavior change to generated output). 1a/1b are NOT safe to unilaterally resolve: extracting them requires deciding whether render codegen grows a composition capability (added complexity, new failure surface in a security-relevant SARIF-gating path) versus accepting the current duplication as the price of each reusable workflow shipping standalone — a real tradeoff that also collides with network-timeout-policy.test.cjs's occurrence-count assertions (which would need to change from "expect N copies" to "expect 1 shared source, N call sites").
Recommendation
- 1c (render.cjs consolidation): straightforward, do independently.
- 1a/1b: needs a decision on composition-vs-accept before implementation. Suggested next step: a short design conversation (or
/architecture:improvere-run with a human available for the interview loop) to pick the shape, then implement.
Verification once implemented: /verification:measure for the line-count/duplication reduction claim.
Activity
kyle-sexton commentedon Jul 23, 2026
This was generated by AI during triage.
Triage: premises have partly drifted since authoring — re-scope before implementing
Verified the three claims against
main(HEADfd8439b). Two of the three have materially eroded since this issue was written; one survives.1a — shared SARIF annotator (osv + zizmor): now OBSOLETE.
#203(77d6c29,refactor(zizmor): replace hand-rolled SARIF guard with native --format=github) removed the hand-rolledzizmor-sarif-guard.shand itsrender-zizmor-sarif-guard.cjs. There is no longer azizmor-sarif-guard.shin the tree.annotate_findingsnow lives in exactly one place —.github/scripts/osv-scan-guard.sh— with no second consumer to share with (govulncheck-sarif-guard.shstill deliberately omits per-finding annotation). The duplication that motivated extractingsarif-to-annotations.shis gone.1c —
render-*.cjsbyte-identical clones: premise no longer holds. There are 4, not 5 (find-tracking-issue,osv-scan-guard,pulumi-version-drift,select-runner-workflow). They are not byte-identical after normalization — they've diverged into at least two distinct shapes: theosv/older shape (51 lines,scriptsDirectory,module.exports,process.exitCode) vs. thepulumi/newer shape (59 lines,root,indentation/beginMarker, exactly-one-ordered-block validation,throw). A consolidation opportunity may still exist conceptually, but it's now a reconcile-then-unify job, not a mechanical dedup of clones.1b —
gh-bounded-read retry helper: still REAL. 6 definitions across 5 files:pulumi-version-drift.sh:21,link-check.yml:119,pulumi-version-drift-check.yml:74,queue-monitor-liveness.yml:62,tool-version-drift-check.yml:64(bounded_read) +:424(gh_read);pulumi-deploy-guard/guard.shalso present.network-timeout-policy.test.cjsis occurrence-count based (assert.equal(occurrences(...), 6)), so it freezes the duplication rather than forbidding it — any extraction must flip those assertions from "N copies" to "1 source + N call sites".Routing
Keeping this open but routing to needs-human, not autonomous:
gh-bounded-read dedup + the render-shape reconcile) before any implementation. An autonomous session acting on the body as written would chase removed files.Priority medium: real value, no deadline; ongoing refactors (
#199,#203,#205,#206) are independently chipping at duplication, so nothing here blocks other open work.test(actions): cover composite action shell with ShellCheck (#261)
docs(yq): ratify the runner-preinstalled exception at every call site (…
kyle-sexton commentedon Aug 12, 2026
Status (2026-08-12 drain): needs-human — leave open. Recommended default for ratification (re-scoped against current tree):
Do now — 1c: unify the remaining
render-*.cjsfamily into a single data-drivenrender.cjs+ manifest{source, workflow, markers}(reconcile the older osv-shape vs newer pulumi-shape first; not a blind byte-dedup). Safe tooling-only change; no generated-output behavior change intended.Later — 1a: treat as obsolete / low priority (zizmor hand-rolled SARIF guard already removed in #203; no second annotator consumer).
Later — 1b:
gh-bounded-read dedup still real (~6 copies) — only after deciding whether render codegen grows composition/include vs accepting duplication for standalone shippability. Flipnetwork-timeout-policy.test.cjsfrom occurrence-count freeze to single-source assertions when extracting.Please ratify “1c now; 1a/1b later” before autonomous implementation.
kyle-sexton commentedon Aug 12, 2026
Claiming for implementation: land 1c only (unify remaining
render-*.cjsinto shared compose + data-driven render). 1a obsolete; 1b deferred (composition-vs-duplication still open). No new issues.kyle-sexton commentedon Aug 12, 2026
1c landed in #421 (
cursor/issue-200-render-compose-9b36@33890ae).render-compose.cjs+ data-drivenrender.cjsmanifest; thinrender-*.cjswrappers kept.--checkgreen; SHA-256 unchanged after rewrite).source).Still deferred (no new issues filed):
gh-bounded-read dedup still real; needs composition-vs-accept-duplication decision before extraction / flippingnetwork-timeout-policy.test.cjsoccurrence-count freezes.Leaving #200 open for 1b; not closing on 1c alone.
refactor(scripts): unify render-*.cjs behind shared compose + manifest (
refactor: clear the remaining deferred inventory
fix(guards): close fail-open and latent-test defects found by a repo-…