@startuml
interface Artifact
interface ArtifactReducer
interface ArtifactKind
interface ArtifactKindRegistry
interface ArtifactRepository
interface MaterializingArtifactWriter
interface Projection

class DefaultArtifactReducer
class DefaultArtifactKindRegistry
class ArtifactProjector

class ArtifactState
class ArtifactLineage
class ArtifactRelationship
class FileWrittenKind
class ProcessResultKind
class FileWrittenPayload
class FileWrittenArtifact
class ProcessResultArtifact
class TypedArtifactSlot

ArtifactReducer <|.. DefaultArtifactReducer
ArtifactKindRegistry <|.. DefaultArtifactKindRegistry
ArtifactKind <|.. FileWrittenKind
ArtifactKind <|.. ProcessResultKind
Projection <|.. ArtifactProjector
ArtifactProjector --> ArtifactReducer

DefaultArtifactKindRegistry --> ArtifactKind
DefaultArtifactReducer ..> ArtifactState
ArtifactState --> ArtifactLineage
ArtifactLineage --> "relationships" ArtifactRelationship

FileWrittenKind ..> FileWrittenPayload
FileWrittenKind ..> FileWrittenArtifact
ProcessResultKind ..> ProcessResultArtifact

package "core:events" <<External>> {
  [ArtifactCreatedEvent]
  [ArtifactValidatingEvent]
  [ArtifactValidatedEvent]
  [ArtifactRejectedEvent]
  [ArtifactSupersededEvent]
  [ArtifactArchivedEvent]
  [ArtifactRelationshipAddedEvent]
}
package "core:artifacts-store" <<External>> {
  [ArtifactStore]
}

DefaultArtifactReducer ..> "core:events"
ArtifactProjector ..> "core:events"
MaterializingArtifactWriter ..> "core:artifacts-store"

@enduml
