feat: replicate threads through the observation log (#45)
build / test (push) Successful in 3m28s
build / image (push) Successful in 19s

feat: replicate threads through the observation log (#45)

Co-authored-by: David Gwilliam <dhgwilliam@gmail.com>
Co-committed-by: David Gwilliam <dhgwilliam@gmail.com>
This commit was merged in pull request #45.
This commit is contained in:
2026-11-05 08:47:39 +00:00
committed by david
parent bdde79e268
commit 00f277cf76
8 changed files with 652 additions and 39 deletions
+18 -1
View File
@@ -22,7 +22,24 @@ motivation, and in-flight knowledge development work.
Subcommands: create, list, link, link-entry, relate, golden, prune, rescan, close, show, note`,
}
cmd.AddCommand(newThreadCreateCmd(kdb))
cmd.AddCommand(
&cobra.Command{
Use: "emit-all",
Short: "Backfill thread observations so existing threads replicate",
Long: `Backfill thread observations.
Threads written before replication existed have no observation, so no peer can
learn about them. This assigns a uid to each and emits one observation per
thread. Re-running is safe: unchanged documents dedupe.`,
RunE: func(c *cobra.Command, args []string) error {
n, err := kdb.EmitAllThreads()
if err != nil {
return err
}
fmt.Printf("emitted %d thread(s)\n", n)
return nil
},
}, newThreadCreateCmd(kdb))
cmd.AddCommand(newThreadAutoCmd(kdb))
cmd.AddCommand(newThreadDraftCmd(kdb))
cmd.AddCommand(newThreadUpdateCmd(kdb))