Skip to content

feat(showcase): complete the state_machine validation demonstration#1474

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/showcase-state-machine-completeness
Jun 1, 2026
Merged

feat(showcase): complete the state_machine validation demonstration#1474
xuyushun441-sys merged 1 commit into
mainfrom
feat/showcase-state-machine-completeness

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

Summary

The showcase had 3 state_machine validations (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.
  • New advisory project_health_progression with severity: '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)

  • error-severity invalid transition (task done→backlog) → HTTP 400 invalid_transition
  • warning-severity skip (project health green→red) → HTTP 200 (flagged, not blocked)

Note (separate finding)

objectql/validation/rule-validator.ts enforces 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

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment Jun 1, 2026 2:29pm

Request Review

@github-actions github-actions Bot added the size/s label Jun 1, 2026
@xuyushun441-sys xuyushun441-sys merged commit c9271fd into main Jun 1, 2026
10 of 11 checks passed
@xuyushun441-sys xuyushun441-sys deleted the feat/showcase-state-machine-completeness branch June 1, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants