Skip to content
Registry StackDocsDevelopment (unreleased)

Staff the directory

View as Markdown

A ReviewTask waits in a queue until someone eligible picks it up. Which people that is lives in the directory, not in the policy. You continue in tutorial-work/casework, with the development session you restarted in Author a Casework policy still running.

The policy declares the queues and, for each team it names, the profiles its members and supervisors must hold. The directory is runtime state: each team’s staff and supervisors, as an issuer and a subject, and the queues the team serves, under one directory revision. A person reaches a queue’s tasks only as a member of a team that serves it, while holding a profile that may decide the stage. Changing who is in a team needs no new package.

Only an access profile with the administrator role may read or change the directory.

The session seeded its directory from dev-clients.yaml, as its administrator client, on its first start:

dev-clients.yaml
directory:
- team: decisions-team
queue: decisions
staff: [staff]
supervisors: [supervisor]

Each entry names one team and the one declared queue it serves, with at most eight teams. Its staff must be clients bound to a staff profile and its supervisors clients bound to a supervisor profile. caseworkctl check refuses a file that leaves a declared queue with no team (casework.dev-clients.unserved-queue) or that has no administrator client to seed it.

A deployment names people by issuer and subject. Show the subject the session’s staff client signs in as:

Terminal window
caseworkctl dev identity staff
{"clientId": "staff", "subject": "17e79057-d468-701e-845e-a94875c37bd4"}

Read it as the administrator to confirm every queue has a team:

Terminal window
caseworkctl dev token administrator
curl --fail-with-body --silent --show-error \
--header @.casework/dev/secrets/administrator.header \
http://127.0.0.1:8092/v1/directory | jq .
{"revision": 1}
{"id": "decisions-team", "servedQueues": ["decisions"]}

A deployment has no dev-clients.yaml. Its first administrator creates the first team with one call, naming directory revision 0 and an idempotency key so a retry cannot create it twice:

Terminal window
curl --fail-with-body --silent --show-error --request POST \
--header @administrator.header \
--header 'If-Match: "0"' \
--header 'Idempotency-Key: directory-bootstrap-1' \
--header 'Content-Type: application/json' \
--data '{"teamId": "decisions-team", "queueId": "decisions",
"staff": [{"issuer": "https://identity.example.test/realms/registry", "subject": "<staff subject>"}],
"supervisors": [{"issuer": "https://identity.example.test/realms/registry", "subject": "<supervisor subject>"}]}' \
"$casework_url/v1/directory/bootstrap"

Casework refuses a queue the active package does not declare. Later changes go through PUT /v1/directory/teams/{teamId} with the team’s staff, supervisors and servedQueues, each under the directory revision you last read, so two administrators cannot overwrite each other. The Casework API reference lists every directory operation.

Deploy Registry Casework