Document direct access to listed extension projects
This commit is contained in:
@@ -45,27 +45,29 @@ An acknowledged atomic batch is removed from the local journal immediately. The
|
||||
preferences, recovery drafts, conflict sidecars, and resumable migration
|
||||
journals.
|
||||
|
||||
## 20.2 Project identity is not project storage
|
||||
## 20.2 ISA project storage and grants
|
||||
|
||||
There are two valid project identity models:
|
||||
Dashboard-backed projects use real writable `<name>.isap` folders under a group’s shared Projects container. `project.json` is the version 1 basic metadata manifest; `extensions/<extension-id>/` organizes extension data and `assets/` contains media. Namespace names are not permission boundaries: a project read-write grant covers supported data throughout the selected project. Preserve unknown files and extension data.
|
||||
|
||||
1. A dashboard Shared Project Registry ID from `projects_list`,
|
||||
`projects_create`, and `projects_set_archived`. Use this when project identity
|
||||
must be shared across extensions.
|
||||
2. An extension-owned project ID stored in the canonical project document. ISA
|
||||
Quote uses this model.
|
||||
`projects_list` returns currently available project metadata and canonical folder identities. `projects_create` requires a stable `operationId`, creates the manifest and folder atomically, and grants the creating extension access. Extensions with `projects_open_listed`, `projects_read` and `filesystem_read` permissions can obtain a folder grant directly by resolving an active project ID in the launch group. Remembered grants are bound to account, workspace, immutable launch group, extension package and folder, and are revalidated on use. `projects_set_group_link` changes explicit group availability with current management authorization in both groups; it never copies the project.
|
||||
|
||||
Registry records contain group-scoped identity and lifecycle metadata only.
|
||||
Their system-owned registry folders are not writable project storage or sync
|
||||
roots. When an extension uses a registry project, it stores that ID as a
|
||||
foreign key in its own canonical files.
|
||||
The Projects container itself has no inheritable group folder link. Each project has direct group links, allowing another group to use the same persisted folder and KV identities. Unlinking one group preserves the project and other links. The server-owned `isa_project` row identifies the canonical project independently of mutable project files; editing or importing `project.json` cannot create access or publishing authority. Identity-only registry data requires explicit manual cutover rather than automatic migration. New hosts require `isa-project-folders-v1` and do not treat the old registry capability as writable storage.
|
||||
|
||||
In both models, project contents live below the extension's authoritative group
|
||||
folder.
|
||||
Project files use dashboard-confirmed persistence by default. KV stores retain their separate syncable selective-cache/outbox behavior: a validated project parent does not have to enable whole-folder filesystem sync for a KV store to use `syncable: true`. Canonical project stores have no extension owner, and checkpoint authority follows the workspace/project and canonical artifact configuration rather than the original opening extension, user or group.
|
||||
|
||||
Extension conversion and the standalone shared library’s complete transfer/screens remain release integration requirements. Group supplier catalogs and explicitly group-scoped resources remain outside project namespaces; per-project data belongs inside the selected `.isap`.
|
||||
|
||||
### Project start screen
|
||||
|
||||
Selecting a row opens that project. On hosts advertising `projects_open_listed`, invoke it with the stable `projectId` and use the folder reference returned by the host. On older hosts, reopen the selected folder using its existing grant. If access is unavailable, show the access error on the overview. Read the extension’s saved record after the host grants access.
|
||||
A project-based extension opens on the active group's project overview. ISA Match is the layout reference. Below the extension title and summary counts, put recent activity in the left column and **Projects** (**Projecten**) in the larger right column. Place **+ Create project** (**+ Project maken**) at the top right of the Projects panel, with search, sort and the project rows below. The button opens the setup form where the user enters the project name. On narrow screens, stack Projects above recent activity. Choose fields that help with this extension’s work, such as a planning deadline in ISA Projects or a quote deadline in ISA Match. [Shared UI styling](14-strict-styling-requirements.md)
|
||||
|
||||
Use the shared `@isa-warden/isa-project-format` overview when adding a project extension. Pass the host’s `projects.commands` to `createProjectClient` as `projectCommands`. Mount `ProjectWorkspace` with `extensionName`, the host locale and that client. A custom home can use the same `client.list()` and `client.openListed(row)` API. Keep earlier private records accessible through a separate history view when introducing shared storage. ISA Host Test Center uses this approach for private rounds, and writes new rounds only inside the selected project. Workspace-wide reference tools such as ISA Prijzenregister can open their register directly.
|
||||
|
||||
On launch, call `projects_list` with `{}` and render every returned active project, including projects created by another extension that this extension has never opened. Use the returned project ID to join any known extension details and to identify each row. Personal recents may provide shortcuts. If the extension offers an archive view, load it separately with `includeArchived: true` and filter on `archived`.
|
||||
|
||||
Refresh the inventory when the overview regains focus. Show the empty state after a successful empty response. If a refresh fails, show the error and retain the last successful list for that launch group.
|
||||
|
||||
Selecting a row opens that project. Invoke `projects_open_listed` with its stable `projectId` and use the folder reference returned by the host. On older hosts, reopen the selected folder using its existing grant. If access is unavailable, show the access error on the overview. Read the extension’s saved record after the host grants access.
|
||||
|
||||
| Result of reading the extension record | What the user sees |
|
||||
| --- | --- |
|
||||
@@ -80,49 +82,35 @@ Use `projects_create` when the user explicitly creates a shared project, reusing
|
||||
|
||||
## 20.3 Capability and root discovery
|
||||
|
||||
An extension using dashboard-backed project files must:
|
||||
Read `get_app_info().projects.commands` for the captured launch. Request `projects_read` to list the group's projects and `projects_write` for project creation or lifecycle actions. Check each command before enabling its action. Request the filesystem or KV permissions needed to read and save this extension’s project data.
|
||||
|
||||
- request `get_app_info`, `filesystem_read`, and `filesystem_write`;
|
||||
- request `filesystem_delete` only when its lifecycle deletes shared files;
|
||||
- request `projects_read` or `projects_write` only when it uses the Shared
|
||||
Project Registry;
|
||||
- check the advertised filesystem commands before enabling shared writes;
|
||||
- call `filesystem_ensure_group_folder` once per mounted launch before reading
|
||||
or writing canonical data;
|
||||
- use the returned path exactly and never derive a path from a mutable group
|
||||
name; and
|
||||
- keep all access in the immutable workspace, group, and extension scope
|
||||
supplied by the host.
|
||||
|
||||
A cached root may be used as an offline read fallback, keyed by immutable launch
|
||||
scope. It must not suppress authoritative root discovery on a later online
|
||||
launch. Calling the ensure command also registers the current root with the
|
||||
host event bridge.
|
||||
|
||||
First-time group-folder provisioning is online-only.
|
||||
Use the project path returned by the host after opening or creating the shared project. For extension-owned group data, `filesystem_ensure_group_folder` returns the current extension’s group root. For datasets shared across extensions in an ordinary workspace folder, use the same authorised folder and dataset identity in every viewer.
|
||||
|
||||
### Dedicated viewers for shared datasets
|
||||
|
||||
Use the workspace folder `/shared` as the default location for cross-extension datasets. The dashboard provisions it during S3 setup. On an older S3 workspace, a storage-enabled group's host picker can create the missing folder on first use. To bind a viewer, call `open_workspace_folder({ accessPolicy: 'read-only' })`, select `/shared`, and save the returned folder ID and path for this workspace and group. An editor requests editable access. On subsequent launches, open the saved dataset directly while the grant is valid. Keep an existing register's configured folder when upgrading.
|
||||
|
||||
One extension can specialise in suppliers and another in the price book. Other extensions, including ISA Match, can display those same sources through their own host access. A dedicated viewer opens its dataset directly when its configured folder is accessible. Keep the format independent of the viewer ID. Loading a viewer reads the canonical source without copying it or initialising a fresh store. Report denied access or a missing source separately from an empty dataset.
|
||||
|
||||
Use `createSharedFolderReader` from `@isa-warden/isa-project-format/shared-folder` for relative file, JSON and consistent KV reads. ISA Match’s shared register identifies suppliers in `isa-match-suppliers.json`. Its register ID selects `isa-match-catalog-<id>.kv` for detailed supplier data and `isa-match-prices-<id>.kv` for its price book. Encode the ID as a path component. Each consuming extension retains its own host grant to that folder. For a dataset inside an open `.isap`, use its captured project grant.
|
||||
|
||||
A cached extension group folder can support offline reads for the same launch scope. Repeat authoritative root discovery on a later online launch. The ensure command also registers the current group folder with the host event bridge.
|
||||
|
||||
First-time group-folder provisioning is online-only.
|
||||
|
||||
## 20.4 Canonical layout
|
||||
|
||||
Each extension documents one deterministic layout. New extensions should use:
|
||||
Project extensions use the selected host-granted project path and document their own schema within it:
|
||||
|
||||
```text
|
||||
<extension-root>/
|
||||
projects/<project-id>/
|
||||
<project-path>.isap/
|
||||
project.json
|
||||
extensions/<extension-id>/
|
||||
project-state/current.json
|
||||
assets/<immutable-id>-<sha256>.<ext>
|
||||
assets/<immutable-id>-<sha256>.<ext>
|
||||
```
|
||||
|
||||
Existing schemas may retain another documented layout. For example, ISA Scribe
|
||||
uses `meetings/<meeting-id>/project.json`.
|
||||
|
||||
The mutable project document is the commit point. Immutable transcripts,
|
||||
sources, exports, and other assets are uploaded before it. An optional manifest
|
||||
or aggregate index is a derived accelerator only; canonical inventory must be
|
||||
able to repair it.
|
||||
Immutable sources, media and exports are uploaded before the extension’s mutable commit document. Optional aggregate indexes are derived accelerators; canonical inventory must be sufficient to repair them. The root manifest contains basic project identity/metadata, while ISA Projects owns planning and detailed overview data. Group-only catalogs remain in the extension group folder.
|
||||
|
||||
For ISA Quote acceptance, `projects/<project-id>/workflow/award/current.json` is the only canonical commit point. `workflow/export-state/current.json` and the workspace file manifest are derived state: failure to update either one queues repair but does not roll back or invalidate a successfully committed award. Repeated writes use one stable operation ID. Every mutation must use the authoritative award entry on which the UI state was based as its CAS base; an internal fresh read may validate that base but must never silently rebase a stale full-document mutation. A remote CAS conflict is resolved by loading the newest award instead of issuing a compensating write. Manifest repair rereads the current canonical award and only repairs its index entry. Export repair is tied to the committed award revision and is discarded when that award has already been superseded.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user