Files
cleveragents-core/features/resource_handler_project_access_1444.feature
T
HAL9000 fa0065593b fix(resource): implement AccessProjection return type on ResourceHandler.project_access
Implements the spec-required AccessProjection type with fields access_path,
protocol, crosses_sandbox, and read_richness per docs/specification.md lines 
25100-25114. Updates ResourceHandler.project_access to accept the spec-required
parameters (binding_resource, target_resource, containment_path, sandbox) and
return AccessProjection | None per spec lines 21691-21698.

Separates access-control logic into a new check_access method returning 
AccessCheckResult, resolving the semantic confusion between authorization
(check_access) and routing/reachability (project_access).

Updates all concrete handler implementations and test step definitions to use
the new signatures. Adds TDD Behave scenarios tagged @tdd_issue @tdd_issue_1444
verifying the spec-required fields and method signatures.

ISSUES CLOSED: #1444
Epic-Reference: #398
2026-06-15 06:57:28 -04:00

55 lines
3.1 KiB
Gherkin

Feature: TDD issue #1444 — AccessProjection return type on ResourceHandler.project_access
Verifies that ResourceHandler.project_access returns an AccessProjection with the
correct spec-required fields (access_path, protocol, crosses_sandbox, read_richness)
and that the method accepts the spec-required parameters.
Per docs/specification.md lines 21691-21698 and 25100-25114.
@tdd_issue @tdd_issue_1444
Scenario: AccessProjection has spec-required fields
Given tdd1444 the AccessProjection dataclass is imported
Then tdd1444 AccessProjection has field "access_path"
And tdd1444 AccessProjection has field "protocol"
And tdd1444 AccessProjection has field "crosses_sandbox"
And tdd1444 AccessProjection has field "read_richness"
And tdd1444 AccessProjection does not have field "permitted"
And tdd1444 AccessProjection does not have field "principal"
And tdd1444 AccessProjection does not have field "action"
And tdd1444 AccessProjection does not have field "scope"
And tdd1444 AccessProjection does not have field "reason"
@tdd_issue @tdd_issue_1444
Scenario: AccessProjection can be instantiated with spec-required fields
Given tdd1444 the AccessProjection dataclass is imported
When tdd1444 I create an AccessProjection with access_path "src/main.py" protocol "filesystem" crosses_sandbox False read_richness 1
Then tdd1444 the AccessProjection instance has access_path "src/main.py"
And tdd1444 the AccessProjection instance has protocol "filesystem"
And tdd1444 the AccessProjection instance has crosses_sandbox False
And tdd1444 the AccessProjection instance has read_richness 1
@tdd_issue @tdd_issue_1444
Scenario: ResourceHandler.project_access accepts spec-required parameters
Given tdd1444 a base resource handler with a located resource
When tdd1444 I call project_access with binding_resource target_resource containment_path and sandbox None
Then tdd1444 the result is an AccessProjection or None
@tdd_issue @tdd_issue_1444
Scenario: ResourceHandler.project_access returns AccessProjection with filesystem protocol
Given tdd1444 a base resource handler with a located resource
When tdd1444 I call project_access with binding_resource target_resource containment_path and sandbox None
Then tdd1444 the result is an AccessProjection with protocol "filesystem"
And tdd1444 the result has read_richness 1
@tdd_issue @tdd_issue_1444
Scenario: AccessCheckResult has authorization fields separate from AccessProjection
Given tdd1444 the AccessCheckResult dataclass is imported
Then tdd1444 AccessCheckResult has field "permitted"
And tdd1444 AccessCheckResult has field "principal"
And tdd1444 AccessCheckResult has field "action"
And tdd1444 AccessCheckResult has field "scope"
And tdd1444 AccessCheckResult has field "reason"
And tdd1444 AccessCheckResult does not have field "access_path"
And tdd1444 AccessCheckResult does not have field "protocol"
And tdd1444 AccessCheckResult does not have field "crosses_sandbox"
And tdd1444 AccessCheckResult does not have field "read_richness"