Repository navigation
Delegate transcript artifact references to lacing.ArtifactRef / resolve_in_mall (an#670) - #675
Merged
Merged
Conversation
`an.stores.transcripts` now parses, formats and resolves `artifact:[<store>/]<key>[@<sha256>]` through `lacing.ArtifactRef`, `ArtifactRef.locate` and `lacing.resolve_in_mall` (lacing#90/#95) instead of its own regexes, store guess and catalog scans. Removed: `parse_artifact_ref`, `ARTIFACT_REF_PREFIX` (use lacing's), `_REF`, `_PINNED`, `_pinned`, `_holds`, `_record`, `_has`. `is_artifact_ref` still accepts `lacing.Artifact`s; an Artifact is resolved as a pin, so lacing finds its holder (indexed on a SQL catalog). `pin_of` reads the unprefixed provenance spelling with `require_prefix=False`; `record_transcript` refuses a key no reference could name, by lacing's rule. TranscriptLinkError messages keep "no such store", "no such key", "content no longer kept" and "not transcript artifacts" distinct, and add "does not match its pin" (lacing verifies pinned bytes). Accepted differences (lacing's, intended): a pin in capitals is a pin, text without `artifact:` is refused rather than sliced, `artifact:takes/` names key `takes/` of the default store, and keys with whitespace or a leading `/` are refused when recorded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ormatted as recorded Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #670
What.
an/stores/transcripts.pydelegatesartifact:references to lacing (reeleehq/lacing#95, released in lacing 0.0.65, already a core dependency, imported lazily as before).ArtifactRef.parse(...).locate(mall, default_store=...)andArtifactRef.format().resolve_in_mall, which tries the key first, scans only when the key no longer holds the pin, and checks the bytes against the pin.parse_artifact_ref,ARTIFACT_REF_PREFIX,_REF,_PINNED,_pinned,_holds,_record,_has. Nothing else in the fleet imports them.is_artifact_refstill acceptsArtifactobjects.TranscriptLinkErrormessages stay distinct: no such store, no such key, content no longer kept, not an artifact store, damaged record, and a new "does not match its pin".Behaviour changes accepted (from lacing):
artifact:is refused by name instead of having its prefix sliced off.artifact:takes/looks up keytakes/in the transcripts store.record_transcriptrefuses keys that no reference could name (with whitespace, or starting with/).Compatibility kept:
pin_ofstill reads a reference an olderanrecorded under a key lacing now refuses, such astranscripts/my take@<sha>. Without that,an cache gcwould collect the transcript a take names. A refused key read back is formatted as it was recorded instead of raising a bareValueError.Tests: recorded-voices, import-firewall and gc tests plus doctests: 132 passed, 4 skipped (the cut-out genre is not installed here). The new test covers lacing reading the reference, the distinct refusals, a pin in capitals, refused keys, and an older
an's key.Implementation: an Opus worker subagent, reviewed by a separate fresh Opus subagent.
Adversarial review: ship with fixes.
pin_oflost older references with spaces in the key, which could have let gc delete a take's transcript.ValueError.🤖 Generated with Claude Code