feat(agents): scope friction reporting capability#1298
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
Requesting changes: ReportFriction is still exposed for the PM-optional debug profile when no PM integration is configured.
Code Issues
Should Fix
- src/agents/definitions/debug.yaml:21 —
debugdeclaresintegrations.optional: [pm], and integration-validation tests pin that PM is not required for this profile. BecausebuildExecutionPlannow resolves effective capabilities fromprofile.capabilities.required, puttingpm:frictionunderrequiredbypasses the PM integration checker. A debug run on a project without PM still getsReportFrictioninavailableToolsand the friction-reporting guidance, which violates the acceptance criterion that guidance/tool exposure happens only when friction reporting is actually available. Move this capability to the optional PM side for debug, or realign all debug PM capabilities with the explicit optional integration model, and update the rollout test to key off explicit integration requirements.
🕵️ codex · gpt-5.5 · run details
| - pm:read | ||
| - pm:write | ||
| - pm:checklist | ||
| - pm:friction |
There was a problem hiding this comment.
debug declares PM as optional at the top of this file, and the integration-validation tests pin that PM is not required for this profile. With pm:friction in capabilities.required, the new effective-capability path in buildExecutionPlan always includes it, so ReportFriction and the friction guidance are exposed even when createIntegrationChecker(project.id) says PM is not configured. This needs to be optional for debug, or the debug PM capability model needs to be realigned, otherwise the guidance/tool gate is not actually tied to friction availability.
There was a problem hiding this comment.
Fixed. The root cause was that debug.yaml had all PM capabilities (pm:read, pm:write, pm:checklist, pm:friction) in capabilities.required despite the explicit integrations.optional: [pm] declaration. Since resolveEffectiveCapabilities always includes required capabilities, this bypassed the PM integration gate entirely.
The fix moves all four PM capabilities to capabilities.optional in debug.yaml, matching the pattern used by review.yaml and other agents that have PM as optional. The loader test for debug was updated from "requires pm only" to "has pm optional" to reflect that deriveIntegrations now correctly derives PM as optional for debug.
With this change, for a debug run on a project without PM configured, resolveEffectiveCapabilities excludes all PM caps → ReportFriction is not in availableTools and friction guidance is not appended. When PM is configured, all four PM capabilities (including pm:friction) are included as expected.
…tion gate `debug` explicitly declares `integrations.optional: [pm]`, so all PM capabilities must live in `capabilities.optional` so that `resolveEffectiveCapabilities` can gate them on PM availability. Previously pm:read/write/checklist and pm:friction were all in `capabilities.required`, which caused `buildExecutionPlan` to unconditionally include `ReportFriction` in `availableTools` and append the friction guidance even on projects with no PM integration. Move all four PM capabilities to `capabilities.optional`, matching the pattern used by `review.yaml` and `respond-to-review.yaml`. Update the loader test to reflect that `deriveIntegrations` now correctly derives PM as optional (not required) for the debug profile. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM - the latest diff scopes ReportFriction to pm:friction, gates optional PM exposure through effective capabilities, and appends the friction guidance only when that capability is available. Focused capability/profile/orchestrator tests pass locally, and PR checks are green.
🕵️ codex · gpt-5.5 · run details
Summary
Adds a dedicated PM-backed
pm:frictioncapability so agents can receiveReportFrictionwithout inheriting broad PM write access.Card: https://trello.com/c/69ff6ab3af064ec1d268eabd
Changes
pm:frictionand movedReportFrictionout ofpm:write.pm:frictionis effective.pm:frictionas required for PM-required agent profiles and optional for SCM/alerting profiles with optional PM.Testing
npx vitest run --project unit-core --project unit-backends tests/unit/agents/capabilities/resolver.test.ts tests/unit/agents/shared/gadgets.test.ts tests/unit/agents/shared/frictionGuidance.test.ts tests/unit/backends/agent-profiles.test.ts tests/unit/backends/secretOrchestrator.test.ts tests/unit/agents/definitions/loader.test.tsnpx vitest run --project unit-backends tests/unit/backends/adapter.test.ts tests/unit/backends/secretOrchestrator.test.tsnpx vitest run --project unit-core tests/unit/architecture-docs.test.ts tests/unit/repo-hygiene.test.tsnpm run lintnpm run typechecknpm testnpm run test:integrationNote:
npm run lintexits 0 but reports existing warnings in unrelated tests (tests/unit/backends/postProcess.test.tsandtests/unit/gadgets/github/core/createPR.test.ts).🕵️ codex · gpt-5.5 · run details