simlock seed makes and settles a kind's seed on a worker

Đang mở
#1,749 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
18/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
api, backend, cli, documentation, testing

Hướng nghiên cứu

Start with the contract manual for adding an operation, then trace component.install progress through src/daemon/server-requests.ts and the dispatcher tests in src/daemon/dispatcher-components.test.ts. The work spans the operation contract, daemon and gateway handlers, CLI, leasing, docs, and a real-device slow test; completion is defined by the listed unit, typecheck, contract-surface, website, and slow-lane commands passing.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

task:ready

Part of #1732.

Scope

An operator can run simlock seed <ios|android> <model> [--os] [--image-tag] [--json] on a worker to make and settle a kind's seed before anyone leases it, and the website documents it. The slow lane proves on real devices that copies of a settled seed do less work.

If this goes wrong, a user would notice simlock seed hanging past 60 minutes, an error that points at --allow-download, a refusal for a kind a lease accepts, or a gateway that tries to run it.

Technical spec

Commit fb426763.

Rows
  • Behaviours: B10, B11, B12, B13
  • Interfaces: I7, I8, I9 (and uses I4, I12)
  • Existing code: X19, X20, X21, X22, X23, X25
Facts
# Fact Source
F1 Adding an operation takes the family file, OPERATIONS, the role and effect matrices, the protocol bump, daemon and gateway handlers, the admin client, error rows and errors.mdx src/contract/operations.ts:220 (OPERATIONS), src/contract/protocol.ts:13 (PROTOCOL_VERSION_RANGE), src/contract/operations.test.ts:64, :162 (matrices)
F2 component.install's progress reaches the CLI as component-progress pushes keyed by request id src/daemon/server-requests.ts:532-549; src/contract/pushes.ts:85-95
F3 warm forget takes the platform as its first word src/cli/index.ts:25
F4 Worker-only operations answer UNSUPPORTED_IN_GATEWAY_MODE through unsupportedByDesign src/gateway/dispatcher.ts:268-274, :849-856
Modules touched

Searches: component.install, componentProgress, warm.forget, unsupportedByDesign, resolveSpec, RuntimeMissingError, PROTOCOL_VERSION_RANGE. New files: src/cli/commands/seed.ts, e2e/slow-seed-settle.test.ts. Also: src/daemon/dispatcher.ts (the handler map), src/daemon/dispatcher-options.ts and worker-composition.ts (the settler from createCore's seedSettler and leasing's resolveSeedSpec reach the handler), src/leasing/create-leasing.ts.

flowchart LR
  CLI[cli/commands/seed] --> AC[simlock-client admin]
  AC --> CT[contract seed.make]
  CT --> DD[daemon dispatcher]
  DD --> LR[leasing resolveSeedSpec]
  DD --> SS[core seed-settle settle]
  GW[gateway dispatcher] -.refuses.-> CT
Rules in play
  • contract manual "Adding an operation" and "Protocol version": one bump in this PR.
  • architecture.md rule 8: the CLI holds no decision; the daemon resolves, waits and answers.
  • architecture.md rule 11: the 60-minute limit counts from arrival.
  • documentation.md rule 9: cli.mdx, errors.mdx and worker/capacity.mdx describe simlock seed and settling in this PR.
  • src/instructions/index.ts: nothing tells an agent to run simlock seed; it is an operator command.
Tests

The operation is driven through the daemon dispatcher with a fake driver and the real settler, modelled on src/daemon/dispatcher-components.test.ts; the CLI through runCli with a fake admin client, modelled on src/cli/index-catalog-components.test.ts.

  • B10: simlock seed makes and settles a kind's seed: settled already; quick seed; no seed; another kind's settle running; this kind's background settle running; two calls for one kind; memory, disk and capacity waits; a failed make or settle; 60 minutes pass; --json
  • B11: simlock seed refuses what it cannot settle: no platform; unknown model; --image-tag with ios; a runtime not installed; iOS below 16; a gateway; an agent session; virtual devices off
  • B12: Ctrl-C stops the wait only: during waiting; during settling; doctor --json afterwards
  • B13: on real hardware a settled seed's copy does less work: Android under a quarter, iOS under three quarters and under 0.3 cores from minute 3

Done when

  • pnpm test:changed passes, with the B10 to B12 cases above.
  • pnpm typecheck passes.
  • PROTOCOL_VERSION_RANGE is one higher than after #1746.
  • pnpm test:e2e e2e/contract-surface.test.ts passes with seed.make probed.
  • pnpm --dir website install && pnpm --dir website build && node website/scripts/check-openapi.mjs passes, and cli.mdx, errors.mdx and worker/capacity.mdx describe simlock seed, SEED_SETTLE_FAILED and background settling.
  • Slow lane, on a Mac with an iOS 27 runtime and an Android SDK: scripts/slow-e2e.sh e2e/slow-seed-settle.test.ts passes (B13).

Out of scope

  • Pre-seeding from config; a warmPool.targets seed-only entry.

Depends on

  • #1746
  • #1747
  • #1748

Written by an agent.

Ngôn ngữ chính
TypeScript
Star
705
Fork
40
Merge trung bình
12 giờ 9 phút
Pull request đã merge (30 ngày)
376

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của callstackincubator/simlock

Tất cả issue của callstackincubator/simlock

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.