Each of the four is core. Every state that named no cap names one, from its live fill read 2026-11-22 01:4x CET (mesh-broker show, nats_streams on novox): mesh-build-go steps 16.0 MiB (16,783,695 bytes) -> 128 MiB; mesh-build-node steps 2.35 MiB (2,463,833 bytes) -> 16 MiB; every other state under 2 MiB -> 8 MiB (largest: distribution holds 1,844,287 bytes, mesh-build-go detected-steps 868,554, distribution transfers 846,359, findings 668,161, idle 401,736, mesh-build-go pauses 254,366). The Go build module's finding-events is 8 MiB for 7 days. The objects stores already name their caps; none keeps a log. The Go and Node build modules prune their state detected-steps (each key an artifact's steps as detected, detected again when gone) at their own writes, past prune-mark 70 % down to prune-target 50 %, and serve <module>_state_prune_now and <module>_state_keep; no other state of the four is prunable (each is truth: running steps, pauses, keys, toolchains, findings, holds, transfers, windows, mirrors, taken asks). Builds: design 47 H2 §812, §820; H-A-411 (1), (2), (3), H-A-437
36 lines
1.6 KiB
Go
36 lines
1.6 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"sync"
|
|
|
|
seat "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/nodebuildnode"
|
|
|
|
"git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient"
|
|
stdio "git.novox.be/novox/mesh-sdk/go"
|
|
"git.novox.be/novox/mesh-sdk/go/stateobjects"
|
|
)
|
|
|
|
// ModuleName is this module's name, which its prune tools are named for (stateobjects.PruneTools).
|
|
const ModuleName = "mesh-build-node"
|
|
|
|
// prunedDetected is the state detected-steps, pruned toward its cap at this module's own writes (design 47 H2 §812;
|
|
// H-A-411 (2), (3)): past prune-mark of its 8 MiB the oldest keys go down to prune-target, in one journal line. Each key
|
|
// is an artifact's steps as detected, which the verb steps detects again when its key is gone. A setting that is no
|
|
// percentage is said, and the defaults hold.
|
|
var prunedDetected = sync.OnceValue(func() *stdio.PrunedState {
|
|
p, err := stdio.PruneSettings()
|
|
if err != nil {
|
|
fmt.Fprintf(os.Stderr, "the prune of %s keeps its defaults (%d %% to %d %%): %v\n", seat.StateDetectedSteps, stdio.PruneMarkDefault, stdio.PruneTargetDefault, err)
|
|
p = stdio.Prune{Mark: stdio.PruneMarkDefault, Target: stdio.PruneTargetDefault}
|
|
}
|
|
return stdio.State(seat.StateDetectedSteps).Pruned(p)
|
|
})
|
|
|
|
// pruneTools are the module's two prune tools over detected-steps, each written in the hand-act log (H-A-380 (3)).
|
|
func pruneTools() []stdio.Tool {
|
|
return stateobjects.PruneTools(ModuleName, []stateobjects.Pruning{{Name: seat.StateDetectedSteps, State: prunedDetected()}},
|
|
meshhandactsclient.Recorder{Ask: stdio.Ask})
|
|
}
|