Artifact 1d3e86a22ca1eb1a58e2a2bc068eae44dbcf27d5c9fc83569a128b27239e0e66:
- File
cli/repo_verify.go
— part of check-in
[c61a17d9ab]
at
2026-10-22 16:25:41
on branch feat/horizon-cones
— feat: expose the structural horizon and name it where history ends
Horizon gains Structural, whose zero value is the content horizon, so a Horizon built before it means what it meant; clone and sync results say how many replies served the structural level and whether the store fell back. repo clone and repo cone store take --structural with --horizon.
A structural store's history ends at its horizon, which the commands now say rather than leave bare phantoms (draft-fossil-horizon-00 §5.4, §5.5): repo info names the horizon and the check-ins below it, repo verify counts them apart from damage, and checkout, diff and annotate of a check-in below C fail naming the horizon and the deepen that reaches it. (user: [email protected], size: 1330) [annotate] [blame] [check-ins using] [more...]
package cli import ( "fmt" "github.com/danmestas/go-libfossil/internal/verify" ) // RepoVerifyCmd verifies repository integrity: every held artifact against // its name, delta chains, phantom records and the derived tables. It reports // what the store lacks by class (sparse-cone §5.2): transit phantoms, which // sync still wants, apart from artifacts the store cone deliberately elides, // which are healthy and never an error. type RepoVerifyCmd struct{} func (c *RepoVerifyCmd) Run(g *Globals) error { r, err := g.OpenRepo() if err != nil { return err } defer r.Close() report, err := verify.Verify(r.Inner()) if err != nil { return fmt.Errorf("verification failed: %w", err) } for _, issue := range report.Issues { fmt.Printf("ERROR %s %s\n", issue.UUID, issue.Message) } fmt.Printf("%d artifacts checked, %d transit phantoms, %d elided", report.BlobsChecked, report.Phantoms, report.Elided) // Horizon §5.4: the manifests below a structural horizon are elided, // reported apart from damage, and named as the horizon. if report.BelowHorizon > 0 { fmt.Printf(", %d check-in(s) below the horizon", report.BelowHorizon) } fmt.Println() if !report.OK() { return fmt.Errorf("verification failed: %d issues", len(report.Issues)) } fmt.Println("repository integrity verified") return nil }