Module: github.com/mojomast/ussycode
Date: 2026-03-20
Codebase: 62 .go files, 20,442 lines of Go
Tracks Audited: A (Core Hardening), B (Server Pool), C (Community/Arena), E (API & Admin), F (Agent/Mesh)
Post-review verification against live source code identified 4 factual errors in the original report. Each has been corrected in place below. This section documents what changed and why.
| # | Original Claim | Correction |
|---|---|---|
| 1 | cmdLLMKey is never registered — unreachable dead code |
FALSE. internal/ssh/commands.go:42 has "llm-key": cmdLLMKey in the static commands map. The command is registered and reachable. All related "dead code" findings for this item are removed. |
| 2 | admin.go:680 uses a local method that only updates trust_level, skipping quotas |
FALSE. admin.go:441 calls h.db.SetUserTrustLevel(ctx, id, newLevel) — the correct centralized DB method that updates trust_level AND all 4 quota columns. Line 680 does not contain this logic. The reported inconsistency does not exist. |
| 3 | go.mod specifies go 1.25.7 (non-existent version) |
FALSE. Actual go.mod contains go 1.24.0 with toolchain go1.24.4 — both valid, real versions. |
| 4 | All 12 test suites pass including internal/gateway |
INCOMPLETE. go test ./internal/gateway/... FAILS. TestSMTPServer_DotStuffing fails with a Maildir path resolution error. This is a known failing test not reflected in the original report. |
Command: go build ./...
Result: ✅ PASSES — zero errors
All 18 packages compile cleanly. No unresolved symbols, type errors, or missing dependencies.
Command: go test ./... -count=1
Result: internal/gateway has a known failing test (see CORRECTIONS section)
| Package | Status | Notes |
|---|---|---|
internal/admin |
✅ PASS | 0.387s |
internal/api |
✅ PASS | 0.250s |
internal/auth |
✅ PASS | 0.010s |
internal/config |
✅ PASS | 0.005s |
internal/db |
✅ PASS | 0.210s (17 tests: migration, quota, custom domain) |
internal/gateway |
🔴 FAIL | TestSMTPServer_DotStuffing — open .../dotvm/home/ussycode/Maildir/new: no such file or directory |
internal/pki |
✅ PASS | 0.015s |
internal/scheduler |
✅ PASS | 0.010s |
internal/ssh |
✅ PASS | 1.457s |
internal/storage |
✅ PASS | 0.003s |
internal/vm |
✅ PASS | 0.007s |
cmd/ussycode |
||
cmd/ussyverse-agent |
||
internal/agent |
||
internal/controlplane |
||
internal/mesh |
||
internal/proto/nodev1 |
||
internal/proxy |
Known failing test: internal/gateway.TestSMTPServer_DotStuffing (email_test.go:420) — the test attempts to open a Maildir path constructed from a temp directory and VM fixture (/tmp/TestSMTPServer_DotStuffing.../dotvm/home/ussycode/Maildir/new) that does not get created during test setup. This is a test infrastructure bug, not a production code defect, but it means the dot-stuffing delivery path is not verified by CI.
7 packages have no test files. While some of these are small (proto definitions, main entrypoints), internal/agent, internal/controlplane, internal/mesh, and internal/proxy contain significant logic that is untested.
Command: go vet ./...
Result: ✅ PASSES — zero issues
No shadowed variables, Printf mismatches, unreachable code, or other vet findings.
Check: All .go files must use github.com/mojomast/ussycode (not exedevussy)
Result: ✅ CLEAN — zero matches for exedevussy in any .go file
The module rename from Track A.1 was completed correctly across all files.
Directory: internal/db/migrations/
Result: ✅ Sequential, no gaps or conflicts
| # | File | Purpose |
|---|---|---|
| 001 | 001_initial_schema.sql |
Users, VMs, SSH keys |
| 002 | 002_vm_networking.sql |
TAP/IP/MAC columns |
| 003 | 003_ssh_key_mgmt.sql |
SSH key management |
| 004 | 004_arena_tables.sql |
Arena matches, participants, ELO |
| 005 | 005_tutorial_progress.sql |
Tutorial progress tracking |
| 006 | 006_api_tokens.sql |
API tokens (usy1.) |
| 007 | 007_admin_audit_log.sql |
Admin audit logging |
| 008 | 008_user_quotas.sql |
Trust levels & quota columns |
| 009 | 009_custom_domains.sql |
Custom domain records |
9 migrations, numbered 001–009 with no gaps, no conflicting prefixes.
- Static commands map (line 26): 16 commands registered statically (
help,whoami,ls,new,rm,ssh,stop,restart,tag,rename,cp,start,ssh-key,share,admin,llm-key) - Dynamic registrations via
init(): 4 commands registered at runtime (community,arena,browser,tutorial) - Total registered: 20 commands
✅ — CORRECTED (see CORRECTIONS section). cmdLLMKey dead codecmdLLMKey IS registered at line 42 of the static commands map ("llm-key": cmdLLMKey). The command and its 5 helper functions (lines 1561–1692) are fully reachable. This was not dead code.
🟡 ISSUE: Duplicate scan helper interfaces. Lines 1041–1058 define two interfaces with identical signatures:
scannable(line 1043):Scan(dest ...any) error— used byscanVM()rowScanner(line 1056):Scan(dest ...any) error— UNUSED, dead codescanVMRow()(line 1060) uses an inline anonymous interfaceinterface{ Scan(dest ...any) error }instead of either named interface
🟡 ISSUE: Duplicate --- scan helpers --- comment blocks at lines 868 and 1041, suggesting a merge/copy artifact between tracks.
No inconsistencies found. All models are well-structured and used. TrustLimits map is consistent with migration 008. CustomDomain model matches migration 009.
No inconsistencies found. Clean startup flow: config → DB → migrations → server.
Well-formed interface with 4 methods:
CloneForVM(ctx, baseImage, vmID) (devicePath, error)DestroyVM(ctx, vmID) errorResizeVM(ctx, vmID, newSize) errorGetUsage(ctx, userID) (*UsageStats, error)
All methods have context parameters, clear documentation, and a concrete implementation (ZFSBackend) that satisfies it.
This is a concrete struct, NOT an interface. It has fields (bridge, subnet, gateway, allocated, nextIP, mu, logger, firewall) and methods, but no interface contract. There IS a FirewallManager interface in internal/vm/nftables.go which NetworkManager depends on, but NetworkManager itself is not abstracted behind an interface. This limits testability and pluggability.
Well-formed interface with 3 methods:
PlaceVM(ctx, spec) (*NodeStatus, error)DrainNode(ctx, nodeID) errorListNodes(ctx) ([]*NodeStatus, error)
Also includes a companion NodeProvider interface (line 101) for dependency injection. Clean design.
Well-formed interface with 3 methods:
Proxy(w, r, provider)SetUserKey(ctx, userID, provider, key) errorGetUserKey(ctx, userID, provider) (string, error)
Has a concrete Gateway implementation. Well-documented.
Summary: 3 of 4 interfaces are well-formed. NetworkManager is a struct, not an interface.
| Item | Location | Lines | Severity |
|---|---|---|---|
cmdLLMKey + 5 helpers |
commands.go:1561–1692 |
~~~131~~ | |
rowScanner interface |
queries.go:1056–1058 |
3 | LOW — defined but never referenced |
| TODO | Location | Description |
|---|---|---|
// TODO: Check via netlink or ip link show |
vm/integration_test.go:41 |
TAP verification incomplete |
// TODO: Parse nft list table inet ussycode |
vm/integration_test.go:81 |
Firewall rule verification incomplete |
// TODO: Set up full VM manager with real database and firecracker |
vm/integration_test.go:111 |
Full integration test not implemented |
// TODO: dispatch to VM manager |
agent/heartbeat.go:179 |
Agent heartbeat doesn't dispatch to VM manager yet |
| Item | Location | Notes |
|---|---|---|
hasFlag() |
commands.go:823 |
Returns (bool, []string) with remaining args |
hasArgFlag() |
tutorial.go:397 |
Returns just bool — simpler version of hasFlag for the same purpose. Two functions with overlapping intent. |
admin.go line 680: (h *Handler) setUserTrustLevel() — updates ONLY trust_level column
admin.go line 441: h.db.SetUserTrustLevel(ctx, id, newLevel) — this IS the centralized DB method, which updates trust_level AND resets all 4 quota columns (vm_limit, cpu_limit, ram_limit_mb, disk_limit_mb)
The admin web panel correctly calls h.db.SetUserTrustLevel() (the same DB method used by the SSH CLI at commands.go line 1728). The originally reported line number (680) was incorrect, and no local bypass method exists. There is no inconsistency between the web panel and SSH CLI paths — both use the centralized DB method and both update quotas correctly.
go 1.24.0
toolchain go1.24.4
Version 1.25.7 does not exist. The actual go.mod specifies go 1.24.0 with toolchain go1.24.4 — both are valid, real, released versions. No issue exists here.
browser.go (line 22) calls hasArgFlag() which is defined in tutorial.go (line 397). This works because they're in the same ssh package, but it's a hidden coupling — if tutorial.go were ever removed or moved, browser.go would break with no obvious reason. Similarly, arena.go calls hasFlag() from commands.go.
| # | Package | Files | Has Tests | Notes |
|---|---|---|---|---|
| 1 | cmd/ussycode |
1 | ❌ | Server entrypoint |
| 2 | cmd/ussyverse-agent |
1 | ❌ | Agent binary entrypoint |
| 3 | internal/admin |
3 | ✅ | Web admin panel |
| 4 | internal/agent |
2 | ❌ | Agent heartbeat/handler — has TODO stub |
| 5 | internal/api |
3 | ✅ | HTTPS API + rate limiting |
| 6 | internal/auth |
1+ | ✅ | SSH auth |
| 7 | internal/config |
1+ | ✅ | Config loading |
| 8 | internal/controlplane |
1+ | ❌ | Control plane logic |
| 9 | internal/db |
5+ | ✅ | Database, models, migrations, queries |
| 10 | internal/gateway |
5+ | ✅ | SSH gateway, LLM, email, crypto |
| 11 | internal/mesh |
1+ | ❌ | Mesh networking |
| 12 | internal/pki |
1+ | ✅ | PKI/certificate management |
| 13 | internal/proto/nodev1 |
1+ | ❌ | Protobuf definitions |
| 14 | internal/proxy |
1+ | ❌ | Caddy proxy integration |
| 15 | internal/scheduler |
2+ | ✅ | VM scheduling |
| 16 | internal/ssh |
8+ | ✅ | Shell, commands, arena, tutorial, browser |
| 17 | internal/storage |
2+ | ✅ | ZFS storage backend |
| 18 | internal/vm |
3+ | ✅ | VM management, networking, firewall |
18 packages total. 11 have tests, 7 do not.
-
— CORRECTED.cmdLLMKeydead codellm-keyIS registered atcommands.go:42. Not dead code. Finding removed. -
Admin web panel trust level doesn't update quotas— CORRECTED.admin.go:441correctly callsh.db.SetUserTrustLevel(), which updates all quota columns. No inconsistency exists. Finding removed. -
🔴
TestSMTPServer_DotStuffingfails —internal/gatewaytest suite fails with a Maildir path error (email_test.go:420). The dot-stuffing delivery path is not verified by CI. Needs test fixture setup fix. (Added during post-review verification.)
3. 4. — CORRECTED. Actual go.mod specifies go 1.25.7go.mod contains go 1.24.0 / toolchain go1.24.4, both valid. Finding removed.
5. NetworkManager is a struct, not an interface — limits testability and doesn't match the pattern of the other 3 contracts (StorageBackend, Scheduler, LLMGateway).
6. 7 packages have no tests — including internal/agent, internal/controlplane, internal/mesh, and internal/proxy which contain non-trivial logic.
7. Duplicate/redundant scan helpers in queries.go — rowScanner interface is unused, scanVMRow uses an inline interface, duplicate section comment headers.
8. hasArgFlag / hasFlag duplication — two functions with overlapping purpose in different files, creating hidden cross-file coupling.
9. 4 TODO stubs — 3 in VM integration tests (incomplete assertions), 1 in agent heartbeat (unfinished dispatch).
10. internal/admin/embed.go pre-existing //go:embed issue — empty web/templates dir. Known issue, not introduced by any track work.
End of audit report.