dbrules

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package dbrules holds codefit's deterministic database-structure rules. Each rule reasons over the neutral core/db.Schema and emits deterministic Findings (affirmations, Confidence 1.0) and/or SurfaceItems (questions for the agent) — it never sees a concrete ORM. Because a rule is language-neutral, every future ORM provider (JPA, Drizzle, EF Core) inherits it for free once it can produce a db.Schema (ADR 0015).

dbrules lives BESIDE core/db, not inside it: a rule imports core/findings and core/surface, so it cannot live in the pure leaf core/db (ADR 0014). The dependency arrow is dbrules -> {core/db, core/findings, core/surface}; core/db still imports nothing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

Run executes every rule over the schema and returns the union of their findings and surface. A nil schema yields nothing.

Types

type Rule

type Rule interface {
	ID() string
	Check(*db.Schema) ([]findings.Finding, []findings.SurfaceItem)
}

Rule is one deterministic DB-structure check over the neutral schema. It emits affirmations (Findings, Confidence 1.0) and/or surface (SurfaceItems, questions the agent reasons). A rule never sees a concrete ORM — only db.Schema — so it is inherited by every future provider that can produce one (ADR 0015).

func All

func All() []Rule

All is the enumerated rule set of this slice (schema-only OLTP). Instantiated by hand, like the sensors — no registry (YAGNI until there are many rules).

Jump to

Keyboard shortcuts

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