feat(agentic-engineering)!: require explicit spend enablement - #204
Conversation
Ship a required default-off boolean, bind onboarding and dispatch to the same effective desired state, and preserve all Spend contract prerequisites.
@coderabbitai review Test-first implementation and independent current-head review are complete. All 202 manifest cases, ShellCheck, actual manifest validation, digest refresh tests and version checks pass. Please review the explicit opt-in and fail-closed semantics, schema states, source selection, and migration contract. Consumers remain disabled by default; this PR does not activate a runtime or edit its cache. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== Repository and commit context =='
git status --short
git rev-parse HEAD
git diff --stat HEAD^ HEAD
git diff --name-status HEAD^ HEAD
echo '== Changed content =='
git diff --find-renames --find-copies --unified=50 HEAD^ HEAD
echo '== Relevant symbols and documents =='
rg -n -i -C 4 \
'spendStewardshipEnabled|spend stewardship|spend.*enable|enable.*spend|effective desired.state|preflight|scheduler|onboarding|ADR 0007|0007' \
. \
-g '!**/.git/**' \
-g '!**/node_modules/**' \
-g '!**/dist/**' || trueLength of output: 240742 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== Repository review instructions =='
sed -n '1,240p' AGENTS.md
echo '== Validator function map =='
ast-grep outline scripts/validate-manifests.sh --items all --type function --view expanded
echo '== Desired-state validation flow =='
sed -n '680,980p' scripts/validate-manifests.sh
sed -n '1160,1270p' scripts/validate-manifests.sh
echo '== Test helpers and relevant new cases =='
sed -n '1,140p' scripts/validate-manifests.test.sh
sed -n '560,850p' scripts/validate-manifests.test.sh
sed -n '1270,1360p' scripts/validate-manifests.test.sh
echo '== Current policy and migration texts =='
sed -n '1,235p' plugins/agentic-engineering/agents/agentic-engineer.agent.md
sed -n '1,235p' plugins/agentic-engineering/README.md
sed -n '1,120p' docs/adr/0007-explicit-spend-enablement.md
echo '== Digest and manifest consistency checks =='
printf 'entrypoint actual: '
sha256sum plugins/agentic-engineering/agents/agentic-engineer.agent.md
printf 'entrypoint declared: '
jq -r '.spec.source.entrypointSha256' plugins/agentic-engineering/resources/provider-neutral.desired-state.json
printf 'versions: '
jq -r '.version' .claude-plugin/marketplace.json \
| head -n 1 >/dev/null
jq -r '.plugins[] | select(.name == "agentic-engineering") | .version' .claude-plugin/marketplace.json
jq -r '.plugins[] | select(.name == "agentic-engineering") | .version' .github/plugin/marketplace.json
jq -r '.version' plugins/agentic-engineering/plugin.json
jq -r '.version' plugins/agentic-engineering/.claude-plugin/plugin.jsonLength of output: 108480 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== Review head =='
git rev-parse HEAD
git diff --check HEAD^ HEAD
echo '== Changed JSON parses =='
for file in \
.claude-plugin/marketplace.json \
.github/plugin/marketplace.json \
plugins/agentic-engineering/.claude-plugin/plugin.json \
plugins/agentic-engineering/plugin.json \
plugins/agentic-engineering/resources/provider-neutral.desired-state.json
do
jq -e . "$file" >/dev/null
printf 'valid JSON: %s\n' "$file"
done
echo '== Exact enabled-state and source-selection statements =='
rg -n -C 2 \
'Only literal `true`|single effective desired-state document|If no effective document is declared|unreadable or invalid declared document|never change the source or value during a run|partial-override merge|spendStewardshipEnabled": false' \
docs/adr/0007-explicit-spend-enablement.md \
plugins/agentic-engineering/README.md \
plugins/agentic-engineering/agents/agentic-engineer.agent.md \
plugins/agentic-engineering/resources/provider-neutral.desired-state.json \
scripts/validate-manifests.sh \
scripts/validate-manifests.test.sh
echo '== Changed-file occurrences of legacy spend activation wording =='
git diff --name-only HEAD^ HEAD | while IFS= read -r file; do
rg -n -i -C 1 \
'enabled only when.*spend contract|spend contract.*enable(s|d).*stewardship|presence.*spend contract.*enable|finops-engineer' \
"$file" || true
doneLength of output: 15062
No findings. The desired state ships The entrypoint requires literal The scheduler pointer, onboarding flow, README migration, and ADR 0007 use the same explicit opt-in contract. The entrypoint digest matches the declared digest. All four plugin manifests use version ✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (11)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details🧰 Additional context used📓 Path-based instructions (2)Any change to the plugin set updates both manifests in the same PR Edit both together.📄 CodeRabbit inference engine (AGENTS.md) Files:
README and manifests stay in lockstep.📄 CodeRabbit inference engine (AGENTS.md) Files:
🧠 Learnings (1)📚 Learning: 2026-07-25T12:40:46.973ZApplied to files:
🔇 Additional comments (11)
📝 WalkthroughWalkthroughVersion 5 introduces explicit, default-off spend stewardship. The desired-state manifest adds Merge Risk: ⚪ Minimal · up to Spend stewardship is now disabled by default and activates only with explicit maintainer opt-in and a resolving Spend contract; configuration errors fail closed while normal engineering continues. The documented migration, manifests, and validation coverage are aligned. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
Why
A complete Spend contract currently enables cost work without a distinct maintainer choice. The desired-state schema has no machine-readable disabled state.
What
Require
spec.roles["agentic-engineer"].spendStewardshipEnabled, shipped asfalse. Only explicit maintainer opt-in plus a resolving Spend contract enables spend analysis and decisions; private-channel, protected-outcomes, and authority requirements still apply. Preflight resolves one declared full effective desired-state document and freezes the source and flag for the run. Onboarding preserves the flag and scheduler pointers consume the same field. Missing or malformed enablement disables spend while ordinary engineering continues.This is a breaking configuration change and bumps all four plugin manifests to 5.0.0. Migration documentation and ADR 0007 explain adoption, including consumers that preserve an exact upstream mirror.
Validation: test-first RED then GREEN; all 202 manifest cases pass, including both boolean states, five malformed types, omission, default-off packaging, and onboarding/dispatch/policy regressions. Actual manifest validation, ShellCheck, digest refresh tests (25 cases), both version test suites, and the version gate pass. Independent review is clean at 2016266 after its findings were fixed.
Implements the upstream acceptance criteria of #93. The consumer gitlink and copied desired-state follow-up follows the merged upstream revision; #93 remains open until that adoption is accounted for.