Documentation
¶
Overview ¶
Package walls — OVERKILL_ARCH.md + CONTEXT.md generation (master plan §6.5 Wall 2).
Wall 2 already exists as ArchitectureWall (architecture.go) and gets surfaced as the wall_architecture agent tool. What was missing: the FILES the wall reads — OVERKILL_ARCH.md (canonical architecture reference) and CONTEXT.md (domain glossary). Without them the wall runs against an empty source of truth.
This file generates seed versions of both on first boot of a project so the agent + Wall 2 have something to reason against. The user extends them as architecture evolves; agent tools (arch_*, glossary_*) let the agent append entries when it discovers new modules or terms.
Generated files live in the PROJECT ROOT, not the agent's config dir. They're code-adjacent so they get committed alongside the source.
Package walls — behavioral regression bank (master plan §6.5 Wall 3).
Every shipped bug should leave a regression test behind so the same bug cannot re-ship. The bank persists each regression as a small record: what broke, the symptom, the test command that proves it's fixed. A `Verify` pass re-runs every recorded test command and reports any that fail — those are reopened bugs.
orphan: quality-gate runner (master plan §5.6); needs /walls slash command
Index ¶
- Constants
- Variables
- func DefaultCmdRunner(ctx context.Context, cmd string, timeout time.Duration) (string, error)
- func EnsureArch(projectRoot string) (bool, error)
- func EnsureGlossary(projectRoot string) (bool, error)
- type ArchRule
- type ArchitectureConfig
- type ArchitectureWall
- type CmdRunner
- type MemRegressionStore
- type OuroborosConfig
- type OuroborosWall
- type PostgresRegressionStore
- type Regression
- type RegressionBank
- func (b *RegressionBank) Delete(id string) error
- func (b *RegressionBank) Get(id string) (*Regression, error)
- func (b *RegressionBank) List() ([]Regression, error)
- func (b *RegressionBank) Record(r *Regression) (*Regression, error)
- func (b *RegressionBank) Verify(ctx context.Context, timeout time.Duration) ([]VerifyResult, error)
- type RegressionStore
- type Severity
- type TestAnalysis
- type TestQualityConfig
- type TestQualityWall
- func (w *TestQualityWall) AnalyzeTestQuality(code, tests string) *TestAnalysis
- func (w *TestQualityWall) Check(ctx context.Context, code string, tests string) (*WallResult, error)
- func (w *TestQualityWall) CheckWithCoverage(ctx context.Context, code, tests string, profile io.Reader) (*WallResult, error)
- type VerifyResult
- type WallID
- type WallReport
- type WallResult
Constants ¶
const ( // ArchFile is the canonical architecture reference (master plan §6.5). ArchFile = "OVERKILL_ARCH.md" // GlossaryFile is the domain vocabulary (CONTEXT.md per the plan). GlossaryFile = "CONTEXT.md" )
Variables ¶
var ErrRegressionNotFound = errors.New("regression bank: not found")
ErrRegressionNotFound is returned when an ID is missing.
Functions ¶
func DefaultCmdRunner ¶
DefaultCmdRunner runs the command via /bin/sh with the given timeout.
func EnsureArch ¶
EnsureArch generates OVERKILL_ARCH.md at projectRoot if absent. Returns (created, error): created=true when we wrote a fresh file, false when one already existed. Non-fatal on any error — the wall keeps running without it.
func EnsureGlossary ¶
EnsureGlossary generates CONTEXT.md at projectRoot if absent. Returns (created, error) following the same convention as EnsureArch.
Types ¶
type ArchitectureConfig ¶
type ArchitectureWall ¶
type ArchitectureWall struct {
// contains filtered or unexported fields
}
func NewArchitectureWall ¶
func NewArchitectureWall(cfg ArchitectureConfig) *ArchitectureWall
func (*ArchitectureWall) Check ¶
func (w *ArchitectureWall) Check(_ context.Context, files map[string]string) (*WallResult, error)
func (*ArchitectureWall) LoadRules ¶
func (w *ArchitectureWall) LoadRules(path string) error
type CmdRunner ¶
CmdRunner runs `sh -c cmd` and returns combined output + exit error. The default uses os/exec; tests inject a fake.
type MemRegressionStore ¶
type MemRegressionStore struct {
// contains filtered or unexported fields
}
MemRegressionStore is a non-persistent store, mostly for tests.
func NewMemRegressionStore ¶
func NewMemRegressionStore() *MemRegressionStore
func (*MemRegressionStore) Delete ¶
func (m *MemRegressionStore) Delete(id string) error
func (*MemRegressionStore) Get ¶
func (m *MemRegressionStore) Get(id string) (*Regression, error)
func (*MemRegressionStore) List ¶
func (m *MemRegressionStore) List() ([]Regression, error)
func (*MemRegressionStore) Save ¶
func (m *MemRegressionStore) Save(r *Regression) error
type OuroborosConfig ¶
type OuroborosWall ¶
type OuroborosWall struct {
// contains filtered or unexported fields
}
func NewOuroborosWall ¶
func NewOuroborosWall(cfg OuroborosConfig) *OuroborosWall
func (*OuroborosWall) Check ¶
func (w *OuroborosWall) Check(ctx context.Context, code string, spec string) (*WallResult, error)
type PostgresRegressionStore ¶
type PostgresRegressionStore struct {
// contains filtered or unexported fields
}
PostgresRegressionStore persists regressions in the regressions table.
func NewPostgresRegressionStore ¶
func NewPostgresRegressionStore(db *sql.DB) (*PostgresRegressionStore, error)
func (*PostgresRegressionStore) Delete ¶
func (s *PostgresRegressionStore) Delete(id string) error
func (*PostgresRegressionStore) Get ¶
func (s *PostgresRegressionStore) Get(id string) (*Regression, error)
func (*PostgresRegressionStore) List ¶
func (s *PostgresRegressionStore) List() ([]Regression, error)
func (*PostgresRegressionStore) Save ¶
func (s *PostgresRegressionStore) Save(r *Regression) error
type Regression ¶
type Regression struct {
ID string `json:"id"`
Title string `json:"title"`
Symptom string `json:"symptom"`
RootCause string `json:"root_cause,omitempty"`
TestCmd string `json:"test_cmd"`
CommitSHA string `json:"commit_sha,omitempty"`
CreatedAt time.Time `json:"created_at"`
LastVerify time.Time `json:"last_verified,omitempty"`
LastResult string `json:"last_result,omitempty"` // "passed" | "failed" | ""
LastFailMsg string `json:"last_fail_msg,omitempty"`
}
Regression is one persisted record. Created on bug-fix, verified on demand.
type RegressionBank ¶
type RegressionBank struct {
// contains filtered or unexported fields
}
RegressionBank coordinates record/verify against a RegressionStore.
func NewRegressionBank ¶
func NewRegressionBank(store RegressionStore, runner CmdRunner) *RegressionBank
NewRegressionBank wires a store and a runner. Nil runner falls back to DefaultCmdRunner.
func (*RegressionBank) Delete ¶
func (b *RegressionBank) Delete(id string) error
Delete removes one regression (e.g. when a feature is intentionally retired).
func (*RegressionBank) Get ¶
func (b *RegressionBank) Get(id string) (*Regression, error)
Get fetches one regression.
func (*RegressionBank) List ¶
func (b *RegressionBank) List() ([]Regression, error)
List returns every regression sorted newest-first.
func (*RegressionBank) Record ¶
func (b *RegressionBank) Record(r *Regression) (*Regression, error)
Record persists a new regression. Title and TestCmd are required.
func (*RegressionBank) Verify ¶
func (b *RegressionBank) Verify(ctx context.Context, timeout time.Duration) ([]VerifyResult, error)
Verify runs every recorded TestCmd and updates LastVerify/LastResult. timeout is per-command. Returns one VerifyResult per regression, in the same order as List().
type RegressionStore ¶
type RegressionStore interface {
Save(r *Regression) error
Get(id string) (*Regression, error)
List() ([]Regression, error)
Delete(id string) error
}
RegressionStore abstracts persistence so tests can swap in an in-memory store.
type TestAnalysis ¶
type TestAnalysis struct {
TestCount int `json:"test_count"`
HasTableDriven bool `json:"has_table_driven"`
HasEdgeCases bool `json:"has_edge_cases"`
HasErrorCases bool `json:"has_error_cases"`
HasConcurrency bool `json:"has_concurrency"`
// Coverage is unknown until a coverage-tool profile is supplied.
Coverage *float64 `json:"coverage"`
StructuralTestRatio float64 `json:"structural_test_ratio"`
MeasurementSource string `json:"measurement_source"`
}
type TestQualityConfig ¶
type TestQualityWall ¶
type TestQualityWall struct {
// contains filtered or unexported fields
}
func NewTestQualityWall ¶
func NewTestQualityWall(cfg TestQualityConfig) *TestQualityWall
func (*TestQualityWall) AnalyzeTestQuality ¶
func (w *TestQualityWall) AnalyzeTestQuality(code, tests string) *TestAnalysis
func (*TestQualityWall) Check ¶
func (w *TestQualityWall) Check(ctx context.Context, code string, tests string) (*WallResult, error)
func (*TestQualityWall) CheckWithCoverage ¶
func (w *TestQualityWall) CheckWithCoverage(ctx context.Context, code, tests string, profile io.Reader) (*WallResult, error)
CheckWithCoverage accepts a caller-supplied Go coverage-tool profile from the tested source revision. It never infers execution from source length. Callers are responsible for supplying the artifact from their actual run.
type VerifyResult ¶
type VerifyResult struct {
ID string `json:"id"`
Title string `json:"title"`
Passed bool `json:"passed"`
Output string `json:"output,omitempty"`
}
VerifyResult is one entry in the report returned by RegressionBank.Verify.
type WallReport ¶
type WallReport struct {
Results []WallResult `json:"results"`
Passed bool `json:"passed"`
Blocked bool `json:"blocked"`
}
func NewReport ¶
func NewReport(results []WallResult) *WallReport
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package impossibleprobe — ImpossibleBench-style cheating detection (§8.4 Zhong 2025).
|
Package impossibleprobe — ImpossibleBench-style cheating detection (§8.4 Zhong 2025). |
|
Package mcpshield — MCP tool-call policy layer (§8.4 MCPSHIELD, Acharya 2026).
|
Package mcpshield — MCP tool-call policy layer (§8.4 MCPSHIELD, Acharya 2026). |
|
Package monitor — heuristic detectors (Wall 4, paper #48).
|
Package monitor — heuristic detectors (Wall 4, paper #48). |
|
Package promptinject — prompt-injection scanner (§8.4 Owner-Harm threat model, Zhang 2026).
|
Package promptinject — prompt-injection scanner (§8.4 Owner-Harm threat model, Zhang 2026). |
|
Package truthsource — "user is source of truth" behavioral wall (§8.7.6).
|
Package truthsource — "user is source of truth" behavioral wall (§8.7.6). |