Repository navigation
Description
The CLI owns the control and issue-type catalog (the one-engine rule). Several pieces of that catalog are authored in this repo but not exported, so the platform and getplumber.io are forced to hand-maintain second copies that drift from the CLI's own definitions. This issue consolidates the CLI <> Platform contract work that closes that gap: the CLI exports its catalog once, everyone else reflects it.
Anchor: #440 (config-schema export). The exports below extend the same surface; the last item is a related jobs_known correctness bug on the same boundary.
Work items:
- Export per-control config schemas
- Export per-control category / provider metadata
- Export control and issue-type descriptions
- Immutable ids for controls and issue types
- Exhaustive identity declarations table + guard
- Generate getplumber.io docs from the definitions
- Fix DeriveIncludeJobs case-divergent nested-include detection
1. Export per-control config schemas (anchor, #440)
A control's configuration FORMAT (field names, types, constraints) is defined here but not exported. The platform frontend hand-builds config edit forms with no source of truth to render against, and the platform cannot validate a policy's control config beyond storing it verbatim.
Ask: export the config schema per control_type (JSON-schema-ish is fine) so forms and validation generate from the CLI's own definition instead of a hand-maintained copy.
2. Export per-control category / provider metadata
The platform's GET /controls needs each control's category, but the per-control provider/category metadata (controlsMeta) is unexported. Without an accessor the platform would have to hand-maintain a second, driftable copy of the control catalog, exactly the duplication the one-engine rule exists to avoid.
Ask: export an accessor for the per-control metadata (category, provider) alongside the config-schema export.
3. Export control and issue-type descriptions
Control AND issue-type descriptions are authored in this repo but not exported. The platform can only reflect what it is handed, so any description shown in the console today is either absent or a platform-side duplicate that drifts from the CLI's wording.
Ask: export both description sets (per control_type and per issue type) so the backend serves the CLI's own words. Pairs naturally with the category/metadata export.
4. Immutable ids for controls and issue types
Controls and issue types are addressed by their string control_type / type name, which is renamable and carries no stability guarantee across releases. The platform keys durable state (issues, config, history) on those names, so a rename would orphan or duplicate platform-side state.
Ask: export an immutable id alongside each name (for controls and for issue types) so the platform can key on something that survives a rename. Migration/compat notes welcome: the platform can carry a dual-key transition the way it has for earlier renames.
5. Make the identity declarations table exhaustive + add a guard
The identity recipe (v4) gives any control code absent from the 73-entry declarations table a message-only identity, so N distinct findings of an undeclared code collapse into ONE platform issue. The platform pins this behavior as the CLI's contract.
Two asks:
- Confirm whether the table is meant to be exhaustive for every shipping control, and audit the current control set against it.
- Add a guard (a test or a generator) so a new control cannot ship undeclared. Today nothing catches the omission until findings collapse in production.
6. Keep getplumber.io control/issue docs generated from the CLI definitions
The public control/issue documentation on getplumber.io should be generated from this repo's control and issue-type definitions, so the docs, the platform console, and the engine never diverge. Pairs with the description and metadata exports above.
7. Fix DeriveIncludeJobs case-divergent nested-include detection
DeriveIncludeJobs decides "nested" by exact string equality between the stored project path and contextProject, but GitLab resolves paths case-insensitively. A stored path differing in case or form misclassifies every include as nested and serves jobs_known: true with zero jobs, a silent pass instead of the genuine determined-empty (and never a degrade).
Suggested fix: normalize both sides (GitLab full-path folding) before the comparison, plus a test with a case-divergent stored path.
Activity
[-][Tracking] CLI <> Platform: the control/issue catalog as the single source of truth[/-][+]CLI <> Platform: make the CLI the single source of truth for the control/issue catalog[/+]ci(deadcode): exempt the ConfigSchemas catalog export like ControlsCa…
fix(catalog): purge em dashes from rendered strings and correct stale…
test(catalog): exercise the catalog command's cobra wiring (#458)
test(catalog): pin that every issue code belongs to a registered cont…
test(catalog): pin prose config-key references to the real schemas (#458
docs(catalog): spec amendment for requiresConfig and the defaults exc…
feat(catalog): authored requiresConfig flag for controls inert withou…
docs(catalog): design spec and implementation plan for the catalog ex…
feat(catalog): export the control/issue catalog as the single source …
fix(catalog): rendered-string cleanup, contract guard tests and CI de…
feat(catalog): authored requiresConfig flag for controls inert withou…
docs(catalog): design spec and implementation plan for the catalog ex…
feat(catalog): export the control/issue catalog as the single source …
fix(catalog): rendered-string cleanup, contract guard tests and CI de…
feat(catalog): authored requiresConfig flag for controls inert withou…
chore(release): 0.4.56 [skip ci]