fix(gorilla-s3): prefix bare-basename keys from agent-produced index entries - #93
Merged
Merged
Conversation
Pre-v7 the backend's `bucket_prefix` accepted only the long-form
`{year}`/`{month}`/`{day}`/`{hour}` placeholders, but the agent-side
`gorillas3processor` (and the v6 demo deploy's
`ASAP_GORILLA_S3_PREFIX_TEMPLATE`) writes objects under the
short-form `{YYYY}`/`{MM}`/`{DD}`/`{HH}` spelling. So when a
deploy used the short-form template, `{tenant}` and `{metric}`
substituted but the timestamp placeholders stayed literal — every
backend `index.json` fetch issued a path like
`default/<metric>/{YYYY}/{MM}/{DD}/{HH}/index.json` that missed the
real chunks on disk.
Issue #46 criterion ⑥ (freshness probes) surfaced as 0 samples on
every path because of this — the chunks were on MinIO, the routing
table directed the query through the Gorilla engine, but the cold
store could not find them. v7 dual-routing closed the routing-side
gap; this aligns the placeholder vocabulary so the chunks are
actually located.
The fix accepts BOTH spellings; existing deploys using the long-form
keep working unchanged.
3 new tests: long-form preserved, agent-side aliases work,
mixed-form works.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…mvp/v7-prefix-template-alignment
…entries When the agent's gorillas3processor writes index.json, each entry's `object` field carries just the chunk basename (e.g. `part-1778128694-000000.gor`). Backend-produced entries carry the full S3 key (e.g. `tenant/metric/2026/05/07/04/part-1778128694-000000.gor`). `list_chunks` was passing entry.key through to ChunkRef.key unchanged, so subsequent `read_chunk` issued GET against the bare basename and hit "not found". The agent-side index.json deserialize landed in the v7 follow-ups, but the keys-need-prefixing tail is only visible end-to-end. Fix: in `list_chunks`, detect a bare basename (no `/` in entry.key) and prepend the per-hour `bucket_prefix(metric, hour_ms)`. Preserves backend-produced entry handling exactly (key already contains `/`). Required for issue #46 criterion ⑥ archive freshness path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closed
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #91 / #92 — the last hop of issue #46 ⑥ archive freshness.
The agent's
gorillas3processorwrites index.json entries with the chunk's basename in theobjectfield (e.g.part-1778128694-000000.gor). The backend-produced index entries (and the existingIndexEntrytest fixtures) carry the full S3 key (e.g.tenant1/metric/2026/05/06/12/part-A.gor).list_chunkswas passingentry.keythrough toChunkRef.keyunchanged, so for agent-produced entries the subsequentread_chunkissued GET against the bare basename and got "not found".This PR detects a bare basename (
!entry.key.contains('/')) and prepends the per-hourbucket_prefix(metric, hour_ms). Backend-produced full keys pass through unchanged.Without this, the v7 demo's freshness phase still gets 0 archive-path samples even after #91 (planner accepts
last_over_time) and #92 (placeholder vocabulary aligned).Test plan
gorilla_s3cold-store tests pass (existing tests use full keys; the bare-key path is exercised end-to-end by the v7 demo rerun)🤖 Generated with Claude Code