Skip to content

Trim store repo to dvm-only: remove leftover monorepo build contexts #2

Description

@toon-backlog-bot

Context

This repo was carved from the TOON monorepo's docker/ aggregator (see CLAUDE.md and README.md) and still ships the build contexts for every other image in the monorepo. The repo's sole purpose is to build the Arweave DVM container from Dockerfile.dvm over src/entrypoint-dvm.ts.

Grounding facts from the current tree:

  • 11 non-dvm Dockerfiles exist: Dockerfile.agent-runtime-patched, Dockerfile.akash-anvil, Dockerfile.akash-solana, Dockerfile.akash-solana-explorer, Dockerfile.mill, Dockerfile.nix, Dockerfile.oyster, Dockerfile.sdk-e2e, Dockerfile.toon-client, Dockerfile.town, Dockerfile.townhouse-api.
  • src/ holds entrypoints for other services plus their tests and helpers.
  • src/entrypoint-dvm.ts has ZERO relative imports (verified: grep -nE "from '\.|require\(" src/entrypoint-dvm.ts finds nothing relative). Every helper it uses — createJobCounter, createTurboAdapter, formatWincAsBytes, arweaveAddressFromJwk, applyEnvOverlay, config parsing — is inlined in the file itself. It imports only npm packages (@toon-protocol/{sdk,core}, hono, @hono/node-server, node:*, lazy @ardrive/turbo-sdk, arweave). Therefore there are no in-repo "shared helper" source files the DVM depends on. In particular src/shared.ts is imported only by src/entrypoint-sdk.ts, and src/attestation-server.ts is a separate supervisord-managed process (its own doc comment says so) never referenced by the DVM.
  • src/entrypoint-dvm.test.ts imports only ./entrypoint-dvm.js (relative) + npm packages, so it travels with the DVM entrypoint.
  • esbuild.config.mjs currently has three entryPoints: entrypoint-sdk.ts, attestation-server.ts, entrypoint-dvm.ts — two of which are being deleted, so this file must be edited (not deleted).
  • package.json main/start point at dist/entrypoint-sdk.js (deleted entrypoint) and it lists deps used only by deleted entrypoints — so it must be edited.

Scope

DELETE — non-dvm Dockerfiles

  • Dockerfile.agent-runtime-patched
  • Dockerfile.akash-anvil
  • Dockerfile.akash-solana
  • Dockerfile.akash-solana-explorer
  • Dockerfile.mill
  • Dockerfile.nix
  • Dockerfile.oyster
  • Dockerfile.sdk-e2e
  • Dockerfile.toon-client
  • Dockerfile.town
  • Dockerfile.townhouse-api

DELETE — non-dvm src files (entrypoints, their tests, helpers)

  • src/entrypoint-sdk.ts
  • src/entrypoint-mill.ts, src/entrypoint-mill.test.ts
  • src/entrypoint-toon-client.ts, src/entrypoint-toon-client.test.ts, src/entrypoint-toon-client-helpers.ts
  • src/entrypoint-town.ts
  • src/entrypoint-townhouse-api.ts
  • src/shared.ts, src/shared.test.ts (imported only by entrypoint-sdk.ts)
  • src/attestation-server.ts, src/attestation-server.test.ts (separate supervisord process; not used by the DVM)

DELETE — non-dvm build-context dirs & files

  • supervisord.conf (only referenced by deleted attestation-server.ts + the akash/oyster/nix/sdk-e2e Dockerfiles)
  • configs/ (townhouse-dev-connector.yaml, townhouse-hs-connector.yaml)
  • dev-fixtures/ (README + the three mill config fixtures)
  • akash-ator-probe/ (Dockerfile, checksums.txt, entrypoint.sh)
  • townhouse-ator-sidecar/ (Dockerfile, checksums.txt, entrypoint.sh)
  • docker-compose-oyster.yml

KEEP — dvm sources

  • Dockerfile.dvm
  • src/entrypoint-dvm.ts
  • src/entrypoint-dvm.test.ts

KEEP — repo infra (edit, do not delete)

  • package.json — remove main/start pointing at dist/entrypoint-sdk.js; prune dependencies now used only by deleted entrypoints. Keep at minimum the deps entrypoint-dvm.ts actually imports: @toon-protocol/sdk, @toon-protocol/core, hono, @hono/node-server; plus @ardrive/turbo-sdk + arweave which the entrypoint dynamically imports. Leave private: true.
  • esbuild.config.mjs — reduce entryPoints to just src/entrypoint-dvm.ts; trim the external list / comments that only existed for the deleted entrypoints (keep the externals the DVM bundle needs).
  • tsconfig.json, vitest.config.ts, .gitignore

KEEP — docs

  • README.md, CLAUDE.md — update the "still contains the other images' build contexts" follow-up note to reflect that the trim is done.

Out of scope

  • Do NOT rewrite Dockerfile.dvm's COPY graph. It still references monorepo paths that do not exist in this repo (packages/*, examples/*, docker/, patches/, pnpm-workspace.yaml, pnpm-lock.yaml). Fixing the Dockerfile to build standalone is a separate follow-up (tracked alongside the image-publish workflow in CLAUDE.md). This issue only removes the other images' contexts.
  • Do NOT add the image-publish workflow (separate issue).
  • Do NOT change src/entrypoint-dvm.ts logic.
  • Do NOT repin or upgrade dependency versions beyond removing now-unused entries.

Acceptance criteria

  • All 11 non-dvm Dockerfiles listed above are removed; Dockerfile.dvm remains.
  • All non-dvm src/ files listed above are removed; only src/entrypoint-dvm.ts and src/entrypoint-dvm.test.ts remain under src/.
  • supervisord.conf, configs/, dev-fixtures/, akash-ator-probe/, townhouse-ator-sidecar/, docker-compose-oyster.yml are removed.
  • esbuild.config.mjs lists exactly one entry point: src/entrypoint-dvm.ts.
  • package.json contains no main/start/script reference to any deleted file (no entrypoint-sdk), and no dependency that is no longer imported by src/entrypoint-dvm.ts.
  • A grep -rn over kept files (excluding .git, node_modules) finds no remaining references to any deleted file/dir name in package.json, esbuild.config.mjs, Dockerfile.dvm, README.md, CLAUDE.md, or other kept files — i.e. no supervisord, attestation-server, entrypoint-sdk, entrypoint-mill, entrypoint-town, entrypoint-toon-client, entrypoint-townhouse-api, configs/, dev-fixtures, akash-ator-probe, townhouse-ator-sidecar.
  • pnpm install && pnpm build succeeds and emits dist/entrypoint-dvm.js (and only DVM output).
  • pnpm test (vitest) passes — only src/entrypoint-dvm.test.ts runs.

Implementation notes

Import trace (the load-bearing finding): src/entrypoint-dvm.ts is fully self-contained — grep -nE "from '\\.|require\\(" src/entrypoint-dvm.ts returns nothing relative. So nothing in src/ (no shared.ts, no helpers) needs to be preserved as a "shared helper." The CLAUDE.md phrase "keep shared helpers" resolves, in this repo, to "no separate helper files exist — they're inlined into the entrypoint."

Files that must be EDITED, not deleted (deleting them breaks the build): package.json, esbuild.config.mjs.

Pre-existing breakage to be aware of (NOT introduced by this task, NOT to be fixed here):

  • tsconfig.json does "extends": "../tsconfig.json", which is absent in this standalone repo. pnpm typecheck (tsc --noEmit) may already fail for that reason — do not treat a pre-existing typecheck failure as caused by this change. The build script uses esbuild (no typecheck), so pnpm build is the meaningful gate.
  • Dockerfile.dvm cannot docker build standalone today (missing monorepo COPY paths). Hence docker build -f Dockerfile.dvm is intentionally NOT an acceptance criterion for this issue — it is deferred to the Dockerfile-standalone follow-up.

Validation commands:

git rm <each deleted path>            # use git rm so history is clean
pnpm install
pnpm build                            # must emit dist/entrypoint-dvm.js only
pnpm test                             # vitest: only entrypoint-dvm.test.ts
# reference sweep over kept files:
grep -rnE 'entrypoint-(sdk|mill|town|toon-client|townhouse-api)|attestation-server|supervisord|configs/|dev-fixtures|akash-ator-probe|townhouse-ator-sidecar' \
  --include='*.json' --include='*.mjs' --include='*.ts' --include='Dockerfile*' --include='*.md' . \
  | grep -v node_modules
# (should return nothing in KEPT files)

Gotcha: package.json currently lists deps (@toon-protocol/{client,connector,mill,relay,bls}, fastify, @fastify/cors, ajv, ajv-formats, nostr-tools, viem, ws, bs58, @noble/curves, @noble/curves) that were used by the now-deleted entrypoints. Cross-check each against src/entrypoint-dvm.ts's actual imports before removing; when uncertain whether a dep is a transitive runtime need of the bundle, prefer keeping it over breaking the build (the acceptance gate is "build + test pass," not "minimal dep set"). The DVM test (entrypoint-dvm.test.ts) vi.mocks @toon-protocol/sdk and @toon-protocol/pet-dvm; mocks don't require the package to be installed, so a missing @toon-protocol/pet-dvm won't fail vitest — confirm pnpm test still passes after pruning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs:humanA human decision/clarification is requiredrisk:lowLow-risk; agent-executable when agent:ready

    Fields

    No fields configured for Refactor.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions