diff --git a/schema/CodeChunk.schema.yaml b/schema/CodeChunk.schema.yaml index 202a0641..3bc351bc 100644 --- a/schema/CodeChunk.schema.yaml +++ b/schema/CodeChunk.schema.yaml @@ -20,6 +20,26 @@ properties: items: $ref: BlockContent - type: string + executeAuto: + '@id': stencila:executeAuto + description: Under which circumstances the node should be automatically executed. + enum: + - Never + - Needed + - Always + default: Needed + $comment: | + `Never`: Never automatically execute the code chunk. Only execute when the user explicitly runs + the code (or its containing document). + `Needed`: Automatically execute the code chunk if needed. Execute the code chunk if it is an + upstream dependency of a node that has been executed, or is a downstream dependent of a node that + has been executed. + `Always`: Always execute the code, even if it, or its dependencies, are unchanged since the + last time it was executed. + executePure: + '@id': stencila:executePure + description: Whether the code should be treated as side-effect free when executed. + type: boolean outputs: '@id': stencila:outputs description: Outputs from executing the chunk. diff --git a/schema/CodeExecutable.schema.yaml b/schema/CodeExecutable.schema.yaml index 37d3314b..2c44848b 100644 --- a/schema/CodeExecutable.schema.yaml +++ b/schema/CodeExecutable.schema.yaml @@ -63,7 +63,7 @@ properties: last executed. executeStatus: '@id': stencila:executeStatus - description: Status of the most recent, including in progress, execution of the code. + description: Status of the most recent, including any current, execution of the code. enum: - Scheduled - ScheduledPreviouslyFailed diff --git a/schema/CodeExpression.schema.yaml b/schema/CodeExpression.schema.yaml index 7dd335b1..d6cdb9a7 100644 --- a/schema/CodeExpression.schema.yaml +++ b/schema/CodeExpression.schema.yaml @@ -11,3 +11,7 @@ properties: description: The value of the expression when it was last evaluated. allOf: - $ref: Node +$comment: + Note that `CodeExpression` nodes lack the `executeAuto` and `executePure` properties that + `CodeChunk` nodes have because they will always be executed (when dependencies) change and + should be side-effect free. diff --git a/ts/bindings/rust.ts b/ts/bindings/rust.ts index 45ef5e80..c06a7715 100644 --- a/ts/bindings/rust.ts +++ b/ts/bindings/rust.ts @@ -83,6 +83,7 @@ const noBoxTypes = [ 'ClaimClaimType', 'CodeExecutableExecuteRequired', 'CodeExecutableExecuteStatus', + 'CodeChunkExecuteAuto', 'ListOrder', 'NoteNoteType', 'SoftwareSessionStatus',