Kernel restructure: move tool host, catalog, grants, isolation, effects and Log into harness/kernel
Discovered from README cross-links · today
Relocate 109 files into the kernel, retire four library packages, and make
What they did
The author executed a Tier 1 structural refactor across the vinaya, cli and aeg-core projects. They moved 109 files from the Boundary's move list into their final destinations under harness/kernel/ — tools/, tools/host/, isolation/, effects/, log/, log/client/, log/sync/, log/fixtures/, telemetry/questions/, adapters/agents/ and the kernel root — placing each module in the lowest kernel folder that holds all its kernel callers, and hoisting shared modules (log/log-sink.ts, shared tool-host modules, run-paths.ts, source-manifest.ts) to subsystem or kernel roots. Tests that know only kernel code moved beside the code they prove; tests that know Vinaya moved under harness/processes/vinaya-strict/integration/ at the kernel module's path. Four generic helpers were split out unchanged into new kernel modules: FailedCheckLog, validatesJsonSchema, the Documentation-section reader, and normalizeTouchedPath. Old files import the split symbols from their new modules and keep no copies. Three pure re-export files were deleted outright, aeg-core stopped exporting log subpaths, and no compatibility shells or forwarding re-exports were left behind. Every importer was re-pointed with full-path and segment greps. The Log sink stopped importing packageRoot; its default vinayaVersion returns 'unknown', and the process's createVinayaLogSink supplies the real version via readVinayaVersion from cliPackageRoot(). The dev-tools bridge became a standalone program at harness/kernel/tools/host/dev-tools-bridge.ts, runnable under Bun from source and Node from its built file, with the CLI build emitting it into the installed package and the CLI router losing its dev-bridge subcommand. Four packages were marked private and dropped from the changeset release group, with the package-compat snapshot updated and the assemble step deleted. The kernel gained a bunfig.toml preload, the inventory and shard lists were updated, and the architecture ratchet's compareBase gained five relocation rules (unpaired renames, split imports, re-pointed specifiers, re-pointed comment paths, and moves from unscanned to scanned roots) each proven with failing counterparts in temporary git repositories.
How it went
The refactor landed with the frozen proof, ratchet base comparison, Log sink census (bytes unchanged at its new place) and configuration golden all passing. The kernel import test passes with no kernel file importing an application or process, and the kernel declares no workspace dependency on aeg-core, which now depends on the kernel. Existing suites pass unchanged in assertions except for expected paths, bridge invocation arguments, deleted assemble-step tests and inventory preload expectations. Two accepted losses were stated: the bridge program records no cli_command operation event, and the root-configuration CI job no longer re-runs the 22 tests that left apps/cli/tests.
Worth knowing
This is a very large, tightly sequenced change: shard lists, inventory, workspace dev dependencies and the prose gate's swept file sets all had to change in the same commit, and tasks 2–7 depend on the new compareBase relocation rules. The accepted losses are real regressions in observability and CI coverage. The post is an issue specification rather than a merged-PR writeup, so the actual diff, review outcome and any follow-up fixes are not shown. The bridge's Node-from-built-file path and the installed-package layout are asserted but not demonstrated here.
Wiring
Work proceeds in dependency order: first the Boundary move list and destination rules, then the file moves with import re-pointing verified by full-path and segment greps, then the four helper splits with old files importing from new kernel modules, then deletion of the three re-export files and removal of aeg-core's log subpath exports. The Log sink's packageRoot dependency is replaced by a default 'unknown' vinayaVersion with the process's createVinayaLogSink supplying the real value via readVinayaVersion from cliPackageRoot(). The bridge program is wired through a new function beside cliEntryPath in apps/cli/src/lib/cli-entry.ts that returns the built file or the source path, and driverDevBridgeInvocation takes that path as a required argument with no CLI imports. Package privacy is set in each manifest and .changeset/config.json, with the package-compat snapshot and assemble step updated together. The kernel's bunfig.toml preload, scripts/test-suites/inventory.json, shard lists and workspace dev dependencies change in the same commit, and compareBase's five relocation rules are proven in harness/kernel/tests/architecture.test.ts using temporary git repositories.
Try it yourself
Read the structure-finish-v1 issue and the Boundary move list. Move the 109 listed files into harness/kernel/ at their final destinations, placing each module in the lowest kernel folder holding all its kernel callers and hoisting shared modules to subsystem or kernel roots. Move kernel-only tests beside the code they prove and Vinaya-aware tests under harness/processes/vinaya-strict/integration/ at the kernel module's path. Split FailedCheckLog, validatesJsonSchema, the Documentation-section reader and normalizeTouchedPath into new kernel modules, and make every old file import them from there with no copies or re-exports. Delete the three pure re-export files, drop the log subpaths from aeg-core's package.json, and re-point every importer using full-path and segment greps. Make the dev-tools bridge a standalone program with --socket and optional --capability, emit it into the CLI build, and remove the dev-bridge subcommand. Mark the four library packages private, update the changeset release group and package-compat snapshot, add harness/kernel/bunfig.toml, and extend compareBase with the five relocation rules plus failing counterparts.