Skip to content

build: fetch the corpus image without a login, and make install - #67

Merged
webern merged 2 commits into
mainfrom
m/deslag-blobfetch
Oct 3, 2026
Merged

webern merged 2 commits into
mainfrom
m/deslag-blobfetch

Conversation

@webern

@webern webern commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Human Summary

Some fixes due to Claude cloud environment limitations.

Summary

The big tier of the test corpus is an OCI image in ghcr.io/webern/deslag-blobs. The package became public on 2026-10-03, so fetching it needs no login. scripts/blobstore/blobs.sh did not know that: before every fetch it logged crane in with whatever token gh held and never checked that the registry accepted it.

That broke fetching in hosted agent environments. They set GH_TOKEN to a stand-in that only their own proxy accepts, gh auth token hands it over, the registry refuses it, and make fetch-blobs failed with a message telling the user the package was private and to log in. A person on their own machine never saw this, because their gh token is real.

Now fetch reads anonymously first and turns to gh only when that fails, which is what a private package, such as a fork's, would need. Any login is checked against the registry before anything relies on it, by listing the package's tags, and dropped when refused, so a later anonymous request is not sent with bad credentials. The auth error says which case it is, no token or a refused one, and what fixes each. An export that fails after the registry agreed to serve the image is now reported as a transfer failure rather than an auth failure.

The second commit adds make install. Preflight already said what was missing, but installing it was left to the reader, and the same hosted environment had cargo and git but lacked typos, so make ci stopped before it started. install installs with cargo what preflight checks for and the machine lacks, and for rustup, cargo and git it gives preflight's hint rather than installing anything behind the user's back. Preflight's last line now points at it.

install is a new verb in the build doctrine's vocabulary. That list was held at ten items by deslag's own list-growth lint, and the file sat four bytes under its budget, so this PR also, with the owner's go-ahead: raises the doctrine's byte budget by exactly the 92 bytes the new item added, in a one-file override; and, since an override can turn a lint on but not off, has list_growth name the three other skill files it judges rather than the whole skills directory. Everything else in the doctrine is as it was.

The Access section of scripts/blobstore/blobs.md describes the public package, the anonymous path and the token check. The build doctrine's North Star, that a fresh clone just works, now holds for make fetch-blobs in a hosted environment too.

Testing

  • make ci: exit 0, in a hosted agent environment with its stand-in GH_TOKEN left in place
  • make clean-blobs && make fetch-blobs with the environment untouched: anonymous fetch, exit 0, both batches unpacked; a second make fetch-blobs is a no-op
  • The same script pointed at a package that does not exist, with the stand-in token present: reports that the registry refused the token and how to fix it, exit 1
  • The same with GH_TOKEN and GITHUB_TOKEN unset: reports that there is no login and how to get one, exit 1
  • make test-blobs: 5 passed
  • make install on a machine with typos present: "nothing to install", exit 0; make preflight with cargo off PATH names the three missing tools and points at make install
  • deslag explain on the doctrine shows list_growth off and a 5092-byte budget; on the other three skills it shows list_growth on

References

webern added 2 commits October 3, 2026 04:15
The blobstore package is public now, so fetching it needs no login.
blobs.sh still logged crane in with whatever token gh held before every
fetch, and a hosted agent environment hands gh a stand-in token that
only its own proxy accepts. The registry refused it, and every fetch
there failed with a message about a private package.

fetch now reads anonymously first and turns to gh only when that fails.
A login is checked against the registry before anything relies on it,
by listing the package's tags, and dropped when refused, so a later
anonymous request is not sent with bad credentials. The auth error
says which case it is, no token or a refused one, and what fixes each.
An export that fails after the registry agreed to serve the image is
reported as a transfer failure, not an auth one.

blobs.md's Access section describes the public package, the anonymous
path and the token check.
The build doctrine's North Star is that a fresh clone just works, and
preflight already says what is missing, but installing it was left to
the reader. A hosted agent environment had cargo and git and lacked
typos, so make ci stopped at preflight and the agent had to work out
the install itself.

make install runs scripts/install.sh, which installs with cargo what
preflight checks for and the machine lacks, today typos. rustup, cargo
and git are not something the repo installs behind the user's back, so
for those it gives the same hint preflight does. preflight's closing
line now points at make install.

The doctrine gains install in its verb list, which the owner
authorized on 2026-10-03. Its byte budget grows by exactly the 92
bytes that item added, in a one-file override. An override can turn a
lint on but not off, so list_growth now names the three skills it
judges and leaves the doctrine out.
@webern webern added the area/build Deals with deslag build, scripts, ci, cd. label Oct 3, 2026 — with Claude
@webern
webern merged commit 18975fb into main Oct 3, 2026
2 checks passed
@webern
webern deleted the m/deslag-blobfetch branch October 3, 2026 05:27
@webern webern mentioned this pull request Oct 25, 2026
webern added a commit that referenced this pull request Nov 29, 2026
…erride (#273)

## Human Summary

This gives the user the ability to exempt a single lint case.

## Summary

Issue #68 asked for two things. The first is a way to exempt one
violation, keyed to its place and not to the whole file. The second is a
way for a narrower override to turn off a lint that a broader override
turned on.

Much of the first already exists. `[[<section>.allow]]` entries (#199,
#251) exempt one sentence, they require a reason, a tally of them prints
on every run, and a stale entry fails the check. `list_growth`, the lint
behind #67, was removed in #207, so there was no list count to rebase.
What was still missing:

- `density` could not be exempted. An `allow` entry for `density` now
quotes one whole paragraph or list item, folded the same way a sentence
quote is. Any edit to that block makes the entry stale, and the block is
judged again. So a paragraph that grows has to be re-exempted by a
human, and an entry does not last forever. A failed entry reports
`no_such_block`, `two_blocks` or `no_finding`. `deslag fix` leaves a
quoted block as it is. A `line` on a `density` entry is refused.
- An override can now say `off = ["<lint>", ...]`. This sets each named
lint back to unset for the files the override matches. A later override
that sets the lint's table turns it back on, with only the settings that
table sets. Loading the config (exit 2) refuses an unknown lint, a lint
named twice, a lint the same override both turns off and sets, and an
`off` for a lint that no table in the section turns on. `deslag explain`
shows `# <lint>: off, by override N`. The field is marked `since =
"next"` with a default of `[]`, so it needs no schema version bump.

Exemptions stay in the config, with no in-file marker. That keeps to the
existing rule that there is one way to exempt a finding.

`guide.md` and `lints/allow.md` no longer say that an override cannot
turn a lint off, or that an entry only exempts a sentence. They keep the
rule that an agent proposes an entry or an `off` and a human writes it.
The summary line, the SARIF rule text and the docs for entries now say
"text" rather than "sentence", since an entry can name a paragraph.

`.agents/deslag.toml` is unchanged. The #67 workaround was already
removed along with `list_growth`.

## Testing

- [x] `make ci-fast`: exit 0, including `check-deslag` on the repo
itself
- [x] `make test-tools`: exit 0
- [x] New `density` cases: `override_off`, `allow_applied`,
`allow_fails` (covering `no_such_block` and `no_finding`), `allow_rust`
and `allow_fix_held`
- [x] Unit tests for the `off` load errors, the merge order and
`two_blocks`, plus a new `deslag explain` test
- [x] Expected outputs regenerated with `make fix-test-output`, and the
diff checked. Existing `density` cases changed only by the added advice
sentence and the sentence-to-text wording.

## References

- Closes #68
- Related: #67, #199, #207, #251
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Deals with deslag build, scripts, ci, cd.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant