Skip to content

Attach-state mode/posture split + the transport classifier per ADR-0005 (fleet rearchitect P4a-1) #1069

Description

@aarontrowbridge

Problem — ADR-0005 (merged, amicissimo PR #410) amends the attach-state vocabulary: mode (standalone|fleet, human-confirmed writes only) and posture (ok|degraded|hub-down, transport-written) become SEPARATE additive fields, and no transport-derived outcome may ever write the mode field. The live extension still runs the frozen vocabulary — this slice implements the amendment in the base machinery.

Approach — The machinery half of rows 2–3, driven by a config program so the fleet-specific values (thresholds, budgets) arrive later as staged overlay data (P4b): (1) attach-state gains mode + posture as additive optional fields (mode absent = standalone, posture absent = ok) with the old fields PRESERVED, never clobbered, and a read-side mapping for old values; (2) a transport classifier implements the row-3 taxonomy — transient (timeout, unreachable, handshake-fail, half-open) → posture degraded; sustained N consecutive no-responses (hysteresis, the substrate's D6 rule carried over) → hub-down; recovery → posture ok — writing ONLY the posture field, through the mode machine as the sole attach-state writer; (3) structural signals (auth-revoked class) surface as typed events for the future proposal queue (P4a-3) — stub surface, no queue yet.

Scope — in: the field split + migration mapping + the classifier machinery + its config interface + tests · out: the two-phase transition engine (P4a-2), the proposal queue (P4a-3), the fleet program values (P4b, amicissimo), any consumer switches (P3b-2)

Acceptance Criteria

  • RECON FIRST: the existing posture/attach-state/fleet surfaces (the amicode_service fleet modules + their tests) are read and the migration is designed against what exists — the live vocabulary is migrated, not greenfielded
  • Attach-state carries mode + posture as separate additive fields; old fields preserved bidirectionally (base rewrite never clobbers overlay fields and vice versa — asserted in tests); readers prefer the new fields with a mapping for old values
  • The classifier maps the full row-3 taxonomy via the F-harness in tests (FaultProxy fault modes + FakeClock hysteresis): each fault mode lands in the right posture; sustained no-response lands in hub-down; recovery lands in ok
  • ZERO mode-field writes from any injected transport outcome — the F3 core assertion, tested with the F-harness's labeled fault oracle (the train-wifi replay shape)
  • Posture writes are render-only and exempt from any serialization/journal machinery (the spec's row-3 exemption)
  • Structural-class signals emit typed events (consumed by P4a-3 later) — no behavior beyond emission yet
  • The taxonomy thresholds are config (injectable), not hard-coded — the P4b program composes them later; base defaults ship
  • Typecheck + the repo suite green; ADR-0005's reading convention applied to any residual frozen-vocabulary prose the slice touches

Key Decisions

  • Machinery (this slice, base, public) vs program (P4b, staged overlay data, premium) — the classifier's MECHANISM is base because the posture field is base-owned schema and the base product must run standalone; the fleet VALUES are premium
  • ADR-0005 is the vocabulary law — read it first (amicissimo main, docs/adr/0005)
  • Additive migration only: no field is renamed or removed; the old vocabulary values map, they don't vanish

Testing Decisions — vitest + the F-harness (on main, PR #1051): FaultProxy for fault modes, FakeClock for hysteresis windows; mirror the F3 fixture shape from the rearchitect spec §8

Constraints — vitest only; no new deps; overlay-mutation side effects stay uncommitted; shared checkouts + skills-agent worktrees OFF-LIMITS; worktree off origin/main only

Source — Part of approved spec spec-20260913-114814 (rows 2–3, §0.2/Amendment A, D1); the vocabulary law: amicissimo ADR-0005 (merged) · Blocks: P4a-2 (the transition engine consumes these fields), P4a-3 (the queue consumes the structural events)

Notes — gate discipline: director re-runs every verdict from commands; merges per the standing green directive.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    hitlNeeds human review before merge

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions