Skip to content

Delegate transcript artifact references to lacing.ArtifactRef / resolve_in_mall (an#670) - #675

Merged
thorwhalen merged 2 commits into
mainfrom
lacing-artifact-ref
Oct 27, 2026
Merged

thorwhalen merged 2 commits into
mainfrom
lacing-artifact-ref

Conversation

@thorwhalen

Copy link
Copy Markdown
Collaborator

Closes #670

What. an/stores/transcripts.py delegates artifact: references to lacing (reeleehq/lacing#95, released in lacing 0.0.65, already a core dependency, imported lazily as before).

  • Parsing and formatting: ArtifactRef.parse(...).locate(mall, default_store=...) and ArtifactRef.format().
  • Resolution: 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.
  • Removed outright, not wrapped: parse_artifact_ref, ARTIFACT_REF_PREFIX, _REF, _PINNED, _pinned, _holds, _record, _has. Nothing else in the fleet imports them.
  • is_artifact_ref still accepts Artifact objects.
  • TranscriptLinkError messages 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):

  • A pin in capitals is read as a pin, lowercased.
  • Text without artifact: is refused by name instead of having its prefix sliced off.
  • artifact:takes/ looks up key takes/ in the transcripts store.
  • record_transcript refuses keys that no reference could name (with whitespace, or starting with /).

Compatibility kept: pin_of still reads a reference an older an recorded under a key lacing now refuses, such as transcripts/my take@<sha>. Without that, an cache gc would collect the transcript a take names. A refused key read back is formatted as it was recorded instead of raising a bare ValueError.

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.

  • Fixed: pin_of lost older references with spaces in the key, which could have let gc delete a take's transcript.
  • Fixed: an Artifact held under such a key raised a bare ValueError.
  • Accepted: an Artifact whose record exists but whose bytes are gone is now told "no record holds it" (main said "its content is missing").
  • Not done: the pin-mismatch message has no test; the reviewer checked it by hand.

🤖 Generated with Claude Code

thorwhalen and others added 2 commits October 27, 2026 18:40
`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>
@thorwhalen
thorwhalen merged commit 1b13284 into main Oct 27, 2026
14 checks passed
@thorwhalen
thorwhalen deleted the lacing-artifact-ref branch October 27, 2026 19:33
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.

Delegate artifact references to lacing.ArtifactRef / resolve_in_mall (lacing#90)

1 participant