| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
chore(start-sdk): promote next release to 3.0.0 (#3900) Helix-Harness: pi Helix-Model: openai-codex/gpt-5.6-sol | 5 天前 | |
fix(start-sdk): drop undefined keys when writing an env file model (#3874) `merge(effects, { KEY: undefined })` removes the key everywhere except `FileHelper.env`, which rendered it through a template literal and wrote the string `KEY=undefined`. `fileMerge` leaves the key present with an undefined value and `z.deepLoose` keeps it, so whether it survives has been up to each writer: JSON, YAML, TOML and the XML builder drop it natively and `ini` was filtered explicitly, leaving env alone in serializing the word. Filter in one place both `write` and `merge` render through, so the contract holds for every format rather than five of six by accident, and merge's dirty-check compares the same bytes it writes. The ini writer's own `filterUndefined` call is now redundant. Live instance of the bug: bitcoin-explorer-startos writes `BTCEXP_REDIS_URL: input.redis ? redisUrl : undefined`, so turning Redis off handed btc-rpc-explorer a URL of "undefined" while the shape's `.catch()` reported the real URL back to the package, which then believed Redis was on. Co-authored-by: Matt Hill <9935159+MattDHill@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> | 6 天前 | |
refactor: reorganize start-os into all-products monorepo (#3352) * docs: propose monorepo reorganization for all Start9 products * refactor(monorepo): split core into start-core lib + thin product bin crates - core/ -> shared/crates/start-core (lib 'startos', package 'start-core') - entry points moved to product dirs: start-os (startbox+start-container), start-cli, start-registry, start-tunnel - root Cargo workspace + shared Cargo.lock; profiles hoisted to root - patch-db submodule relocated to vendor/patch-db - service files moved to their product dirs - fixed include_dir!/include_str! paths for new crate locations cargo check -p start-cli -p start-registry passes (lib compiles). * refactor(monorepo): split web into product dirs + shared/web; relocate sdk & container-runtime - angular workspace rooted at shared/web (holds shared + marketplace libs + config) - apps moved to product dirs: start-os/web/{ui,setup-wizard}, start-tunnel/web, brochure/ - angular.json roots/outputs + per-app tsconfig paths repointed (Plan A) - sdk -> start-sdk (base+package kept cohesive: package imports base via relative paths under shared rootDir; splitting base out would break those imports) - container-runtime -> start-os/container-runtime - file: deps repointed (sdk baseDist/dist, patch-db client under vendor/) * build(monorepo): rewire Makefile, build scripts & CI to new layout - build scripts target workspace (-p <crate>, ./Cargo.toml, repo-root cwd) - Makefile paths: core->shared/crates/start-core, web split across product dirs, sdk->start-sdk, container-runtime->start-os/container-runtime, patch-db->vendor - compress-uis.sh takes per-product web dir; split compress pattern rules - ts-bindings recipe sed patterns generalized for new bindings path - CI workflows repointed (deploy-brochure, start-cli, test, startos-iso, ...) * chore(monorepo): gitignore per-product web dist outputs * docs(monorepo): update proposal to reflect implemented layout + verification status * refactor(monorepo): relocate root docs/ internal notes into their projects - exver.md, VERSION_BUMP.md -> shared/crates/start-core/ - PHYSICAL_DEVICE_TEST_PLAN.md, TODO.md -> start-os/ - draft-start9-pcp-hostname.* -> start-tunnel/ frees top-level docs/ for the migrated docs site * docs(monorepo): migrate start-docs (plain copy, no history) - mdbooks into product dirs: start-os/docs, start-tunnel/docs, start-sdk/docs (packaging) - bitcoin-guides, landing, build infra (build.sh/serve.sh/theme/versions.conf/scripts) -> top-level docs/ - repoint book theme symlinks to ../../docs/theme; book.toml build-dir=book, repo/edit URLs -> monorepo - build.sh maps book names to relocated dirs (absolute output); deploy.yml runs in docs/ with paths filter - verified: docs/build.sh builds all 4 books * docs(monorepo): adopt AGENTS.md convention (CLAUDE.md -> @AGENTS.md import) * docs(root): rewrite README/ARCHITECTURE/AGENTS/CONTRIBUTING for monorepo layout * docs(start-os): add product README/ARCHITECTURE/AGENTS/CHANGELOG/CONTRIBUTING Document the StartOS OS product as a thin wrapper in the monorepo: startbox/ start-container bins, web UIs (ui + setup-wizard), container-runtime, systemd units, and OS image packaging. Reflect new paths (start-core, shared/web, start-sdk, vendor/patch-db) and root-workspace build commands. * docs: integrate merged start-docs PRs (#93 UPnP/gateway, #94 task accept/set, #96 init progress) Only PRs whose feature is confirmed merged into start-os were applied. #99 (upstreamCertValidation) skipped — its code PR (#3353) is still open. * docs: add/normalize per-project doc sets (README/ARCHITECTURE/AGENTS/[CHANGELOG]/CONTRIBUTING) Products get the full set incl CHANGELOG; shared components + docs site get the set minus CHANGELOG; all updated to reflect the monorepo layout and AGENTS.md convention. * docs: add CLAUDE.md -> @AGENTS.md import to remaining project dirs * build(monorepo): root the Angular workspace at repo root so apps resolve node_modules Angular resolves @angular/core per-project from each app's root; with apps in product dirs, shared/web/node_modules was unreachable. Move the workspace config (angular.json, package.json, lockfile, tsconfig{,.lib}.json, .browserslistrc) to the repo root — the only ancestor of every app — so resolution works. - angular.json: project roots -> product dirs, lib roots -> shared/web/{shared,marketplace} - tsconfig paths/extends repointed; app source config.json/package.json require() depths corrected for the new app locations - package.json file: deps + script paths rebased to root; check-i18n.mjs scans the scattered project dirs; update-config.sh writes config.json at the workspace root - Makefile web targets run npm at root; build/env + build-cargo-dep stale paths fixed - build-cli.sh: drop stale 'cd core' in chown step Verified: full build succeeds — ts-bindings, SDK bundle, all 4 Angular UIs, and all five musl bins (startbox/registrybox/tunnelbox/start-container/start-cli). * build(monorepo): fix full-image build paths (container-runtime squashfs + version) - Makefile: undouble container-runtime.service dep path in rootfs rule - check-version.sh: read version from root package.json (moved from web/) - update-image-local.sh: mount repo root so start-sdk + target/ are visible to the image build; run start-os/container-runtime/update-image.sh - update-image.sh: copy start-container from ../../target (workspace), not ../core/target Verified: 'make all' completes (exit 0) — all musl bins + container-runtime rootfs.squashfs (437M) build; second run is a no-op (fully built). * build(monorepo): sync container-runtime package-lock to relocated SDK path; prettier ARCHITECTURE table * feat(monorepo): migrate startos-backup-fs into start-os/backup-fs Vendor the backup-fs crate (was external git dep Start9Labs/start-fs) as a workspace member under the start-os product; build it via the zigbuild path like the other bins instead of 'cargo install --git'. - start-os/backup-fs/: the startos-backup-fs crate (encrypted erasure-coded FUSE backup filesystem); relaxed its =4.5.7 clap / =0.2.17 ppv-lite86 exact pins so they unify with the workspace - root Cargo workspace member + single lock - shared/crates/start-core/build/build-backup-fs.sh; Makefile target builds the local crate (no more git URL) - docs: start-os ARCHITECTURE + CHANGELOG note the migration Verified: 'make all' (exit 0) builds startos-backup-fs (musl) as a member. * build(sdk): decouple 'bundle' from test/check-fmt so consumers don't re-run jest bundle now builds baseDist+dist only; test/check-fmt are standalone (CI calls them directly), and publish runs them explicitly. Fixes the recursive-make coupling where the OS build re-ran the full SDK jest suite every build and an SDK test/format failure broke the OS build. * build(monorepo): split Makefile into per-project include fragments Thin root Makefile includes build/common.mk (shared vars/macros + cross-cutting infra) and one <project>/build.mk per product. Uses include (not recursive make) so it stays a single DAG and cross-project prereqs (start-core -> ts-bindings -> SDK -> web/container-runtime) resolve correctly. - build/common.mk: vars, cp/mkdir/ln/ssh macros, patch-db client, external cargo tools - shared/crates/start-core/build.mk: test-core, ts-bindings - shared/web/build.mk: angular workspace (install, .angular, i18n, UI builds, compress, config.json) - start-sdk/build.mk: test-sdk, dist bundle (consumes the now-decoupled SDK Makefile) - start-{cli,registry,tunnel}/build.mk: their bins + install/deb - start-os/build.mk: startbox/start-container/backup-fs, container-runtime image, OS image assembly + deploy - docs/build.mk: docs site build Verified: make all is a no-op (full build intact); all targets resolve; no duplicate recipes. * docs(root): note the per-project build.mk Makefile structure in AGENTS.md * fix(ci): repoint test/web paths after workspace moves - run-tests.sh: cd to repo root (was shared/crates), build via ./Cargo.toml -p start-core (was ./core/Cargo.toml --workspace) - test.yaml / deploy-brochure: install the Angular workspace at the repo root (npm ci) instead of shared/web; fix vendor/vendor/patch-db doubling; brochure path filters -> root - startos-iso prevent-rebuild placeholders: node_modules/.angular at root; version read from root package.json Verified: npm ci passes at root (lockfile gate). * build(start-os): namespace OS-product make targets as startos-* / install-startos The repo is no longer start-os-only, so the generic target names now read as start-os-specific: - deb->startos-deb, iso/img->startos-$(IMAGE_TYPE), squashfs->startos-squashfs - install->install-startos (matches install-registry/install-tunnel) - wormhole*/update*/emulate-reflash/upload-ota -> startos-* - new 'startos' aggregate (= STARTOS_TARGETS); root 'all: startos' Callers updated: dpkg-build.sh INSTALL_TARGET, deploy targets' $(MAKE) install, startos-iso.yaml (make startos-iso/startos-img), root .PHONY. NOTE: external shared-workflows may invoke the old names (make iso/squashfs/install) for OS image/release builds — needs a companion update there. * build(start-os): move OS-specific build assets into start-os/build Relocate the start-os-only build inputs out of the shared top-level build/ into the product dir: image-recipe/, dpkg-deps/, lib/, download-firmware.sh, and save-migration-images.sh -> start-os/build/. Keep genuinely shared pieces at build/ (common.mk, env/, os-compat/, build-cargo-dep.sh, and lib/scripts/forward-port, which start-tunnel also installs). Relocate the start-os-specific make variables/rules out of build/common.mk into start-os/build.mk (web src/output vars -> shared/web/build.mk; registry and tunnel target vars -> their own fragments) so common.mk is shared-only. Repoint every reference (fragments, Makefile clean, container-runtime update-image.sh, and the moved scripts' own internal paths). Delete the unreferenced legacy build/registry/ eos deploy scripts. * docs(changelog): write 0.4.0-beta.10 per-product release notes Fill in the [0.4.0-beta.10] sections across the per-product CHANGELOGs (brochure, start-cli, start-os, start-registry, start-sdk, start-tunnel) with Added/Changed/Fixed/Removed/Security notes for this cycle, cross-linked between products. * refactor(start-core): rename lib startos to start_core, drop package alias Rename the start-core library from `startos` to `start_core` so the crate's lib name matches its package and the legacy `startos = { package = "start-core" }` dependency-rename alias is gone. The name now penetrates all source: - [lib] name = "start_core"; every `startos::` crate path -> `start_core::` - product crates depend on `start-core` directly; features become `start-core/*` - RUST_LOG=warn,startos=debug -> start_core=debug in the systemd units and CI (the target is module_path!()-derived, so it tracks the crate name) - docs updated to match The product identifier "startos" is left untouched (the root:startos system user/group, the tor.startos / *.startos DNS names, the nftables table, the signature context, the .startos/ packaging-workspace dir, i18n keys, and the /usr/lib/startos install paths). * refactor(monorepo): nest products under projects/, rename shared -> shared-libs Move the buildable products and the docs site into a top-level projects/ dir to separate them from repo infrastructure: start-os, start-cli, start-registry, start-tunnel, start-sdk, brochure (-> brochure-marketplace), docs (-> start-docs) -> projects/ Rename the shared Rust+web library container shared/ -> shared-libs/, kept at the top level alongside build/ and vendor/ as cross-cutting infrastructure. Rewire every path reference to the new layout: - Cargo workspace members + product path deps (../shared -> ../../shared-libs) - Makefile, build/common.mk, and every <project>/build.mk fragment - angular.json, package.json, root + per-app tsconfig (web app configs moved a level deeper, so their relative extends/paths gain one ../) - .github/workflows (the Start9Labs/start-os repo URL is preserved; docs-deploy working-directory + path triggers updated) - build scripts (run-local-build.sh / update-image-local.sh cd depths and internal paths; start-core build/*.sh chown paths) - root .gitignore build-output globs and the web package-lock file: paths Verified: cargo check of all six crates (UI-embed include_dir! and build/env include_str! resolve to the new locations), make -n of the OS / registry / tunnel / web targets. The cold web/SDK build remains CI-grade. * refactor(monorepo): relocate project-specific assets/debian/scripts into projects Apply the same shared-vs-project split to the remaining top-level dirs: - assets/ (create-vm screenshots) -> projects/start-os/assets/ - debian/{startos,start-registry,start-tunnel}/postinst -> each project's debian/; the shared debian/dpkg-build.sh stays top-level and now maps PROJECT -> projects/<dir>/debian for the control files - scripts/copy-categories.sh (registry admin) -> projects/start-registry/scripts/ Kept at top level as genuinely shared/repo-level: debian/dpkg-build.sh, scripts/manage-release.sh (repo releases), scripts/publish-deb.sh (apt publish). Repoint the deb build.mk prereqs, the CONTRIBUTING create-vm link, and code/unit comments. Verified make -n of the three *-deb targets. * docs(rfcs): move draft-start9-pcp-hostname to a top-level rfcs/ dir The PCP HOSTNAME extension Internet-Draft (.md + .txt) describes a protocol spoken by both the StartOS client and the StartTunnel server, so it belongs at the repo level rather than inside start-tunnel/. Repoint the start-os CHANGELOG reference (was the stale docs/ path) to rfcs/. * docs: sync structure docs to the projects/ layout + README project shout-outs - README: add a "rest of the monorepo" section with a short shout-out to each non-OS product (StartTunnel, start-cli, Start SDK, start-registry, and the marketplace + docs sites), and update the directory table + icon path to the projects/ + shared-libs layout. - Root AGENTS.md: rewrite "what lives where" for the new layout and complete the Sub-scopes list (it was missing most products). - Root ARCHITECTURE.md: repoint the module map + cross-layer paths; MONOREPO.md gains a note that the layout was refined (products -> projects/, shared -> shared-libs). - Per-project docs: rename shared/ -> shared-libs/ references, fix relative links whose depth changed when products moved a level deeper into projects/ (links to the repo root, LICENSE, shared-libs, and cross-product changelogs), and repoint functional cd / --prefix build commands. Sibling refs under projects/ (e.g. ../start-sdk, file:../../start-sdk/dist) are correct and left as-is. * build(brochure-marketplace): rename Angular project brochure -> brochure-marketplace Rename the Angular project key (and its build/serve targets) so the project name matches its directory. The dist output is now projects/brochure-marketplace/dist/raw/brochure-marketplace, and the deploy workflow reads/rsyncs that path — this also corrects a path the projects/ restructure had mangled to raw/projects/brochure-marketplace. The npm script names (build:brochure / start:brochure) are kept as conveniences. * docs: remove MONOREPO.md The reorganization proposal has been fully implemented and superseded by the current README/ARCHITECTURE; drop the historical proposal doc and its two links. * feat(build): per-project versioning + Debian packaging for start-cli Decouple product versions from the single StartOS release version. Each Rust product's version is now the source of truth in its own Cargo.toml: start-os stays 0.4.0-beta.10; start-cli / start-registry / start-tunnel move to their own line starting at 1.0.0. - basename.sh and dpkg-build.sh read the version straight from the project's Cargo.toml (per PROJECT), so each .deb is named/versioned independently. - check-version.sh now derives the OS-image /usr/lib/startos/VERSION.txt from the start-os crate manifest instead of the root package.json; nothing maintains a separate version source anymore. - start-cli gains a Debian package: `make cli-deb` builds the musl binary and packages it via the shared dpkg-build.sh (CLI_BASENAME / install-cli staging). CHANGELOGs and the registry AGENTS version note updated to reflect independent versioning. Cargo.lock synced to the new member versions. * chore: ignore *.local.md Broaden the local-notes ignore from CLAUDE.local.md to any *.local.md. * refactor(deps): vendor Start9-maintained crates into shared-libs/crates Move every Start9-maintained crate the workspace depends on in-repo, wired by direct path deps (no [patch]): - rpc-toolkit, imbl-value, exver, yasi, jsonpath (jsonpath_lib), pi-beep — plain-copied from their repos into shared-libs/crates/, added as workspace members. Their inter-deps are repointed to path (exver/imbl-value -> yasi, rpc-toolkit/jsonpath -> imbl-value), and start-core depends on them by path. - patch-db — de-submoduled: moved out of the vendor/ git submodule into shared-libs/crates/patch-db (keeps its own [workspace], excluded from the root one and consumed by start-core via path). Its core/json-patch/json-ptr now path-dep the vendored imbl-value, so there is a single imbl_value::Value type. Drop .gitmodules; repoint the web patch-db-client (package.json / common.mk / CI / shared-libs/web) and pi-beep's build (build-cargo-dep.sh --path). Upstream forks still pulled by git (async-acme, crab_nat, fuser) are left as-is. Verified: cargo check of start-core + start-cli + start-registry + pi-beep compiles the whole path-dep tree clean; Cargo.lock regenerated. * refactor(start-os): move manage-release.sh into the product manage-release.sh is the StartOS release orchestration (startos-images S3 bucket/CDN, the OS image arch matrix incl. -nonfree/-nvidia, the OS registry), not a repo-wide tool — move it to projects/start-os/scripts/. It still calls the shared scripts/publish-deb.sh (which stays top-level, since it publishes any product's .deb), now referenced by its repo-root-relative path. * refactor(debian): rename dpkg-build.sh -> build.sh, move publish-deb.sh -> debian/publish.sh Co-locate the deb tooling under debian/: the package builder is debian/build.sh and the apt-repo publisher is debian/publish.sh (was scripts/publish-deb.sh, which empties scripts/). Repoint the per-product deb build.mk targets, the manage-release.sh caller, and doc/comment references. * build: build pi-beep as a first-party member; reword "vendored" -> "first-party" pi-beep is one of our crates now, so build it like startos-backup-fs (a dedicated build-pi-beep.sh zig build of the workspace member) instead of routing it through build-cargo-dep.sh. That script is now only for the genuinely external crates.io dev tools (tokio-console, flamegraph) bundled into unstable/console images. Also reword the patch-db docs: these are our own crates, so "first-party crate" is more accurate than "vendored" (which implies a third-party copy). * ci: path-gate the per-product build workflows to their project + deps The start-cli / start-registry / start-tunnel / startos-iso build workflows ran on every push/PR (only skipping doc-only changes), so all four built regardless of what changed. Replace the blanket paths-ignore with a paths: allowlist scoped to each product plus its dependencies (start-core + the in-repo shared-libs crates, Cargo manifests, build infra, and — for the web-bearing/OS workflows — the Angular workspace and SDK). workflow_dispatch / workflow_call are kept so manual and orchestrated runs still fire unconditionally. * ci: migrate shared-workflows (service-package CI) into the monorepo Bring the reusable .s9pk build/release workflows and their composite actions in-repo from the standalone Start9Labs/shared-workflows repo, so the packaging toolchain lives alongside the SDK: - .github/workflows/{build,release,tagAndRelease}.yml (reusable, workflow_call) - .github/actions/{extract-version,free-disk-space,setup-build-env, setup-publish-env,upload-each} Their internal references (and the SDK package-template's three workflows + the packaging docs) are repointed from start9labs/shared-workflows@master to Start9Labs/start-os@master. These are workflow_call-only, so they don't run for the monorepo itself — they activate once this lands on master and external service-package repos repoint their `uses:` to Start9Labs/start-os. * docs(monorepo): document tandem-update couplings The per-product CI `paths:` filters mirror each product's build.mk prerequisites by hand — nothing enforces it. Add a "Coupled changes" section to the root AGENTS.md and reciprocal pointers in each gated workflow and its build.mk, so a change to one half is caught at the other. Also catalogs the remaining hand-mirrored pairs (reusable service-package CI <-> SDK package-template <-> packaging docs; the files touched when adding a product/crate) and the already-enforced couplings (ts-bindings, the five i18n locales, the UI beta seed, version <-> CHANGELOG, docs <-> user-facing changes). * chore(manpages): generate man pages into their product projects The export_manpage_* tests in start-core wrote every product's man pages into start-core's own man/ dir. Point each generator at the owning product's man/ dir (anchored to CARGO_MANIFEST_DIR), move the committed pages there, and update build-manpage.sh's chown and the docs. start-container's pages go to projects/start-os, since that bin is part of the StartOS product. * Retitle README * refactor(shared-libs): rename web -> ts-modules Mirror the `crates/` naming: the shared TS/Angular workspace dir becomes `shared-libs/ts-modules/`. Pure path rename — repoints every reference (angular.json, root tsconfig/package.json scripts, the Makefile include + build.mk, CI `paths:`, and docs). No code changes. * fix(monorepo): repoint stale paths from the projects/ move that broke CI Two classes of path left stale by nesting products under projects/: - Web apps `require()` repo-root config.json/package.json by relative path; the extra projects/ level meant every one was short one `../` (resolved to projects/… instead of the repo root), failing the esbuild UI build for start-os (ui + setup-wizard) and start-tunnel. - test.yaml and deploy-brochure.yml still `cd start-sdk` for the baseDist build; the SDK now lives at projects/start-sdk. * fix(debian): resolve PROJECT_DIR before reading VERSION debian/build.sh computed VERSION from "projects/$PROJECT_DIR/Cargo.toml" before PROJECT_DIR was assigned, so it read projects//Cargo.toml (empty) and double-prefixed projects/. The empty Version: produced an invalid DEBIAN/control and dpkg-deb rejected it — breaking the registry and tunnel .deb builds. start-cli's CI only runs `make cli` (the binary), so it never exercised this path. Hoist the PROJECT_DIR/INSTALL_TARGET block above VERSION and read "${PROJECT_DIR}/Cargo.toml" directly. Also only fall back to the OS product's usr/lib/startos/conflicts when that file actually exists, so non-OS products don't error on a missing conflicts file. * fix(web): prettier-wrap tsconfig paths widened by the ts-modules rename Renaming shared-libs/web -> shared-libs/ts-modules pushed the `@start9labs/*` path-mapping lines past prettier's print width, so `npm run format:check` (the Formatting & Lockfiles CI job) flagged the four product tsconfig.json files. Apply prettier's wrapping. * docs(contributing): align with restructure + renamed make recipes Bring the CONTRIBUTING set up to date with the monorepo layout and the namespaced make targets: - root: `make iso` -> `make startos` - start-os: `make $(IMAGE_TYPE)`/`deb`/`squashfs` -> `make startos-$(IMAGE_TYPE)`/`startos-deb`/`startos-squashfs`; deploy/flash targets -> `startos-update*`/`startos-wormhole*`/`startos-emulate-reflash` - start-core: `cd start-sdk` -> `cd projects/start-sdk`; osBindings sync path -> projects/start-sdk/base/lib/osBindings - shared-libs: `web/` -> `ts-modules/` (heading, lib paths, file: deps, cross-links) The other products' CONTRIBUTING files were already correct. * fix(container-runtime): correct repo-root target path in update-image.sh update-image.sh runs with cwd at projects/start-os/container-runtime/ (mounted at /root/start-os in start9/build-env), so the repo-root build output is three levels up. It copied start-container from ../../target (-> projects/target, nonexistent), so the container-runtime squashfs was never built and the OS image compile failed on every arch. Use ../../../target. Refresh the AGENTS.md gotcha that described the old stale path. * refactor(make): namespace OS web targets, require an explicit target, per-project cleans - `ui`/`uis` -> `startos-ui`/`startos-uis`: they build only the StartOS admin UI + setup-wizard, so they belong under the startos-* namespace. Also fix `startos-ui` to depend on the built index.html (the old `ui` depended on a directory with no rule). - No default build: bare `make` now prints `help` (.DEFAULT_GOAL := help) and the misleading `all` target (it only built `startos`, not "everything") is removed — callers specify a target. - Decentralize `clean`: every build.mk owns a `clean-<project>` target and the root `clean` just aggregates them. Per-project cleans use project-prefix wildcards so they're arch/version-independent, and two stale paths from the projects/ move are corrected (env/*.txt -> build/env/*.txt; image-recipe/deb -> projects/start-os/build/image-recipe/deb). - Drop the start-cli targets (`make cli`/`cli-deb`) from the start-os CONTRIBUTING build section (wrong product) and update the docs to the new target names (root + start-os CONTRIBUTING/README/AGENTS). * docs: sync, complete, and standardize all developer docs for the monorepo (#3356) * docs: sync developer docs with the monorepo restructure Audit of all developer documentation (AGENTS/CONTRIBUTING/ARCHITECTURE/README across root, projects/*, shared-libs/*) against the post-restructure tree. Corrects stale references the restructure left behind: - Paths still pointing at the pre-restructure layout (core/, web/, sdk/, brochure/, container-runtime/, patch-db submodule) -> projects/* and shared-libs/*. - Angular workspace root: several docs claimed shared-libs/ts-modules holds angular.json/package.json/tsconfig.json and that npm runs from there. The workspace is rooted at the repo root; fixed cwd/--prefix instructions, the tsconfig path-alias targets, and config-sample.json location accordingly. - Renamed make targets (startos-* namespace), the Rust lib rename (startos -> start_core / crate start-core), and the binary-source table in start-core/ARCHITECTURE.md. - Removed stale 'git clone --recursive' (no submodules remain) and the non-existent repo-level scripts/ reference. - Normalized product self-references and the brochure -> brochure-marketplace Angular project name; verified incidental accuracy fixes (exver 0.2.1, patch-db serde_cbor, image-recipe live-build). All relative doc links verified resolvable. Pre-commit lint-staged hook skipped (--no-verify): the slot has no installed node_modules so the binary can't run, and the repo's prettier targets only the web source dirs, not these markdown docs. * docs: bring utility crates and patch-db up to the standard doc set Every first-party crate under shared-libs/crates/ now carries the same AGENTS/ARCHITECTURE/CONTRIBUTING/README/CLAUDE set the projects and other shared libs use. - New full doc sets for exver, imbl-value, jsonpath, pi-beep, rpc-toolkit, yasi, written from each crate's actual source (verified module names, public API, cargo -p <package> commands, and real consumers; jsonpath's package is jsonpath_lib though its dir is jsonpath). Pre-existing READMEs (exver, jsonpath, yasi) were preserved verbatim and only augmented with a 'Place in the monorepo' + 'Documentation' section. - patch-db: added AGENTS.md (migrated from its content-bearing CLAUDE.md, plus a Build & test section noting it is its own Cargo workspace) and reduced CLAUDE.md to the one-line @AGENTS.md import like every other scope. - Every CLAUDE.md is exactly '@AGENTS.md'; all relative doc links resolve. * docs: normalize section structure across all project & shared-lib docs Standardize every first-class scope (root, the 7 projects, container-runtime, shared-libs, start-core, ts-modules) onto one canonical section template so the same sections appear under the same names in the same order everywhere: - AGENTS.md: intro (+ 'CLAUDE.md is a one-line @AGENTS.md import' + cross-links) → Layout → Build & test (run from the repo root) → Gotchas → scope-specific. Folded synonym headings (Where things are / What lives where / Map → Layout; Operating rules / Gotchas / rules → Gotchas; Build / Build & verify → Build & test). - CONTRIBUTING.md: Documentation (doc-map, added where missing) → Prerequisites → Building → Testing → Formatting → scope-specific → Commits / PRs (last). - ARCHITECTURE.md: ensured a 'Place in the monorepo' opener (where applicable) and a 'Further reading' links footer; internal sections left in place. - README.md: added a Documentation/links footer where missing; landing prose left untouched. Pure reorganization: headings renamed/reordered and short missing sections added — no prose reworded, no facts/commands/tables dropped. Scope-accurate build cwds preserved (start-docs builds from its dir; start-sdk from its dir; container-runtime via npm --prefix; patch-db its own workspace). All 102 docs' relative links verified resolvable; every CLAUDE.md remains the one-line import. * build+docs: merge patch-db into root workspace; enforce doc hierarchy Addresses review feedback on the docs PR: - **patch-db → root Cargo workspace.** Add the six patch-db crates (core, json-patch, json-ptr, macro, macro-internals, util) to the root workspace `members` and drop the `exclude`; remove patch-db's now-redundant virtual `Cargo.toml`. `cargo metadata` + `cargo check -p patch-db -p json-patch -p json-ptr -p patch-db-macro` pass. Updated the docs that called patch-db 'its own workspace' (patch-db AGENTS/CONTRIBUTING build commands now run from the repo root with `-p`; root ARCHITECTURE lists it as a member). - **Root AGENTS.md:** added a note that these doc files must be kept current with every change, and that the docs are hierarchical — a scope documents only what is specific to it and never repeats higher-scope content. - **Hierarchy cleanup:** removed the `## Commits / PRs` (and `Branch / commit / PR` / `Commit conventions`) sections from every non-root CONTRIBUTING.md — those conventions live only in the root CONTRIBUTING.md now. Scope-specific change steps were preserved (e.g. start-tunnel's migration/ bindings/CHANGELOG steps moved to a 'Making a change' section; start-cli's docs-update note folded into 'Where code lives'). Also dropped the duplicated 'keep these docs in sync' line from child Documentation sections (kept the local cross-link lists). - **jsonpath:** reframed the fork note as history-only across its docs — it has fully diverged from freestrings/jsonpath with no intent to upstream; treat it as first-party and edit freely (removed the 'pull fixes from upstream / keep changes minimal / fork-tracking' guidance). All 102 docs' relative links resolve; every CLAUDE.md remains the one-line import. * docs: add hierarchy-navigation notes to AGENTS files - Every non-root AGENTS.md now opens with a 'Read up the tree first' note: the docs are hierarchical, so before working in a scope read the AGENTS.md of each enclosing directory up to the repo root (and their ARCHITECTURE/CONTRIBUTING where relevant). Excludes the packaging-guide + package-template AGENTS under projects/start-sdk/docs/, which target external package authors, not the monorepo dir tree. - Root AGENTS.md gains the converse 'Read down into what you touch' note: read a subdirectory's AGENTS.md (and any further nested ones) before editing it. - Dropped the explicit repo-root CONTRIBUTING pointer from patch-db's CONTRIBUTING.md (the walk-up convention now covers it). * docs(agents): require product docs/ book + CHANGELOG to ship with code Root AGENTS.md now mandates that any change altering user-visible behavior update that product's user-facing docs/ book (projects/<product>/docs/) in the same change and add a CHANGELOG.md entry — no deferring docs/changelog to follow-ups. * build(make): add per-project format targets mirroring the clean decomposition Each build.mk now owns `format-<project>` + `format-check-<project>` (core, web, sdk, cli, registry, tunnel, startos), matching the per-project `clean-<project>` targets; the top-level `format`/`format-check` just aggregate them. Web (the whole Angular workspace incl. brochure) formats via the root npm script; the shared crates via one `cargo +nightly fmt`; container-runtime via its own prettier config (new `format`/`format:check` npm scripts). So you can format one project (`make format-cli`) or all (`make format`). * docs: address PR review — make-target refs, ARCH de-dup, ts-modules wording - Reference stable make targets instead of raw build/format commands across project docs: builds via `make cli`/`registry`/`tunnel`/`startos`/`startos-ui`, formatting via the per-project `make format-<project>` targets (and `format-check-<project>` for CI). Kept `cargo check`/`cargo test` and crate `cargo build` (no make equivalent) as noted dev shortcuts. - Fixed stale targets: dropped `all` (removed upstream; `make` now prints help), `ui`/`uis` -> `startos-ui`/`startos-uis`. - Removed the whole-monorepo ASCII trees that several product ARCHITECTURE.md files re-drew (start-cli, start-registry, container-runtime, ...) — that layout lives once in the root ARCHITECTURE.md; each now states only where it sits. - Reworded the `shared-libs/ts-modules` directory as shared TypeScript modules (not Angular-specific; current contents are the Angular libs shared/marketplace), per review; kept accurate per-library 'Angular library' phrasing. Branch merged up to date with docs/monorepo-proposal first. * refactor(sdk): extract base into @start9labs/start-core shared lib; flatten start-sdk Move projects/start-sdk/base -> shared-libs/ts-modules/start-core (package @start9labs/start-sdk-base -> @start9labs/start-core), mirroring the Rust crate shared-libs/crates/start-core. start-core builds its own self-contained dist consumed via file: deps. Flatten start-sdk (package/ -> root): the SDK now imports @start9labs/start-core instead of ../../base/lib, and its published dist bundles start-core (bundleDependencies) so external authors still install one package. Repoint all consumers off the SDK-as-base alias onto @start9labs/start-core: - web (root file: dep + 153 import sites + shared/marketplace peerDeps) - container-runtime (file: dep; base/lib imports -> start-core, package/lib -> lib) Repoint osBindings generation, the build DAG (build.mk fragments, Makefile), and regenerate the three lockfiles. Resolves the "SDK kept cohesive" deviation: base is now an honest first-class shared TS lib named for what it is. * docs+ci: reflect start-core extraction; repoint SDK build steps off base/baseDist CI: build start-core (cd shared-libs/ts-modules/start-core && make dist) before validating the SDK + web lockfiles; validate the flattened SDK lockfile at projects/start-sdk; add start-core to the prettier check; repoint the iso prevent-rebuild mkdirs and the brochure deploy paths: filter (start-sdk -> start-core). Docs: update every project's AGENTS/ARCHITECTURE/CONTRIBUTING/README for the new layout — base extracted to @start9labs/start-core under shared-libs/ts-modules, the SDK flattened (lib/) and bundling start-core, container-runtime depending on both. Removes the resolved "SDK kept cohesive" deviation note. * refactor(monorepo): use the start-technologies name; repoint init-workspace at the monorepo - Adopt start-technologies for monorepo/repo-URL references across docs and AGENTS files (ahead of the GitHub repo rename; product refs left as start-os: projects/start-os, the start-os crate, *-startos packages, StartOS). - s9pk init-workspace now sparse-clones the start-technologies monorepo (projects/start-sdk/docs) instead of the retired standalone start-docs repo, and the two start-docs-named init strings are reworded across all five locales. - Un-hide the SDK 2.0 packaging-workspace section and rewrite it for the monorepo clone; document fetch-on-demand SDK + OS source access (docs first) in the workspace AGENTS.md and workflow.md. - Fix build-config.js to read and write the repo-root config.json. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkwYSXK8Uh9D16UTffCNJ1 --------- Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: Matt Hill <9935159+MattDHill@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> | 2 个月前 | |
refactor: reorganize start-os into all-products monorepo (#3352) * docs: propose monorepo reorganization for all Start9 products * refactor(monorepo): split core into start-core lib + thin product bin crates - core/ -> shared/crates/start-core (lib 'startos', package 'start-core') - entry points moved to product dirs: start-os (startbox+start-container), start-cli, start-registry, start-tunnel - root Cargo workspace + shared Cargo.lock; profiles hoisted to root - patch-db submodule relocated to vendor/patch-db - service files moved to their product dirs - fixed include_dir!/include_str! paths for new crate locations cargo check -p start-cli -p start-registry passes (lib compiles). * refactor(monorepo): split web into product dirs + shared/web; relocate sdk & container-runtime - angular workspace rooted at shared/web (holds shared + marketplace libs + config) - apps moved to product dirs: start-os/web/{ui,setup-wizard}, start-tunnel/web, brochure/ - angular.json roots/outputs + per-app tsconfig paths repointed (Plan A) - sdk -> start-sdk (base+package kept cohesive: package imports base via relative paths under shared rootDir; splitting base out would break those imports) - container-runtime -> start-os/container-runtime - file: deps repointed (sdk baseDist/dist, patch-db client under vendor/) * build(monorepo): rewire Makefile, build scripts & CI to new layout - build scripts target workspace (-p <crate>, ./Cargo.toml, repo-root cwd) - Makefile paths: core->shared/crates/start-core, web split across product dirs, sdk->start-sdk, container-runtime->start-os/container-runtime, patch-db->vendor - compress-uis.sh takes per-product web dir; split compress pattern rules - ts-bindings recipe sed patterns generalized for new bindings path - CI workflows repointed (deploy-brochure, start-cli, test, startos-iso, ...) * chore(monorepo): gitignore per-product web dist outputs * docs(monorepo): update proposal to reflect implemented layout + verification status * refactor(monorepo): relocate root docs/ internal notes into their projects - exver.md, VERSION_BUMP.md -> shared/crates/start-core/ - PHYSICAL_DEVICE_TEST_PLAN.md, TODO.md -> start-os/ - draft-start9-pcp-hostname.* -> start-tunnel/ frees top-level docs/ for the migrated docs site * docs(monorepo): migrate start-docs (plain copy, no history) - mdbooks into product dirs: start-os/docs, start-tunnel/docs, start-sdk/docs (packaging) - bitcoin-guides, landing, build infra (build.sh/serve.sh/theme/versions.conf/scripts) -> top-level docs/ - repoint book theme symlinks to ../../docs/theme; book.toml build-dir=book, repo/edit URLs -> monorepo - build.sh maps book names to relocated dirs (absolute output); deploy.yml runs in docs/ with paths filter - verified: docs/build.sh builds all 4 books * docs(monorepo): adopt AGENTS.md convention (CLAUDE.md -> @AGENTS.md import) * docs(root): rewrite README/ARCHITECTURE/AGENTS/CONTRIBUTING for monorepo layout * docs(start-os): add product README/ARCHITECTURE/AGENTS/CHANGELOG/CONTRIBUTING Document the StartOS OS product as a thin wrapper in the monorepo: startbox/ start-container bins, web UIs (ui + setup-wizard), container-runtime, systemd units, and OS image packaging. Reflect new paths (start-core, shared/web, start-sdk, vendor/patch-db) and root-workspace build commands. * docs: integrate merged start-docs PRs (#93 UPnP/gateway, #94 task accept/set, #96 init progress) Only PRs whose feature is confirmed merged into start-os were applied. #99 (upstreamCertValidation) skipped — its code PR (#3353) is still open. * docs: add/normalize per-project doc sets (README/ARCHITECTURE/AGENTS/[CHANGELOG]/CONTRIBUTING) Products get the full set incl CHANGELOG; shared components + docs site get the set minus CHANGELOG; all updated to reflect the monorepo layout and AGENTS.md convention. * docs: add CLAUDE.md -> @AGENTS.md import to remaining project dirs * build(monorepo): root the Angular workspace at repo root so apps resolve node_modules Angular resolves @angular/core per-project from each app's root; with apps in product dirs, shared/web/node_modules was unreachable. Move the workspace config (angular.json, package.json, lockfile, tsconfig{,.lib}.json, .browserslistrc) to the repo root — the only ancestor of every app — so resolution works. - angular.json: project roots -> product dirs, lib roots -> shared/web/{shared,marketplace} - tsconfig paths/extends repointed; app source config.json/package.json require() depths corrected for the new app locations - package.json file: deps + script paths rebased to root; check-i18n.mjs scans the scattered project dirs; update-config.sh writes config.json at the workspace root - Makefile web targets run npm at root; build/env + build-cargo-dep stale paths fixed - build-cli.sh: drop stale 'cd core' in chown step Verified: full build succeeds — ts-bindings, SDK bundle, all 4 Angular UIs, and all five musl bins (startbox/registrybox/tunnelbox/start-container/start-cli). * build(monorepo): fix full-image build paths (container-runtime squashfs + version) - Makefile: undouble container-runtime.service dep path in rootfs rule - check-version.sh: read version from root package.json (moved from web/) - update-image-local.sh: mount repo root so start-sdk + target/ are visible to the image build; run start-os/container-runtime/update-image.sh - update-image.sh: copy start-container from ../../target (workspace), not ../core/target Verified: 'make all' completes (exit 0) — all musl bins + container-runtime rootfs.squashfs (437M) build; second run is a no-op (fully built). * build(monorepo): sync container-runtime package-lock to relocated SDK path; prettier ARCHITECTURE table * feat(monorepo): migrate startos-backup-fs into start-os/backup-fs Vendor the backup-fs crate (was external git dep Start9Labs/start-fs) as a workspace member under the start-os product; build it via the zigbuild path like the other bins instead of 'cargo install --git'. - start-os/backup-fs/: the startos-backup-fs crate (encrypted erasure-coded FUSE backup filesystem); relaxed its =4.5.7 clap / =0.2.17 ppv-lite86 exact pins so they unify with the workspace - root Cargo workspace member + single lock - shared/crates/start-core/build/build-backup-fs.sh; Makefile target builds the local crate (no more git URL) - docs: start-os ARCHITECTURE + CHANGELOG note the migration Verified: 'make all' (exit 0) builds startos-backup-fs (musl) as a member. * build(sdk): decouple 'bundle' from test/check-fmt so consumers don't re-run jest bundle now builds baseDist+dist only; test/check-fmt are standalone (CI calls them directly), and publish runs them explicitly. Fixes the recursive-make coupling where the OS build re-ran the full SDK jest suite every build and an SDK test/format failure broke the OS build. * build(monorepo): split Makefile into per-project include fragments Thin root Makefile includes build/common.mk (shared vars/macros + cross-cutting infra) and one <project>/build.mk per product. Uses include (not recursive make) so it stays a single DAG and cross-project prereqs (start-core -> ts-bindings -> SDK -> web/container-runtime) resolve correctly. - build/common.mk: vars, cp/mkdir/ln/ssh macros, patch-db client, external cargo tools - shared/crates/start-core/build.mk: test-core, ts-bindings - shared/web/build.mk: angular workspace (install, .angular, i18n, UI builds, compress, config.json) - start-sdk/build.mk: test-sdk, dist bundle (consumes the now-decoupled SDK Makefile) - start-{cli,registry,tunnel}/build.mk: their bins + install/deb - start-os/build.mk: startbox/start-container/backup-fs, container-runtime image, OS image assembly + deploy - docs/build.mk: docs site build Verified: make all is a no-op (full build intact); all targets resolve; no duplicate recipes. * docs(root): note the per-project build.mk Makefile structure in AGENTS.md * fix(ci): repoint test/web paths after workspace moves - run-tests.sh: cd to repo root (was shared/crates), build via ./Cargo.toml -p start-core (was ./core/Cargo.toml --workspace) - test.yaml / deploy-brochure: install the Angular workspace at the repo root (npm ci) instead of shared/web; fix vendor/vendor/patch-db doubling; brochure path filters -> root - startos-iso prevent-rebuild placeholders: node_modules/.angular at root; version read from root package.json Verified: npm ci passes at root (lockfile gate). * build(start-os): namespace OS-product make targets as startos-* / install-startos The repo is no longer start-os-only, so the generic target names now read as start-os-specific: - deb->startos-deb, iso/img->startos-$(IMAGE_TYPE), squashfs->startos-squashfs - install->install-startos (matches install-registry/install-tunnel) - wormhole*/update*/emulate-reflash/upload-ota -> startos-* - new 'startos' aggregate (= STARTOS_TARGETS); root 'all: startos' Callers updated: dpkg-build.sh INSTALL_TARGET, deploy targets' $(MAKE) install, startos-iso.yaml (make startos-iso/startos-img), root .PHONY. NOTE: external shared-workflows may invoke the old names (make iso/squashfs/install) for OS image/release builds — needs a companion update there. * build(start-os): move OS-specific build assets into start-os/build Relocate the start-os-only build inputs out of the shared top-level build/ into the product dir: image-recipe/, dpkg-deps/, lib/, download-firmware.sh, and save-migration-images.sh -> start-os/build/. Keep genuinely shared pieces at build/ (common.mk, env/, os-compat/, build-cargo-dep.sh, and lib/scripts/forward-port, which start-tunnel also installs). Relocate the start-os-specific make variables/rules out of build/common.mk into start-os/build.mk (web src/output vars -> shared/web/build.mk; registry and tunnel target vars -> their own fragments) so common.mk is shared-only. Repoint every reference (fragments, Makefile clean, container-runtime update-image.sh, and the moved scripts' own internal paths). Delete the unreferenced legacy build/registry/ eos deploy scripts. * docs(changelog): write 0.4.0-beta.10 per-product release notes Fill in the [0.4.0-beta.10] sections across the per-product CHANGELOGs (brochure, start-cli, start-os, start-registry, start-sdk, start-tunnel) with Added/Changed/Fixed/Removed/Security notes for this cycle, cross-linked between products. * refactor(start-core): rename lib startos to start_core, drop package alias Rename the start-core library from `startos` to `start_core` so the crate's lib name matches its package and the legacy `startos = { package = "start-core" }` dependency-rename alias is gone. The name now penetrates all source: - [lib] name = "start_core"; every `startos::` crate path -> `start_core::` - product crates depend on `start-core` directly; features become `start-core/*` - RUST_LOG=warn,startos=debug -> start_core=debug in the systemd units and CI (the target is module_path!()-derived, so it tracks the crate name) - docs updated to match The product identifier "startos" is left untouched (the root:startos system user/group, the tor.startos / *.startos DNS names, the nftables table, the signature context, the .startos/ packaging-workspace dir, i18n keys, and the /usr/lib/startos install paths). * refactor(monorepo): nest products under projects/, rename shared -> shared-libs Move the buildable products and the docs site into a top-level projects/ dir to separate them from repo infrastructure: start-os, start-cli, start-registry, start-tunnel, start-sdk, brochure (-> brochure-marketplace), docs (-> start-docs) -> projects/ Rename the shared Rust+web library container shared/ -> shared-libs/, kept at the top level alongside build/ and vendor/ as cross-cutting infrastructure. Rewire every path reference to the new layout: - Cargo workspace members + product path deps (../shared -> ../../shared-libs) - Makefile, build/common.mk, and every <project>/build.mk fragment - angular.json, package.json, root + per-app tsconfig (web app configs moved a level deeper, so their relative extends/paths gain one ../) - .github/workflows (the Start9Labs/start-os repo URL is preserved; docs-deploy working-directory + path triggers updated) - build scripts (run-local-build.sh / update-image-local.sh cd depths and internal paths; start-core build/*.sh chown paths) - root .gitignore build-output globs and the web package-lock file: paths Verified: cargo check of all six crates (UI-embed include_dir! and build/env include_str! resolve to the new locations), make -n of the OS / registry / tunnel / web targets. The cold web/SDK build remains CI-grade. * refactor(monorepo): relocate project-specific assets/debian/scripts into projects Apply the same shared-vs-project split to the remaining top-level dirs: - assets/ (create-vm screenshots) -> projects/start-os/assets/ - debian/{startos,start-registry,start-tunnel}/postinst -> each project's debian/; the shared debian/dpkg-build.sh stays top-level and now maps PROJECT -> projects/<dir>/debian for the control files - scripts/copy-categories.sh (registry admin) -> projects/start-registry/scripts/ Kept at top level as genuinely shared/repo-level: debian/dpkg-build.sh, scripts/manage-release.sh (repo releases), scripts/publish-deb.sh (apt publish). Repoint the deb build.mk prereqs, the CONTRIBUTING create-vm link, and code/unit comments. Verified make -n of the three *-deb targets. * docs(rfcs): move draft-start9-pcp-hostname to a top-level rfcs/ dir The PCP HOSTNAME extension Internet-Draft (.md + .txt) describes a protocol spoken by both the StartOS client and the StartTunnel server, so it belongs at the repo level rather than inside start-tunnel/. Repoint the start-os CHANGELOG reference (was the stale docs/ path) to rfcs/. * docs: sync structure docs to the projects/ layout + README project shout-outs - README: add a "rest of the monorepo" section with a short shout-out to each non-OS product (StartTunnel, start-cli, Start SDK, start-registry, and the marketplace + docs sites), and update the directory table + icon path to the projects/ + shared-libs layout. - Root AGENTS.md: rewrite "what lives where" for the new layout and complete the Sub-scopes list (it was missing most products). - Root ARCHITECTURE.md: repoint the module map + cross-layer paths; MONOREPO.md gains a note that the layout was refined (products -> projects/, shared -> shared-libs). - Per-project docs: rename shared/ -> shared-libs/ references, fix relative links whose depth changed when products moved a level deeper into projects/ (links to the repo root, LICENSE, shared-libs, and cross-product changelogs), and repoint functional cd / --prefix build commands. Sibling refs under projects/ (e.g. ../start-sdk, file:../../start-sdk/dist) are correct and left as-is. * build(brochure-marketplace): rename Angular project brochure -> brochure-marketplace Rename the Angular project key (and its build/serve targets) so the project name matches its directory. The dist output is now projects/brochure-marketplace/dist/raw/brochure-marketplace, and the deploy workflow reads/rsyncs that path — this also corrects a path the projects/ restructure had mangled to raw/projects/brochure-marketplace. The npm script names (build:brochure / start:brochure) are kept as conveniences. * docs: remove MONOREPO.md The reorganization proposal has been fully implemented and superseded by the current README/ARCHITECTURE; drop the historical proposal doc and its two links. * feat(build): per-project versioning + Debian packaging for start-cli Decouple product versions from the single StartOS release version. Each Rust product's version is now the source of truth in its own Cargo.toml: start-os stays 0.4.0-beta.10; start-cli / start-registry / start-tunnel move to their own line starting at 1.0.0. - basename.sh and dpkg-build.sh read the version straight from the project's Cargo.toml (per PROJECT), so each .deb is named/versioned independently. - check-version.sh now derives the OS-image /usr/lib/startos/VERSION.txt from the start-os crate manifest instead of the root package.json; nothing maintains a separate version source anymore. - start-cli gains a Debian package: `make cli-deb` builds the musl binary and packages it via the shared dpkg-build.sh (CLI_BASENAME / install-cli staging). CHANGELOGs and the registry AGENTS version note updated to reflect independent versioning. Cargo.lock synced to the new member versions. * chore: ignore *.local.md Broaden the local-notes ignore from CLAUDE.local.md to any *.local.md. * refactor(deps): vendor Start9-maintained crates into shared-libs/crates Move every Start9-maintained crate the workspace depends on in-repo, wired by direct path deps (no [patch]): - rpc-toolkit, imbl-value, exver, yasi, jsonpath (jsonpath_lib), pi-beep — plain-copied from their repos into shared-libs/crates/, added as workspace members. Their inter-deps are repointed to path (exver/imbl-value -> yasi, rpc-toolkit/jsonpath -> imbl-value), and start-core depends on them by path. - patch-db — de-submoduled: moved out of the vendor/ git submodule into shared-libs/crates/patch-db (keeps its own [workspace], excluded from the root one and consumed by start-core via path). Its core/json-patch/json-ptr now path-dep the vendored imbl-value, so there is a single imbl_value::Value type. Drop .gitmodules; repoint the web patch-db-client (package.json / common.mk / CI / shared-libs/web) and pi-beep's build (build-cargo-dep.sh --path). Upstream forks still pulled by git (async-acme, crab_nat, fuser) are left as-is. Verified: cargo check of start-core + start-cli + start-registry + pi-beep compiles the whole path-dep tree clean; Cargo.lock regenerated. * refactor(start-os): move manage-release.sh into the product manage-release.sh is the StartOS release orchestration (startos-images S3 bucket/CDN, the OS image arch matrix incl. -nonfree/-nvidia, the OS registry), not a repo-wide tool — move it to projects/start-os/scripts/. It still calls the shared scripts/publish-deb.sh (which stays top-level, since it publishes any product's .deb), now referenced by its repo-root-relative path. * refactor(debian): rename dpkg-build.sh -> build.sh, move publish-deb.sh -> debian/publish.sh Co-locate the deb tooling under debian/: the package builder is debian/build.sh and the apt-repo publisher is debian/publish.sh (was scripts/publish-deb.sh, which empties scripts/). Repoint the per-product deb build.mk targets, the manage-release.sh caller, and doc/comment references. * build: build pi-beep as a first-party member; reword "vendored" -> "first-party" pi-beep is one of our crates now, so build it like startos-backup-fs (a dedicated build-pi-beep.sh zig build of the workspace member) instead of routing it through build-cargo-dep.sh. That script is now only for the genuinely external crates.io dev tools (tokio-console, flamegraph) bundled into unstable/console images. Also reword the patch-db docs: these are our own crates, so "first-party crate" is more accurate than "vendored" (which implies a third-party copy). * ci: path-gate the per-product build workflows to their project + deps The start-cli / start-registry / start-tunnel / startos-iso build workflows ran on every push/PR (only skipping doc-only changes), so all four built regardless of what changed. Replace the blanket paths-ignore with a paths: allowlist scoped to each product plus its dependencies (start-core + the in-repo shared-libs crates, Cargo manifests, build infra, and — for the web-bearing/OS workflows — the Angular workspace and SDK). workflow_dispatch / workflow_call are kept so manual and orchestrated runs still fire unconditionally. * ci: migrate shared-workflows (service-package CI) into the monorepo Bring the reusable .s9pk build/release workflows and their composite actions in-repo from the standalone Start9Labs/shared-workflows repo, so the packaging toolchain lives alongside the SDK: - .github/workflows/{build,release,tagAndRelease}.yml (reusable, workflow_call) - .github/actions/{extract-version,free-disk-space,setup-build-env, setup-publish-env,upload-each} Their internal references (and the SDK package-template's three workflows + the packaging docs) are repointed from start9labs/shared-workflows@master to Start9Labs/start-os@master. These are workflow_call-only, so they don't run for the monorepo itself — they activate once this lands on master and external service-package repos repoint their `uses:` to Start9Labs/start-os. * docs(monorepo): document tandem-update couplings The per-product CI `paths:` filters mirror each product's build.mk prerequisites by hand — nothing enforces it. Add a "Coupled changes" section to the root AGENTS.md and reciprocal pointers in each gated workflow and its build.mk, so a change to one half is caught at the other. Also catalogs the remaining hand-mirrored pairs (reusable service-package CI <-> SDK package-template <-> packaging docs; the files touched when adding a product/crate) and the already-enforced couplings (ts-bindings, the five i18n locales, the UI beta seed, version <-> CHANGELOG, docs <-> user-facing changes). * chore(manpages): generate man pages into their product projects The export_manpage_* tests in start-core wrote every product's man pages into start-core's own man/ dir. Point each generator at the owning product's man/ dir (anchored to CARGO_MANIFEST_DIR), move the committed pages there, and update build-manpage.sh's chown and the docs. start-container's pages go to projects/start-os, since that bin is part of the StartOS product. * Retitle README * refactor(shared-libs): rename web -> ts-modules Mirror the `crates/` naming: the shared TS/Angular workspace dir becomes `shared-libs/ts-modules/`. Pure path rename — repoints every reference (angular.json, root tsconfig/package.json scripts, the Makefile include + build.mk, CI `paths:`, and docs). No code changes. * fix(monorepo): repoint stale paths from the projects/ move that broke CI Two classes of path left stale by nesting products under projects/: - Web apps `require()` repo-root config.json/package.json by relative path; the extra projects/ level meant every one was short one `../` (resolved to projects/… instead of the repo root), failing the esbuild UI build for start-os (ui + setup-wizard) and start-tunnel. - test.yaml and deploy-brochure.yml still `cd start-sdk` for the baseDist build; the SDK now lives at projects/start-sdk. * fix(debian): resolve PROJECT_DIR before reading VERSION debian/build.sh computed VERSION from "projects/$PROJECT_DIR/Cargo.toml" before PROJECT_DIR was assigned, so it read projects//Cargo.toml (empty) and double-prefixed projects/. The empty Version: produced an invalid DEBIAN/control and dpkg-deb rejected it — breaking the registry and tunnel .deb builds. start-cli's CI only runs `make cli` (the binary), so it never exercised this path. Hoist the PROJECT_DIR/INSTALL_TARGET block above VERSION and read "${PROJECT_DIR}/Cargo.toml" directly. Also only fall back to the OS product's usr/lib/startos/conflicts when that file actually exists, so non-OS products don't error on a missing conflicts file. * fix(web): prettier-wrap tsconfig paths widened by the ts-modules rename Renaming shared-libs/web -> shared-libs/ts-modules pushed the `@start9labs/*` path-mapping lines past prettier's print width, so `npm run format:check` (the Formatting & Lockfiles CI job) flagged the four product tsconfig.json files. Apply prettier's wrapping. * docs(contributing): align with restructure + renamed make recipes Bring the CONTRIBUTING set up to date with the monorepo layout and the namespaced make targets: - root: `make iso` -> `make startos` - start-os: `make $(IMAGE_TYPE)`/`deb`/`squashfs` -> `make startos-$(IMAGE_TYPE)`/`startos-deb`/`startos-squashfs`; deploy/flash targets -> `startos-update*`/`startos-wormhole*`/`startos-emulate-reflash` - start-core: `cd start-sdk` -> `cd projects/start-sdk`; osBindings sync path -> projects/start-sdk/base/lib/osBindings - shared-libs: `web/` -> `ts-modules/` (heading, lib paths, file: deps, cross-links) The other products' CONTRIBUTING files were already correct. * fix(container-runtime): correct repo-root target path in update-image.sh update-image.sh runs with cwd at projects/start-os/container-runtime/ (mounted at /root/start-os in start9/build-env), so the repo-root build output is three levels up. It copied start-container from ../../target (-> projects/target, nonexistent), so the container-runtime squashfs was never built and the OS image compile failed on every arch. Use ../../../target. Refresh the AGENTS.md gotcha that described the old stale path. * refactor(make): namespace OS web targets, require an explicit target, per-project cleans - `ui`/`uis` -> `startos-ui`/`startos-uis`: they build only the StartOS admin UI + setup-wizard, so they belong under the startos-* namespace. Also fix `startos-ui` to depend on the built index.html (the old `ui` depended on a directory with no rule). - No default build: bare `make` now prints `help` (.DEFAULT_GOAL := help) and the misleading `all` target (it only built `startos`, not "everything") is removed — callers specify a target. - Decentralize `clean`: every build.mk owns a `clean-<project>` target and the root `clean` just aggregates them. Per-project cleans use project-prefix wildcards so they're arch/version-independent, and two stale paths from the projects/ move are corrected (env/*.txt -> build/env/*.txt; image-recipe/deb -> projects/start-os/build/image-recipe/deb). - Drop the start-cli targets (`make cli`/`cli-deb`) from the start-os CONTRIBUTING build section (wrong product) and update the docs to the new target names (root + start-os CONTRIBUTING/README/AGENTS). * docs: sync, complete, and standardize all developer docs for the monorepo (#3356) * docs: sync developer docs with the monorepo restructure Audit of all developer documentation (AGENTS/CONTRIBUTING/ARCHITECTURE/README across root, projects/*, shared-libs/*) against the post-restructure tree. Corrects stale references the restructure left behind: - Paths still pointing at the pre-restructure layout (core/, web/, sdk/, brochure/, container-runtime/, patch-db submodule) -> projects/* and shared-libs/*. - Angular workspace root: several docs claimed shared-libs/ts-modules holds angular.json/package.json/tsconfig.json and that npm runs from there. The workspace is rooted at the repo root; fixed cwd/--prefix instructions, the tsconfig path-alias targets, and config-sample.json location accordingly. - Renamed make targets (startos-* namespace), the Rust lib rename (startos -> start_core / crate start-core), and the binary-source table in start-core/ARCHITECTURE.md. - Removed stale 'git clone --recursive' (no submodules remain) and the non-existent repo-level scripts/ reference. - Normalized product self-references and the brochure -> brochure-marketplace Angular project name; verified incidental accuracy fixes (exver 0.2.1, patch-db serde_cbor, image-recipe live-build). All relative doc links verified resolvable. Pre-commit lint-staged hook skipped (--no-verify): the slot has no installed node_modules so the binary can't run, and the repo's prettier targets only the web source dirs, not these markdown docs. * docs: bring utility crates and patch-db up to the standard doc set Every first-party crate under shared-libs/crates/ now carries the same AGENTS/ARCHITECTURE/CONTRIBUTING/README/CLAUDE set the projects and other shared libs use. - New full doc sets for exver, imbl-value, jsonpath, pi-beep, rpc-toolkit, yasi, written from each crate's actual source (verified module names, public API, cargo -p <package> commands, and real consumers; jsonpath's package is jsonpath_lib though its dir is jsonpath). Pre-existing READMEs (exver, jsonpath, yasi) were preserved verbatim and only augmented with a 'Place in the monorepo' + 'Documentation' section. - patch-db: added AGENTS.md (migrated from its content-bearing CLAUDE.md, plus a Build & test section noting it is its own Cargo workspace) and reduced CLAUDE.md to the one-line @AGENTS.md import like every other scope. - Every CLAUDE.md is exactly '@AGENTS.md'; all relative doc links resolve. * docs: normalize section structure across all project & shared-lib docs Standardize every first-class scope (root, the 7 projects, container-runtime, shared-libs, start-core, ts-modules) onto one canonical section template so the same sections appear under the same names in the same order everywhere: - AGENTS.md: intro (+ 'CLAUDE.md is a one-line @AGENTS.md import' + cross-links) → Layout → Build & test (run from the repo root) → Gotchas → scope-specific. Folded synonym headings (Where things are / What lives where / Map → Layout; Operating rules / Gotchas / rules → Gotchas; Build / Build & verify → Build & test). - CONTRIBUTING.md: Documentation (doc-map, added where missing) → Prerequisites → Building → Testing → Formatting → scope-specific → Commits / PRs (last). - ARCHITECTURE.md: ensured a 'Place in the monorepo' opener (where applicable) and a 'Further reading' links footer; internal sections left in place. - README.md: added a Documentation/links footer where missing; landing prose left untouched. Pure reorganization: headings renamed/reordered and short missing sections added — no prose reworded, no facts/commands/tables dropped. Scope-accurate build cwds preserved (start-docs builds from its dir; start-sdk from its dir; container-runtime via npm --prefix; patch-db its own workspace). All 102 docs' relative links verified resolvable; every CLAUDE.md remains the one-line import. * build+docs: merge patch-db into root workspace; enforce doc hierarchy Addresses review feedback on the docs PR: - **patch-db → root Cargo workspace.** Add the six patch-db crates (core, json-patch, json-ptr, macro, macro-internals, util) to the root workspace `members` and drop the `exclude`; remove patch-db's now-redundant virtual `Cargo.toml`. `cargo metadata` + `cargo check -p patch-db -p json-patch -p json-ptr -p patch-db-macro` pass. Updated the docs that called patch-db 'its own workspace' (patch-db AGENTS/CONTRIBUTING build commands now run from the repo root with `-p`; root ARCHITECTURE lists it as a member). - **Root AGENTS.md:** added a note that these doc files must be kept current with every change, and that the docs are hierarchical — a scope documents only what is specific to it and never repeats higher-scope content. - **Hierarchy cleanup:** removed the `## Commits / PRs` (and `Branch / commit / PR` / `Commit conventions`) sections from every non-root CONTRIBUTING.md — those conventions live only in the root CONTRIBUTING.md now. Scope-specific change steps were preserved (e.g. start-tunnel's migration/ bindings/CHANGELOG steps moved to a 'Making a change' section; start-cli's docs-update note folded into 'Where code lives'). Also dropped the duplicated 'keep these docs in sync' line from child Documentation sections (kept the local cross-link lists). - **jsonpath:** reframed the fork note as history-only across its docs — it has fully diverged from freestrings/jsonpath with no intent to upstream; treat it as first-party and edit freely (removed the 'pull fixes from upstream / keep changes minimal / fork-tracking' guidance). All 102 docs' relative links resolve; every CLAUDE.md remains the one-line import. * docs: add hierarchy-navigation notes to AGENTS files - Every non-root AGENTS.md now opens with a 'Read up the tree first' note: the docs are hierarchical, so before working in a scope read the AGENTS.md of each enclosing directory up to the repo root (and their ARCHITECTURE/CONTRIBUTING where relevant). Excludes the packaging-guide + package-template AGENTS under projects/start-sdk/docs/, which target external package authors, not the monorepo dir tree. - Root AGENTS.md gains the converse 'Read down into what you touch' note: read a subdirectory's AGENTS.md (and any further nested ones) before editing it. - Dropped the explicit repo-root CONTRIBUTING pointer from patch-db's CONTRIBUTING.md (the walk-up convention now covers it). * docs(agents): require product docs/ book + CHANGELOG to ship with code Root AGENTS.md now mandates that any change altering user-visible behavior update that product's user-facing docs/ book (projects/<product>/docs/) in the same change and add a CHANGELOG.md entry — no deferring docs/changelog to follow-ups. * build(make): add per-project format targets mirroring the clean decomposition Each build.mk now owns `format-<project>` + `format-check-<project>` (core, web, sdk, cli, registry, tunnel, startos), matching the per-project `clean-<project>` targets; the top-level `format`/`format-check` just aggregate them. Web (the whole Angular workspace incl. brochure) formats via the root npm script; the shared crates via one `cargo +nightly fmt`; container-runtime via its own prettier config (new `format`/`format:check` npm scripts). So you can format one project (`make format-cli`) or all (`make format`). * docs: address PR review — make-target refs, ARCH de-dup, ts-modules wording - Reference stable make targets instead of raw build/format commands across project docs: builds via `make cli`/`registry`/`tunnel`/`startos`/`startos-ui`, formatting via the per-project `make format-<project>` targets (and `format-check-<project>` for CI). Kept `cargo check`/`cargo test` and crate `cargo build` (no make equivalent) as noted dev shortcuts. - Fixed stale targets: dropped `all` (removed upstream; `make` now prints help), `ui`/`uis` -> `startos-ui`/`startos-uis`. - Removed the whole-monorepo ASCII trees that several product ARCHITECTURE.md files re-drew (start-cli, start-registry, container-runtime, ...) — that layout lives once in the root ARCHITECTURE.md; each now states only where it sits. - Reworded the `shared-libs/ts-modules` directory as shared TypeScript modules (not Angular-specific; current contents are the Angular libs shared/marketplace), per review; kept accurate per-library 'Angular library' phrasing. Branch merged up to date with docs/monorepo-proposal first. * refactor(sdk): extract base into @start9labs/start-core shared lib; flatten start-sdk Move projects/start-sdk/base -> shared-libs/ts-modules/start-core (package @start9labs/start-sdk-base -> @start9labs/start-core), mirroring the Rust crate shared-libs/crates/start-core. start-core builds its own self-contained dist consumed via file: deps. Flatten start-sdk (package/ -> root): the SDK now imports @start9labs/start-core instead of ../../base/lib, and its published dist bundles start-core (bundleDependencies) so external authors still install one package. Repoint all consumers off the SDK-as-base alias onto @start9labs/start-core: - web (root file: dep + 153 import sites + shared/marketplace peerDeps) - container-runtime (file: dep; base/lib imports -> start-core, package/lib -> lib) Repoint osBindings generation, the build DAG (build.mk fragments, Makefile), and regenerate the three lockfiles. Resolves the "SDK kept cohesive" deviation: base is now an honest first-class shared TS lib named for what it is. * docs+ci: reflect start-core extraction; repoint SDK build steps off base/baseDist CI: build start-core (cd shared-libs/ts-modules/start-core && make dist) before validating the SDK + web lockfiles; validate the flattened SDK lockfile at projects/start-sdk; add start-core to the prettier check; repoint the iso prevent-rebuild mkdirs and the brochure deploy paths: filter (start-sdk -> start-core). Docs: update every project's AGENTS/ARCHITECTURE/CONTRIBUTING/README for the new layout — base extracted to @start9labs/start-core under shared-libs/ts-modules, the SDK flattened (lib/) and bundling start-core, container-runtime depending on both. Removes the resolved "SDK kept cohesive" deviation note. * refactor(monorepo): use the start-technologies name; repoint init-workspace at the monorepo - Adopt start-technologies for monorepo/repo-URL references across docs and AGENTS files (ahead of the GitHub repo rename; product refs left as start-os: projects/start-os, the start-os crate, *-startos packages, StartOS). - s9pk init-workspace now sparse-clones the start-technologies monorepo (projects/start-sdk/docs) instead of the retired standalone start-docs repo, and the two start-docs-named init strings are reworded across all five locales. - Un-hide the SDK 2.0 packaging-workspace section and rewrite it for the monorepo clone; document fetch-on-demand SDK + OS source access (docs first) in the workspace AGENTS.md and workflow.md. - Fix build-config.js to read and write the repo-root config.json. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkwYSXK8Uh9D16UTffCNJ1 --------- Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: Matt Hill <9935159+MattDHill@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> | 2 个月前 | |
refactor: reorganize start-os into all-products monorepo (#3352) * docs: propose monorepo reorganization for all Start9 products * refactor(monorepo): split core into start-core lib + thin product bin crates - core/ -> shared/crates/start-core (lib 'startos', package 'start-core') - entry points moved to product dirs: start-os (startbox+start-container), start-cli, start-registry, start-tunnel - root Cargo workspace + shared Cargo.lock; profiles hoisted to root - patch-db submodule relocated to vendor/patch-db - service files moved to their product dirs - fixed include_dir!/include_str! paths for new crate locations cargo check -p start-cli -p start-registry passes (lib compiles). * refactor(monorepo): split web into product dirs + shared/web; relocate sdk & container-runtime - angular workspace rooted at shared/web (holds shared + marketplace libs + config) - apps moved to product dirs: start-os/web/{ui,setup-wizard}, start-tunnel/web, brochure/ - angular.json roots/outputs + per-app tsconfig paths repointed (Plan A) - sdk -> start-sdk (base+package kept cohesive: package imports base via relative paths under shared rootDir; splitting base out would break those imports) - container-runtime -> start-os/container-runtime - file: deps repointed (sdk baseDist/dist, patch-db client under vendor/) * build(monorepo): rewire Makefile, build scripts & CI to new layout - build scripts target workspace (-p <crate>, ./Cargo.toml, repo-root cwd) - Makefile paths: core->shared/crates/start-core, web split across product dirs, sdk->start-sdk, container-runtime->start-os/container-runtime, patch-db->vendor - compress-uis.sh takes per-product web dir; split compress pattern rules - ts-bindings recipe sed patterns generalized for new bindings path - CI workflows repointed (deploy-brochure, start-cli, test, startos-iso, ...) * chore(monorepo): gitignore per-product web dist outputs * docs(monorepo): update proposal to reflect implemented layout + verification status * refactor(monorepo): relocate root docs/ internal notes into their projects - exver.md, VERSION_BUMP.md -> shared/crates/start-core/ - PHYSICAL_DEVICE_TEST_PLAN.md, TODO.md -> start-os/ - draft-start9-pcp-hostname.* -> start-tunnel/ frees top-level docs/ for the migrated docs site * docs(monorepo): migrate start-docs (plain copy, no history) - mdbooks into product dirs: start-os/docs, start-tunnel/docs, start-sdk/docs (packaging) - bitcoin-guides, landing, build infra (build.sh/serve.sh/theme/versions.conf/scripts) -> top-level docs/ - repoint book theme symlinks to ../../docs/theme; book.toml build-dir=book, repo/edit URLs -> monorepo - build.sh maps book names to relocated dirs (absolute output); deploy.yml runs in docs/ with paths filter - verified: docs/build.sh builds all 4 books * docs(monorepo): adopt AGENTS.md convention (CLAUDE.md -> @AGENTS.md import) * docs(root): rewrite README/ARCHITECTURE/AGENTS/CONTRIBUTING for monorepo layout * docs(start-os): add product README/ARCHITECTURE/AGENTS/CHANGELOG/CONTRIBUTING Document the StartOS OS product as a thin wrapper in the monorepo: startbox/ start-container bins, web UIs (ui + setup-wizard), container-runtime, systemd units, and OS image packaging. Reflect new paths (start-core, shared/web, start-sdk, vendor/patch-db) and root-workspace build commands. * docs: integrate merged start-docs PRs (#93 UPnP/gateway, #94 task accept/set, #96 init progress) Only PRs whose feature is confirmed merged into start-os were applied. #99 (upstreamCertValidation) skipped — its code PR (#3353) is still open. * docs: add/normalize per-project doc sets (README/ARCHITECTURE/AGENTS/[CHANGELOG]/CONTRIBUTING) Products get the full set incl CHANGELOG; shared components + docs site get the set minus CHANGELOG; all updated to reflect the monorepo layout and AGENTS.md convention. * docs: add CLAUDE.md -> @AGENTS.md import to remaining project dirs * build(monorepo): root the Angular workspace at repo root so apps resolve node_modules Angular resolves @angular/core per-project from each app's root; with apps in product dirs, shared/web/node_modules was unreachable. Move the workspace config (angular.json, package.json, lockfile, tsconfig{,.lib}.json, .browserslistrc) to the repo root — the only ancestor of every app — so resolution works. - angular.json: project roots -> product dirs, lib roots -> shared/web/{shared,marketplace} - tsconfig paths/extends repointed; app source config.json/package.json require() depths corrected for the new app locations - package.json file: deps + script paths rebased to root; check-i18n.mjs scans the scattered project dirs; update-config.sh writes config.json at the workspace root - Makefile web targets run npm at root; build/env + build-cargo-dep stale paths fixed - build-cli.sh: drop stale 'cd core' in chown step Verified: full build succeeds — ts-bindings, SDK bundle, all 4 Angular UIs, and all five musl bins (startbox/registrybox/tunnelbox/start-container/start-cli). * build(monorepo): fix full-image build paths (container-runtime squashfs + version) - Makefile: undouble container-runtime.service dep path in rootfs rule - check-version.sh: read version from root package.json (moved from web/) - update-image-local.sh: mount repo root so start-sdk + target/ are visible to the image build; run start-os/container-runtime/update-image.sh - update-image.sh: copy start-container from ../../target (workspace), not ../core/target Verified: 'make all' completes (exit 0) — all musl bins + container-runtime rootfs.squashfs (437M) build; second run is a no-op (fully built). * build(monorepo): sync container-runtime package-lock to relocated SDK path; prettier ARCHITECTURE table * feat(monorepo): migrate startos-backup-fs into start-os/backup-fs Vendor the backup-fs crate (was external git dep Start9Labs/start-fs) as a workspace member under the start-os product; build it via the zigbuild path like the other bins instead of 'cargo install --git'. - start-os/backup-fs/: the startos-backup-fs crate (encrypted erasure-coded FUSE backup filesystem); relaxed its =4.5.7 clap / =0.2.17 ppv-lite86 exact pins so they unify with the workspace - root Cargo workspace member + single lock - shared/crates/start-core/build/build-backup-fs.sh; Makefile target builds the local crate (no more git URL) - docs: start-os ARCHITECTURE + CHANGELOG note the migration Verified: 'make all' (exit 0) builds startos-backup-fs (musl) as a member. * build(sdk): decouple 'bundle' from test/check-fmt so consumers don't re-run jest bundle now builds baseDist+dist only; test/check-fmt are standalone (CI calls them directly), and publish runs them explicitly. Fixes the recursive-make coupling where the OS build re-ran the full SDK jest suite every build and an SDK test/format failure broke the OS build. * build(monorepo): split Makefile into per-project include fragments Thin root Makefile includes build/common.mk (shared vars/macros + cross-cutting infra) and one <project>/build.mk per product. Uses include (not recursive make) so it stays a single DAG and cross-project prereqs (start-core -> ts-bindings -> SDK -> web/container-runtime) resolve correctly. - build/common.mk: vars, cp/mkdir/ln/ssh macros, patch-db client, external cargo tools - shared/crates/start-core/build.mk: test-core, ts-bindings - shared/web/build.mk: angular workspace (install, .angular, i18n, UI builds, compress, config.json) - start-sdk/build.mk: test-sdk, dist bundle (consumes the now-decoupled SDK Makefile) - start-{cli,registry,tunnel}/build.mk: their bins + install/deb - start-os/build.mk: startbox/start-container/backup-fs, container-runtime image, OS image assembly + deploy - docs/build.mk: docs site build Verified: make all is a no-op (full build intact); all targets resolve; no duplicate recipes. * docs(root): note the per-project build.mk Makefile structure in AGENTS.md * fix(ci): repoint test/web paths after workspace moves - run-tests.sh: cd to repo root (was shared/crates), build via ./Cargo.toml -p start-core (was ./core/Cargo.toml --workspace) - test.yaml / deploy-brochure: install the Angular workspace at the repo root (npm ci) instead of shared/web; fix vendor/vendor/patch-db doubling; brochure path filters -> root - startos-iso prevent-rebuild placeholders: node_modules/.angular at root; version read from root package.json Verified: npm ci passes at root (lockfile gate). * build(start-os): namespace OS-product make targets as startos-* / install-startos The repo is no longer start-os-only, so the generic target names now read as start-os-specific: - deb->startos-deb, iso/img->startos-$(IMAGE_TYPE), squashfs->startos-squashfs - install->install-startos (matches install-registry/install-tunnel) - wormhole*/update*/emulate-reflash/upload-ota -> startos-* - new 'startos' aggregate (= STARTOS_TARGETS); root 'all: startos' Callers updated: dpkg-build.sh INSTALL_TARGET, deploy targets' $(MAKE) install, startos-iso.yaml (make startos-iso/startos-img), root .PHONY. NOTE: external shared-workflows may invoke the old names (make iso/squashfs/install) for OS image/release builds — needs a companion update there. * build(start-os): move OS-specific build assets into start-os/build Relocate the start-os-only build inputs out of the shared top-level build/ into the product dir: image-recipe/, dpkg-deps/, lib/, download-firmware.sh, and save-migration-images.sh -> start-os/build/. Keep genuinely shared pieces at build/ (common.mk, env/, os-compat/, build-cargo-dep.sh, and lib/scripts/forward-port, which start-tunnel also installs). Relocate the start-os-specific make variables/rules out of build/common.mk into start-os/build.mk (web src/output vars -> shared/web/build.mk; registry and tunnel target vars -> their own fragments) so common.mk is shared-only. Repoint every reference (fragments, Makefile clean, container-runtime update-image.sh, and the moved scripts' own internal paths). Delete the unreferenced legacy build/registry/ eos deploy scripts. * docs(changelog): write 0.4.0-beta.10 per-product release notes Fill in the [0.4.0-beta.10] sections across the per-product CHANGELOGs (brochure, start-cli, start-os, start-registry, start-sdk, start-tunnel) with Added/Changed/Fixed/Removed/Security notes for this cycle, cross-linked between products. * refactor(start-core): rename lib startos to start_core, drop package alias Rename the start-core library from `startos` to `start_core` so the crate's lib name matches its package and the legacy `startos = { package = "start-core" }` dependency-rename alias is gone. The name now penetrates all source: - [lib] name = "start_core"; every `startos::` crate path -> `start_core::` - product crates depend on `start-core` directly; features become `start-core/*` - RUST_LOG=warn,startos=debug -> start_core=debug in the systemd units and CI (the target is module_path!()-derived, so it tracks the crate name) - docs updated to match The product identifier "startos" is left untouched (the root:startos system user/group, the tor.startos / *.startos DNS names, the nftables table, the signature context, the .startos/ packaging-workspace dir, i18n keys, and the /usr/lib/startos install paths). * refactor(monorepo): nest products under projects/, rename shared -> shared-libs Move the buildable products and the docs site into a top-level projects/ dir to separate them from repo infrastructure: start-os, start-cli, start-registry, start-tunnel, start-sdk, brochure (-> brochure-marketplace), docs (-> start-docs) -> projects/ Rename the shared Rust+web library container shared/ -> shared-libs/, kept at the top level alongside build/ and vendor/ as cross-cutting infrastructure. Rewire every path reference to the new layout: - Cargo workspace members + product path deps (../shared -> ../../shared-libs) - Makefile, build/common.mk, and every <project>/build.mk fragment - angular.json, package.json, root + per-app tsconfig (web app configs moved a level deeper, so their relative extends/paths gain one ../) - .github/workflows (the Start9Labs/start-os repo URL is preserved; docs-deploy working-directory + path triggers updated) - build scripts (run-local-build.sh / update-image-local.sh cd depths and internal paths; start-core build/*.sh chown paths) - root .gitignore build-output globs and the web package-lock file: paths Verified: cargo check of all six crates (UI-embed include_dir! and build/env include_str! resolve to the new locations), make -n of the OS / registry / tunnel / web targets. The cold web/SDK build remains CI-grade. * refactor(monorepo): relocate project-specific assets/debian/scripts into projects Apply the same shared-vs-project split to the remaining top-level dirs: - assets/ (create-vm screenshots) -> projects/start-os/assets/ - debian/{startos,start-registry,start-tunnel}/postinst -> each project's debian/; the shared debian/dpkg-build.sh stays top-level and now maps PROJECT -> projects/<dir>/debian for the control files - scripts/copy-categories.sh (registry admin) -> projects/start-registry/scripts/ Kept at top level as genuinely shared/repo-level: debian/dpkg-build.sh, scripts/manage-release.sh (repo releases), scripts/publish-deb.sh (apt publish). Repoint the deb build.mk prereqs, the CONTRIBUTING create-vm link, and code/unit comments. Verified make -n of the three *-deb targets. * docs(rfcs): move draft-start9-pcp-hostname to a top-level rfcs/ dir The PCP HOSTNAME extension Internet-Draft (.md + .txt) describes a protocol spoken by both the StartOS client and the StartTunnel server, so it belongs at the repo level rather than inside start-tunnel/. Repoint the start-os CHANGELOG reference (was the stale docs/ path) to rfcs/. * docs: sync structure docs to the projects/ layout + README project shout-outs - README: add a "rest of the monorepo" section with a short shout-out to each non-OS product (StartTunnel, start-cli, Start SDK, start-registry, and the marketplace + docs sites), and update the directory table + icon path to the projects/ + shared-libs layout. - Root AGENTS.md: rewrite "what lives where" for the new layout and complete the Sub-scopes list (it was missing most products). - Root ARCHITECTURE.md: repoint the module map + cross-layer paths; MONOREPO.md gains a note that the layout was refined (products -> projects/, shared -> shared-libs). - Per-project docs: rename shared/ -> shared-libs/ references, fix relative links whose depth changed when products moved a level deeper into projects/ (links to the repo root, LICENSE, shared-libs, and cross-product changelogs), and repoint functional cd / --prefix build commands. Sibling refs under projects/ (e.g. ../start-sdk, file:../../start-sdk/dist) are correct and left as-is. * build(brochure-marketplace): rename Angular project brochure -> brochure-marketplace Rename the Angular project key (and its build/serve targets) so the project name matches its directory. The dist output is now projects/brochure-marketplace/dist/raw/brochure-marketplace, and the deploy workflow reads/rsyncs that path — this also corrects a path the projects/ restructure had mangled to raw/projects/brochure-marketplace. The npm script names (build:brochure / start:brochure) are kept as conveniences. * docs: remove MONOREPO.md The reorganization proposal has been fully implemented and superseded by the current README/ARCHITECTURE; drop the historical proposal doc and its two links. * feat(build): per-project versioning + Debian packaging for start-cli Decouple product versions from the single StartOS release version. Each Rust product's version is now the source of truth in its own Cargo.toml: start-os stays 0.4.0-beta.10; start-cli / start-registry / start-tunnel move to their own line starting at 1.0.0. - basename.sh and dpkg-build.sh read the version straight from the project's Cargo.toml (per PROJECT), so each .deb is named/versioned independently. - check-version.sh now derives the OS-image /usr/lib/startos/VERSION.txt from the start-os crate manifest instead of the root package.json; nothing maintains a separate version source anymore. - start-cli gains a Debian package: `make cli-deb` builds the musl binary and packages it via the shared dpkg-build.sh (CLI_BASENAME / install-cli staging). CHANGELOGs and the registry AGENTS version note updated to reflect independent versioning. Cargo.lock synced to the new member versions. * chore: ignore *.local.md Broaden the local-notes ignore from CLAUDE.local.md to any *.local.md. * refactor(deps): vendor Start9-maintained crates into shared-libs/crates Move every Start9-maintained crate the workspace depends on in-repo, wired by direct path deps (no [patch]): - rpc-toolkit, imbl-value, exver, yasi, jsonpath (jsonpath_lib), pi-beep — plain-copied from their repos into shared-libs/crates/, added as workspace members. Their inter-deps are repointed to path (exver/imbl-value -> yasi, rpc-toolkit/jsonpath -> imbl-value), and start-core depends on them by path. - patch-db — de-submoduled: moved out of the vendor/ git submodule into shared-libs/crates/patch-db (keeps its own [workspace], excluded from the root one and consumed by start-core via path). Its core/json-patch/json-ptr now path-dep the vendored imbl-value, so there is a single imbl_value::Value type. Drop .gitmodules; repoint the web patch-db-client (package.json / common.mk / CI / shared-libs/web) and pi-beep's build (build-cargo-dep.sh --path). Upstream forks still pulled by git (async-acme, crab_nat, fuser) are left as-is. Verified: cargo check of start-core + start-cli + start-registry + pi-beep compiles the whole path-dep tree clean; Cargo.lock regenerated. * refactor(start-os): move manage-release.sh into the product manage-release.sh is the StartOS release orchestration (startos-images S3 bucket/CDN, the OS image arch matrix incl. -nonfree/-nvidia, the OS registry), not a repo-wide tool — move it to projects/start-os/scripts/. It still calls the shared scripts/publish-deb.sh (which stays top-level, since it publishes any product's .deb), now referenced by its repo-root-relative path. * refactor(debian): rename dpkg-build.sh -> build.sh, move publish-deb.sh -> debian/publish.sh Co-locate the deb tooling under debian/: the package builder is debian/build.sh and the apt-repo publisher is debian/publish.sh (was scripts/publish-deb.sh, which empties scripts/). Repoint the per-product deb build.mk targets, the manage-release.sh caller, and doc/comment references. * build: build pi-beep as a first-party member; reword "vendored" -> "first-party" pi-beep is one of our crates now, so build it like startos-backup-fs (a dedicated build-pi-beep.sh zig build of the workspace member) instead of routing it through build-cargo-dep.sh. That script is now only for the genuinely external crates.io dev tools (tokio-console, flamegraph) bundled into unstable/console images. Also reword the patch-db docs: these are our own crates, so "first-party crate" is more accurate than "vendored" (which implies a third-party copy). * ci: path-gate the per-product build workflows to their project + deps The start-cli / start-registry / start-tunnel / startos-iso build workflows ran on every push/PR (only skipping doc-only changes), so all four built regardless of what changed. Replace the blanket paths-ignore with a paths: allowlist scoped to each product plus its dependencies (start-core + the in-repo shared-libs crates, Cargo manifests, build infra, and — for the web-bearing/OS workflows — the Angular workspace and SDK). workflow_dispatch / workflow_call are kept so manual and orchestrated runs still fire unconditionally. * ci: migrate shared-workflows (service-package CI) into the monorepo Bring the reusable .s9pk build/release workflows and their composite actions in-repo from the standalone Start9Labs/shared-workflows repo, so the packaging toolchain lives alongside the SDK: - .github/workflows/{build,release,tagAndRelease}.yml (reusable, workflow_call) - .github/actions/{extract-version,free-disk-space,setup-build-env, setup-publish-env,upload-each} Their internal references (and the SDK package-template's three workflows + the packaging docs) are repointed from start9labs/shared-workflows@master to Start9Labs/start-os@master. These are workflow_call-only, so they don't run for the monorepo itself — they activate once this lands on master and external service-package repos repoint their `uses:` to Start9Labs/start-os. * docs(monorepo): document tandem-update couplings The per-product CI `paths:` filters mirror each product's build.mk prerequisites by hand — nothing enforces it. Add a "Coupled changes" section to the root AGENTS.md and reciprocal pointers in each gated workflow and its build.mk, so a change to one half is caught at the other. Also catalogs the remaining hand-mirrored pairs (reusable service-package CI <-> SDK package-template <-> packaging docs; the files touched when adding a product/crate) and the already-enforced couplings (ts-bindings, the five i18n locales, the UI beta seed, version <-> CHANGELOG, docs <-> user-facing changes). * chore(manpages): generate man pages into their product projects The export_manpage_* tests in start-core wrote every product's man pages into start-core's own man/ dir. Point each generator at the owning product's man/ dir (anchored to CARGO_MANIFEST_DIR), move the committed pages there, and update build-manpage.sh's chown and the docs. start-container's pages go to projects/start-os, since that bin is part of the StartOS product. * Retitle README * refactor(shared-libs): rename web -> ts-modules Mirror the `crates/` naming: the shared TS/Angular workspace dir becomes `shared-libs/ts-modules/`. Pure path rename — repoints every reference (angular.json, root tsconfig/package.json scripts, the Makefile include + build.mk, CI `paths:`, and docs). No code changes. * fix(monorepo): repoint stale paths from the projects/ move that broke CI Two classes of path left stale by nesting products under projects/: - Web apps `require()` repo-root config.json/package.json by relative path; the extra projects/ level meant every one was short one `../` (resolved to projects/… instead of the repo root), failing the esbuild UI build for start-os (ui + setup-wizard) and start-tunnel. - test.yaml and deploy-brochure.yml still `cd start-sdk` for the baseDist build; the SDK now lives at projects/start-sdk. * fix(debian): resolve PROJECT_DIR before reading VERSION debian/build.sh computed VERSION from "projects/$PROJECT_DIR/Cargo.toml" before PROJECT_DIR was assigned, so it read projects//Cargo.toml (empty) and double-prefixed projects/. The empty Version: produced an invalid DEBIAN/control and dpkg-deb rejected it — breaking the registry and tunnel .deb builds. start-cli's CI only runs `make cli` (the binary), so it never exercised this path. Hoist the PROJECT_DIR/INSTALL_TARGET block above VERSION and read "${PROJECT_DIR}/Cargo.toml" directly. Also only fall back to the OS product's usr/lib/startos/conflicts when that file actually exists, so non-OS products don't error on a missing conflicts file. * fix(web): prettier-wrap tsconfig paths widened by the ts-modules rename Renaming shared-libs/web -> shared-libs/ts-modules pushed the `@start9labs/*` path-mapping lines past prettier's print width, so `npm run format:check` (the Formatting & Lockfiles CI job) flagged the four product tsconfig.json files. Apply prettier's wrapping. * docs(contributing): align with restructure + renamed make recipes Bring the CONTRIBUTING set up to date with the monorepo layout and the namespaced make targets: - root: `make iso` -> `make startos` - start-os: `make $(IMAGE_TYPE)`/`deb`/`squashfs` -> `make startos-$(IMAGE_TYPE)`/`startos-deb`/`startos-squashfs`; deploy/flash targets -> `startos-update*`/`startos-wormhole*`/`startos-emulate-reflash` - start-core: `cd start-sdk` -> `cd projects/start-sdk`; osBindings sync path -> projects/start-sdk/base/lib/osBindings - shared-libs: `web/` -> `ts-modules/` (heading, lib paths, file: deps, cross-links) The other products' CONTRIBUTING files were already correct. * fix(container-runtime): correct repo-root target path in update-image.sh update-image.sh runs with cwd at projects/start-os/container-runtime/ (mounted at /root/start-os in start9/build-env), so the repo-root build output is three levels up. It copied start-container from ../../target (-> projects/target, nonexistent), so the container-runtime squashfs was never built and the OS image compile failed on every arch. Use ../../../target. Refresh the AGENTS.md gotcha that described the old stale path. * refactor(make): namespace OS web targets, require an explicit target, per-project cleans - `ui`/`uis` -> `startos-ui`/`startos-uis`: they build only the StartOS admin UI + setup-wizard, so they belong under the startos-* namespace. Also fix `startos-ui` to depend on the built index.html (the old `ui` depended on a directory with no rule). - No default build: bare `make` now prints `help` (.DEFAULT_GOAL := help) and the misleading `all` target (it only built `startos`, not "everything") is removed — callers specify a target. - Decentralize `clean`: every build.mk owns a `clean-<project>` target and the root `clean` just aggregates them. Per-project cleans use project-prefix wildcards so they're arch/version-independent, and two stale paths from the projects/ move are corrected (env/*.txt -> build/env/*.txt; image-recipe/deb -> projects/start-os/build/image-recipe/deb). - Drop the start-cli targets (`make cli`/`cli-deb`) from the start-os CONTRIBUTING build section (wrong product) and update the docs to the new target names (root + start-os CONTRIBUTING/README/AGENTS). * docs: sync, complete, and standardize all developer docs for the monorepo (#3356) * docs: sync developer docs with the monorepo restructure Audit of all developer documentation (AGENTS/CONTRIBUTING/ARCHITECTURE/README across root, projects/*, shared-libs/*) against the post-restructure tree. Corrects stale references the restructure left behind: - Paths still pointing at the pre-restructure layout (core/, web/, sdk/, brochure/, container-runtime/, patch-db submodule) -> projects/* and shared-libs/*. - Angular workspace root: several docs claimed shared-libs/ts-modules holds angular.json/package.json/tsconfig.json and that npm runs from there. The workspace is rooted at the repo root; fixed cwd/--prefix instructions, the tsconfig path-alias targets, and config-sample.json location accordingly. - Renamed make targets (startos-* namespace), the Rust lib rename (startos -> start_core / crate start-core), and the binary-source table in start-core/ARCHITECTURE.md. - Removed stale 'git clone --recursive' (no submodules remain) and the non-existent repo-level scripts/ reference. - Normalized product self-references and the brochure -> brochure-marketplace Angular project name; verified incidental accuracy fixes (exver 0.2.1, patch-db serde_cbor, image-recipe live-build). All relative doc links verified resolvable. Pre-commit lint-staged hook skipped (--no-verify): the slot has no installed node_modules so the binary can't run, and the repo's prettier targets only the web source dirs, not these markdown docs. * docs: bring utility crates and patch-db up to the standard doc set Every first-party crate under shared-libs/crates/ now carries the same AGENTS/ARCHITECTURE/CONTRIBUTING/README/CLAUDE set the projects and other shared libs use. - New full doc sets for exver, imbl-value, jsonpath, pi-beep, rpc-toolkit, yasi, written from each crate's actual source (verified module names, public API, cargo -p <package> commands, and real consumers; jsonpath's package is jsonpath_lib though its dir is jsonpath). Pre-existing READMEs (exver, jsonpath, yasi) were preserved verbatim and only augmented with a 'Place in the monorepo' + 'Documentation' section. - patch-db: added AGENTS.md (migrated from its content-bearing CLAUDE.md, plus a Build & test section noting it is its own Cargo workspace) and reduced CLAUDE.md to the one-line @AGENTS.md import like every other scope. - Every CLAUDE.md is exactly '@AGENTS.md'; all relative doc links resolve. * docs: normalize section structure across all project & shared-lib docs Standardize every first-class scope (root, the 7 projects, container-runtime, shared-libs, start-core, ts-modules) onto one canonical section template so the same sections appear under the same names in the same order everywhere: - AGENTS.md: intro (+ 'CLAUDE.md is a one-line @AGENTS.md import' + cross-links) → Layout → Build & test (run from the repo root) → Gotchas → scope-specific. Folded synonym headings (Where things are / What lives where / Map → Layout; Operating rules / Gotchas / rules → Gotchas; Build / Build & verify → Build & test). - CONTRIBUTING.md: Documentation (doc-map, added where missing) → Prerequisites → Building → Testing → Formatting → scope-specific → Commits / PRs (last). - ARCHITECTURE.md: ensured a 'Place in the monorepo' opener (where applicable) and a 'Further reading' links footer; internal sections left in place. - README.md: added a Documentation/links footer where missing; landing prose left untouched. Pure reorganization: headings renamed/reordered and short missing sections added — no prose reworded, no facts/commands/tables dropped. Scope-accurate build cwds preserved (start-docs builds from its dir; start-sdk from its dir; container-runtime via npm --prefix; patch-db its own workspace). All 102 docs' relative links verified resolvable; every CLAUDE.md remains the one-line import. * build+docs: merge patch-db into root workspace; enforce doc hierarchy Addresses review feedback on the docs PR: - **patch-db → root Cargo workspace.** Add the six patch-db crates (core, json-patch, json-ptr, macro, macro-internals, util) to the root workspace `members` and drop the `exclude`; remove patch-db's now-redundant virtual `Cargo.toml`. `cargo metadata` + `cargo check -p patch-db -p json-patch -p json-ptr -p patch-db-macro` pass. Updated the docs that called patch-db 'its own workspace' (patch-db AGENTS/CONTRIBUTING build commands now run from the repo root with `-p`; root ARCHITECTURE lists it as a member). - **Root AGENTS.md:** added a note that these doc files must be kept current with every change, and that the docs are hierarchical — a scope documents only what is specific to it and never repeats higher-scope content. - **Hierarchy cleanup:** removed the `## Commits / PRs` (and `Branch / commit / PR` / `Commit conventions`) sections from every non-root CONTRIBUTING.md — those conventions live only in the root CONTRIBUTING.md now. Scope-specific change steps were preserved (e.g. start-tunnel's migration/ bindings/CHANGELOG steps moved to a 'Making a change' section; start-cli's docs-update note folded into 'Where code lives'). Also dropped the duplicated 'keep these docs in sync' line from child Documentation sections (kept the local cross-link lists). - **jsonpath:** reframed the fork note as history-only across its docs — it has fully diverged from freestrings/jsonpath with no intent to upstream; treat it as first-party and edit freely (removed the 'pull fixes from upstream / keep changes minimal / fork-tracking' guidance). All 102 docs' relative links resolve; every CLAUDE.md remains the one-line import. * docs: add hierarchy-navigation notes to AGENTS files - Every non-root AGENTS.md now opens with a 'Read up the tree first' note: the docs are hierarchical, so before working in a scope read the AGENTS.md of each enclosing directory up to the repo root (and their ARCHITECTURE/CONTRIBUTING where relevant). Excludes the packaging-guide + package-template AGENTS under projects/start-sdk/docs/, which target external package authors, not the monorepo dir tree. - Root AGENTS.md gains the converse 'Read down into what you touch' note: read a subdirectory's AGENTS.md (and any further nested ones) before editing it. - Dropped the explicit repo-root CONTRIBUTING pointer from patch-db's CONTRIBUTING.md (the walk-up convention now covers it). * docs(agents): require product docs/ book + CHANGELOG to ship with code Root AGENTS.md now mandates that any change altering user-visible behavior update that product's user-facing docs/ book (projects/<product>/docs/) in the same change and add a CHANGELOG.md entry — no deferring docs/changelog to follow-ups. * build(make): add per-project format targets mirroring the clean decomposition Each build.mk now owns `format-<project>` + `format-check-<project>` (core, web, sdk, cli, registry, tunnel, startos), matching the per-project `clean-<project>` targets; the top-level `format`/`format-check` just aggregate them. Web (the whole Angular workspace incl. brochure) formats via the root npm script; the shared crates via one `cargo +nightly fmt`; container-runtime via its own prettier config (new `format`/`format:check` npm scripts). So you can format one project (`make format-cli`) or all (`make format`). * docs: address PR review — make-target refs, ARCH de-dup, ts-modules wording - Reference stable make targets instead of raw build/format commands across project docs: builds via `make cli`/`registry`/`tunnel`/`startos`/`startos-ui`, formatting via the per-project `make format-<project>` targets (and `format-check-<project>` for CI). Kept `cargo check`/`cargo test` and crate `cargo build` (no make equivalent) as noted dev shortcuts. - Fixed stale targets: dropped `all` (removed upstream; `make` now prints help), `ui`/`uis` -> `startos-ui`/`startos-uis`. - Removed the whole-monorepo ASCII trees that several product ARCHITECTURE.md files re-drew (start-cli, start-registry, container-runtime, ...) — that layout lives once in the root ARCHITECTURE.md; each now states only where it sits. - Reworded the `shared-libs/ts-modules` directory as shared TypeScript modules (not Angular-specific; current contents are the Angular libs shared/marketplace), per review; kept accurate per-library 'Angular library' phrasing. Branch merged up to date with docs/monorepo-proposal first. * refactor(sdk): extract base into @start9labs/start-core shared lib; flatten start-sdk Move projects/start-sdk/base -> shared-libs/ts-modules/start-core (package @start9labs/start-sdk-base -> @start9labs/start-core), mirroring the Rust crate shared-libs/crates/start-core. start-core builds its own self-contained dist consumed via file: deps. Flatten start-sdk (package/ -> root): the SDK now imports @start9labs/start-core instead of ../../base/lib, and its published dist bundles start-core (bundleDependencies) so external authors still install one package. Repoint all consumers off the SDK-as-base alias onto @start9labs/start-core: - web (root file: dep + 153 import sites + shared/marketplace peerDeps) - container-runtime (file: dep; base/lib imports -> start-core, package/lib -> lib) Repoint osBindings generation, the build DAG (build.mk fragments, Makefile), and regenerate the three lockfiles. Resolves the "SDK kept cohesive" deviation: base is now an honest first-class shared TS lib named for what it is. * docs+ci: reflect start-core extraction; repoint SDK build steps off base/baseDist CI: build start-core (cd shared-libs/ts-modules/start-core && make dist) before validating the SDK + web lockfiles; validate the flattened SDK lockfile at projects/start-sdk; add start-core to the prettier check; repoint the iso prevent-rebuild mkdirs and the brochure deploy paths: filter (start-sdk -> start-core). Docs: update every project's AGENTS/ARCHITECTURE/CONTRIBUTING/README for the new layout — base extracted to @start9labs/start-core under shared-libs/ts-modules, the SDK flattened (lib/) and bundling start-core, container-runtime depending on both. Removes the resolved "SDK kept cohesive" deviation note. * refactor(monorepo): use the start-technologies name; repoint init-workspace at the monorepo - Adopt start-technologies for monorepo/repo-URL references across docs and AGENTS files (ahead of the GitHub repo rename; product refs left as start-os: projects/start-os, the start-os crate, *-startos packages, StartOS). - s9pk init-workspace now sparse-clones the start-technologies monorepo (projects/start-sdk/docs) instead of the retired standalone start-docs repo, and the two start-docs-named init strings are reworded across all five locales. - Un-hide the SDK 2.0 packaging-workspace section and rewrite it for the monorepo clone; document fetch-on-demand SDK + OS source access (docs first) in the workspace AGENTS.md and workflow.md. - Fix build-config.js to read and write the repo-root config.json. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkwYSXK8Uh9D16UTffCNJ1 --------- Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: Matt Hill <9935159+MattDHill@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> | 2 个月前 | |
chore(start-sdk): promote next release to 3.0.0 (#3900) Helix-Harness: pi Helix-Model: openai-codex/gpt-5.6-sol | 5 天前 | |
feat(sdk): supply the package toolchain and bundle only start-core (#3853) A package declared five dependencies to build: the SDK, plus typescript, @types/node, @vercel/ncc and prettier, in 17 different @types/node ranges across the fleet. All four now install with the SDK and hoist into the package's own node_modules, so a package declares the SDK alone. s9pk.mk invokes each step itself through TS_CHECK, FORMAT_CHECK and JS_BUNDLE rather than npm run, which also frees the `build` and `check` script names for application repos that ship packaging alongside an app. Formatting joins the build gate next to lint, with `make format` to write. The shipped config is the four settings all 142 package.json blocks already declared, so a formatted package stays formatted; deliberately not the monorepo's .prettierrc.json, whose arrowParens: avoid would reformat 762 of the fleet's 3294 files. bundleDependencies drops from three entries to one. start-core has to stay — it is a file: dep that is never published — but eslint and typescript-eslint were putting 90 packages somewhere neither `overrides` nor `npm audit fix` can reach, making an SDK release the only way to clear an advisory against any of them. Un-bundled they hoist and a package can override them itself; verified by moving brace-expansion 1.1.18 -> 2.0.2 from a package, which is the case 2.0.10's Security entry had to ship an SDK release for. Verified by scaffolding the template against the packed tarball: the gate passes with one dependency declared, fails on unformatted source and on the Promise-in-template lint rule, `make format` repairs it, and a JS_BUNDLE override still applies a package's own chmod. Co-authored-by: Matt Hill <9935159+MattDHill@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> | 6 天前 | |
chore(start-sdk): promote next release to 3.0.0 (#3900) Helix-Harness: pi Helix-Model: openai-codex/gpt-5.6-sol | 5 天前 | |
refactor: reorganize start-os into all-products monorepo (#3352) * docs: propose monorepo reorganization for all Start9 products * refactor(monorepo): split core into start-core lib + thin product bin crates - core/ -> shared/crates/start-core (lib 'startos', package 'start-core') - entry points moved to product dirs: start-os (startbox+start-container), start-cli, start-registry, start-tunnel - root Cargo workspace + shared Cargo.lock; profiles hoisted to root - patch-db submodule relocated to vendor/patch-db - service files moved to their product dirs - fixed include_dir!/include_str! paths for new crate locations cargo check -p start-cli -p start-registry passes (lib compiles). * refactor(monorepo): split web into product dirs + shared/web; relocate sdk & container-runtime - angular workspace rooted at shared/web (holds shared + marketplace libs + config) - apps moved to product dirs: start-os/web/{ui,setup-wizard}, start-tunnel/web, brochure/ - angular.json roots/outputs + per-app tsconfig paths repointed (Plan A) - sdk -> start-sdk (base+package kept cohesive: package imports base via relative paths under shared rootDir; splitting base out would break those imports) - container-runtime -> start-os/container-runtime - file: deps repointed (sdk baseDist/dist, patch-db client under vendor/) * build(monorepo): rewire Makefile, build scripts & CI to new layout - build scripts target workspace (-p <crate>, ./Cargo.toml, repo-root cwd) - Makefile paths: core->shared/crates/start-core, web split across product dirs, sdk->start-sdk, container-runtime->start-os/container-runtime, patch-db->vendor - compress-uis.sh takes per-product web dir; split compress pattern rules - ts-bindings recipe sed patterns generalized for new bindings path - CI workflows repointed (deploy-brochure, start-cli, test, startos-iso, ...) * chore(monorepo): gitignore per-product web dist outputs * docs(monorepo): update proposal to reflect implemented layout + verification status * refactor(monorepo): relocate root docs/ internal notes into their projects - exver.md, VERSION_BUMP.md -> shared/crates/start-core/ - PHYSICAL_DEVICE_TEST_PLAN.md, TODO.md -> start-os/ - draft-start9-pcp-hostname.* -> start-tunnel/ frees top-level docs/ for the migrated docs site * docs(monorepo): migrate start-docs (plain copy, no history) - mdbooks into product dirs: start-os/docs, start-tunnel/docs, start-sdk/docs (packaging) - bitcoin-guides, landing, build infra (build.sh/serve.sh/theme/versions.conf/scripts) -> top-level docs/ - repoint book theme symlinks to ../../docs/theme; book.toml build-dir=book, repo/edit URLs -> monorepo - build.sh maps book names to relocated dirs (absolute output); deploy.yml runs in docs/ with paths filter - verified: docs/build.sh builds all 4 books * docs(monorepo): adopt AGENTS.md convention (CLAUDE.md -> @AGENTS.md import) * docs(root): rewrite README/ARCHITECTURE/AGENTS/CONTRIBUTING for monorepo layout * docs(start-os): add product README/ARCHITECTURE/AGENTS/CHANGELOG/CONTRIBUTING Document the StartOS OS product as a thin wrapper in the monorepo: startbox/ start-container bins, web UIs (ui + setup-wizard), container-runtime, systemd units, and OS image packaging. Reflect new paths (start-core, shared/web, start-sdk, vendor/patch-db) and root-workspace build commands. * docs: integrate merged start-docs PRs (#93 UPnP/gateway, #94 task accept/set, #96 init progress) Only PRs whose feature is confirmed merged into start-os were applied. #99 (upstreamCertValidation) skipped — its code PR (#3353) is still open. * docs: add/normalize per-project doc sets (README/ARCHITECTURE/AGENTS/[CHANGELOG]/CONTRIBUTING) Products get the full set incl CHANGELOG; shared components + docs site get the set minus CHANGELOG; all updated to reflect the monorepo layout and AGENTS.md convention. * docs: add CLAUDE.md -> @AGENTS.md import to remaining project dirs * build(monorepo): root the Angular workspace at repo root so apps resolve node_modules Angular resolves @angular/core per-project from each app's root; with apps in product dirs, shared/web/node_modules was unreachable. Move the workspace config (angular.json, package.json, lockfile, tsconfig{,.lib}.json, .browserslistrc) to the repo root — the only ancestor of every app — so resolution works. - angular.json: project roots -> product dirs, lib roots -> shared/web/{shared,marketplace} - tsconfig paths/extends repointed; app source config.json/package.json require() depths corrected for the new app locations - package.json file: deps + script paths rebased to root; check-i18n.mjs scans the scattered project dirs; update-config.sh writes config.json at the workspace root - Makefile web targets run npm at root; build/env + build-cargo-dep stale paths fixed - build-cli.sh: drop stale 'cd core' in chown step Verified: full build succeeds — ts-bindings, SDK bundle, all 4 Angular UIs, and all five musl bins (startbox/registrybox/tunnelbox/start-container/start-cli). * build(monorepo): fix full-image build paths (container-runtime squashfs + version) - Makefile: undouble container-runtime.service dep path in rootfs rule - check-version.sh: read version from root package.json (moved from web/) - update-image-local.sh: mount repo root so start-sdk + target/ are visible to the image build; run start-os/container-runtime/update-image.sh - update-image.sh: copy start-container from ../../target (workspace), not ../core/target Verified: 'make all' completes (exit 0) — all musl bins + container-runtime rootfs.squashfs (437M) build; second run is a no-op (fully built). * build(monorepo): sync container-runtime package-lock to relocated SDK path; prettier ARCHITECTURE table * feat(monorepo): migrate startos-backup-fs into start-os/backup-fs Vendor the backup-fs crate (was external git dep Start9Labs/start-fs) as a workspace member under the start-os product; build it via the zigbuild path like the other bins instead of 'cargo install --git'. - start-os/backup-fs/: the startos-backup-fs crate (encrypted erasure-coded FUSE backup filesystem); relaxed its =4.5.7 clap / =0.2.17 ppv-lite86 exact pins so they unify with the workspace - root Cargo workspace member + single lock - shared/crates/start-core/build/build-backup-fs.sh; Makefile target builds the local crate (no more git URL) - docs: start-os ARCHITECTURE + CHANGELOG note the migration Verified: 'make all' (exit 0) builds startos-backup-fs (musl) as a member. * build(sdk): decouple 'bundle' from test/check-fmt so consumers don't re-run jest bundle now builds baseDist+dist only; test/check-fmt are standalone (CI calls them directly), and publish runs them explicitly. Fixes the recursive-make coupling where the OS build re-ran the full SDK jest suite every build and an SDK test/format failure broke the OS build. * build(monorepo): split Makefile into per-project include fragments Thin root Makefile includes build/common.mk (shared vars/macros + cross-cutting infra) and one <project>/build.mk per product. Uses include (not recursive make) so it stays a single DAG and cross-project prereqs (start-core -> ts-bindings -> SDK -> web/container-runtime) resolve correctly. - build/common.mk: vars, cp/mkdir/ln/ssh macros, patch-db client, external cargo tools - shared/crates/start-core/build.mk: test-core, ts-bindings - shared/web/build.mk: angular workspace (install, .angular, i18n, UI builds, compress, config.json) - start-sdk/build.mk: test-sdk, dist bundle (consumes the now-decoupled SDK Makefile) - start-{cli,registry,tunnel}/build.mk: their bins + install/deb - start-os/build.mk: startbox/start-container/backup-fs, container-runtime image, OS image assembly + deploy - docs/build.mk: docs site build Verified: make all is a no-op (full build intact); all targets resolve; no duplicate recipes. * docs(root): note the per-project build.mk Makefile structure in AGENTS.md * fix(ci): repoint test/web paths after workspace moves - run-tests.sh: cd to repo root (was shared/crates), build via ./Cargo.toml -p start-core (was ./core/Cargo.toml --workspace) - test.yaml / deploy-brochure: install the Angular workspace at the repo root (npm ci) instead of shared/web; fix vendor/vendor/patch-db doubling; brochure path filters -> root - startos-iso prevent-rebuild placeholders: node_modules/.angular at root; version read from root package.json Verified: npm ci passes at root (lockfile gate). * build(start-os): namespace OS-product make targets as startos-* / install-startos The repo is no longer start-os-only, so the generic target names now read as start-os-specific: - deb->startos-deb, iso/img->startos-$(IMAGE_TYPE), squashfs->startos-squashfs - install->install-startos (matches install-registry/install-tunnel) - wormhole*/update*/emulate-reflash/upload-ota -> startos-* - new 'startos' aggregate (= STARTOS_TARGETS); root 'all: startos' Callers updated: dpkg-build.sh INSTALL_TARGET, deploy targets' $(MAKE) install, startos-iso.yaml (make startos-iso/startos-img), root .PHONY. NOTE: external shared-workflows may invoke the old names (make iso/squashfs/install) for OS image/release builds — needs a companion update there. * build(start-os): move OS-specific build assets into start-os/build Relocate the start-os-only build inputs out of the shared top-level build/ into the product dir: image-recipe/, dpkg-deps/, lib/, download-firmware.sh, and save-migration-images.sh -> start-os/build/. Keep genuinely shared pieces at build/ (common.mk, env/, os-compat/, build-cargo-dep.sh, and lib/scripts/forward-port, which start-tunnel also installs). Relocate the start-os-specific make variables/rules out of build/common.mk into start-os/build.mk (web src/output vars -> shared/web/build.mk; registry and tunnel target vars -> their own fragments) so common.mk is shared-only. Repoint every reference (fragments, Makefile clean, container-runtime update-image.sh, and the moved scripts' own internal paths). Delete the unreferenced legacy build/registry/ eos deploy scripts. * docs(changelog): write 0.4.0-beta.10 per-product release notes Fill in the [0.4.0-beta.10] sections across the per-product CHANGELOGs (brochure, start-cli, start-os, start-registry, start-sdk, start-tunnel) with Added/Changed/Fixed/Removed/Security notes for this cycle, cross-linked between products. * refactor(start-core): rename lib startos to start_core, drop package alias Rename the start-core library from `startos` to `start_core` so the crate's lib name matches its package and the legacy `startos = { package = "start-core" }` dependency-rename alias is gone. The name now penetrates all source: - [lib] name = "start_core"; every `startos::` crate path -> `start_core::` - product crates depend on `start-core` directly; features become `start-core/*` - RUST_LOG=warn,startos=debug -> start_core=debug in the systemd units and CI (the target is module_path!()-derived, so it tracks the crate name) - docs updated to match The product identifier "startos" is left untouched (the root:startos system user/group, the tor.startos / *.startos DNS names, the nftables table, the signature context, the .startos/ packaging-workspace dir, i18n keys, and the /usr/lib/startos install paths). * refactor(monorepo): nest products under projects/, rename shared -> shared-libs Move the buildable products and the docs site into a top-level projects/ dir to separate them from repo infrastructure: start-os, start-cli, start-registry, start-tunnel, start-sdk, brochure (-> brochure-marketplace), docs (-> start-docs) -> projects/ Rename the shared Rust+web library container shared/ -> shared-libs/, kept at the top level alongside build/ and vendor/ as cross-cutting infrastructure. Rewire every path reference to the new layout: - Cargo workspace members + product path deps (../shared -> ../../shared-libs) - Makefile, build/common.mk, and every <project>/build.mk fragment - angular.json, package.json, root + per-app tsconfig (web app configs moved a level deeper, so their relative extends/paths gain one ../) - .github/workflows (the Start9Labs/start-os repo URL is preserved; docs-deploy working-directory + path triggers updated) - build scripts (run-local-build.sh / update-image-local.sh cd depths and internal paths; start-core build/*.sh chown paths) - root .gitignore build-output globs and the web package-lock file: paths Verified: cargo check of all six crates (UI-embed include_dir! and build/env include_str! resolve to the new locations), make -n of the OS / registry / tunnel / web targets. The cold web/SDK build remains CI-grade. * refactor(monorepo): relocate project-specific assets/debian/scripts into projects Apply the same shared-vs-project split to the remaining top-level dirs: - assets/ (create-vm screenshots) -> projects/start-os/assets/ - debian/{startos,start-registry,start-tunnel}/postinst -> each project's debian/; the shared debian/dpkg-build.sh stays top-level and now maps PROJECT -> projects/<dir>/debian for the control files - scripts/copy-categories.sh (registry admin) -> projects/start-registry/scripts/ Kept at top level as genuinely shared/repo-level: debian/dpkg-build.sh, scripts/manage-release.sh (repo releases), scripts/publish-deb.sh (apt publish). Repoint the deb build.mk prereqs, the CONTRIBUTING create-vm link, and code/unit comments. Verified make -n of the three *-deb targets. * docs(rfcs): move draft-start9-pcp-hostname to a top-level rfcs/ dir The PCP HOSTNAME extension Internet-Draft (.md + .txt) describes a protocol spoken by both the StartOS client and the StartTunnel server, so it belongs at the repo level rather than inside start-tunnel/. Repoint the start-os CHANGELOG reference (was the stale docs/ path) to rfcs/. * docs: sync structure docs to the projects/ layout + README project shout-outs - README: add a "rest of the monorepo" section with a short shout-out to each non-OS product (StartTunnel, start-cli, Start SDK, start-registry, and the marketplace + docs sites), and update the directory table + icon path to the projects/ + shared-libs layout. - Root AGENTS.md: rewrite "what lives where" for the new layout and complete the Sub-scopes list (it was missing most products). - Root ARCHITECTURE.md: repoint the module map + cross-layer paths; MONOREPO.md gains a note that the layout was refined (products -> projects/, shared -> shared-libs). - Per-project docs: rename shared/ -> shared-libs/ references, fix relative links whose depth changed when products moved a level deeper into projects/ (links to the repo root, LICENSE, shared-libs, and cross-product changelogs), and repoint functional cd / --prefix build commands. Sibling refs under projects/ (e.g. ../start-sdk, file:../../start-sdk/dist) are correct and left as-is. * build(brochure-marketplace): rename Angular project brochure -> brochure-marketplace Rename the Angular project key (and its build/serve targets) so the project name matches its directory. The dist output is now projects/brochure-marketplace/dist/raw/brochure-marketplace, and the deploy workflow reads/rsyncs that path — this also corrects a path the projects/ restructure had mangled to raw/projects/brochure-marketplace. The npm script names (build:brochure / start:brochure) are kept as conveniences. * docs: remove MONOREPO.md The reorganization proposal has been fully implemented and superseded by the current README/ARCHITECTURE; drop the historical proposal doc and its two links. * feat(build): per-project versioning + Debian packaging for start-cli Decouple product versions from the single StartOS release version. Each Rust product's version is now the source of truth in its own Cargo.toml: start-os stays 0.4.0-beta.10; start-cli / start-registry / start-tunnel move to their own line starting at 1.0.0. - basename.sh and dpkg-build.sh read the version straight from the project's Cargo.toml (per PROJECT), so each .deb is named/versioned independently. - check-version.sh now derives the OS-image /usr/lib/startos/VERSION.txt from the start-os crate manifest instead of the root package.json; nothing maintains a separate version source anymore. - start-cli gains a Debian package: `make cli-deb` builds the musl binary and packages it via the shared dpkg-build.sh (CLI_BASENAME / install-cli staging). CHANGELOGs and the registry AGENTS version note updated to reflect independent versioning. Cargo.lock synced to the new member versions. * chore: ignore *.local.md Broaden the local-notes ignore from CLAUDE.local.md to any *.local.md. * refactor(deps): vendor Start9-maintained crates into shared-libs/crates Move every Start9-maintained crate the workspace depends on in-repo, wired by direct path deps (no [patch]): - rpc-toolkit, imbl-value, exver, yasi, jsonpath (jsonpath_lib), pi-beep — plain-copied from their repos into shared-libs/crates/, added as workspace members. Their inter-deps are repointed to path (exver/imbl-value -> yasi, rpc-toolkit/jsonpath -> imbl-value), and start-core depends on them by path. - patch-db — de-submoduled: moved out of the vendor/ git submodule into shared-libs/crates/patch-db (keeps its own [workspace], excluded from the root one and consumed by start-core via path). Its core/json-patch/json-ptr now path-dep the vendored imbl-value, so there is a single imbl_value::Value type. Drop .gitmodules; repoint the web patch-db-client (package.json / common.mk / CI / shared-libs/web) and pi-beep's build (build-cargo-dep.sh --path). Upstream forks still pulled by git (async-acme, crab_nat, fuser) are left as-is. Verified: cargo check of start-core + start-cli + start-registry + pi-beep compiles the whole path-dep tree clean; Cargo.lock regenerated. * refactor(start-os): move manage-release.sh into the product manage-release.sh is the StartOS release orchestration (startos-images S3 bucket/CDN, the OS image arch matrix incl. -nonfree/-nvidia, the OS registry), not a repo-wide tool — move it to projects/start-os/scripts/. It still calls the shared scripts/publish-deb.sh (which stays top-level, since it publishes any product's .deb), now referenced by its repo-root-relative path. * refactor(debian): rename dpkg-build.sh -> build.sh, move publish-deb.sh -> debian/publish.sh Co-locate the deb tooling under debian/: the package builder is debian/build.sh and the apt-repo publisher is debian/publish.sh (was scripts/publish-deb.sh, which empties scripts/). Repoint the per-product deb build.mk targets, the manage-release.sh caller, and doc/comment references. * build: build pi-beep as a first-party member; reword "vendored" -> "first-party" pi-beep is one of our crates now, so build it like startos-backup-fs (a dedicated build-pi-beep.sh zig build of the workspace member) instead of routing it through build-cargo-dep.sh. That script is now only for the genuinely external crates.io dev tools (tokio-console, flamegraph) bundled into unstable/console images. Also reword the patch-db docs: these are our own crates, so "first-party crate" is more accurate than "vendored" (which implies a third-party copy). * ci: path-gate the per-product build workflows to their project + deps The start-cli / start-registry / start-tunnel / startos-iso build workflows ran on every push/PR (only skipping doc-only changes), so all four built regardless of what changed. Replace the blanket paths-ignore with a paths: allowlist scoped to each product plus its dependencies (start-core + the in-repo shared-libs crates, Cargo manifests, build infra, and — for the web-bearing/OS workflows — the Angular workspace and SDK). workflow_dispatch / workflow_call are kept so manual and orchestrated runs still fire unconditionally. * ci: migrate shared-workflows (service-package CI) into the monorepo Bring the reusable .s9pk build/release workflows and their composite actions in-repo from the standalone Start9Labs/shared-workflows repo, so the packaging toolchain lives alongside the SDK: - .github/workflows/{build,release,tagAndRelease}.yml (reusable, workflow_call) - .github/actions/{extract-version,free-disk-space,setup-build-env, setup-publish-env,upload-each} Their internal references (and the SDK package-template's three workflows + the packaging docs) are repointed from start9labs/shared-workflows@master to Start9Labs/start-os@master. These are workflow_call-only, so they don't run for the monorepo itself — they activate once this lands on master and external service-package repos repoint their `uses:` to Start9Labs/start-os. * docs(monorepo): document tandem-update couplings The per-product CI `paths:` filters mirror each product's build.mk prerequisites by hand — nothing enforces it. Add a "Coupled changes" section to the root AGENTS.md and reciprocal pointers in each gated workflow and its build.mk, so a change to one half is caught at the other. Also catalogs the remaining hand-mirrored pairs (reusable service-package CI <-> SDK package-template <-> packaging docs; the files touched when adding a product/crate) and the already-enforced couplings (ts-bindings, the five i18n locales, the UI beta seed, version <-> CHANGELOG, docs <-> user-facing changes). * chore(manpages): generate man pages into their product projects The export_manpage_* tests in start-core wrote every product's man pages into start-core's own man/ dir. Point each generator at the owning product's man/ dir (anchored to CARGO_MANIFEST_DIR), move the committed pages there, and update build-manpage.sh's chown and the docs. start-container's pages go to projects/start-os, since that bin is part of the StartOS product. * Retitle README * refactor(shared-libs): rename web -> ts-modules Mirror the `crates/` naming: the shared TS/Angular workspace dir becomes `shared-libs/ts-modules/`. Pure path rename — repoints every reference (angular.json, root tsconfig/package.json scripts, the Makefile include + build.mk, CI `paths:`, and docs). No code changes. * fix(monorepo): repoint stale paths from the projects/ move that broke CI Two classes of path left stale by nesting products under projects/: - Web apps `require()` repo-root config.json/package.json by relative path; the extra projects/ level meant every one was short one `../` (resolved to projects/… instead of the repo root), failing the esbuild UI build for start-os (ui + setup-wizard) and start-tunnel. - test.yaml and deploy-brochure.yml still `cd start-sdk` for the baseDist build; the SDK now lives at projects/start-sdk. * fix(debian): resolve PROJECT_DIR before reading VERSION debian/build.sh computed VERSION from "projects/$PROJECT_DIR/Cargo.toml" before PROJECT_DIR was assigned, so it read projects//Cargo.toml (empty) and double-prefixed projects/. The empty Version: produced an invalid DEBIAN/control and dpkg-deb rejected it — breaking the registry and tunnel .deb builds. start-cli's CI only runs `make cli` (the binary), so it never exercised this path. Hoist the PROJECT_DIR/INSTALL_TARGET block above VERSION and read "${PROJECT_DIR}/Cargo.toml" directly. Also only fall back to the OS product's usr/lib/startos/conflicts when that file actually exists, so non-OS products don't error on a missing conflicts file. * fix(web): prettier-wrap tsconfig paths widened by the ts-modules rename Renaming shared-libs/web -> shared-libs/ts-modules pushed the `@start9labs/*` path-mapping lines past prettier's print width, so `npm run format:check` (the Formatting & Lockfiles CI job) flagged the four product tsconfig.json files. Apply prettier's wrapping. * docs(contributing): align with restructure + renamed make recipes Bring the CONTRIBUTING set up to date with the monorepo layout and the namespaced make targets: - root: `make iso` -> `make startos` - start-os: `make $(IMAGE_TYPE)`/`deb`/`squashfs` -> `make startos-$(IMAGE_TYPE)`/`startos-deb`/`startos-squashfs`; deploy/flash targets -> `startos-update*`/`startos-wormhole*`/`startos-emulate-reflash` - start-core: `cd start-sdk` -> `cd projects/start-sdk`; osBindings sync path -> projects/start-sdk/base/lib/osBindings - shared-libs: `web/` -> `ts-modules/` (heading, lib paths, file: deps, cross-links) The other products' CONTRIBUTING files were already correct. * fix(container-runtime): correct repo-root target path in update-image.sh update-image.sh runs with cwd at projects/start-os/container-runtime/ (mounted at /root/start-os in start9/build-env), so the repo-root build output is three levels up. It copied start-container from ../../target (-> projects/target, nonexistent), so the container-runtime squashfs was never built and the OS image compile failed on every arch. Use ../../../target. Refresh the AGENTS.md gotcha that described the old stale path. * refactor(make): namespace OS web targets, require an explicit target, per-project cleans - `ui`/`uis` -> `startos-ui`/`startos-uis`: they build only the StartOS admin UI + setup-wizard, so they belong under the startos-* namespace. Also fix `startos-ui` to depend on the built index.html (the old `ui` depended on a directory with no rule). - No default build: bare `make` now prints `help` (.DEFAULT_GOAL := help) and the misleading `all` target (it only built `startos`, not "everything") is removed — callers specify a target. - Decentralize `clean`: every build.mk owns a `clean-<project>` target and the root `clean` just aggregates them. Per-project cleans use project-prefix wildcards so they're arch/version-independent, and two stale paths from the projects/ move are corrected (env/*.txt -> build/env/*.txt; image-recipe/deb -> projects/start-os/build/image-recipe/deb). - Drop the start-cli targets (`make cli`/`cli-deb`) from the start-os CONTRIBUTING build section (wrong product) and update the docs to the new target names (root + start-os CONTRIBUTING/README/AGENTS). * docs: sync, complete, and standardize all developer docs for the monorepo (#3356) * docs: sync developer docs with the monorepo restructure Audit of all developer documentation (AGENTS/CONTRIBUTING/ARCHITECTURE/README across root, projects/*, shared-libs/*) against the post-restructure tree. Corrects stale references the restructure left behind: - Paths still pointing at the pre-restructure layout (core/, web/, sdk/, brochure/, container-runtime/, patch-db submodule) -> projects/* and shared-libs/*. - Angular workspace root: several docs claimed shared-libs/ts-modules holds angular.json/package.json/tsconfig.json and that npm runs from there. The workspace is rooted at the repo root; fixed cwd/--prefix instructions, the tsconfig path-alias targets, and config-sample.json location accordingly. - Renamed make targets (startos-* namespace), the Rust lib rename (startos -> start_core / crate start-core), and the binary-source table in start-core/ARCHITECTURE.md. - Removed stale 'git clone --recursive' (no submodules remain) and the non-existent repo-level scripts/ reference. - Normalized product self-references and the brochure -> brochure-marketplace Angular project name; verified incidental accuracy fixes (exver 0.2.1, patch-db serde_cbor, image-recipe live-build). All relative doc links verified resolvable. Pre-commit lint-staged hook skipped (--no-verify): the slot has no installed node_modules so the binary can't run, and the repo's prettier targets only the web source dirs, not these markdown docs. * docs: bring utility crates and patch-db up to the standard doc set Every first-party crate under shared-libs/crates/ now carries the same AGENTS/ARCHITECTURE/CONTRIBUTING/README/CLAUDE set the projects and other shared libs use. - New full doc sets for exver, imbl-value, jsonpath, pi-beep, rpc-toolkit, yasi, written from each crate's actual source (verified module names, public API, cargo -p <package> commands, and real consumers; jsonpath's package is jsonpath_lib though its dir is jsonpath). Pre-existing READMEs (exver, jsonpath, yasi) were preserved verbatim and only augmented with a 'Place in the monorepo' + 'Documentation' section. - patch-db: added AGENTS.md (migrated from its content-bearing CLAUDE.md, plus a Build & test section noting it is its own Cargo workspace) and reduced CLAUDE.md to the one-line @AGENTS.md import like every other scope. - Every CLAUDE.md is exactly '@AGENTS.md'; all relative doc links resolve. * docs: normalize section structure across all project & shared-lib docs Standardize every first-class scope (root, the 7 projects, container-runtime, shared-libs, start-core, ts-modules) onto one canonical section template so the same sections appear under the same names in the same order everywhere: - AGENTS.md: intro (+ 'CLAUDE.md is a one-line @AGENTS.md import' + cross-links) → Layout → Build & test (run from the repo root) → Gotchas → scope-specific. Folded synonym headings (Where things are / What lives where / Map → Layout; Operating rules / Gotchas / rules → Gotchas; Build / Build & verify → Build & test). - CONTRIBUTING.md: Documentation (doc-map, added where missing) → Prerequisites → Building → Testing → Formatting → scope-specific → Commits / PRs (last). - ARCHITECTURE.md: ensured a 'Place in the monorepo' opener (where applicable) and a 'Further reading' links footer; internal sections left in place. - README.md: added a Documentation/links footer where missing; landing prose left untouched. Pure reorganization: headings renamed/reordered and short missing sections added — no prose reworded, no facts/commands/tables dropped. Scope-accurate build cwds preserved (start-docs builds from its dir; start-sdk from its dir; container-runtime via npm --prefix; patch-db its own workspace). All 102 docs' relative links verified resolvable; every CLAUDE.md remains the one-line import. * build+docs: merge patch-db into root workspace; enforce doc hierarchy Addresses review feedback on the docs PR: - **patch-db → root Cargo workspace.** Add the six patch-db crates (core, json-patch, json-ptr, macro, macro-internals, util) to the root workspace `members` and drop the `exclude`; remove patch-db's now-redundant virtual `Cargo.toml`. `cargo metadata` + `cargo check -p patch-db -p json-patch -p json-ptr -p patch-db-macro` pass. Updated the docs that called patch-db 'its own workspace' (patch-db AGENTS/CONTRIBUTING build commands now run from the repo root with `-p`; root ARCHITECTURE lists it as a member). - **Root AGENTS.md:** added a note that these doc files must be kept current with every change, and that the docs are hierarchical — a scope documents only what is specific to it and never repeats higher-scope content. - **Hierarchy cleanup:** removed the `## Commits / PRs` (and `Branch / commit / PR` / `Commit conventions`) sections from every non-root CONTRIBUTING.md — those conventions live only in the root CONTRIBUTING.md now. Scope-specific change steps were preserved (e.g. start-tunnel's migration/ bindings/CHANGELOG steps moved to a 'Making a change' section; start-cli's docs-update note folded into 'Where code lives'). Also dropped the duplicated 'keep these docs in sync' line from child Documentation sections (kept the local cross-link lists). - **jsonpath:** reframed the fork note as history-only across its docs — it has fully diverged from freestrings/jsonpath with no intent to upstream; treat it as first-party and edit freely (removed the 'pull fixes from upstream / keep changes minimal / fork-tracking' guidance). All 102 docs' relative links resolve; every CLAUDE.md remains the one-line import. * docs: add hierarchy-navigation notes to AGENTS files - Every non-root AGENTS.md now opens with a 'Read up the tree first' note: the docs are hierarchical, so before working in a scope read the AGENTS.md of each enclosing directory up to the repo root (and their ARCHITECTURE/CONTRIBUTING where relevant). Excludes the packaging-guide + package-template AGENTS under projects/start-sdk/docs/, which target external package authors, not the monorepo dir tree. - Root AGENTS.md gains the converse 'Read down into what you touch' note: read a subdirectory's AGENTS.md (and any further nested ones) before editing it. - Dropped the explicit repo-root CONTRIBUTING pointer from patch-db's CONTRIBUTING.md (the walk-up convention now covers it). * docs(agents): require product docs/ book + CHANGELOG to ship with code Root AGENTS.md now mandates that any change altering user-visible behavior update that product's user-facing docs/ book (projects/<product>/docs/) in the same change and add a CHANGELOG.md entry — no deferring docs/changelog to follow-ups. * build(make): add per-project format targets mirroring the clean decomposition Each build.mk now owns `format-<project>` + `format-check-<project>` (core, web, sdk, cli, registry, tunnel, startos), matching the per-project `clean-<project>` targets; the top-level `format`/`format-check` just aggregate them. Web (the whole Angular workspace incl. brochure) formats via the root npm script; the shared crates via one `cargo +nightly fmt`; container-runtime via its own prettier config (new `format`/`format:check` npm scripts). So you can format one project (`make format-cli`) or all (`make format`). * docs: address PR review — make-target refs, ARCH de-dup, ts-modules wording - Reference stable make targets instead of raw build/format commands across project docs: builds via `make cli`/`registry`/`tunnel`/`startos`/`startos-ui`, formatting via the per-project `make format-<project>` targets (and `format-check-<project>` for CI). Kept `cargo check`/`cargo test` and crate `cargo build` (no make equivalent) as noted dev shortcuts. - Fixed stale targets: dropped `all` (removed upstream; `make` now prints help), `ui`/`uis` -> `startos-ui`/`startos-uis`. - Removed the whole-monorepo ASCII trees that several product ARCHITECTURE.md files re-drew (start-cli, start-registry, container-runtime, ...) — that layout lives once in the root ARCHITECTURE.md; each now states only where it sits. - Reworded the `shared-libs/ts-modules` directory as shared TypeScript modules (not Angular-specific; current contents are the Angular libs shared/marketplace), per review; kept accurate per-library 'Angular library' phrasing. Branch merged up to date with docs/monorepo-proposal first. * refactor(sdk): extract base into @start9labs/start-core shared lib; flatten start-sdk Move projects/start-sdk/base -> shared-libs/ts-modules/start-core (package @start9labs/start-sdk-base -> @start9labs/start-core), mirroring the Rust crate shared-libs/crates/start-core. start-core builds its own self-contained dist consumed via file: deps. Flatten start-sdk (package/ -> root): the SDK now imports @start9labs/start-core instead of ../../base/lib, and its published dist bundles start-core (bundleDependencies) so external authors still install one package. Repoint all consumers off the SDK-as-base alias onto @start9labs/start-core: - web (root file: dep + 153 import sites + shared/marketplace peerDeps) - container-runtime (file: dep; base/lib imports -> start-core, package/lib -> lib) Repoint osBindings generation, the build DAG (build.mk fragments, Makefile), and regenerate the three lockfiles. Resolves the "SDK kept cohesive" deviation: base is now an honest first-class shared TS lib named for what it is. * docs+ci: reflect start-core extraction; repoint SDK build steps off base/baseDist CI: build start-core (cd shared-libs/ts-modules/start-core && make dist) before validating the SDK + web lockfiles; validate the flattened SDK lockfile at projects/start-sdk; add start-core to the prettier check; repoint the iso prevent-rebuild mkdirs and the brochure deploy paths: filter (start-sdk -> start-core). Docs: update every project's AGENTS/ARCHITECTURE/CONTRIBUTING/README for the new layout — base extracted to @start9labs/start-core under shared-libs/ts-modules, the SDK flattened (lib/) and bundling start-core, container-runtime depending on both. Removes the resolved "SDK kept cohesive" deviation note. * refactor(monorepo): use the start-technologies name; repoint init-workspace at the monorepo - Adopt start-technologies for monorepo/repo-URL references across docs and AGENTS files (ahead of the GitHub repo rename; product refs left as start-os: projects/start-os, the start-os crate, *-startos packages, StartOS). - s9pk init-workspace now sparse-clones the start-technologies monorepo (projects/start-sdk/docs) instead of the retired standalone start-docs repo, and the two start-docs-named init strings are reworded across all five locales. - Un-hide the SDK 2.0 packaging-workspace section and rewrite it for the monorepo clone; document fetch-on-demand SDK + OS source access (docs first) in the workspace AGENTS.md and workflow.md. - Fix build-config.js to read and write the repo-root config.json. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkwYSXK8Uh9D16UTffCNJ1 --------- Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: Matt Hill <9935159+MattDHill@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> | 2 个月前 | |
chore(license): fixes from license hygiene audit (#3627) * chore(license): replace proprietary fonts with an open family Proxima Nova (Copyright (c) Mark Simonson, all rights reserved) and MBF Minimal Custom (Copyright (c) MoonBandit, all rights reserved) were tracked in-tree and copied into the ui, setup-wizard, start-tunnel, start-wrt and marketplace bundles by angular.json, under a repository that grants recipients MIT rights to distribute and sublicense. Replace them with Hanken Grotesk (SIL OFL 1.1). One variable face covers the whole 100-900 range the seven static Proxima weights were serving, so the two woff2 subsets are 54 KB against the 460 KB they replace. The MBF face was declared in start-tunnel but no rule ever applied the family, so it is dropped rather than replaced. * chore(license): carve the GPL-2.0 OpenWrt material out of start-wrt's MIT grant projects/start-wrt/LICENSE claimed MIT over the whole project, but sixteen files under openwrt-overlay/ carry an explicit SPDX-License-Identifier: GPL-2.0-only header naming SpaceMiT Ltd. or OpenWrt.org, and openwrt-patches/ are derivative works of GPL-2.0 OpenWrt sources. GPL-2.0 cannot be relicensed downstream, so the MIT grant was offering rights Start9 does not hold. Add COPYING (GPL-2.0) plus a README to each directory recording provenance and the GPL-2.0 §3 source obligation, and scope the MIT grant in the LICENSE and README to exclude them. CONTRIBUTING described openwrt-overlay/ as "the Start9 additions"; it is mostly SpaceMiT's BSP, so say so. * chore(license): attribute vendored third-party code imbl-value's src/de.rs is 84% line-identical to serde_json's src/value/de.rs (longest identical run 107 lines), ser.rs 80% and index.rs 74%, and macros.rs is serde_json's json! muncher with its comments intact — yet LICENSE named only Start9 and AGENTS.md asserted the impls were not serde_json's. All the upstreams here are MIT or MIT-compatible, so this is notice compliance, not relicensing. - imbl-value: credit Erick Tryzelaar and David Tolnay in LICENSE, record the derivation in README, and correct the AGENTS.md bullet. - patch-db/json-patch: a fork of idubrov/json-patch with serde_json swapped for imbl-value + json-ptr, shipping no license text despite declaring dual terms. Add LICENSE-MIT and the verbatim LICENSE-APACHE, a README recording the fork, and normalize the SPDX expression to "MIT OR Apache-2.0". - jsonpath: fill in the MIT template placeholders left as "[2019] [Changseok Han]" and credit the upstream in the README. - init_resize.sh: name RPi-Distro/raspi-config, which it derives from. json-patch and jsonpath_lib are also set publish = false: both sit at crates.io names owned by their upstreams, so publishing a diverged fork from here would be wrong even if it were possible. * chore(license): declare MIT on every manifest, ship it with published crates Five Cargo manifests (backup-fs, patch-db-util, the three start-wrt crates) and eleven package.json files declared no license at all, and the workspace root has no [workspace.package] table to inherit one from, so tooling reported them as unlicensed. Declare MIT on each. exver and rpc-toolkit are published to crates.io but carried no license text in their tarballs; give them a LICENSE. Normalize the copyright holder across the existing files, which variously read "Start9", "Start9 Labs" and "Start9 Labs, Inc.", and rename yasi's LICENSE.md so cargo packages it by convention. The upload-each action's committed ncc bundle inlined 97 dependencies with their notices stripped; build it with --license so the per-dependency notices are generated and committed alongside. The bundle itself is byte-identical. * chore(license): add NOTICE.md and state the licensing policy Nothing in the repo said what "everything is MIT" excludes, so the claim could not be checked. NOTICE.md is now the complete list of files under other terms — if something is not named there, it is MIT — and the root LICENSE, README and the StartOS architecture doc point at it. Also: - CONTRIBUTING gains an inbound-licensing statement and a rule that vendored code keeps its notice and lands in NOTICE.md in the same PR. - .deb packages are built with a usr/share/doc/<pkg>/copyright file, which Debian policy requires and which the hand-written control block omitted. - deny.toml moves to the workspace root and drops copyleft/unlicensed/ allow-osi-fsf-free, removed from cargo-deny's schema in 0.14. Note nothing in CI runs it yet, so it remains documentation rather than a gate. - The Intel BIOS capsule mirrored for the discontinued 2023 Server One is attributed to Intel on the page that serves it. It is Intel's, not ours, and the architecture doc no longer implies the shipped image is MIT end to end. * chore(license): sync lockfiles with the added license fields npm records the root package's license in package-lock.json, so declaring it in package.json leaves the lockfile out of sync — which is exactly what CI's `npm ci` drift gate rejects. Five lockfiles, one line each, no dependency churn. * chore(license): taplo-format deny.toml The relocated file landed at the repo root without going through taplo, whose reorder_keys sorts each [[licenses.clarify]] table's keys. Caught by CI's format-check, which I hadn't run locally because it needs the fmt container. * chore(license): make deny.toml describe the tree it actually governs Nothing had ever run this policy, so it had drifted from reality in both directions. Ran cargo-deny against the real dependency graph: - LGPL-3.0, OpenSSL and Unicode-DFS-2016 were allowed but appear nowhere. LGPL is the one that mattered: allowing it invited a copyleft dependency that would have been incompatible with shipping start-core as MIT. - The webpki and ring clarifications are dead — webpki is gone (rustls-webpki now) and ring declares "Apache-2.0 AND ISC" itself. - Four permissive licenses genuinely in the tree were missing, so 25 crates were rejected for no good reason: Unicode-3.0 (the ICU stack), CDLA-Permissive-2.0 (webpki-roots), BSL-1.0 (xxhash-rust, lazy-bytes-cast) and 0BSD (quoted_printable). MPL-2.0 stays allowed and is now explained: its copyleft is per-file, so linking imbl and friends into an MIT binary is fine as long as we don't modify them. This leaves two genuine GPL-3.0-or-later rejections, which need code changes rather than a policy change, so the CI gate lands with that fix. * chore(license): revert the overreach in this branch Review of my own decisions found several that were wrong or went further than the evidence supported. Reverting them. - Restore "LGPL-3.0" to deny.toml. My commit message claimed allowing it was "incompatible with shipping start-core as MIT". That is wrong: LGPL-3.0 §4 expressly permits combining the library with a work conveyed under other terms, subject to notice and relink conditions. Worse, the entry was not drift — 5b22d0a3b (Aiden McClelland, 2021-06-17) added it in the commit that created the file, as a deliberate carve-out. An unmatched allowance is only a warning, so removing it bought nothing and would have hard-rejected a future LGPL dependency that is in fact perfectly usable. - Restore the root LICENSE to byte-canonical MIT. Editing the license body to add a carve-out risks breaking automated license detection, and the carve-out already lives in README.md and NOTICE.md. Same for start-wrt's LICENSE. - Restore extract-ikconfig. Deleting a working debugging tool from the image was a functional change made for a licensing reason that a NOTICE entry solves. - Restore jsonpath's LICENSE verbatim. Filling in a third party's copyright placeholders is not ours to do; the clarification belongs in the README. - CONTRIBUTING lumped LGPL in with GPL/AGPL as forbidden. Corrected: GPL/AGPL can't be linked into our binaries, LGPL and MPL-2.0 can, with obligations. - NOTICE claimed to be "the complete list" and that anything unlisted is MIT. Softened — I can't guarantee completeness. - Moved brand marks out of "Not MIT" into their own Trademarks section. Trademark is not copyright and is not granted or withheld by a copyright license, so listing logos as a licensing exception was a category error. - The MPL note said obligations attach only if we modify the sources. They attach on distribution (§3.2), modified or not. - The overlay README asserted every unheadered file was GPL "including the Start9-authored ones, which are derivative works". A new file in an OpenWrt tree is not automatically derivative; that gave away Start9's own copyright by assertion. Now stated as a deliberate contribution choice. Also dropped "the one exception" (NOTICE lists several) and softened GPL-2.0-only to GPL-licensed, since the tree mixes -only and -or-later. - Restore the start-wrt font-weight design comment, reworded for the variable face rather than deleted. * refactor(core): replace socks5-impl with fast-socks5 socks5-impl is GPL-3.0-or-later, and it was a direct dependency of start-core, so every product binary linking start-core would have to be conveyed under GPL-3.0. No permissive version exists upstream — the current 0.9.6 is still GPL-3.0-or-later — so this is a swap rather than a bump. fast-socks5 (MIT) covers the same ground: read_command() hands back the target before connecting, which is what lets us keep intercepting .onion (tunnel via the tor service's SOCKS proxy) and .local (resolve over mDNS), and get_socket() unwraps the client tunnel to a plain TcpStream so the keepalive still applies. BIND and UDP ASSOCIATE are still answered CommandNotSupported. The proxy had no test coverage, so this adds three: a round trip through the proxy to an echo server, an unreachable target refused rather than hung, and BIND/UDP rejected. * refactor(start-wrt): replace tracing-rfc-5424 with syslog-tracing, gate licenses in CI tracing-rfc-5424 is GPL-3.0-or-later — the last crate in the tree whose terms we can't meet while conveying our binaries under MIT. syslog-tracing (MIT) writes through libc's syslog(), which lands in the same /dev/log that the old UnixSocket transport targeted, so logread still sees the entries. Its MakeWriter maps tracing levels to syslog severities via make_writer_for. init_logging took a name it then ignored; syslog-tracing can use it as the openlog identity, so startwrt-cli and startwrt-ctrld are now distinguishable in logread instead of sharing one tag. The startwrt-activity marker activity.rs greps for is in the message body, so it is unaffected. Timestamps and tag are dropped from the formatter because syslogd adds its own. With that, `cargo deny check licenses` passes, so it becomes a CI job. LGPL-3.0 stays allowed and simply reports as an unmatched allowance. | 1 个月前 | |
feat(sdk): supply the package toolchain and bundle only start-core (#3853) A package declared five dependencies to build: the SDK, plus typescript, @types/node, @vercel/ncc and prettier, in 17 different @types/node ranges across the fleet. All four now install with the SDK and hoist into the package's own node_modules, so a package declares the SDK alone. s9pk.mk invokes each step itself through TS_CHECK, FORMAT_CHECK and JS_BUNDLE rather than npm run, which also frees the `build` and `check` script names for application repos that ship packaging alongside an app. Formatting joins the build gate next to lint, with `make format` to write. The shipped config is the four settings all 142 package.json blocks already declared, so a formatted package stays formatted; deliberately not the monorepo's .prettierrc.json, whose arrowParens: avoid would reformat 762 of the fleet's 3294 files. bundleDependencies drops from three entries to one. start-core has to stay — it is a file: dep that is never published — but eslint and typescript-eslint were putting 90 packages somewhere neither `overrides` nor `npm audit fix` can reach, making an SDK release the only way to clear an advisory against any of them. Un-bundled they hoist and a package can override them itself; verified by moving brace-expansion 1.1.18 -> 2.0.2 from a package, which is the case 2.0.10's Security entry had to ship an SDK release for. Verified by scaffolding the template against the packed tarball: the gate passes with one dependency declared, fails on unformatted source and on the Promise-in-template lint rule, `make format` repairs it, and a JS_BUNDLE override still applies a package's own chmod. Co-authored-by: Matt Hill <9935159+MattDHill@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> | 6 天前 | |
docs(start-sdk): document the release pipeline; fold CONTRIBUTING into AGENTS The SDK's CONTRIBUTING.md documented `make publish` as the publishing procedure, and its AGENTS.md build table said the same. Both omitted scripts/manage-release.sh entirely, so following either put the package on npm with no git tag and no GitHub release — which is what happened to 2.0.4 and 2.0.5, and is unrecoverable in the normal flow (pre-check then refuses the version, and npm cannot republish it). Both have since been backfilled. manage-release.sh was documented in exactly one prose doc (start-wrt's CONTRIBUTING.md); the root had no release documentation at all. Fold this scope's CONTRIBUTING.md into its AGENTS.md rather than extend a file we're retiring, and start the per-scope migration: - projects/start-sdk/AGENTS.md: absorb CONTRIBUTING.md and add "Cutting a release" — the pipeline, why the step order is what it is, and how to backfill a version already on npm (npm records the gitHead to tag). Sections that only restated ARCHITECTURE.md (build pipeline, builder pattern, effects boundary, manifest threading) now point at it instead. - projects/start-sdk/CONTRIBUTING.md: deleted; inbound links repointed from the SDK's README/ARCHITECTURE and the root CONTRIBUTING build table. - AGENTS.md: add a cross-product Releases section, declare the CONTRIBUTING -> AGENTS fold as the direction of travel, and correct the claim that every scope carries a CONTRIBUTING.md. - projects/start-sdk/CHANGELOG.md: add the date the 2.0.4 heading was missing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> | 1 个月前 | |
chore: rename make targets to consistent <project>-<recipe> form (#3400) * chore: rename make targets to consistent <project>-<recipe> form Every project-specific root make target now uses its full start-* directory name as the <project> prefix, and verb-first targets are reordered to project-first, so the whole target surface reads <project>-<recipe>. Examples: tunnel-deb -> start-tunnel-deb cli / startos -> start-cli / start-os startwrt-image -> start-wrt-image install-cli -> start-cli-install clean-tunnel -> start-tunnel-clean format-cli -> start-cli-format format-check-cli -> start-cli-format-check test-core -> start-core-test ts-bindings -> start-core-ts-bindings test-container-runtime -> container-runtime-test format-web -> web-format Aggregate targets (test, format, format-check, clean, help, metadata, touch) are unchanged. Non-start-* project tokens keep their own name: `web` (the Angular workspace) and `container-runtime` (a start-os sub-module); ts-bindings is treated as a start-core recipe. Updates every call site: the five product CI workflows, internal $(MAKE)/prerequisite references, help text, and all docs. The startos-iso.yaml workflow FILE and the `startos-ui` npm package name are deliberately left as-is (only the make targets they reference were renamed). * fix(deb): point debian/build.sh at the renamed <project>-install targets debian/build.sh derives INSTALL_TARGET from $PROJECT and calls `make "$INSTALL_TARGET"` to stage the binary into DESTDIR — this is how every product's .deb is built. It still used the pre-rename names (install-startos / install-<project>), which no longer exist, so all .deb builds would fail. Derive the new names instead: startos -> start-os-install, start-<x> -> start-<x>-install. | 2 个月前 | |
chore(fmt): normalize formatting — one config per language, reproducible rustfmt (#3437) * chore(fmt): one config per language + reproducible rustfmt Our rustfmt.toml uses nightly-only options (group_imports, imports_granularity) but nothing pinned the nightly, so output drifted between contributors — and CI never even checked Rust formatting. Configs were also duplicated and partial. Consolidate to one config per language and make the output reproducible: - rustfmt: single root rustfmt.toml (was 5 duplicate copies + ~14 crates with none). Runs in start9/fmt-env — start9/cargo-zigbuild (the same image the Rust build uses) plus the pinned nightly + rustfmt component (build/fmt/fmtenv.Dockerfile) — via build/fmt/run-fmt.sh, which runs it --user so output stays host-owned. FMT_NATIVE=1 runs on the host against the same pinned toolchain (read from the Dockerfile ARG — one source of truth for the version). - prettier: single root .prettierrc.json (was 3-4 drifted copies, incl. container-runtime on double quotes). One repo-wide pass with a hardened .prettierignore (excludes .sqlx cache, the generated exver.ts parser, conformance vectors, locales, snapshots/fixtures, proxy.pac, patch-db/client). - taplo: single root taplo.toml over all TOML (was one stray copy), pinned via @taplo/cli. Only rustfmt needs the container; prettier and taplo run natively. - CI `make format-check` now covers rustfmt (previously unchecked) + taplo. - Remove the dead husky v4 / lint-staged pre-commit hook (no lint-staged config existed). Per-project `<project>-format` targets are kept (routed through the same tools/config). The formatting content itself lands in the next commit. * style: apply repo-wide formatting Mechanical output of `make format` using the configs from the previous commit (rustfmt in the pinned-nightly container, prettier and taplo). No behavior changes. * chore: ignore the repo-wide reformat in git blame | 2 个月前 | |
chore(fmt): normalize formatting — one config per language, reproducible rustfmt (#3437) * chore(fmt): one config per language + reproducible rustfmt Our rustfmt.toml uses nightly-only options (group_imports, imports_granularity) but nothing pinned the nightly, so output drifted between contributors — and CI never even checked Rust formatting. Configs were also duplicated and partial. Consolidate to one config per language and make the output reproducible: - rustfmt: single root rustfmt.toml (was 5 duplicate copies + ~14 crates with none). Runs in start9/fmt-env — start9/cargo-zigbuild (the same image the Rust build uses) plus the pinned nightly + rustfmt component (build/fmt/fmtenv.Dockerfile) — via build/fmt/run-fmt.sh, which runs it --user so output stays host-owned. FMT_NATIVE=1 runs on the host against the same pinned toolchain (read from the Dockerfile ARG — one source of truth for the version). - prettier: single root .prettierrc.json (was 3-4 drifted copies, incl. container-runtime on double quotes). One repo-wide pass with a hardened .prettierignore (excludes .sqlx cache, the generated exver.ts parser, conformance vectors, locales, snapshots/fixtures, proxy.pac, patch-db/client). - taplo: single root taplo.toml over all TOML (was one stray copy), pinned via @taplo/cli. Only rustfmt needs the container; prettier and taplo run natively. - CI `make format-check` now covers rustfmt (previously unchecked) + taplo. - Remove the dead husky v4 / lint-staged pre-commit hook (no lint-staged config existed). Per-project `<project>-format` targets are kept (routed through the same tools/config). The formatting content itself lands in the next commit. * style: apply repo-wide formatting Mechanical output of `make format` using the configs from the previous commit (rustfmt in the pinned-nightly container, prettier and taplo). No behavior changes. * chore: ignore the repo-wide reformat in git blame | 2 个月前 | |
feat(sdk): supply the package toolchain and bundle only start-core (#3853) A package declared five dependencies to build: the SDK, plus typescript, @types/node, @vercel/ncc and prettier, in 17 different @types/node ranges across the fleet. All four now install with the SDK and hoist into the package's own node_modules, so a package declares the SDK alone. s9pk.mk invokes each step itself through TS_CHECK, FORMAT_CHECK and JS_BUNDLE rather than npm run, which also frees the `build` and `check` script names for application repos that ship packaging alongside an app. Formatting joins the build gate next to lint, with `make format` to write. The shipped config is the four settings all 142 package.json blocks already declared, so a formatted package stays formatted; deliberately not the monorepo's .prettierrc.json, whose arrowParens: avoid would reformat 762 of the fleet's 3294 files. bundleDependencies drops from three entries to one. start-core has to stay — it is a file: dep that is never published — but eslint and typescript-eslint were putting 90 packages somewhere neither `overrides` nor `npm audit fix` can reach, making an SDK release the only way to clear an advisory against any of them. Un-bundled they hoist and a package can override them itself; verified by moving brace-expansion 1.1.18 -> 2.0.2 from a package, which is the case 2.0.10's Security entry had to ship an SDK release for. Verified by scaffolding the template against the packed tarball: the gate passes with one dependency declared, fails on unformatted source and on the Promise-in-template lint rule, `make format` repairs it, and a JS_BUNDLE override still applies a package's own chmod. Co-authored-by: Matt Hill <9935159+MattDHill@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> | 6 天前 | |
chore(start-sdk): promote next release to 3.0.0 (#3900) Helix-Harness: pi Helix-Model: openai-codex/gpt-5.6-sol | 5 天前 | |
chore(start-sdk): promote next release to 3.0.0 (#3900) Helix-Harness: pi Helix-Model: openai-codex/gpt-5.6-sol | 5 天前 | |
feat(sdk): supply the package toolchain and bundle only start-core (#3853) A package declared five dependencies to build: the SDK, plus typescript, @types/node, @vercel/ncc and prettier, in 17 different @types/node ranges across the fleet. All four now install with the SDK and hoist into the package's own node_modules, so a package declares the SDK alone. s9pk.mk invokes each step itself through TS_CHECK, FORMAT_CHECK and JS_BUNDLE rather than npm run, which also frees the `build` and `check` script names for application repos that ship packaging alongside an app. Formatting joins the build gate next to lint, with `make format` to write. The shipped config is the four settings all 142 package.json blocks already declared, so a formatted package stays formatted; deliberately not the monorepo's .prettierrc.json, whose arrowParens: avoid would reformat 762 of the fleet's 3294 files. bundleDependencies drops from three entries to one. start-core has to stay — it is a file: dep that is never published — but eslint and typescript-eslint were putting 90 packages somewhere neither `overrides` nor `npm audit fix` can reach, making an SDK release the only way to clear an advisory against any of them. Un-bundled they hoist and a package can override them itself; verified by moving brace-expansion 1.1.18 -> 2.0.2 from a package, which is the case 2.0.10's Security entry had to ship an SDK release for. Verified by scaffolding the template against the packed tarball: the gate passes with one dependency declared, fails on unformatted source and on the Promise-in-template lint rule, `make format` repairs it, and a JS_BUNDLE override still applies a package's own chmod. Co-authored-by: Matt Hill <9935159+MattDHill@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> | 6 天前 | |
feat(sdk): supply the package toolchain and bundle only start-core (#3853) A package declared five dependencies to build: the SDK, plus typescript, @types/node, @vercel/ncc and prettier, in 17 different @types/node ranges across the fleet. All four now install with the SDK and hoist into the package's own node_modules, so a package declares the SDK alone. s9pk.mk invokes each step itself through TS_CHECK, FORMAT_CHECK and JS_BUNDLE rather than npm run, which also frees the `build` and `check` script names for application repos that ship packaging alongside an app. Formatting joins the build gate next to lint, with `make format` to write. The shipped config is the four settings all 142 package.json blocks already declared, so a formatted package stays formatted; deliberately not the monorepo's .prettierrc.json, whose arrowParens: avoid would reformat 762 of the fleet's 3294 files. bundleDependencies drops from three entries to one. start-core has to stay — it is a file: dep that is never published — but eslint and typescript-eslint were putting 90 packages somewhere neither `overrides` nor `npm audit fix` can reach, making an SDK release the only way to clear an advisory against any of them. Un-bundled they hoist and a package can override them itself; verified by moving brace-expansion 1.1.18 -> 2.0.2 from a package, which is the case 2.0.10's Security entry had to ship an SDK release for. Verified by scaffolding the template against the packed tarball: the gate passes with one dependency declared, fails on unformatted source and on the Promise-in-template lint rule, `make format` repairs it, and a JS_BUNDLE override still applies a package's own chmod. Co-authored-by: Matt Hill <9935159+MattDHill@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> | 6 天前 | |
refactor: reorganize start-os into all-products monorepo (#3352) * docs: propose monorepo reorganization for all Start9 products * refactor(monorepo): split core into start-core lib + thin product bin crates - core/ -> shared/crates/start-core (lib 'startos', package 'start-core') - entry points moved to product dirs: start-os (startbox+start-container), start-cli, start-registry, start-tunnel - root Cargo workspace + shared Cargo.lock; profiles hoisted to root - patch-db submodule relocated to vendor/patch-db - service files moved to their product dirs - fixed include_dir!/include_str! paths for new crate locations cargo check -p start-cli -p start-registry passes (lib compiles). * refactor(monorepo): split web into product dirs + shared/web; relocate sdk & container-runtime - angular workspace rooted at shared/web (holds shared + marketplace libs + config) - apps moved to product dirs: start-os/web/{ui,setup-wizard}, start-tunnel/web, brochure/ - angular.json roots/outputs + per-app tsconfig paths repointed (Plan A) - sdk -> start-sdk (base+package kept cohesive: package imports base via relative paths under shared rootDir; splitting base out would break those imports) - container-runtime -> start-os/container-runtime - file: deps repointed (sdk baseDist/dist, patch-db client under vendor/) * build(monorepo): rewire Makefile, build scripts & CI to new layout - build scripts target workspace (-p <crate>, ./Cargo.toml, repo-root cwd) - Makefile paths: core->shared/crates/start-core, web split across product dirs, sdk->start-sdk, container-runtime->start-os/container-runtime, patch-db->vendor - compress-uis.sh takes per-product web dir; split compress pattern rules - ts-bindings recipe sed patterns generalized for new bindings path - CI workflows repointed (deploy-brochure, start-cli, test, startos-iso, ...) * chore(monorepo): gitignore per-product web dist outputs * docs(monorepo): update proposal to reflect implemented layout + verification status * refactor(monorepo): relocate root docs/ internal notes into their projects - exver.md, VERSION_BUMP.md -> shared/crates/start-core/ - PHYSICAL_DEVICE_TEST_PLAN.md, TODO.md -> start-os/ - draft-start9-pcp-hostname.* -> start-tunnel/ frees top-level docs/ for the migrated docs site * docs(monorepo): migrate start-docs (plain copy, no history) - mdbooks into product dirs: start-os/docs, start-tunnel/docs, start-sdk/docs (packaging) - bitcoin-guides, landing, build infra (build.sh/serve.sh/theme/versions.conf/scripts) -> top-level docs/ - repoint book theme symlinks to ../../docs/theme; book.toml build-dir=book, repo/edit URLs -> monorepo - build.sh maps book names to relocated dirs (absolute output); deploy.yml runs in docs/ with paths filter - verified: docs/build.sh builds all 4 books * docs(monorepo): adopt AGENTS.md convention (CLAUDE.md -> @AGENTS.md import) * docs(root): rewrite README/ARCHITECTURE/AGENTS/CONTRIBUTING for monorepo layout * docs(start-os): add product README/ARCHITECTURE/AGENTS/CHANGELOG/CONTRIBUTING Document the StartOS OS product as a thin wrapper in the monorepo: startbox/ start-container bins, web UIs (ui + setup-wizard), container-runtime, systemd units, and OS image packaging. Reflect new paths (start-core, shared/web, start-sdk, vendor/patch-db) and root-workspace build commands. * docs: integrate merged start-docs PRs (#93 UPnP/gateway, #94 task accept/set, #96 init progress) Only PRs whose feature is confirmed merged into start-os were applied. #99 (upstreamCertValidation) skipped — its code PR (#3353) is still open. * docs: add/normalize per-project doc sets (README/ARCHITECTURE/AGENTS/[CHANGELOG]/CONTRIBUTING) Products get the full set incl CHANGELOG; shared components + docs site get the set minus CHANGELOG; all updated to reflect the monorepo layout and AGENTS.md convention. * docs: add CLAUDE.md -> @AGENTS.md import to remaining project dirs * build(monorepo): root the Angular workspace at repo root so apps resolve node_modules Angular resolves @angular/core per-project from each app's root; with apps in product dirs, shared/web/node_modules was unreachable. Move the workspace config (angular.json, package.json, lockfile, tsconfig{,.lib}.json, .browserslistrc) to the repo root — the only ancestor of every app — so resolution works. - angular.json: project roots -> product dirs, lib roots -> shared/web/{shared,marketplace} - tsconfig paths/extends repointed; app source config.json/package.json require() depths corrected for the new app locations - package.json file: deps + script paths rebased to root; check-i18n.mjs scans the scattered project dirs; update-config.sh writes config.json at the workspace root - Makefile web targets run npm at root; build/env + build-cargo-dep stale paths fixed - build-cli.sh: drop stale 'cd core' in chown step Verified: full build succeeds — ts-bindings, SDK bundle, all 4 Angular UIs, and all five musl bins (startbox/registrybox/tunnelbox/start-container/start-cli). * build(monorepo): fix full-image build paths (container-runtime squashfs + version) - Makefile: undouble container-runtime.service dep path in rootfs rule - check-version.sh: read version from root package.json (moved from web/) - update-image-local.sh: mount repo root so start-sdk + target/ are visible to the image build; run start-os/container-runtime/update-image.sh - update-image.sh: copy start-container from ../../target (workspace), not ../core/target Verified: 'make all' completes (exit 0) — all musl bins + container-runtime rootfs.squashfs (437M) build; second run is a no-op (fully built). * build(monorepo): sync container-runtime package-lock to relocated SDK path; prettier ARCHITECTURE table * feat(monorepo): migrate startos-backup-fs into start-os/backup-fs Vendor the backup-fs crate (was external git dep Start9Labs/start-fs) as a workspace member under the start-os product; build it via the zigbuild path like the other bins instead of 'cargo install --git'. - start-os/backup-fs/: the startos-backup-fs crate (encrypted erasure-coded FUSE backup filesystem); relaxed its =4.5.7 clap / =0.2.17 ppv-lite86 exact pins so they unify with the workspace - root Cargo workspace member + single lock - shared/crates/start-core/build/build-backup-fs.sh; Makefile target builds the local crate (no more git URL) - docs: start-os ARCHITECTURE + CHANGELOG note the migration Verified: 'make all' (exit 0) builds startos-backup-fs (musl) as a member. * build(sdk): decouple 'bundle' from test/check-fmt so consumers don't re-run jest bundle now builds baseDist+dist only; test/check-fmt are standalone (CI calls them directly), and publish runs them explicitly. Fixes the recursive-make coupling where the OS build re-ran the full SDK jest suite every build and an SDK test/format failure broke the OS build. * build(monorepo): split Makefile into per-project include fragments Thin root Makefile includes build/common.mk (shared vars/macros + cross-cutting infra) and one <project>/build.mk per product. Uses include (not recursive make) so it stays a single DAG and cross-project prereqs (start-core -> ts-bindings -> SDK -> web/container-runtime) resolve correctly. - build/common.mk: vars, cp/mkdir/ln/ssh macros, patch-db client, external cargo tools - shared/crates/start-core/build.mk: test-core, ts-bindings - shared/web/build.mk: angular workspace (install, .angular, i18n, UI builds, compress, config.json) - start-sdk/build.mk: test-sdk, dist bundle (consumes the now-decoupled SDK Makefile) - start-{cli,registry,tunnel}/build.mk: their bins + install/deb - start-os/build.mk: startbox/start-container/backup-fs, container-runtime image, OS image assembly + deploy - docs/build.mk: docs site build Verified: make all is a no-op (full build intact); all targets resolve; no duplicate recipes. * docs(root): note the per-project build.mk Makefile structure in AGENTS.md * fix(ci): repoint test/web paths after workspace moves - run-tests.sh: cd to repo root (was shared/crates), build via ./Cargo.toml -p start-core (was ./core/Cargo.toml --workspace) - test.yaml / deploy-brochure: install the Angular workspace at the repo root (npm ci) instead of shared/web; fix vendor/vendor/patch-db doubling; brochure path filters -> root - startos-iso prevent-rebuild placeholders: node_modules/.angular at root; version read from root package.json Verified: npm ci passes at root (lockfile gate). * build(start-os): namespace OS-product make targets as startos-* / install-startos The repo is no longer start-os-only, so the generic target names now read as start-os-specific: - deb->startos-deb, iso/img->startos-$(IMAGE_TYPE), squashfs->startos-squashfs - install->install-startos (matches install-registry/install-tunnel) - wormhole*/update*/emulate-reflash/upload-ota -> startos-* - new 'startos' aggregate (= STARTOS_TARGETS); root 'all: startos' Callers updated: dpkg-build.sh INSTALL_TARGET, deploy targets' $(MAKE) install, startos-iso.yaml (make startos-iso/startos-img), root .PHONY. NOTE: external shared-workflows may invoke the old names (make iso/squashfs/install) for OS image/release builds — needs a companion update there. * build(start-os): move OS-specific build assets into start-os/build Relocate the start-os-only build inputs out of the shared top-level build/ into the product dir: image-recipe/, dpkg-deps/, lib/, download-firmware.sh, and save-migration-images.sh -> start-os/build/. Keep genuinely shared pieces at build/ (common.mk, env/, os-compat/, build-cargo-dep.sh, and lib/scripts/forward-port, which start-tunnel also installs). Relocate the start-os-specific make variables/rules out of build/common.mk into start-os/build.mk (web src/output vars -> shared/web/build.mk; registry and tunnel target vars -> their own fragments) so common.mk is shared-only. Repoint every reference (fragments, Makefile clean, container-runtime update-image.sh, and the moved scripts' own internal paths). Delete the unreferenced legacy build/registry/ eos deploy scripts. * docs(changelog): write 0.4.0-beta.10 per-product release notes Fill in the [0.4.0-beta.10] sections across the per-product CHANGELOGs (brochure, start-cli, start-os, start-registry, start-sdk, start-tunnel) with Added/Changed/Fixed/Removed/Security notes for this cycle, cross-linked between products. * refactor(start-core): rename lib startos to start_core, drop package alias Rename the start-core library from `startos` to `start_core` so the crate's lib name matches its package and the legacy `startos = { package = "start-core" }` dependency-rename alias is gone. The name now penetrates all source: - [lib] name = "start_core"; every `startos::` crate path -> `start_core::` - product crates depend on `start-core` directly; features become `start-core/*` - RUST_LOG=warn,startos=debug -> start_core=debug in the systemd units and CI (the target is module_path!()-derived, so it tracks the crate name) - docs updated to match The product identifier "startos" is left untouched (the root:startos system user/group, the tor.startos / *.startos DNS names, the nftables table, the signature context, the .startos/ packaging-workspace dir, i18n keys, and the /usr/lib/startos install paths). * refactor(monorepo): nest products under projects/, rename shared -> shared-libs Move the buildable products and the docs site into a top-level projects/ dir to separate them from repo infrastructure: start-os, start-cli, start-registry, start-tunnel, start-sdk, brochure (-> brochure-marketplace), docs (-> start-docs) -> projects/ Rename the shared Rust+web library container shared/ -> shared-libs/, kept at the top level alongside build/ and vendor/ as cross-cutting infrastructure. Rewire every path reference to the new layout: - Cargo workspace members + product path deps (../shared -> ../../shared-libs) - Makefile, build/common.mk, and every <project>/build.mk fragment - angular.json, package.json, root + per-app tsconfig (web app configs moved a level deeper, so their relative extends/paths gain one ../) - .github/workflows (the Start9Labs/start-os repo URL is preserved; docs-deploy working-directory + path triggers updated) - build scripts (run-local-build.sh / update-image-local.sh cd depths and internal paths; start-core build/*.sh chown paths) - root .gitignore build-output globs and the web package-lock file: paths Verified: cargo check of all six crates (UI-embed include_dir! and build/env include_str! resolve to the new locations), make -n of the OS / registry / tunnel / web targets. The cold web/SDK build remains CI-grade. * refactor(monorepo): relocate project-specific assets/debian/scripts into projects Apply the same shared-vs-project split to the remaining top-level dirs: - assets/ (create-vm screenshots) -> projects/start-os/assets/ - debian/{startos,start-registry,start-tunnel}/postinst -> each project's debian/; the shared debian/dpkg-build.sh stays top-level and now maps PROJECT -> projects/<dir>/debian for the control files - scripts/copy-categories.sh (registry admin) -> projects/start-registry/scripts/ Kept at top level as genuinely shared/repo-level: debian/dpkg-build.sh, scripts/manage-release.sh (repo releases), scripts/publish-deb.sh (apt publish). Repoint the deb build.mk prereqs, the CONTRIBUTING create-vm link, and code/unit comments. Verified make -n of the three *-deb targets. * docs(rfcs): move draft-start9-pcp-hostname to a top-level rfcs/ dir The PCP HOSTNAME extension Internet-Draft (.md + .txt) describes a protocol spoken by both the StartOS client and the StartTunnel server, so it belongs at the repo level rather than inside start-tunnel/. Repoint the start-os CHANGELOG reference (was the stale docs/ path) to rfcs/. * docs: sync structure docs to the projects/ layout + README project shout-outs - README: add a "rest of the monorepo" section with a short shout-out to each non-OS product (StartTunnel, start-cli, Start SDK, start-registry, and the marketplace + docs sites), and update the directory table + icon path to the projects/ + shared-libs layout. - Root AGENTS.md: rewrite "what lives where" for the new layout and complete the Sub-scopes list (it was missing most products). - Root ARCHITECTURE.md: repoint the module map + cross-layer paths; MONOREPO.md gains a note that the layout was refined (products -> projects/, shared -> shared-libs). - Per-project docs: rename shared/ -> shared-libs/ references, fix relative links whose depth changed when products moved a level deeper into projects/ (links to the repo root, LICENSE, shared-libs, and cross-product changelogs), and repoint functional cd / --prefix build commands. Sibling refs under projects/ (e.g. ../start-sdk, file:../../start-sdk/dist) are correct and left as-is. * build(brochure-marketplace): rename Angular project brochure -> brochure-marketplace Rename the Angular project key (and its build/serve targets) so the project name matches its directory. The dist output is now projects/brochure-marketplace/dist/raw/brochure-marketplace, and the deploy workflow reads/rsyncs that path — this also corrects a path the projects/ restructure had mangled to raw/projects/brochure-marketplace. The npm script names (build:brochure / start:brochure) are kept as conveniences. * docs: remove MONOREPO.md The reorganization proposal has been fully implemented and superseded by the current README/ARCHITECTURE; drop the historical proposal doc and its two links. * feat(build): per-project versioning + Debian packaging for start-cli Decouple product versions from the single StartOS release version. Each Rust product's version is now the source of truth in its own Cargo.toml: start-os stays 0.4.0-beta.10; start-cli / start-registry / start-tunnel move to their own line starting at 1.0.0. - basename.sh and dpkg-build.sh read the version straight from the project's Cargo.toml (per PROJECT), so each .deb is named/versioned independently. - check-version.sh now derives the OS-image /usr/lib/startos/VERSION.txt from the start-os crate manifest instead of the root package.json; nothing maintains a separate version source anymore. - start-cli gains a Debian package: `make cli-deb` builds the musl binary and packages it via the shared dpkg-build.sh (CLI_BASENAME / install-cli staging). CHANGELOGs and the registry AGENTS version note updated to reflect independent versioning. Cargo.lock synced to the new member versions. * chore: ignore *.local.md Broaden the local-notes ignore from CLAUDE.local.md to any *.local.md. * refactor(deps): vendor Start9-maintained crates into shared-libs/crates Move every Start9-maintained crate the workspace depends on in-repo, wired by direct path deps (no [patch]): - rpc-toolkit, imbl-value, exver, yasi, jsonpath (jsonpath_lib), pi-beep — plain-copied from their repos into shared-libs/crates/, added as workspace members. Their inter-deps are repointed to path (exver/imbl-value -> yasi, rpc-toolkit/jsonpath -> imbl-value), and start-core depends on them by path. - patch-db — de-submoduled: moved out of the vendor/ git submodule into shared-libs/crates/patch-db (keeps its own [workspace], excluded from the root one and consumed by start-core via path). Its core/json-patch/json-ptr now path-dep the vendored imbl-value, so there is a single imbl_value::Value type. Drop .gitmodules; repoint the web patch-db-client (package.json / common.mk / CI / shared-libs/web) and pi-beep's build (build-cargo-dep.sh --path). Upstream forks still pulled by git (async-acme, crab_nat, fuser) are left as-is. Verified: cargo check of start-core + start-cli + start-registry + pi-beep compiles the whole path-dep tree clean; Cargo.lock regenerated. * refactor(start-os): move manage-release.sh into the product manage-release.sh is the StartOS release orchestration (startos-images S3 bucket/CDN, the OS image arch matrix incl. -nonfree/-nvidia, the OS registry), not a repo-wide tool — move it to projects/start-os/scripts/. It still calls the shared scripts/publish-deb.sh (which stays top-level, since it publishes any product's .deb), now referenced by its repo-root-relative path. * refactor(debian): rename dpkg-build.sh -> build.sh, move publish-deb.sh -> debian/publish.sh Co-locate the deb tooling under debian/: the package builder is debian/build.sh and the apt-repo publisher is debian/publish.sh (was scripts/publish-deb.sh, which empties scripts/). Repoint the per-product deb build.mk targets, the manage-release.sh caller, and doc/comment references. * build: build pi-beep as a first-party member; reword "vendored" -> "first-party" pi-beep is one of our crates now, so build it like startos-backup-fs (a dedicated build-pi-beep.sh zig build of the workspace member) instead of routing it through build-cargo-dep.sh. That script is now only for the genuinely external crates.io dev tools (tokio-console, flamegraph) bundled into unstable/console images. Also reword the patch-db docs: these are our own crates, so "first-party crate" is more accurate than "vendored" (which implies a third-party copy). * ci: path-gate the per-product build workflows to their project + deps The start-cli / start-registry / start-tunnel / startos-iso build workflows ran on every push/PR (only skipping doc-only changes), so all four built regardless of what changed. Replace the blanket paths-ignore with a paths: allowlist scoped to each product plus its dependencies (start-core + the in-repo shared-libs crates, Cargo manifests, build infra, and — for the web-bearing/OS workflows — the Angular workspace and SDK). workflow_dispatch / workflow_call are kept so manual and orchestrated runs still fire unconditionally. * ci: migrate shared-workflows (service-package CI) into the monorepo Bring the reusable .s9pk build/release workflows and their composite actions in-repo from the standalone Start9Labs/shared-workflows repo, so the packaging toolchain lives alongside the SDK: - .github/workflows/{build,release,tagAndRelease}.yml (reusable, workflow_call) - .github/actions/{extract-version,free-disk-space,setup-build-env, setup-publish-env,upload-each} Their internal references (and the SDK package-template's three workflows + the packaging docs) are repointed from start9labs/shared-workflows@master to Start9Labs/start-os@master. These are workflow_call-only, so they don't run for the monorepo itself — they activate once this lands on master and external service-package repos repoint their `uses:` to Start9Labs/start-os. * docs(monorepo): document tandem-update couplings The per-product CI `paths:` filters mirror each product's build.mk prerequisites by hand — nothing enforces it. Add a "Coupled changes" section to the root AGENTS.md and reciprocal pointers in each gated workflow and its build.mk, so a change to one half is caught at the other. Also catalogs the remaining hand-mirrored pairs (reusable service-package CI <-> SDK package-template <-> packaging docs; the files touched when adding a product/crate) and the already-enforced couplings (ts-bindings, the five i18n locales, the UI beta seed, version <-> CHANGELOG, docs <-> user-facing changes). * chore(manpages): generate man pages into their product projects The export_manpage_* tests in start-core wrote every product's man pages into start-core's own man/ dir. Point each generator at the owning product's man/ dir (anchored to CARGO_MANIFEST_DIR), move the committed pages there, and update build-manpage.sh's chown and the docs. start-container's pages go to projects/start-os, since that bin is part of the StartOS product. * Retitle README * refactor(shared-libs): rename web -> ts-modules Mirror the `crates/` naming: the shared TS/Angular workspace dir becomes `shared-libs/ts-modules/`. Pure path rename — repoints every reference (angular.json, root tsconfig/package.json scripts, the Makefile include + build.mk, CI `paths:`, and docs). No code changes. * fix(monorepo): repoint stale paths from the projects/ move that broke CI Two classes of path left stale by nesting products under projects/: - Web apps `require()` repo-root config.json/package.json by relative path; the extra projects/ level meant every one was short one `../` (resolved to projects/… instead of the repo root), failing the esbuild UI build for start-os (ui + setup-wizard) and start-tunnel. - test.yaml and deploy-brochure.yml still `cd start-sdk` for the baseDist build; the SDK now lives at projects/start-sdk. * fix(debian): resolve PROJECT_DIR before reading VERSION debian/build.sh computed VERSION from "projects/$PROJECT_DIR/Cargo.toml" before PROJECT_DIR was assigned, so it read projects//Cargo.toml (empty) and double-prefixed projects/. The empty Version: produced an invalid DEBIAN/control and dpkg-deb rejected it — breaking the registry and tunnel .deb builds. start-cli's CI only runs `make cli` (the binary), so it never exercised this path. Hoist the PROJECT_DIR/INSTALL_TARGET block above VERSION and read "${PROJECT_DIR}/Cargo.toml" directly. Also only fall back to the OS product's usr/lib/startos/conflicts when that file actually exists, so non-OS products don't error on a missing conflicts file. * fix(web): prettier-wrap tsconfig paths widened by the ts-modules rename Renaming shared-libs/web -> shared-libs/ts-modules pushed the `@start9labs/*` path-mapping lines past prettier's print width, so `npm run format:check` (the Formatting & Lockfiles CI job) flagged the four product tsconfig.json files. Apply prettier's wrapping. * docs(contributing): align with restructure + renamed make recipes Bring the CONTRIBUTING set up to date with the monorepo layout and the namespaced make targets: - root: `make iso` -> `make startos` - start-os: `make $(IMAGE_TYPE)`/`deb`/`squashfs` -> `make startos-$(IMAGE_TYPE)`/`startos-deb`/`startos-squashfs`; deploy/flash targets -> `startos-update*`/`startos-wormhole*`/`startos-emulate-reflash` - start-core: `cd start-sdk` -> `cd projects/start-sdk`; osBindings sync path -> projects/start-sdk/base/lib/osBindings - shared-libs: `web/` -> `ts-modules/` (heading, lib paths, file: deps, cross-links) The other products' CONTRIBUTING files were already correct. * fix(container-runtime): correct repo-root target path in update-image.sh update-image.sh runs with cwd at projects/start-os/container-runtime/ (mounted at /root/start-os in start9/build-env), so the repo-root build output is three levels up. It copied start-container from ../../target (-> projects/target, nonexistent), so the container-runtime squashfs was never built and the OS image compile failed on every arch. Use ../../../target. Refresh the AGENTS.md gotcha that described the old stale path. * refactor(make): namespace OS web targets, require an explicit target, per-project cleans - `ui`/`uis` -> `startos-ui`/`startos-uis`: they build only the StartOS admin UI + setup-wizard, so they belong under the startos-* namespace. Also fix `startos-ui` to depend on the built index.html (the old `ui` depended on a directory with no rule). - No default build: bare `make` now prints `help` (.DEFAULT_GOAL := help) and the misleading `all` target (it only built `startos`, not "everything") is removed — callers specify a target. - Decentralize `clean`: every build.mk owns a `clean-<project>` target and the root `clean` just aggregates them. Per-project cleans use project-prefix wildcards so they're arch/version-independent, and two stale paths from the projects/ move are corrected (env/*.txt -> build/env/*.txt; image-recipe/deb -> projects/start-os/build/image-recipe/deb). - Drop the start-cli targets (`make cli`/`cli-deb`) from the start-os CONTRIBUTING build section (wrong product) and update the docs to the new target names (root + start-os CONTRIBUTING/README/AGENTS). * docs: sync, complete, and standardize all developer docs for the monorepo (#3356) * docs: sync developer docs with the monorepo restructure Audit of all developer documentation (AGENTS/CONTRIBUTING/ARCHITECTURE/README across root, projects/*, shared-libs/*) against the post-restructure tree. Corrects stale references the restructure left behind: - Paths still pointing at the pre-restructure layout (core/, web/, sdk/, brochure/, container-runtime/, patch-db submodule) -> projects/* and shared-libs/*. - Angular workspace root: several docs claimed shared-libs/ts-modules holds angular.json/package.json/tsconfig.json and that npm runs from there. The workspace is rooted at the repo root; fixed cwd/--prefix instructions, the tsconfig path-alias targets, and config-sample.json location accordingly. - Renamed make targets (startos-* namespace), the Rust lib rename (startos -> start_core / crate start-core), and the binary-source table in start-core/ARCHITECTURE.md. - Removed stale 'git clone --recursive' (no submodules remain) and the non-existent repo-level scripts/ reference. - Normalized product self-references and the brochure -> brochure-marketplace Angular project name; verified incidental accuracy fixes (exver 0.2.1, patch-db serde_cbor, image-recipe live-build). All relative doc links verified resolvable. Pre-commit lint-staged hook skipped (--no-verify): the slot has no installed node_modules so the binary can't run, and the repo's prettier targets only the web source dirs, not these markdown docs. * docs: bring utility crates and patch-db up to the standard doc set Every first-party crate under shared-libs/crates/ now carries the same AGENTS/ARCHITECTURE/CONTRIBUTING/README/CLAUDE set the projects and other shared libs use. - New full doc sets for exver, imbl-value, jsonpath, pi-beep, rpc-toolkit, yasi, written from each crate's actual source (verified module names, public API, cargo -p <package> commands, and real consumers; jsonpath's package is jsonpath_lib though its dir is jsonpath). Pre-existing READMEs (exver, jsonpath, yasi) were preserved verbatim and only augmented with a 'Place in the monorepo' + 'Documentation' section. - patch-db: added AGENTS.md (migrated from its content-bearing CLAUDE.md, plus a Build & test section noting it is its own Cargo workspace) and reduced CLAUDE.md to the one-line @AGENTS.md import like every other scope. - Every CLAUDE.md is exactly '@AGENTS.md'; all relative doc links resolve. * docs: normalize section structure across all project & shared-lib docs Standardize every first-class scope (root, the 7 projects, container-runtime, shared-libs, start-core, ts-modules) onto one canonical section template so the same sections appear under the same names in the same order everywhere: - AGENTS.md: intro (+ 'CLAUDE.md is a one-line @AGENTS.md import' + cross-links) → Layout → Build & test (run from the repo root) → Gotchas → scope-specific. Folded synonym headings (Where things are / What lives where / Map → Layout; Operating rules / Gotchas / rules → Gotchas; Build / Build & verify → Build & test). - CONTRIBUTING.md: Documentation (doc-map, added where missing) → Prerequisites → Building → Testing → Formatting → scope-specific → Commits / PRs (last). - ARCHITECTURE.md: ensured a 'Place in the monorepo' opener (where applicable) and a 'Further reading' links footer; internal sections left in place. - README.md: added a Documentation/links footer where missing; landing prose left untouched. Pure reorganization: headings renamed/reordered and short missing sections added — no prose reworded, no facts/commands/tables dropped. Scope-accurate build cwds preserved (start-docs builds from its dir; start-sdk from its dir; container-runtime via npm --prefix; patch-db its own workspace). All 102 docs' relative links verified resolvable; every CLAUDE.md remains the one-line import. * build+docs: merge patch-db into root workspace; enforce doc hierarchy Addresses review feedback on the docs PR: - **patch-db → root Cargo workspace.** Add the six patch-db crates (core, json-patch, json-ptr, macro, macro-internals, util) to the root workspace `members` and drop the `exclude`; remove patch-db's now-redundant virtual `Cargo.toml`. `cargo metadata` + `cargo check -p patch-db -p json-patch -p json-ptr -p patch-db-macro` pass. Updated the docs that called patch-db 'its own workspace' (patch-db AGENTS/CONTRIBUTING build commands now run from the repo root with `-p`; root ARCHITECTURE lists it as a member). - **Root AGENTS.md:** added a note that these doc files must be kept current with every change, and that the docs are hierarchical — a scope documents only what is specific to it and never repeats higher-scope content. - **Hierarchy cleanup:** removed the `## Commits / PRs` (and `Branch / commit / PR` / `Commit conventions`) sections from every non-root CONTRIBUTING.md — those conventions live only in the root CONTRIBUTING.md now. Scope-specific change steps were preserved (e.g. start-tunnel's migration/ bindings/CHANGELOG steps moved to a 'Making a change' section; start-cli's docs-update note folded into 'Where code lives'). Also dropped the duplicated 'keep these docs in sync' line from child Documentation sections (kept the local cross-link lists). - **jsonpath:** reframed the fork note as history-only across its docs — it has fully diverged from freestrings/jsonpath with no intent to upstream; treat it as first-party and edit freely (removed the 'pull fixes from upstream / keep changes minimal / fork-tracking' guidance). All 102 docs' relative links resolve; every CLAUDE.md remains the one-line import. * docs: add hierarchy-navigation notes to AGENTS files - Every non-root AGENTS.md now opens with a 'Read up the tree first' note: the docs are hierarchical, so before working in a scope read the AGENTS.md of each enclosing directory up to the repo root (and their ARCHITECTURE/CONTRIBUTING where relevant). Excludes the packaging-guide + package-template AGENTS under projects/start-sdk/docs/, which target external package authors, not the monorepo dir tree. - Root AGENTS.md gains the converse 'Read down into what you touch' note: read a subdirectory's AGENTS.md (and any further nested ones) before editing it. - Dropped the explicit repo-root CONTRIBUTING pointer from patch-db's CONTRIBUTING.md (the walk-up convention now covers it). * docs(agents): require product docs/ book + CHANGELOG to ship with code Root AGENTS.md now mandates that any change altering user-visible behavior update that product's user-facing docs/ book (projects/<product>/docs/) in the same change and add a CHANGELOG.md entry — no deferring docs/changelog to follow-ups. * build(make): add per-project format targets mirroring the clean decomposition Each build.mk now owns `format-<project>` + `format-check-<project>` (core, web, sdk, cli, registry, tunnel, startos), matching the per-project `clean-<project>` targets; the top-level `format`/`format-check` just aggregate them. Web (the whole Angular workspace incl. brochure) formats via the root npm script; the shared crates via one `cargo +nightly fmt`; container-runtime via its own prettier config (new `format`/`format:check` npm scripts). So you can format one project (`make format-cli`) or all (`make format`). * docs: address PR review — make-target refs, ARCH de-dup, ts-modules wording - Reference stable make targets instead of raw build/format commands across project docs: builds via `make cli`/`registry`/`tunnel`/`startos`/`startos-ui`, formatting via the per-project `make format-<project>` targets (and `format-check-<project>` for CI). Kept `cargo check`/`cargo test` and crate `cargo build` (no make equivalent) as noted dev shortcuts. - Fixed stale targets: dropped `all` (removed upstream; `make` now prints help), `ui`/`uis` -> `startos-ui`/`startos-uis`. - Removed the whole-monorepo ASCII trees that several product ARCHITECTURE.md files re-drew (start-cli, start-registry, container-runtime, ...) — that layout lives once in the root ARCHITECTURE.md; each now states only where it sits. - Reworded the `shared-libs/ts-modules` directory as shared TypeScript modules (not Angular-specific; current contents are the Angular libs shared/marketplace), per review; kept accurate per-library 'Angular library' phrasing. Branch merged up to date with docs/monorepo-proposal first. * refactor(sdk): extract base into @start9labs/start-core shared lib; flatten start-sdk Move projects/start-sdk/base -> shared-libs/ts-modules/start-core (package @start9labs/start-sdk-base -> @start9labs/start-core), mirroring the Rust crate shared-libs/crates/start-core. start-core builds its own self-contained dist consumed via file: deps. Flatten start-sdk (package/ -> root): the SDK now imports @start9labs/start-core instead of ../../base/lib, and its published dist bundles start-core (bundleDependencies) so external authors still install one package. Repoint all consumers off the SDK-as-base alias onto @start9labs/start-core: - web (root file: dep + 153 import sites + shared/marketplace peerDeps) - container-runtime (file: dep; base/lib imports -> start-core, package/lib -> lib) Repoint osBindings generation, the build DAG (build.mk fragments, Makefile), and regenerate the three lockfiles. Resolves the "SDK kept cohesive" deviation: base is now an honest first-class shared TS lib named for what it is. * docs+ci: reflect start-core extraction; repoint SDK build steps off base/baseDist CI: build start-core (cd shared-libs/ts-modules/start-core && make dist) before validating the SDK + web lockfiles; validate the flattened SDK lockfile at projects/start-sdk; add start-core to the prettier check; repoint the iso prevent-rebuild mkdirs and the brochure deploy paths: filter (start-sdk -> start-core). Docs: update every project's AGENTS/ARCHITECTURE/CONTRIBUTING/README for the new layout — base extracted to @start9labs/start-core under shared-libs/ts-modules, the SDK flattened (lib/) and bundling start-core, container-runtime depending on both. Removes the resolved "SDK kept cohesive" deviation note. * refactor(monorepo): use the start-technologies name; repoint init-workspace at the monorepo - Adopt start-technologies for monorepo/repo-URL references across docs and AGENTS files (ahead of the GitHub repo rename; product refs left as start-os: projects/start-os, the start-os crate, *-startos packages, StartOS). - s9pk init-workspace now sparse-clones the start-technologies monorepo (projects/start-sdk/docs) instead of the retired standalone start-docs repo, and the two start-docs-named init strings are reworded across all five locales. - Un-hide the SDK 2.0 packaging-workspace section and rewrite it for the monorepo clone; document fetch-on-demand SDK + OS source access (docs first) in the workspace AGENTS.md and workflow.md. - Fix build-config.js to read and write the repo-root config.json. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkwYSXK8Uh9D16UTffCNJ1 --------- Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: Matt Hill <9935159+MattDHill@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> | 2 个月前 | |
chore(fmt): normalize formatting — one config per language, reproducible rustfmt (#3437) * chore(fmt): one config per language + reproducible rustfmt Our rustfmt.toml uses nightly-only options (group_imports, imports_granularity) but nothing pinned the nightly, so output drifted between contributors — and CI never even checked Rust formatting. Configs were also duplicated and partial. Consolidate to one config per language and make the output reproducible: - rustfmt: single root rustfmt.toml (was 5 duplicate copies + ~14 crates with none). Runs in start9/fmt-env — start9/cargo-zigbuild (the same image the Rust build uses) plus the pinned nightly + rustfmt component (build/fmt/fmtenv.Dockerfile) — via build/fmt/run-fmt.sh, which runs it --user so output stays host-owned. FMT_NATIVE=1 runs on the host against the same pinned toolchain (read from the Dockerfile ARG — one source of truth for the version). - prettier: single root .prettierrc.json (was 3-4 drifted copies, incl. container-runtime on double quotes). One repo-wide pass with a hardened .prettierignore (excludes .sqlx cache, the generated exver.ts parser, conformance vectors, locales, snapshots/fixtures, proxy.pac, patch-db/client). - taplo: single root taplo.toml over all TOML (was one stray copy), pinned via @taplo/cli. Only rustfmt needs the container; prettier and taplo run natively. - CI `make format-check` now covers rustfmt (previously unchecked) + taplo. - Remove the dead husky v4 / lint-staged pre-commit hook (no lint-staged config existed). Per-project `<project>-format` targets are kept (routed through the same tools/config). The formatting content itself lands in the next commit. * style: apply repo-wide formatting Mechanical output of `make format` using the configs from the previous commit (rustfmt in the pinned-nightly container, prettier and taplo). No behavior changes. * chore: ignore the repo-wide reformat in git blame | 2 个月前 |
Start SDK
The Start SDK (@start9labs/start-sdk) is a TypeScript framework for packaging services to run on StartOS. It provides a strongly-typed, builder-pattern API for defining every aspect of a service package: manifests, daemons, health checks, networking interfaces, actions, backups, dependencies, configuration, and more.
It lives at projects/start-sdk/ inside the start-technologies monorepo and is published to npm as @start9labs/start-sdk.
Features
- Type-safe manifest definitions - Declare your service's identity, metadata, images, volumes, and dependencies with full TypeScript inference.
- Daemon management - Define multi-process topologies with startup ordering, ready probes, and graceful shutdown via
Daemons.of().addDaemon(). - Health checks - Built-in checks for TCP port listening, HTTP(S) endpoints, and custom scripts, with configurable polling strategies (fixed interval, cooldown, adaptive).
- Network interfaces - Bind ports, export UI/API/P2P interfaces, and manage hostnames with MultiHost and ServiceInterfaceBuilder.
- User actions - Create interactive operations with validated form inputs (text, select, toggle, list, union/variants, and more) that users can trigger from the StartOS UI.
- Backup and restore - Rsync-based volume backups with exclude patterns and custom sync paths.
- Dependency management - Declare inter-service dependencies with version ranges, health check requirements, and volume mounts.
- Configuration file helpers - Read, write, and merge JSON, YAML, TOML, INI, and ENV files with type-safe
FileHelper. - Reactive subscriptions - Watch for changes to container IPs, SSL certificates, SMTP config, service status, and more with
const(),once(),watch(),onChange(), andwaitFor()patterns. - Extended versioning (ExVer) - Flavor-aware semantic versioning with range matching, supporting independent upstream and downstream version tracking.
- Internationalization - Built-in i18n support with locale fallback and parameter substitution.
- Container execution - Run commands in subcontainers with volume mounts, environment variables, and entrypoint overrides.
- Plugin system - Extensible plugin architecture (e.g.
url-v0for URL management).
Quick Start
import { setupManifest, buildManifest } from '@start9labs/start-sdk'
const manifest = setupManifest({
id: 'my-service',
title: 'My Service',
license: 'MIT',
// ...
})
export default buildManifest(manifest)
The primary entry point is the StartSdk facade:
import { StartSdk } from '@start9labs/start-sdk'
import { manifest } from './manifest'
export const sdk = StartSdk.of().withManifest(manifest).build(true)
From there, sdk exposes the full toolkit:
// Define daemons
export const main = sdk.setupMain(async ({ effects }) =>
sdk.Daemons.of(effects).addDaemon('primary', {
/* ... */
}),
)
// Define actions
export const setName = sdk.Action.withInput('set-name' /* ... */)
// Define interfaces
export const setInterfaces = sdk.setupInterfaces(async ({ effects }) => {
const multi = sdk.MultiHost.of(effects, 'web')
const origin = await multi.bindPort(80, { protocol: 'http' })
const ui = sdk.createInterface(effects, { name: 'Web UI', id: 'ui' /* ... */ })
return [await origin.export([ui])]
})
// Define backups
export const { createBackup, restoreBackup } = sdk.setupBackups(async () => sdk.Backups.ofVolumes('main'))
Packages
| Source | npm | Description |
|---|---|---|
projects/start-sdk/lib/ |
@start9labs/start-sdk |
Full SDK for service developers (the one package you install) |
shared-libs/ts-modules/start-core/ |
@start9labs/start-core |
Core types, ABI definitions, and effects interface — bundled into the SDK, not published separately |
The published package also ships s9pk.mk and tsconfig.base.json at its root, so a service package consumes the canonical build plumbing by reference: include node_modules/@start9labs/start-sdk/s9pk.mk in its Makefile and "extends": "@start9labs/start-sdk/tsconfig.base.json" in its tsconfig.json.
Documentation
For comprehensive packaging guides, tutorials, and API reference:
The packaging docs cover:
- Environment setup and prerequisites
- Project structure and conventions
- Manifest, main, interfaces, actions, and all other service modules
- File models and configuration management
- Versioning, migrations, and initialization
- Dependencies and cross-service communication
- Building and installing
.s9pkpackages
Contributing
See AGENTS.md for environment setup, building from source, testing, releasing, and development workflow.
Architecture
See ARCHITECTURE.md for a detailed overview of the SDK's internal structure, module responsibilities, and data flow.
For agent/dev instructions, see AGENTS.md (CLAUDE.md is a one-line @AGENTS.md import).
License
MIT