Skip to main content

Class: ArtifactFile

Defined in: packages/core/src/domain/value-objects/artifact-file.ts:33

Tracks the validation state of a single file within a multi-file artifact.

For scope: change artifacts there is one ArtifactFile keyed by the artifact type id. For scope: spec artifacts there is one ArtifactFile per specId.

Status is maintained in a mutable _status field, initialised from ArtifactFileProps.status (defaulting to "missing"). Use the explicit transition methods to mutate it, or read status to observe the current value.

See​

ChangeArtifact

Constructors​

Constructor​

new ArtifactFile(props): ArtifactFile

Defined in: packages/core/src/domain/value-objects/artifact-file.ts:44

Creates a new ArtifactFile from the given properties.

Parameters​

props​

ArtifactFileProps

File construction properties

Returns​

ArtifactFile

Accessors​

filename​

Get Signature​

get filename(): string

Defined in: packages/core/src/domain/value-objects/artifact-file.ts:57

Relative path within the change directory.

Returns​

string


isComplete​

Get Signature​

get isComplete(): boolean

Defined in: packages/core/src/domain/value-objects/artifact-file.ts:72

Whether this file has been successfully validated (status === "complete").

Returns​

boolean


key​

Get Signature​

get key(): string

Defined in: packages/core/src/domain/value-objects/artifact-file.ts:52

Identifier for this file within the artifact.

Returns​

string


status​

Get Signature​

get status(): ArtifactStatus

Defined in: packages/core/src/domain/value-objects/artifact-file.ts:62

The current validation status of this file.

Returns​

ArtifactStatus


validatedHash​

Get Signature​

get validatedHash(): string | undefined

Defined in: packages/core/src/domain/value-objects/artifact-file.ts:67

The SHA-256 hash recorded at the last successful validation, or undefined.

Returns​

string | undefined

Methods​

markComplete()​

markComplete(hash): void

Defined in: packages/core/src/domain/value-objects/artifact-file.ts:82

Records a successful validation by storing the content hash and setting the status to "complete".

Parameters​

hash​

string

The SHA-256 hash of the validated file content

Returns​

void


markDriftedPendingReview()​

markDriftedPendingReview(): void

Defined in: packages/core/src/domain/value-objects/artifact-file.ts:112

Marks this file as drifted from its validated content while preserving the last validated hash for diagnostics and future revalidation.

Returns​

void


markInProgress()​

markInProgress(): void

Defined in: packages/core/src/domain/value-objects/artifact-file.ts:120

Marks this file as present but not yet validated.

Returns​

void


markMissing()​

markMissing(): void

Defined in: packages/core/src/domain/value-objects/artifact-file.ts:128

Marks this file as absent and not yet validated.

Returns​

void


markPendingReview()​

markPendingReview(): void

Defined in: packages/core/src/domain/value-objects/artifact-file.ts:102

Marks this file as requiring review while preserving the last validated hash.

Drift is sticky: once a file is drifted-pending-review, downgrading it to the broader review state is ignored until it is revalidated.

Returns​

void


markSkipped()​

markSkipped(): void

Defined in: packages/core/src/domain/value-objects/artifact-file.ts:91

Marks this file as explicitly skipped, storing the sentinel hash and setting the status to "skipped".

Returns​

void