|
| 1 | +# focus-model Specification |
| 2 | + |
| 3 | +## Purpose |
| 4 | +TBD - created by archiving change integrate-resource-browsers. Update Purpose after archive. |
| 5 | +## Requirements |
| 6 | +### Requirement: Focus data structure |
| 7 | + |
| 8 | +The system SHALL represent a "focus" as a hierarchical structure of profiles → regions → services → resource types → ARNs. A focus SHALL carry a `version` string and a list of profiles; each profile SHALL have an `id` and a list of regions; each region SHALL have an `id` and a list of services; each service SHALL have an `id` and a list of resource types; each resource type SHALL have an `id` and a list of ARN strings. The structure SHALL be validated against a schema before use. |
| 9 | + |
| 10 | +#### Scenario: Valid focus is accepted |
| 11 | + |
| 12 | +- **WHEN** a focus object matching the schema (version, profiles, regions, services, resource types, arns) is parsed |
| 13 | +- **THEN** parsing succeeds and the typed focus object is returned |
| 14 | + |
| 15 | +#### Scenario: Malformed focus is rejected |
| 16 | + |
| 17 | +- **WHEN** a focus object missing required fields or with mistyped fields is parsed |
| 18 | +- **THEN** parsing fails with a descriptive validation error and no focus is returned |
| 19 | + |
| 20 | +### Requirement: Wildcard and default selectors |
| 21 | + |
| 22 | +The system SHALL support wildcard (`*`) selectors for profiles, regions, services, resource types, and ARNs, and a `default` selector for regions. A wildcard at a level SHALL mean "expand dynamically to all available items at that level when rendered"; a `default` region SHALL mean "the profile's configured default region". Non-wildcard ids SHALL be used literally. |
| 23 | + |
| 24 | +#### Scenario: Wildcard service expands to all supported services |
| 25 | + |
| 26 | +- **WHEN** a region's services list contains exactly one service with id `*` |
| 27 | +- **THEN** consumers SHALL expand it to every supported service provider, each with wildcard resource types and ARNs |
| 28 | + |
| 29 | +#### Scenario: Default region resolves to the profile's configured region |
| 30 | + |
| 31 | +- **WHEN** a profile's regions list contains exactly one region with id `default` |
| 32 | +- **THEN** consumers SHALL resolve it to the region configured for that profile, or surface an error if none is configured |
| 33 | + |
| 34 | +#### Scenario: Wildcard ARN triggers live listing |
| 35 | + |
| 36 | +- **WHEN** a resource type's arns list is exactly `["*"]` |
| 37 | +- **THEN** consumers SHALL list the actual ARNs from the platform rather than using literal values |
| 38 | + |
| 39 | +### Requirement: Merging multiple focuses |
| 40 | + |
| 41 | +The system SHALL merge a set of selected focuses into a single focus such that the union of all selected profiles/regions/services/resource types/ARNs is represented, with duplicate ids collapsed and child lists combined. Merging an empty set SHALL yield no focus. |
| 42 | + |
| 43 | +#### Scenario: Two focuses on the same profile and region are unioned |
| 44 | + |
| 45 | +- **WHEN** two focuses each select the same profile and region but different services are merged |
| 46 | +- **THEN** the result contains that single profile and region with both services present |
| 47 | + |
| 48 | +#### Scenario: Merging an empty selection yields nothing |
| 49 | + |
| 50 | +- **WHEN** an empty set of focuses is merged |
| 51 | +- **THEN** the result is undefined and the Resources view shows its empty-state placeholder |
| 52 | + |
0 commit comments