Skip to content

feat(agents): scope friction reporting capability#1298

Merged
aaight merged 2 commits into
devfrom
feature/friction-capability-scope
May 9, 2026
Merged

feat(agents): scope friction reporting capability#1298
aaight merged 2 commits into
devfrom
feature/friction-capability-scope

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented May 9, 2026

Summary

Adds a dedicated PM-backed pm:friction capability so agents can receive ReportFriction without inheriting broad PM write access.

Card: https://trello.com/c/69ff6ab3af064ec1d268eabd

Changes

  • Registered pm:friction and moved ReportFriction out of pm:write.
  • Resolved effective capabilities before native tool manifest exposure and native capability propagation.
  • Added central friction-reporting prompt guidance that is appended only when pm:friction is effective.
  • Added pm:friction as required for PM-required agent profiles and optional for SCM/alerting profiles with optional PM.
  • Updated architecture docs to reflect the new capability boundary.
  • Added unit coverage for capability filtering, gadget/tool availability, profile resolution, and guidance gating.

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.ts
  • npx vitest run --project unit-backends tests/unit/backends/adapter.test.ts tests/unit/backends/secretOrchestrator.test.ts
  • npx vitest run --project unit-core tests/unit/architecture-docs.test.ts tests/unit/repo-hygiene.test.ts
  • npm run lint
  • npm run typecheck
  • npm test
  • npm run test:integration

Note: npm run lint exits 0 but reports existing warnings in unrelated tests (tests/unit/backends/postProcess.test.ts and tests/unit/gadgets/github/core/createPR.test.ts).

🕵️ codex · gpt-5.5 · run details

@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:21debug declares integrations.optional: [pm], and integration-validation tests pin that PM is not required for this profile. Because buildExecutionPlan now resolves effective capabilities from profile.capabilities.required, putting pm:friction under required bypasses the PM integration checker. A debug run on a project without PM still gets ReportFriction in availableTools and 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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@aaight aaight merged commit 249079a into dev May 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants