Artifact f42137460a19cc2ef64306b3833b68c3788aaff5ef0a0f40f37321be535a25eb:
- File
internal/sync/stubs.go
— part of check-in
[fe06d02a12]
at
2026-10-23 02:20:22
on branch feat/horizon-cones
— feat(sync): name a history URL in horizon-served
draft-fossil-horizon-00 §6.2.5 lets an origin append to pragma horizon-served the URL of an interface outside the protocol at which history below a horizon can be queried, and §5.5 has a client direct the user there. go-libfossil emitted the level alone and dropped any URL a reply carried.
An origin now appends its horizon-history-url setting when set. The value rides the pragma as one raw card token, so SetConfig refuses anything but a single http or https URL with a host and no white space or credentials, and the handler emits nothing for a value stored past that check. The client records a valid URL from any origin in its clone and sync results, exported additively on the public results, and the CLI's clone and cone store/deepen print it. (user: [email protected], size: 2650) [annotate] [blame] [check-ins using] [more...]
package sync import ( "github.com/danmestas/go-libfossil/internal/cone" "github.com/danmestas/go-libfossil/internal/horizon/seed" "github.com/danmestas/go-libfossil/simio" ) // CloneOpts configures a clone operation. type CloneOpts struct { StoreCone *cone.Cone // nil is dense; local policy, never synchronized User string // Credentials for clone auth (also default admin user) Password string Version int // Protocol version (default 3) Env *simio.Env // nil defaults to RealEnv Observer Observer // nil defaults to no-op Buggify BuggifyChecker // fault injection for DST (nil = no faults) // PullPhantoms, when set, makes Clone fetch the artifacts the clone // rounds left missing with a follow-up pull session, and fail with a // *PhantomStallError if any are still missing after it. That pull // departs from Section 8.2 of the sync draft, which sends no clone, // pull or push card after clone_seqno 0, so it is off by default. PullPhantoms bool // SeedVerifier checks the seed of a structural horizon against the // origin's key (draft-fossil-horizon-00 §5.2.4); nil accepts an unsigned // seed, as a clone knowing no key does. SeedVerifier seed.Verifier // Origin names the peer the clone addresses, keying the horizon cursor // a converged horizon clone records (draft-fossil-horizon-00 §6.2.6) as // SyncOpts.Origin keys a sync's. Empty keeps none. Origin string } // CloneResult reports what happened during a clone. type CloneResult struct { Elided int // artifacts deliberately absent under the store cone ConeServed int // replies acknowledging the store cone (sparse-cone §6.3); the rest were filtered locally HorizonServed int // replies serving the store's horizon at either level (horizon §6.2.5); the rest were classified locally // StructuralServed counts the replies that served the structural level, // and HorizonFallback reports a structural clone that kept the content // horizon instead: its origin did not serve the structural level with a // seed in the first reply, or the seed failed its provenance (§5.1, // §5.2.4, §6.3). StructuralServed int HorizonFallback bool Rounds int BlobsRecvd int ArtifactsLinked int // Manifests crosslinked into event table ProjectCode string ServerCode string Messages []string // Informational messages from server // HorizonHistoryURL is the interface outside the protocol at which the // origin says history below a horizon can be queried (horizon-served // URL, §6.2.5), the last a reply named; "" when none did. HorizonHistoryURL string }