Hermes 284313f908
Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Initial import of AlgaPSA codebase from PSA server
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz

Source: /opt/alga-psa on psa.joliet.tech
2026-06-22 16:12:17 -05:00

36 lines
2.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Scratchpad — Workflow Payload Contract Inference
Rolling implementation notes (append; prune as needed).
## 2025-12-28
- Decision: pinning is unrestricted (no extra governance permission).
- Contract schemas: start with payload-only snapshots (no embedding `event/vars`).
- Effective schema UI can be shown as JSON preview; no virtual schemaRef needed.
- Custom events policy left flexible (may be removed); avoid extra work.
### Implemented slice (mode + persistence + UI)
- Added `payload_schema_mode`, `pinned_payload_schema_ref`, `payload_schema_provenance` to `workflow_definitions`.
- Migration: `server/migrations/20251228193000_add_workflow_payload_schema_mode.cjs`
- Extended workflow draft save/create APIs to persist mode + pinned ref:
- `server/src/lib/actions/workflow-runtime-v2-schemas.ts`
- `server/src/lib/actions/workflow-runtime-v2-actions.ts`
- Updated designer to present “Workflow data contract” with a “Pin schema (advanced)” toggle and to persist mode.
- `ee/server/src/components/workflow-designer/WorkflowDesigner.tsx`
### Notes
- Current runtime uses `payload_schema_json` snapshots stored on `workflow_definition_versions` on publish; execution does not depend on schema registry at runtime.
- For now, inferred mode sets `payloadSchemaRef` to the triggers inferred schemaRef (from event catalog) and publishes a snapshot of that schema JSON for stability.
### Follow-up (publish-time behavior + UX)
- Publish action now re-infers `definition.payloadSchemaRef` in inferred mode from the triggers source schemaRef at publish time (override or event catalog).
- Designer shows a warning if inferred contract differs from the published contract and offers “Pin to published contract”.
### 2025-12-28 (cont.)
- Added deterministic payload schema snapshot hashing via stable JSON key ordering in validation/publish.
- `server/src/lib/actions/workflow-runtime-v2-actions.ts`
- Added in-memory caching for schema registry `toJsonSchema()` + `listRefs()` to reduce repeated Zod→JSON conversions in designer/run dialogs.
- `shared/workflow/runtime/registries/schemaRegistry.ts`
- Allowed opening the Run dialog for draft (unpublished) workflows for preview; running remains disabled until a version is published.
- `ee/server/src/components/workflow-designer/WorkflowDesigner.tsx`
- `ee/server/src/components/workflow-designer/WorkflowRunDialog.tsx`