Skip to content

when expressions: parentheses, precedence, OR keep-site migration - #383

Merged
m2ux merged 12 commits into
mainfrom
chore/379-when-expressions-parentheses-precedence
Aug 1, 2026
Merged

when expressions: parentheses, precedence, OR keep-site migration#383
m2ux merged 12 commits into
mainfrom
chore/379-when-expressions-parentheses-precedence

Conversation

@m2ux

@m2ux m2ux commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

Authors can write nested boolean step gates (&&, ||, parentheses) in the inline when: dialect with one shared evaluator for tests and guards — the four production OR keep-sites no longer need structured condition: form.

🐛 Issue 📐 Engineering 📋 Test plan


Motivation

Simple gates and flat AND compounds already used inline when:, but OR-shaped gates stayed on structured condition: because parentheses, precedence, and mixed &&/|| evaluation were not validated. Without a single reference dialect, authors cannot safely express nested shapes, docs over-promise what mechanical nets enforce, and an OR migration risks run/skip divergence from structured trees.


Changes

  • Schema - Reference when-expression module (tokenize, C-style precedence, ||/&&/!, comparisons including numeric); activity schema grammar card and fail-closed net rule
  • Mechanical nets - e2e walker and stealth isolation call the shared module; walker fail-closed on invalid input
  • Guards - check:when authoring guard rejects bare mixed ops without parentheses
  • Corpus - Four OR keep-sites migrated to parenthesized when:; workflows pin + corpus SHA stamp
  • Tests - Unit truth tables, nested keep-site shapes, structured-condition parity (24 tests)

🤖 AI Assistance

  • Assistant / Model: Cursor Agent / GPT-class coding agent
  • Context scope: mixed
  • Prompt classes: code-generation, test-writing, docs
  • Provenance log: 08-provenance-log.md

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason: repo has no root changes/ convention
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • No new todos introduced

🔱 Fork Strategy

  • Runtime Update
  • Client Update
  • Other
  • N/A

🗹 TODO before merging

  • Ready for review
  • Address unsigned-commit gate (12 commits %G? = N on branch range) if project policy requires signatures
  • Local validation: typecheck, test:ci (811 passed), check:all (20/20)

@m2ux m2ux self-assigned this Aug 1, 2026
@m2ux m2ux changed the title feat(when): parentheses and precedence before OR step-gate migration (#379) when expressions: parentheses, precedence, OR keep-site migration Aug 1, 2026
m2ux added a commit that referenced this pull request Aug 1, 2026
Bring parenthesized when: gates for the four OR keep-sites onto this
branch so parallel-fan-out does not reintroduce structured OR condition
trees when both land.
m2ux added a commit that referenced this pull request Aug 1, 2026
Align co-touched 11-validate step gates with the reference when dialect
from #383 so flat AND compounds and simple equals use when: consistently.

Signed-off-by: Mike Clay <mike.clay@shielded.io>
m2ux added a commit that referenced this pull request Aug 1, 2026
Scope and findings record the OR keep-site merge and host check:when
dependency; progress tracks pattern library delivery as complete.
m2ux added a commit that referenced this pull request Aug 1, 2026
Register and close-out record the four OR sites as parenthesized when:
after cherry-pick d891ed7; totals 149 migrated / 0 OR-kept.
m2ux added a commit that referenced this pull request Aug 1, 2026
Express the non-complex prism inline path as when: problem_complexity !=
'complex', matching the sibling dispatch-prism when gate and the #383
when-expression dialect.
@m2ux
m2ux marked this pull request as ready for review August 1, 2026 17:32
@m2ux
m2ux merged commit e456fcc into main Aug 1, 2026
4 checks passed
m2ux added a commit that referenced this pull request Aug 1, 2026
…merge

Record ADR-0009, COMPLETE, session-trace, review analysis, and README
progress for the parentheses/precedence OR keep-site work package.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant