Repository navigation
fix(flows): repair PR→PO conversion and content trigger conditions (runtime-verified) - #44
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:pr_to_po_convertcreated the PO withorder_date: 'today()'— a literal string the runtime rejects (invalid_date), aborting the whole conversion (no PO; PR stuck atapproved). Fix:order_dateis optional on a draft PO (buyer sets it at send;sent_requires_order_datestill enforces it), and drop the bogus literal. Verified: approving a PR now creates a draft PO, flips PR→converted, carriescost_center.signal_to_topic_promotionusedPRIOR(status)andcta_creation_defaultusedisBlank(...)— neither is evaluated by the runtime condition dialect, so both flows were silently skipped. Switched to the provenprevious.status/!= nullidioms. Verified: promoting a signal now creates a topic.Documented (not regressions, left as fork points)
cta_creation_defaultstill no-ops:target_channelsis 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.Verification
17→19 PASS harness (hooks, state machines, contracts/hr/procurement/helpdesk/content flows, validations).
typecheck+objectstack build(9/9) +format:checkclean.🤖 Generated with Claude Code