Every daemon knows the latest Simlock version, and simlock status says when a newer one exists
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 57/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- nodejs, typescript
調査の方向性
Start with #836 and its isNewerVersion rule, then read the listed contract schemas and operations, protocol, daemon main and dispatcher, gateway dispatcher and aggregate, config, CLI format, and the cited docs. Use the startDaemon seam in src/daemon/main.test.ts with FakeNpmCli and FakeClock, then exercise the CLI cases in src/cli/index.test.ts. Done means the specified daemon, gateway, failure, timing, config-off, and status output cases pass, and the configuration docs include update.check.
索引モデルが issue の本文から書いたものです。
説明
Part of #825.
Scope
Every daemon, worker or gateway, learns npm's latest Simlock version at start and every 24 h after. It reports it as status.get daemon.latestVersion and in the frozen daemon.update answer, and simlock status says when it's newer. update.check: false turns this off. It reads #836's isNewerVersion, the one "newer" rule. Shared values: update.check, the "newer" rule, the latestVersion field, the npm port, the protocol version.
In short
simlock status prints Simlock: 0.3.0 (0.4.0 available) once the daemon has seen a newer latest on npm. The check doesn't delay startup. The rule is "newer" by semver, comparing numbers first, so 0.10.0 beats 0.9.0. A release beats its own prereleases, so 0.4.0 beats 0.4.0-rc.2. Prereleases compare by their dot parts, numbers as numbers, so rc.10 beats rc.2.
flowchart LR
T[start, off the start path; then every 24 h] -->|update.check true| V[NpmCli.view simlock version]
V -->|ok| L[latestVersion]
V -->|fails| K[keep last value, warn log]
L --> S[status.get + daemon.update answer] --> P[simlock status line]
| Running | npm latest |
simlock status line |
|---|---|---|
| 0.3.0 | 0.4.0 | Simlock: 0.3.0 (0.4.0 available) |
| 0.9.0 | 0.10.0 | Simlock: 0.9.0 (0.10.0 available) |
| 0.4.0-rc.2 | 0.4.0 | Simlock: 0.4.0-rc.2 (0.4.0 available) |
| 0.4.0 | 0.4.0 | Simlock: 0.4.0 |
| 0.5.0-rc.1 | 0.4.0 | Simlock: 0.5.0-rc.1 |
| 0.3.0 | not known | Simlock: 0.3.0 |
If this task goes wrong, a user would notice a missing or wrong "available" notice.
Technical spec
Facts
| # | Fact | Source |
|---|---|---|
| F1 | npm view simlock version prints npm's latest tag (0.2.0; npm view simlock dist-tags --json → {"latest":"0.2.0"}) |
ran 2026-10-21 |
| F2 | NodeNpmCli runs npm with the daemon's Node, in its data directory, with a 30 s limit on view |
#835 Modules touched |
| F3 | A config key needs a type, a default and a validator entry in config.ts, plus a configSchema entry, or config.get drops it |
src/core/config.ts:336, 915, 1080; src/contract/schemas.ts:991; src/core/config.test.ts:2197 |
| F4 | compareVersions compares dotted numbers only and ignores prereleases; there's no semver dependency |
src/contract/os-range.ts:124-135; package.json |
| F5 | startDaemon composes both roles and is driven in main.test.ts |
src/daemon/main.ts:182-186, 765; src/daemon/main.test.ts |
| F6 | daemon start waits 20 s for the daemon to answer |
src/ports/daemon-launcher.ts:51 |
Modules touched
Searches: rg "readonly log:", rg "configSchema", rg "compareVersions" (os-range, its tests).
src/contract/schemas.ts and operations.ts (latestVersion filled in), src/contract/protocol.ts, src/daemon/version-check.ts (new), src/daemon/main.ts (both roles), src/daemon/dispatcher.ts, src/gateway/{dispatcher,aggregate}.ts, src/core/config.ts, src/cli/format.ts, website/src/content/docs/docs/reference/configuration.mdx, website/src/content/docs/docs/reference/cli.mdx, src/daemon/AGENTS.md.
Contract and event changes
This PR bumps the protocol by one, because latestVersion changes from always null to a value and the config schema gains a key. latestVersion is a string ≤ 64 matching #836's version pattern, or null. An npm answer that doesn't match keeps the last value. No events.
Failure modes
| Call | Outcome | What happens | Limit, counted from |
|---|---|---|---|
NpmCli.view |
ok | latestVersion set |
30 s |
NpmCli.view |
error, timeout or bad answer | last value kept, warn log line |
30 s |
Nothing is stored. A restart checks again. The 24 h timer is cancelled in dispose, so a stopping daemon doesn't wait for it.
Rules in play
- ADR 0042 §12: "at start and every 24 h after, unless
update.checkis false". - architecture rule 10: one "newer" rule,
isNewerVersionfrom #836.
Tests
Seam: startDaemon (src/daemon/main.test.ts) with an injected FakeNpmCli and FakeClock, both roles. The CLI is driven through src/cli/index.test.ts.
- Daemon runs the version check: at start without delaying ready, then after 24 h; newer found (
latestVersioninstatus.getand thedaemon.updatequery); npm fails or answers junk (last value kept);update.check: false(never runs,null); gateway role (same, read throughstatus.get). - Operator reads
simlock statuswith a known latest: the six rows of the table above.
Done when
pnpm test:changedpasses (it runs the unit tests under src/daemon src/cli src/core src/contract).- CI's check job passes.
website/src/content/docs/docs/reference/configuration.mdxhas theupdate.checkrow, andreference/cli.mdxthesimlock statusnotice.
Out of scope
- The per-worker notice (#838) and the console (#839). Updating automatically.
Depends on
- #836
Written by an agent.
- 主要言語
- TypeScript
- スター
- 22
- フォーク
- 2
- 平均マージ
- 7時間 38分
- マージ済み PR(30日)
- 413
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
callstackincubator/simlock のほかの issue
-
bug:ready
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
callstackincubator/simlock#639 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
A lease renew right after a gateway restart answers UNKNOWN_LEASE and the client drops the leaseオープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
callstackincubator/simlock#983 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
iOS simulators can live in Xcode's device set (drivers.ios.deviceSet)対応中かも @V3RON が今日担当しました。 オープンtask:blocked
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
callstackincubator/simlock#968 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
feature:planned
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
callstackincubator/simlock#962 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
request:new
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
callstackincubator/simlock#948 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
callstackincubator/simlock の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
MoonshotAI/kimi-code#4398 ·
メンテナーはふだん 1 日以内に返信
-
Xiaomi Mimo语音识别服务异常オープンpending triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
package-lock.json : les binaires natifs macOS et Linux de unrs-resolver ont disparu depuis #1823オープンbug dependencies
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
AxaFrance/design-system#2064 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100