You are working in a repo with shipgate.yaml already in place and want a coordinated remediation pass across all active findings — not just the top one. Walk every finding, classify it against the current autofix policy, and surface targeted fix recommendations. Apply only the safe, high-confidence patches (after preview + explicit confirmation); leave the rest for human review with concrete advice.
-
Always run a fresh v0.8+ scan with patches. Do not reuse a stale report — earlier scans may be pre-v0.7 (no remediation fields), pre-v0.8 (no
release_decision), or may lackpatches[](no--suggest-patches). SetAGENTS_SHIPGATE_AGENT_MODE=1so errors emit anext_actionJSON line on stderr.AGENTS_SHIPGATE_AGENT_MODE=1 agents-shipgate scan -c shipgate.yaml \ --suggest-patches --format json --ci-mode advisoryRead
agents-shipgate-reports/report.json. Verifyreport_schema_versionis"0.8"or higher. Filterfindings[]to entries with"suppressed": false. -
Bucket each active finding into one of four classes. Read
agent_action(v0.12+; deterministic projection of patches/autofix/human-review fields) to bucket each active finding directly. Ifagent_actionis missing (older v0.11 or earlier reports), fall back to the legacy three-field check shown in the right column. The buckets correspond todocs/autofix-policy.md:Bucket agent_action(v0.12+)Legacy fallback (v0.11 or earlier) Example check IDs A. Safe auto-fix auto_applyautofix_safe == trueSHIP-MANIFEST-STALE-{SUPPRESSION,POLICY,RISK-OVERRIDE}when the match is uniqueB. Medium-confidence config fix propose_patch_for_reviewautofix_safe == falseANDsuggested_patch_kind∈{set_pointer, append_pointer, remove_pointer}SHIP-AUTH-SCOPE-COVERAGE-MISSINGC. Manual escalate_to_human(withsuggested_patch_kind == "manual")suggested_patch_kind == "manual"Documentation, schema bounds, owner gaps, ADK/LangChain/CrewAI metadata, and the never-auto-fix trace findings D. No patch emitted escalate_to_human(withsuggested_patch_kind == "none")suggested_patch_kind == "none"The generator emitted nothing — but the finding can still be high/critical (e.g. low-confidence inventory). Treat as human triage, not informational. (skip) informationalsuppressed == trueAlready-suppressed findings; show counts only. For one-fetch counts read the top-level
agent_summaryblock (v0.12+):agent_summary.auto_appliable_patchesis the bucket-A count, andagent_summary.needs_human_reviewis buckets B + C + D combined (every active finding the user must weigh in on before applying — medium/low-confidence patches AND escalations). To split bucket B from bucket C+D you have to walkfindings[].agent_action— agent_summary deliberately does not disaggregate them, since the distinction is an implementation detail of the patch-confidence policy rather than a release-gate signal. Useagent_summary.first_recommended_action.commandas your default suggestion when bucket A is non-empty. -
Build a recommendation card per finding. For each, present:
check_id,title,severity,tool_name,confidence- The verbatim
recommendationstring (per-finding fix text from the check author) docs_urlas a markdown link (when non-null)- Concrete fix step — branch on patch kind, since the patch shapes differ:
set_pointer/append_pointer: showtarget_file,pointer,value,confidence,rationaleremove_pointer: showtarget_file,pointer,confidence,rationalemanual: showinstructionsverbatim.ManualPatchhas onlykindandinstructions— do NOT try to readtarget_file/pointer/value; they don't exist.- No patches (bucket D): use
evidenceandsourceto makerecommendationconcrete — quote the offending parameter name, the file path fromsource.ref, the manifest key. Generic advice is not acceptable here.
-
Present the prioritised plan. Severity-ordered (critical → high → medium → low → info), grouped by bucket within each severity tier. Show counts per bucket up front. For low/info findings in bucket D, summary-link via
docs_urlrather than full cards — avoid wall-of-text. -
Decision points — ask the user explicitly. Always preview before mutating.
- Bucket A (safe auto-fix). First run a dry-run (omit
--apply):Show the user the planned file diffs. Only after explicit confirmation, re-run withagents-shipgate apply-patches \ --from agents-shipgate-reports/report.json \ --confidence high--apply --json. Never silently apply. - Bucket B (medium-confidence config). Surface the patches with their
pointerandvalue. Tell the user the opt-in command (apply-patches --confidence medium) and that they must read the appended values first — scope strings can encode policy choices. Do not apply on the user's behalf in this recipe. - Bucket C (manual). Ask whether to walk through them now or defer. For deep dive on a single finding, cross-link to
fix-top-finding.md. Never edit a trace recording to silenceSHIP-API-TRACE-{APPROVAL,CONFIRMATION}-MISSING— that patches the evidence, not the agent. Implement the runtime gate instead. - Bucket D (no patch). Ask whether to walk through them — these need diagnosis, not patch application. Cross-link to
fix-top-finding.md; the four-response decision tree (add policy / override / suppress / fix tool spec) applies.
- Bucket A (safe auto-fix). First run a dry-run (omit
-
Re-scan after applying any Bucket A patches. Show the diff in
summary.{critical_count, high_count, medium_count}. Confirm the previously-fixed fingerprints are gone fromreport.json. -
Report back:
- Counts per bucket (A/B/C/D) and per severity
- What was applied (from
apply-patches --apply --jsonoutput'sfiles) - What remains, with one clear next action per remaining bucket
- Any cross-links the user should follow (
fix-top-finding.md,triage-false-positive.md)
- Do not run
apply-patches --applywithout showing the dry-run preview first AND getting explicit user confirmation, even whenautofix_safe == true. - Do not apply
--confidence mediumpatches in this recipe. They are opt-in only and require the user to read the appended values. - Do not edit a trace recording to silence
SHIP-API-TRACE-{APPROVAL,CONFIRMATION}-MISSING. Trace findings are class-four "never auto-fix" per the autofix policy. Implement the runtime approval/confirmation gate. - Do not recommend
checks.ignoreas a fix here. That's thetriage-false-positive.mdworkflow's job — cross-link to it. - Do not claim a finding is fixed without re-running
agents-shipgate scanand showing the diff in counts. - Do not invent recommendations not grounded in
recommendation,evidence,patches[].instructions, ordocs_url. Use evidence to make advice concrete; do not replace check-author guidance with a guess.
- A fresh
report.jsonexists, validates asreport_schema_version: "0.8"(or higher; v0.12+ exposesagent_actionandagent_summary), and was generated with--suggest-patches. - Each presented card cites a concrete location:
target_file+pointerfor non-manual patches,instructionsverbatim for manual patches, file path + parameter name fromevidence/sourcefor bucket D. - If Bucket A patches were applied: re-scan shows lower active counts AND the previously-failing fingerprints are absent from the new
report.json. - If only B/C/D were surfaced: counts are unchanged (expected); the user has a clear list of next actions.