doctor: ship as a devenv module, beside .doctor.just #96

Merged
larandar merged 1 commit from tango/95-devenv-doctor into main 2026-08-28 20:05:01 +00:00
Owner

Ships Ting's repository doctor as a devenv module, ting-doctor.nix, beside .doctor.just rather than replacing it. Every repo not yet migrated keeps working unchanged; .doctor.just is removed only when the last consumer has moved.

What changed in the mechanism

The nushell bodies are carried over byte-for-byte — verified by diffing all 11 against the .doctor.just originals after the Nix ''-string round-trip (0 mismatches). What went away is the shell plumbing that devenv makes structural:

recipe fate
flake deleted — textually patched nushell/gum into the first mkShell in flake.nix. packages in the module is the declaration now.
environment deleted — enforced an .envrc header and gated on a hand-set TING_DEVSHELL="active" marker. $env.DEVENV_ROOT is set by devenv itself.
doctor-cached deleted — the [cache(...)] wrapper is now a shared status gate script with the same policy.
sync deleted — consumers take this file as a devenv input; devenv update is the sync, and the rev lands in their devenv.lock.
ting:pin new — the one invariant standalone devenv creates: consumers pin nixpkgs twice, so this asserts flake.lock and devenv.lock agree. Warns; never rewrites a lockfile behind the operator.

wire and adopt become devenv scripts guarded by gum confirm — they edit tracked files, so they stay deliberate acts and never run unattended before a shell opens.

One escaping trap worth flagging for review: '${1}' in default-branch escapes to '''${1}', which Nix reads as a literal '' followed by a live interpolation. It evaluated to cannot coerce an integer to a string: 1. Double-quoted at the source.

Verification

Proven from lar.ad/flake-ops with this file as a path: input:

  • devenv tasks list renders the full chain, every task carrying the status gate.
  • devenv tasks run ting:doctor completes green.
  • The gate skips the chain on re-run and invalidates when a lockfile moves.

Not in this PR

This repo's own .envrc/.doctor.just usage is untouched — it migrates with the rest, after this lands and the input resolves.

Closes #95

Ships Ting's repository doctor as a devenv module, `ting-doctor.nix`, **beside** `.doctor.just` rather than replacing it. Every repo not yet migrated keeps working unchanged; `.doctor.just` is removed only when the last consumer has moved. ### What changed in the mechanism The nushell bodies are carried over byte-for-byte — verified by diffing all 11 against the `.doctor.just` originals after the Nix `''`-string round-trip (0 mismatches). What went away is the shell plumbing that devenv makes structural: | recipe | fate | | --- | --- | | `flake` | deleted — textually patched `nushell`/`gum` into the first `mkShell` in `flake.nix`. `packages` in the module *is* the declaration now. | | `environment` | deleted — enforced an `.envrc` header and gated on a hand-set `TING_DEVSHELL="active"` marker. `$env.DEVENV_ROOT` is set by devenv itself. | | `doctor-cached` | deleted — the `[cache(...)]` wrapper is now a shared `status` gate script with the same policy. | | `sync` | deleted — consumers take this file as a devenv input; `devenv update` is the sync, and the rev lands in their `devenv.lock`. | | `ting:pin` | **new** — the one invariant standalone devenv creates: consumers pin nixpkgs twice, so this asserts `flake.lock` and `devenv.lock` agree. Warns; never rewrites a lockfile behind the operator. | `wire` and `adopt` become devenv `scripts` guarded by `gum confirm` — they edit tracked files, so they stay deliberate acts and never run unattended before a shell opens. One escaping trap worth flagging for review: `'${1}'` in `default-branch` escapes to `'''${1}'`, which Nix reads as a literal `''` followed by a *live* interpolation. It evaluated to `cannot coerce an integer to a string: 1`. Double-quoted at the source. ### Verification Proven from `lar.ad/flake-ops` with this file as a `path:` input: - `devenv tasks list` renders the full chain, every task carrying the status gate. - `devenv tasks run ting:doctor` completes green. - The gate skips the chain on re-run and invalidates when a lockfile moves. ### Not in this PR This repo's own `.envrc`/`.doctor.just` usage is untouched — it migrates with the rest, after this lands and the input resolves. Closes #95
The same doctor as devenv tasks, nushell bodies carried over byte-for-byte.
Deletes what the shell plumbing made redundant — flake, environment,
doctor-cached, sync — and adds ting:pin for the two-lockfile invariant that
standalone devenv creates. .doctor.just stays for unmigrated repos.

Closes #95

Co-Authored-By: Claude Opus 5 <[email protected]>
larandar deleted branch tango/95-devenv-doctor 2026-08-28 20:05:01 +00:00
Sign in to join this conversation.
No reviewers
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
Ting/Jostoph!96
No description provided.