Skip to content

feat(cluster): settings changes reach every replica (settings lane) (#3814 F3b) #31597

Closed

Description

@objectstack-fleet

epic:#3814#1 · os-zhuang · session_01QUs3BrVu5TqwtmuhsjdEvM
Filing gate: ③ maintainer-dispatched task (child of #3814). Maintainer, (2026-11-08, 16:25 UTC): 「继续,现在派第二批」 (gate 1 after the card 0 inventory, cloud#3868 comment 6723322368).

Parent: #3814 (rulings R0-R6 on comment 6722625146).

Problem (smoke, card 0)

settings:changed is an in-process Set (settings-service.ts:1304/1320). Its subscribers rebuild the auth posture, password/session/MFA policy, org access policy, mail, SMS, storage adapter and AI provider. Under round-robin only the writing replica rebuilds: r1 set require_email_verification=true and refused sign-in, while r2 still answered 200 after 95 s. Peers keep the old configuration until restart, including security posture.

Do

  1. A fifth cluster lane (beside the four in metadata-cluster-bridge-plugin.ts): broadcast the changed namespace/key; receivers re-read the settings store and emit their local settings:changed, so every subscriber rebuilds from the DB (the DB stays the source of truth; the message carries no values or secrets).
  2. Join the F3a reconnect resync (re-read all namespaces) once F3a lands; if F3a is not merged yet, leave a clearly named hook.
  3. Tests: two kernels on a shared pubsub: a settings write on A changes B's auth posture within one second; single node emits exactly what it emits today.

Rules that bind every #3814 child (verbatim rulings on the parent)

R1 peer round-robin. R2 Redis required for multi-replica only. R3 「同意:每张卡都只在"声明多副本并接上 Redis 驱动"时才生效」: the single-node default path is unchanged, multi-replica behaviour switches on only behind declared replicas>1 AND a connected Redis cluster driver, the split-brain guard is never weakened, and the deploy README "multi-node unsupported" line stays until the final gate.

Done when

PR merged; a settings change on one replica is effective on every replica within seconds; single node unchanged.

Activity

  1. added
    enhancement
    priority:p1
    pm:queue
    domain:server
    pm:dispatched
    and removed
    pm:queue
    on Nov 8, 2026
  2. added
    pm:queue
    and removed
    pm:dispatched
    on Nov 8, 2026
  3. objectstack-fleet commented on Nov 8, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: confirmed · domain:server · p1 · pm:queue · 2026-11-08T17:00Z

    ⛔ Not a claim.


    Generated by Claude Code

  4. objectstack-fleet commented on Nov 8, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#1 · os-steve · session_01ADHkmPF1skfu2kx89BEXZi

    Claim intent — to the epic seat epic:#3814#1 (os-zhuang) · 2026-11-08T20:54Z

    ⛔ Not a claim yet.

    domain:server#1 intends to dispatch #31596 and #31597. Both are p1 and have sat in domain:server pm:queue unclaimed since triage 6724367875 (16:59Z), roughly 4 hours. Seat 1 has free capacity.

    Per #31502 point 2, the epic seat dispatches the current milestone while it is online. So this is a notice, not a take.

    The other children (#31598–#31602, #31604, #31607, #31608) are not named here.

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 9, 2026
  6. objectstack-fleet commented on Nov 9, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#1 · os-steve · session_01ADHkmPF1skfu2kx89BEXZi

    Claim: PM loop round 1 · #31597 · 2026-11-09T02:44Z · feature (p1; #3814 F3b settings lane; prioritised by the maintainer 2026-11-09T02:41Z)
    Session: session_01ADHkmPF1skfu2kx89BEXZi
    Account: os-steve
    Branch: claude/project-thread-5sumzg (the card thread's harness-pinned branch; platform exception to claude/issue-<n>-<slug>)
    Worktree: objectstack-issue-31597
    Domain: domain:server
    Seat: domain:server#1
    File surface: packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts (a fifth lane), packages/services/service-settings/src/settings-service.ts (the lane's broadcast/receive seam), their tests, content/docs/kernel/cluster.mdx, a changeset (stop on breach; explain in the report)
    Container & model: M/L, mode:thread, model: default tier, effort: high
    Clause-②: no
    Metadata-protocol: none
    Ruling-ref: #3814 R0–R6 as #31596 quotes them (R3 binds)
    Responsibility: n/a — not a defect card
    Thread-read: none
    Premise: holds (read at f65c36fc: settings:changed is an in-process Set; the bridge has four lanes; F3a's resync API is on PR #31721 head f2661d70, in the merge queue)
    Serial constraints cleared: F3a PR #31721 (this seat) is in the merge queue; this card builds against its head and pushes only after it merges. #31722 (this seat, another thread) edits the same bridge file; this card lands first, #31722 merges main after it.
    Order: standard order + server-seat1/31597-delta.md (project files).

  7. objectstack-fleet commented on Nov 9, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#1 · os-steve · session_01ADHkmNwiZZUkMiBsD19UEZ
    os-dev-report

    {
      "issue": 31597,
      "status": "done",
      "branch": "claude/project-thread-5sumzg",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/31785",
      "head": "260046945",
      "session": "session_01ADHkmNwiZZUkMiBsD19UEZ",
      "premise_still_valid": true,
      "summary": "A fifth MetadataClusterBridgePlugin lane, settings.changed: a settings write publishes its address (originNode, namespace, key, scope, action, at; never a value) and a peer emits its own local settings:changed, so every subscriber re-reads the shared store. The receive path never publishes (no echo); the writer drops its own originNode. Lane 5 attaches only behind declaresMultiReplicaOnRedis (R3) and at kernel:bootstrapped, after the settings engine bind; it joins F3a's cluster.resync through resyncSettingsChangePubSub, which announces every namespace locally once. Built on main after #31721 merged (9e1f1f90).",
      "tests": "On 260046945 after pnpm install --frozen-lockfile and turbo build of ./packages/** (exit 0): service-settings 75 files / 1430 tests passed (new settings-cluster-lane.test.ts: 10, two LiteKernel replicas over one shared Map driver and one bus, real bridge; A write turns B's auth posture within 1 s; payload keys exactly action/at/key/namespace/originNode/scope and value absent; one message per write, no echo; resync after a lost message; shutdown; CONTROL undeclared/non-redis/no-transport/malformed). service-cluster 11 files / 154 tests passed (lane-5 describe: 12 cases incl. binds at kernel:bootstrapped not kernel:ready). Ablations via scripts/ablation-replace.mjs, re-run on 260046945, suites resolve source so no dist leg: A1 value on the wire 1 red; A2 echo 4 red; A3 loopback removed 2 red; A4 R3 guard -> in-process guard 3/10 + 4/42 red; A5 shutdown detach removed 1 red in each suite; A6 resync no-transport guard 1 red; every restore blob == HEAD and git diff HEAD empty.",
      "gates": "dispatch-gates --commands on 260046945: 114 commands, all run, all exit 0; --ran reconciliation: 114 derived, 114 run, 0 NOT-MEASURED, 0 UNRUN. typecheck service-settings + service-cluster exit 0 (incl. check:test-typecheck). pnpm lint family: root eslint --no-inline-config on both package dirs exit 0. Round 1 (a6384788) red: check:settings-bind-window (getService('settings') in a kernel:ready hook) -> fixed by binding lane 5 at kernel:bootstrapped. CI check-runs: not yet concluded at report time (in_progress).",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "5 — all reads: issue_read get x1, issue_read get_comments x2, pull_request_read get x2 (#31721, #31785); 0 write tools",
      "api_writes": "2 — POST /repos/objectstack-ai/objectstack/dispatches (pr_create #31785, relay run 42558541771, read-back 9501 bytes sent == stored); this os-dev-report comment via post-stamped.mjs (relay). git push is not a REST write.",
      "files_changed": [
        ".changeset/31597-settings-changes-reach-every-replica.md (+17)",
        "content/docs/kernel/cluster.mdx (+21/-7)",
        "packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts (+120/-6)",
        "packages/services/service-cluster/src/metadata-cluster-bridge-plugin.test.ts (+179/-1)",
        "packages/services/service-settings/src/settings-service.ts (+133/-2)",
        "packages/services/service-settings/src/settings-cluster-channel.ts (new, +48)",
        "packages/services/service-settings/src/settings-cluster-lane.test.ts (new, +312)",
        "packages/services/service-settings/src/index.ts (+6)",
        "packages/services/service-settings/package.json (+1, devDependency @objectstack/service-cluster)",
        "packages/services/service-settings/vitest.config.ts (+6, source alias)",
        "pnpm-lock.yaml (+3)"
      ],
      "line_budget": "+846 / -16 over 11 files (source +301/-8; tests +491/-1; docs, changeset, config, lock the rest)",
      "deviations": [
        "Clause-②: the claim read `no`; measured on the built dist d.ts it is `yes (widening)` (two new exports and three public SettingsService methods; nothing removed). PR body and changeset carry the measured value.",
        "File surface grew beyond the claim's list: settings-cluster-channel.ts (channel constant + payload type), service-settings index.ts (exports), package.json devDependency and vitest.config.ts alias (the two-kernel suite boots the real bridge from source), pnpm-lock.yaml, and the two test files.",
        "Lane 5 binds at kernel:bootstrapped, not kernel:ready like lanes 1-4: check:settings-bind-window refused the kernel:ready read (round 1, a6384788); a peer change before the settings engine bind would have subscribers read in-memory defaults. Resync subscription factored into subscribeResync() so a later lane still joins cluster.resync.",
        "First ablation run: legs A2 and A3 were refused by ablation-replace (anchor/replacement overlap, nothing landed); re-run with distinct anchors, both red. Their first attempts were no-ops, not readings.",
        "check-plugin-teardown-shape --self-test exited 3 in round 1 until its pinned fixture was fetched (git fetch origin 621a4876…); exit 0 after, and in the final round.",
        "Developed locally on #31721's head f2661d70 while it queued; after it merged (9e1f1f90) the three commits were cherry-picked onto fresh main before the first push (nothing pushed before the merge). origin/main moved to c2bb879fe during the round with no overlapping file, so main was not merged.",
        "PR assignee/reviewer not set: the session's MCP issue_write/update_pull_request step conflicts with the standard order's no-MCP-writes rule; the standard order wins."
      ],
      "open_questions": [
        { "question": "New public names (seat's call): channel `settings.changed`, constant SETTINGS_CHANGE_CLUSTER_CHANNEL, type ClusterSettingsChangePayload, methods attach/detach/resyncSettingsChangePubSub on SettingsService.", "options": ["A keep as named (the family's dot spelling beside the local `settings:changed`; method names mirror attachDatasourceMutationPubSub / resync*PubSub)", "B rename"], "recommendation": "A, because it matches lanes 2-4 and F3a's resync seam naming" },
        { "question": "Lane 5 is gated by declaresMultiReplicaOnRedis while lanes 1-4 still gate only on the in-process driver. Keep the asymmetry?", "options": ["A keep: R3 binds new multi-replica behaviour; lanes 1-4 predate it and are not this card", "B also move lanes 1-4 to the R3 switch (a separate card)"], "recommendation": "A, because changing lanes 1-4 is out of this card's scope" }
      ],
      "security_findings": "none",
      "out_of_scope_findings": []
    }

    Stamped 2026-11-09T03:51Z.

  8. objectstack-fleet commented on Nov 9, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#1 · os-steve · session_01ADHkmPF1skfu2kx89BEXZi

    Claim: PM loop round 1 (restated: surface and Clause-② as measured on PR #31785) · #31597 · 2026-11-09T03:52Z · feature (p1; #3814 F3b settings lane; prioritised by the maintainer 2026-11-09T02:41Z)
    Session: session_01ADHkmPF1skfu2kx89BEXZi
    Account: os-steve
    Branch: claude/project-thread-5sumzg (the card thread's harness-pinned branch; platform exception to claude/issue-<n>-<slug>)
    Worktree: objectstack-issue-31597
    Domain: domain:server
    Seat: domain:server#1
    File surface: packages/services/service-cluster/src/metadata-cluster-bridge-plugin.ts (a fifth lane), packages/services/service-settings/src/settings-service.ts (the lane's broadcast/receive seam), packages/services/service-settings/src/settings-cluster-channel.ts (new: the channel name and payload type), packages/services/service-settings/src/index.ts (their exports), packages/services/service-settings/package.json + vitest.config.ts + pnpm-lock.yaml (a @objectstack/service-cluster devDependency for the lane suite), their tests, content/docs/kernel/cluster.mdx, a changeset (stop on breach; explain in the report)
    Container & model: M/L, mode:thread, model: default tier, effort: high
    Clause-②: yes (widening: new exports SETTINGS_CHANGE_CLUSTER_CHANNEL, ClusterSettingsChangePayload, three SettingsService methods; nothing narrowed)
    Metadata-protocol: none
    Ruling-ref: #3814 R0–R6 as #31596 quotes them (R3 binds)
    Responsibility: n/a — not a defect card
    Thread-read: 6731802460
    Premise: holds (read at f65c36fc: settings:changed is an in-process Set; the bridge has four lanes; F3a's resync API is on PR #31721 head f2661d70, in the merge queue)
    Serial constraints cleared: F3a PR #31721 (this seat) is in the merge queue; this card builds against its head and pushes only after it merges. #31722 (this seat, another thread) edits the same bridge file; this card lands first, #31722 merges main after it.
    Order: standard order + server-seat1/31597-delta.md (project files).

  9. removed
    pm:dispatched
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:serverenhancementpriority:p1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions