mcp/policy-aware-actions #13

Closed
opened 2026-05-09 23:25:16 +02:00 by codex · 1 comment
Collaborator

Parent: #2
Wave: 2 - Board Maturity
Depends on: #10, #12

Summary

Teach MCP action tools to return policy warnings before or alongside narrow mutations.

Scope

  • Add policyWarnings to create/move/link results where relevant.
  • Warn on WIP exceeded, blocked card, and policy mismatch.
  • Keep allowed direct actions narrow: create, move, comment, relation link/unlink when approved.
  • Route broader operations to proposals.

Non-goals

  • No hard policy enforcement in v1.
  • No autonomous repair or reprioritization.
  • No hidden board restructuring.

Acceptance Criteria

  • Moving into a full column returns a WIP warning.
  • Moving a blocked card returns a blocked-card warning.
  • Policy mismatch is visible to Iskra and can be explained to Piotr.
  • Mutation audit still records action result and warnings.

Tests / Smoke

  • MCP/API tests for warning shapes.
  • Smoke for move into Doing with advisory WIP limit.
  • Regression tests for normal create/move/comment paths.

Rollback

Ignore policyWarnings client-side and keep existing action behavior.

Owner Gates

Owner approval before enabling policy-aware warnings in production MCP responses if clients depend on strict schemas.

Parent: #2 Wave: 2 - Board Maturity Depends on: #10, #12 ## Summary Teach MCP action tools to return policy warnings before or alongside narrow mutations. ## Scope - Add `policyWarnings` to create/move/link results where relevant. - Warn on WIP exceeded, blocked card, and policy mismatch. - Keep allowed direct actions narrow: create, move, comment, relation link/unlink when approved. - Route broader operations to proposals. ## Non-goals - No hard policy enforcement in v1. - No autonomous repair or reprioritization. - No hidden board restructuring. ## Acceptance Criteria - Moving into a full column returns a WIP warning. - Moving a blocked card returns a blocked-card warning. - Policy mismatch is visible to Iskra and can be explained to Piotr. - Mutation audit still records action result and warnings. ## Tests / Smoke - MCP/API tests for warning shapes. - Smoke for move into Doing with advisory WIP limit. - Regression tests for normal create/move/comment paths. ## Rollback Ignore `policyWarnings` client-side and keep existing action behavior. ## Owner Gates Owner approval before enabling policy-aware warnings in production MCP responses if clients depend on strict schemas.
Author
Collaborator

PR gotowy: #37 mcp/policy-aware-actions

Zakres:

  • create_card i move_card zwracają advisory policyWarnings,
  • warningi obejmują WIP exceeded, blocked card, entry/exit policy, agentMovePolicy: warn i proposal_required,
  • wynik z warningami trafia też do agent_audit_event.result, więc Iskra może później wyjaśnić, co się stało,
  • MCP opisy narzędzi mówią wprost, że create/move mogą zwracać policyWarnings,
  • bez twardego blokowania i bez poszerzania write surface.

Walidacja:

  • pnpm --filter @kan/db build
  • pnpm --filter @kan/api build
  • pnpm --filter @kan/api typecheck
  • pnpm --filter @kan/db typecheck
  • pnpm --filter @kan/mcp typecheck
  • pnpm --filter @kan/api test -- integration-tests/agent.integration.test.ts agent.test.ts integration-tests/card-relations.integration.test.ts integration-tests/list-policies.integration.test.ts
  • pnpm --filter @kan/api test -- integration-tests/agent.integration.test.ts agent.test.ts
  • pnpm exec prettier --check packages/db/src/repository/card.repo.ts packages/api/src/routers/agent.ts packages/api/integration-tests/agent.integration.test.ts packages/mcp/src/index.ts docs/agent-mcp-contract.md
  • git diff --check

Uwagi:

  • proposal_required jest teraz mocnym sygnałem do wyjaśnienia/proposal-first, ale nie blokadą runtime.
  • Nie dotykałem produkcyjnych tokenów, sekretów ani deploya.
PR gotowy: #37 `mcp/policy-aware-actions` Zakres: - `create_card` i `move_card` zwracają advisory `policyWarnings`, - warningi obejmują WIP exceeded, blocked card, entry/exit policy, `agentMovePolicy: warn` i `proposal_required`, - wynik z warningami trafia też do `agent_audit_event.result`, więc Iskra może później wyjaśnić, co się stało, - MCP opisy narzędzi mówią wprost, że create/move mogą zwracać `policyWarnings`, - bez twardego blokowania i bez poszerzania write surface. Walidacja: - `pnpm --filter @kan/db build` - `pnpm --filter @kan/api build` - `pnpm --filter @kan/api typecheck` - `pnpm --filter @kan/db typecheck` - `pnpm --filter @kan/mcp typecheck` - `pnpm --filter @kan/api test -- integration-tests/agent.integration.test.ts agent.test.ts integration-tests/card-relations.integration.test.ts integration-tests/list-policies.integration.test.ts` - `pnpm --filter @kan/api test -- integration-tests/agent.integration.test.ts agent.test.ts` - `pnpm exec prettier --check packages/db/src/repository/card.repo.ts packages/api/src/routers/agent.ts packages/api/integration-tests/agent.integration.test.ts packages/mcp/src/index.ts docs/agent-mcp-contract.md` - `git diff --check` Uwagi: - `proposal_required` jest teraz mocnym sygnałem do wyjaśnienia/proposal-first, ale nie blokadą runtime. - Nie dotykałem produkcyjnych tokenów, sekretów ani deploya.
Sign in to join this conversation.
No labels
3plus3-followup
agent/claude-code
agent/codex
agent/hermes
agent/iskra
agent/ollama
agent/patchwarden
analytics
api
cockpit
dependency/blocked
dependency/blocks-others
dependency/cross-repo
dependency/needs-confirmation
docs
domain:agents
domain:ci
domain:docs
domain:forgejo
domain:infra
domain:memory
domain:runtime
domain:signal
domain:ux
flow/architecture
flow/blocked
flow/deployed
flow/done
flow/implementation
flow/intake
flow/maintained
flow/observed
flow/ready
flow/refining
flow/retired
flow/review
gemini-flash
judge/codex-candidate
judge/hermes-candidate
judge/low-confidence
judge/needs-refinement
judge/operator-needed
judge/p0
judge/p1
judge/p2
judge/p3
judge/park
judge/patchwarden-candidate
judge/stale-priority
kind/adr
kind/bug
kind/chore
kind/feature
kind/infra
kind/ops
kind/refactor
kind/research
leviathan
mcp
merge/auto
merge/manual
merge/manual-dependency-conflict
merge/manual-failing-tests
merge/manual-merge-conflict
merge/manual-missing-review
merge/manual-operator-preference
merge/manual-red-zone
merge/manual-security-sensitive
merge/manual-unclear-scope
merge/manual-unknown
mode:operator-only
mode:patchwarden-iskra-approved
mode:safe-auto
observed/erroring
observed/needs-followup
observed/pending
observed/retire-candidate
observed/unused
observed/used
ops
priority:p0
priority:p1
priority:p2
priority:p3
review:claude-reviewed
review:codex-reviewed
review:dziadek-reviewed
review:needs-human
safety
safety:external-write
safety:no-prod-mutation
safety:prod-impact
safety:secret-touch
scout
security
size/large
size/medium
size/small
size/tiny
size/unknown
small-task
source/adr
source/agent-generated
source/manual
source/operator-chat
source/voice-note
status:blocked
status:codex-ready
status:merged:pending-evidence
status:needs-evidence
status:operator-needed
status:parked
tests
tier:0-platform-substrate
tier:1-iskra-value-layer
tier:2-tools-products-modules
type:bug
type:chore
type:docs
type:feat
type:policy
type:research
ui
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
pdurlej/kan-ductor#13
No description provided.