AGPL-3.0-or-later · forever.

tutorial · live

Refuse before CI spends.

Turn the engine audit, the static cost floor and a mock rehearsal into one typed pull-request gate.

A pull request should prove the file is clean, bound the spend shape and rehearse the same graph on mock access before a protected job receives real authority.

Install a known engine and client pair.

Pin both artifacts and print both versions. Their release numbers do not need to match; the local driver follows the versioned machine contract and must make any real compatibility floor explicit.

nika --version
npm ls @supernovae-st/nika-client

Fail on findings and unknown spend.

A clean boolean is necessary, but it is not the whole admission decision. Read the cost shape explicitly and reject an unbounded plan when the CI policy requires a dollar ceiling.

const report = await nika.check('workflow.nika.yaml', {
  model: 'mock/echo',
  nativeStrict: true,
})

if (!report.clean) {
  console.error(report.findings)
  process.exit(2)
}

if (report.cost?.has_unbounded) {
  console.error('CI requires a bounded model price')
  process.exit(3)
}

Record what the engine plans.

The dry-run object gives reviewers the waves, task verbs, requirements and declared boundary without starting the workflow.

const plan = await nika.dryRunPlan('workflow.nika.yaml')
console.log(JSON.stringify({
  workflow: plan.workflow,
  waves: plan.waves,
  permits: plan.permits,
}, null, 2))

Run the graph without provider authority.

Use the mock model in pull requests. Give provider keys and deployment authority only to the protected job that needs them.

const run = await nika.runToEnd('workflow.nika.yaml', {
  model: 'mock/echo',
  maxCostUsd: 0,
})

if (!run.ok) process.exit(run.exitCode)