fix(library): make manifest-declared flows portable across Colang versions#2185
Draft
Pouyanpi wants to merge 6 commits into
Draft
fix(library): make manifest-declared flows portable across Colang versions#2185Pouyanpi wants to merge 6 commits into
Pouyanpi wants to merge 6 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
11 tasks
Pouyanpi
force-pushed
the
pouyanpi/rail-library-stack-4-builtins
branch
from
July 17, 2026 11:58
2310548 to
f72f3e2
Compare
Space-separated action names (call cleanlab api, call fiddler safety on user message, call fiddler safety on bot message, call fiddler faithfulness, call gcpnlp api) can never be invoked from Colang 2: CamelCaseAction invocations normalize to snake_case and the dispatcher has no alias support. Rename them to the snake_case forms the Colang 2 flows already call, updating v1 flows, docs, log filters, and the runtime flow gate equivalence fixtures. Breaking change: custom Colang 1 flows that execute the old spaced names must switch to the snake_case names. Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
None of these had ever been executed under Colang 2:
- injection_detection/flows.co did not parse: variables were missing
the $ sigil and the file used Colang 1 idioms (else if, {{ }}
interpolation, $config instead of $system.config). Rewritten to the
library's Colang 2 idiom, mirroring flows.v1.co semantics.
- regex/flows.co awaited DetectRegexMatchAction, which normalizes to
the unregistered detect_regex_match; the registered action is
detect_regex_pattern.
- gcp_moderate_text shipped Colang 1 content in flows.co and had no
flows.v1.co at all; moved the v1 content to flows.v1.co and authored
a proper Colang 2 flows.co.
- activefence/flows.v1.co had one flow definition indented by a stray
space (cosmetic; the parser still registered it).
Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
Colang 1 ships clavata check input / clavata check output but the manifest declared only the parameterized clavata check for, which is Colang 2 only (Colang 1 has no parameterized flows). Add Colang 2 wrapper flows for input and output and declare all three flow names in the manifest. Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
Library rail tests run Colang 1 almost exclusively, so broken Colang 2 flow files shipped silently. Gate every manifest-declared rail: both dialect files must parse, define the declared flow names (a declared flow whose Colang 2 definition is parameterized is exempt from Colang 1 presence, since Colang 1 has no parameterized flows), and invoke only actions the dispatcher can resolve. Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
flows.co line 44 awaited autoalign_factcheck_output_api by its registered snake_case name; a lowercase name after await is a flow reference in Colang 2, so the invocation resolved to a nonexistent flow. Use the CamelCase Action form like the sibling flows in the same file. Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
A lowercase name after await/start parses as a flow reference, so awaiting an action by its snake_case registered name fails only at runtime. Flag any awaited lowercase name that matches a registered action; this caught the autoalign factcheck defect and matches the mistake pattern seen in inbound rail PRs. Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
Pouyanpi
force-pushed
the
pouyanpi/rail-library-stack-4b-flow-gate
branch
from
July 17, 2026 12:07
c23f5a4 to
b05380f
Compare
This was referenced Jul 17, 2026
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.
Description
Make flows declared by built-in rail manifests executable in each packaged
Colang dialect. Normalize vendor action identifiers so Colang 2 can resolve
them, repair invalid Colang 2 flow syntax, add missing Clavata and GCP flow
variants, and correct the AutoAlign fact-check invocation.
Add a cross-dialect gate that loads packaged flow files, verifies declared
actions resolve, detects actions incorrectly awaited as flows, and exercises
representative runtime outcomes.
Manifests do not replace Colang orchestration in LLMRails. They declare the
portable action contract, while packaged Colang flows continue to own
LLMRails-specific sequencing and presentation. This PR keeps those two layers
aligned across both supported Colang dialects.
both GCP dialects retain the merged action-owned moderation verdict: flows gate
on
RailOutcome.is_blocked, usetriggered_violationonly for presentation,and fail closed when detailed trigger metadata is absent.
Impact
packaged Colang dialects instead of failing on invalid syntax or unresolved
names.
and registered action names during tests rather than at user runtime.
Colang flows remain responsible only for response presentation.
unavailable.
Stack
pouyanpi/rail-library-stack-3-manifest-contractdeveloppouyanpi/rail-library-stack-4-builtinspouyanpi/rail-library-stack-4b-flow-gatepouyanpi/rail-library-stack-5-lazy-actionspouyanpi/rail-library-stack-6-hardeningRelated Issue(s)
Verification
AI Assistance
Codex assisted with implementation analysis, validation, stack restructuring,
and this draft. Check the disclosure box after human review.
Checklist