Repository navigation
describe: no eval hint on assignment results - #313
Merged
Merged
Conversation
Agents run snippets through DangEval, which describes the snippet's result. For a snippet ending in an assignment like `chat = editor.install(...)` or `ws = ws.withChanges(...)`, that result is a lazy GraphQL handle, and Describe said it was "not evaluated" and to select .sync. But the assignment was the point, and the engine applies it; dogfooding showed agents adding .sync anyway. Snippet.Eval now returns a copy of the handle marked Assigned when the snippet's last form assigns a binding from before the snippet, and Describe leaves the hint out for it. The mark is decided from the snippet's syntax, not set by Reassignment.Eval, so a function whose body ends in an assignment doesn't pass it on to callers; and an assignment to the snippet's own local, which runs nothing, keeps the hint. The stored binding stays unmarked. Signed-off-by: Alex Suraci <[email protected]>
Deploying dang with
|
| Latest commit: |
3ba0a1d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0af3af81.dang-3kk.pages.dev |
| Branch Preview URL: | https://assign-no-eval-hint.dang-3kk.pages.dev |
vito
force-pushed
the
assign-no-eval-hint
branch
from
November 13, 2026 21:37
d6db8c8 to
3ba0a1d
Compare
vito
added a commit
to dagger/dagger
that referenced
this pull request
Nov 13, 2026
v2.5.0 is the tagged release of what the stack pinned as a pseudo-version.
What matters here:
- Language version 2.5 (dang.CurrentVersion, so DangEval/DangCheck
snippets in the default scope): "..." and """...""" interpolate ${...},
""" strings take escapes and a language tag, '...' is verbatim, and text
on the opening line of a multi-line string is an error.
- A snippet ending in an assignment to a binding from outside it (ws, a
tool object, chat) no longer prints the "(not evaluated…)" hint
(vito/dang#313); assert that in the unit and integration tests.
- Dang interfaces are structural, at every version.
- Tree-sitter runs as WebAssembly, so Dang needs no cgo: go mod tidy drops
go-tree-sitter and its grammars.
- The embedded dang-language skill now documents 2.5.
Signed-off-by: Alex Suraci <[email protected]>
vito
added a commit
to dagger/dagger
that referenced
this pull request
Nov 14, 2026
v2.5.0 is the tagged release of what the stack pinned as a pseudo-version.
What matters here:
- Language version 2.5 (dang.CurrentVersion, so DangEval/DangCheck
snippets in the default scope): "..." and """...""" interpolate ${...},
""" strings take escapes and a language tag, '...' is verbatim, and text
on the opening line of a multi-line string is an error.
- A snippet ending in an assignment to a binding from outside it (ws, a
tool object, chat) no longer prints the "(not evaluated…)" hint
(vito/dang#313); assert that in the unit and integration tests.
- Dang interfaces are structural, at every version.
- Tree-sitter runs as WebAssembly, so Dang needs no cgo: go mod tidy drops
go-tree-sitter and its grammars.
- The embedded dang-language skill now documents 2.5.
Signed-off-by: Alex Suraci <[email protected]>
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.
Problem
Agents run Dang snippets through the Dagger engine's DangEval tool, which calls
Session.Check,Snippet.Eval, thendang.Describeon the result. For a lazy GraphQL handle, Describe adds:That hint is wrong when the snippet ends in an assignment the engine writes back, e.g.
chat = editor.install(…)orws = ws.withChanges(…). There the assignment is the whole point, and the engine applies it. While dogfooding, agents kept reading the hint as an instruction and adding.syncanyway.Fix
The fix is in Dang only, with no engine change:
GraphQLValuegets anAssigned boolfield, which Describe checks to skip the hint.Snippet.Evalreturns a copy of its result withAssignedset when the snippet's last form is aReassignmentwhose root binding (xinx = …orx.f = …) existed before the snippet, i.e. the snippet didn't declare it. The binding the assignment stored stays unmarked, so readingxlater still shows the hint.Reassignment.Evalis unchanged, so:let c = …; c = c.withExec(…)keeps the hint, since nothing ran and the local goes away with the snippet.GraphQLValue, so the mark never spreads. Nothing else reads the mark: equality, IDs and forcing ignore it.Tests in
describe_test.gocover:Caveat
"Binding from before the snippet" stands in for "a binding the caller writes back". These can differ: if a one-shot session assigns one of the module's own top-level bindings (
ctr = ctr.withExec(…)withModule.Eval), the result also loses the hint, even though the write is thrown away with the session. Fixing that exactly would need the caller to say which names it writes back (e.g. a set of names onSession). That means an engine change, so this PR leaves it out. At worst the effect is a missing hint.