Repository navigation
Pin the over-cap well-known handling offline, at the resolver - #238
Merged
Merged
Conversation
`resolve_app_identity_skips_probe_for_known_apps` resolved oisy.com and expected `DerivationSource::Known`. oisy.com now publishes its own /.well-known/ii-derivation-origin (`https://oisy.com`), and the app's own declaration deliberately wins over the registry, so it resolves as `Declared` and the test failed on main and on every PR. The test also pinned the over-cap Layer 5 regression on oisy.com serving its SPA shell there, which it no longer does. - The live test now checks three registry apps that still declare nothing (nns.internetcomputer.org, multidex.ai, app.icpswap.com). Each must resolve to its registry derivation origin, unprobed, either via the registry (`Known`) or via its own agreeing declaration (`Declared`), and at least one must still go through the registry. One app adopting the declaration no longer breaks the test. - The over-cap regression gets an offline test, `an_over_cap_layer5_body_reads_as_no_declaration`: a loopback listener serves an oversized page, and `fetch_well_known` must read it as `Absent` under `Overflow::NotTheDocument` and `Unreachable` under `Overflow::Unknown`. - `Overflow::NotTheDocument`'s doc no longer says OISY serves that page. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VP2vTJm9ipTPD18xW9HyVG
Merged
6 of 7 tasks
aterga
pushed a commit
that referenced
this pull request
Nov 10, 2026
main now carries #237's fix for the stale oisy.com discover test, so the copy of #238's version this branch carried is dropped in favour of main's discover.rs, and #200's auth.rs changes merge cleanly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VP2vTJm9ipTPD18xW9HyVG
There was a problem hiding this comment.
🟡 Changes recommended
The offline test supplies Overflow::NotTheDocument directly, so it would miss a regression in resolve_declared_origin that restores resolution failures for oversized pages.
1 open issue
What changed in this PR
Updates imcp2-core identity-discovery tests to tolerate known apps publishing derivation-origin declarations, while moving oversized-response regression coverage offline.
Changes:
- Checks three registry apps, accepting matching
KnownorDeclaredresults while requiring at least one registry fallback. - Adds a loopback regression test for both overflow policies.
- Replaces the OISY-specific doc comment with a reference to the offline test.
| File | Description |
|---|---|
crates/imcp2-core/src/discover.rs |
Revises live known-app checks, adds offline overflow coverage, and updates documentation. |
Review effort: Max
main fixed the stale oisy.com test in #237 (pinned on multidex.ai), so this takes main's discover.rs as-is; the offline coverage follows on top. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VP2vTJm9ipTPD18xW9HyVG
The only coverage of how `resolve_declared_origin` treats an over-cap well-known body was the live test on multidex.ai, which holds only while that site keeps serving its SPA shell at the Layer 5 path (oisy.com stopped, and the test broke). Two loopback tests now drive the resolver itself, so the overflow policy it picks for each path is pinned too: - `an_over_cap_layer5_page_declares_nothing`: an SPA page over MAX_DERIVATION_ORIGIN_BYTES at /.well-known/ii-derivation-origin and no legacy manifest resolve to the application-origin default, not a failed check. Fails if the Layer 5 probe's policy becomes `Overflow::Unknown`. - `an_over_cap_legacy_manifest_is_not_read_as_absent`: an over-cap /.well-known/ic-app.json makes resolution refuse, rather than default past a declaration it may carry. Fails if the legacy probe's policy becomes `Overflow::NotTheDocument`. `serve_paths` is the small loopback server both use; the resolver is called directly because `resolve_app_identity`'s SSRF guard refuses loopback. The `Overflow::NotTheDocument` doc no longer says OISY serves that page. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VP2vTJm9ipTPD18xW9HyVG
aterga
marked this pull request as ready for review
November 16, 2026 20:56
sea-snake
approved these changes
Nov 17, 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.

Summary
Right now, only the live test on multidex.ai checks how
resolve_declared_origintreats an over-cap well-known body. That coverage lasts only while multidex.ai keeps serving its SPA shell at/.well-known/ii-derivation-origin. oisy.com already stopped doing that, which is what broke the test and led to #237.This PR adds two offline tests that drive the resolver itself against a loopback server. They pin both the behavior and the overflow policy the resolver picks for each path, and no longer depend on what a live site serves.
The live test from #237 is unchanged and still checks real-world behavior. This PR originally reworked that live test. Since #237 fixed it on
main, the branch now mergesmainand keeps only the offline coverage.Related issues
Follow-up to #237.
Changes
All changes are in
crates/imcp2-core/src/discover.rs: two tests, a test helper, and one doc comment.an_over_cap_layer5_page_declares_nothingMAX_DERIVATION_ORIGIN_BYTESat the Layer 5 path, and no legacy manifest.AppUrlDefault). It must not be read as a failed check, a mistake that once refused to resolve healthy apps.Overflow::Unknown.an_over_cap_legacy_manifest_is_not_read_as_absent/.well-known/ic-app.json.Overflow::NotTheDocument.serve_paths: a smallstd::net::TcpListenerserver that answers by path and returns 404 for anything else.resolve_declared_origindirectly, becauseresolve_app_identity's SSRF guard refuses loopback.no_proxy(), so the tests also run behind an HTTP proxy.Overflow::NotTheDocumentdoc: no longer says OISY serves that page. It now points to the offline test.This addresses Copilot's review point: the previous version tested
fetch_well_knownwith the policy passed in, so it would have missed the resolver choosing the wrong policy.Testing
resolve_declared_origin, and passes otherwise.cargo build --locked --all-targetscargo test --locked --workspace --all-targets: all pass (imcp2lib 90, bin 8, routers 11;imcp2-core219;imcp2-local21).cargo fmt --all/cargo clippy --workspace --all-targets(tree is warning-free)npm test --prefix monitoring/mcp-status(n/a, dashboard untouched)Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01VP2vTJm9ipTPD18xW9HyVG