Skip to content

boundaries

propose: a model writes a boundaries file from censuses of the model, checked on receipt. audit: the precision per rule of the shipped boundaries-audit walk.

propose shows a model no code: counts over the graph — annotations by use, supertypes, the names of operations nothing calls, the types that hold them and their suffixes, the external code the model calls with its members, the files whose name says wiring. Two calls per language, one per half (inbound, outbound), each with a strict response schema. What comes back is checked before it is written:

  1. The names are given, not chosen. A key the census did not show, or a pattern that matches none of its names, is dropped and listed.
  2. Every rule is run. A rule that finds no row is dropped and listed; an operations or types rule taking more than a quarter of the uncalled operations is kept and flagged broad, to audit.
  3. A person’s file is never overwritten. The file’s proposal header holds the digest of what was proposed. A file at --out that no longer digests to it (or has none, or is not JSON) is left as it is: the proposal is written beside it as FILE.proposed, and the diff is printed on stdout.

Synopsis

codegraph boundaries <propose|audit> [model.jsonl] [--out FILE] [--name NAME] [--provider <auto|openrouter|cloudflare|claude-code>] [--claude-path FILE] [--model SLUG] [--max-tokens N] [--boundaries FILE] [--store FILE] [--per-rule N] [--threshold P] [--no-cache] [--dry-run] [--estimate] [--price-in USD] [--price-out USD] [--yes] [--json]

Arguments

ArgumentMeaningDefault
<propose|audit>propose: show a model the censuses and write the boundaries file it answers; audit: read the boundaries-audit walk’s store as a precision per rule.—
[model.jsonl]The model, of one language.<current-dir>-codegraph.jsonl

Options

OptionMeaningDefault
--out FILEpropose: the boundaries file to write; a file a person wrote or edited is never replaced (FILE.proposed and a diff instead).<model>.boundaries.json
--name NAMEpropose: the file’s name key.proposed
--provider NAMEpropose: where the two calls go, as for walk.auto
--claude-path FILEpropose: the Claude Code binary.—
--model SLUGpropose: the model slug.per provider
--max-tokens Npropose: cap on the tokens one answer may use.—
--boundaries FILEaudit, required: the boundaries file the audit walk was run with.—
--store FILEaudit: the walk’s store.<model>.boundaries-audit.walk.db
--per-rule Naudit: rows sampled per rule; the shipped walk’s sample.perRule.5
--threshold Paudit: a rule whose precision is below this is listed for removal.0.8
--no-cacheRead the model.jsonl directly; never build or reuse a sibling model.db.—
--dry-runpropose: print the two prompts as they would be sent, and make no call.—
--estimatepropose: print the calls and the token volume, and make no call.—
--price-in USD, --price-out USDpropose: per million tokens, for the estimate’s cost line.—
-y, --yespropose: run without asking. Otherwise the estimate is printed and a yes is asked for, which needs a terminal.—
--jsonOne machine-readable document on stdout.—

Each verb refuses the other’s flags.

The audit

The shipped walk plugin/walks/boundaries-audit.json asks, of 5 rows per inbound rule sampled by a hash of the ids (the same on every run), whether the entity is an entry point, of which kind, and at which shown line it is wired. Its prompt names no rule. boundaries audit then prints, per rule, the rows sampled, the answers yes, no and unsure, how many confirmed rows agree with the rule’s kind, and the precision yes / (yes + no). A rule under the threshold is listed for removal: nothing is rewritten, the file is yours to edit.

codegraph boundaries propose model.jsonl --estimate
codegraph boundaries propose model.jsonl --out proposed.boundaries.json
codegraph walk model.jsonl --walk plugin/walks/boundaries-audit.json --boundaries proposed.boundaries.json --estimate
codegraph boundaries audit model.jsonl --boundaries proposed.boundaries.json

Exit codes

0 ok · 1 internal error (a bug) · 2 usage error · 3 findings.

A model of several languages, an answer that does not follow its schema, a run with calls and no terminal to confirm on without --yes, and audit without its store are usage errors. A proposal written beside a person’s file is not an error.

Example

$ codegraph boundaries propose fixtures/elixir/expected/model.jsonl --estimate --price-in 0.10 --price-out 0.60
boundaries propose (ex): 2 model calls, one per half; writes fixtures/elixir/expected/model.boundaries.json
  census: 36 uncalled operations; annotations 0, supertypes 4, operation names 32, types 21, suffixes 18, stubs 15, containers 2, wiring files 2
  model: openai/gpt-5.6-luna (openrouter)

  call         input tokens  output tokens
  inbound             1 421          1 500
  outbound              910          1 500
  total               2 331          3 000

  cost at $0.1/M in, $0.6/M out: $0.0020
  input ≈ system, census and schema at 4 characters per token; output ≈ 1500 per call, assumed, not measured.

See also

Boundaries file · walk · analyze · CLI conventions

Last updated on