Skip to content

FID-7: drive NUT worker between phases + install gmp/bcmath#2

Merged
GreicodexJM merged 2 commits into
mainfrom
feature/FID-7-interop
May 12, 2026
Merged

FID-7: drive NUT worker between phases + install gmp/bcmath#2
GreicodexJM merged 2 commits into
mainfrom
feature/FID-7-interop

Conversation

@GreicodexJM

Copy link
Copy Markdown
Owner

Summary

Closes the PHP-NUT-as-conformance-target gap. The symmetric suite's bucket 03 + 04 were failing in CI not because the PHP↔Go envelope contract is broken (the GREEN Go-NUT direction proves the wire shape is fine), but because:

  1. Nothing was running PHP's bin/worker.php between transmit and the runner's delivery poll, so transmit_message jobs stayed pending forever.
  2. brick/math (used by web-token's RSA-OAEP path) was falling back to a pure-PHP NativeCalculator without gmp/bcmath. A 4096-bit decrypt in that path runs ~3 minutes per envelope, far past the runner's worker timeout.

Both issues are fixed CI-side:

  • Pass --node-worker-cmd to the runner with the full env block PHP's worker needs to write to the same sqlite the NUT is using.
  • Add gmp + bcmath to the setup-php extensions list so brick/math picks GmpCalculator (single-digit ms per modPow).

The runner-side support for --node-worker-cmd and the portable message_id-baseline tests both live in GreicodexJM/fidex-conformance#1; this PR pins the suite checkout to that feature branch until it merges.

Test plan

  • PR CI run for this branch — bucket 01/02/03/04 all PASS, core profile job exits 0
  • After fidex-conformance#1 merges to master, revert the ref: pin in the conformance checkout step
  • Go-NUT direction (fidex-go-node conformance workflow on master) stays GREEN — verified independently after this lands

Linked: FID-7.

The conformance suite's bucket 03 (NUT outbound) and bucket 04 (NUT
inbound decrypt) need to drive the PHP queue worker between phases.
Without it, transmit_message jobs stay 'pending' forever and
inbound rows never advance past RECEIVED — both directions then
report false negatives even when the Go peer correctly delivered
the envelope.

Pass the cron drain command via --node-worker-cmd so the suite
spawns bin/worker.php between transmit/receive phases.

Also install gmp + bcmath in the setup-php step. brick/math (used
by web-token/jwt-framework for RSA-OAEP modPow) falls back to
NativeCalculator without one of these — and pure-PHP modPow on
4096-bit RSA routinely runs minutes per envelope, which makes the
worker hang inside the 60s drain budget. With gmp the same path
completes in single-digit milliseconds.
@GreicodexJM GreicodexJM merged commit bb9b355 into main May 12, 2026
3 checks passed
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