Skip to content

feat(api): carry language and jurisdictions in the .mikeworkflow.json interchange format - #18

Open
amal66 wants to merge 4 commits into
mainfrom
feat/workflow-metadata
Open

feat(api): carry language and jurisdictions in the .mikeworkflow.json interchange format#18
amal66 wants to merge 4 commits into
mainfrom
feat/workflow-metadata

Conversation

@amal66

@amal66 amal66 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

Extends the .mikeworkflow.json import/export format with optional language and jurisdictions metadata while keeping format-version 1 backwards compatible. Scope is the interchange layer only (pack schema, export, import, published JSON schema); the underlying database columns and CRUD handling for these fields already live on main from the upstream workflow metadata sync.

Compatibility behavior

  • Existing packs without the new fields still validate and import.
  • Legacy imports receive stable defaults: English and ["General"].
  • Explicit metadata round-trips through export/import.
  • schemas/workflow.schema.json remains generated from the Zod source of truth (drift-checked in tests).

Verification

  • 13 focused tests pass across workflowFormat.test.ts and workflows.import-metadata.test.ts: schema drift + published examples (2), pack validation behavior including metadata acceptance and rejection of malformed jurisdictions (9), explicit-metadata import and legacy-default import (2).
  • API TypeScript production build (tsc) passes.
  • Branch reconciled with current main (olp UI sync, b3166dd): clean merge, no conflicts, no adaptations required.

Credits & prior art

🤖 Generated with Claude Code

https://claude.ai/code/session_01CEguyEgXa9JjCciXCcVemC

@amal66
amal66 force-pushed the feat/workflow-metadata branch 5 times, most recently from 3128ba7 to 7eda703 Compare July 6, 2026 00:26
…nterchange format

Rebased onto the upstream workflow-metadata sync: main already persists and
normalizes language/jurisdictions on create/update (via the metadata
envelope), ships the modal fields, metadata bar, scope tabs, Tiptap tables
and the DB migration — those parts of this branch were dropped as superseded.

What remains is the genuinely additive slice: the .mikeworkflow.json
interchange format now carries the two metadata fields.

  - workflowFormat.ts (the SINGLE zod source): two new optional fields,
    language and jurisdictions, plus updated examples. The published
    schemas/workflow.schema.json is regenerated from it (via
    `npm run generate:workflow-schema`) — never hand-edited; the drift
    test (workflowFormat.test.ts) guards the pair.
  - exportWorkflow selects and emits the columns.
  - importWorkflow normalizes them with main's existing
    normalizeOptionalString / normalizeJurisdictions helpers, falling back
    to the 'English' / ['General'] defaults so files predating the fields
    still import onto the same baseline the UI shows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@amal66
amal66 force-pushed the feat/workflow-metadata branch from 7eda703 to f97cbac Compare July 10, 2026 02:56
@amal66 amal66 changed the title feat: workflow metadata (language/jurisdiction/practice) + modal & scope tabs feat(api): carry language and jurisdictions in the .mikeworkflow.json interchange format Jul 17, 2026
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.

1 participant