docs & feat: add license & attribution notice (Apache-2.0 / GPL-3.0) and core system enhancements

This commit is contained in:
CAtlas0784 committed 2026-11-01 20:14:36 +07:00
1 parent 507836d367
commit ce6aabfc55
47 files changed
+5674 -724

No files matched your search

+8
View File
@@ -24,6 +24,8 @@ type CurrencyWarsSnapshot struct {
Revision uint64 `json:"revision"`
WireData []byte `json:"wire_data"`
Runtime *CurrencyWarsRuntimeState `json:"runtime,omitempty"`
Archives [][]byte `json:"archives,omitempty"`
PendingArchive []byte `json:"-"` // appended in the same CAS as settlement
}
// Server-side rules are kept beside, never smuggled into, the Client protocol.
@@ -144,6 +146,9 @@ func commitCurrencyWarsSnapshot(expectedRevision uint64, next CurrencyWarsSnapsh
return 0, fmt.Errorf("CW snapshot source differs; migration is required")
}
revision = previous.Revision
if next.Archives == nil {
next.Archives = previous.Archives
}
if next.Runtime != nil && previous.Runtime != nil && next.Runtime.RunID == previous.Runtime.RunID && next.Runtime.Rules == nil {
next.Runtime.Rules = previous.Runtime.Rules
}
@@ -155,6 +160,9 @@ func commitCurrencyWarsSnapshot(expectedRevision uint64, next CurrencyWarsSnapsh
return 0, fmt.Errorf("CW snapshot revision exhausted")
}
next.Revision = revision + 1
if len(next.PendingArchive) != 0 {
next.Archives = append(next.Archives, append([]byte(nil), next.PendingArchive...))
}
// Retain unrelated envelope fields added by tools or a newer writer.
encoded, err := json.Marshal(next)
if err != nil {