feat(cli): roll circuit-breaker state over across config wipes - #2856
Merged
Conversation
The DE parallel-router breaker's tripped state lived in the same config file as the install id, so the most common identity reset — deleting ~/.hyperframes — also re-enrolled the machine into an experimental path that had already failed on it. Mirror exactly two facts into a machine-local state file (~/.local/state/hyperframes/install-state.json) that a config wipe does not touch: - markerAt: written unconditionally on every install, so the fraction of fresh mints that find it directly measures recoverable id churn (config wiped, machine persisted) vs unrecoverable (fresh machine/container/new user). Emitted as install_predecessor_found on telemetry events; absent (not false) on configs predating the field. - deParallelRouterTrialFired: a breaker tripped by a previous install stays tripped for the new one. Config corruption takes the same mint path, so it survives that too. The file deliberately holds NO identity — no anonymousId, no counters. A wiped config still gets a fresh id unconditionally; only the safety fact about the machine survives. Sync happens inside writeConfig so no breaker write site can forget it; failures are swallowed (telemetry must never break the CLI) but leave the memo unset so a later write retries. `hyperframes telemetry` lists the state path for transparency. Co-Authored-By: Claude Opus 5 (1M context) <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.
Stacked on #2854.
What
The DE parallel-router circuit breaker's tripped state lived in the same config file as the install id, so the most common identity reset — deleting
~/.hyperframes— also re-enrolled the machine into an experimental path that had already failed on it.This mirrors exactly two facts into a machine-local state file (
~/.local/state/hyperframes/install-state.json) that a config wipe does not touch:deParallelRouterTrialFired— a breaker tripped by a previous install stays tripped for the new one. Config corruption takes the same mint path, so it survives that too.markerAt— written unconditionally on every install, so the fraction of fresh mints that find it directly measures recoverable id churn (config wiped, machine persisted) vs unrecoverable (fresh machine / container / new user). Emitted asinstall_predecessor_foundon telemetry events; absent (notfalse) on configs predating the field, mirroring the canary absent-vs-control semantics.What it deliberately is NOT
The file holds no identity — no anonymousId, no counters, nothing linking old install to new. A wiped config still gets a fresh id unconditionally; only the safety fact about the machine survives. Full attribution rollover (aliasing old id to new) was considered and deferred: it collides with deliberate identity resets, and the breaker-only version captures the safety value without the intent problem. The
install_predecessor_foundrate is the data that would justify going further.Mechanics
writeConfig, so no breaker write site can forget it; memoized per process so it's not an fs hit on every write.hyperframes telemetrylists the state path for transparency.Validation
18 config tests (10 new): wipe survival, corruption survival, untripped-breaker-not-invented, no-identity assertion (file keys are exactly
[deParallelRouterTrialFired, markerAt], anonymousId never appears in the bytes), marker timestamp written once, state-write failure never breaks the config write, absent-vs-false on legacy configs. Full CLI suite: 2204 passed.🤖 Generated with Claude Code