You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Area: APIapps/api (NestJS backend, Prisma models, CASL permissions)Area: InstrumentsInstrument authoring API, bundling, runtime, rendering, measures and the built-in libraryArea: SharedCross-tier packages (schemas, react-core, etc.) not covered by another areaArea: Webapps/web (clinician-facing React SPA)Difficulty: HighMore than a day, or touches several workspacesFeatureType: a new capability that does not exist yetNeeds DecisionWell-defined, but blocked on a maintainer decision about direction or designPriority: LowNice to have, cosmetic or speculative
Closing this as stale as part of a backlog cleanup. It has had no activity since it was opened, and a dedicated instrument kind isn't planned. The kinds are still FILE | FORM | INTERACTIVE | SERIES (packages/runtime-core/src/types/instrument.base.ts).
You can already enter schema-validated JSON programmatically. Define a FORM or INTERACTIVE instrument whose validationSchema describes the data, then create records through POST /v1/instrument-records (or bulk through POST /v1/instrument-records/upload). The API checks each payload against the instrument's schema before storing it (apps/api/src/instrument-records/instrument-records.service.ts).
If a kind with no UI at all becomes necessary, feel free to reopen this or file a new issue.
Still a design question on main (d86740e). Here is what a no-UI kind needs and what it is waiting on.
What the workaround is missing
Authoring is nearly free. FormInstrument.Content accepts an array of groups (packages/runtime-core/src/types/instrument.form.ts:289-290), so a FORM with content: [] type-checks and passes $$FormInstrumentContent. The CSV upload reads only validationSchema and internal (apps/web/src/utils/upload.ts:971-985).
The gap is exposure. Nothing marks an instrument as "data arrives from elsewhere", so a field-less FORM is still offered by Administer Instrument and both remote-assignment pickers (selectAdministrableInstruments, apps/web/src/utils/administrable-instruments.ts:15-25). The API assigns it remotely too: the only instrument checks in apps/api/src/assignments/assignments.service.ts:88 and :279-284 are the group's opt-in list and archival. #1708 is the same gap for FILE. It proposes a per-kind refusal at those two places and in the remote pickers, so a no-UI kind should land after it, join that list, and also be dropped from Administer Instrument.
Options
Document the workaround. No code, and the exposure stays.
A per-group "API only" switch in Manage Group. No runtime-core change, but it turns a property of the instrument into a setting of each group, and the instrument still has a blank UI.
A new scalar kind with no content. This is my recommendation: the instrument says what it is, nothing can render it, and the API can refuse to assign it.
Phase 1: one kind registry
When FILE was added (21695b3), several hand-written kind lists missed it: #1774, #1783, the Kind filter in InstrumentKindDropdown.tsx:21-42 (no File option), the outreach JSON Schema pages (apps/outreach/src/lib/instrument-schemas.ts:9, no file), and SeriesInstrumentRenderer, which shows a FILE item as a blank step. A fifth kind added to the runtime-core types compiles and then fails at runtime:
packages/schemas/src/instrument/instrument.base.ts:28, :237 and :321 list the kinds by hand. satisfies accepts an enum narrower than the type, so tsc stays quiet, and then $InstrumentInfo.array() in apps/web/src/hooks/useInstrumentInfoQuery.ts:28 rejects the whole instrument list.
ScalarInstrumentRenderer.tsx:155 and SeriesInstrumentRenderer.tsx:225 end in .otherwise(() => null), a blank step.
translateInstrument (packages/instrument-utils/src/translate.ts:383-392) throws for a multilingual instrument of any other kind.
InstrumentIcon.tsx:23 logs and returns null. apps/web/src/routes/_app/admin/instruments.tsx:167-171 labels any other kind "Form".
Fix: export a /** @public */INSTRUMENT_KINDS from runtime-core src/constants.ts and derive InstrumentKind from it, as FileInstrument.FileType derives from FILE_TYPES. packages/schemas already imports that module, so $InstrumentKind = z.enum(INSTRUMENT_KINDS), with .exclude(['SERIES']) for the two scalar enums. Make both renderer matches exhaustive. Key the icon, the labels and the Manage Group sections by kind. PR #1807's useInstrumentKindLabels already returns { [K in InstrumentKind]: string }, which also covers part of #1769. #1783 stays a hand fix: the CLI has no link to packages/schemas (cli/AGENTS.md). Most of these steps fix a bug that exists today, so this phase is worth shipping, each step with its own unit and e2e test, even if the new kind never lands.
Phase 2: the kind
runtime-core: a new types/instrument.<kind>.ts with content?: never, added to the unions in instrument.core.ts and to DiscriminatedInstrument in define.ts. This changes the published API, so packages/instrument-guidelines/AGENTS.md and the reference docs change with it, as part of a release.
schemas: a $$<Kind>Instrument, added to $$AnyInstrument (packages/schemas/src/instrument/instrument.core.ts:16-28, which the API parses every uploaded bundle against at instruments.service.ts:102) and to the outreach schema map.
instrument-utils: an is<Kind>Instrument guard and a translate<Kind> branch.
react-core: ScalarInstrumentRenderer shows a translated placeholder for it, which covers a direct /instruments/render/<id> link and the playground preview.
web: exclude it in selectAdministrableInstruments. If the data is form-shaped, also offer it on /upload (apps/web/src/routes/_app/upload/index.tsx:51 asks for FORM only) and in the subject graph (datahub/subjects/$subjectId/graph.tsx:29).
Unit tests: define.test-d.ts (it infers and rejects content), a new instrument.<kind>.test.ts in packages/schemas, translate.test.ts, ScalarInstrumentRenderer.test.tsx (the placeholder), assignments.service.test.ts and instruments.service.test.ts (the refusals), instrument-records.service.test.ts (create and upload still work), and administrable-instruments.test.ts. E2E: seed a built-in example through apps/api/src/demo/demo.service.ts as FILE did. In datahub.spec.ts, send records with api.uploadRecords and check that they show. In accessible-instruments.spec.ts and remote-assignment.spec.ts, check that it is not offered and that POST /v1/assignments for it returns 422.
Open questions
The name. Every stored bundle carries it and runtime-core treats a rename as a breaking change, so it is picked once (EXTERNAL, DATA, HEADLESS?).
The data shape: form data, as the body suggests, which keeps the CSV upload and the graph working, or any JSON, like INTERACTIVE?
Credentials. Today a sending system logs in with a user's password and gets a 1h token (apps/api/src/auth/auth.service.ts:82-85), and odc-cli has no command to create or upload records. Is a long-lived token scoped to create InstrumentRecord part of this issue, or a separate one?
Triage note written with Claude Code. Code references point at main @ d86740e.
Area: APIapps/api (NestJS backend, Prisma models, CASL permissions)Area: InstrumentsInstrument authoring API, bundling, runtime, rendering, measures and the built-in libraryArea: SharedCross-tier packages (schemas, react-core, etc.) not covered by another areaArea: Webapps/web (clinician-facing React SPA)Difficulty: HighMore than a day, or touches several workspacesFeatureType: a new capability that does not exist yetNeeds DecisionWell-defined, but blocked on a maintainer decision about direction or designPriority: LowNice to have, cosmetic or speculative
Activity
joshunrau commentedon Sep 27, 2026
Closing this as stale as part of a backlog cleanup. It has had no activity since it was opened, and a dedicated instrument kind isn't planned. The kinds are still
FILE | FORM | INTERACTIVE | SERIES(packages/runtime-core/src/types/instrument.base.ts).You can already enter schema-validated JSON programmatically. Define a FORM or INTERACTIVE instrument whose
validationSchemadescribes the data, then create records throughPOST /v1/instrument-records(or bulk throughPOST /v1/instrument-records/upload). The API checks each payload against the instrument's schema before storing it (apps/api/src/instrument-records/instrument-records.service.ts).If a kind with no UI at all becomes necessary, feel free to reopen this or file a new issue.
gdevenyi commentedon Sep 27, 2026
Keeping this open for "no UI instrument"
joshunrau commentedon Oct 26, 2026
Still a design question on
main(d86740e). Here is what a no-UI kind needs and what it is waiting on.What the workaround is missing
Authoring is nearly free.
FormInstrument.Contentaccepts an array of groups (packages/runtime-core/src/types/instrument.form.ts:289-290), so a FORM withcontent: []type-checks and passes$$FormInstrumentContent. The CSV upload reads onlyvalidationSchemaandinternal(apps/web/src/utils/upload.ts:971-985).The gap is exposure. Nothing marks an instrument as "data arrives from elsewhere", so a field-less FORM is still offered by Administer Instrument and both remote-assignment pickers (
selectAdministrableInstruments,apps/web/src/utils/administrable-instruments.ts:15-25). The API assigns it remotely too: the only instrument checks inapps/api/src/assignments/assignments.service.ts:88and:279-284are the group's opt-in list and archival. #1708 is the same gap for FILE. It proposes a per-kind refusal at those two places and in the remote pickers, so a no-UI kind should land after it, join that list, and also be dropped from Administer Instrument.Options
content. This is my recommendation: the instrument says what it is, nothing can render it, and the API can refuse to assign it.Phase 1: one kind registry
When FILE was added (21695b3), several hand-written kind lists missed it: #1774, #1783, the Kind filter in
InstrumentKindDropdown.tsx:21-42(no File option), the outreach JSON Schema pages (apps/outreach/src/lib/instrument-schemas.ts:9, nofile), andSeriesInstrumentRenderer, which shows a FILE item as a blank step. A fifth kind added to the runtime-core types compiles and then fails at runtime:packages/schemas/src/instrument/instrument.base.ts:28,:237and:321list the kinds by hand.satisfiesaccepts an enum narrower than the type, so tsc stays quiet, and then$InstrumentInfo.array()inapps/web/src/hooks/useInstrumentInfoQuery.ts:28rejects the whole instrument list.ScalarInstrumentRenderer.tsx:155andSeriesInstrumentRenderer.tsx:225end in.otherwise(() => null), a blank step.translateInstrument(packages/instrument-utils/src/translate.ts:383-392) throws for a multilingual instrument of any other kind.InstrumentIcon.tsx:23logs and returns null.apps/web/src/routes/_app/admin/instruments.tsx:167-171labels any other kind "Form".Fix: export a
/** @public */INSTRUMENT_KINDSfrom runtime-coresrc/constants.tsand deriveInstrumentKindfrom it, asFileInstrument.FileTypederives fromFILE_TYPES.packages/schemasalready imports that module, so$InstrumentKind = z.enum(INSTRUMENT_KINDS), with.exclude(['SERIES'])for the two scalar enums. Make both renderer matches exhaustive. Key the icon, the labels and the Manage Group sections by kind. PR #1807'suseInstrumentKindLabelsalready returns{ [K in InstrumentKind]: string }, which also covers part of #1769. #1783 stays a hand fix: the CLI has no link topackages/schemas(cli/AGENTS.md). Most of these steps fix a bug that exists today, so this phase is worth shipping, each step with its own unit and e2e test, even if the new kind never lands.Phase 2: the kind
types/instrument.<kind>.tswithcontent?: never, added to the unions ininstrument.core.tsand toDiscriminatedInstrumentindefine.ts. This changes the published API, sopackages/instrument-guidelines/AGENTS.mdand the reference docs change with it, as part of a release.$$<Kind>Instrument, added to$$AnyInstrument(packages/schemas/src/instrument/instrument.core.ts:16-28, which the API parses every uploaded bundle against atinstruments.service.ts:102) and to the outreach schema map.is<Kind>Instrumentguard and atranslate<Kind>branch.ScalarInstrumentRenderershows a translated placeholder for it, which covers a direct/instruments/render/<id>link and the playground preview.selectAdministrableInstruments. If the data is form-shaped, also offer it on/upload(apps/web/src/routes/_app/upload/index.tsx:51asks for FORM only) and in the subject graph (datahub/subjects/$subjectId/graph.tsx:29).validateSeriesInstrument(apps/api/src/instruments/instruments.service.ts:799), which checks that the items exist but not what kind they are.Unit tests:
define.test-d.ts(it infers and rejectscontent), a newinstrument.<kind>.test.tsinpackages/schemas,translate.test.ts,ScalarInstrumentRenderer.test.tsx(the placeholder),assignments.service.test.tsandinstruments.service.test.ts(the refusals),instrument-records.service.test.ts(create and upload still work), andadministrable-instruments.test.ts. E2E: seed a built-in example throughapps/api/src/demo/demo.service.tsas FILE did. Indatahub.spec.ts, send records withapi.uploadRecordsand check that they show. Inaccessible-instruments.spec.tsandremote-assignment.spec.ts, check that it is not offered and thatPOST /v1/assignmentsfor it returns 422.Open questions
EXTERNAL,DATA,HEADLESS?).apps/api/src/auth/auth.service.ts:82-85), andodc-clihas no command to create or upload records. Is a long-lived token scoped tocreate InstrumentRecordpart of this issue, or a separate one?Triage note written with Claude Code. Code references point at
main@d86740e.