feat(06-06): envelope flows + composed ladder — minimize POST, resume GET, trip-end DELETE (GREEN)

- route.ts: onDeactivated POSTs the FROZEN six-field snapshot with
  keepalive (the minimize race's belt) and stores the server-minted id;
  onActivated DELETEs (the cron pauses — structural) and RETAINS the id;
  teardown's deleteEnvelope completes the idempotent pair; a live
  envelope is never double-minted; best-effort honesty throughout (D-13)
- resume(trip): the controller computes the projection from
  startedAtSec + avg speed (the cron's own math, one formula), renders
  GUIDE // RESUMING + gantry + projected card, draws the rebuilt line,
  arms the watch, DELETEs immediately (a resumed boot is foregrounded),
  and seeds the session mid-route on the first fix through the machine's
  own resuming path — synthesized terminal marks keep the arrive mark at
  the line's END (a steps-less envelope model would instantly arrive)
- backAction(): the PX-01 resolver's single authority — driving →
  confirm, confirm → CONTINUE, ended/route → the walk, root → close
- guidance.ts: resumingView keeps the progress math in guidance/ (RS6)
- main.ts: the COMPOSED LADDER (engine-a first, fixture fallback —
  code-constructed, zero env reads), the ?g= UUID-validated reader with
  the defensive envelope validation (fail-honest → honest boot), the
  capability-guarded activated/deactivated wiring, the recenter
  re-lock at the guidance pose, the chain-fix camera skip while driving,
  and the no-double-consult resume guard
- merged suite: G9-G12 + the E-family (co-executor tests reconciled:
  pre-gate probe, builder-format asserts, terminal-mark fixture)
  — 146 passed, typecheck clean
This commit is contained in:
araharah-executor
2026-10-24 15:31:51 +08:00
parent 6448e31a29
commit d5e104b2e9
4 changed files with 560 additions and 42 deletions
+14 -2
View File
@@ -482,8 +482,7 @@ export interface GuidanceViewData {
rows: GuidanceListRow[];
}
export function guidanceView(snap: GuidanceSnapshot, listOpen: boolean): GuidanceViewData {
const { model } = snap;
export function guidanceView(snap: GuidanceSnapshot, listOpen: boolean): GuidanceViewData { const { model } = snap;
const marks = maneuverMarksOf(model);
const next = marks[snap.nextManeuver] ?? null;
@@ -552,3 +551,16 @@ export function guidanceView(snap: GuidanceSnapshot, listOpen: boolean): Guidanc
rows,
};
}
/** The RESUMING register's card view (06-06): the projected progress math
* composed HERE — the guidance-implementation boundary (RS6) keeps every
* progress rendering out of route/, which only spreads the result into
* the builders. Pure numbers in, the card's view fields out. */
export function resumingView(
destinationName: string,
totalM: number,
projectedRemainingM: number,
): GuidanceCardData {
const pct = totalM > 0 ? Math.min(100, Math.max(0, ((totalM - projectedRemainingM) / totalM) * 100)) : 0;
return { destinationName, progressPct: pct, showNoReroute: false };
}