Documentation
¶
Index ¶
- type Apply
- type Baseline
- type DB
- func (s *DB) Close() error
- func (s *DB) Conformed(versionID int64, requireVerified bool) (bool, string, error)
- func (s *DB) FinishApply(id int64, exitCode int, now time.Time) error
- func (s *DB) FinishApplyWithOutcome(id int64, exitCode int, outcome string, now time.Time) error
- func (s *DB) FinishVerification(id int64, exitCode int, detail []byte, now time.Time) error
- func (s *DB) FinishVerificationWithOutcome(id int64, outcome string, detail []byte, now time.Time) error
- func (s *DB) GetBaseline(id int64) (*Baseline, error)
- func (s *DB) GetRefine(id int64) (*Refine, error)
- func (s *DB) GetVersion(id int64) (*SpecVersion, error)
- func (s *DB) HasUnfinishedApply() (bool, error)
- func (s *DB) InsertApply(versionID int64, agent, featurePath string, now time.Time) (int64, error)
- func (s *DB) InsertBaseline(agent, outcome, beforeHash, afterHash string, ...) (int64, error)
- func (s *DB) InsertRefine(agent, outcome, beforeHash, afterHash string, ...) (int64, error)
- func (s *DB) InsertVerification(versionID int64, agent string, now time.Time) (int64, error)
- func (s *DB) InsertVersion(hash string, content []byte, message string, now time.Time) (int64, error)
- func (s *DB) IsApplied(versionID int64) (bool, error)
- func (s *DB) IsFeatureApplied(versionID int64, featurePath string) (bool, error)
- func (s *DB) LatestBaseline() (*Baseline, error)
- func (s *DB) LatestRefine() (*Refine, error)
- func (s *DB) LatestRefineByTarget(targetPath string) (*Refine, error)
- func (s *DB) LatestVerification(versionID int64) (*Verification, error)
- func (s *DB) LatestVersion() (*SpecVersion, error)
- func (s *DB) ListApplies() ([]Apply, error)
- func (s *DB) ListBaselines() ([]Baseline, error)
- func (s *DB) ListRefines() ([]Refine, error)
- func (s *DB) ListVerifications() ([]Verification, error)
- func (s *DB) ListVersions() ([]SpecVersion, error)
- func (s *DB) MarkUnfinishedAppliesStale() error
- func (s *DB) MarkUnfinishedVerificationsStale() error
- func (s *DB) SchemaVersion() (int, error)
- func (s *DB) SetApplyLogPath(id int64, logPath string) error
- func (s *DB) SetBaselineOutcome(id int64, outcome string) error
- func (s *DB) SetVerificationLogPath(id int64, logPath string) error
- type Refine
- type SpecVersion
- type Verification
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Apply ¶
type Apply struct {
ID int64
VersionID int64
Agent string
StartedAt time.Time
FinishedAt *time.Time
ExitCode *int
Outcome string
// FeaturePath is the repository-relative spec file being implemented; empty
// for a whole-version apply.
FeaturePath string
LogPath string
}
Apply is one agent run against a committed version. FinishedAt and ExitCode are nil while the run is active or after an unexpected exit.
type Baseline ¶ added in v0.1.4
type Baseline struct {
ID int64
Agent string
StartedAt time.Time
FinishedAt time.Time
Outcome string
BeforeHash string
AfterHash string
BeforeContent []byte
AfterContent []byte
// Proposal holds a JSON-encoded multi-file baseline proposal (before/after
// file maps); empty for single-file baselines.
Proposal []byte
LogPath string
}
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB wraps the SQLite handle and owns migrations.
func (*DB) Conformed ¶ added in v0.2.0
Conformed reports whether versionID counts as applied: it has a successful whole-version apply row and — when requireVerified is set — its latest verification passed. The second return value explains a negative result: "no successful apply", "never verified", "verification failed", or "verification <outcome>".
func (*DB) FinishApply ¶
FinishApply stamps the outcome of an apply run.
func (*DB) FinishApplyWithOutcome ¶ added in v0.0.6
func (*DB) FinishVerification ¶ added in v0.2.0
FinishVerification stamps a passed/failed outcome derived from the exit code, mirroring FinishApply.
func (*DB) FinishVerificationWithOutcome ¶ added in v0.2.0
func (s *DB) FinishVerificationWithOutcome(id int64, outcome string, detail []byte, now time.Time) error
FinishVerificationWithOutcome stamps the outcome (passed, failed, error, timed_out, interrupted, stale) and the per-command detail JSON.
func (*DB) GetVersion ¶
func (s *DB) GetVersion(id int64) (*SpecVersion, error)
GetVersion loads one stored snapshot by id.
func (*DB) HasUnfinishedApply ¶
HasUnfinishedApply reports whether any apply row lacks an outcome.
func (*DB) InsertApply ¶
InsertApply records the start of an apply run; log_path starts empty and is filled by SetApplyLogPath once the row id has named the file. featurePath is empty for a whole-version apply.
func (*DB) InsertBaseline ¶ added in v0.1.4
func (*DB) InsertRefine ¶ added in v0.0.6
func (*DB) InsertVerification ¶ added in v0.2.0
InsertVerification records the start of a verification run. agent is empty for the built-in [verify] commands and names an auditing agent in later phases.
func (*DB) InsertVersion ¶
func (s *DB) InsertVersion(hash string, content []byte, message string, now time.Time) (int64, error)
InsertVersion stores a full spec snapshot and returns its id (displayed as vN).
func (*DB) IsApplied ¶
IsApplied reports whether versionID has a whole-version apply row with exit_code = 0.
func (*DB) IsFeatureApplied ¶ added in v0.1.14
IsFeatureApplied reports whether versionID has a successful apply row for the given feature path.
func (*DB) LatestBaseline ¶ added in v0.1.4
func (*DB) LatestRefine ¶ added in v0.0.6
func (*DB) LatestRefineByTarget ¶ added in v0.1.14
LatestRefineByTarget returns the most recent refinement for a given target path (empty for the master spec).
func (*DB) LatestVerification ¶ added in v0.2.0
func (s *DB) LatestVerification(versionID int64) (*Verification, error)
LatestVerification returns the newest verification row for versionID, or nil when none exist.
func (*DB) LatestVersion ¶
func (s *DB) LatestVersion() (*SpecVersion, error)
LatestVersion returns the newest committed version, or nil when none exist.
func (*DB) ListApplies ¶
ListApplies returns all apply rows, newest first.
func (*DB) ListBaselines ¶ added in v0.1.4
func (*DB) ListRefines ¶ added in v0.0.6
func (*DB) ListVerifications ¶ added in v0.2.0
func (s *DB) ListVerifications() ([]Verification, error)
ListVerifications returns all verification rows, newest first.
func (*DB) ListVersions ¶
func (s *DB) ListVersions() ([]SpecVersion, error)
ListVersions returns all versions, newest first.
func (*DB) MarkUnfinishedAppliesStale ¶ added in v0.0.6
func (*DB) MarkUnfinishedVerificationsStale ¶ added in v0.2.0
MarkUnfinishedVerificationsStale marks verification rows that never finished (e.g. respex was killed mid-run) as stale.
func (*DB) SchemaVersion ¶
SchemaVersion returns the current schema version.
func (*DB) SetApplyLogPath ¶
SetApplyLogPath records the (repo-relative) log path for an apply row.
func (*DB) SetBaselineOutcome ¶ added in v0.1.6
SetBaselineOutcome updates the outcome of a baseline row — used when a pending multi-file proposal is accepted or discarded.
type Refine ¶ added in v0.0.6
type Refine struct {
ID int64
Agent string
StartedAt time.Time
FinishedAt time.Time
Outcome string
BeforeHash string
AfterHash string
BeforeContent []byte
AfterContent []byte
// TargetPath is the repository-relative spec file being refined; empty for
// the master spec.
TargetPath string
InputFingerprint string
LogPath string
}
type SpecVersion ¶
type SpecVersion struct {
ID int64
Hash string
Content []byte
CommittedAt time.Time
Message string
}
SpecVersion is one committed snapshot of the spec file.
type Verification ¶ added in v0.2.0
type Verification struct {
ID int64
VersionID int64
Agent string
StartedAt time.Time
FinishedAt *time.Time
Outcome string
GitSHA string
TreeDirty bool
Detail string
LogPath string
}
Verification is one conformance check of the working tree against a committed spec version: the configured [verify] commands, run against the working tree as-is. FinishedAt is nil while the run is active; Detail is JSON describing the per-command results.