context

package
v0.2.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package context defines AuditContext, the immutable struct that carries everything a sensor needs about the project under audit: where it lives, its language and framework, the parsed config, and the run modifiers (incremental ref, no-LLM mode).

It lives in its own package — not in findings — so the leaf findings package stays dependency-free: AuditContext references config, and a finding type must never depend on the config parser.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditContext

type AuditContext struct {
	// ProjectRoot is the absolute path to the project being audited.
	ProjectRoot string
	// Language is the project language (e.g. "go", "typescript"); selects the
	// LanguageProvider.
	Language string
	// Framework is the detected framework (e.g. "react"), optional.
	Framework string
	// Config is the parsed .codefit.yaml for the project.
	Config *config.Config
	// Scope is layer 0 of the filtering pyramid: the files this pass may examine.
	// The caller supplies it (codefit never asks git — see the scope package
	// doc). A walk must gate on scope.Scope.Narrows, NOT on Includes: the zero
	// value includes nothing, so gating on Includes would turn an AuditContext
	// assembled without a scope into a silent no-op audit reporting score 100.
	// Both the unset value and scope.Full mean "audit everything".
	//
	// It replaces a dead `Since string` that promised a git ref for an
	// incremental mode codefit never had, and that never had a reader or a
	// writer. A field naming a capability codefit does not have is the same class
	// of lie as a manifest that over-promises.
	Scope scope.Scope
}

AuditContext encapsulates all the information about the project being audited and is passed to every sensor. It is assembled once by the orchestrator and treated as read-only by sensors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL