Skip to content

Remove cmd/orchestrator and pkg/orchestrator, and gate recurrence (#811) - #862

Merged
scttfrdmn merged 1 commit into
mainfrom
chore/811-remove-orchestrator
Oct 12, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
chore/811-remove-orchestrator

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Second of #811's staged items. Refs #811, not Closes.

What goes

A second binary no release has ever produced. .goreleaser.yaml builds spawn and spored and nothing else, so spawn-orchestrator could not be installed by any supported route.

  • cmd/orchestrator/ + pkg/orchestrator/ — 679 non-test lines plus 654 of tests
  • deployment/spawn-orchestrator.service — its ExecStart named /usr/local/bin/spawn-orchestrator, which nothing writes, and passed /etc/spawn/orchestrator-config.yaml, which the repo never contained

Verified before deleting, because two earlier issues in this audit (#809, #810) had premises that were wrong in both halves:

claim check
no release builds it .goreleaser.yaml has exactly two build entries, main: . and main: ./cmd/spored
no sibling repo imports it go.mod of truffle, lagotto, spore-host-mcp, calque, nf-spawn, spore-plugins — 0 each
not a wire contract absent from api/public-surface.txt; make api-snapshot shows no drift after removal
nothing else references it only its own source, a CHANGELOG line, and the service file

The gate, which is the point

Nothing was broken by this code, and that is exactly the problem: it compiled, it vetted, it had more test lines than most live packages, and make check was green on all of it for as long as it existed. Nothing anywhere asserted that a package main is a thing a user can actually obtain.

TestEveryCommandIsBuiltByARelease — every package main in the root module must appear as a main: in .goreleaser.yaml. The set is discovered from the filesystem, not listed: a gate naming the commands it knew about would have reported a clean bill of health for precisely the one nobody remembered (rule 4).

Verified three ways, not one:

  1. re-add cmd/orchestrator/main.go as a compiling stub → fails, naming it;
  2. also add a build entry for it → passes. This is the one that matters — without it the gate might merely be forbidding directories rather than gating the relationship between the two files;
  3. break its own parse of .goreleaser.yaml → fails with "the parse has broken, which is not the same as the release building nothing".

Two false citations it exposed

Neither is cosmetic.

  • pkg/taskpool/exec.go justified its 0o700 workspace mode with "spored is User=root (deployment/spawn-orchestrator.service)" — a unit file for a different binary, and one no release produced. The conclusion holds but for a different reason: the unit pkg/launcher/bootstrap.go actually writes sets no User= at all, so root comes from systemd's default. Deleting the file would have left the only citation for a security-relevant mode decision pointing at nothing.
  • the generated spored.service said SigV4 DNS signing was "harmless today (the DNS Function URL is still AuthType: NONE, which ignores the signature)". The cutover landed: the live function is AuthType: AWS_IAM, verified against it directly. So an unsigned request is now rejected at the URL and the instance never registers — the variable is load-bearing, and the comment read as though it were optional.

Next in #811

The observability stack (pkg/observability/alerting + deployment/prometheus + deployment/grafana), lambda/dns-updater/handler.py, the dead pkg/regions half, and the pkg/compliance split. All three of the first group's claims were checked while this PR was in flight and hold: alerting has zero references of any kind, handler.py is packaged nowhere and the live function is provided.al2023/bootstrap, and the two deployment/ config trees are referenced by nothing.

The pkg/security item stays last on purpose — #811 is right that whether something should be calling SanitizeForLog/ValidateCommand is a different question from whether deleting them is safe.

🤖 Generated with Claude Code

A second binary no release has ever produced. .goreleaser.yaml builds spawn and
spored and nothing else, so spawn-orchestrator could not be installed by any
supported route; no sibling repo imported the package and it was not in
api/public-surface.txt. deployment/spawn-orchestrator.service goes with it — its
ExecStart named a path nothing writes and passed a config the repo never had.

It compiled, it vetted, it had 654 lines of its own tests, and make check was
green on all of it for as long as it existed. So the removal comes with
TestEveryCommandIsBuiltByARelease: every package main in the root module must
appear as a main: in .goreleaser.yaml, discovered from the filesystem rather
than listed.

Also fixes two comments it exposed: pkg/taskpool/exec.go justified its 0o700
workspace mode by citing the orchestrator's unit as evidence of spored's user,
and the generated spored.service still described the DNS Function URL as
AuthType: NONE long after the AWS_IAM cutover, making a load-bearing variable
read as optional.

Refs #811
@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit b7ecf7b into main Oct 12, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the chore/811-remove-orchestrator branch October 12, 2026 00:53
scttfrdmn added a commit that referenced this pull request Oct 15, 2026
…ess (#907) (#914)

pkg/integration/orchestrator_test.go imported pkg/orchestrator, which #862
deleted as dead code (#811). The test sat behind //go:build integration, and
nothing in make check or CI compiles that tag, so build, vet and test all stayed
green while `go mod tidy` failed outright. It covered only the deleted package
(LoadConfig, New, scaling decisions) plus a registry.EnsureTable call that
hybrid_test.go already exercises, so there is nothing to port.

With tidy runnable again, the root module drops robfig/cron (required only by
the deleted package) and promotes spf13/pflag to direct (cmd tests import it).
lambda/dashboard-api drops an unused service/sqs requirement.

The gate: scripts/check-tidy.sh runs `go mod tidy -diff` over every go.mod in
the repo, discovered rather than listed, and refuses to pass if discovery misses
the root module. Tidy is the only tool here that loads every build tag, which is
why it is the one that could see this. Wired into `make check` (step 6) and CI
as `make check-tidy`. Watched it fail against the restored test, main's untidy
go.mod/go.sum, and a nested module with an unused require.

Fixes #907
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.

1 participant