Skip to content

fix(access-context): a refused identity-less post names the call chain that issued it (Refs #5227) - #5693

Merged
meshweaver-cloud[bot] merged 2 commits into
mainfrom
fix/5227-guard-names-its-sender
Sep 25, 2026
Merged

meshweaver-cloud[bot] merged 2 commits into
mainfrom
fix/5227-guard-names-its-sender

Conversation

@rbuergi

@rbuergi rbuergi commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Refs #5227. This is an instrument, not the fix. The issue stays open until the sender it names is fixed.

Why

On memex-cloud ci.9291 (Plugins#2333 live), 47 identity-less GetDataRequests were refused in 6 h. All came from hub=portal/reads-{meshId}, with targets Store, Home, AgenticEngineering, SST, Pricing and LossModelling. That hub posts for every root-hub holder in the process: Blazor components, mesh singletons, and Rx callbacks. So the Error line cannot name the sender. Plugins#2360 fixed three candidate senders with deterministic repros, but the 09-24 comment says it did not establish that they are the production ones. There were also two cross-pod coincidences 0–4 ms apart that nothing explains.

What

UserServicePostPipeline's never-null guard runs synchronously inside Post. On the refusal path only, it now writes a companion Warning on a new category, MeshWeaver.AccessContext.PostSite:

  • The line carries hub, message and target, so it joins to the Error line.
  • It carries the call chain as Type.Method frames: no file info, at most 40 frames, with Rx, threading and async-machinery frames elided and counted.
  • The Error line's text is unchanged. It is the CI tripwire and the incident fingerprint, so this does not re-key Portal posts GetDataRequest to Home with no AccessContext — post is rejected at the identity gate #5227's incident or mint one per caller.
  • No bound or level changes, and nothing is retried or swallowed. The refusal is exactly as before.

Doc: Doc/Architecture/AccessContextPropagation, new section Reading a refusal: the Error names the HUB, the companion line names the CALLER.

Verification

  • New test: UnattributedPostNamesItsSiteTest checks three things. The refusal is still delivered as OnError. The Error line contains no frames. The companion line names UnattributedPostNamesItsSiteTest.IssueTheUnattributedProbe, the method that subscribed.
  • Negative control: with the LogWarning call disabled and the test kept, the test goes red with Expected collection to contain a single item … a refused post must say where it came from … but found 0.
  • MeshWeaver.Messaging.Hub.Test: 524/524 in Release.
  • dotnet build -c Release -warnaserror is clean for MeshWeaver.Messaging.Hub, MeshWeaver.Messaging.Hub.Test and MeshWeaver.Documentation.

After deploy

Once a roll carries this, run a Logs InstanceAction for "unattributed post site" on the memex-cloud ReplicaSet. The frames name each remaining portal/reads sender. Fix those at the source, the issue (Refs #5227) is resolved on a clean re-read of …-f-nullctx-reads.

No public type or member was removed and no interface member was added, so no Pairs-with or Implementers declaration is needed. No catalog key was added.

🤖 Generated with Claude Code

…n that issued it

The never-null guard's Error line names the SENDING hub. On portal/reads-{meshId}
that hub stands for every root-hub holder in the process, so 47 refusals in 6 h on
memex-cloud (#5227) could not be tied to a sender. The guard runs synchronously
inside Post, so it now writes a companion Warning on its own category
(MeshWeaver.AccessContext.PostSite) that carries the post's call chain. The Error
text and the incident fingerprint stay unchanged.

Refs #5227

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Address the two moderate performance concerns around eager logger creation and unguarded stack capture.

Review effort: Lite
Findings: None

What changed in this PR

Adds caller-site diagnostics for identity-less post refusals while preserving existing refusal behavior and error logging.

Changes:

  • Adds bounded, filtered call-chain warning diagnostics.
  • Adds regression coverage for refusal and caller attribution.
  • Documents how to correlate diagnostic logs.
File Summary
test/​MeshWeaver.Messaging.Hub.Test/​UnattributedPostNamesItsSiteTest.cs Verifies refusal delivery and caller diagnostics.
src/​MeshWeaver.Messaging.Hub/​MessageHubConfiguration.cs Adds companion warnings and stack formatting; logger creation and stack capture should be deferred or guarded for performance.
src/​MeshWeaver.Documentation/​Data/​Architecture/​AccessContextPropagation.md Documents diagnostic interpretation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

443 tests   443 ✅  1m 0s ⏱️
  2 suites    0 💤
  2 files      0 ❌

Results for commit 9086328.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

550 tests   550 ✅  1m 9s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 9086328.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

  1 files    1 suites   3m 10s ⏱️
345 tests 345 ✅ 0 💤 0 ❌
349 runs  349 ✅ 0 💤 0 ❌

Results for commit 9086328.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

    2 files      2 suites   6m 33s ⏱️
2 636 tests 2 636 ✅ 0 💤 0 ❌
2 637 runs  2 637 ✅ 0 💤 0 ❌

Results for commit 9086328.

♻️ This comment has been updated with latest results.

…ack only when the Warning is written

Copilot review on #5693: no per-hub logger at pipeline build, no stack walk when Warning is disabled.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

1 647 tests   1 647 ✅  9m 14s ⏱️
    2 suites      0 💤
    2 files        0 ❌

Results for commit 9086328.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

    5 files      5 suites   14m 45s ⏱️
3 491 tests 3 491 ✅ 0 💤 0 ❌
3 495 runs  3 495 ✅ 0 💤 0 ❌

Results for commit 9086328.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   13 files     13 suites   35m 53s ⏱️
9 112 tests 9 112 ✅ 0 💤 0 ❌
9 121 runs  9 121 ✅ 0 💤 0 ❌

Results for commit 9086328.

♻️ This comment has been updated with latest results.

@meshweaver-cloud
meshweaver-cloud Bot added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit d2259c0 Sep 25, 2026
67 of 69 checks passed
@rbuergi
rbuergi deleted the fix/5227-guard-names-its-sender branch October 10, 2026 13:10
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.

2 participants