Repository navigation
List modules' read tools and allow WAM scope patterns - #10
Merged
Merged
Conversation
Stage 2 needs the Teams module's own tools to reach agents, and a SharePoint token whose audience is the user's own tenant, which no manifest built once for everyone can spell out. The registry now lists the read tools of active modules as <module>_<tool>, with an optional account the core adds and resolves. The core checks the arguments against the declared schema, the read permission before the call and again after it for the same account, drops items of conversations the agent may not read, and takes only a JSON object of at most 1 MiB back. Write tools, bad names, names taken twice or by a core tool, schemas the core cannot check and schemas declaring account are not listed; status says why. Every MCP session hears tools/list_changed when the list changes, from a scan or from the host stopping a module after crashes. A WAM scope may now be https://*.<domain>/.default, checked at load like a host pattern; it covers one lowercase DNS label on the module's host list and nothing else. Literal scopes compare as before. The scope check now runs before the tests' fake WAM too, and the approval window says what the SharePoint pattern hands over.
Review of fc631e3 (Codex, GLM): a module file that declared, say, `read` + `messages` made every read_messages call end as that module's unknown or disabled tool, even while the module waited for approval. A core tool's name now never routes to a module. Codex also found that the declaration checked was read before the account's module handle was taken: a replacement approved in between could run a tool that writes in the new version under the read permission. The call now goes ahead only if the module it reaches declares the very same tool.
Since main gained the window languages (#8), every Polish literal of the daemon needs its English beside it. The approval's text for a WAM scope pattern was Polish only; it now follows the window's language, with a test of both.
This was referenced Nov 3, 2026
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.
Change
Stage 2 (Teams meetings and transcripts) needs two things from the core that a module could not do before.
Module read tools in the registry. A module can declare its own tools in its manifest. The registry lists the read tools of active modules as
<module>_<tool>, over both MCP and the CLI, with an optionalaccountthat the core adds and resolves.The core enforces the rules, not the module:
Some declared tools are not listed, and
statussays why: write tools, bad names, names declared twice or taken by a core tool, schemas the core cannot check, and schemas that declareaccount. Every MCP session getstools/list_changedwhen the list changes, whether from a scan or because the host stopped a module after crashes.A module tool never shadows a core tool. A call goes ahead only if the module it reaches still declares that very tool. Without this, a replacement approved in between could run a tool that now writes, under the read permission.
WAM scope patterns. A WAM scope may now be
https://*.<domain>/.default, checked at load like a host pattern. It covers one lowercase DNS label on the module's host list and nothing else. Literal scopes compare as before. The approval window says what the SharePoint pattern hands over (Sites.FullControl.Allincluded), in the window's language. That text is the one commit added after the split (8e696e1): since #8, every Polish literal of the daemon needs its English beside it.This is the first of three stacked pull requests split from one working branch. The Teams meetings and transcripts PR is based on this branch.
Spec
.specs/2026-10-28-meetings-transcripts.md, sections 5.1 and 5.2, already onmain(8ebb79c). Codex and GLM both approved it in R10, and again in R18 after later changes.Tests
crates/open-mess/tests/shared_tools.rs,tests/modules.rs,tests/channel.rsandsrc/tools/extra.rscover:tools/list_changed,crates/open-mess-host/tests/sign_in.rsandtests/load.rscover scope patterns at load and at sign-in. Literal scopes are unchanged. A pattern outside the host list, or one that covers more than one label, is refused.src/ui/commands.rs,wam_scopes_in_both_languages: the approval text in Polish and in English.cargo xtask ci(CARGO_BUILD_JOBS=3): fmt, clippy-D warnings, the wasm module build and tests all green, 556 passed, 0 failed.Commit reviews
3148814(cherry-pick offc631e3, differs only in context lines):fc631e3): a module tool named like a core tool shadows it.3220c13.3220c13(same patch as4567b6e): Codex APPROVE. GLM APPROVE with one P3: no test for the "module changed meanwhile" guard. Not fixed, because the race needs a module replaced in the middle of a call.8e696e1: Codex APPROVE, GLM APPROVE.Each commit is recorded in
.reviews/<sha>.processed.Coexistence (platform modules only)
Not applicable: this changes the core and the host. The Teams module starts using it in the next PR.
Checklist
unwrap/expect/panic!/ unchecked indexing in non-test code