Traced what a "Block NNNN" collision actually means before designing a fix for it: capsule_loader.c's block-write path routes through the generic block-subsystem API, which kernel_main.c registers as two devices in a fixed order -- the volatile ramdrive first (LBN 2048-3071), then Artemis's real virtio-blk device immediately after (LBN 3072+, backed by disk/artemis.img). Every capsule this project has lands in Artemis's persistent range, not the ramdrive, and blk_update()'s dirty-marking + repl.c's idle-loop flush write that content through to the real disk file on every boot. A block-number collision is therefore a silent, persistent overwrite of real disk content surviving reboots, not a transient RAM mixup. The existing collision gate (check_block_conflicts(), already a hard non-interactive build failure) already catches capsule-vs-capsule collisions across the whole flat range. The real gap: zero visibility into blocks something other than a capsule owns (Artemis's own non-capsule persistent data), and no device-boundary/capacity awareness at all. Added, scoped step by step before writing any code: - tools/capsule-claims.txt -- derived, auto-created/regenerated, git-ignored. Lets --resolve tell "this capsule's own content changed" apart from "genuinely new collision with something else." - tools/capsule-reserved.txt -- human-authored, git-tracked, seeded with nothing yet rather than guessed at. Checked by both the plain build gate (new check_reserved_conflicts()) and --resolve. - tools/patches/ -- git-tracked, one file per accepted interactive renumber; a structured old->new block list, not a generic diff, since that's the only thing a renumber ever changes. - mkcapsule --resolve <dir> -- the only interactive mkcapsule mode, a deliberate separate invocation from the plain build path (which stays non-interactive so CI never blocks on a prompt). Suggests a renumbering that preserves a capsule's own existing block spacing, prompts y/N, rewrites the .4th source in place on acceptance. Found and fixed a real bug during verification: the registry's empty-block-list case (workload-5.4th, zero Block headers) serialized with a stray trailing space that the reader parsed back as a phantom block 0, causing spurious re-registration every run -- caught by testing idempotency directly, not assuming a clean first run meant it worked. Verified: isolated collision tests confirm both accept and reject paths, confirm a resolved collision doesn't re-prompt the other side, confirm reserved-range collisions are caught by both --resolve and the plain build gate. Full 3-architecture rebuild via the real Makefile.starkernel succeeded clean; amd64 boots with an unchanged dict_hash/capsule_hash from every prior boot this session. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EXieurDfDSsDFdnSyusuWo
77 lines
2.0 KiB
Plaintext
77 lines
2.0 KiB
Plaintext
# build artifacts
|
|
/build/
|
|
target/
|
|
out/
|
|
# Formal documentation build output — PDFs are committed artifacts
|
|
# LaTeX intermediates are excluded; PDFs are tracked with git add -f
|
|
docs/formal/build/**
|
|
!docs/formal/build/**/*.pdf
|
|
# Doxygen generated output (PDF artifact committed separately)
|
|
docs/formal/doxygen/
|
|
docs/api/
|
|
|
|
# IDE crap
|
|
.idea/
|
|
.vscode/
|
|
*.iml
|
|
|
|
# generated headers
|
|
include/version.h
|
|
|
|
# bundles / archives
|
|
*.bundle
|
|
*.tar
|
|
*.tar.gz
|
|
*.zip
|
|
|
|
# experiment scratch outputs ONLY (keep raw CSVs!)
|
|
experiments/**/results/tmp/
|
|
experiments/**/results/cache/
|
|
experiments/**/results/*.log
|
|
|
|
# OS junk
|
|
.DS_Store
|
|
Thumbs.db
|
|
qemu.log
|
|
|
|
# Framebuffer/Console screendumps — throwaway local verification images,
|
|
# never meant to be committed (Captain Bob, 2026-08-07)
|
|
fb/
|
|
|
|
# Serial acceptance logs and session directories are audit artifacts — tracked in git
|
|
# logs/ and logs2/ are intentionally NOT ignored
|
|
# EXCEPTION: ECW-trace sessions generate 500-638MB logs that exceed GitHub's 100MB
|
|
# limit. Those specific sessions are excluded here.
|
|
logs/20260625-183218/
|
|
logs/20260625-183958/
|
|
logs/20260625-184714/
|
|
logs/20260625-190541/
|
|
|
|
# Retired data directories (replaced by experiments/bare_metal/)
|
|
doe/
|
|
csv/
|
|
|
|
# Kconfig — vendored tool build products (tools/kconfig/README.md) and
|
|
# generated per-arch config output (lives under build/, already ignored
|
|
# above, but a stray root-level .config from manual testing is also caught)
|
|
tools/kconfig/conf
|
|
tools/kconfig/mconf
|
|
tools/kconfig/qconf
|
|
tools/kconfig/*.o
|
|
tools/kconfig/lxdialog/*.o
|
|
tools/kconfig/parser.tab.c
|
|
tools/kconfig/parser.tab.h
|
|
tools/kconfig/lexer.lex.c
|
|
tools/kconfig/qconf-moc.cc
|
|
tools/kconfig/*-cflags.mk
|
|
tools/kconfig/.mconf.*
|
|
tools/kconfig/.qconf.*
|
|
/.config
|
|
/.config.old
|
|
|
|
# mkcapsule --resolve claim registry (FABRIC-3.md SXXIV) — pure derived
|
|
# state, auto-created/regenerated, never a source of truth. Its sibling
|
|
# tools/capsule-reserved.txt (human-authored) and tools/patches/ (decision
|
|
# record) are NOT ignored — those are tracked deliberately.
|
|
/tools/capsule-claims.txt
|