Skip to content

OUTERLOOP_AUTO_UPDATE: deploy update policy — off by default, release, or main - #331

Merged
renmengye merged 3 commits into
mainfrom
feat/auto-update-policy
Sep 8, 2026
Merged

renmengye merged 3 commits into
mainfrom
feat/auto-update-policy

Conversation

@renmengye

Copy link
Copy Markdown
Member

What

OUTERLOOP_AUTO_UPDATE is the deploy step's update policy, read from .env before the fetch so a change needs no chain restart:

  • off (default): the checkout stays as it is. An adopter installs a release and upgrades when they choose.
  • release: fetch the public repo's v* tags and move to the newest by version order (at one X.Y.Z a final release beats rc beats alpha beats dev). No credential needed.
  • main: follow every merge, as before. This is for the kernel's own developers; the lab deployment sets it.

Why

The deploy step pulled main whenever a PAT file was present. That couples "has a bot PAT" to "runs unreleased code", which is right for us and wrong for an adopter. Following every merge stays an internal thing; external auto-update, when opted into, stays at release level.

Notes

  • The environment rollback logic is unchanged: whatever moved the checkout, the venv is synced to the commit that is checked out, or the deploy goes back to the pair that matched.
  • init writes OUTERLOOP_AUTO_UPDATE=off into a Slurm deployment's .env so the knob is visible where it is set. The local loop runs the installed package and is upgraded by hand (docs say how).
  • The .env trust check (owner, not group/world-writable) is factored into one place and now also works with BSD stat, so the deploy tests run on a Mac.
  • Tests: default fetches nothing even with a PAT; release picks v0.2.0a1 over v0.2.0.dev1, v0.1.1, v0.1.0, v0.1.0rc1, v0.1.0.dev10 and ignores vlatest/v1; at-tag stays put; no tag runs previous code; main authenticates through GIT_ASKPASS and the PAT never appears in argv; the .env line wins over the environment in either spelling; an unknown value is off and says so.

🤖 Generated with Claude Code

renmengye and others added 2 commits September 7, 2026 21:42
…lt, release, or main

The deploy step used to pull main whenever a PAT file was present. That is
the right behaviour for the kernel's own developers and the wrong one for
an adopter, who installs a release and upgrades when they choose. The
policy is now explicit, read from .env before the fetch so a change needs
no chain restart:

- off (default): the checkout stays as it is.
- release: fetch the public repo's release tags and move to the newest by
  version order (dev/rc pre-releases count). No credential needed.
- main: follow every merge. The lab deployment sets this.

The environment rollback logic is unchanged: whatever moved the checkout,
the venv is synced to the commit that is checked out or the deploy goes
back to the pair that matched. init writes the default for Slurm
deployments; the .env trust check now also works with BSD stat.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 1 — reviewed head 0f2d6cb7 — reviewer summarizer:hermes/gpt-5.6-terra over coverage+credentials+deployment+general+lifecycle+prose.

terra
Advisory findings from outerloop — the code owner decides. Reply to disagree; the outerloop:no-review label opts this PR out.

Verdict: 1 blocking, 1 advisory.

1 finding attached to the lines below.

A failed sync runs manually upgraded code on the old environment. [deployment+prose] With off, DEPLOY_PREV stays empty, so a manual checkout update followed by a failed uv sync takes this branch and leaves the new checkout running on the old environment. (scripts/tick_deploy.sh:142; high confidence)

Verdict: one blocking off-policy sync-failure issue and one advisory release-tag selection issue. Merged duplicates: deployment and prose agree on scripts/tick_deploy.sh:142; credentials, general, and lifecycle agree on scripts/tick_deploy.sh:107–108. Rejected findings: none; coverage reported no findings.

Comment thread scripts/tick_deploy.sh Outdated
…ced commit; release tags come from the public remote

- A successful sync records the installed commit beside the environment
  (.venv/.synced-head), and a failed sync rolls back to that commit rather
  than to "HEAD before the fetch". A checkout the operator moved by hand
  under the off policy now gets the same code-and-environment guarantee.
  Without a record the checkout stays, as before.
- The release policy asks the public repo for its tags (ls-remote), picks
  the newest, fetches only that tag with a forced update and resets to it;
  the checkout's own tags are never consulted, so a stale or local v-tag
  cannot be chosen.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@renmengye

Copy link
Copy Markdown
Member Author

Round 1's blocking finding (tick_deploy.sh:142, no thread was attached): fixed in af75951. A successful sync now records the installed commit beside the environment (.venv/.synced-head) and a failed sync rolls back to that commit, not to "HEAD before the fetch". A checkout the operator moved by hand under the off policy gets the same code-and-environment guarantee; without a record the checkout stays, as before. Tests: hand-moved checkout with a differing lockfile rolls back to the recorded commit with no fetch; a successful sync writes the record; no record keeps the checkout.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 1 — reviewed head af75951b — reviewer hermes/gpt-5.6-terra.

terra
Advisory findings from outerloop — the code owner decides. Reply to disagree; the outerloop:no-review label opts this PR out.

Verdict: nothing blocking — 1 advisory note.

1 finding attached to the lines below.

A first deploy without the new sync record does not preserve the claimed code-and-environment pairing after a manual checkout change.

Comment thread scripts/tick_deploy.sh
@renmengye
renmengye merged commit a45b267 into main Sep 8, 2026
5 checks passed
@renmengye
renmengye deleted the feat/auto-update-policy branch September 8, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

outerloop:review re-request the advisory review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant