Skip to content

feat(generator): desugar signal completion predicates into IR waits - #37

Merged
joelgwebber merged 2 commits into
mainfrom
feat/signal-completion-predicates
Sep 11, 2026
Merged

feat(generator): desugar signal completion predicates into IR waits#37
joelgwebber merged 2 commits into
mainfrom
feat/signal-completion-predicates

Conversation

@joelgwebber

Copy link
Copy Markdown
Collaborator

What

Desugar signal completion predicates into IR waits in the generator.

  • New wait_for {signal: name} form and a step-level then: post-condition.
  • Both reference a corpus signal (the SEP-0007 state-signal subset: a named boolean over a component's presence or a view's route) and desugar into an ordinary waitFor step — a component ref becomes a present-wait on its selectors, a view ref a route-wait.
  • Resolution runs against the whole corpus (Corpus.ResolveSignal), so a post-condition may name a subject in the destination view, outside the tool's ensure_view scope (the common click-continue → wait-for-next-view case).
  • A step with then: completes only once the named signal holds, not merely when the action dispatched — the fix for a click that reports done while accomplishing nothing.
  • The runtime is unchanged; these desugar to query/route waits it already runs.

⚠️ Pre-merge dependency

generator/go.mod currently pins the sightmap library to the state-signals branch build (for Corpus.Signals / Corpus.ResolveSignal). Bump it to the released sightmap version before merging — now unblocked by the latest sightmap release.


Rebased on main; go test ./... is green including the new signal_wait_test.

Add a wait_for {signal: name} form and a step-level then: post-condition. Both reference a corpus signal (the SEP-0007 state-signal subset: a named boolean over a component's presence or a view's route) and desugar into an ordinary waitFor step -- a component ref becomes a present-wait on the component's selectors, a view ref a route-wait. Resolution runs against the whole corpus (Corpus.ResolveSignal), so a post-condition may name a subject in the destination view, outside the tool's ensure_view scope (the common click-continue -> wait-for-next-view case).

then: expands to the action step followed by the signal wait, inheriting the step's when so an optional step and its post-condition skip together. A step then completes only once a named signal holds, not merely when the action dispatched -- the fix for a click that reports done while accomplishing nothing.

Runtime is unchanged: the desugared steps are the query/route waits it already runs. Pins the sightmap library to the state-signals branch build for Corpus.Signals/ResolveSignal; bump to the released version once that lands.

Signed-off-by: Joel Webber <joel@fullstory.com>
Signed-off-by: Joel Webber <joel@fullstory.com>
@joelgwebber
joelgwebber merged commit b80c5e5 into main Sep 11, 2026
2 checks passed
@joelgwebber
joelgwebber deleted the feat/signal-completion-predicates branch September 11, 2026 17:54
joelgwebber added a commit that referenced this pull request Sep 11, 2026
PR #37 landed the signal-completion-predicates feature but kept generator/go.mod
pinned to the state-signals branch build (v0.31.3-0.20260910214719-f6ac005ba83a).
Now that sightmap v0.32.0 is released with Corpus.Signals / Corpus.ResolveSignal,
replace the pseudo-version with the release tag. go build + go test ./... green.

Signed-off-by: Joel Webber <joel@fullstory.com>
joelgwebber added a commit that referenced this pull request Sep 11, 2026
)

* feat(generator): desugar signal completion predicates into IR waits

Add a wait_for {signal: name} form and a step-level then: post-condition. Both reference a corpus signal (the SEP-0007 state-signal subset: a named boolean over a component's presence or a view's route) and desugar into an ordinary waitFor step -- a component ref becomes a present-wait on the component's selectors, a view ref a route-wait. Resolution runs against the whole corpus (Corpus.ResolveSignal), so a post-condition may name a subject in the destination view, outside the tool's ensure_view scope (the common click-continue -> wait-for-next-view case).

then: expands to the action step followed by the signal wait, inheriting the step's when so an optional step and its post-condition skip together. A step then completes only once a named signal holds, not merely when the action dispatched -- the fix for a click that reports done while accomplishing nothing.

Runtime is unchanged: the desugared steps are the query/route waits it already runs. Pins the sightmap library to the state-signals branch build for Corpus.Signals/ResolveSignal; bump to the released version once that lands.

Signed-off-by: Joel Webber <joel@fullstory.com>

* chore: add changeset for signal completion predicates

Signed-off-by: Joel Webber <joel@fullstory.com>

---------

Signed-off-by: Joel Webber <joel@fullstory.com>
joelgwebber added a commit that referenced this pull request Sep 11, 2026
PR #37 landed the signal-completion-predicates feature but kept generator/go.mod
pinned to the state-signals branch build (v0.31.3-0.20260910214719-f6ac005ba83a).
Now that sightmap v0.32.0 is released with Corpus.Signals / Corpus.ResolveSignal,
replace the pseudo-version with the release tag. go build + go test ./... green.

Signed-off-by: Joel Webber <joel@fullstory.com>
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