Skip to content

fix(webmcp): repair post-merge registration and fallback contracts - #52

Merged
erinepshovel-code merged 4 commits into
mainfrom
repair/webmcp-postmerge-contracts
Sep 1, 2026
Merged

erinepshovel-code merged 4 commits into
mainfrom
repair/webmcp-postmerge-contracts

Conversation

@erinepshovel-code

Copy link
Copy Markdown
Contributor

Post-merge repair for #51

Codex review landed after #51 merged and identified one P1 plus two P2 defects in the WebMCP surface. This PR repairs only those defects on current main@653e832a2dcf79bb24a1feb180c0d7acef22bdb2.

Repairs

  • use the browser WebMCP imperative API at navigator.modelContext rather than document.modelContext;
  • resolve the registry projection and display exact source provenance before returning in browsers without WebMCP support;
  • commit an exact clean-checkout bootstrap snapshot of The-Interdependency/skill-lib@260671303733a45c8f8d5563e41d8854e09856e6:skills.json (Git blob 7f71adeadac07a751b953c39e38dd78be599976f);
  • verify that bootstrap blob before normalizing it into the same provenance-bearing projection used by online refreshes;
  • add focused regression coverage for navigator registration, unsupported-browser source resolution, and clean-checkout fallback provenance.

Scope

Four files only: provider registration, registry collector, one committed bootstrap snapshot, and its tests. No write-capable WebMCP tool or authority transfer is introduced.

Validation

Repository CI is authoritative. The focused tests are part of npm test; the full Pull Request workflow must pass before merge.

hmmm

WebMCP remains browser/platform-dependent. Browsers without the API intentionally expose the truthful human-readable registry status without tool registration.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T12:54:31.490020Z 189468c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@erinepshovel-code
erinepshovel-code merged commit 6f83648 into main Sep 1, 2026
5 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 189468c77b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/webmcp.test.mjs
test('committed fallback snapshot is exact, usable on a clean checkout, and retains source provenance', async () => {
const snapshot = await readFallback();
assert.equal(snapshot.source.repository, 'The-Interdependency/skill-lib');
assert.equal(snapshot.source.commit, '260671303733a45c8f8d5563e41d8854e09856e6');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Do not pin refreshed snapshots to the bootstrap commit

In the pull-request and Pages workflows, npm run check runs the build before npm test; the build's prevalidate hook runs refresh:data, and a successful refresh:skills overwrites this snapshot with the current skill-lib HEAD. As soon as that HEAD differs from 260671..., readFallback() correctly returns the refreshed commit but this assertion fails, blocking checks and deployment despite the documented contract that online refreshes replace the bootstrap with the newest verified snapshot. Test the bootstrap through an isolated fixture or allow valid refreshed provenance here.

Useful? React with 👍 / 👎.

Comment on lines +124 to +125
const actualBlob = gitBlobSha1(text);
if (actualBlob !== BOOTSTRAP_SNAPSHOT_BLOB) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve snapshot bytes across Git line-ending conversion

On a clean checkout with core.autocrlf=true, such as a typical Windows checkout, Git can rewrite this JSON snapshot from LF to CRLF because the repository has no .gitattributes rule fixing its line endings. gitBlobSha1(text) then hashes the converted working-tree bytes, so this comparison rejects the otherwise exact committed bootstrap and OFFLINE=1 fails in the clean-checkout scenario this change promises to support. Enforce LF or binary treatment for the snapshot, or verify canonicalized bytes.

Useful? React with 👍 / 👎.

Comment thread src/assets/js/webmcp.js
Comment on lines +70 to +71
if (globalThis.__interdependencyWebMcpRegistered) {
return { registered: true, reused: true, registry: status };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reuse the registry that backs the registered tools

When this exported function is invoked again after the registry asset has changed, it fetches the new projection and calls updateSource(status) before reaching this reuse branch, but the already-registered tools are not replaced and their execute closures still reference the first registry. The page and returned registry therefore advertise the new commit while tool calls continue serving the old one; a failed refetch can also reject this reuse path even though the tools remain registered. Check the registration marker before reloading, or retain and return the status associated with the original registrations.

Useful? React with 👍 / 👎.

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.

1 participant