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 line.
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.
Import attempts every constructible package in deterministic best-effort order. Each attempt stages the package in the disposable per-user Web coding cache, requires a fresh real-Chromium check, and reconciles immutable publication through the existing K1 projection. An exact version already present is accepted only when every source byte matches.
Concrete package failures are logged and deferred while other packages continue. After any round that imports at least one package, every failed package is retried in another deterministic round so newly published dependencies can unblock it. Import stops only when every package is imported or an entire round makes no progress. Terminal SUCCESS is written only when all packages were actually imported. 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. Fatal results require a concrete inability to complete a required operation, such as failure to construct a package, configure or open coding, pass a fresh Chromium check, inspect or reconcile immutable publication, or write the required log. The importer does not silently claim success for an unimported package.
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, or perform background work. Publication is its only durable source effect.