feat(automation): schema-aware flow-condition validation at registration (#1928)#3190
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 6 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…ion (#1928) registerFlow now runs the same schema-aware condition checks as objectstack build, so a flow registered dynamically (API/Studio, bypassing the build lint) still gets the guardrail. When an object-schema resolver is wired, a condition that references an unknown field, likely-typos a field, or does arithmetic/ ordering on a text/boolean field against a number is surfaced as an advisory warning (logged), against the object's real schema. - New AutomationEngine.setObjectSchemaResolver bridge (mirrors setFunctionResolver); AutomationServicePlugin wires it to objectql.registry.getObject in start(), before the flow pull. - Strictly additive: the fatal set is unchanged (syntax, brace-in-CEL, unknown-function still throw); schema findings are logged, never thrown; no-op when unwired. Flattened scope — flow variables stay dyn, equality safe. - parseObjectFieldSchema helper normalizes the registry's field map/array. Tests: service-automation 316 (+10: 6 engine resolver, 4 parser); no regression. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hnji7EEYR2mGt6pY53a8Bm
os-zhuang
force-pushed
the
claude/flow-registration-schema-aware-validation
branch
from
July 18, 2026 07:14
79f41ea to
adf2015
Compare
os-zhuang
marked this pull request as ready for review
July 18, 2026 07:28
This was referenced Jul 18, 2026
Merged
os-zhuang
added a commit
that referenced
this pull request
Jul 18, 2026
…olver wiring (#3208) Adds a kernel-level integration test that boots LiteKernel with a fake objectql service (registry.getObject) + AutomationServicePlugin and proves the plugin bridges the engine's object-schema resolver to the live registry at start(): - the wired resolver returns the object's fields + types; - a flow registered through the running kernel doing arithmetic on a text field emits the tier-4 advisory (captured via process.stdout); - a sound condition stays quiet. Locks in the production integration point that #3190's engine-level unit tests (resolver set by hand) could not exercise. Test-only; no behavior change. Tests: service-automation 319 (+3 e2e); full suite green. Claude-Session: https://claude.ai/code/session_01Hnji7EEYR2mGt6pY53a8Bm Co-authored-by: Claude <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.
What
Brings the
registerFlowruntime path up to parity withobjectstack build: a flow condition that references an unknown field, likely-typos a field name, or does arithmetic/ordering on a text/boolean field against a number is now surfaced at registration — so a flow registered dynamically (API / Studio, bypassing the build lint) still gets the #1928 guardrails.This is the real, tractable version of the "authoring-time feedback" follow-up noted in #3178. (There is no
validate_expressionagent tool in the codebase to wire into; the flow-registration path is the actual runtime authoring surface.)Design — strictly additive, zero regression
AutomationEngine.setObjectSchemaResolver(resolver), mirroring the existingsetFunctionResolver.AutomationServicePluginwires it toobjectql.registry.getObjectinstart(), before the flow pull, so registry-sourced flows are covered too.validateFlowExpressionskeeps its fatal set unchanged (syntax, brace-in-CEL, unknown-function still throw). When a resolver is wired, a second schema-aware pass runs only on syntactically-valid conditions and its findings (field-existence, tier-3 typo, tier-4 type mismatch) are logged as advisory warnings — never thrown. So a wired resolver can never break a flow that used to register cleanly, and the whole thing is a no-op when unwired.flattenedscope: flow variables staydyn(never flagged), equality stays runtime-safe.parseObjectFieldSchemanormalizes the registry's field shape (name-keyed map — theServiceObjectshape — or{name,type}[]) into the validator's hint.Why advisory (not fatal) at registration
The build gate (
objectstack build) is strict and fails the build. RuntimeregisterFlowis deliberately lenient — a running system should log a suspicious dynamically-registered flow, not refuse to register it (and a resolver fed a partial field list must never hard-break registration). Same guardrail, appropriate severity per surface.Testing
@objectstack/service-automation— 316 green (+10):parseObjectFieldSchemacases: map shape, array shape, non-string type → dyn, invalid input.Refs: #1928, ADR-0032. Builds on #3178 (tier-4), #1930 / #1931 / #1933.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Hnji7EEYR2mGt6pY53a8Bm
Generated by Claude Code