Skip to content

Rewrite/p12 v1 - #1

Open
kgpp34 wants to merge 31 commits into
developfrom
rewrite/p12-v1
Open

kgpp34 wants to merge 31 commits into
developfrom
rewrite/p12-v1

Conversation

@kgpp34

@kgpp34 kgpp34 commented Sep 16, 2026

Copy link
Copy Markdown
Owner

No description provided.

The four identity packages were near-identical copies of one another and the
architecture test package duplicated what a linter should do (DEC-012,
DEC-015). Nothing here is reused; the specs govern the rewrite.
Cocoon-shaped layout: main.go at the root, cmd/ with a cobra command tree
(cmd/doctor), and flat capability packages at the top level (config/, layout/,
host/, version/) instead of an internal/ tree of abstract packages.

doctor judges each requirement against the phase being worked on, so KVM,
Cloud Hypervisor and CNI show as not-required on a laptop while the root and
free-space checks decide the exit code. --fix only creates KumaBox-owned
directories; installing packages stays in the install script (DEC-014).

Tests run on macOS with no root and no KVM.
doctor/check.sh is Cocoon's doctor/check.sh with Cocoon's parts replaced:
KumaBox root, run and log directories, kumabox0 bridge and 10-kumabox.conflist,
the KumaBox database and staging directories, and the KumaBox version floors
(cloud-hypervisor >= v43, erofs-utils >= 1.8).

Sections that do not apply to KumaBox are gone: firecracker, ch-remote, zstd,
the JSON metadata backend and the JSON snapshot inspection. Store health now
reports rows stuck mid-flight and stray staging entries, which is what
'kumabox gc' reclaims.

doctor/check_test.sh tests the checker against a throwaway root and a PATH of
fake tools, so it needs no root, no KVM and no Cloud Hypervisor. Two knobs,
KUMABOX_KVM_DEVICE and KUMABOX_NETNS_DIR, exist so the checks can run off-host;
arm64 is accepted alongside aarch64.

The Go side keeps only the CLI skeleton in Cocoon's shape: main.go, cmd/root.go
and version/. The Go doctor command is removed -- doctor is the script, as in
Cocoon.
Restores Makefile and doctor/ to the state that matches Cocoon's README: the
checker is doctor/check.sh, built into bin/kumabox-check, installed next to the
kumabox binary, and covered by 'make test' through doctor/check_test.sh.

The Go rewrite of doctor (cmd/doctor) is dropped: it duplicated the script,
changed the command surface, and clobbered the Makefile targets that build and
install the checker.
Move dependency assembly to core and organize CLI commands and image adapters by responsibility. Keep metadata contract tests in their owning package and preserve SQLite cancellation errors after automatic rollback.

Validated with make verify, Linux/macOS make lint, and 30 repeated cancellation regression runs.
Add aligned image tables, indented JSON, and terminal-aware progress for import, pull, verification, and removal.

Document module responsibilities, API contracts, resource ownership, and workflow boundaries with ASCII diagrams.
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