Attach-state mode/posture split + the transport classifier per ADR-0005 (#1069) - #1070
Merged
Merged
Conversation
…e writer (#1069) ADR-0005 (amicissimo #410) in the base machinery: the attach-state record gains mode (standalone|fleet, human-confirm-written) and posture (ok|degraded|hub-down, transport-written) as additive optional fields with base defaults (absent = standalone / ok). The frozen legacy state field is preserved and dual-written with its legacy projection; resolveAttachState prefers the new fields with a mapping for old values per rearchitect spec §0.2's table. The ModeMachine is the SOLE attach-state writer — three paths, three owners (writePosture / confirmMode / overlayRewrite), with bidirectional preserve-on-rewrite asserted. Posture writes are render-only and exempt from serialization/journal (the mode journal surface exists and posture writes never land in it); commit-pending is a mode-journal state, not a posture value — the posture vocabulary is closed. Structural signals (auth-revoked class) are typed events, no behavior beyond emission.
…le (#1069) The transport classifier implements the row-3 taxonomy (rearchitect spec §2.2 row 3): transient (timeout, unreachable, handshake-fail, half-open) → posture degraded; sustained N consecutive no-responses (the D6 hysteresis carried over) → posture hub-down; recovery → posture ok; the D6 latency window carries over; transient faults persisting past a fetch-age cap escalate to ONE presumed-structural typed event — never auto-applied. Every threshold and window is injectable config (the P4b fleet program composes them; base defaults ship, carried over from the fleet_posture D6 constants — one vocabulary source, not a fork). It writes ONLY the posture field through the mode machine (the sole attach-state writer) and has no mode-writing surface at all. Tests consume the F-harness (#1051): each FaultProxy fault mode lands the right posture through the real proxy, and the F3 core assertion runs the 09-13 train-wifi replay asserting the mode field is untouched by EVERY injected transport outcome — n_transport_derived_mode_field_writes == 0.
…ding convention (#1069) fleet_writes: an additive onStructural dep — the 401 revocation (D5's auth-revoked shape) also lands as a typed structural event for the P4a-3 proposal queue. No behavior beyond emission; absent, the write path is byte-identical (revocation stays honest unreachability, never degradation). fleet_posture: the frozen module's header now states ADR-0005's reading convention for its residual frozen-vocabulary prose (fleet = mode fleet + posture ok; standalone = the hub-down rendering) and names the amended write path (attach_state.ts + transport_classifier.ts). The detector's behavior is unchanged — its fixtures stay byte-identical; the consumer switch is P3b-2.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
10 tasks
8 tasks
This was referenced Sep 13, 2026
Merged
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.
P4a-1 of the approved fleet rearchitect (spec-20260913-114814 rows 2–3) — the ADR-0005 amendment implemented in the base machinery: mode (standalone|fleet, human-confirmed) and posture (ok|degraded|hub-down, transport-written) become separate additive attach-state fields, and no transport-derived outcome ever writes the mode field — the 09-13 train-wifi incident class killed at the schema level.
What lands (recon-first, evolved — not forked — from the live FleetPostureDetector):
attach_state.ts— the base-owned schema + ModeMachine, the sole attach-state writer: three write paths with three owners (writePosture — transport, mechanically cannot name mode; confirmMode — human, the only mode writer; overlayRewrite — strips machine-owned fields, killing the 09-13 clobber class at field level). Additive migration only: the frozen state field is preserved and dual-written with its legacy projection; readers prefer new fields per ADR-0005's §0.2 mapping. The mode-journal surface exists (commit-pending's P4a-2 home); posture writes never land in it (asserted).transport_classifier.ts— the row-3 taxonomy as a machine component with no mode-writing API: transient fault modes → posture degraded; sustained N-consecutive (D6 hysteresis carried over) → hub-down; recovery streak → ok; past-cap fetch-age (locally measured, never projection-age) → ONE presumed-structural typed event per episode. All thresholds injectable — the P4b fleet program composes them later.Gate evidence (director re-run): the two new suites 37/37 passed; extension typecheck clean; suite at baseline parity (same 9 evidenced environmental failures as detached origin/main, 3404 passed). Scope: 6 files +1276 (2 new modules + 2 surgical seams + 2 test files).
The F3 core assertion, tested with the F-harness: the full 09-13 train-wifi replay (tunnel flapping through the FaultProxy) — every injected fault lands the right posture,
transportModeWriteCount() == 0, the mode field untouched by every transport write. That is the rearchitect's spine, mechanically proven.Blocks: P4a-2 (the two-phase transition engine grows on confirmMode's surface), P4a-3 (the queue consumes the structural events). Merge is per the standing green directive.