Files
mesh-delivery/modules/mesh-grants/internal/grants/full.go
T
jschoubben 2fe8d01e86 Join item 1: the rewrite map, asks/asker, the vault's types and compose-candidate to mesh-contracts
mesh-sdk holds no go/asks, go/asker, vault answers or compose-candidate types (A1d, J1): each module now names the
operator-channel contract and client, the channel benches (mesh-sdk/go/channel), mesh-vault's contract, and node-engine's
contract and client (a1-progress.md, the A1d and J1 rewrite maps).
- assigner, teller, view: delivery.Ask.Ask and AssignerAsk.Ask are the router's ask as JSON; the refusals mesh-sdk
  dropped (an id other than AskingID(key, asking), no option) are each reader's and writer's: assign.EncodeAsk/DecodeAsk
  (askjson.go), the teller's routerAskOf (teller.go) and the view's routerAsk (view.go); the teller refuses an option
  the asking does not offer and one whose level is not acknowledge (viewanswers.go), the two refusals ViewAnswerFits
  gave. Row: subtest of TestTheHoldAskIsValid (another id, no option, no ask; each written before).
- enrolment, grants: the vault's verbs and answers from meshvault; asks' conditions from the contract and client.
- checker, assigner's judge: compose-candidate from nodeengine/nodeengineclient (nec.Own for "node").
- mesh-grants' user-lists golden: the node-engine's users now subscribe to mesh-delivery-view's settled (mesh-sdk's
  NodeAgentHears, A7's ENG-8 retry).
go.mod: each module requires the mesh-contracts modules it imports (and nodeengineclient, which mesh-sdk imports) at the
zero version, for the group pin.

Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
2026-11-04 15:05:12 +01:00

34 lines
1.4 KiB
Go

package grants
import (
occ "git.novox.be/novox/mesh-contracts/go/clients/operatorchannelclient"
oc "git.novox.be/novox/mesh-contracts/go/seats/operatorchannel"
)
// **The fill of a module's kept data is the bus module's** (novox/hq ADR 0595 §6, design 25 § 12.3): its one periodic
// read raises `full` at its raise mark and clears it below its clear mark, for every entry that refuses when full. The
// grants part no longer reads any stream's size and raises nothing of fill: `mesh-grants.history-full` moved to the bus
// module, its new condition raised first, then this old key cleared. So the part clears the old key once, at its first
// pass after a start (DLV-G3), whether or not one is held: a clear of a condition not raised is a no-op at the keeper.
// FullCondition is the key of the warning this part raised before ADR 0595 §6 moved fill to the bus module: only ever
// cleared now.
const FullCondition = "mesh-grants.history-full"
// clearFull clears FullCondition once after a start; a clear refused is tried again at the next pass.
func (p *Part) clearFull() {
if p.Say == nil {
return
}
p.holdMu.Lock()
defer p.holdMu.Unlock()
if p.fullCleared {
return
}
c := oc.Condition{Key: FullCondition, Subject: oc.ConditionSubject{Scope: "module", ID: Module}, State: occ.StateCleared,
Resolved: "the fill of a module's kept data is the bus module's own condition now (novox/hq ADR 0595 §6)"}
if p.Say(c) == nil {
p.fullCleared = true
}
}