fix(production-scan): stop silent Stage-4 skip — locate renderer up front + mandatory publish - #36
Merged
Merged
Conversation
…ront + make publish mandatory A trial scanned a public repo but skipped report render + S3 upload, wrongly concluding "there is no callable uploader" even though render-report.mjs was in its checkout, and ended with neither a hosted URL nor an honest upload-failed line. Two SKILL.md-only changes: - Stage 1.1a preflight: locate render-report.mjs on disk (cwd is the scanned repo, not the skill) and derive SKILL_DIR up front, while context is short — so the agent cannot later claim the uploader is absent. Graceful when truly missing: finish the scan, emit the honest upload-failed line, don't abort. - honest-URL rule: for a public repo, publishing is mandatory; ending with only an in-chat summary is a FAILED run. Forbid skipping publish on a belief, and allow the upload-failed line only after a real non-zero exit quoting the real error. Carve out the Stage 4.1 public-repo gate as the one legitimate no-publish path. Prose-only; render smoke test unchanged (17/17). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A production-scan trial scanned a public repo but never rendered the report or uploaded it to S3 — it ended the turn with no report file, no hosted
report.first-tree.ai/<key>.htmlURL, and no honest "upload failed" line. The agent's own account: it concluded "there is no callable uploader" even thoughscripts/render-report.mjswas present in its checkout. Nothing caught the half-finished run.Root cause is a discovery + fallback gap, not a missing step: the skill spells out render (Stage 3) and upload (Stage 4), but the free-running agent, deep in a long scan with cwd in the scanned repo (not the skill), couldn't wire up the skill's own renderer path, decided the tool didn't exist, and silently stopped.
Fix (SKILL.md prose only — no code, no runtime change)
findrender-report.mjson disk and deriveSKILL_DIRfrom where it actually is, then reuse that resolved absolute path as<skill-dir>in Stages 3/4. Because the renderer is located from the real filesystem, the agent can't later claim "no uploader". Graceful when genuinely absent: finish the scan, deliver the in-chat report, emit the honest upload-failed line — don't abort before findings exist.⚠️ Report upload failedline only after a real non-zero exit quoting the real error. Explicit carve-out: the Stage 4.1 step-0 public-repo gate remains the one legitimate no-publish path (fail-closed, in-chat only).Scope / tradeoff
Deliberately minimal and skill-only. This substantially lowers the failure rate and converts a silent no-report into either a hosted URL or a loud honest failure line — but it can't fully eliminate the failure, because the tail is still executed by a free-running agent (a dropped tool call / turn-budget exhaustion remain possible). Eliminating that entirely would require moving render+upload out of the agent (out of scope by request).
Verification
node --test scripts/render-report.test.mjs→ 17/17 pass (prose-only change; renderer untouched).bash -n.🤖 Generated with Claude Code