persist: global commit ordering across streams + 11 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 46s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 46s
global.sx: persist/gappend records a pointer in a reserved $global index whose seq is the global commit position; read-global/project-global replay every event in commit order; global-from for incremental consumers. Opt-in (plain append untouched); $-prefixed streams now reserved + hidden from the public catalog (streams-all reveals them). Gives feed its unified timeline. Deterministic across restart. 191/191. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,15 +1,30 @@
|
||||
; persist/catalog — enumerate the streams a backend holds. The catalog is the
|
||||
; set of streams ever appended to (from the seq high-water marks), so a stream
|
||||
; whose log has been fully compacted still appears. For admin, global ops, and
|
||||
; cross-stream tooling. Requires: lib/persist/backend.sx, lib/persist/log.sx.
|
||||
; whose log has been fully compacted still appears. $-prefixed streams are
|
||||
; reserved for internal indexes (e.g. the $global commit index) and are hidden
|
||||
; from the public catalog; use streams-all to see them. For admin, global ops,
|
||||
; and cross-stream tooling. Requires: lib/persist/backend.sx, lib/persist/log.sx.
|
||||
|
||||
(define persist/reserved-stream? (fn (s) (starts-with? s "$")))
|
||||
|
||||
; every stream including reserved internal indexes
|
||||
(define persist/streams-all (fn (b) (persist/backend-streams b)))
|
||||
|
||||
; public streams (reserved internal indexes hidden)
|
||||
(define
|
||||
persist/streams
|
||||
(fn
|
||||
(b)
|
||||
(filter
|
||||
(fn (s) (not (persist/reserved-stream? s)))
|
||||
(persist/streams-all b))))
|
||||
|
||||
(define persist/streams (fn (b) (persist/backend-streams b)))
|
||||
(define persist/stream-count (fn (b) (len (persist/streams b))))
|
||||
(define
|
||||
persist/stream-exists?
|
||||
(fn (b stream) (contains? (persist/streams b) stream)))
|
||||
|
||||
; total logical events across all streams (sum of high-water marks)
|
||||
; total logical events across all public streams (sum of high-water marks)
|
||||
(define
|
||||
persist/total-events
|
||||
(fn
|
||||
|
||||
Reference in New Issue
Block a user