Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
pro-boundaryPro/core boundary: Pro code moves to nodespace-sync (ADR-081..085)
Description
Summary
Add AppExtensions::daemon_profile(self, profile: DaemonProfile) -> Self (ADR-082 §3.2 and §3.6, proposed).
- An app built on core can supply its profile. That app is the Pro app crate in nodespace-sync. The profile sets its daemon binary, the daemon's service environment and its product.
runinstalls the supplied profile before it creates the Tauri builder.AppExtensions::none()supplies no profile. Core's ownmain.rspasses it, so the app keeps its built-in default and the free app does not change.DaemonProfilehas to live in the crate that extensions depend on.
Context
- The fallback. After Add a DaemonProfile for the app's daemon binary and service env (no behavior change) #3346,
daemon_profile::active()lazily falls back todaemon_setup::profile_for_this_build(). - The entry point comes from Route the desktop app through run(extensions, context) with no extensions in core #3306.
- ADR-082 §3.2 names it
run(extensions: AppExtensions, context). The Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322 plan before revision called itrun_with(context, extensions). Use whichever name Route the desktop app through run(extensions, context) with no extensions in core #3306 merged. - ADR-082 §3.6 says the profile is read once at startup, before any daemon setup, and stays fixed for the life of the process.
- ADR-082 §3.2 names it
- The first readers run after
run.- The first reader of the profile is
daemon_setup::kill_stale_daemon_sync(), throughdaemon_binary_name(), inside core's.setup. ensure_daemon_runningreads it next, in the startup task.- Extension plugin setup runs before core's setup (ADR-082 §3.3), and must not read the profile.
- So installing the profile in
run, before the builder exists, comes before every reader.
- The first reader of the profile is
- Where the type lives. An extension crate that is linked into the
nodespace-apppackage cannot depend on that package, because that would be a package cycle.- If Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322 did ADR-082 §3.1's split: the library package (crate
nodespace_app_lib) already holdsdaemon_profile.rs, because the file moved with the library. The Pro app crate depends on that library. Nothing moves; add the re-export. - If Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322 added a separate extension-API crate instead (the unrevised Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322 plan's
nodespace-app-extension-api): move theDaemonProfilestruct andcommunity()into that crate.- Under the ADR-082 shape they depend on nothing in core, so write the
nodespacedliteral there. - Re-export the type from
nodespace_app_lib. active()andinstallstay in the library.
- Under the ADR-082 shape they depend on nothing in core, so write the
- Never leave the type only in the
nodespace-appapp package.
- If Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322 did ADR-082 §3.1's split: the library package (crate
- Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322 may have declared
daemon_profilealready. ADR-082 §3.2 lists it, so Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322 may have added it as a no-op. If so, wire that method instead of adding a second one. Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322 must not define a second mechanism for the daemon's identity.
Scope
daemon_profile.rs:- Add
pub(crate) fn install(profile: DaemonProfile), which setsACTIVE. - If
ACTIVEwas already set because something read the profile first, panic with a message that names the ordering bug. - Put the set-once logic in
fn install_into(cell: &OnceLock<DaemonProfile>, profile: DaemonProfile) -> Result<(), DaemonProfile>, so the unit tests can use a local cell.
- Add
AppExtensions:- Add a private field
daemon_profile: Option<DaemonProfile>. - Add the builder method
pub fn daemon_profile(self, profile: DaemonProfile) -> Self. - Its rustdoc says what each field controls:
binary_name: the binary that is installed, registered, started, and killed by image name;service_env: the environment in the launchd registration;product: the product the running daemon is expected to belong to.
- The rustdoc also says two things. The label, socket, UI pid file and marker are core's shared identity (ADR-084 decision 2(a)) and cannot be configured. And the named daemon must honour ADR-084's registration contract.
- Add a private field
run:- Before creating the builder, call
daemon_profile::install(<the supplied profile>.unwrap_or_else(daemon_setup::profile_for_this_build)). assembledoes not install. Tests drive it withMockRuntime, and must not touch the process-global cell.
- Before creating the builder, call
- The library root: add
pub use daemon_profile::DaemonProfile;, or the re-export from the API crate. EXTENSION_API_VERSION: if it exists and Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322 did not already declare this method, bump its minor version. ADR-082 §6 counts a newAppExtensionsmethod as additive.
Out of scope
- Deleting the in-core Pro values (Delete the in-core Pro daemon profile, NODESPACE_PRO_* switch and tauri.pro.conf.json #3354).
- Anything in nodespace-sync.
Steps
- Run the CLAUDE.md startup sequence, and assign the issue at pickup.
- Add
installandinstall_into. - Add the field and the method, and call the install from
run. - Add the re-export and the docs. Code comments must not cite GitHub issue numbers.
- Add the tests.
- Run
bun run scripts/check-pro-boundary.tsand paste the printedBASELINES. - Run
bun run test:changedandbun run quality:fix, push, and open the PR.
Acceptance criteria
- A crate outside the library can construct
DaemonProfile { binary_name: "custom-daemon", service_env: vec![], product: "custom" }and pass it withAppExtensions::none().daemon_profile(..). Show this with core's fixture extension (ADR-082 §7) or atests/integration crate. - With
AppExtensions::none(),active()equalsprofile_for_this_build(). - A supplied profile is the one that
daemon_binary_name(), the Windows image name and the plist env use. - Installing a profile after it was read fails loudly. It is never silently ignored.
- Free app behaviour is unchanged.
-
bun run scripts/check-pro-boundary.tspasses, andBASELINESis pasted. No change is expected.
Tests and verification
- Unit tests for
install_into:- it stores a supplied profile;
- it falls back to the build default when nothing is supplied;
- it returns
Errwhen the cell is already set.
- Fixture test: if Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322 ships the ADR-082 §7 fixture extension, add a case showing that it can name and pass a custom
DaemonProfile. - Default test: if
assembleexposes the extension parts, check thatAppExtensions::none()carries no profile. - Commands:
bun run test:changedcargo clippy -p <the library crate> --all-targets -- -D warnings -D clippy::unused-async
Dependencies
- Add a DaemonProfile for the app's daemon binary and service env (no behavior change) #3346: adds
DaemonProfileandactive(). - Route the desktop app through run(extensions, context) with no extensions in core #3306: adds the entry point that takes
AppExtensions.
Risks and rollback
- Install order. If Split the desktop Tauri crate and add ADR-082's Tauri extension points #3322 runs extension setup inside core's
.setup, the install must still happen first, inrun, before any builder exists. - Rollback: revert the PR. Add a DaemonProfile for the app's daemon binary and service env (no behavior change) #3346's lazy default keeps working.
Plan key: C8.2 (pro-boundary DAG).
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
pro-boundaryPro/core boundary: Pro code moves to nodespace-sync (ADR-081..085)
Activity
mstomar125 commentedon Sep 30, 2026
Acceptance criterion added (from #3346's review): where an external
DaemonProfileis accepted viaAppExtensions, rejectservice_envkeys that collide with core's reserved launch-agent variables (NODESPACED_SOCKET,NODESPACE_UI_BINARY) — a duplicate plist key is accepted by plutil and silently overrides core's value. Take the reserved names from one shared list thatwrite_plistalso uses.mstomar125 commentedon Oct 1, 2026
Superseded by #3414 (umbrella against the final ADR-081–085)