Skip to content

feat(agentic-engineering)!: require explicit spend enablement - #204

Merged
devantler merged 1 commit into
mainfrom
codex/spend-enablement-93
Sep 6, 2026
Merged

feat(agentic-engineering)!: require explicit spend enablement#204
devantler merged 1 commit into
mainfrom
codex/spend-enablement-93

Conversation

@devantler

Copy link
Copy Markdown
Contributor

🤖 Generated by the Agentic Engineer

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 as false. 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.

Ship a required default-off boolean, bind onboarding and dispatch to the same effective desired state, and preserve all Spend contract prerequisites.
@devantler

Copy link
Copy Markdown
Contributor Author

🤖 Generated by the Agentic Engineer

@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.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown
🧩 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/**' || true

Length 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.json

Length 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
done

Length of output: 15062


@devantler Reviewed commit 20162666aac8ad44d5649e551de07b28dccdb745.

No findings.

The desired state ships spendStewardshipEnabled: false. The validator requires a boolean field. The regression cases cover both boolean values, omission, and malformed values.

The entrypoint requires literal true and a resolving Spend contract. It fails closed for absent, unreadable, invalid, missing, and malformed enablement states. It also freezes the selected source and value for each run.

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 5.0.0. Changed JSON files parse, and git diff --check reports no whitespace errors.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: e7583bc1-dd61-4a8b-b13e-1ad81c68a4dc

📥 Commits

Reviewing files that changed from the base of the PR and between ec99f9e and 2016266.

📒 Files selected for processing (11)
  • .claude-plugin/marketplace.json
  • .github/plugin/marketplace.json
  • docs/adr/0007-explicit-spend-enablement.md
  • docs/resources.md
  • plugins/agentic-engineering/.claude-plugin/plugin.json
  • plugins/agentic-engineering/README.md
  • plugins/agentic-engineering/agents/agentic-engineer.agent.md
  • plugins/agentic-engineering/plugin.json
  • plugins/agentic-engineering/resources/provider-neutral.desired-state.json
  • scripts/validate-manifests.sh
  • scripts/validate-manifests.test.sh

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:

  • .claude-plugin/marketplace.json
  • .github/plugin/marketplace.json
README and manifests stay in lockstep.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • .claude-plugin/marketplace.json
  • .github/plugin/marketplace.json
🧠 Learnings (1)
📚 Learning: 2026-07-25T12:40:46.973Z
Learnt from: devantler
Repo: devantler-tech/agent-plugins PR: 89
File: plugins/agentic-engineering/skills/portfolio-maintenance/SKILL.md:0-0
Timestamp: 2026-07-25T12:40:46.973Z
Learning: During code review in this repo: (1) For `plugins/agentic-engineering/agents/*.agent.md` (local agent-entrypoints), do NOT require upstream provenance frontmatter—assume these are authored locally; renames/edits to agent-entrypoints should remain local and not be forced through the upstream sync process. (2) For bundled skill artifacts at `plugins/*/skills/*/SKILL.md`, expect upstream provenance frontmatter to be present; do not make direct “local” edits for skill content—skill changes must originate from the upstream source and be brought in via the repo’s sync workflow.

Applied to files:

  • plugins/agentic-engineering/agents/agentic-engineer.agent.md
🔇 Additional comments (11)
docs/adr/0007-explicit-spend-enablement.md (1)

1-36: LGTM!

plugins/agentic-engineering/agents/agentic-engineer.agent.md (1)

15-15: LGTM!

Also applies to: 51-51, 167-169

plugins/agentic-engineering/README.md (1)

21-22: LGTM!

Also applies to: 24-50, 93-94, 115-118, 133-134, 209-214

docs/resources.md (1)

15-16: LGTM!

Also applies to: 24-26, 107-109

.claude-plugin/marketplace.json (1)

30-30: LGTM!

.github/plugin/marketplace.json (1)

30-30: LGTM!

plugins/agentic-engineering/resources/provider-neutral.desired-state.json (1)

30-30: LGTM!

Also applies to: 58-58, 83-83, 116-116

scripts/validate-manifests.sh (1)

456-458: LGTM!

Also applies to: 863-864, 946-958, 1248-1257

scripts/validate-manifests.test.sh (1)

629-629: LGTM!

Also applies to: 754-754, 779-779, 812-812, 1294-1344

plugins/agentic-engineering/plugin.json (1)

4-4: LGTM!

plugins/agentic-engineering/.claude-plugin/plugin.json (1)

4-4: LGTM!


📝 Walkthrough

Walkthrough

Version 5 introduces explicit, default-off spend stewardship. The desired-state manifest adds spendStewardshipEnabled, and scheduler and onboarding instructions consume the effective value. Spend requires literal true and a resolving Spend contract. Missing or invalid configuration disables spend while normal engineering work continues. Documentation and agent instructions describe the migration. Manifest validation and self-tests enforce the schema, contract text, boolean values, and required references. Plugin version metadata is updated to 5.0.0.

Merge Risk: ⚪ Minimal · up to 20162

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)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (9 skipped: 9 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the primary breaking change: explicit spend enablement for the agentic-engineering plugin.
Description check ✅ Passed The description directly explains the explicit opt-in requirement, fail-closed behavior, version 5 migration, validation, and related changes.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devantler
devantler marked this pull request as ready for review September 6, 2026 15:31
@devantler
devantler merged commit bb19a27 into main Sep 6, 2026
41 checks passed
@devantler
devantler deleted the codex/spend-enablement-93 branch September 6, 2026 15:31
@github-project-automation github-project-automation Bot moved this from 🫴 Ready to ✅ Done in 🌊 Project Board Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

1 participant