Expand description
Bounds and effect policy of the experimental --use-formal-ai mode
(issue #255). Mirrors js/src/lib/formal-ai-policy.js.
Formal AI owns the interpretation of a natural-language request and picks the tool calls; start owns the permission to run them. Every tool call is a POSIX command line that start tokenizes itself and runs as an argv vector, never through a shell, so a call that needs shell syntax (pipes, redirects, substitutions, globs, variables) is refused instead of being interpreted.
Structs§
- Bound
Spec - One START_FORMAL_AI_* bound: environment variable, default and range.
- Bounds
- Resolved bounds of one run.
- Decision
- Decision about one tool call.
- Effect
Diff - Differences between two fingerprints.
- Fingerprint
- Bounded fingerprint of a directory tree (names, types, sizes, mtimes).
- Policy
Context - What a read observed, so a later change may name it.
- Tokenized
- Words of a command line and the shell syntax it would have needed.
- Verification
- Result of reading a change back from the filesystem.
Constants§
- BOUND_
DEFAULTS - EFFECT_
MODES - EXIT_
BUDGET - Step, tool, time or retry budget exhausted.
- EXIT_
CONFIG - Invalid START_FORMAL_AI_* bound.
- EXIT_
PROTOCOL - Malformed response, unknown tool or unverified effect.
- EXIT_
REFUSED - A tool call was refused by the effect policy.
- EXIT_
UNAVAILABLE - No qualified Formal AI runtime could be resolved.
- EXIT_
UNSUPPORTED - Formal AI reported that it did not understand the task.
- EXIT_
USAGE - Request text or option combination rejected.
- READ_
PROGRAMS - WRITE_
PROGRAMS
Functions§
- diff_
fingerprints - evaluate_
command - Decide whether a tool call may run.
- fingerprint
- Bounded breadth-first fingerprint of the working directory;
.gitis listed but not descended into. - operands
- Path-like operands of a call (values of
--opt=valueincluded). - record_
observation - Remember what a read call observed, so a later change may name it.
- resolve_
bounds - Resolve the bounds from the process environment.
- resolve_
bounds_ with - Resolve the bounds of one run from START_FORMAL_AI_* variables read
through
get. An invalid value is an error (exit status EXIT_CONFIG). - tokenize_
command - Split a command line with POSIX quoting rules. Characters that would make a shell do more than split words are reported instead of honoured.
- verify_
change - Read the result of a successful change back from the filesystem.
- workspace_
path - Normalized workspace-relative path of an operand, or None outside it.