Skip to content

fix(demos): wait for the gateway to bind instead of sleeping - #34

Merged
imran-siddique merged 1 commit into
mainfrom
fix/demo-startup-readiness
Aug 3, 2026
Merged

fix(demos): wait for the gateway to bind instead of sleeping#34
imran-siddique merged 1 commit into
mainfrom
fix/demo-startup-readiness

Conversation

@imran-siddique

Copy link
Copy Markdown
Contributor

What

Demos 1-5 and the web console started their subprocesses and then slept a fixed 1-2 seconds before the first call. cMCP Runtime 0.3.0 does attestation and audit setup before it binds :8443, so on a cold start every cMCP demo failed with ConnectionRefusedError / URLError on its first tool call. Demo 3 then failed too, since it reads demo 1's claim.

They now poll the port until it accepts, with a 60s ceiling and an error that points at the *.log files.

Also corrects demo-05's module docstring, which still said "Demo 4: context-aware enforcement".

Verified locally

python demo.py --no-pause — all 9 demos pass, exit 0:

  • demo 1: write/read allowed, list_dir 403 POLICY_DENY, signed claim written
  • demo 2: v2 write denied, policy_bundle.hash FAIL against the pinned v1 hash and PASS against v2
  • demo 3: offline verify partially_verified, all crypto checks pass
  • demo 4: write_file allowed in invoice-run, 403 in chat-freeform, read allowed in both
  • demo 5: BAA guardrail denies the non-covered tool
  • demos 6-9: unchanged (WCM 0.23.0)

Web console: all three obligors run through the real financial-services example; the €750k write is blocked citing EBA/GL/2020/06 under the approved bundle, allowed under the tampered bundle, and that record then fails policy_bundle.hash against the pinned approved hash.

🤖 Generated with Claude Code

Demos 1-5 and the web console started their processes and then slept a
fixed 1-2 seconds. cMCP Runtime 0.3.0 does attestation and audit setup
before it binds, so on a cold start the first tool call hit a refused
connection and every cMCP demo failed. Poll the port instead, with a
60s ceiling and a message pointing at the logs.

Also fixes demo-05's docstring, which was copied from demo-04.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@imran-siddique
imran-siddique merged commit d1ca016 into main Aug 3, 2026
3 checks passed
@imran-siddique
imran-siddique deleted the fix/demo-startup-readiness branch August 3, 2026 20:12
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