mesh-config wakes only on a changed input and holds no value for a pull request (issue 1982; ADR 0681; A-490l) #708

Closed
mesh-tools wants to merge 6 commits from fix/1982-mesh-config-events into main
Member

Issue 1982 (the bus flood): mesh-config re-read all its own states key by key on every wake-up (~1,200 gets per event, ~2,800 per pass) and polled the forge every 5 min and the router every minute. Now: own states from watched copies (ADR 0580 §1), no pass without a changed input, one one-shot timer for its real deadlines (A-490l), and the pull-request path removed (ADR 0681, the operator's word 2026-11-19). mesh-cli drops pull. Group with mesh-contracts fix/1982-no-held-values, mesh-sdk fix/1982-no-config-candidates and mesh-delivery fix/1982-no-config-candidates; order: mesh-contracts and mesh-sdk with mesh-config, mesh-config before the indexer. Held values listed before removal: issue 1982 note 11. Quick vs thorough: thorough, every wake-up mapped to its record.

Reviewed-by: mesh-code-reviewer@shanks at 247d89e152 (three rounds)

https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy

Issue 1982 (the bus flood): mesh-config re-read all its own states key by key on every wake-up (~1,200 gets per event, ~2,800 per pass) and polled the forge every 5 min and the router every minute. Now: own states from watched copies (ADR 0580 §1), no pass without a changed input, one one-shot timer for its real deadlines (A-490l), and the pull-request path removed (ADR 0681, the operator's word 2026-11-19). mesh-cli drops `pull`. Group with mesh-contracts fix/1982-no-held-values, mesh-sdk fix/1982-no-config-candidates and mesh-delivery fix/1982-no-config-candidates; order: mesh-contracts and mesh-sdk with mesh-config, mesh-config before the indexer. Held values listed before removal: issue 1982 note 11. Quick vs thorough: thorough, every wake-up mapped to its record. Reviewed-by: mesh-code-reviewer@shanks at 247d89e152ccde9273653a75b192b9bc4fdc10a1 (three rounds) https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
mesh-tools added 6 commits 2026-11-19 22:22:33 +00:00
mesh-config sent about 262 requests a second and received about 1,540 since its start: every sources() call (a
resolution pass, and a `delivered`, `manifest-reads-changed` or `manifest-accepted` event, each of which read the sources
whether or not a window or a retirement was open) read every key of its own states by one get each (pulls 1,176 keys,
resolved 447, declared 168, values 101...: about 1,200 requests for an event, 2,800 for a pass), serialised by one lock, so
a delivery's burst of events kept it asking the bus back to back.

- The module's own states are read from mesh-sdk's WatchedStates (one watch per state, its own writes taken into the copy)
  instead of a get per key (ownstates.go, main.go runtimeStore).
- An event judges what it names: `delivered` and `manifest-reads-changed` read no source when no rename window is open,
  `manifest-accepted` reads none when every row is already marked or read again (renames.go windowOpen, retiring.go).
- Open windows and retirements are judged again after each pass, since an entry that answers after the judgement was
  made moves the pass, not the event; the slow reads had hidden that race.
- No timer polls: the five-minute resolution and sweep of every pull request on the forge, and the minute's read of the
  router's record, are gone. The sweep and Decide run once at start (an event said while the module was down is not said
  again), then on git.pull-merged/-closed and operator-channel.decided.mesh-config; an ask ended with no choice also
  takes the retirements from the router's record. One timer is left, a deadline: for the earliest waiting proposal
  (ProposalLasts + 1 h) or unanswered retirement (HeldFinding), set again when either is written (NextDeadline).

Wake-ups kept, each by its record: `delivered` and `manifest-reads-changed` close a rename window (design 32 *A config
value renamed*, ADR 0609 §4); `manifest-accepted` judges one module's retirements (design 32 *A value no longer read*);
`git.pull-merged` and `-closed` settle one pull request's held values (ADR 0502 §7); `decided.mesh-config` takes one ask's
warrant (ADR 0259); a changed view (assignment, want, predefined list, config candidate, catalog revision, entry) moves a
resolution that writes only what moved (ADR 0565 §3).

Builds: ADR 0681 §1 (no polling of the forge: the five-minute look ends); ADR 0580 §1; ADR 0426 §3; design 32 (*A config value renamed*, *A value no longer read*);
lead answer A-490l (hq main, 03-DESIGN/01-to-be/47-milestones/G-22-lead-answers-2.md) for the wake-ups and the one deadline timer.

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
The mesh knows no pull request (design 47 G, G-1 §38-39). Removed:
- the states `pulls` and `kept` and all code that reads or writes them (pulls.go, the held values a proposal holds, the
  listing of held values), SweepPulls, settlePull, HeardPull and the forge call;
- the consumes of git.pull-merged and git.pull-closed, the invoke of seat:git.pull;
- the config verb's `pull`, `head`, `declares` and `pulls` arguments and its actions `pull-declares` and `held`;
- the indexer's config candidates, which only that path used: the consume of mesh-delivery-indexer.views.config-candidates
  and the invoke of indexer_read_config_candidates (the indexer's state goes in the same group).
A stored proposal that names a pull request is judged not one this module makes, so nothing is set on it.

Builds: ADR 0681 §1 (no pulls or kept, no git events, no seat:git.pull, no `pull` argument, no pull-declares or held), §3, §5, §6;
lead answer A-490l (a stored proposal naming a pull request is refused on its approval).

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
mesh-config's verb takes no pull request argument any more, so `nox config` offers none.

Builds: ADR 0681 §1 (the verb `config` takes no `pull`).

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
The generated client held only the held values' keys and decoder, which the seat no longer has.

Builds: ADR 0681 §1, §6 (the seat keeps no held value, so its generated client goes).

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
The one timer left is set for the earliest of three deadlines: a waiting proposal's end, an unanswered retirement's second
ask, and a rename window's seven-day held finding, which is now judged at its deadline (JudgeHeldWindows) so it comes in a
quiet mesh too. Its floor is the module's setting deadline-floor-seconds (default 60), not a constant.

Tests: an integration test counts asks by key and fails on any `seat:git.*` over the whole run (ADR 0681, How it is checked,
clause 1); a unit test shows an approved proposal records a hand act naming no pull request; another that a stored proposal
naming a pull request is refused on approval, saying why.

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
The timer was rearmed on a write of proposals or retiring only, so a rename window opened after start, with nothing else
waiting on a time, left it blocked and its seven-day held finding never came; a window opened under a later armed deadline
came late. The condition is now armsDeadline (proposals, retiring, renames), and a test shows a written window rearms it.
The comment on Proposal.Pull cites ADR 0681 §5.

Builds: ADR 0681 §1; lead answer A-490l (hq main, 03-DESIGN/01-to-be/47-milestones/G-22-lead-answers-2.md: the held finding comes in a quiet mesh too).

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
mesh-tools closed this pull request 2026-11-20 05:43:25 +00:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-catalog#708