# Small local tools

These tools make no network or model calls. Node.js 20 or newer is required.

## Price a recorded token mix

```sh
node tools/core.cjs price tools/price-example.json
```

Expected API-equivalent value: $37.20 for the synthetic example. Counts are raw tokens; rates are USD per million. Missing or negative counts/rates are errors, not zero. Record the model, date and any modifiers alongside your actual input.

## Check a compact finding

```sh
node tools/core.cjs finding templates/finding.json
```

Expected: valid true. The example is an observation with no baseline and publicationPermission false. Structure validation does not prove evidence, detect all sensitive free text or authorize submission.

## Run behavioral checks

```sh
node --test tools/core.test.cjs kit/local-memory.test.cjs
```

Tests cover distinct cache pricing, invalid measurement inputs, incompatible comparison units, explicit limits/consent, safe relative export paths, guarded updates and competing claims. In a restricted Windows sandbox, use `node --preserve-symlinks --preserve-symlinks-main` before the same arguments.

## Agentic Kanban tools

`flow.cjs` computes the morning brief and the weekly report from records, with no model:

    node tools/flow.cjs brief framework/example-board.json dev-a@example.org
    node tools/flow.cjs report framework/example-board.json

The brief lists decisions, work to resume, reviews and ready work, and returns at most three top actions; an empty board returns `"empty": true`. The report counts an epic once (its parts roll in), and reports cost per accepted task as `null` when any attempt is unpriced. Run the tests with `node --test tools/flow.test.cjs`.
