docs(adr): correct ADR-0032 #1491 root-cause attribution; tighten silent-failure scope#1508
Closed
os-zhuang wants to merge 1 commit into
Closed
docs(adr): correct ADR-0032 #1491 root-cause attribution; tighten silent-failure scope#1508os-zhuang wants to merge 1 commit into
os-zhuang wants to merge 1 commit into
Conversation
…ent-failure scope Verified ADR-0032's factual claims against the code and issue #1491: - Issue #1491 was "record-change trigger loads but flows never fire," reproduced with the condition omitted — not the single-brace '{record.rating} >= 4' the ADR named as root cause. The committed fix (static import in service-automation/engine.ts, replacing a throwing CJS __require stub) attributes it to the formula engine throwing on every CEL eval, masked by evaluateCondition's silent catch -> return false. Context rewritten to that account; single-brace/CEL-map collision kept as a real latent hazard of the same class (engine.ts:1456/1458). - Decision 4 split into its two halves: build-time validation catches the malformed-expression class; removing the silent fallback catches the runtime-fault class (#1491). Build-time validation alone would not have caught #1491. - Noted the silent/inconsistent handling is repo-wide: the same EvalResult is handled five different ways (seed/hook/validation/projection/condition); target is one declared policy. - Fixed precision: coercion transform lives in spec/shared/expression.zod.ts:84 (flow.zod.ts only consumes it). Cited flow.zod.ts:213-214 JSDoc still teaching condition: "{amount} < 500". https://claude.ai/code/session_01Sc2gibgfAH8af75zitRTUh
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
A review/polish pass over
docs/adr/0032-unified-expression-layer.md(Proposed), checking its factual claims against the code and against issue #1491. The ADR's thesis (one language, one delimiter, typed envelopes, no silent failure, build-time + schema-aware validation) holds up well; this PR corrects one material inaccuracy and tightens scope.The material finding — #1491 root-cause attribution
The ADR's Context said the incident's root cause was "a decision/edge condition authored as
'{record.rating} >= 4'." That is not what #1491 was:importof@objectstack/formulainservice-automation/engine.ts, replacing a CJSrequirethat bundled to a throwing tsup__requirestub — seeengine.ts:11-16) attributes the symptom to the formula engine throwing on every CEL eval, whichevaluateCondition'scatch → return falsesilently turned into "condition not met → flow skipped,success:true."ratingdetail in the ADR appears conflated with the issue'sbeforeInsert-hook example (which the reporter cited to prove L2 hooks do fire).Net: the silent
catch → falseis the real shared villain — which actually strengthens the ADR's Decision 4 — but the specific causal story was wrong. Context is rewritten to the accurate account; the single-brace / CEL-map-literal collision is kept as a genuine latent hazard of the same class (verified standard CEL grammar;engine.ts:1456/1458).Other corrections
EvalResultis handled five different ways today —seed-loader(loud fail),hook-wrappers(warn+false),rule-validator(warn+skip→null),engineformula projection (silent null), flowevaluateCondition(silent false). Target is one declared policy, not five ad-hoc ones; added to sequencing.transformis defined inspec/shared/expression.zod.ts:84(flow.zod.ts only consumes it), not inflow.zod.tsas stated.automation/flow.zod.ts:213-214's own JSDoc still teachescondition: "{amount} < 500"— the exact silently-failing single-brace form. Sequencing now includes fixing in-spec examples/skills/docs.Scope
Docs-only; one file (
+16 / −8). No code or schema changes. Status stays Proposed — the rewritten Context narrative is based on the issue text + the committed fix's own comment, so if the architects have private context on #1491 the attribution can be adjusted.https://claude.ai/code/session_01Sc2gibgfAH8af75zitRTUh
Generated by Claude Code