Skip to content

M3: Implement local AI modes and cost guardrails #11

@dbrosio3

Description

@dbrosio3

Goal

Implement local AI modes and guardrails so AI review is scoped and predictable in the configured mode.

User value

Developers get local AI feedback with explicit blocking, advisory, and off behavior plus visible cost and latency guardrails.

Implementation notes

  • Add ai.mode: blocking | advisory | off.
  • Keep local AI blocking by default, with advisory and off as supported softer modes.
  • Add guardrails such as max_changed_lines, max_prompt_tokens, and timeout_seconds once their defaults are frozen.
  • Respect the AI-only skip decision exposed by the documented skip-control work so deterministic checks can still run when local AI is skipped.
  • Print when AI is skipped because a guardrail was reached.
  • Make provider error behavior explicit for each AI mode.

Risks / tradeoffs

  • A blocking default needs clear timeout, provider failure, and auth behavior to stay predictable.
  • Token estimates may be approximate across providers.

Suggested priority

P1

Milestone

M3: Local AI review

TBD considerations

  • Exact cost/latency guardrail defaults.
  • Privacy policy for diff context, full-file context, and secret handling before AI calls.

Acceptance criteria

  • Default blocking, explicit advisory, and explicit off modes are covered by tests.
  • AI-only skip keeps the deterministic layer running when the skip-control path selects it.
  • Guardrail skips are visible and non-surprising.

Metadata

Metadata

Assignees

No one assigned

    Labels

    M3Milestone M3: optional local AIP1Priority P1: important follow-upenhancementNew feature or requestv2ai-pushgate v2 roadmap

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions