chore: trim repo to dvm-only, remove leftover monorepo build contexts#9
chore: trim repo to dvm-only, remove leftover monorepo build contexts#9toon-backlog-bot[bot] wants to merge 3 commits into
Conversation
Deletes 11 non-dvm Dockerfiles, all non-dvm src/ entrypoints and helpers, and all non-dvm build-context dirs (configs/, dev-fixtures/, akash-ator-probe/, townhouse-ator-sidecar/, supervisord.conf, docker-compose-oyster.yml). Edits esbuild.config.mjs to a single entryPoint (entrypoint-dvm.ts) and trims unneeded externals. Updates package.json to remove main/start scripts pointing at the deleted entrypoint-sdk and prune deps only used by deleted entrypoints. Fixes tsconfig.json to stand alone (removes the extends to the monorepo root tsconfig that no longer exists here); vitest was failing on this pre-existing breakage. Closes #2 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ALLiDoizCode
left a comment
There was a problem hiding this comment.
Adversarial Review — Blocking Issue
❌ buildNoCreditsMessage is undefined — runtime crash + typecheck failure
File: src/entrypoint-dvm.ts:508
Severity: Blocking (runtime ReferenceError + breaks the typecheck fix this PR claims to deliver)
// line 508
console.warn(
`[DVM Entrypoint] ${buildNoCreditsMessage(turboResult.arweaveAddress)}`
);buildNoCreditsMessage is called here but is never defined anywhere in the file and never imported from any module. Full verification:
grep -rn 'buildNoCreditsMessage' src/ --include='*.ts'
# → src/entrypoint-dvm.ts:508: ...buildNoCreditsMessage(turboResult.arweaveAddress)...
# (definition line: none)
Impact:
- Runtime crash — any DVM that starts with
DVM_ARWEAVE_JWK_B64set (JWK-authenticated wallet) and a zero winc balance hits this code path at boot. Instead of logging a warning, it throwsReferenceError: buildNoCreditsMessage is not definedand the process exits (the error propagates out of the balance probetry/catchbecause the reference error fires inside theconsole.warnargument, not in the probe code that the try/catch guards — wait, actually it is inside the try/catch block so it would be caught and logged, then boot would continue). Let me revise: the crash is caught by the outertry/catchat line 512, so the DVM would boot successfully but silently swallow the zero-balance warning and log a confusing probe-failure message instead. Either way the behavior is wrong.
Revised impact (more accurate):
- The
try/catchat line 512 catches theReferenceError, so the DVM boots, but the zero-balance warning is lost and replaced with a misleading "Could not probe Arweave credit balance" message. Operators with a newly-funded wallet won't know their wallet has zero credits.
TypeCheck: This PR enables strict: true in tsconfig.json, which means pnpm typecheck (tsc --noEmit) should now report error TS2304: Cannot find name 'buildNoCreditsMessage'. The PR verification only shows npm run build (esbuild, no type checking) and npm test (vitest/esbuild transforms, also no type checking) — not pnpm typecheck. If typecheck was the motivating fix for the tsconfig change, it should be shown to pass.
Fix required before merge: Either define buildNoCreditsMessage (e.g., inline the formatting logic) or remove the call and replace with a concrete string template.
Non-blocking observations (FYI, not blocking merge once the above is fixed)
esbuild.config.mjs vs Dockerfile.dvm external list divergence. The new esbuild.config.mjs lists 3 externals (@ardrive/turbo-sdk, arweave, better-sqlite3); Dockerfile.dvm uses 9 (@libsql/client, libsql, ethers, express, @solana/kit, @solana-program/token, @ardrive/turbo-sdk, @toon-protocol/mina-zkapp, better-sqlite3). Since Dockerfile.dvm is acknowledged as broken (monorepo paths), this is moot now, but the person fixing the Dockerfile will need to reconcile these lists.
Dockerfile.dvm:105 still builds @toon-protocol/bls (--filter '@toon-protocol/bls') after bls is removed from package.json. Same caveat — moot while Dockerfile.dvm is broken, but worth fixing in the Dockerfile follow-up.
Cleanup itself is solid: removing 11 non-DVM Dockerfiles, all non-DVM src/ entrypoints, configs/, dev-fixtures/, akash-ator-probe/, townhouse-ator-sidecar/, etc. is exactly the right work. The tsconfig.json fix, package.json dep trim, and esbuild.config.mjs reduction are all correct and well-scoped.
The function was called at line 508 but was never defined or imported, causing a ReferenceError (caught by the outer try/catch, silently swallowing the zero-balance warning). Inline the message directly with the same information: credits are zero, wallet address to fund. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix round 1 —
|
ALLiDoizCode
left a comment
There was a problem hiding this comment.
Adversarial Review — PR #9 (trim to dvm-only)
The cleanup deletions are correct and the scope is appropriate. I found two blocking issues and one concern that should be addressed before merge.
[BLOCKING] CLAUDE.md pnpm install conflicts with package-lock.json lockfile
CLAUDE.md Build section still says:
pnpm install
pnpm build
But the PR removes pnpm-lock.yaml and adds package-lock.json. Running pnpm install against a repo that has only package-lock.json will ignore the npm lockfile and generate a fresh pnpm-lock.yaml from scratch — non-deterministic and not equivalent to what the npm lockfile pins.
Required fix: Update the Build section in CLAUDE.md to npm install && npm run build (matching the lockfile format actually present in the repo).
[BLOCKING] Stale vi.mock('@toon-protocol/pet-dvm') in src/entrypoint-dvm.test.ts
src/entrypoint-dvm.test.ts line 15–17:
vi.mock('@toon-protocol/pet-dvm', () => ({
createDungeonDvmHandler: vi.fn(() => vi.fn()),
}));@toon-protocol/pet-dvm is not in package.json and entrypoint-dvm.ts does not import it (only mentions it in a comment). This is dead code from the kind:5250 Dungeon DVM era. While vitest's vi.mock factory avoids a real require at import-time, it silently masks any future accidental reintroduction of a pet-dvm import (the mock intercepts before resolution errors surface). Remove it.
[CONCERN] esbuild.config.mjs external list diverges from Dockerfile.dvm
esbuild.config.mjs (used by npm run build):
external: ['@ardrive/turbo-sdk', 'arweave', 'better-sqlite3']Dockerfile.dvm runs esbuild directly with:
--external:better-sqlite3 --external:@libsql/client --external:libsql
--external:ethers --external:express --external:@solana/kit
--external:@solana-program/token --external:@ardrive/turbo-sdk
--external:@toon-protocol/mina-zkapp
These are not equivalent: the dev build bundles ethers, express, @libsql/client, libsql, @solana/kit, @solana-program/token, and @toon-protocol/mina-zkapp inline; the Docker build externalises all of them. Conversely, arweave is external in the dev build but bundled in the Docker build. The PR's stated verification (npm run build → dist/entrypoint-dvm.js 378 KB) validates the wrong artifact shape relative to what the Docker image would run. I understand Dockerfile.dvm is acknowledged as a follow-up fix, but the divergence should at least be noted here so the follow-up PR knows to reconcile the external lists.
What's good
- The deletions are clean and complete: 11 non-DVM Dockerfiles, all non-DVM
src/entrypoints and test files,configs/,dev-fixtures/,akash-ator-probe/,townhouse-ator-sidecar/,supervisord.conf,docker-compose-oyster.ymlall gone. tsconfig.jsonstandalone fix (removing brokenextends: "../tsconfig.json") is correct and the inlined settings are standard for a Node ESM TS project.package.jsondep trim is accurate — only@hono/node-server,@toon-protocol/{core,sdk},honoremain.- The
buildNoCreditsMessageundefined-reference fix is correct: inlining the message avoids a runtime ReferenceError when the Arweave wallet has 0 winc credits. - CLAUDE.md cross-repo deps line correctly drops
@toon-protocol/bls.
…mock
Addresses two blocking findings from review round 1:
- CLAUDE.md Build section referenced pnpm but the repo uses package-lock.json;
update to `npm install` / `npm run build` to match the actual lockfile.
- `vi.mock('@toon-protocol/pet-dvm', ...)` in entrypoint-dvm.test.ts was dead
code from the kind:5250 era — the package is not in package.json and not
imported by entrypoint-dvm.ts. Remove it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix round 2 — CLAUDE.md build commands and stale pet-dvm mockAddressed both blocking findings from @ALLiDoizCode's second review (commit 94f08d8). [BLOCKING] CLAUDE.md
|
ALLiDoizCode
left a comment
There was a problem hiding this comment.
Review Round 2 — LGTM, all blocking issues resolved
I verified the current HEAD (94f08d8) against all blocking findings from the two prior reviews.
Prior blocking issues — confirmed fixed
[R1] buildNoCreditsMessage undefined reference (src/entrypoint-dvm.ts:508)
Commit 0b4f86f inlines the message as a string literal. Confirmed no + lines in the diff re-introduce the call.
[R2a] CLAUDE.md build commands used pnpm while only package-lock.json exists
Commit 94f08d8 updates both commands to npm install / npm run build. Now consistent with the lockfile.
[R2b] Stale vi.mock('@toon-protocol/pet-dvm') in src/entrypoint-dvm.test.ts
Commit 94f08d8 removes the dead mock entirely. Confirmed no residual references in additions.
What I independently checked
package.jsondep trim is accurate:@hono/node-server,@toon-protocol/{core,sdk},hono— matches the imports inentrypoint-dvm.ts.tsconfig.jsonstandalone fix (target: ES2022,module: ESNext,moduleResolution: Bundler,strict: true) is standard for a Node ESM + esbuild project.esbuild.config.mjssingle entry point and reduced externals (@ardrive/turbo-sdk,arweave,better-sqlite3) are appropriate; the Dockerfile.dvm divergence is acknowledged inREADME.mdas a known follow-up.package-lock.jsonroot dependencies matchpackage.jsonexactly.- All 11 non-DVM Dockerfiles and all non-DVM
src/entrypoints/tests are deleted with no stray survivors in the diff additions.
|
Closing as stale/superseded. The trim is still genuinely needed — legacy Dockerfiles ( |
…ntexts (#23) The repo was carved from the monorepo docker/ aggregator and still carried every other image's build context. Now that store is a standalone, payment-oblivious POST /store backend behind the connector (#19), trim to just the store image: - Delete 11 non-store Dockerfiles (akash-*, mill, town, townhouse-api, nix, oyster, sdk-e2e, toon-client, agent-runtime-patched), docker-compose-oyster.yml, supervisord.conf, and the configs/, dev-fixtures/, akash-ator-probe/, townhouse-ator-sidecar/ build-context dirs. - Delete the non-store src entrypoints + helpers (entrypoint-{sdk,toon-client, toon-client-helpers,town,townhouse-api}, attestation-server, shared) and their tests. The store path (entrypoint-store.ts -> store-backend.ts) imports none of them. - esbuild.config.mjs: build only src/entrypoint-store.ts. - package.json: point main/start at dist/entrypoint-store.js; drop unused @types/dockerode devDep; refresh description. pnpm-lock.yaml regenerated (dockerode types only) so --frozen-lockfile stays valid. - README: mark the trim-to-store-only follow-up done. Supersedes the stale #9 (which predated the dvm->store rename + pnpm lockfile). Verified: pnpm build -> dist/entrypoint-store.js only; 22/22 tests pass. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
src/entrypoints and helpers, and all non-dvm build-context dirs (configs/,dev-fixtures/,akash-ator-probe/,townhouse-ator-sidecar/,supervisord.conf,docker-compose-oyster.yml).esbuild.config.mjsto a singleentryPoint(src/entrypoint-dvm.ts) and trims externals to only what the DVM bundle needs.main/startscripts and unused deps frompackage.json(kept:@toon-protocol/{core,sdk},hono,@hono/node-server).tsconfig.jsonto stand alone — removes theextends: "../tsconfig.json"monorepo-root reference that no longer exists; this was a pre-existing breakage that caused vitest to fail before this PR.Deviation from Agent Assessment plan
The issue body says
pnpm typecheckmay fail due to the pre-existingtsconfig.jsonextends issue, but treats it as "not to be fixed here." However,pnpm test(vitest via vite) also hard-fails on the broken extends — it's not just typecheck. Since fixing the tsconfig is entirely within the "make this repo standalone" scope of this issue and is low-risk (inlining standard settings for a Node ESM TS project), the fix is included here. Onmainbefore this PR,vitestwas crashing on all 5 test files; after this PR,22 tests passinsrc/entrypoint-dvm.test.ts.Verification
Closes #2
🤖 Generated with Claude Code