Issue #88: plan/rule guards surface explicit-ask #97

Merged
gotoi-agent merged 2 commits from issue/88-create-guards-explicit into agent-develop 2026-10-08 23:25:25 +02:00
Collaborator

Refs #88

Adds imperative-phrase handling to plan_create / create_match_rule:

  • guard accepts any imperative verb-noun phrasing (fix, improve, set up, update, ...)
    not just literal "create the plan"
  • refusals are structured: { refused: true, reason, accepts_examples, how_to_recover }
  • new get_agent_guards tool exposes the current accepts_examples / how_to_recover text
    so the agent does not have to burn a turn discovering the guard rule

Re-based onto b638a13 (post #96/#97 merges) — manual conflict-resolved the AI-header
(See:/Last:) block in middleware/src/control-agent.ts to enumerate both branches' UCs.

Gates (this PR):

  • _check.py / check-ai-headers.py / check-type-mirror.py all exit 0
  • Showing-lines scan clean
  • middleware bun test targeted (uc-mw-172 + uc-mw-137 + uc-mw-136): 27 pass / 0 fail
  • middleware bun test FULL suite: 18 pre-existing reds (UC-MW-19/35/81-84/113/115/136/138/139/141/142/143/154/160/165/OP-07); reproduced identically on a throwaway worktree at base d6bb5c3; none in the changed paths
  • agent go test: pre-existing env failures (TestUCAG50* / TestAgentBinaryIntegration); unrelated to this diff

Refs #88

Refs #88 Adds imperative-phrase handling to plan_create / create_match_rule: - guard accepts any imperative verb-noun phrasing (fix, improve, set up, update, ...) not just literal "create the plan" - refusals are structured: { refused: true, reason, accepts_examples, how_to_recover } - new get_agent_guards tool exposes the current accepts_examples / how_to_recover text so the agent does not have to burn a turn discovering the guard rule Re-based onto b638a13 (post #96/#97 merges) — manual conflict-resolved the AI-header (See:/Last:) block in middleware/src/control-agent.ts to enumerate both branches' UCs. Gates (this PR): - _check.py / check-ai-headers.py / check-type-mirror.py all exit 0 - Showing-lines scan clean - middleware bun test targeted (uc-mw-172 + uc-mw-137 + uc-mw-136): 27 pass / 0 fail - middleware bun test FULL suite: 18 pre-existing reds (UC-MW-19/35/81-84/113/115/136/138/139/141/142/143/154/160/165/OP-07); reproduced identically on a throwaway worktree at base d6bb5c3; none in the changed paths - agent go test: pre-existing env failures (TestUCAG50* / TestAgentBinaryIntegration); unrelated to this diff Refs #88
Refs #88
Guard widened to a request verb (incl. fix, implement, set up, clean up, handle, address,
remediate) plus the plan/rule noun or an anaphor for it, so "fix it and improve it" passes.
requireOperatorRequest now throws a JSON refusal naming the satisfying condition and examples;
new read tool get_agent_guards exposes the state before a call.

UC-MW-172 (plan guard), UC-MW-173 (rule guard); UC-MW-137 updated.

Refs #88
EduarD3V force-pushed issue/88-create-guards-explicit from 6b24e240e7 to db0da2ca1d 2026-10-08 22:50:06 +02:00 Compare
gotoi-agent merged commit 038c94bbab into agent-develop 2026-10-08 23:25:25 +02:00
Sign in to join this conversation.
No description provided.