--target root documented in service_mycelium.nu line 521 but rejected by clients/target.nu validator (driver|common|self only) #244

Closed
opened 2026-05-10 02:41:09 +00:00 by mik-tf · 1 comment
Owner

Symptom

$ service mycelium start --target root
Error: nu::shell::error
  x invalid --target 'root'. Must be one of: driver, common, self
   ,-[clients/target.nu:36:20]
 35 |     if not ($target in $TARGET_VALUES) and not ($target | is-empty) {
 36 |         error make {msg: $"invalid --target '($target)'. Must be one of: …"}

But service_mycelium.nu line 521 reads:

let sudo = ($target == "root")
if $sudo { svc_require_sudo }

And the doc-comment on the function literally lists --target: string = "" # driver|common|root.

So the user-facing doc says root is a valid value, the dispatch function checks for it, but the validator rejects it before the dispatch runs. Drift between docs/dispatch and validator.

Surfaced during hero_slides#49 session 86 close-out — anyone following the documented service mycelium start --target root recipe immediately hits this.

Resolution options

A. Accept root in the validator (alias for self + sudo)

Add "root" to TARGET_VALUES in clients/target.nu. service_mycelium.nu (and any other service that distinguishes the root case) keeps its let sudo = ($target == "root") check. Other services that don't need to distinguish keep using self.

B. Drop root from docs, callers use --target self + a separate --sudo flag

More invasive but clearer. Splits "which target to address" from "do you have sudo".

C. Drop the documented root value, callers run as actual root

Least user-friendly — operators have to su/sudo into root before running the command.

A is the lowest-effort fix; B or C are bigger refactors.

Acceptance

  • service mycelium start --target root succeeds (whichever resolution is taken).
  • All services that document driver|common|root in their --target doc-comment (grep "# driver\\|common\\|root" in nutools/modules/services/*.nu) align with the chosen behaviour.
  • clients/target.nu TARGET_VALUES and the doc-comments agree.

Refs

  • lhumina_code/hero_skills/nutools/modules/services/service_mycelium.nu line 521
  • lhumina_code/hero_skills/nutools/modules/clients/target.nu line 36 (validator)
  • lhumina_code/hero_slides#49
## Symptom ``` $ service mycelium start --target root Error: nu::shell::error x invalid --target 'root'. Must be one of: driver, common, self ,-[clients/target.nu:36:20] 35 | if not ($target in $TARGET_VALUES) and not ($target | is-empty) { 36 | error make {msg: $"invalid --target '($target)'. Must be one of: …"} ``` But `service_mycelium.nu` line 521 reads: ```nushell let sudo = ($target == "root") if $sudo { svc_require_sudo } ``` And the doc-comment on the function literally lists `--target: string = "" # driver|common|root`. So the user-facing doc says `root` is a valid value, the dispatch function checks for it, but the validator rejects it before the dispatch runs. Drift between docs/dispatch and validator. Surfaced during [hero_slides#49](https://forge.ourworld.tf/lhumina_code/hero_slides/issues/49) session 86 close-out — anyone following the documented `service mycelium start --target root` recipe immediately hits this. ## Resolution options ### A. Accept `root` in the validator (alias for `self` + sudo) Add `"root"` to `TARGET_VALUES` in `clients/target.nu`. `service_mycelium.nu` (and any other service that distinguishes the root case) keeps its `let sudo = ($target == "root")` check. Other services that don't need to distinguish keep using `self`. ### B. Drop `root` from docs, callers use `--target self` + a separate `--sudo` flag More invasive but clearer. Splits "which target to address" from "do you have sudo". ### C. Drop the documented `root` value, callers run as actual root Least user-friendly — operators have to su/sudo into root before running the command. A is the lowest-effort fix; B or C are bigger refactors. ## Acceptance - [ ] `service mycelium start --target root` succeeds (whichever resolution is taken). - [ ] All services that document `driver|common|root` in their `--target` doc-comment (grep `"# driver\\|common\\|root"` in `nutools/modules/services/*.nu`) align with the chosen behaviour. - [ ] `clients/target.nu` `TARGET_VALUES` and the doc-comments agree. ## Refs - `lhumina_code/hero_skills/nutools/modules/services/service_mycelium.nu` line 521 - `lhumina_code/hero_skills/nutools/modules/clients/target.nu` line 36 (validator) - https://forge.ourworld.tf/lhumina_code/hero_slides/issues/49
Author
Owner

Closing as obsolete on origin/development.

The service_mycelium.nu line 521 this issue references (the let sudo = ($target == "root") branch + the doc-comment advertising driver|common|root) was deleted by commit d1825ad (despiegk, 2026-05-10 08:21) along with 46 other service_*.nu modules. On current origin/development:

  • nutools/modules/clients/target.nu validator restricts --target to ["driver" "common" "self"] (line 21).
  • Nothing in the surviving codebase advertises or accepts root as a target value.

So the validator and the (gone) caller are now mutually consistent — the drift this issue documents no longer exists on tip.

The underlying broken-dispatcher state is tracked in #245. If the per-service mycelium logic returns (option A in #245), this issue can be re-opened against the restored code; if the migration proceeds (option B/C), the --target root semantics need to be redesigned in the lab Rust surface and a fresh issue filed there.

Note: anyone still on a runtime clone that hasn't pulled past d1825ad continues to hit this bug as documented.

Signed-off-by: mik-tf

Closing as obsolete on origin/development. The `service_mycelium.nu` line 521 this issue references (the `let sudo = ($target == "root")` branch + the doc-comment advertising `driver|common|root`) was deleted by commit [`d1825ad`](https://forge.ourworld.tf/lhumina_code/hero_skills/commit/d1825ad) (despiegk, 2026-05-10 08:21) along with 46 other `service_*.nu` modules. On current origin/development: - `nutools/modules/clients/target.nu` validator restricts `--target` to `["driver" "common" "self"]` (line 21). - Nothing in the surviving codebase advertises or accepts `root` as a target value. So the validator and the (gone) caller are now mutually consistent — the drift this issue documents no longer exists on tip. The underlying broken-dispatcher state is tracked in [#245](https://forge.ourworld.tf/lhumina_code/hero_skills/issues/245). If the per-service mycelium logic returns (option A in #245), this issue can be re-opened against the restored code; if the migration proceeds (option B/C), the `--target root` semantics need to be redesigned in the `lab` Rust surface and a fresh issue filed there. Note: anyone still on a runtime clone that hasn't pulled past `d1825ad` continues to hit this bug as documented. Signed-off-by: mik-tf
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_skills#244
No description provided.