Skip to content

fix(pm-console): a machine's console runs from its own copy of main, fetched from GitHub - #14286

Merged
dezren39 merged 1 commit into
mainfrom
claude/pm-own-copy
Nov 24, 2026
Merged

dezren39 merged 1 commit into
mainfrom
claude/pm-own-copy

Conversation

@dezren39

@dezren39 dezren39 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

What was wrong

On the laptop the console ran from the checkout the fleet's lanes work in. That checkout is not kept at main: lanes leave it on their own branches with half-written files, and the unit that would pull main into it rightly refuses to. So the console in service was main's code from the day before, and from 08:39Z on 2026-11-24 another branch's code altogether (9c2b4ad096e3). The journal on the machine says what put it there: the console's own redeploy (redeploy: 9c2b4ad096e is in service), when the checkout was switched to that branch. #13833 has been passed over five times by five lanes; each found it still so.

What this changes

The source of truth for what a machine's console runs is GitHub's main, not a directory on the laptop.

  • The console runs from ~/.local/share/pm-console, which is its own:
    • repo/: a clone that fetches only main, and only the console's part of the tree;
    • releases/<commit>/: the console's files at one commit, with .release saying which commit and which tree;
    • current: a link to the release in service. The console's four services run from it.
  • redeploy.sh (every minute) asks GitHub for main. When the console's code there, one of its units, or the dashboard's list of pages is not what is in service, it lays the commit out as a release, starts it in a self-check with the service's own settings, and only then moves the link and runs the release's own install.sh.
  • install.sh installs the units, restarts the console and waits for it to answer its health check as that commit. The console now says which commit it was started from, read from the release.
  • A release that does not start, or does not come up, does not stay: the one before it is put back and the unit fails, where the Services screen and the notifications show it. That code is not tried again until main's console code changes.
  • GitHub out of reach changes nothing, and is a failure after half an hour.
  • It runs the same from anywhere; the first run on a machine makes the copy. A machine still on the old way moves itself the first time its old checkout holds this script.

How it was checked

  • Both scripts are run for real. GitHub is a bare repository reached over git's own protocol, allowing the partial fetches GitHub allows; the only stand-ins are the program that runs the self-check, systemctl, and the health check.
  • What is in service is compared with the files of the commit pushed to main, read back from git.
  • Run from inside a checkout that is on another branch with half-written files: main is what goes into service, and that checkout is left exactly as it was.
  • A damaged copy (link gone, clone pointed elsewhere, a file edited in place, a stray file) is made right from GitHub.
  • Faults planted one at a time, restored after each: 33 across the two scripts, all caught after one test was tightened.
  • On amd, with the repository's own tools: shfmt -i 2 -s -d no difference, shellcheck nothing.
  • bun test 564 pass; types; formatting; the self-check.

Not in this change

The edge still cannot tell by itself that a machine runs other console code than it does (each says a commit, and two commits can hold the same console). A release now records its console's tree, which is what the two sides would compare.

Refs #13833.


Generated by Claude Code


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…fetched from GitHub

On the laptop the console ran from the checkout the fleet's lanes work
in. That checkout is not kept at main, so the console in service was
main's code from the day before, and then another branch's altogether,
put into service by the console's own redeploy when the checkout was
switched to that branch (#13833).

- The console runs from ~/.local/share/pm-console: a clone that fetches
  only main and only the console's part of the tree, a release laid out
  for each commit, and a link to the one in service.
- redeploy.sh asks GitHub for main every minute. New console code is
  laid out as a release and started in a self-check; only then is the
  link moved and the release's own install.sh run.
- install.sh waits for the console to answer its health check as that
  release's commit. The console says which commit it was started from,
  read from the release.
- A release that does not start, or does not come up, does not stay:
  the one before it is put back and the unit fails. GitHub out of reach
  changes nothing, and is a failure after half an hour.
- The console's four services run from the link, and from no checkout
  anything else works in.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: def048a1-9030-40db-a0a8-2ee48b5ca602
Commits

Reviewing files that changed from the base of the PR and between 055411d and 742b557.

Files selected for processing: 14

  • doc/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core.md
  • planning/roadmaps/pm-stack.md
  • pm-stack/book/getting-started/installation.md
  • pm-stack/console/README.md
  • pm-stack/console/install.sh
  • pm-stack/console/redeploy.sh
  • pm-stack/console/src/server.ts
  • pm-stack/console/test/console.test.ts
  • pm-stack/console/test/install.test.ts
  • pm-stack/console/test/redeploy.test.ts
  • pm-stack/systemd/pm-console-android-release.service
  • pm-stack/systemd/pm-console-expose.service
  • pm-stack/systemd/pm-console-redeploy.service
  • pm-stack/systemd/pm-console.service
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants