Skip to content

feat(agent-bff): fork the permission evaluator with a drift gate - #1802

Open
Tonours wants to merge 2 commits into
mainfrom
feature/prd-682-fork-the-forestadmin-client-permission-evaluator-into-the
Open

feat(agent-bff): fork the permission evaluator with a drift gate#1802
Tonours wants to merge 2 commits into
mainfrom
feature/prd-682-fork-the-forestadmin-client-permission-evaluator-into-the

Conversation

@Tonours

@Tonours Tonours commented Aug 4, 2026

Copy link
Copy Markdown
Member

fixes PRD-682

Problem

The BFF needs its own permission evaluator for PRD-683, but the evaluator in forestadmin-client is private. A local fork is required, with a guard against semantic drift.

Fix

  • Fork CRUD and custom-action permission evaluation into agent-bff.
  • Preserve role-based checks, action identifiers, conditions, and the four custom-action events.
  • Add a contract test comparing the fork with forestadmin-client transformations and verdicts.
  • Make the drift gate cover SelfApprove and malformed permission descriptors.
  • Use a typed options object for custom-action checks.

Scope and safety

  • Changes are limited to packages/agent-bff.
  • No change to forestadmin-client.
  • No public export is added.
  • The evaluator is not wired to a route in this PR; PRD-683 will consume it.

How to test

yarn workspace @forestadmin/forestadmin-client build
yarn workspace @forestadmin/agent-bff test

Verified: 737 tests passing across 56 suites, including a deliberate SelfApprove drift mutation that fails the gate.

Definition of Done

General

  • Write an explicit title for the Pull Request, following Conventional Commits specification
  • Test manually the implemented changes
  • Validate the code quality (indentation, syntax, style, simplicity, readability)

Security

  • Consider the security impact of the changes made

@linear-code

linear-code Bot commented Aug 4, 2026

Copy link
Copy Markdown

PRD-682

@qltysh

qltysh Bot commented Aug 4, 2026

Copy link
Copy Markdown

2 new issues

Tool Category Rule Count
qlty Duplication Found 29 lines of similar code in 2 locations (mass = 130) 1
qlty Structure Function with many parameters (count = 4): canRolePerformCollectionAction 1

@qltysh

qltysh Bot commented Aug 4, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

This PR will not change total coverage.

Modified Files with Diff Coverage (2)

RatingFile% DiffUncovered Line #s
New Coverage rating: A
packages/agent-bff/src/permissions/action-identifiers.ts100.0%
New Coverage rating: A
packages/agent-bff/src/permissions/action-permissions.ts100.0%
Total100.0%
馃殾 See full report on Qlty Cloud 禄

馃洘 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@Tonours
Tonours force-pushed the feature/prd-682-fork-the-forestadmin-client-permission-evaluator-into-the branch from 92beb7b to 5a846a5 Compare August 5, 2026 10:21
@Tonours
Tonours force-pushed the feature/prd-682-fork-the-forestadmin-client-permission-evaluator-into-the branch 2 times, most recently from 29c3bb4 to dd27c33 Compare August 6, 2026 13:59
@Tonours
Tonours force-pushed the feature/prd-682-fork-the-forestadmin-client-permission-evaluator-into-the branch from dd27c33 to acd8894 Compare August 6, 2026 15:25
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.

1 participant