docs(scaffold): add a Logos Scaffold section for the module - #442
Conversation
dev loop Adds a new `scaffold` docs section covering how to work with logos-scaffold when developing Logos modules against Basecamp: - About Logos Scaffold (concept): command surface, project layout, profiles, and the boundaries against logos-module-builder. - Develop a Logos module with Logos Scaffold (procedure): install, project setup, module capture, install, launch, and the rebuild -> reinstall -> restart iteration loop, two-instance testing with profiles or --user-dir, and portable builds. - Troubleshoot Logos module development with Basecamp (troubleshooting): symptom-to-fix coverage for the failures that build cleanly and misbehave at runtime, including the macOS 104-byte socket path limit, unnamed QML module imports, untracked files missing from a flake build, and dependency/pin resolution. Wires the section into the Explore dropdown and the Build an app journey, and points the ecosystem repository table at the canonical logos-scaffold repository. Co-authored-by: Cursor <cursoragent@cursor.com>
…boko/scaffold-docs
… 7c2578d Reviews the scaffold section against the five scaffold commits landed since it was written (#244, #245, #246, #247, #249) and against the canonical repository name. Corrections: - The repository is `logos-co/scaffold`; `logos-co/logos-scaffold` is a redirect. Restores the ecosystem table row and fixes the clone command and links, while keeping `logos-scaffold` for the crate and binary. - Basecamp's module-root override is now documented as the pair it is: 0.1.x reads LOGOS_DATA_DIR, 0.2.x reads LOGOS_USER_DIR, and `launch` sets both absolute per profile on macOS with a portable `[repos.basecamp].attr`. Adds the symptom that appears when only one is set: profiles collapsing onto the shared data tree. - The module socket is `logos_token_<module>` under TMPDIR, not XDG_RUNTIME_DIR, and the path cap applies on Linux too (108 bytes), so the guidance is no longer macOS-only. - Documents the full `launch` environment as a table. Additions: - `basecamp build --variant`, of which `build-portable` is now an alias, plus `develop`, `run`, `paths`, `docs`, and `launch --log-file`. - `.scaffold/basecamp/lgx/`, `.scaffold/wallet/`, and the development-only nature of the wallet key material. - The LEZ guide gains a `logos-scaffold run` section covering the six-step pipeline, run profiles, `topup`/`deploy` skips, the hook environment, and the no-inheritance rule for named profiles. It also exports LEE_WALLET_HOME_DIR next to NSSA_WALLET_HOME_DIR for LEZ v0.2.0, describes the wallet seeding change, and closes an unterminated code fence at the end of the page. - Cross-links between the LEZ guide, the module guide, and the core module tutorial so each entry point reaches the other. Sets the author on the scaffold pages to weboko.
|
triggering AI review now, let's see |
weboko
left a comment
There was a problem hiding this comment.
Dogfooded this on a clean Ubuntu 24.04 container, following the module guide end to end: installed Nix (flakes), cloned logos-co/scaffold @ 7c2578d — the exact rev the last commit says it refreshed against — cargo install --path ., then lgs init, lgs doctor, lgs basecamp docs, lgs basecamp setup (full Nix build of Basecamp + lgpm, ~8 min), lgs basecamp paths, and lgs basecamp doctor. Also ran yarn build on this branch.
This holds up unusually well. I went looking for drift and mostly found the docs matching the source line for line. Things I checked and confirmed:
- Every documented subcommand and flag exists:
--show,--print-output,--log-file[=PATH],--json,--variant,--module,completions bash|zsh, and all ofrun's flags (--profile,--reset/--no-reset,--post-deploy,--no-post-deploy,--watch). init's.gitignoreappend and thescaffold.toml.bakmigration, both exactly as described.setupprintedseeded profiles: alice, bob, and neitherbasecampnorlgpmlanded onPATH— as line 78 says.- The launch env table:
launch_envsets the three XDG vars under the profile dir plusLOGOS_PROFILE, andBASECAMP_MODULE_ROOT_ENV_VARSreally is["LOGOS_DATA_DIR", "LOGOS_USER_DIR"]— line 283's "sets both" is right. The portable attrsbin-macos-app/bin-appimage/bin-bundle-dirmatchconstants.rstoo. - The
runtime_dirresolution order (config →/tmp/lgs-<profile>on macOS → in-profilexdg-tmp) matchesresolve_profile_runtime_direxactly, andpaths alice --jsonreturnedxdg_runtime_dir: nullwithtmpdirpointing atxdg-tmpon Linux, which is precisely what the table predicts. - The
Devsuffix field note (line 272-278) showed up live:modules_dirresolved to.../xdg-data/Logos/LogosBasecamp**Dev**/modules. - The QML claim about
logos-module-buildergeneratingmodule com.logos.module.<name>and preserving an author-suppliedqmldir— verified inlib/mkLogosQmlModule.nix:127-143. - The subtle one on the LEZ page: profiles shadow rather than inherit
[run].config.rsparses each profile key with.unwrap_or(true/false), so a key the profile omits falls back to its own default, not your inline value. The warning is correct. yarn buildpasses clean withonBrokenLinks: 'throw', no warnings, and every in-page anchor I extracted resolves to a real heading.
Three fixes inline, all small — a factual overreach on the about page, an undocumented init side effect that writes un-gitignored files into the repo, and an off-by-one in a data-loss warning.
What I could not exercise: the GUI half. This container is headless (DISPLAY unset), and the page correctly lists a graphical environment as a prerequisite, so Step 4's launch, Step 6's two-instance peer-to-peer test, and every runtime symptom in the troubleshooting page (socket path overflow, QML cross-matching, instance collision, blank macOS UI) are unverified here. I got as far as setup completing and the profile paths resolving. Those runtime sections read as plausible and internally consistent, and the mechanisms behind them check out in source — the logos_token_<module> socket collision is described in a comment in launch_env almost verbatim — but someone should confirm the observed symptoms on a desktop before this leaves draft.
One thing in the PR description rather than the docs: it says the ecosystem-repositories change "now points at logos-co/logos-scaffold (the logos-co/scaffold URL redirects to it)". Both halves are backwards — the diff points at logos-co/scaffold, and it's logos-co/logos-scaffold that 301s to it. The docs get this right (about page line 22 states the direction correctly); only the description needs a touch-up.
|
|
||
| ## Project layout | ||
|
|
||
| Scaffold works on a project directory that contains a `scaffold.toml` file at its root. Every command refuses to run outside such a project, and `lgs init` creates the file for an existing project. |
There was a problem hiding this comment.
"Every command refuses to run outside such a project" isn't quite right, and it contradicts the procedure page.
Verified against logos-scaffold 0.1.1 built from logos-co/scaffold @ 7c2578d, running from an empty directory with no scaffold.toml:
lgs basecamp docs -> # Basecamp Module Requirements (works)
lgs init -> scaffold.toml created at ... (works)
lgs --version -> logos-scaffold 0.1.1 (works)
lgs doctor -> error: This command must be run inside a logos-scaffold project.
create / new are in the same category as init — they exist precisely to be run outside a project. And basecamp docs working outside is a deliberate feature that develop-a-logos-module-with-logos-scaffold.md:101 calls out explicitly: "It works outside a scaffold project too, so you can read the contract before running lgs init." As written, this page contradicts that.
| Scaffold works on a project directory that contains a `scaffold.toml` file at its root. Every command refuses to run outside such a project, and `lgs init` creates the file for an existing project. | |
| Scaffold works on a project directory that contains a `scaffold.toml` file at its root. Project-scoped commands refuse to run outside such a project; the exceptions are `create` and `new`, which bootstrap one, `lgs init`, which creates the file for an existing project, and `lgs basecamp docs`, which prints the module contract from anywhere. |
| lgs init | ||
| ``` | ||
|
|
||
| `init` writes `scaffold.toml`, creates `.scaffold/`, and appends `.scaffold` to `.gitignore`. Run it once per project. If the project already has a `scaffold.toml` from an older schema, `init` migrates it in place and leaves a `scaffold.toml.bak` next to it. |
There was a problem hiding this comment.
init has three more side effects worth documenting, because they land in the user's repo and are not covered by the .scaffold gitignore entry.
Running lgs init in a fresh git repo (scaffold @ 7c2578d):
$ lgs init
scaffold.toml created at /.../scaffold.toml. Run 'lgs setup' to clone LEZ and build dependencies.
AI skills installed under .claude/skills/, .cursor/rules/, and AGENTS.md.
$ ls -a
.claude .cursor .git .gitignore .scaffold AGENTS.md scaffold.toml
So beyond the three things this paragraph lists, init also writes .claude/skills/, .cursor/rules/, and a top-level AGENTS.md. Only .scaffold gets appended to .gitignore, so on the next git add -A all three get committed — which matters given the page later tells readers to run exactly that (line 218, the git-tracking warning).
Re-running init refreshes them rather than leaving them alone (AI skills refreshed under .claude/skills/, .cursor/rules/, AGENTS.md.), so a project that deletes them gets them back on the next init.
Both other claims in this paragraph check out exactly: I confirmed the .gitignore append, and the migration path writes scaffold.toml.bak and prints the schema diff.
| `init` writes `scaffold.toml`, creates `.scaffold/`, and appends `.scaffold` to `.gitignore`. Run it once per project. If the project already has a `scaffold.toml` from an older schema, `init` migrates it in place and leaves a `scaffold.toml.bak` next to it. | |
| `init` writes `scaffold.toml`, creates `.scaffold/`, and appends `.scaffold` to `.gitignore`. It also installs AI-assistant scaffolding into the project — `.claude/skills/`, `.cursor/rules/`, and a top-level `AGENTS.md` — which are **not** gitignored, so decide whether to commit or ignore them before your next `git add -A`. Run it once per project; re-running refreshes the assistant files. If the project already has a `scaffold.toml` from an older schema, `init` migrates it in place and leaves a `scaffold.toml.bak` next to it. |
| To keep a copy of the window's output, add `--log-file`. Bare `--log-file` writes to `.scaffold/basecamp/profiles/<profile>/basecamp.log` and still tees to your terminal; `--log-file=PATH` picks the file. | ||
|
|
||
| :::warning | ||
| The scrub in step 3 is deliberate: every launch starts from a clean profile, so identity keys, conversations, and any other in-app state are discarded. That is what makes runs reproducible. If you need state that survives a restart, run Basecamp yourself against a fixed base directory as described in [Step 6](#step-6-run-two-instances-side-by-side). |
There was a problem hiding this comment.
Off-by-one, and the numbering collides with the page's own ## Step N headings.
Line 130 lists launch's four moves in order: (1) kills leftover processes, (2) removes the profile's state, (3) replays the install, (4) starts Basecamp. The scrub is the second, not the third — the third is the reinstall. I confirmed the real order in src/commands/basecamp.rs, which runs kill_process_tree → seed_profiles → scrub_profile_data_and_cache → seed_profiles → install_sources_into_profiles → launch.
"step 3" also reads as a pointer to this page's ## Step 3: Build and install the module, which contains no scrub at all — so naming the move is clearer than numbering it:
| The scrub in step 3 is deliberate: every launch starts from a clean profile, so identity keys, conversations, and any other in-app state are discarded. That is what makes runs reproducible. If you need state that survives a restart, run Basecamp yourself against a fixed base directory as described in [Step 6](#step-6-run-two-instances-side-by-side). | |
| The state removal above is deliberate: every launch starts from a clean profile, so identity keys, conversations, and any other in-app state are discarded. That is what makes runs reproducible. If you need state that survives a restart, run Basecamp yourself against a fixed base directory as described in [Step 6](#step-6-run-two-instances-side-by-side). |
Draft. First cut of a docs package for
logos-scaffold, focused on the module development loop against Basecamp.What this adds
A new
docs/scaffold/section with three pages:logos-module-builder.lgs init,basecamp setup / modules / install / launch, the iteration loop, two-instance testing, andbuild-portable.The five field notes this PR was opened to capture:
nix build .#lgxdoes not update a running Basecamp. Documented as three moves — rebuild, reinstall into every base directory, restart — plus the fact thatlgs basecamp launch <profile>collapses all three, and that relaunching one profile leaves the other on the old build.--user-dir/LOGOS_USER_DIRand scaffold profiles, with a table of how the base directory resolves, including theDevsuffix that non-portable builds append to the application data location.sun_pathcap, theUnix socket path too longerror, and keepingXDG_RUNTIME_DIR/TMPDIRshort (/tmp/lgs-<profile>).qmldirnaming. Why a bareimport "."lets same-basename types cross-match between modules in one host process, and the named-module layout that avoids it.src = ./.only see git-tracked files, so a newqmldiror config file must be staged before the build or it is silently omitted.Additional material drawn from the scaffold and module-builder repositories:
followswiring for transitivelogos-module-builderinputs, unresolved dependency errors frombasecamp modules, sibling sub-flake override limits,doctordrift, theui-devQML hot-reload loop, absoluteLOGOS_DATA_DIRon the macOS bundle, and how to collect diagnostics withlgs report.Wiring
scaffoldSidebarinsidebars.ts, added to the Explore dropdown indocusaurus.config.ts.docs/get-started/logos-ecosystem-repositories.mdnow points atlogos-co/logos-scaffold(thelogos-co/scaffoldURL redirects to it) with a description matching what the tool actually does.Verification
npm run buildpasses with no broken links or anchors (onBrokenLinks: 'throw')..github/styles/Logos/BritishSpelling.yml.logos-scaffold(src/commands/basecamp.rs,src/constants.rs,docs/basecamp-module-requirements.md),logos-basecamp(app/utils/LogosBasecampPaths.h,README.md), andlogos-module-builder(lib/mkLogosQmlModule.nix,README.md).Open questions for review
authors:is empty in the three new files — please fill in the handles that should be credited.product: corewas chosen for the frontmatter since the taxonomy inCONTRIBUTING.mdhas no scaffold area. Happy to change it.doc_type: troubleshootingis sanctioned byCONTRIBUTING.mdbut is the first use of that type indocs/. There is no template committed underresources/templates/yet, so the structure is symptom / cause / fix with an index table at the top.