feat(#5344): add CF Worker adapter and Wrangler config for mint#5427
Conversation
|
🤖 Finished Review · ✅ Success · Started 11:14 PM UTC · Completed 11:31 PM UTC |
Site previewPreview: https://a6e9537b-site.fullsend-ai.workers.dev Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ReviewFindingsHigh
Medium
Low
Previous runReviewFindingsHigh
Medium
Low
Previous run (2)ReviewFindingsHigh
Medium
Low
Previous run (3)ReviewReason: stale-head The review agent reviewed commit Previous run (4)ReviewFindingsMedium
Low
Previous run (5)ReviewFindingsLow
Previous run (6)ReviewFindingsMedium
Low
Previous run (7)ReviewFindingsMedium
Low
Previous run (8)ReviewFindingsHigh
Medium
Low
Labels: PR adds Cloudflare Worker adapter under internal/dispatch/cf/ for the token mint |
|
/fs-fix fix the review agent comments, but prefer to remain compatible with GCF behaviour when reviewer suggests otherwise |
|
🤖 Finished Fix · ✅ Success · Started 11:42 PM UTC · Completed 11:54 PM UTC |
- Use Go class from wasm_exec.js with proper importObject for WASM instantiation instead of bare WebAssembly.instantiate() which would throw a LinkError due to missing Go host imports - Add wasm_exec.d.ts type declarations for the Go WASM support class - Fix race condition in GoWasm.init() by replacing boolean flag with a shared Promise guard (initPromise ??= doInit pattern) - Make serializeRequest body parsing consistent with createFetchCallback (use method !== GET/HEAD instead of method === POST/PUT) - Add error handling around JSON.parse in createFetchCallback for improved debuggability - Align tsconfig.json module setting to ESNext to match repo convention Addresses review feedback on #5427
🔧 Fix agent — iteration 1 (human-triggered)Addressed 5 of 7 review findings (logic-error, race-condition, edge-case, module-system-consistency, error-handling-gap). Disagreed with 2: fail-open wildcard default kept for GCF compatibility per human instruction; missing-interface-spec deferred as premature before bridge implementation. Fixed (5):
Disagreed (2):
Tests: passed Decision points
Updated by fullsend fix agent |
E2E tests are runningAuthorization passed for this commit. See the E2E Tests workflow for results. |
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 12:29 AM UTC · Completed 12:45 AM UTC |
Superseded by updated review
|
/fs-fix review agent comments, some of your previous comments seems to imply the bridge between Go and JS is not complete? it probably aught to be, further issues are about deployment and tests so the implementation for the code that goes in the worker (as opposed to the code that deploys or tests it) should be rather complete after this |
|
🤖 Finished Fix · ✅ Success · Started 12:51 AM UTC · Completed 1:03 AM UTC |
🔧 Fix agent — iteration 2 (human-triggered)Addressed 6 of 8 review findings. Fixed: go.run() unhandled rejection, role name validation defense-in-depth, workers-types version drift, compatibility_date drift, missing type:module, cli-internals.md documentation. Disagreed with 2: AGENTS.md is a protected path, and ALLOWED_WORKFLOW_FILES wildcard default is intentional per ADR 0059. Fixed (6):
Disagreed (2):
Tests: passed Updated by fullsend fix agent |
- Add role name validation (validateRoleName) mirroring Go's mintcore.ValidateRoleName pattern for defense-in-depth - Add .catch() on go.run(instance) to surface Go runtime panics instead of silent unhandled promise rejections - Update @cloudflare/workers-types from ^4 to ^5 to match root package.json version - Update compatibility_date from 2025-01-01 to 2026-04-09 to match existing cloudflare_site Worker - Add "type": "module" to package.json for consistency with other package.json files in the repo - Add CF Worker adapter to cli-internals.md key source files table Addresses review feedback on #5427
|
/fs-fix #5447 has merged to
|
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 3:21 PM UTC · Completed 3:39 PM UTC |
|
/fs-fix Latest agent review is CHANGES_REQUESTED. Please address as follows (do not touch High — fix
High — disagree / no code change
Medium — disagree / out of scope for this agent
Lows — optional hygiene only if quick
Preserve poison-on-timeout, const |
|
🤖 Finished Fix · ✅ Success · Started 3:43 PM UTC · Completed 4:16 PM UTC |
Change AllowedWorkflowFiles default from "*" (any) to "" (empty) when the
env var is absent, matching standalone mint (cmd/mint) fail-closed behavior.
Go's SplitCSV("") produces an empty allowlist — operators must set the env
var explicitly to allow workflow files.
Add clearTimeout on handleFetch success path to prevent a leaked timer from
firing a spurious unhandled rejection after the request completes.
Set ALLOWED_WORKFLOW_FILES explicitly in vitest/miniflare bindings instead
of relying on a production wildcard default.
Addresses review feedback on #5427
🔧 Fix agent — iteration 3 (human-triggered)Fixed AllowedWorkflowFiles fail-open default (changed '*' to '' for fail-closed matching standalone mint), added clearTimeout on handleFetch success path, and set explicit ALLOWED_WORKFLOW_FILES in test bindings. Disagreed with 4 findings: PR title is correctly 'feat', CI workflow edits are out of scope for code agents, ESLint coverage is out of scope, and Promise.reject(string) is intentional Go-interop. Fixed (4):
Disagreed (4):
Tests: passed Decision points
Updated by fullsend fix agent |
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 4:27 PM UTC · Completed 4:45 PM UTC |
Superseded: AllowedWorkflowFiles fail-closed fixed; remaining HIGH (feat title) is intentional per COMMITS.md (new mint deploy platform); CI setup-go/node is a follow-up for workflow owners (mint-cf-worker-test already green).
|
/fs-review Please re-review current HEAD Prior actionable highs are addressed:
Please do not request changes solely for:
Lows/docs-only notes are fine as comment-only. |
Superseded by later review cycle; AllowedWorkflowFiles fixed on subsequent commits.
|
🤖 Finished Review · ✅ Success · Started 5:11 PM UTC · Completed 5:31 PM UTC |
Dismissing agent request-changes: (1) feat(#5344) title is intentional — CF Worker mint is a new deploy platform users can target (COMMITS.md). (2) mint-cf-worker-test workflow setup-go/setup-node is a follow-up for workflow owners; job is already green. No further remote code fixes planned for these.
Babysit checkpointSquash + rebase: done onto current CI: all green on HEAD Remote fix loop (post-squash):
Settled / deferred (no more
Ready for human review/merge judgment. |
ifireball
left a comment
There was a problem hiding this comment.
Approving after remote fix/review loop. Remaining open lows deferred/won't-fix as documented on the threads. Follow-up for mint-cf-worker-test setup-go/setup-node to be filed separately.
|
🤖 Finished Retro · ✅ Success · Started 7:34 PM UTC · Completed 8:19 PM UTC |
Retro: PR #5427Workflow: 9 review + 12 fix agent runs over 44 hours to ship a CF Worker adapter for mint (848 lines, 13 files). Key findingsReview quality gap: Human reviewer found 2 critical + 7 high-severity bugs the review agent missed entirely, including a deploy-blocking Fix rework: 33% of iterations addressed human-found issues, 25% handled scope changes from concurrent merges (#5447, #5481), 17% fixed bugs the fix agent itself introduced (iteration 7: timeout leak + broken test fixtures). The fix iteration cap (10) was hit, requiring manual squash-rebase that caused a regression in iteration 12. Positive: Review agent's persistent Evidence for existing issues
Proposals filed
|
Summary
Add thin TypeScript Cloudflare Worker adapter and Wrangler config under
internal/dispatch/cf/workersrc/, establishing the embeddable tree for the CF mint deploy provisioner (#5345). The adapter handles I/O only — all mint logic stays in Go via the mintcore WASM module.Related Issue
Closes #5344 (part of #5109)
Changes
src/index.ts: Worker fetch handler — loads mintcore WASM, routesPOST /v1/token/GET /health/GET /v1/statusto the WASM handler, provides PEM accessor (reads from Worker secrets) and fetch callbacks (wraps hostfetch) for outbound HTTPwrangler.toml: Wrangler config targeting*-mint-test.fullsend-ai.workers.devwithwasm_modulesbinding for the compiled mintcore WASM binarypackage.json: Minimal metadata with@cloudflare/workers-types, TypeScript, and Wrangler dev dependenciestsconfig.json: Strict TypeScript config for the Workers module formatDesign decisions:
internal/dispatch/cf/workersrc/(sibling ofgcf/mintsrc/), ready for//go:embedwithout relocation<ROLE>_APP_PEM), matching the issue requirement of no filesystem/GCP in the Worker pathglobalThis-registered functions (mintcoreInit,mintcoreHandleRequest) — the Go WASM bridge registers these viasyscall/jsTesting
make wasm-buildpasses (mintcore WASM build unaffected)go build ./...passesgo vet ./...passesinternal/dispatch,internal/dispatch/gcf)npm install(dev dependencies not installed in sandbox)Checklist
//go:embedfor fullsend mint deploy: Cloudflare platform mode (flags, env creds, embedded workersrc) #5345Closes #5344
Post-script verification
agent/5344-cf-workersrc)6ef9152c619fe81daeb47b3df138b2f72626d456..HEAD)