deslop: structural sweep — derive state from facts, one owner per policy, delete test-shaped seams - #24
Open
pythonlearner1025 wants to merge 6 commits into
Open
deslop: structural sweep — derive state from facts, one owner per policy, delete test-shaped seams#24pythonlearner1025 wants to merge 6 commits into
pythonlearner1025 wants to merge 6 commits into
Conversation
…guest code Actor: adapter revalidation catalogs, chat-session test query, turn-output export, refresh-seam params, stdout recheck. Gateway: nil proxy fallbacks, context identity stash, default transport field. Guest scripts: dead tmux helper, duplicate boot guards, silent skel skip. Guest files changed; ships with the next box image. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ove lock ownership Delete injectable runners, nullable HTTP clients, completion channels, mutable timing knobs, and the dead SyncState mirror; tests move to fake executables on PATH, httptest, and real short durations. Remove the LinuxBackend mutex with a new -race serialization test proving Manager owns every lifecycle path. Replace the microvm enroll timeout/kill stack with the bounded blitz-register wrapper; phone-home wire unchanged. Guest enroll script changed; ships with the next M2 guest rootfs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…og shell Delete ApiAdapter and consume schema views directly with a single unauthorized chokepoint. Derive the chat transcript in one pass from reducer state. Delete the ignored standalone-ports subsystem, legacy lifecycle variants, tab-rename subsystem, desktop drawer resizer, dead store actions, and test-only seams. Merge preview-focus polling into the sources poller and unify Drive dialogs on ModalOverlay. Share dialogs and invite creation each get one owner. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… drop dead subsystems Drop derived-state columns with migrations 0028-0030: boxes.is_broker derives from broker_boxes; invites and credential_leases store revoked_at and derive lifecycle from timestamps, deleting the lease sweep and invite write-on-read. Make invite signup one guarded atomic batch. Move cron policy into core runScheduledMaintenance, used by both entrypoints. Delete the unbound AWS volume implementation, test-only provider seams, the abortable re-race, duplicated destroy transaction, redundant rechecks, mintSession, principalSource plumbing, the rotation catalog field, and the dead workspace cap. One base64url codec lives in crypto.ts. Managed worker template and BLITZDEV schema mirror stay in sync. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…nce counts no-runtime-typeof 27 to 25, no-unknown-parameters 52 to 51; anti-slop total 105. Known-debt list now names the six files over the 700-line warn, matching lint:gate output. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…covered option rechecks no-console-in-core and no-raw-fetch share isGlobalValue in global-reference.ts. allowed-files reads options oxlint already validated against the rule schema; the SAFETY comment names that invariant. Vendored anti-slop untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What part this touches
This is a deslop pass: it removes structural slop, code that exists to look robust rather than to be needed. A sweep on 2026-08-22 filed 130 findings across nine areas. This PR acts on all of them.
The touched parts, for a reader away for months:
core/compute, workspace lifecycle, janitors, identity, connections, files, and the scheduled handler.scripts/lib/worker-source.mjsemits the blitz.dev worker. Its schema mirror and entrypoint now match core.The problem
Slop code costs real bugs and real drift. Concrete examples from this tree:
leases,invites, andboxeseach stored a fact twice. A sweep then reconciledstatewithexpires_at, andis_brokermirroredbroker_boxes. Two copies drift; the sweep hid that drift.The fix
One rule per line:
revoked_atandexpires_atreplace storedstate;broker_boxesmembership replacesis_broker.runScheduledMaintenancein core owns cron routing for both entrypoints.mintSession, rename and ports subsystems, dead reducer actions.SAFETY:comment naming the invariant.The risk trade
Costs and mitigations:
ModalOverlay. Escape and focus return behavior changed slightly, on purpose, toward the shared owner.Re-verification refuted nine sweep claims; that code stays because it is load-bearing. Examples: the grant base URL stores real per-member data; the recipes cleanup covers a foreign key with no delete action; a boot timeout guards against a wedged child; a rm guard file (
managed-settings.json) still has a producer on old boxes.Skipped and listed, design tier (8): volume-provider routing, the box remove-file tombstone pipeline, both webapp-state ownership findings, auth-layer principal typing, and three
worker-source.mjsderivation mirrors.Skipped and listed, judgment tier (14): seams whose real boundary needs root, firecracker, or fixed guest ports; a frozen microVM wire contract; an unprovable mutex claim; a 75-second lock knob; the terminal sign-in delays, which lack an honest readiness signal; the actor model-catalog copy, which needs a build edge; two zero-value moves.
Tests
All gates green on this branch:
npm run typecheck: all workspaces, including the wire-drift config.npm run lint:gate: passes; the ratchet lowered in this PR, no-runtime-typeof 27 to 25, no-unknown-parameters 52 to 51; anti-slop total 108 to 105.npm test: control plane 451 vitest tests plus Python fixture conformance and 15 scripts tests; webapp 224 tests in 30 files; box actor 88 tests including six conformance suites; guest node tests; house-rule tests; broker provision script.go test -race ./...: broker, microvm-host, and box gateway all pass.BLITZDEV_MANAGED=1): 32 tests pass against the synced mirror.Net diff: 180 files, 2,751 insertions, 4,508 deletions.
Deploy
Artifacts, in order:
boxes.is_broker; 0029 and 0030 addrevoked_atand dropstateoninvitesandcredential_leases. Apply migrations with the worker deploy:npx wrangler d1 migrations applythennpx wrangler deployfrompackages/control-plane. Canary first, then prod, per house practice. The managed blitz.dev path redeploys throughnpm run blitzdev:buildunchanged.blitz-term,blitz-rules-boot,blitz-init-state). Existing boxes never upgrade in place; the change rides the next box image build only.build-rootfs-m2.shwhen convenient. Phone-home wire is byte-identical.Rollback: redeploy the previous worker only after re-adding the three dropped columns, or roll forward with a fix. Box and rootfs artifacts need no rollback; old images keep working.
🤖 Generated with Claude Code
Claude session: c478d64f-55f7-4b3a-bac9-3b304be66d4f