Skip to content

Attach-state mode/posture split + the transport classifier per ADR-0005 (#1069) - #1070

Merged
aarontrowbridge merged 3 commits into
mainfrom
1069-attach-state-posture-split
Sep 13, 2026
Merged

aarontrowbridge merged 3 commits into
mainfrom
1069-attach-state-posture-split

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

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.
  • The auth-revoked structural seam: fleet_writes' 401 path gains an additive onStructural dep (a 401 is an ANSWER, never a posture degrade — D5 honored); absent → byte-identical.
  • The frozen detector stays untouched as the legacy read surface (its fixtures are the frozen contract; the consumer switch is P3b-2's).

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.

…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.
@aarontrowbridge aarontrowbridge added the hitl Needs human review before merge label Sep 13, 2026
@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: ce1e3cd1-f52a-49fc-b737-27aed169d09c


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hitl Needs human review before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant