Skip to content

Function: evaluateFsRequireReadBeforeWriteGuard() ​

ts
function evaluateFsRequireReadBeforeWriteGuard(
   _node, 
   input, 
   ctx
): PolicyGuardEvaluationResult;

Defined in: fs/src/executors/fs-write-guard-executors.ts:52

Evaluates an FsRequireReadBeforeWriteGuardNode (fs:require-read-before-write) (SPEC.md §4.3).

Rejects mutating any file that existed at baseRef unless ctx.observedEffects contains a prior read effect for that path in the current session.

Parameters ​

ParameterTypeDescription
_nodeFsRequireReadBeforeWriteGuardNodeRead-before-write guard AST node.
inputPolicyGuardEvaluationInputTool name, proposed effects, and active leases.
ctxStepExecutionContext<unknown>Step execution context providing observedEffects.

Returns ​

PolicyGuardEvaluationResult

Guard evaluation result and projected violatedEffects.

Released under the MIT License.