chore(worker): single-Worker topology; remove the Workflow binding, `entry.mjs`, the DO rate limiter and the `SELF` binding
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- backend, devops, infrastructure, testing
Hướng nghiên cứu
Start with crates/thrust-worker/wrangler.toml, wrangler.stage2.toml, and src/lib.rs, then trace the rate limiter through crates/thrust-adapters-cloudflare/src/lib.rs and crates/thrust-core/src/lib.rs. Review the named probes, contract tests, scripts, port comment, and architecture docs alongside the referenced ADRs. Done means the obsolete Workflow and rate limiter pieces are removed, the native binding and topology check are in place, and the listed contract and acceptance checks pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Context
crates/thrust-worker is already a single Worker: fetch, queue and scheduled in src/lib.rs:113, :166, :193, and two Durable Object classes, RateLimiterDo (src/durable.rs:26) and RoomDo (:79). Four pieces around it exist only for the role-split and workflow plans. main = "entry.mjs" (wrangler.toml:9) points at a 26-line JavaScript shim that defines the Workflow class ThrustWorkflow (entry.mjs:1-26). The [[workflows]] binding WORKFLOW is at wrangler.toml:80-83. The [[services]] binding SELF points the Worker at itself (wrangler.toml:75-77); two things use it, the service probe (src/probes.rs:87-92) and the shim's step.do callback (entry.mjs:21). The RATE_LIMITER Durable Object (wrangler.toml:45-55) sits behind DoRateLimiter (crates/thrust-adapters-cloudflare/src/lib.rs:187-223), and create_work_item calls it before every create (crates/thrust-core/src/lib.rs:235-243). wrangler.stage2.toml repeats all four (:52-62, :79-86).
Problem
- ADR-0090 is still
proposed, with Option 2 (role-split Workers) as the leading hypothesis (adrs/infra/0090-cloudflare-topology.md:38-40; Q-0090 open). FR-11 accepts Option 1 for P0 and the daily-use release: one Worker with fetch, queue, scheduled, static assets and placement. AcollabWorker is added only when the P1 room lands. - FR-05 withdraws the
WorkflowEngineport. That leaves no job for the shim, which is the only JavaScript in the Worker and the only live entry in the ADR-0006 non-Rust register (adrs/architecture/0006-runtime-language-and-framework.md:107,:111). Its exit plan, "when workers-rs ships a Workflow API", has no date (adrs/jobs/0071-workflow-port.md:122). - The DO limiter contradicts three accepted decisions. ADR-0033 accepted Option 1, the Workers Rate Limiting binding, in round 15 (
adrs/api/0033-rate-limiting-and-api-keys.md:31). D-007 accepts per-location, approximate limits with 10 s or 60 s periods (DEVIATIONS.md:15). ADR-0082 round 25 introduces no DO class for rate limiting at P0 (adrs/storage/0082-cache-and-session-port-kv.md:35). Meanwhile it adds one DO round trip to every create (research/0004§9, line 327). The port's doc comment still says the Cloudflare adapter is a Durable Object (crates/thrust-ports/src/lib.rs:213-214).
Proposal
- Delete
entry.mjsand setmain = "build/worker/shim.mjs"inwrangler.tomlandwrangler.stage2.toml, aswrangler.memory.toml:3already does. Remove the[[workflows]]and[[services]]blocks. Delete theserviceandworkflowprobes (src/probes.rs:87-143) andserde-wasm-bindgen(Cargo.toml:32), which only the workflow probe uses. - Replace
DoRateLimiterwith an adapter overenv.rate_limiter(..); workers-rs already supports the binding natively, as theratelimitprobe shows (src/probes.rs:54-64). Add a[[ratelimits]]binding for creates (for the contract cell,simple = { limit = 30, period = 60 }, matchingRATE_LIMIT=30inscripts/contract.sh:33). On Cloudflare the binding's configuration is the source of truth. The Worker root rejects anyTHRUST_RATE_WINDOW_SECSother than 10 or 60 at startup (ADR-0033:33). A refusal maps toLimited { retry_after_secs: period }. The native set keepsMemoryRateLimiterin process. - Remove
RateLimiterDo(src/durable.rs:22-73) and theRATE_LIMITERbinding. No deployed Worker carries thev1migration (the Stage 2 Worker was deleted,wrangler.stage2.toml:3), so editv1tonew_sqlite_classes = ["RoomDo"]. If one has been deployed by then, add av2migration withdeleted_classes = ["RateLimiterDo"]instead.RoomDostays as the P1 collab template. create_is_rate_limited_per_user(crates/thrust-contract-tests/tests/contract.rs:319-334) asserts an exact limit. The binding does not promise one: the deployed binding allowed 4 of 3 (tests/worker_only.rs:167-175). Use the target-agnostic bound the binding probe already uses. The firstlimitcreates pass, a 429 withRetry-Afterappears within2 × limit + 1creates, and another member is unaffected. Move the exact check into a unit test ofMemoryRateLimiter, and give the reason in the commit message (AGENTS.md rule 3, D-007).- Set
EXPECT_BINDINGSto 4 (scripts/contract.sh:40) and thebindingspass to 3 (scripts/stage2-contract.sh:49), and fix both headers. Updatedocs/src/architecture/infra.md:12-51,docs/src/architecture/app.md:84and the port comment.
Acceptance criteria
-
entry.mjsis gone, andgrep -nE 'workflows|\[\[services\]\]|RATE_LIMITER|RateLimiterDo|entry\.mjs' crates/thrust-worker/wrangler*.tomlprints nothing. -
grep -rn -e DoRateLimiter -e ThrustWorkflow crates docs/srcprints nothing. -
scripts/contract-all.shis green on all 16 cells, andworker-cf bindingsreportspassed=4 expected=4. -
create_is_rate_limited_per_userpasses onworker-cfagainst the binding. Control: with the binding's limit raised above2 × 30 + 1, it fails. - A topology check run by the
depsCI job fails on any[[workflows]]or[[services]]block, or on amainother thanbuild/worker/shim.mjs. It is shown failing on today'swrangler.toml. - ADR-0090 and ADR-0071 (round-29 notes) are cited in the PR. The ADR-0006 register no longer lists the Workflows shim as live.
References
- Review: .agents/plans/contrail/reviews/2026-10-19-fable-architecture-review.md (FR-05, FR-11)
crates/thrust-worker/wrangler.toml:9,:45-55,:75-83;crates/thrust-worker/wrangler.stage2.toml:3,:52-62,:79-86crates/thrust-worker/entry.mjs:1-26;src/probes.rs:54-64,:87-143;src/durable.rs:22-73;src/lib.rs:94crates/thrust-adapters-cloudflare/src/lib.rs:187-223;crates/thrust-ports/src/lib.rs:207-218;crates/thrust-core/src/lib.rs:235-246crates/thrust-contract-tests/tests/contract.rs:319-334;tests/worker_only.rs:162-220;scripts/contract.sh:13-14,:40;scripts/stage2-contract.sh:11,:49- ADR-0090 (round-29 note), ADR-0071 (round-29 note), ADR-0033 (round-29 note), ADR-0082, ADR-0006, ADR-0007; D-007; Q-0090, Q-0030.2
research/0004§9 (DO limiter cost);research/0006§13.5 (service-binding hop +2.3 to +2.8 ms)
Finding: FR-05, FR-11
- Ngôn ngữ chính
- Rust
- Star
- 0
- Fork
- 0
- Merge trung bình
- 1 giờ 35 phút
- Pull request đã merge (30 ngày)
- 67
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aRustyDev/thrust
-
area:process prio:p1 type:security
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:process bug prio:p1
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:process prio:p1
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:process prio:p1
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:process prio:p1
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aRustyDev/thrust
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
area:frontend kind:bug priority:p3 ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug priority: medium ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
storytold/vectorcraft#6333 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug lexer
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
yara-x fails to build with rsa 0.10.0: unresolved import rsa::Pkcs1v15SignCó thể đã có người làm @CfirTsabari đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 87/100
VirusTotal/yara-x#865 ·
Maintainer thường phản hồi trong vòng 1 ngày