feat(showcase): complete the state_machine validation demonstration#1474
Merged
Merged
Conversation
The 3 status state machines (task/project/account) covered transition topologies but not the rule's other knobs. Round it out so the showcase exercises — and verifies — the full state_machine surface: - events: ['update'] on all three — state machines validate *transitions*, so they should run on update only (insert sets the initial state). Makes the intent explicit rather than relying on the insert short-circuit. - New advisory `project_health_progression` with severity: 'warning' — health should step one level at a time (green↔yellow↔red); a skip is flagged (logged) but NOT blocked, demonstrating soft guards alongside the existing error-severity (blocking) status flows. Verified against the runtime: error-severity invalid transition → HTTP 400 `invalid_transition`; warning-severity skip (health green→red) → HTTP 200. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
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.
Summary
The showcase had 3
state_machinevalidations (task/project/account) covering transition topologies (linear+reopen, branching+terminal, re-entrant) but not the rule's other knobs. Rounds out the demonstration so the showcase exercises — and verifies — the full state_machine surface:events: ['update']on all three: state machines validate transitions, so they run on update only (an insert sets the initial state). Makes intent explicit.project_health_progressionwithseverity: 'warning': health should change one step at a time (green↔yellow↔red); a skip is flagged (logged) but not blocked — demonstrating soft guards alongside the error-severity (blocking) status flows.Verification (runtime enforcement is live)
task done→backlog) → HTTP 400invalid_transitionproject health green→red) → HTTP 200 (flagged, not blocked)Note (separate finding)
objectql/validation/rule-validator.tsenforces only 3 of the spec's 9 rule types —state_machine,script,cross_field— exactly what the showcase covers. The other 6 (unique-rule,format,json_schema,async,custom,conditional) are declared but not enforced on the write path — same "advertise only what you can deliver" issue as the ChartType taxonomy; worth a follow-up (trim vs implement).🤖 Generated with Claude Code