Skip to content

fix(docs): regenerate bank-template-schema.json and guard drift#1065

Merged
nicoloboschi merged 1 commit intovectorize-io:mainfrom
mrkhachaturov:fix/docs-bank-template-schema-regen
Apr 15, 2026
Merged

fix(docs): regenerate bank-template-schema.json and guard drift#1065
nicoloboschi merged 1 commit intovectorize-io:mainfrom
mrkhachaturov:fix/docs-bank-template-schema-regen

Conversation

@mrkhachaturov
Copy link
Copy Markdown
Contributor

Summary

hindsight-docs/static/bank-template-schema.json is hand-edited. Nothing regenerates it and nothing checks it. Three PRs have changed BankTemplateManifest since it was last touched:

None of the bundled templates exercise any of these fields, so check-templates.mjs kept passing. A template that uses the dict-shaped label format fails Ajv with should be string on every label.

This PR regenerates the schema from BankTemplateManifest.model_json_schema() and hooks the generator into the existing verify-generated-files CI job alongside generate-openapi and generate-clients, so the same drift guard you already rely on for those catches future schema changes.

Test plan

  • ./scripts/generate-bank-template-schema.sh runs cleanly and is idempotent on re-run
  • ./scripts/hooks/lint.sh — all lints pass (new Python file + ruff + ty)
  • node hindsight-docs/scripts/check-templates.mjs — all 3 bundled templates still validate against the regenerated schema
  • A template using entity_labels: list[dict] (dict-shaped) now validates against the regenerated schema but is rejected by the stale schema on main with should be string — confirms the drift was reachable
  • CI verify-generated-files job passes the new Run generate-bank-template-schema step

hindsight-docs/static/bank-template-schema.json is hand-edited.
Nothing regenerates it and nothing checks it. Three PRs have
changed BankTemplateManifest since it was last touched:
vectorize-io#902 flipped entity_labels from list[str] to list[dict[str, Any]],
vectorize-io#1044 added ten BankTemplateConfig fields, vectorize-io#1048 added three
MentalModelTrigger fields.

None of the bundled templates use the new fields, so Ajv in
check-templates.mjs still passes. A template that uses the
dict-shaped label format fails with 'should be string' on
every label.

Regenerate from BankTemplateManifest.model_json_schema() and
hook the generator into verify-generated-files alongside
generate-openapi and generate-clients.
Copy link
Copy Markdown
Collaborator

@nicoloboschi nicoloboschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!!

@nicoloboschi nicoloboschi merged commit 16ed93b into vectorize-io:main Apr 15, 2026
47 checks passed
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.

2 participants