Skip to content

Fix normative defects in tool registration, notification, and observation - #244

Merged
domfarolino merged 1 commit into
webmachinelearning:mainfrom
emecii:fix-spec-defects
Aug 17, 2026
Merged

Fix normative defects in tool registration, notification, and observation#244
domfarolino merged 1 commit into
webmachinelearning:mainfrom
emecii:fix-spec-defects

Conversation

@emecii

@emecii emecii commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Three normative fixes, each a case where the algorithm text does not do what the surrounding spec says it does, plus one editorial nit in the same area.

registerTool() writes to the struct instead of its tool map

Fixes #213

A [=model context=] struct has exactly one item, tool map, so indexing the struct itself by tool name is not well-defined. Every other algorithm reads through internal context's tool map — see unregister a tool, getTools(), and perform an observation.

perform an observation has an inverted assertion

Fixes #214

It asserts the traversable's active document is not fully active. A top-level traversable's active document is always fully active, and the algorithm then goes on to read that document's descendants, which only makes sense when it is. registerTool(), getTools(), and executeTool() all reject when a document is not fully active.

notify documents of a tool change skips the registering document

Fixes #215

Using descendant navigables excludes the tool owner's own navigable, so the document that registered the tool never receives toolchange. This contradicts the worked example immediately below the algorithm, which asserts that Parent toolchange always logs before Child toolchange for a registerTool() call on the top-level document. The two comparable algorithms — in getTools() and perform an observation — both use inclusive descendant navigables.

Editorial

Removes a stray possessive in perform an observation (|descendant|'s active document's.), matching the identical assignments in notify documents of a tool change and getTools().


All three normative issues were filed by @Aravindargutus. No new link targets are introduced — every construct used already appears elsewhere in index.bs.


Preview | Diff

…tion

- registerTool() now writes to the internal context's tool map rather than
  indexing the model context struct itself (webmachinelearning#213)
- perform an observation asserts the active document IS fully active,
  correcting an inverted assertion (webmachinelearning#214)
- notify documents of a tool change uses inclusive descendant navigables so
  the registering document receives toolchange (webmachinelearning#215)
- Editorial: drop a stray possessive in perform an observation

@domfarolino domfarolino left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching these tricky issues, much appreciated!

@domfarolino
domfarolino merged commit 3aafb9c into webmachinelearning:main Aug 17, 2026
2 checks passed
github-actions Bot added a commit that referenced this pull request Aug 17, 2026
)

SHA: 3aafb9c
Reason: push, by domfarolino

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants