Skip to main content

ADR-0163: One dedicated test per portal screen and a manifest based plugin builder

Context​

The A4 and B5 spaces and screens existed, but many had no test of their own: the global api-conformance.test.ts checks every request of the portal without telling which screen sends it, nor whether its labels, states and navigation are right. Plugin Studio (A4.2) and Plugin Builder (B5.2) were limited to the catalogue (install, uninstall, status).

Decision​

  • Each screen cited by the A4 and B5 conformance has a dedicated test in portal/tests/screens-spaces.test.ts. The test reads the code of the screen: the configurations it renders go through checkResource (routes, bodies, roles, confirmations, empty state); the client calls written in its body must be exactly those the test lists, and each one is replayed against the documented request surface; every literal label exists in English and French; a screen that queries the API shows a loading and an error state; no button is without an action; the navigation section is open to the server roles.
  • The plugin builder (studio/plugins) authors a Plugin manifest in the studio editor, validates it against contracts/v1 (POST /v1/contracts/plugin-manifest/validate) and registers it (POST /v1/plugins): the registry verifies the signature of the OCI artefact. The pack itself is scaffolded and signed in code (eai create plugin, CI), never in the browser: no signing key goes there.
  • security_officer sees the studio section: it writes the OPA policies (POLICY_WRITERS) and reads the other studios; the server stays the authority.

Consequences​

A screen that changes its calls, loses a label or adds a button without an action fails its own test. The conformance items cite one test per screen.

Evidence​

portal/tests/screens-spaces.test.ts, portal/tests/studio.test.ts, portal/tests/nav-access.test.ts.