Skip to content

feat: the guardrail gains its public request-an-action entry (ADR-0047 §5) - #508

Merged
alicoding merged 1 commit into
mainfrom
guardrail-request-entry
Aug 28, 2026
Merged

feat: the guardrail gains its public request-an-action entry (ADR-0047 §5)#508
alicoding merged 1 commit into
mainfrom
guardrail-request-entry

Conversation

@alicoding

Copy link
Copy Markdown
Owner

Summary

  • Extracts the guardrail's rule evaluation into a callable core in guardrailsvc (EvaluateStep/EvaluateAction) shared by the execution gate and a new public RequestGuardedAction entry -- one rule plane, two entry points.
  • RequestGuardedAction(ctx, GuardedAction{Kind, Attributes, Description, Source}) lets a non-workflow caller submit an action for the same rules a workflow step already evaluates against: allow/deny resolve immediately; ask parks a PendingGuardedAction (decoupled from composition.ExecContext) and blocks until resolved, ctx-cancelled, or a 24h fail-safe timeout.
  • Not Wails-bound this slice -- a Go-internal entry for the MCP rebase (ADR-0047 §5 point 4) and any Review/floating-prompt UI wiring, both deferred to the next slice.

Test plan

  • go test ./internal/services/guardrailsvc/... ./internal/services/executionsvc/... ./internal/domain/guardrail/... -- all green, including the full pre-existing executionsvc guardrail-gate suite UNMODIFIED (the byte-identical-behavior proof).
  • go test -race -run 'TestRequestGuardedAction|TestEvaluateAction' ./internal/services/guardrailsvc/...
  • New tests cover: EvaluateAction against seeded rules (allow/ask/deny precedence, kind-scoped matching), RequestGuardedAction allow/deny immediate paths, ask→resolved-approve unblocking, ask→resolved-deny unblocking, and ctx-cancel clean withdrawal (pending removed, stale resolve is a no-op).
  • Full local lefthook suite green (go-build-desktop, go-build-server, go-vet, golangci-lint, go-test, comment-hygiene, file-loc-limit, gocognit-new, depguard-new, doc-paths, root-file-naming).

🤖 Generated with Claude Code

https://claude.ai/code/session_012im1JxQQV2ahnXzZDdVmZq

…7 §5)

Extracts the guardrail's rule-evaluation into a callable core in
guardrailsvc (EvaluateStep/EvaluateAction) that the execution gate and
the new public RequestGuardedAction entry both call -- one rule
plane, two entry points, never a second policy evaluation.

RequestGuardedAction(ctx, GuardedAction{Kind, Attributes, Description,
Source}) lets a non-workflow caller (an agent today, a plugin once the
out-of-tree loader ships) submit an action for the same rules a
workflow step already evaluates against. allow/deny resolve
immediately; ask parks a PendingGuardedAction -- decoupled from
composition.ExecContext, an in-memory analogue of
executionsvc.PendingApproval -- and blocks until resolved,
ctx-cancelled (a clean withdrawal), or the same 24h fail-safe every
other park in this codebase already uses.

Not Wails-bound this slice; the MCP rebase onto this entry and any
Review/floating-prompt UI wiring for a non-workflow park are the next
slice.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012im1JxQQV2ahnXzZDdVmZq
@alicoding
alicoding enabled auto-merge (squash) August 28, 2026 20:22
@alicoding
alicoding merged commit 9d64ec5 into main Aug 28, 2026
30 checks passed
@alicoding
alicoding deleted the guardrail-request-entry branch August 28, 2026 20:34
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