Repository navigation
feat(ops): subscribeChanges, a substrate change signal wakes an operator tick and is never trusted as a fact (#1981) - #2213
Merged
Merged
Conversation
… tick and never becomes a fact (#1981) The plugin seam gains `subscribeChanges?`, whose `onChange` takes no arguments, so a substrate's change notification has no channel through which it could reach a change set, a snapshot row or a diff line. It is a reason to look again, never evidence of what is there. `runOperatorForever` gains a second wake source behind a coalescing floor (`./change-signal.ts`, default 5s): a storm of signals costs one early round, the timer stays as the ceiling, a failing or dying subscription degrades to polling with one logged line, and every subscription is closed and its signal aborted when the loop stops. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FoXyD9UvKQ5ZdhiR9JT1yB
…n 410 Gone (#1981) `GET <list path>?watch=1&resourceVersion=<rv>&allowWatchBookmarks=true`, started from a LIST so it opens without a gap. Frame decoding, the resume-version rule and the stream-to-lines adapter live in ./watch.ts; the connection lives in the client, where discovery, credentials and the one request seam already are. `ResponseContextLike.body` gains an optional `stream()`, which client-node's own HTTP library already exposes and `send`'s `text()` cannot substitute for on a response that never completes. A transport without it falls back to the complete body, which is what a fixture returning canned NDJSON wants. `fakeWatchStream` in the testing harness drives all of it without a cluster. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FoXyD9UvKQ5ZdhiR9JT1yB
…d estate (#1981) One watch per (kind, namespace) the declared entities name, resolved through the same connector a live read uses, capped at 32 connections so a large estate refuses rather than opening a partial watch that would go quiet for whatever was dropped. Every frame is consumed by calling a no-argument onChange(); nothing a frame carries leaves the module. The operator guide gains the per-lexicon verdict table, so the absence of a signal on aws, gcp and azure is a stated position: subscribing there means deploying infrastructure into the account being observed, which inverts the property that makes a read-only watch safe to point at production. The lexicon-authoring member table gains its row. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FoXyD9UvKQ5ZdhiR9JT1yB
…lice (#1981) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FoXyD9UvKQ5ZdhiR9JT1yB
…tor's gate (#1981) The k8s subscribeChanges bound the way `chant operator` binds it, driving the real ChangeSignalGate: a frame on a declared Deployment's watch wakes a 60-second sleep in under a second, against the fake cluster. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FoXyD9UvKQ5ZdhiR9JT1yB
`temporal` is not a lexicon here, and the last `--temporal` bridge went in #2206, so the row naming it described nothing. The catch-all row now names cedar, fountain, render and cpln. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FoXyD9UvKQ5ZdhiR9JT1yB
Sixty-two of them across the doc comments, test titles, log lines and the one authoring-table row this branch wrote. Each becomes a comma, a colon, a period or a parenthetical; no wording changes beyond the joins. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FoXyD9UvKQ5ZdhiR9JT1yB
lex00
added a commit
that referenced
this pull request
Sep 7, 2026
…2214) Peer session dropped findings in #2198, #2203, #2206; this session dropped findings in #2208, #2210, #2213. Each PR deferred the ratchet so the drops would not conflict on the same baseline file, per PR #2174's precedent that the baseline is ratcheted down rather than left slack. Claude-Session: https://claude.ai/code/session_01FoXyD9UvKQ5ZdhiR9JT1yB Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
lex00
added a commit
that referenced
this pull request
Oct 27, 2026
…eside a live root (#4557) choudoufu stopped refusing a backend or cloud block beside a live declaration in its #2213: it ignores the block with a warning. TF024 now says so. A backend block is reported at info: no state is read or written there, -migrate-state is refused, an apply publishes outputs to it, and with no record_store the record store is derived from its bucket (choudoufu#2293). A cloud block, which choudoufu drops entirely, is a warning. Fixtures cover an explicit record_store and an estate.chdf.hcl sidecar. Catalog title and remediation, lineage note, lint-rules page, ops page and the audit-rules row follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1981.
The problem
The operator loop woke on a timer only, so drift on a substrate that can say "something moved" was noticed one interval late. Kubernetes can say it through a watch, and nothing in chant listened.
What this lands
An optional plugin seam,
subscribeChanges, that lets a lexicon signal that something moved so the operator wakes early. The signal is a trigger and never a fact: an early wake runs the ordinary observe tick, and nothing from the event is used as an observation.onChange()takes no argument and the gate'ssignal()takes none either, so no test can construct a diff line from a signal. A test runs one round on a timer and one woken by a fabricated event and asserts the two event lists are byte-identical.A lexicon without the seam behaves exactly as before. The loop with no subscribers takes an early-return branch that is the old loop verbatim, and the CLI does not load config or build when no configured plugin implements the seam.
Coalescing is a rate limit, not a debounce: a pending signal wakes the sleep no earlier than five seconds after the last round started, signals collapse onto one boolean, and the interval stays the ceiling. A debounce would starve under a busy cluster. A killed watch is reported once and the loop continues on the timer; the next round re-subscribes. A subscription that cannot be established degrades to polling with one line. One
AbortControllercovers all subscriptions, afinallyaborts it on any loop exit, and everyclose()is awaited withallSettled.The k8s implementation is a watch on the existing client, scoped to the group-versions the project declares, tested against the fake cluster.
packages/k8s-client'sResponseContextLike.bodygained an optionalstream(), the one widening of that seam, because a watch cannot read a response to completion. The operator daemon now runs one build at startup to learn the declared entities that scope a subscription, guarded so a project with no such plugin pays nothing.Docs
The per-lexicon verdict table from the issue is on the operator guide under a new "Change signals" section, and the lexicon-authoring optional-member table has the row. One deliberate deviation from the issue's table: it named the temporal lexicon, which no longer exists, so the row reads cedar, fountain, render, cpln.
OperatorStackneeds no knob: subscriptions come fromchant operatoritself. If disabling them in-cluster is ever wanted, that is a CLI flag plus a stack field, neither of which exists yet.Gates
Run alone on the rebased head.
No egress catalogue row is needed: the watch reaches the network through the same client seam every existing call uses, and the catalogue's closure check passes.
Read first
packages/k8s-client/src/types.tsfor the one seam widening, thencollectOperatorSubscribersinpackages/core/src/cli/handlers/operator.tsfor the startup build and its three guards, thenpackages/core/src/op/change-signal.tsfor the gate.🤖 Generated with Claude Code
https://claude.ai/code/session_01FoXyD9UvKQ5ZdhiR9JT1yB