Policy: a refine run posts at most one comment #46

Open
opened 2026-11-20 15:08:46 +01:00 by dario · 0 comments
Owner

After #28 is merged.

Problem

The refine-item skill allows one comment per run: questions (headless) or the result. In interactive runs it posts nothing but the result. A local model broke this in an interactive run on #23: it posted questions twice (comments 416 and 417, nearly identical), then the result (418). A skill rule does not hold with local models; a deterministic check does.

Change

  • forge.Policy gets a limit on comments (e.g. MaxComments int, 0 = unlimited). The guarded CommentOnIssue (internal/forge/policy.go:222) counts successful comments and refuses further ones with a PolicyError explaining that this run may post only one comment, which should be the final result.
  • factory mcp is one process per run and builds its policy from the environment (internal/ops/env.go:87). The dispatcher sets the limit through a new FACTORY_* variable for the refine role only.
  • The run report the dispatcher posts with its own policy (internal/dispatch/dispatch.go:272) is not affected.

Done criteria

  • Tests: the second comment of a refine run is refused; other roles are unlimited; the run report is still posted.
  • README and ADR 0016 mention the limit.
  • just check passes.
After #28 is merged. ## Problem The refine-item skill allows one comment per run: questions (headless) or the result. In interactive runs it posts nothing but the result. A local model broke this in an interactive run on #23: it posted questions twice (comments 416 and 417, nearly identical), then the result (418). A skill rule does not hold with local models; a deterministic check does. ## Change - `forge.Policy` gets a limit on comments (e.g. `MaxComments int`, 0 = unlimited). The guarded `CommentOnIssue` (internal/forge/policy.go:222) counts successful comments and refuses further ones with a `PolicyError` explaining that this run may post only one comment, which should be the final result. - `factory mcp` is one process per run and builds its policy from the environment (internal/ops/env.go:87). The dispatcher sets the limit through a new `FACTORY_*` variable for the refine role only. - The run report the dispatcher posts with its own policy (internal/dispatch/dispatch.go:272) is not affected. ## Done criteria - Tests: the second comment of a refine run is refused; other roles are unlimited; the run report is still posted. - README and ADR 0016 mention the limit. - `just check` passes.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dario/factory#46
No description provided.