Skip to content

The rate cap bounds throughput but not persistence, so a retrying agent can bulk-scrape without ever exceeding 5/sec #507

Description

@sotashimozono

docs/LEGAL.md §6a safeguard 5 claims the hard-coded rate limit

prevents bulk-scraping patterns and cannot be overridden by configuration

It bounds 5 requests per second. It does not bound how many times the same request is made.

An agent that retries 500 failed DOIs ten times each emits 5,000 requests while never once exceeding 5/sec. That is a bulk pattern, produced entirely within the safeguard, by a caller behaving exactly as LLM callers behave when a failure looks retryable. The sibling issue on disposition (#506) covers why so many of them look retryable; this issue is about the fact that even a correct disposition is only advice, and advice is not a safeguard.

This is the same class as #493: a NORMATIVE claim that is broader than the mechanism behind it.

doiget is the only tool that can close this

Every fetch is already recorded. docs/PROVENANCE_LOG.md / ADR-0006 define a fail-closed, hash-chained JSON Lines log, and a fetch that cannot be logged does not proceed. So the data needed to answer "has this exact request already been made, and what happened?" is on disk before the network is touched.

That is worth stating plainly because it is not a portable idea: a fetcher that does not record its attempts cannot implement this at all. It turns safeguard 5 from "bounds rate" into "bounds rate and persistence", which is a materially stronger claim and one that can be demonstrated rather than asserted.

Proposed shape

Before the network leg, consult the provenance log for prior attempts on the same (ref, source) within a short window. Then:

  • prior outcome was terminal → do not re-fetch. Return the prior outcome, marked as replayed, with the original error and its denial_context.
  • prior outcome was needs_config → do not re-fetch, and return the remediation again. Nothing has changed unless the config changed, and whether it changed is checkable.
  • prior outcome was retry_after → enforce the wait rather than refuse. If the caller returns early, sleep the remainder or return RATE_LIMITED with the true remaining time.

Depends on #506: "the prior outcome was terminal" has to be a fact the code carries before it can be acted on.

Design constraints worth deciding up front

Notes

Refs #506, #493, #494, ADR-0006, ADR-0014.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions