Skip to main content

Action Inventory - Gap Analysis

This document lists the gaps identified during the exhaustive review of the codebase, comparing existing behaviors against the proposed v1 api-response-contract.md.


1. New ActionSpec Types Required

The following scenarios are not cleanly covered by the proposed v1 Action Registry and may require new, specific action types to be added.

ScenarioImplied UI ActionProposed New ActionSpec TypeNotes
Duplicate ResourceA POST request fails because an identical resource already exists (e.g., creating a duplicate assignment for the same user).VIEW_EXISTING_RESOURCEThe UI needs to direct the user to the existing resource. An alternative is extending the GO_TO_DASHBOARD payload to include a highlight_id.
Legal Hold BlockA POST /compliance/forget request is blocked because the target user is under a legal hold.VIEW_LEGAL_HOLDThe UI should ideally direct the admin to the part of the Compliance Centre where the legal hold can be reviewed or lifted.
Already EnrolledA user tries to enroll in a programme they are already enrolled in.VIEW_ENROLMENTA simple "already enrolled" message is okay, but a better UX would be to navigate the user to their existing enrolment status page.
Generic Server ErrorA 500 Internal Server Error occurs due to an unhandled exception or panic.SHOW_FATAL_ERRORThe v1 registry lacks a generic action for when the only "next step" is to show a support reference ID and ask the user to try again later.

2. Required Payload Extensions for Existing v1 Actions

Some existing behaviors can be mapped to the v1 registry, but require extending the action's payload to be fully effective.

ActionSpec TypeRequired Payload ExtensionScenario / Reason
REQUEST_ACCESSresource_type: string?, resource_id: string?The current payload only includes the missing capability. Adding the specific resource the user was trying to access provides more context for an admin who might grant the permission.

3. Gaps in Code Implementation

This is a behavior defined in the v1 contract that is not yet fully implemented in the code.

ActionSpec TypeMissing BehaviorCurrent Behavior
CREATE_NEW_VERSIONAttempts to PATCH a published, immutable resource (like an Evaluation Version) should be rejected with a 409 Conflict and this ActionSpec.It is not clear from the current handler code (evaluation_versions.go) that this specific 409 Conflict with a structured error is being returned. The logic to block the edit likely exists, but it may be returning a generic error.