Skip to main content

Module init

Module init 

Source
Expand description

speccoder init: detect a project’s checks and write speccoder.toml.

Detection looks only at the project root’s manifests and lockfiles (and whether cargo nextest is installed); it runs nothing of the project’s. What it finds becomes a commented file the person reviews and commits. The result is parsed back with speccoder’s own parsers before it is written, so init never leaves a file run would refuse.

Structs§

BedrockPreview
Where Bedrock’s credentials and region would come from: named, never a value.
Found
What init saw at the project root.
Prepared
init written and its checks run on the untouched code: what a person then decides to commit.
Preview
What init would write here, without writing: for the setup assistant.
Proposed
One check init proposes.

Constants§

BEDROCK_MODEL
The model init writes for Bedrock unless --model names another: a Claude inference profile every commercial region offers.
COMMITTABLE
The files init may commit: nothing else, whatever a caller asks.
NEXTEST_PROFILE
The nextest profile speccoder’s JUnit report path expects.

Functions§

activate_include
Turns the commented [worktree] include proposal init wrote in root’s configuration into the setting (a person confirmed it, or --yes).
allow
Commands the model (and the spec-derived acceptance tests) need besides the checks: narrow prefixes per toolchain, written to [commands] allow.
commit_written
Commits exactly paths — each one of COMMITTABLE — as speccoder: config; the short id.
commit_written_as
commit_written with its own subject.
detect
Looks at root (and whether cargo nextest runs).
env_files
The checkout’s git-ignored .env files (.env, .env.local, at any depth): what checks often need and a worktree never has.
finish
The result of an init the person has decided about: the message, the report, and what comes next.
formatter
The formatter speccoder runs after each attempt, when the toolchain has one.
init
init_with for this machine.
init_with
speccoder init [--provider] [--model] [--region] [--force] with an explicit view of the environment (a variable’s value when it is set) and of what is installed.
no_tests
Whether a test check found no tests to run — an empty suite on a fresh scaffold: pytest’s exit 5, go test with only packages without test files, vitest, jest or nextest reporting nothing to run. Neither passing nor failing: no tests yet.
prepare
Writes the configuration and (unless no_verify) runs its checks on the untouched code. A refusal comes back as Err.
preview
Preview of path.
propose
The checks for what was found (pure: no IO).
render
The file init writes.
root_of
Where init writes for path: the spec project’s root, else path.
verify_written
Runs the fast-tier checks of the configuration init just wrote on the untouched code, confined like in a run.