Skip to content

docs(archdev-skill): mitigate risks found while computing risk, then recompute - #26

Merged
calvin-archastro merged 2 commits into
mainfrom
docs/archdev-skill-mitigate-risks
Sep 23, 2026
Merged

calvin-archastro merged 2 commits into
mainfrom
docs/archdev-skill-mitigate-risks

Conversation

@calvin-archastro

@calvin-archastro calvin-archastro commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

Agents compute risk in two places: the sealed risk assessment on plan, task and PR events, and the per-hunk risk annotations on PRs. Today both are computed once and posted as labels. The assessment finds medium or high risks, and nobody acts on them before posting.

Change

references/monitor.md, sealed assessment: a new step 4, "Mitigate, then recompute".

  • For each medium or high risk driver, reduce the risk in the subject itself: fix the code, add a test or guard, split the unverifiable step, or tighten the plan.
  • Then re-author the assessment and finalize it again.
  • Never lower a grade by editing the assessment alone.
  • Run at most two rounds. Fix only within the existing scope. If a fix would expand scope, don't make it: record the risk as remaining and move forward.
  • Name what was mitigated, and what remains, in --message.

references/monitor.md, PR hunk annotations: a new step 3.

  • Fix real medium or high risk ranges with a test that would have caught them, and push.
  • Annotate the new head. A new head gets a new row, so --force is never needed.
  • At most two rounds, fixing only within the PR's scope. A risk whose fix would expand scope stays annotated, stated plainly, and the agent moves on.

SKILL.md: one sentence that points to this loop (within scope, at most twice).

Factory sessions are unchanged: they still skip hunk annotations, because the host writes those.

🤖 Generated with Claude Code

calvin-archastro and others added 2 commits September 23, 2026 12:53
…recompute

A sealed risk assessment and PR hunk risk annotations were computed once
and posted as labels. Now both are a loop: fix the medium/high risks in
the subject itself (code, tests, guards, plan), re-author and finalize (or
annotate the new head), and post what remains as named residual risk. The
grade must follow the work, never an edited assessment; one mitigation
round; scope-changing fixes go to the human.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ever expand scope

A fix that would expand scope is not made; the risk is recorded as residual
and the agent moves forward.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@calvin-archastro
calvin-archastro merged commit 2ac1732 into main Sep 23, 2026
5 checks passed
@calvin-archastro
calvin-archastro deleted the docs/archdev-skill-mitigate-risks branch September 23, 2026 20:08
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.

1 participant