refactor(repo): move the dev-install symlinking into its own guarded script - #138
Merged
Conversation
…script D-0004 guarded the whole `justfile`, which is the only guard in the repo pointing at a multi-purpose file — every other one names a Rust module, a workflow, or a single-purpose install script. About six of the justfile's 190 lines are D-0004's business, so the guard fired on every unrelated recipe: it tripped while editing `pricing-sync`, which fetches model prices and has nothing to do with installs. That is not just noise. The guard wall also requires a decision trailer on any commit touching a guarded path, so unrelated justfile edits had to cite D-0004 in their commit message — polluting `git log --grep` and training readers to skim past a guard that is usually irrelevant. The protection was real, though, and is kept intact rather than dropped: nothing else in the repo would notice `just link` changing from `ln -sf` to `cp`, which would leave a dev install indistinguishable from a managed one and silently defeat every refusal D-0004 describes. So the symlinking moves to `dev-install.sh` and the guard follows it there. Every path D-0004 now names is install-path logic end to end. Extracting it also brings that logic under the shellcheck/shfmt standard the repo already applies to install.sh — it had been escaping it only by hiding in a justfile — and the script gains a missing-build check the inline recipe never had, where `ln -sf` would happily create a dangling symlink. `just link` produces byte-identical symlinks; verified against a scratch bin dir, along with idempotent re-runs and both failure paths. Why: a guard that fires on edits it does not govern teaches readers to ignore it. Rejected: dropping `justfile` from the guards outright — the `ln -sf` to `cp` regression would then go unguarded, which is the one thing D-0004 must catch. Refs: D-0004 Refs: D-0012 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Asen Lekov <asenlekoff@gmail.com>
Contributor
|
Knowledge layer
Spec currency is reported in the job summary and never fails a build, the same severity the local pre-commit hook uses. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
D-0004 guarded the whole
justfile. It is the only guard in the repo pointing at a multi-purpose file — every other one names a Rust module, a workflow, or a single-purpose install script:So it fired on every unrelated recipe. It tripped while editing
pricing-sync, which fetches model prices from models.dev and has nothing to do with installs.Why this is more than noise
The guard wall requires a decision trailer on any commit touching a guarded path — I confirmed a justfile-only edit with no trailer is blocked locally and in CI:
So unrelated justfile edits had to cite D-0004 in their commit message, polluting
git log --grep D-0004and training readers to skim past a guard that is usually irrelevant.Why the guard is not simply dropped
The protection is real. Nothing else in the repo would notice
just linkchanging fromln -sftocp— and that change would leave a dev install indistinguishable from a managed one, silently defeating every refusal D-0004 describes (discover_installreads the PATH entry withsymlink_metadataprecisely becausecurrent_exe()resolves symlinks away).So the symlinking moves into
dev-install.shand the guard follows it there. Every path D-0004 now names is install-path logic end to end, and the invariant is documented at the edit site rather than three files away.Two things that fall out of it
install.sh, purely by hiding in a justfile. Theshell-lintjob now covers both. (The job's name changes;develophas no branch protection, so no required-check breakage.)ln -sfa binary that had not been built, leaving a dangling symlink on PATH. The script fails with a message pointing atjust release.Verification
just cipasses.shellcheck -s shandshfmt -d -s -ln posix -i 2clean on both scripts.Guard matching flipped as intended:
just linkproduces byte-identical symlinks — tested against a scratch bin dir (never~/.local/bin), along with idempotent re-runs, the missing-build path, and missing arguments.🤖 Generated with Claude Code