Skip to content

fix(tools,manager): yarnrc restore, mise lock store lock, and a cleanup pass - #306

Merged
sweepies merged 3 commits into
mainfrom
refactor/sloppy-tools-manager
Nov 14, 2026
Merged

sweepies merged 3 commits into
mainfrom
refactor/sloppy-tools-manager

Conversation

@sweepies

@sweepies sweepies commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

A cleanup pass over code written during the refactor, covering crates/tools, crates/manager, crates/lookup, crates/lockfiles and crates/words. Two commits: the tools fixes, then the manager/lookup/lockfiles refactor.

Behaviour fixes (each with a test that failed before)

  • Yarn: the committed .yarnrc.yml is always restored. The invocation is built before the sanitised copy is written, so an early return can no longer leave the sanitised copy behind.
  • mise lock: it now runs through the shared tool path, so it takes the store lock and gets the install timeout and usage records like every other tool. Its failures now read mise: ….
  • Credentialed tool failures: they say how the tool failed (the timeout or the exit status), never its output. GitHub authentication errors keep their report-safe cause.
  • Yarn percent escapes: decoded with percent-encoding, so %+A is no longer read as a newline.
  • web_host: drops only its own scheme's default port. http://host:443 is no longer judged public.
  • Version checks: one numeric check, so a .NET SDK version like 8..100 is no longer accepted.
  • Python and Ruby: an unchanged lock after a targeted upgrade says so, instead of "after the manifest edit".
  • Real-tool tests: they assert Planned and a changed lock where the fixture must change. The old Planned | Skipped assertion hid that the APM and Go fixtures change nothing; those now assert "already current", which proves the tool ran.

Cleanup (no behaviour change)

  • The proposal oracle is deleted. The test-only copy of the old predicates is replaced by behaviour tests per descriptor. The 23 descriptors now state only the facts true for their manager, built on a Proposing::BASE.
  • Duplicated helpers merged:
    • the "lock did not change" message, the default-version lookup, the env folding, the lock-file opener and the project-file walker;
    • in actions: canonical, the sha1- prefix stripping and the "not onboarded" message;
    • the leaf extraction (about 50 hand-written copies now use roles::leaf), the unread reason, excluded, the commit-hash check, same_track;
    • a Job::new constructor, and ACTIONS_LOCK in one place.
  • Lookup: proposing() and the pin policy are computed once per evaluation, and the three impl Evaluator blocks are merged into one.
  • Visibility and constants: visibility narrowed (the tool-token types are private), and the magic numbers are named.
  • Tests: a test_runner helper replaces 79 identical setups, the real-tool test helpers are shared, and a testing::dependency fixture builder is added.
  • Comments: history-narrating comments are rewritten, and the cache partition doc now describes all three partitions.
  • Compile-time checks: the refresh order is checked at compile time against every ecosystem.

Review fixes

  • The extract and files cache states go from 5 to 6, because the public-registry verdicts they store change (web_host, percent decoding).
  • Tool-store cleanup never uninstalls the pinned mise, which version lookups use without recording it.
  • The .NET lock and NuGet-config walks keep their original symlink and non-UTF-8 handling.

Follow-up

  • Lookup's wait-hour helpers treat a rule error as a wait of 0. Every caller is in crates/update and crates/engine, so that fix follows in a separate PR.

- `mise lock` runs through `Runner::tool`: the shared store lock, the
  install timeout, `clear_unproven` and usage records now apply to it.
- Yarn resolves its invocation before writing the sanitised `.yarnrc.yml`,
  so an early error can no longer leave the sanitised copy behind.
- A tool that held registry credentials reports how it failed (timeout or
  exit status), never its output; GitHub authentication errors keep their
  cause.
- A corrupt or unreadable tool usage record is logged.
- Store seeding and usage records run off the async runtime.
- The tool cache docs describe all three partitions.
- Cleanups: shared helpers for unchanged-lock errors, numeric versions,
  default versions, lock-file opening, credential folding and the dotnet
  walk; named constants; private visibility; Cargo run arguments as
  structs; real-tool tests assert what they produce; shared test helpers.
- Delete the test-only proposal oracle and its comparison test; each
  descriptor states the fields where it differs from `Proposing::BASE`,
  covered by behaviour tests per descriptor.
- Percent escapes decode through `percent-encoding` (`%+A` stays as
  written), and `web_host` drops only its own scheme's default port.
- One `ACTIONS_LOCK`, one `roles::leaf`, `Job::new`, `Prepared::per_file`,
  yaml descriptors as statics, `Unread::Failed.reason` and `commit_hash`
  reused, one unread warning per YAML file, and the refresh order covers
  every ecosystem at compile time.
- Lookup computes `proposing()` and the Pin policy once per evaluation,
  shares `same_track`, merges its `impl Evaluator` blocks and no longer
  expects a dated release.
- A `testing` feature gives other crates' tests one `Dependency` builder.
- Comments state the present rule; state hashes are refreshed.
@sweepies sweepies changed the title refactor(tools,manager): cleanup pass, with fixes for yarnrc restore and mise lock fix(tools,manager): yarnrc restore, mise lock store lock, and a cleanup pass Nov 14, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
count-patchula 276066a Commit Preview URL

Branch Preview URL
Nov 14 2026, 04:11 AM

…tion

- `clear_unproven` never uninstalls the pinned mise package: version
  lookups install and run it without recording a use, so on a store that
  was never prewarmed the first `mise lock` removed it from under them.
- The `packages.lock.json` walk follows symlinked directories and matches
  names as bytes again, and the NuGet config walk keeps its own rules,
  as before they were merged.
- The `extract` and `files` states go to version 6: the public verdicts,
  the Cargo leaf match and the single unread-YAML warning change what an
  extraction stores. Their rows, and the config rows that read the same
  sources, list `percent-encoding`; the other rows are rehashed.
@sweepies
sweepies merged commit 8142cd0 into main Nov 14, 2026
12 checks passed
@sweepies
sweepies deleted the refactor/sloppy-tools-manager branch November 14, 2026 04:43
@sweepies-ops sweepies-ops Bot mentioned this pull request Nov 14, 2026
sweepies added a commit that referenced this pull request Nov 14, 2026
sweepies added a commit that referenced this pull request Nov 14, 2026
… a cleanup pass (#307)

* fix(datasource,github): sloppiness pass over the datasource and GitHub crates

Behaviour fixes:
- datasource: one realm-trust rule for registry token services. A realm
  off the registry's origin must be on port 443 and be Docker Hub's
  auth.docker.io/token, gitlab.com/jwt/auth for registry.gitlab.com, or a
  self-hosted GitLab's <instance>/jwt/auth (tokens only); anything else is
  refused before any request.
- notes: owns its error type; a failed read returns its own error the
  first time and its kind and message when memoised. GitHub and forge
  notes share one release budget (newest versions first, 32 releases,
  12,000 bytes, stop when spent) and one finish step.
- http: a local cooldown past the longest wait is Error::Throttled, not a
  fake 429; corrupt cached metadata is Error::Metadata; transport errors
  keep a redacted kind (timeout, connect), which GitHub errors keep too.
- github: the governor parses a body only for a rate-limit status or a
  GraphQL answer; installation ids are bounded like every other id;
  redirect loops are Error::Redirect; mints lock per mint and scoped mints
  cache the repository id.
- config: settings validation names the failing field, registry key
  included; an unreadable secret file keeps its io error.

Cleanups: the retired +<build> cleanup is migration 014; Docker Hub's
pull window moves into the datasource rules and the http tests no longer
copy them; shared helpers replace duplicates (Version::new, one tag-tree
builder, the parity harness and file walker in testkit, hex, base
headers, queue SQL consts); named constants replace magic numbers;
history-narrating and stale comments are rewritten.

* fix(datasource,github): review fixes for the realm rule, mirror fallback and scoped mints

- datasource: a self-hosted GitLab registry on a port of its instance
  (registry_external_url 'https://gitlab.example.com:5050') takes tokens
  from the instance's /jwt/auth again, with token trust only. The guide
  names the layout that stays refused: a token service on another port of
  the registry's host.
- datasource: when the batched release read for mirror misses fails, the
  warm heads it read are kept and only the cold misses are asked again,
  concurrently.
- github: a scoped mint must come back narrowed to the repository asked
  for; a mismatch forgets the cached id, reads it again and mints once
  more, and a second mismatch is an error.
- mise: the io helper no longer splits a doc comment from its constant.

* chore: rehash state rows after rebasing onto #306
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant