Skip to content

feat(modelchecker): expose action returns on Link + add no-state-retu…#355

Merged
jp-fizzbee merged 1 commit into
mainfrom
user/jp/feat-action-returns-on-link
May 19, 2026
Merged

feat(modelchecker): expose action returns on Link + add no-state-retu…#355
jp-fizzbee merged 1 commit into
mainfrom
user/jp/feat-action-returns-on-link

Conversation

@jp-fizzbee
Copy link
Copy Markdown
Collaborator

…rns flag

Builds on the prior CloneWithRefs fix by giving downstream consumers (graph, MBT, explorer) a forward-compatible way to read action return values from the per-transition Link rather than per-state Process.Returns.

Producer-side additions:

  • New Link.Returns starlark.StringDict field, populated in processNode alongside Labels/Messages and propagated by Attach/Duplicate to outbound links.
  • proto/graph.proto Link gets repeated NameValue returns = 10 so the per-transition returns are serialized into adjacency-list .pb files. Sorted by name in returnsToNameValues for deterministic output.
  • GenerateDotFile renders the return value on the edge label as \n returns: {...}.

Migration flag:

  • New --experimental_no_state_returns (off by default). When on, suppresses Process.Returns from HashCode, MarshalJSON, and the dot-file state label. Returns remain populated during execution (functions/invariants still read them) and remain visible on Link.Returns. Use this to verify downstream consumers have migrated; planned to become the default once they have.

Drive-by reverts unrelated to Returns work:

  • main.go: dotfile threshold local change 500 -> 250 (local-only bump that caused 11-07 and 13-02-01 reference baselines to drift).
  • processor.go: printPeakSummary now suppressed under the default queue mode and only prints under --experimental_processed_queue. The metric is only meaningful for old-vs-new dedup comparison; printing it in the default path drifted every reference baseline by one line.

Verified: all 94 reference specs + 10 lovable specs pass.

…rns flag

Builds on the prior CloneWithRefs fix by giving downstream consumers
(graph, MBT, explorer) a forward-compatible way to read action return
values from the per-transition Link rather than per-state Process.Returns.

Producer-side additions:

- New Link.Returns starlark.StringDict field, populated in processNode
  alongside Labels/Messages and propagated by Attach/Duplicate to outbound
  links.
- proto/graph.proto Link gets `repeated NameValue returns = 10` so the
  per-transition returns are serialized into adjacency-list .pb files.
  Sorted by name in returnsToNameValues for deterministic output.
- GenerateDotFile renders the return value on the edge label as
  `\n returns: {...}`.

Migration flag:

- New --experimental_no_state_returns (off by default). When on, suppresses
  Process.Returns from HashCode, MarshalJSON, and the dot-file state label.
  Returns remain populated during execution (functions/invariants still
  read them) and remain visible on Link.Returns. Use this to verify
  downstream consumers have migrated; planned to become the default once
  they have.

Drive-by reverts unrelated to Returns work:

- main.go: dotfile threshold local change 500 -> 250 (local-only bump
  that caused 11-07 and 13-02-01 reference baselines to drift).
- processor.go: printPeakSummary now suppressed under the default queue
  mode and only prints under --experimental_processed_queue. The metric
  is only meaningful for old-vs-new dedup comparison; printing it in the
  default path drifted every reference baseline by one line.

Verified: all 94 reference specs + 10 lovable specs pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jp-fizzbee jp-fizzbee merged commit 2e2b9c6 into main May 19, 2026
1 check passed
@jp-fizzbee jp-fizzbee deleted the user/jp/feat-action-returns-on-link branch May 19, 2026 18:59
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.

2 participants