Skip to content

feat(schema): introduce group-level process variable schema system#98

Draft
HanselIdes wants to merge 1 commit intomainfrom
feat/process-variable-schema-2
Draft

feat(schema): introduce group-level process variable schema system#98
HanselIdes wants to merge 1 commit intomainfrom
feat/process-variable-schema-2

Conversation

@HanselIdes
Copy link
Copy Markdown
Contributor

Closes #95

Summary

  • Two group-level schemas cover all processes: solutions/variables.schema.json (114 variables) and quick-start/variables.schema.json (1 variable)
  • Both validate against schema/process-variables.meta-schema.json
  • Variables with the same name across multiple processes within a group share a single entry — the schema is a vocabulary, not a per-process inventory
  • Dotted form key bindings (e.g. loan.amount) are resolved to their root variable (loan)

Toolchain (tools/schema/)

Script Purpose
extract-variables.mjs --extract bootstraps a schema; --check fails CI on unregistered variables; --dead flags candidates for DEAD marking
lint-naming.mjs Enforces camelCase convention; gated by enforceNaming: false in config until issue #96 (snake_case migration) lands
find-similar-variables.mjs Signal A: Levenshtein name similarity within group. Signal B: Jaccard property-set overlap cross-group. Advisory only.

CI (.github/workflows/variable-schema.yml)

Triggers on changes to BPMN, DMN, form, test JSON, or schema files. Detects which group changed and runs: validate meta-schema → check unregistered variables → lint naming. Dead scan and similarity run as advisory jobs after check passes. A cascade warning posts to the job summary when schema/ itself changes.

Test plan

  • node tools/schema/extract-variables.mjs --check --group solutions exits 0
  • node tools/schema/extract-variables.mjs --check --group quick-start exits 0
  • node tools/schema/lint-naming.mjs --group solutions exits 0 (notices for 29 snake_case variables, no errors while enforceNaming: false)
  • node tools/schema/find-similar-variables.mjs exits 0 with advisory output
  • Adding a new BPMN output target without a schema entry causes --check to exit 1 with a GitHub annotation
  • Issue fix(variables): rename 13 snake_case variables to camelCase across 4 solutions #96 (snake_case migration) is a prerequisite before setting enforceNaming: true

🤖 Generated with Claude Code

Two schemas cover all processes in each group:
  solutions/variables.schema.json — 114 variables across all solutions
  quick-start/variables.schema.json — 1 variable (meal)

Both validate against schema/process-variables.meta-schema.json.

Toolchain (tools/schema/):
  extract-variables.mjs — --extract/--check/--dead modes; reads BPMN
    (bpmn-moddle), DMN, forms, and CPT test JSON; --group flag targets
    the full solutions/ or quick-start/ tree
  lint-naming.mjs — camelCase enforcement; gated by enforceNaming flag
    (false until issue #96 snake_case migration lands)
  find-similar-variables.mjs — Signal A (Levenshtein name similarity
    within group) + Signal B (Jaccard property-set overlap cross-group)

Config:
  .variable-schema.config.json — convention, scope, enforceNaming
  CODEOWNERS — @HanselIdes owns schema/ and both vocabulary files
  .github/workflows/variable-schema.yml — CI: detect changed group,
    validate schema, check unregistered variables, lint naming; dead
    scan and similarity advisory; cascade warning on schema/ changes

CLAUDE.md added to document delegated-mode autonomy and schema
maintenance playbook for the ci-agent.

Closes #95 (implementation complete; issue #96 tracks migration).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: introduce a holistic process variable schema and validate it in CI

1 participant