Fix execution context and navigable lookup algorithms - #301
Open
emecii wants to merge 2 commits into
Open
Conversation
Two normative defects in algorithms that were introduced or partially fixed by earlier changes. `imperative execute steps` reads "If |inputObject| [=Object type|is not an Object=] is false", which inverts the intended condition: an Object input fails and a JSON scalar passes. The trailing "is false" is a leftover; PR webmachinelearning#251 writes the same construct without it. `notify documents of a tool change` and `getTools()` read HTML's [=Document/inclusive descendant navigables=] off a traversable navigable. HTML defines that operation for a Document (data-dfn-for=Document) and its own callers route through the traversable's active document. This completes the fix started in webmachinelearning#244, which corrected the same line from "descendant navigables" to "inclusive descendant navigables" but left the receiver wrong. `perform an observation` already does this correctly.
emecii
force-pushed
the
fix-tool-notification-scope-and-input-check
branch
from
September 7, 2026 15:55
d2e24de to
7dcbab9
Compare
The completion callback removes entries from the traversable's pending tool executions map. Its existing assertion says that it runs in parallel, but its callers commonly run on a Document event loop. Make the parallel execution explicit around the existing completion body so the mutation matches the map invariant. Fixes webmachinelearning#305.
emecii
force-pushed
the
fix-tool-notification-scope-and-input-check
branch
from
September 7, 2026 15:55
7dcbab9 to
e6e6376
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.
Fix three normative algorithm defects:
is falsefrom the input type check in imperative execute steps. It currently rejects Object inputs and lets non-Objects proceed.getTools().executeTool()completion body in parallel before it mutates the traversable's pending-executions map. Its former assertion required that context, while most callers run from a Document event loop.The navigation change completes the receiver correction left after #244 changed the notification traversal to be inclusive.
perform an observationalready uses the active Document.Fixes #305.
Validation:
bikeshed --print=plain --dry-run --die-on=warning spec index.bspassed without warnings after all three corrections. The diff changes onlyindex.bs; Bikeshed validates markup and references, while the algorithm changes were checked against the stated execution-context and traversal invariants.Preview | Diff