Skip to content

fix(lookup): a rule error holds the wait instead of waiting 0 hours - #309

Merged
sweepies merged 2 commits into
mainfrom
fix/wait-hours-fail-closed
Nov 14, 2026
Merged

sweepies merged 2 commits into
mainfrom
fix/wait-hours-fail-closed

Conversation

@sweepies

@sweepies sweepies commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

The last piece of the cleanup pass (#306, #307, #308): a fix that crosses crates, plus the leftovers the three groups couldn't reach.

Behaviour fix: a rule error no longer means "wait 0 hours"

Lookup's wait-hour helpers (catalog_wait_hours, lockfile_wait_hours, routine_wait_hours, security_wait_hours) dropped rule errors and returned 0, which is the permissive direction. They now return the error, and each caller fails closed:

  • A Cargo lockfile job: the branch is held with the rule error (<dependency>: <error>). Cargo never runs with a wait the rules didn't give.
  • Lockfile maintenance: the plan is held with the rule error (see guide/lockfiles.md).
  • The engine's catalog reuse: a rule error reuses no saved catalog, because a wait of 0 fetches fresh, which is the strict direction here. The dependency's evaluation fails on the same rule, and that becomes its reported lookup failure.

Cleanup

  • One truncation helper: markers::cut_bytes is gone in favour of patchula_datasource::upstream::truncate, which behaves identically on bytes and char boundaries.
  • Generic HTTP status errors say "HTTP {n}", not "registry HTTP {n}", since most are not registry reads. One dashboard transcript line and the example in reference/report.md change with it.
  • The test fake's State.requests is now derived from State.log.
  • with_cache_limit replaces set_cache_limit, to match the other builder methods.

State rows are rehashed with no version bumps.

Reported only: the CLI's in-place plan ignores the committed-credentials refusal. It runs no lockfile tools and only follows a local lookup that honours the refusal, so this has no practical effect. Closing it would be one line in crates/cli/src/plan.rs.

View guided diff Turn on auto-fix

…ke requests, with_cache_limit

- update's marker and body truncation use patchula_datasource::upstream::truncate;
  markers::cut_bytes is gone (same byte and char-boundary behaviour).
- patchula_http's Error::Status reads "HTTP {n}" for every request, not
  "registry HTTP {n}".
- The fake GitHub's State keeps one request log; requests() derives
  (method, path) from it.
- patchula_tools::Runner::with_cache_limit replaces set_cache_limit.
@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 05c7cdf Commit Preview URL

Branch Preview URL
Nov 14 2026, 06:45 AM

@sweepies
sweepies merged commit 77b339c into main Nov 14, 2026
13 checks passed
@sweepies
sweepies deleted the fix/wait-hours-fail-closed branch November 14, 2026 06:53
@sweepies-ops sweepies-ops Bot mentioned this pull request Nov 14, 2026
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