Skip to content

fix(flows): repair PR→PO conversion and content trigger conditions (runtime-verified) - #44

Merged
xuyushun441-sys merged 1 commit into
mainfrom
fix/runtime-flow-issues
Jun 15, 2026
Merged

xuyushun441-sys merged 1 commit into
mainfrom
fix/runtime-flow-issues

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Why

Ran a comprehensive runtime test harness against objectstack dev all (9.5.1), logging in as the seed admin and triggering every flow / state machine, asserting the actual side effects (not just screenshots). Result: 19 PASS, plus these real defects in flows that build cleanly but don't execute correctly:

  1. procurement pr_to_po_convert created the PO with order_date: 'today()' — a literal string the runtime rejects (invalid_date), aborting the whole conversion (no PO; PR stuck at approved). Fix: order_date is optional on a draft PO (buyer sets it at send; sent_requires_order_date still enforces it), and drop the bogus literal. Verified: approving a PR now creates a draft PO, flips PR→converted, carries cost_center.
  2. content signal_to_topic_promotion used PRIOR(status) and cta_creation_default used isBlank(...) — neither is evaluated by the runtime condition dialect, so both flows were silently skipped. Switched to the proven previous.status / != null idioms. Verified: promoting a signal now creates a topic.

Documented (not regressions, left as fork points)

  • cta_creation_default still no-ops: target_channels is a multi-lookup (junction), not on the after-create row the condition sees — noted inline.
  • publication_rollup's aggregate node is a runtime no-op (in-flow aggregation unsupported), so totals stay seed-maintained per CHARTER.
  • todo urgent-due validation fires on update + explicit-null (the UI path) but not on raw-API field omit — a platform CEL quirk identical to the pre-existing compliance rule.

Verification

17→19 PASS harness (hooks, state machines, contracts/hr/procurement/helpdesk/content flows, validations). typecheck + objectstack build (9/9) + format:check clean.

🤖 Generated with Claude Code

…untime-verified)

Comprehensive runtime testing of every triggerable flow against `objectstack
dev all` (9.5.1) surfaced flows that build cleanly but don't execute correctly:

- procurement pr_to_po_convert created the PO with `order_date: 'today()'` — a
  literal string the runtime's date validation rejects (invalid_date), which
  aborted the whole conversion (no PO, PR stuck at approved). The buyer sets the
  order date when sending, so make `procurement_order.order_date` optional (the
  `sent_requires_order_date` validation still enforces it at send) and drop the
  bogus `today()` literal. Verified: approving a PR now creates a draft PO,
  flips the PR to converted, and carries cost_center.

- content signal_to_topic_promotion used `PRIOR(status)` and cta_creation_default
  used `isBlank(...)` in their trigger conditions — neither is evaluated by the
  runtime condition dialect, so both flows were silently skipped. Switch to the
  proven `previous.status` / `!= null` idioms. Verified: promoting a signal now
  creates a topic. (cta_creation_default still no-ops because target_channels is
  a multi-lookup not visible on the after-create row — documented inline as a
  fork point; publication_rollup's aggregate node is likewise a runtime no-op,
  so totals stay seed-maintained per CHARTER. Neither is a regression.)

typecheck + objectstack build (9/9) + format:check clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@xuyushun441-sys
xuyushun441-sys merged commit 342d75c into main Jun 15, 2026
2 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the fix/runtime-flow-issues branch June 15, 2026 05:41
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