ZDDC/zddc/internal/handler/default-rsk.table.yaml
ZDDC 8b690b782f feat(tables): configurable column option source — dropdown from a live registry
A table column can declare `options_source: <peer>` and the server fills its
`enum` from the live entries under <project>/<peer>/ — so the row editor renders
a dropdown of the current registry instead of free text. Generic + configurable
in the spec; no hardcoding.

- Server (tablehandler.go): resolveDynamicEnums + registryEntries resolve the
  peer directory (its *.yaml basenames + subfolders, sorted, dot/spec entries
  skipped) into the column enum at ServeTable time, before the context inject.
- Default risk register: add a `package` column with `options_source: ssr`
  (dropdown of the project's SSR packages) + the matching form property. The
  spec comment documents the key so operators can source other registries.
- Test covering the resolver (entries, skips, untouched columns).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 15:36:42 -05:00

59 lines
1.7 KiB
YAML

# Default Risk Register spec, served by zddc-server when no
# operator-supplied table.yaml exists at archive/<party>/rsk/.
#
# Columns cover the standard risk-register fields: identifier, title,
# category, likelihood / impact / severity scores, owner, status, and
# due date. Severity is stored on each row (1-25, typically L*I) so
# operators can override it when the simple product doesn't capture
# the actual risk profile.
#
# To customize: drop your own table.yaml + form.yaml into the same
# directory (archive/<party>/rsk/). The whole directory IS the table —
# spec, row-edit form, and rows are siblings. Override examples mirror
# the MDL table.yaml customization patterns.
title: Risk Register
description: Risks tracked for this party. Severity is the residual risk score; sort defaults to severity descending.
columns:
- field: id
title: ID
width: 6em
- field: title
title: Risk
- field: category
title: Category
width: 10em
- field: package
title: Package
width: 12em
# Dropdown sourced from a live registry: `options_source: <peer>` fills
# this column's choices from the entries under <project>/<peer>/. Here it
# lists the project's SSR packages. Change `ssr` to source a different
# registry, or delete the key to make the column free text.
options_source: ssr
- field: likelihood
title: L
width: 4em
- field: impact
title: I
width: 4em
- field: severity
title: Sev
width: 5em
- field: owner
title: Owner
width: 12em
- field: status
title: Status
width: 9em
enum: [open, mitigated, accepted, closed]
- field: dueDate
title: Due
format: date
width: 8em
defaults:
sort:
- { field: severity, dir: desc }
- { field: dueDate, dir: asc }