Skip to content

Add conditional-GET caching for policy-doc fetches #4842

Description

@JSONbored

Problem: Policy documents (contribution/AI-usage guidance) are refetched from GitHub on every single discover invocation even though they rarely change, burning rate-limit budget on essentially static content.

Area: AMS / Performance

Proposal: Add ETag/If-None-Match conditional-GET support to the policy-doc fetch path.

Deliverables:

  • Conditional-GET wired into the policy-doc fetch, with a local cache of the last-known ETag/content.

Acceptance criteria:

  • A repeated discover run against an unchanged repo makes a conditional request and consumes no additional rate-limit budget when the doc hasn't changed.

Scope note: this issue is limited to the HTTP-level fetch mechanism (ETag / If-None-Match) for the policy document. It must not change how the fetched content is parsed or how a policy verdict is derived from it — that logic stays out of scope. On any error, timeout, or ambiguous cache state, the fetch must fail safe by refetching the full document rather than serving a possibly-stale cached copy: silently serving stale policy content that could let the autonomous loop treat a now-opted-out repo as eligible is out of scope for this issue and stays maintainer-owned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions