Documentation
¶
Overview ¶
Package audit holds the `forge audit` command group — a comprehensive snapshot of project state designed to orient an LLM (or human) without forcing them to grep ten different directories. It rolls up:
- Forge version pin (forge.yaml forge_version vs binary buildinfo).
- Project shape (kind, services + RPC counts, workers, operators, frontends, installed packs).
- Convention compliance (rolled up forge lint counts per category).
- Codegen state (certified-file census via the embedded forge:hash markers, orphan _gen files, uncommitted user edits to forge-space files).
- Pack health (each installed pack's version against the embedded pack registry).
- Pack graph health (every installed pack's `depends_on` is also installed; missing producers surface as errors).
- Proto-vs-migration alignment (entity tables vs db/migrations/).
- Migration safety summary (allowed_destructive count, latest migration timestamp, destructive_change severity).
- Wire-coverage (unresolved Deps fields in pkg/app/wire_gen.go, rolled up from `forge lint --wire-coverage`).
- FORGE_SCAFFOLD marker counts (P0 sharpening surface).
- Deps health (go.sum freshness vs go.mod, gen/ presence).
JSON output groups checks by category with status: ok|warn|error so a sub-agent can branch on `.codegen.status == "warn"` directly.
It is a dir-nested command group (the devspace idiom). The few categories it cannot compute without package-cli internals — the KCL-entity-typed ingress / external-builds categories, the friction roll-up, plus the service-registry / env-discovery / drift helpers — are reached through factory.AuditAPI (function values internal/cli registers via SetAuditAPI). The group never imports internal/cli, so the registry indirection in the factory package keeps the dependency one-directional (group → factory) and the import cycle broken. init() self-registers the command with the factory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Report ¶
type Report struct {
ProjectName string `json:"project_name"`
ProjectKind string `json:"project_kind"`
BinaryVersion string `json:"binary_version"`
GeneratedAt time.Time `json:"generated_at"`
Categories map[string]audittype.Category `json:"categories"`
OverallStatus audittype.Status `json:"overall_status"`
}
Report is the top-level JSON structure emitted by `forge audit --json`. Field order is stable so diffing two audits is human-readable.