SDK: let an action read a field of an output it built - #225
Open
robknight wants to merge 1 commit into
Open
Conversation
`collapsed_at` collapsed an Output's script-final form into
`initials.<var>` unconditionally, so a body field read of it rendered
`initials.<var>.<field>` -- anchoring twice, which podlang has no syntax for,
and the module failed to compile through `load_module(...).expect("compiles")`.
The io sides never had this problem: `compute_wildcard_needs` spots a field
read there and keeps the dict as a wildcard pinned by an `ArrayContains`
clause. The initials record just had no equivalent escape.
Give it one. `compute_wildcard_needs` now reports all three forms through a
`WildcardNeeds` struct, `initials_entries` carries a `needs_wildcard` per entry
(hence `EntryShape` rather than a bare name), `collapsed_at` honours it, and
both emitters pin the wildcard to the initials record entry. With a third form
to place, the pin clauses became one loop over the three on each side, which is
what keeps the rendered clauses and the proved statements in step; the shared
`initials_ts` gives the "one ts below max" rule a single home instead of the
three copies this would otherwise have needed. `initials_anchor` returns None
for a forced-open form so TxInsert's initial arg stays bound to the wildcard.
This only changes rendering for scripts that could not compile before, so no
plugin hashes move. It also drops the workaround in
`test_statement_surface_round_trips`, which had to route entry args through
two inputs to avoid the broken form.
robknight
force-pushed
the
sdk-output-field-read
branch
from
August 21, 2026 09:09
5af945f to
5496904
Compare
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.
Previously this did not compile:
An output's script-final dict is normally rendered as
initials.pick, and a field read is rendered as<dict>.<field>. Together they came out asinitials.pick.durability, which anchors twice. Podlang has no syntax for that, so the module failed to compile.The io sides already handle this case. When
compute_wildcard_needssees a field read there, it keeps the dict as a plain wildcard and pins it with anArrayContainsclause. This adds the same mechanism for theinitialsrecord, allowing the pattern above to compile.Stack created with GitHub Stacks CLI • Give Feedback 💬