8000 feat(scaling): a unit that goes leaves the mesh by adeelahmad · Pull Request #669 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(scaling): a unit that goes leaves the mesh - #669

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-azm2mb
Oct 19, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-azm2mb

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Description

Before: when auto scaling let a unit go, or a launch failed, the machine's mesh node stayed on the Nodes page with a valid certificate and database user, and an unspent join token for it stayed usable for up to an hour. Docs listed "revoking a unit's mesh certificate when it goes" under Refine later.

After: a unit that goes (let go, failed, or never came up) leaves the mesh. Its unspent join token is withdrawn, and the node that joined with it is removed as on the Nodes page: its certificates go on the blocklist and its database user is removed. The ledger row for the terminate names the nodes taken off (off_mesh).

How: mesh.let_go_unit(db, name) finds the join tokens scaling made under the unit's name, revokes the unspent ones and calls mesh.remove for each live, non-primary node that joined with one. scaling._terminate and the failed-launch path call it through _unmesh, which logs and carries on if the mesh module is off or errors.

Motivation and Context

Adeel asked for auto scaling that "setups and manage every single thing". A machine let go shouldn't keep a way back into Lens.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (ruff, eslint, prettier).
  • I added or updated tests (test_a_unit_let_go_or_failed_leaves_the_mesh, test_a_scaling_unit_let_go_leaves_the_mesh_with_its_token with the real mesh and fake Nebula).
  • Documentation updated (docs/scaling.md Machines elsewhere and Refine later, docs/requirements.md).
  • Changelog fragment in changelog.d/scaling-unmesh.md.

Done questions (AGENTS.md)

  • Goal: merges on green CI.
  • Agents: it happens on every terminate, whoever asked for it (assistant, MCP, API or the scaler).
  • Zero setup: nothing to set up.
  • Fewest clicks: no click; nobody has to remove the node by hand.
  • Configurable: n/a, no new setting.
  • Light: a few queries per unit let go.
  • Private and secure: closes a way back in; threat model P-SCALING (md and yaml) says so.
  • Cost: n/a, no model or paid call.
  • User decides: only follows a terminate that was already decided; defaults unchanged.
  • Upgrades: no stored-data shape change.
  • Honest: docs say what is taken off and when; the Refine later line is gone.
  • Tested and documented.
  • Open: n/a, no new dependency.
  • Reported in the thread.
  • Reuse: mesh.remove, the same path the Nodes page uses.

Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALjNbLobvPe7VwvDL8j7V3
@adeelahmad
adeelahmad merged commit 80e6f53 into main Oct 19, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-azm2mb branch October 19, 2026 04:32
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

0