Repository navigation
pm-console: edge says when a machine runs other code than Cloudflare, and for how long (#13833) - #16804
Merged
Conversation
…flare, and for how long (#13833) The edge now knows its own console tree: release.mjs stamps the released commit's tree beside VERSION (TREE var, pinned in tests via PM_RELEASE_TREE, read from the checkout otherwise, unstamped when a checkout cannot say). The Worker hands it to the edge as ownTree. On each machine report the edge compares the reported tree with its own and keeps when the difference began (host record for the first machine, mhost record for enrolled ones, read back on restart). The Machines answer carries treeDivergedFor once the difference has lasted five minutes (TREE_DIVERGED_MS); the Machines screen says 'It has run other code than Cloudflare for N min.' beside the existing commit saying, and redraws by the minute while it lasts. Nothing is said while either tree is unknown — an unstamped deploy or an older host behaves exactly as before. Tests (oracle: #13833's 'the Machines screen says when a machine has run other code than Cloudflare for longer than a few minutes'): edge.test.ts — diverged machine unsaid at 0 and 4 minutes, said at 6, kept across restarts, cleared when the machine comes onto the Worker's tree; matched tree and unstamped Worker never said. machines-multi.test.ts — the saying is per machine for an enrolled machine. app.test.ts — the screen's sentences. release.test.ts — a pinned tree is stamped in the upload vars.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
developing-today-fleet
Bot
deleted the
felix/13833-divergence-warning
branch
November 29, 2026 13:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The remaining slice of #13833's criterion 3: PR #15960 landed the reporting half (each machine's release tree reaches the edge and shows in Machines rows); this lands the comparison half the proto comment named as the follow-on.
What the edge knows now
release.mjsstamps the released commit's tree beside VERSION (aTREEvar, in both the upload and the full-deploy paths). The tree is read from the release checkout; tests pin it viaPM_RELEASE_TREE, mirroringPM_RELEASE_DEPLOYED_AT. A checkout that cannot say (an invented sha, no git) stamps nothing.env.TREEto the edge asownTree(validated as a full tree OID, like a reported tree).The comparison
hostrecord for the first machine, in themhost:<kid>record for enrolled machines — read back on restart, so the saying survives the edge's own restarts. A change to another differing tree does not restart the clock; a report of the Worker's own tree clears it.treeDivergedFor(ms) only once the difference has lasted five minutes (TREE_DIVERGED_MS— long enough that a machine mid-update, which follows within a minute or two, is never named). The Machines screen adds the sentence "It has run other code than Cloudflare for N min." beside the existing commit saying, and the screen's redraw mark tracks the duration by the minute.Tests (oracle: #13833, "the Machines screen says when a machine has run other code than Cloudflare for longer than a few minutes")
edge.test.ts: a diverged machine is unsaid at 0 and 4 minutes, said at 6 with the full duration, kept across an edge restart, and cleared when the machine comes onto the Worker's tree; a matched tree and an unstamped Worker are never said to diverge.machines-multi.test.ts: the saying is per machine — an enrolled machine is named with its duration; the first machine (no tree reported) is not.app.test.ts: the screen's sentences, alone and joined with the commit saying.release.test.ts: a pinned tree is stamped in the upload vars; unpinned runs stamp nothing (all existing argv expectations unchanged).Verification: remote fleet-command run at the PR head (bun test for the console suite) — link in the progress note on #13833. No feature flag: the saying is additive and silent until a deploy stamps TREE and a machine actually diverges.
Refs #13833 (criterion 3's comparison half; the issue stays open for its live half — the laptop's console following main in service, which is in service already per the 2026-11-24 record — and the criterion-2 loud-skip remainder tracked by #14080).
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-29T13:39:48Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": "/home/hatch", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/hatch", "repo": "developing-today/code", "branch": "main", "sha": "ac3f377b7f752f50918f491d7443b79e95b5dc34" }, "auth_subject": "felix", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.