Expand description
§Loom Web bootstrap import
WebBootstrapImporter::import_all(archive, authority, user, log_path) performs the one-time tree-preserving Loom Web migration. write_preflight_log(archive, log_path) first replaces the Web import log with a complete warning-only whole-archive preflight. Import then appends every attempt and result to that log and flushes after every write.
Preflight warnings never stop bootstrap. Duplicate coordinates, unusual dependency names or selectors, unresolved dependencies, and non-self dependency cycles are recorded as WARN evidence. The planner keeps every package, omits only unusable ordering edges, chooses a deterministic best-effort order, and makes no success or failure decision.
For each package, import assigns the supplied authority and optimistically constructs a canonical SourcePackage. Invalid dependency declarations that cannot be represented are omitted from generated dependency metadata and ordering only; all usable declarations remain, including unresolved dependencies. A matching self-dependency is omitted from generated metadata because admitted candidate routing serves that family, while its route remains eligible for rewrite.
Preparation preserves every original package file except for two metadata changes. Documentation.md becomes an exact K1 dependency header followed by the original documentation bytes, and k1-web.json is generated with the original entry and test paths. Literal declared legacy /module/<name>/v<selector>/<path> routes in JavaScript, HTML, and CSS become current /<authority>/<name>/v<selector>/<path> routes. Relative imports, dynamic imports, Workers, nested assets, and non-UTF-8 files remain intact. Source is neither combined nor restructured.
Import attempts every constructible package once in deterministic best-effort order. For each package it attempts one fresh Chromium diagnostic and records the complete result. Diagnostic staging failures, unavailable dependencies, Chromium failures, and other uncertain check outcomes are warnings only: none gate migration publication. If the diagnostic runner itself cannot be configured or opened, that limitation is logged and publication still proceeds.
After the diagnostic attempt, the importer submits the complete prepared tree directly through the existing immutable K1 Web projection. An exact existing coordinate is accepted only when every source byte matches. A conflicting immutable winner, inability to construct source, unreconciled publication failure, projection/KTO/filesystem failure, or required-log failure is concrete and therefore fatal for the overall import, but does not prevent attempts for other packages.
The log records all warnings, diagnostic attempts and results, publication successes, and concrete errors without progress-round retries. Terminal SUCCESS is written only when every package was published or already matched exactly. Otherwise the log ends in FAILURE, and the caller receives the concrete remaining-package count plus the log path. Warnings and uncertainty never cause failure.
The returned inventory records every imported exact name, stable version, and complete source digest. The importer does not bundle source, convert through CodeDocument, assume one code file, require a declared dependency to occur in source, reject unused or test-only dependencies, globally reject incidental /module/ text, impose an arbitrary corpus limit, parse ZIP transport, create Accounts, groups, Profiles, Kmap topology, bootstrap state, source Objects, or Web drafts, deploy a daemon, resume, roll back, repair, retry, or perform background work. Publication is its only durable source effect.