doctor: cache-gate the run, drop nix develop, gate on TING_DEVSHELL, quiet the terminal #94
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Meta/Campaign
Meta/Epic
Meta/Session
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
Reviewed/Confirmed
Reviewed/Curated
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Scope/Campaign
Status/Abandoned
Status/Blocked
Status/Conflicted
Status/In Progress
Status/In Review
Status/Need Grooming
Status/Need More Info
Status/Ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Ting/Jostoph!94
Loading…
Reference in a new issue
No description provided.
Delete branch "fastlane"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
.envrc bootstrapped an unconditional
just doctoron every direnv reload,so a fresh HTTP fetch, OpenSpec wiki sync, and jj/git config writes ran on
every re-entry into the directory -- far more often than any of those
inputs actually change.
Wrap
doctorbehind a new privatedoctor-cachedrecipe tagged[cache(inputs = [...], extra = datetime_utc(...))]: just's own recipecache hashes the doctor script and flake.lock content, and the UTC-hour
extra key expires it on its own at least once an hour. A failed doctor run
is never cached (just only writes the entry on a zero exit), so the next
reload retries it rather than going quiet for an hour. Verified all of
this empirically against a throwaway justfile before relying on it.
Drop
nix develop --commandfromset shell/set script-interpreter:.envrc'suse flakehas already put the devShell on PATH beforejustruns, so re-entering
nix developper recipe was pure overhead -- measuredat ~1.3s per call, warm, versus ~30ms for
nurun directly; ~15s of pureshell setup across doctor's 11-recipe chain on every cache-miss run.
That drop gives up a hermetic guarantee:
nix develop --commandprovednu/gum came from THIS flake's devShell, not an ambient install elsewhere on
PATH. Close most of that gap back up with a hard gate:
.envrcnow exportsTING_DEVSHELLright afteruse flake, and.doctor.justrequires it viaan eager top-level
env_var()assignment alongside the existingdirenv := require("direnv")-- confirmed empirically that an eager assignment haltsevery recipe invocation (though not
--list) before any recipe body runs,same mechanism
require()already relied on. A standalone invocationwithout direnv active now fails immediately and loudly instead of quietly
running every recipe against whatever nu/gum happen to be ambient.
environment's own DIRENV_FILE comparison stays as a softer, continuingdiagnostic for the narrower case this gate can't distinguish: a stale load
for this same repo, not an absent one.
Also clear the terminal and leave a single recap line at the end of a real
doctor run, and clear plus a short success line right after
use flake,instead of leaving a screenful of per-check gum log noise in scrollback on
every shell entry.
.envrc bootstrapped an unconditional `just doctor` on every direnv reload, so a fresh HTTP fetch, OpenSpec wiki sync, and jj/git config writes ran on every re-entry into the directory -- far more often than any of those inputs actually change. Wrap `doctor` behind a new private `doctor-cached` recipe tagged `[cache(inputs = [...], extra = datetime_utc(...))]`: just's own recipe cache hashes the doctor script and flake.lock content, and the UTC-hour extra key expires it on its own at least once an hour. A failed doctor run is never cached (just only writes the entry on a zero exit), so the next reload retries it rather than going quiet for an hour. Verified all of this empirically against a throwaway justfile before relying on it. Drop `nix develop --command` from `set shell`/`set script-interpreter`: `.envrc`'s `use flake` has already put the devShell on PATH before `just` runs, so re-entering `nix develop` per recipe was pure overhead -- measured at ~1.3s per call, warm, versus ~30ms for `nu` run directly; ~15s of pure shell setup across doctor's 11-recipe chain on every cache-miss run. That drop gives up a hermetic guarantee: `nix develop --command` proved nu/gum came from THIS flake's devShell, not an ambient install elsewhere on PATH. Close most of that gap back up with a hard gate: `.envrc` now exports `TING_DEVSHELL` right after `use flake`, and `.doctor.just` requires it via an eager top-level `env_var()` assignment alongside the existing `direnv := require("direnv")` -- confirmed empirically that an eager assignment halts every recipe invocation (though not `--list`) before any recipe body runs, same mechanism `require()` already relied on. A standalone invocation without direnv active now fails immediately and loudly instead of quietly running every recipe against whatever nu/gum happen to be ambient. `environment`'s own DIRENV_FILE comparison stays as a softer, continuing diagnostic for the narrower case this gate can't distinguish: a stale load for this same repo, not an absent one. Also clear the terminal and leave a single recap line at the end of a real doctor run, and clear plus a short success line right after `use flake`, instead of leaving a screenful of per-check gum log noise in scrollback on every shell entry.