Repository navigation
Closed
Labels
pro-boundaryPro/core boundary: Pro code moves to nodespace-sync (ADR-081..085)
Description
Summary
Remove the community daemon's dead edition code:
- the unused
procargo feature; is_pro_build()andedition();- the
--editionflag; - the tray's
cfg!(feature = "pro").
In the same PR, make nodespaced exit with status 2 on any argument it does not recognise. Otherwise the installers that still run nodespaced --edition as root would start a full daemon inside $(...) and hang.
Context
- The feature is dead.
packages/daemon/Cargo.toml(65-69) declarespro = [], and nothing enables it: sync'snodespaced-prodepends onnodespace-daemonwithout features. Sois_pro_build()(src/main.rs117-122) is always false, and--editionalways printscommunity. ADR-082 §4 (proposed) removes the feature,edition()and the tray'scfg!choice. - The hazard.
main()(438-449) handles--edition,--versionand--tray, and sends any other argument toserve_headless(). Three places runnodespaced --editionas root inside$(...), and all three fall back with|| echo "unknown":- core's
scripts/pkg-resources/postinstall(line 34), until Move the .pkg guard to a static pre-install check and declare NodeSpaceProduct #3349 removes it; - sync's Pro postinstall, which has already shipped (sync
scripts/pkg-resources/postinstall:33); - core's
release.yml, which installs the.pkgtwice (571-578), so the second postinstall probes the first install's daemon.
- core's
- Audited launchers. Rejecting every other argument breaks none of these:
--tray: the app plist, the systemd unit, the Windows spawn, the HKCU autorun, andscripts/pkg-resources/app.nodespace.daemon.plist;- no arguments: the Homebrew formula's
service(scripts/update-homebrew-formula.ts330-340),src-tauri/test-support,src/tests/e2e/daemon-harness.tsandpackages/daemon/tests/it; --version: the formula'stest.
- The tray must change in the same PR.
src/tray.rs:57readscfg!(feature = "pro"). Once the feature is undeclared, check-cfg warns, and clippy-D warningsfails. - Guardrail: stop new Pro code from landing in core #3302's absence-test convention. A test that passes the retired flag builds it from fragments, so the Pro-boundary ratchet stays at zero for
--edition.
Scope
packages/daemon/Cargo.toml
- Delete the
[features]table (65-69).prois its only entry.
packages/daemon/src/main.rs
is_pro_build(117-122): delete it and its doc.open_default_database(101): passmarker_path(false). Collapse proto socket, pid and marker tables to debug/release; drop CLI Pro discovery #3355 replaces that API.socket_path(132-137): fall back todefault_socket_path_for(cfg!(debug_assertions), false). Collapse proto socket, pid and marker tables to debug/release; drop CLI Pro discovery #3355 collapses that signature.main()(438-449):- Delete the
--editionearly exit, and keep--version. - Add a pure
fn first_unrecognized_arg(args: &[String]) -> Option<&str>. It skips argv[0] and accepts only the arguments the daemon handles, listed inconst ACCEPTED_ARGS: &[&str] = &[TRAY_FLAG];. - When it returns
Some, before tracing or the runtime starts, print one line to stderr that names the argument and the supported ones (--tray,--version). Then callstd::process::exit(2). - Reword the comment at 439-440, which cites the postinstall.
- Delete the
edition()(1181-1188): delete it.socket_fallback_variant_tests::the_env_override_still_wins_over_the_scoped_default(2053): replacesuper::is_pro_build()withfalse. The table's Pro rows stay until Collapse proto socket, pid and marker tables to debug/release; drop CLI Pro discovery #3355.
packages/daemon/src/tray.rs
ui_pid_path(46-59): passfalseinstead ofcfg!(feature = "pro").- Reword its doc (46-52) to say the variant is this daemon's build flavour, debug or release.
packages/daemon/tests/it
- Add
unrecognized_flag.rs, and register it asmod unrecognized_flag;intests/it/main.rs.
Out of scope
packages/proto/src/socket.rs,marker_path(is_pro), and the Pro rows in the variant tests (Collapse proto socket, pid and marker tables to debug/release; drop CLI Pro discovery #3355).- The postinstall guard (Move the .pkg guard to a static pre-install check and declare NodeSpaceProduct #3349).
LAUNCHER_ARGSand the lock (Add a single-instance daemon lock and export the launcher's argument list #3352).- sync's Pro postinstall probe. After this PR it reads
unknown; removing it is sync's job.
Steps
- Run the CLAUDE.md startup sequence, and assign the issue at pickup.
- Make the
Cargo.toml,main.rsandtray.rsedits. - Add the argv check. Put its unit tests in a module next to
tray_mode_tests(~1160). - Add the integration test.
- Run
bun run scripts/check-pro-boundary.tsand pasteBASELINES. - Run
bun run test:changedandbun run quality:fix, push, and open the PR. Code comments must not cite GitHub issue numbers.
Acceptance criteria
- Both of these print nothing:
git grep -nw is_pro_build -- packages/daemongit grep -n -F -e --edition -e 'feature = "pro"' -e 'fn edition' -- packages/daemon
- The retired flag,
--helpand any other unknown argument each exit with status 2 within a second. Nothing is printed on stdout, and no socket is bound. -
nodespaced,nodespaced --trayandnodespaced --versionbehave as before. -
bun run scripts/check-pro-boundary.tspasses, withBASELINESlowered to the printed counts:editionBranchingfalls: theis_pro_build,--editionand edition lines inmain.rs, and the one line intray.rs;proWordingfalls: the comment inCargo.tomland the edition docs inmain.rs.
Tests and verification
- Unit tests for
first_unrecognized_arg:Nonefor[nodespaced]and[nodespaced, --tray].Somefor--help,--no-such-flag,[--tray, <retired>]and the retired flag on its own.- Build the retired flag as
const RETIRED_EDITION_FLAG: &str = concat!("--", "edition");. Its comment says it is built from fragments so the Pro-boundary ratchet stays at zero.
- Integration test (
tests/it/unrecognized_flag.rs):- Spawn
env!("CARGO_BIN_EXE_nodespaced")withRETIRED_EDITION_FLAG. PointHOME,NODESPACE_HOME,NODESPACED_SOCKETandNODESPACED_DB_PATHinto a tempdir. - Assert exit status 2 within 10 s, empty stdout, and no socket file.
- Also assert that
--versionprintsCARGO_PKG_VERSIONand exits 0. - Kill the child on timeout, so a regression fails the test instead of hanging it.
sigterm_during_model_load.rsshows the pattern.
- Spawn
- Mutation check: delete the
exit(2)line, and the integration test must fail. - Commands:
bun run test:changedcargo clippy -p nodespace-daemon --all-targets -- -D warnings -D clippy::unused-async.tools/bin/cargo-nextest nextest run -p nodespace-daemon --bins.tools/bin/cargo-nextest nextest run -p nodespace-daemon --test it unrecognized_flag::
Dependencies
- NodeSpaceAI/nodespace-docs#90 (ADR-082) (ADR-082 §4, proposed): removes the daemon's edition code.
- Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299: the Pro-boundary ratchet.
Risks and rollback
- A launcher the audit missed. If one passes another argument, the daemon now exits 2, and launchd or systemd restarts it in a loop. Before merging, re-run
git grep -n nodespaced -- scripts .github packagesand check every spawn. - Rollback: revert the PR. The removed code never ran in a shipped build.
Plan key: C8.3a (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