Skip to content

feat(get): --cache fetches from a mirror, records the canonical source ([17]) - #245

Merged
christophergeyer merged 4 commits into
rc/0.4.1from
cg/get-cache-source
Jul 27, 2026
Merged

feat(get): --cache fetches from a mirror, records the canonical source ([17])#245
christophergeyer merged 4 commits into
rc/0.4.1from
cg/get-cache-source

Conversation

@christophergeyer

Copy link
Copy Markdown
Member

What

roar get <canonical-url> --cache <s3-url> — the DAG-source design settled in the campaign (infra-spec §3):

  • Canonical URL is the source of truth — always the recorded source_url/downloadLocation (stranger-reachable), never the cache.
  • --cache is a declared accelerator — fetch prefers the (fast, private) mirror, hash-verifies the bytes against the canonical expectation, and falls back to canonical on any cache miss/corruption. Cache is trusted for speed, never identity.
  • The --cache arg is recorded on the get step and propagated to reproduce, so capture and reproduce behave identically.
  • Also records canonical source_type/source_url on get'd artifacts (complements fix(register): carry source_url into artifact metadata for AI-BOM downloadLocation #239's registration-side carry).

Why

Lets expensive instances pre-fetch datasets from a fast S3 mirror without polluting the DAG's provenance — the recorded origin stays the public canonical URL. Output-side sibling is [71] (roar put → HF).

Tests

tests/application/get/test_service.py — 10 passing (cache-hit/verify/fallback, canonical recording). ruff + format clean (pinned 0.15.21). Merged rc/0.4.1 in (ruff pin).

Should ride the 0.4.1 release.

🤖 Generated with Claude Code

chrisgeyertreqs and others added 4 commits July 24, 2026 15:11
A roar get'd file becomes a SOURCE node, but its artifact row carried NULL
source_type/source_url — the URL lived only in the get job's command. So a
downstream AI-BOM had no source to derive downloadLocation from (the confirmed
97.5-not-100 gap for http/get-fetched data). The recorder and schema already
support these fields (schema comment: source_type 'https', NULL=local); the get
service just never set them.

Set source_type = parsed scheme and source_url = each file's canonical remote_url
(falling back to the request source). Adds a GetRequest.cache field: when a mirror
is used, the CANONICAL source is still recorded, so downloadLocation stays the
public URL, not the private mirror. (The --cache FETCH path is a follow-up commit.)

Repro fixed end-to-end: roar get https://... now records source_type=https +
source_url on the artifact (was NULL). Regression tests added. ruff+mypy clean,
36 get tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds `roar get <url> --cache <mirror>`: fetch bytes from the mirror (the
in-region cost win) while recording <url> as the canonical source_type/source_url
(so the AI-BOM downloadLocation stays the public URL, never the private mirror).
The mirror is hash-verified against --hash when given, and by content-addressing
at reproduce time; on miss / unreachable / hash-mismatch it falls back to the
canonical source. The recorded command carries --cache so a reproduce replays
cache-first-then-canonical.

Verified end-to-end: fetch-from-mirror-record-canonical, and fallback on an
unreachable mirror. ruff+mypy clean, 26 get tests pass (4 new).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@christophergeyer
christophergeyer marked this pull request as ready for review July 27, 2026 16:06
@christophergeyer
christophergeyer merged commit 0b473c1 into rc/0.4.1 Jul 27, 2026
15 checks passed
@christophergeyer christophergeyer mentioned this pull request Jul 27, 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.

2 participants