Skip to content

First-class artifact info: Literal.artifact_id + Outputs.produced_artifacts - #7760

Merged
kumare3 merged 1 commit into
artifact-trigger-protosfrom
artifact-info-protos
Aug 4, 2026
Merged

First-class artifact info: Literal.artifact_id + Outputs.produced_artifacts#7760
kumare3 merged 1 commit into
artifact-trigger-protosfrom
artifact-info-protos

Conversation

@kumare3

@kumare3 kumare3 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Stacked on #7749. Replaces the implicit metadata-key contract (magic _ua/_uap keys inside Literal.metadata carrying JSON payloads that the Python SDK and Go backends must keep byte-in-sync) with typed fields, split by lifecycle:

Identity → the value (permanent, value-intrinsic):

  • core.ArtifactVersionId { ArtifactKey key; string version; } — minimal identity, deliberately not the v1-heritage ArtifactID (no partition machinery)
  • core.Literal.artifact_id — stamped once at artifact registration (and on artifact-bound inputs); travels with the value through every copy; participates in cache-key hashing by design (two versions of an artifact are distinct inputs even when bytes coincide)

Registration declaration → the output envelope (transient, slot-scoped):

  • task.ProducedArtifact { output, name, version?, core.ArtifactInfo info, core.LiteralType type } + task.Outputs.produced_artifacts = 3 — an action-scoped instruction that never enters the value stream or downstream hashes. Field 3 (not 2) because outputs.pb blobs are cross-decoded as task.Inputs, where field 2 is context. The declared type makes the declaration self-contained (backends no longer need a task-interface lookup with a silent nil-type drop).

Shared descriptive payload:

  • core.ArtifactInfo { description, user_metadata, card } + core.ArtifactCard (hoisted from artifact.Card, identical shape) — used verbatim by both task.ProducedArtifact.info and the restructured artifact.ArtifactSpec { value, type, info, source }, and excluding identity so declaration and spec can never drift.

Consumers (union cloud leaseworker/artifact service, flyte-sdk) migrate in their respective stacks; the metadata keys are deleted outright there since the artifact stack is unreleased.

🤖 Generated with Claude Code

…ifacts

Replaces the implicit metadata-key contract (magic "_ua"/"_uap" keys in
Literal.metadata carrying JSON payloads that SDKs and backends had to keep in
sync) with typed fields, split by lifecycle:

- core.ArtifactVersionId (ArtifactKey + version), core.ArtifactCard (hoisted
  from artifact.Card, same shape), and core.ArtifactInfo (description,
  user_metadata, card) — the descriptive payload shared by the production
  declaration and the stored spec, deliberately excluding identity so the two
  can never drift.
- core.Literal.artifact_id: the value's artifact identity, stamped once at
  registration and on artifact-bound inputs; travels with the value through
  every copy and participates in cache-key hashing by design.
- task.ProducedArtifact + Outputs.produced_artifacts: the transient
  registration declaration (output name, artifact name, optional version,
  info, declared type) — an action-scoped instruction that never enters the
  value stream. Field 3 on Outputs because outputs.pb blobs are sometimes
  cross-decoded as task.Inputs, where field 2 is context.
- artifact.ArtifactSpec now nests the descriptive payload as core.ArtifactInfo
  (value/type/source stay top-level); artifact.Card is removed in favor of
  core.ArtifactCard.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
}

// Only valid for triggers
message ArtifactBindingData {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this used?

@@ -14,6 +15,42 @@ message ArtifactKey {
string org = 4;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add validation to these fields?

@kumare3
kumare3 merged commit d9c30ed into artifact-trigger-protos Aug 4, 2026
17 checks passed
@kumare3
kumare3 deleted the artifact-info-protos branch August 4, 2026 01:02
kumare3 added a commit that referenced this pull request Aug 4, 2026
* Add artifact trigger automation: TYPE_ARTIFACT + ArtifactTrigger

Third TriggerAutomationSpec automation type: fire a run when a new version of
the named artifact is created. ArtifactTrigger carries the watched artifact
name, an optional exact-version pin, and the task input the artifact's value
binds to at fire time (mirroring Schedule.kickoff_time_input_arg). Also adds
RUN_SOURCE_ARTIFACT_TRIGGER so artifact-triggered runs carry their provenance.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* First-class artifact info: Literal.artifact_id + Outputs.produced_artifacts (#7760)

Replaces the implicit metadata-key contract (magic "_ua"/"_uap" keys in
Literal.metadata carrying JSON payloads that SDKs and backends had to keep in
sync) with typed fields, split by lifecycle:

- core.ArtifactVersionId (ArtifactKey + version), core.ArtifactCard (hoisted
  from artifact.Card, same shape), and core.ArtifactInfo (description,
  user_metadata, card) — the descriptive payload shared by the production
  declaration and the stored spec, deliberately excluding identity so the two
  can never drift.
- core.Literal.artifact_id: the value's artifact identity, stamped once at
  registration and on artifact-bound inputs; travels with the value through
  every copy and participates in cache-key hashing by design.
- task.ProducedArtifact + Outputs.produced_artifacts: the transient
  registration declaration (output name, artifact name, optional version,
  info, declared type) — an action-scoped instruction that never enters the
  value stream. Field 3 on Outputs because outputs.pb blobs are sometimes
  cross-decoded as task.Inputs, where field 2 is context.
- artifact.ArtifactSpec now nests the descriptive payload as core.ArtifactInfo
  (value/type/source stay top-level); artifact.Card is removed in favor of
  core.ArtifactCard.

Co-authored-by: Ketan Umare <kumare3@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Ketan Umare <kumare3@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
kumare3 added a commit to flyteorg/flyte-sdk that referenced this pull request Aug 4, 2026
…act_id

Replaces the magic literal-metadata keys ("_ua"/"_uap") with the typed fields
from flyteorg/flyte#7760, split by lifecycle:

- Producing: convert_from_native_to_outputs emits ProducedArtifact
  declarations on the Outputs envelope (output name, artifact name, optional
  version, ArtifactInfo, and the declared LiteralType — the SDK is
  authoritative for it). The output literal itself carries nothing; the
  compact-JSON codec and both metadata-key constants are deleted.
- Consuming: artifact-bound run inputs get the typed Literal.artifact_id
  (core.ArtifactVersionId) — value-intrinsic identity, per-element for
  collections, no string parsing.
- ArtifactSpec restructure: create() nests description/user_metadata/card as
  spec.info (core.ArtifactInfo); the card type is the hoisted
  core.ArtifactCard.
- Display: artifact_annotation reads the typed identity;
  produced_artifact_annotation renders envelope declarations (Outputs repr and
  ActionOutputs annotate from both).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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