Skip to content

Go-parity audit: spawn-ts vs spawn (tracking) #57

Closed

Description

@scttfrdmn

Tracking issue for the spawn-ts ↔ Go spawn parity audit — the largest of the three -ts pairs (companions: truffle-ts#36, lagotto-ts#5).

The parity milestone previously read open:0 closed:2 and was named v1.0.0 — Feature parity. Both were wrong: it closed by exhaustion rather than by reaching parity, and it named a version that will never ship — spawn-ts stays on 0.x.y indefinitely. It is now v0.7.0 — Go parity (documented divergences) and points at this issue: a per-command judgement, so a deliberate omission is distinguishable from an oversight.

Parity here is a behavioural claim with documented divergences, never a version-number claim. spawn-ts is 0.6.x against Go spawn v0.97.x and the two version lines are independent on purpose — equal numbers would assert a feature correspondence that the tiers below show does not exist.

Headline

The 79k-vs-5.7k line gap is mostly not a defect — but the tag-set gap is, and it's the finding that matters.

Go spawn spawn-ts
non-test lines 79,364 (cmd 27,055 · pkg 39,960 · lambda 11,385 · spored 914) 5,703
top-level commands 50 (rootCmd.AddCommand) 16 shell commands
distinct spawn:* tags ~121 org-wide, 55 written at launch (pkg/aws/tags.go) 33

Line ratio is the wrong metric here. pkg/agent (3,524) is the on-instance daemon; pkg/plugin + pkg/pluginruntime (3,654) run on the box; lambda/ (11,385) is server-side infra. None of that is portable or missing — it's the other half of the architecture spawn-ts writes tags for. Roughly 22,700 lines of pkg/ alone are daemon/server/provisioning code by nature (agent, plugin, pluginruntime, autoscaler, pipeline, compliance, slurm, observability, taskpool, taskproto, staging, orchestrator, doctor, infrastructure, sshkey).

The real finding is the 55→33 tag gap, because docs/integration.md:47 claims a spawn-ts launch is "wire-compatible" with the Go tool. It isn't, and one of the omissions (spawn:iam-user) means the portal can neither list nor terminate a spawn-ts-launched instance while spawn list shows it happily. That's the false-tier-A pattern this audit exists to catch: a capability that looks ported and diverges only at the moment someone needs it.

Filed issues

# title tier
#51 buildLaunchTags omits Go's base-identity block — spawn:iam-user breaks portal terminate B, highest
#52 Execution shapes: job-array --min-viable missing; MPI is tag-only B / C+D
#53 Plugins: browser can detect all 12 and declare 7 at launch — neither implemented B
#54 extend: no safety floor → extending an overdue instance yields a past deadline B, bug
#55 Unbounded-launch guard accepts costLimit but refuses idleTimeout — inverted from Go B, cost-safety
#56 status: four tag-derived notices unported — a failed DNS registration is invisible B

Fix order: #51 → #54 → #55 → #56 → #53 → #52. #51 first because wire-identity is load-bearing for everything downstream; #54/#55 next because they're cost-safety bugs, not gaps.

The 50-command matrix

Tiers: A at parity · B portable, missing · C tag-emit only · D not portable · E deliberately excluded.

Ported (A/B)

Go command tier notes
launch A src/aws/ec2.ts:78; identity tags gap → #51; MPI/EFA/placement → #52
list A Go filters spawn:managed only (pkg/aws/client.go:982) — same as spawn-ts
status B remote spored status is D; the four notices are B → #56
extend B tag write is A, safety floor missing → #54; reload via SSM is B
stop/start/hibernate (cmd/state.go) A provider ops
terminate A
sweep A src/core/sweep.ts + params.ts; spawn:param:* at parity
array B src/core/jobarray.ts; --min-viable → #52
queue A src/core/queue.ts (DAG + dependency gating)
orphans B (narrower) spawn-ts is TTL-overdue instances only (src/core/orphans.ts). Go also reports available EBS volumes, unattached SGs, shared infra, and unassociated/stopped-instance EIPs — all via Resource Groups Tagging API, which is CORS-open (tagging.us-east-1.amazonaws.com → ACAO: *, verified). So the extra resource classes are tier B, not D.
resources B pure RGT API + spawn:managed filter; nothing exists in spawn-ts
dns B src/dns/ has the naming/resolve half; the spawn:dns-status/dns-error reader is missing → #56
plugin B/D split → #53
defaults E ~/.spawn/config.yaml. The browser analogue is localStorage, and the portal has its own preferences path (web/app/config.ts) — not a port.
version A
gen-docs E cobra docs generator; no cobra

Not portable (D) — needs the daemon, a node shell, or server-side infra

Go command why
connect SSH / SSM shell + Windows password decrypt (cmd/connect.go:120, gated on spawn:os). The portal has an SSM terminal (src/ssm/session.ts) but not connect's key/user/protocol resolution.
instance-config reads/writes runtime config over SSH
task per-task diagnosis over SSH
collect-results pulls results off instances
stage multi-region data staging on-node
slurm Slurm batch-script interpreter (pkg/slurm, 1,229 lines)
fsx FSx provisioning
app NICE DCV session management
image / create-ami / list-amis / ami EC2 Image Builder + AMI lifecycle
snapshot builds EBS snapshots from raw disk images (loop-mounts locally)
pipeline pkg/pipeline (1,830) + DynamoDB state
pool pkg/taskpool + pkg/taskproto (1,613) — worker protocol
autoscale pkg/autoscaler (2,022) + DynamoDB
burst joins a local Slurm job array
upgrade-spored in-place daemon upgrade over SSH
doctor local environment checks (pkg/doctor)
validate pkg/compliance (1,639)
cleanup destructive multi-service teardown — see below
onboard CloudFormation stack deploy
resume SSH-driven sweep resume

Deliberately excluded (E) — portable but out of scope, with the reason

Go command reason
availability reads a DynamoDB table in the spore.host-infra account (cmd/availability.go:55 → LoadInfraAWSConfig), not the user's. BYOA credentials don't reach it. Belongs to the portal's own API, not the library.
cost DynamoDB sweep-cost records (cmd/cost.go:59). DynamoDB is CORS-open, but the table is written by the sweep controller — a browser reading a table nothing in the browser writes is half a feature.
alerts DynamoDB alert preferences; hosted concern (lambda/dashboard-api/alerts.go already serves it)
team DynamoDB team records + spawn:team-id
schedule EventBridge Scheduler + a pre-existing SpawnSchedulerExecutionRole (cmd/schedule.go:273). Scheduler is CORS-open (verified in the lagotto-ts audit), so this is the most promotable E → B item — but it needs an IAM role the browser can't create.
notify (cmd/bot.go) DynamoDB registration for the Slack/SMS bot; hosted
capacity-block purchases Capacity Blocks — real money, and truffle capacity-blocks (truffle-ts#33) covers discovery. Deliberately not a browser action.
list-sweeps DynamoDB sweep index; same reason as cost
cancel cancels a running sweep via the DynamoDB record
cleanup destructive — deletes SGs, key pairs, IAM roles. Should not be one click in a browser tab.

Two cross-cutting notes

Where guards live matters more than whether they exist. #55's finding is that the unbounded-launch check is on SpawnClient.launch, which is right — but the set of bounds it accepts diverges from Go, accepting the soft spored-dependent one (costLimit) and rejecting the one Go auto-applies (idleTimeout).

spawn:idle-cpu is not a spawn-ts invention. Verified at pkg/provider/ec2.go:508 → tagprefix.Tag("idle-cpu"). Only two spawn-ts tags fall outside Go's launch set — spawn:compute-seconds (spored writes it, pkg/agent/agent.go:404; spawn-ts seeds it to "0") and spawn:idle-cpu — and both are legitimate.

Milestone

v0.7.0 — Go parity (documented divergences) (renamed from v1.0.0 — Feature parity) is scoped to this issue and the six tier-B issues, so it closes on merit. The tier D/E entries above are the defensible statement it was missing: ~22,700 lines of pkg/ plus all 11,385 lines of lambda/ are the daemon/server half of the architecture, not a gap — and roughly 20 of the 50 commands are D by nature, 10 E by choice, leaving 6 filed issues as the actual work.

Activity

  1. added
    documentation
    area: docs
    on Jul 31, 2026
  2. scttfrdmn commented on Aug 1, 2026

    @scttfrdmn
    ContributorAuthor

    All six filed tier-B issues are closed, so the audit this issue tracks is complete.

    # outcome
    #51 base-identity block ported — spawn:iam-user now written, so the portal can list and terminate a spawn-ts-launched instance
    #54 extend safety floor — extending an overdue instance no longer yields a past deadline
    #55 unbounded-launch guard un-inverted — idleTimeout accepted, costLimit alone no longer sufficient
    #56 the four tag-derived status notices ported — a failed DNS registration is visible, with spored's recorded reason
    #53 plugins — declare 7 at launch, detect all 12; the other five refused with distinct reasons
    #52 --min-viable + sparse indexes; MPI as tags only, with the reason documented rather than half-ported

    What the audit's conclusion actually is

    The 79k-vs-5.7k line gap was, as suspected, mostly not a defect — roughly 22,700 lines of pkg/ alone are daemon/server/provisioning code by nature, and lambda/ is server-side infra. That part of the gap is the other half of the architecture spawn-ts writes tags for, not something missing from it.

    The finding that mattered was the 55→33 launch-tag gap, because it made a documented "wire-compatible" claim false at exactly one load-bearing point (#51): the portal could neither list nor terminate an instance that spawn list showed happily. That is the false-tier-A pattern the audit existed to catch — a capability that looks ported and diverges only when someone needs it.

    Two of the six were cost-safety bugs rather than gaps (#54, #55), which is the other thing a per-command judgement surfaced that a line-count comparison never would.

    What is deliberately not at parity

    Recorded so the milestone closes on a defensible statement rather than on emptiness:

    • MPI orchestration (Execution shapes: job-array --min-viable is missing, MPI is tag-only (and MPI orchestration should not be chased) #52) — Go's pkg/mpicohort is a self-declared spike whose unresolved problem is that cohort's Placement is per-entity while a placement group and an EFA fabric are collective constraints. Porting a spike would commit spawn-ts to a shape Go is still deciding. spawn-ts emits the spawn:mpi-* tags so the array is recognisable, and stops there.
    • EFA validation — must run in the launch region; blocked on truffle-ts#33 (region identity on InstanceType).
    • --auto-placement-group — creates a real AWS resource, so tier D.
    • logs / collect / retry --failed — Go's own help states the blocker for the last: a local launch record under ~/.config/spore/arrays/ that "must run from the machine that launched the array".
    • orphans is narrower than Go's by scope, not by feasibility — the extra resource classes are tier B via the CORS-open Resource Groups Tagging API, and resources likewise. Neither is filed; they are legitimate future work rather than divergences.

    Divergences are documented in docs/execution-shapes.md, docs/data-movement.md, and docs/integration.md (whose stale CORS/live-data paragraph was corrected as part of this work).

    Parity remains a behavioural claim with documented divergences — spawn-ts stays on 0.x.y indefinitely and its version line is deliberately independent of Go spawn's. Equal numbers would assert a feature correspondence the tiers above show does not exist.

    Companion audits: truffle-ts#36, lagotto-ts#5.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: docsdocumentation

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions