Skip to content

Fix execution context and navigable lookup algorithms - #301

Open
emecii wants to merge 2 commits into
webmachinelearning:mainfrom
emecii:fix-tool-notification-scope-and-input-check
Open

Fix execution context and navigable lookup algorithms#301
emecii wants to merge 2 commits into
webmachinelearning:mainfrom
emecii:fix-tool-notification-scope-and-input-check

Conversation

@emecii

@emecii emecii commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Fix three normative algorithm defects:

  • Remove the trailing is false from the input type check in imperative execute steps. It currently rejects Object inputs and lets non-Objects proceed.
  • Obtain the traversable's active Document before accessing Document-scoped inclusive descendant navigables in tool-change notification and getTools().
  • Run the 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 observation already uses the active Document.

Fixes #305.

Validation: bikeshed --print=plain --dry-run --die-on=warning spec index.bs passed without warnings after all three corrections. The diff changes only index.bs; Bikeshed validates markup and references, while the algorithm changes were checked against the stated execution-context and traversal invariants.


Preview | Diff

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
emecii force-pushed the fix-tool-notification-scope-and-input-check branch from d2e24de to 7dcbab9 Compare September 7, 2026 15:55
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
emecii force-pushed the fix-tool-notification-scope-and-input-check branch from 7dcbab9 to e6e6376 Compare September 7, 2026 15:55
@emecii emecii changed the title Fix inverted input type check and Document-scoped navigable lookups Fix execution context and navigable lookup algorithms Sep 7, 2026
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.

Run executeTool completion steps in parallel

1 participant