4.8 KiB
4.8 KiB
Audita Development Workflow
Scope
This is the canonical contributor workflow for Audita maintainers and coding agents.
It defines:
- repository layout and boundaries;
- setup and test commands;
- expectations for code changes;
- how to add config, CLI, modules, validators, docs, and examples.
Setup
Prerequisites:
- Go
1.24or newer.
Common commands:
go test ./...
go build ./cmd/audita
Repository Layout
Top-level areas:
cmd/audita: executable entrypoint.internal/cli: command parsing and process/config command orchestration.internal/core: deterministic config/schema/normalization/chunking/output/diagnostics/reporting logic.internal/framework: runner orchestration, contracts, proposal generation/application, validators runtime, LLM runtime, response schemas.internal/modules/*: module-specific correction behavior.internal/validators/*: validator implementations, chains, and metadata.internal/prompts: embedded prompts and prompt metadata.docs/: canonical documentation.examples/: maintained copyable inputs/configs.
Change Workflow
- Confirm scope and behavior contract before editing.
- Make focused changes in the appropriate ownership area.
- Add or update tests for changed behavior.
- Run targeted package tests for touched areas.
- Run
go test ./...for substantial changes. - Update docs/examples when external behavior changes.
How To Add or Change Configuration
- Add fields/defaults/validation under
internal/core/config. - Apply source precedence correctly (defaults, file, env, CLI for
process). - Ensure
config validateremains file-only andconfig print-effectiveremains redacted. - Update tests in
internal/core/configand related CLI tests. - Update
docs/config.mdand relevant examples underexamples/.
How To Add or Change CLI Behavior
- Implement parsing/wiring in
internal/cli. - Keep stdout/stderr and exit behavior compatible unless intentional and documented.
- Update CLI tests under
internal/cliand integration tests undercmd/audita. - Update
docs/cli.mdand related integration docs.
How To Add or Change Modules
- Add or update one module package under
internal/modules/<module_key>. - Keep module-specific prompt ownership in the module +
internal/prompts. - Wire module registration/catalog resolution through framework/core module catalog code.
- Verify replacement policy and validator chain selection.
- Add/update module tests and proposal-generation tests.
- Update internal docs when behavior/contracts change.
How To Add or Change Validators
- Implement validator behavior in
internal/validatorsand shared runtime pieces ininternal/framework/validatorsonly when needed. - Preserve stable validator keys and decision semantics where already exposed.
- Keep deterministic vs LLM-backed execution-class behavior explicit.
- Add/update validator, chain, batching, and malformed-output tests.
- Update validator documentation when external or developer-facing behavior changes.
Documentation and Examples Expectations
- Keep one canonical home per topic (see
docs/policy/documentation.md). - Do not document future/unimplemented behavior outside
docs/roadmap/. - Keep command examples and config/examples in sync with current code.
- Keep examples secret-free and copyable.
Practical Validation Checklist
Use this checklist for meaningful runtime-impacting changes:
- Run core tests:
go test ./...
- Verify config commands and examples:
go run ./cmd/audita config validate --config examples/minimal-config.yml
go run ./cmd/audita config validate --config examples/production-config.yml
go run ./cmd/audita config print-effective --config examples/minimal-config.yml
- Re-check subprocess/runtime contract when touching CLI/process/report paths:
--outputsuccess keeps stdout empty;- no
--outputsuccess writes transcript JSON to stdout; --report-jsonwrites file output and is not written to stdout;- failures return nonzero and include diagnostics path when available.
- Re-check diagnostics/report/redaction when touching LLM, reporting, or diagnostics code:
- report schema metadata fields remain present;
- diagnostics artifact paths remain valid;
- configured secret values remain redacted in reports/diagnostics/errors.
- Re-check output schema behavior when touching serialization/schema code:
- default
bare-segmentsbehavior remains correct unless intentionally changed; audita-v1behavior remains correct unless intentionally changed;- unsupported schemas fail validation/resolve paths clearly.
Commit Discipline
- Keep commits scoped and reviewable.
- Avoid mixing unrelated refactors with behavior changes.
- Use concise plain-English commit messages.