Skip to main content

Class: ChangeArtifact

Defined in: packages/core/src/domain/entities/change-artifact.ts:36

Represents one artifact type within a change (e.g. proposal, specs, tasks).

Contains zero or more ArtifactFile entries — one per file the artifact produces. For scope: change artifacts there is typically one file keyed by the artifact type id. For scope: spec artifacts there is one file per specId.

Aggregated status: complete iff all files are complete or skipped; missing iff all files are missing or there are no files; in-progress otherwise.

See​

ArtifactFile

Constructors​

Constructor​

new ChangeArtifact(props): ChangeArtifact

Defined in: packages/core/src/domain/entities/change-artifact.ts:48

Creates a new ChangeArtifact from the given properties.

Parameters​

props​

ChangeArtifactProps

Artifact construction properties

Returns​

ChangeArtifact

Accessors​

files​

Get Signature​

get files(): ReadonlyMap<string, ArtifactFile>

Defined in: packages/core/src/domain/entities/change-artifact.ts:76

Read-only view of all files in this artifact.

Returns​

ReadonlyMap<string, ArtifactFile>


isComplete​

Get Signature​

get isComplete(): boolean

Defined in: packages/core/src/domain/entities/change-artifact.ts:95

Whether all files in this artifact have been validated or skipped.

Returns​

boolean


optional​

Get Signature​

get optional(): boolean

Defined in: packages/core/src/domain/entities/change-artifact.ts:66

Whether this artifact is optional in the schema.

Returns​

boolean


requires​

Get Signature​

get requires(): readonly string[]

Defined in: packages/core/src/domain/entities/change-artifact.ts:71

Artifact type IDs that must be complete before this one can be validated.

Returns​

readonly string[]


status​

Get Signature​

get status(): ArtifactStatus

Defined in: packages/core/src/domain/entities/change-artifact.ts:90

Aggregated validation status across all files.

  • complete — all files are complete or skipped (and at least one file exists)
  • skipped — all files are skipped (and at least one file exists)
  • missing — all files are missing or there are no files
  • in-progress — some files exist but not all are complete/skipped
Returns​

ArtifactStatus

The aggregated artifact status


type​

Get Signature​

get type(): string

Defined in: packages/core/src/domain/entities/change-artifact.ts:61

The artifact type identifier (matches the schema's artifacts[].id).

Returns​

string

Methods​

getFile()​

getFile(key): ArtifactFile | undefined

Defined in: packages/core/src/domain/entities/change-artifact.ts:106

Returns the file with the given key, or undefined if not present.

Parameters​

key​

string

The file key (artifact type id for scope:change, specId for scope:spec)

Returns​

ArtifactFile | undefined

The file, or undefined if not found


markComplete()​

markComplete(key, hash): void

Defined in: packages/core/src/domain/entities/change-artifact.ts:137

Records a successful validation for a specific file by storing the content hash and setting the file's status to "complete".

Parameters​

key​

string

The file key to mark complete

hash​

string

The SHA-256 hash of the validated content

Returns​

void


markDriftedPendingReview()​

markDriftedPendingReview(keys): void

Defined in: packages/core/src/domain/entities/change-artifact.ts:179

Marks only the selected files as drifted pending review.

Parameters​

keys​

readonly string[]

File keys to downgrade

Returns​

void


markPendingReview()​

markPendingReview(): void

Defined in: packages/core/src/domain/entities/change-artifact.ts:167

Marks all files in this artifact as pending review, preserving any more specific drifted-pending-review file states.

Returns​

void


markSkipped()​

markSkipped(): void

Defined in: packages/core/src/domain/entities/change-artifact.ts:153

Marks all files in this artifact as explicitly skipped.

Only optional artifacts may be skipped. Skipped artifacts satisfy dependency requirements -- dependents do not treat a skipped artifact as a blocker.

Returns​

void

Throws​

If this artifact is not optional


removeFile()​

removeFile(key): void

Defined in: packages/core/src/domain/entities/change-artifact.ts:125

Removes a file from this artifact.

Parameters​

key​

string

The file key to remove

Returns​

void


setFile()​

setFile(file): void

Defined in: packages/core/src/domain/entities/change-artifact.ts:115

Adds or replaces a file in this artifact.

Parameters​

file​

ArtifactFile

The file to set

Returns​

void


setFileStatus()​

setFileStatus(key, status): void

Defined in: packages/core/src/domain/entities/change-artifact.ts:195

Materializes an unvalidated file state discovered from the filesystem.

Intended for repository hydration of missing / in-progress entries whose file presence changed outside explicit validation flows.

Parameters​

key​

string

File key to update

status​

"missing" | "in-progress"

Newly observed state

Returns​

void