chore(constitution): bump to v1.2.1 for AI orchestration carve-out - #17
Conversation
Add a PATCH-level carve-out under Technology Constraints > AI orchestration permitting non-agent single-turn inference (classification, embedding, summarisation) via `src/ai/llm-client.ts` using the raw Anthropic or Bedrock SDKs. Multi-turn tool-using flows remain on `@anthropic-ai/claude-agent-sdk`. Unblocks the triage-dispatch-modes feature (specs/20260415-000159-triage-dispatch-modes). The triage call is a single-turn no-tool classification; the prior blanket ban targeted agent-loop bypasses, not pure inference. Carve-out is guarded by the circuit-breaker, latency, and cost requirements in FR-020 / SC-003 / SC-005 of that spec. Per §Amendment Procedure this ships as a standalone PR ahead of any feature code that depends on the carve-out. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 56 minutes and 4 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe constitution's AI orchestration rule is revised from a blanket prohibition on direct LLM API calls to a conditional split policy: multi-turn agent flows remain restricted to the agent SDK, while single-turn inference tasks (classification, embedding, summarization) are permitted to use raw Anthropic or Bedrock SDKs, provided they enforce circuit-breaker, latency cap, and cost budget constraints. Version incremented to 1.2.1. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.specify/memory/constitution.md:
- Around line 267-275: Add enforceable runtime guards for the “raw Anthropic or
Bedrock SDK” carve-out by (1) adding a startup/config assertion in src/config.ts
(e.g., assertThirdPartyLlmAllowed() or assertCircuitBreakerConfigured()) that
verifies required circuit-breaker, latency cap and cost budget settings are
present and fail-fast on misconfiguration, and (2) adding a runtime check in the
llm adaptor in src/ai/llm-client.ts (e.g., inside the client factory or call
method such as createLlmClient() or LlmClient.request()) that validates the same
invariants before performing a non-agent single-turn request and throws/returns
an auditable error if they aren’t satisfied; ensure the error messages reference
the policy and the config assertion so audits can trace enforcement.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 36ddbe55-d476-49d9-b351-a4282b9b1e0b
📒 Files selected for processing (1)
.specify/memory/constitution.md
| - **AI orchestration**: `@anthropic-ai/claude-agent-sdk` for all | ||
| multi-turn, tool-using agent flows. Non-agent single-turn | ||
| inference (classification, embedding, summarisation) MAY use the | ||
| raw Anthropic or Bedrock SDKs via the `src/ai/llm-client.ts` | ||
| adaptor, provided the calling feature spec enforces a | ||
| circuit-breaker, latency cap, and cost budget (see | ||
| `specs/20260415-000159-triage-dispatch-modes` FR-020 / SC-003 / | ||
| SC-005 for the reference pattern). Multi-turn tool-using flows | ||
| MUST continue to use `@anthropic-ai/claude-agent-sdk`. |
There was a problem hiding this comment.
Make the carve-out enforceable at runtime, not only at spec level.
Lines 271–274 currently require constraints via “calling feature spec,” which is necessary but not sufficient for enforcement. Please require code-level guards (startup/config assertion + runtime check in the adaptor) so this policy is auditable and fail-fast.
Proposed wording tweak
- **AI orchestration**: `@anthropic-ai/claude-agent-sdk` for all
multi-turn, tool-using agent flows. Non-agent single-turn
inference (classification, embedding, summarisation) MAY use the
raw Anthropic or Bedrock SDKs via the `src/ai/llm-client.ts`
- adaptor, provided the calling feature spec enforces a
- circuit-breaker, latency cap, and cost budget (see
+ adaptor, provided the calling feature spec defines and the code
+ enforces (via startup/config assertions and runtime guards) a
+ circuit-breaker, latency cap, and cost budget (see
`specs/20260415-000159-triage-dispatch-modes` FR-020 / SC-003 /
SC-005 for the reference pattern). Multi-turn tool-using flows
MUST continue to use `@anthropic-ai/claude-agent-sdk`.Based on learnings, in chrisleekr/github-app-playground, security/compliance invariants are preferred as startup-time assertX() checks in src/config.ts to ensure fail-fast enforcement.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - **AI orchestration**: `@anthropic-ai/claude-agent-sdk` for all | |
| multi-turn, tool-using agent flows. Non-agent single-turn | |
| inference (classification, embedding, summarisation) MAY use the | |
| raw Anthropic or Bedrock SDKs via the `src/ai/llm-client.ts` | |
| adaptor, provided the calling feature spec enforces a | |
| circuit-breaker, latency cap, and cost budget (see | |
| `specs/20260415-000159-triage-dispatch-modes` FR-020 / SC-003 / | |
| SC-005 for the reference pattern). Multi-turn tool-using flows | |
| MUST continue to use `@anthropic-ai/claude-agent-sdk`. | |
| - **AI orchestration**: `@anthropic-ai/claude-agent-sdk` for all | |
| multi-turn, tool-using agent flows. Non-agent single-turn | |
| inference (classification, embedding, summarisation) MAY use the | |
| raw Anthropic or Bedrock SDKs via the `src/ai/llm-client.ts` | |
| adaptor, provided the calling feature spec defines and the code | |
| enforces (via startup/config assertions and runtime guards) a | |
| circuit-breaker, latency cap, and cost budget (see | |
| `specs/20260415-000159-triage-dispatch-modes` FR-020 / SC-003 / | |
| SC-005 for the reference pattern). Multi-turn tool-using flows | |
| MUST continue to use `@anthropic-ai/claude-agent-sdk`. |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.specify/memory/constitution.md around lines 267 - 275, Add enforceable
runtime guards for the “raw Anthropic or Bedrock SDK” carve-out by (1) adding a
startup/config assertion in src/config.ts (e.g., assertThirdPartyLlmAllowed() or
assertCircuitBreakerConfigured()) that verifies required circuit-breaker,
latency cap and cost budget settings are present and fail-fast on
misconfiguration, and (2) adding a runtime check in the llm adaptor in
src/ai/llm-client.ts (e.g., inside the client factory or call method such as
createLlmClient() or LlmClient.request()) that validates the same invariants
before performing a non-agent single-turn request and throws/returns an
auditable error if they aren’t satisfied; ensure the error messages reference
the policy and the config assertion so audits can trace enforcement.
There was a problem hiding this comment.
Pull request overview
Updates the repository constitution to clarify AI orchestration rules by allowing limited single-turn inference outside the agent SDK, while keeping multi-turn/tool-using flows constrained to the agent SDK.
Changes:
- Add a PATCH-level (1.2.0 → 1.2.1) carve-out permitting non-agent single-turn inference via raw Anthropic/Bedrock SDKs (with guardrails) while preserving the agent-SDK requirement for multi-turn/tool flows.
- Add a new Sync Impact Report block and move the prior report into the historical section.
- Bump the constitution version footer to 1.2.1 and update amendment metadata.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| raw Anthropic or Bedrock SDKs via the `src/ai/llm-client.ts` | ||
| adaptor, provided the calling feature spec enforces a | ||
| circuit-breaker, latency cap, and cost budget (see | ||
| `specs/20260415-000159-triage-dispatch-modes` FR-020 / SC-003 / | ||
| SC-005 for the reference pattern). Multi-turn tool-using flows |
There was a problem hiding this comment.
The constitution text references specs/20260415-000159-triage-dispatch-modes as a “reference pattern”, but that spec directory/file doesn’t exist in this repo (yet). This creates a broken internal reference; consider linking to an existing, ratified spec/issue/PR instead, or rewording to avoid hardcoding a path until it lands.
| raw Anthropic or Bedrock SDKs via the `src/ai/llm-client.ts` | ||
| adaptor, provided the calling feature spec enforces a |
There was a problem hiding this comment.
src/ai/llm-client.ts is referenced as the required adaptor, but there is no src/ai directory in the current repo. If this adaptor is “forthcoming”, consider explicitly marking it as planned/forthcoming (to avoid implying it exists today) or using a more abstract requirement (e.g., a single approved LLM client module) until the file lands.
- Drop specific file reference (`src/ai/llm-client.ts`) from the policy bullet — the constitution states policy, not paths. Adaptor module location is implementation detail, still constrained to the `src/ai/` namespace. - Drop forward reference to an unmerged spec from the policy bullet (Sync Impact Report still carries it as historical rationale). - Tighten the carve-out's enforcement contract to require all three layers: spec documentation, runtime guards in the adaptor, and fail-fast Zod config validation at startup. Addresses CodeRabbit's concern that "spec enforces" is too weak for a runtime invariant. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for the reviews. Pushed commit Copilot #1 (broken Copilot #2 (forthcoming CodeRabbit (enforceable at runtime) — partially adopted. The policy bullet now requires all three enforcement layers: (a) spec documentation, (b) runtime guards in the adaptor or call site, (c) fail-fast Zod config validation at startup. This addresses the spirit of your comment — enforcement cannot live in prose alone. I did not add runtime guard code to the constitution itself. That's a category error: the constitution states policy, not implementation. The guard code belongs in the feature work (tasks T032 circuit breaker, T034 triage engine with timeout + budget, T005 config schema validation with |
- docs/dispatch-flow.md: new doc with the canonical cascade Mermaid diagram (ported from quickstart.md §Dispatch cascade) plus a node reference table pointing at source-of-truth modules. Uses high-contrast classDefs per GitHub Mermaid rendering requirements. - CLAUDE.md: Active Technologies cleaned up — consolidated the automated update-agent-context.sh output, added a DispatchTarget / DispatchReason taxonomy line and references to dispatch-flow.md and the new dispatch-stats query module. - plan.md: Constitution Check Principle IV row now cites the v1.2.1 AI Orchestration carve-out (PR #17) + triple-gated enforcement so the feature's reliance on the amendment is recorded on the gate. - tasks.md: Slice G entries (T055–T058, T060) marked complete with evidence notes. T059 (live webhook smoke test) deferred to the final PR description per scope — cannot be scripted here. Quality gate (T058): `bun run check` green — 0 lint errors, 83 pre-existing warnings, prettier clean, 34/34 isolated test files pass. Security-critical modules at ≥92% line coverage (T060). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
🎉 This PR is included in version 1.1.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
src/ai/llm-client.tsadaptor using the raw Anthropic or Bedrock SDKs.@anthropic-ai/claude-agent-sdk.Why this is a standalone PR
Per §Amendment Procedure, constitution changes must land as their own PR — not bundled with feature work — so reviewers can evaluate the governance change without feature-code distraction. This unblocks Phase 4 / US2 of the triage-dispatch-modes feature, whose
src/ai/llm-client.tspath would otherwise violate the prior blanket "direct LLM calls forbidden" rule.The triage call is a single-turn, no-tool classification; the prior ban was intended to prevent agent-loop bypasses, not pure inference. The carve-out is guarded by the circuit-breaker, latency, and cost requirements in FR-020 / SC-003 / SC-005 of the feature spec — referenced inline in the amended bullet so future readers can see the reference pattern.
Test plan
git diff --stat main...HEAD— exactly 1 file changed (.specify/memory/constitution.md, +36 / -3)**Version**: 1.2.1 | **Ratified**: 2026-04-09 | **Last Amended**: 2026-04-15🤖 Generated with Claude Code
Summary by CodeRabbit