Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: allow acknowledged walk reopen (#3044)
[._.]/ Adam Eivy61a774e69892
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex ca5437c90f..1b893dfd70 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -218,3 +218,4 @@- **[issue-3049] Pin the walk aligner to the character's torso, not its bounding box** — a re-derived walk cycle slid visibly left and right as the legs scissored instead of walking in place; measured on a real packed 12-frame strip the torso travelled **29px** in a 384px cell. `alignFrames` crops each frame to its own alpha bbox and composites the crop at `dx`, and since #3021 `dx` was a single shared value — but `sourceRootXs[i]` is measured *relative to that frame's own crop*, so a constant `dx` pins `bbox.left` (the leading arm/leg extremity) and lets the body swing by the full spread of those offsets. The emitted manifest showed it exactly: `hipOffsets` spanning 26.2px against `translations` whose x was `122` for all twelve frames, and the strip itself had `bbox.left` at exactly 122 in every cell while the hip swung 179→205. #3021's premise was right (the old 42%–76% hip/leg band did migrate as the legs scissored) but freezing `dx` swapped it for a *worse* landmark: measured in absolute source coordinates over one 6s clip, the candidates rank torso 14px · hip 17px · head 24px · **bbox.left 44px** · legs 52px. So `rootX` now measures the **torso** band (30%–58%, above the knees — the visual mass a viewer tracks and the part genuinely stationary in a walk-in-place) and `dx` is per-frame again, computed from each frame's own crop offset so the shared landmark lands on the pivot every time; that cancels the crop variation *and* the residual drift grok leaves in a "walk in place" clip (~14px). `rootX` is shared with `atlas.js` for idle-frame registration, so both moved together. The #3021 guard had asserted the mechanism (`new Set(translations.map(([dx]) => dx)).size === 1`) rather than the behaviour, and its own fixed-torso/swinging-arm fixture passed while the body slid 30px — it now measures where the torso *lands* in the output frames and requires ≤1px spread, which pinning the crop cannot satisfy. Re-deriving a real direction: torso spread **29px → 1.0px**, with the hip band still swinging 8px and `bbox.left` varying 9px (limbs moving, body still).- **[issue-3050] Spread walk-cycle phases evenly when the gait period doesn't divide the frame count** — a re-derived walk could read as a limp rather than a smooth loop: the *timing* was uneven, not the seam (which is why `validation` never flagged it — the loop closed fine). `selectCycleIndices` resamples the detected window with `pyRound(i * cycleLength / frameCount)`, and `pyRound` is Python's round-half-to-even, so a `.5` tie breaks toward the even integer — meaning the tie's *direction* depends on the parity of the integer part and consecutive ties resolve opposite ways. A 15-frame gait over 12 phases landed its ties at 2.5→2 (down), 7.5→8 (up), 12.5→12 (down), putting double-steps at positions 2, 5 and 10 — spacings of 3 and 5, an arrhythmic hitch. The run manifest corroborated it: those three transitions carried ~28% more motion than the single-step median. Phase indices are now distributed with integer half-up (`floor((i * cycleLength + frameCount/2) / frameCount)`), which resolves every tie the same way, so the unavoidable stretch is spread evenly — 15→12 moves its double-steps to 1, 5 and 9 (gaps of 4 and 4). This is the one place that deliberately does not use `pyRound`: the pixel math keeps it for byte-compatibility with the source pipeline, while phase selection is a perceptual-quality question and only it has a tie problem. The legacy 12→8 default was affected too (strides `2,1,1,2,2,1,1` → `2,1,2,1,2,1,2`), as were 18→12 and any other ratio landing ties at regular intervals; 16→12, 13→12 and 12→12 were already even and are unchanged. The old golden-array test asserted the banker's-rounding output directly; it is replaced by a property assertion — at most two distinct stride lengths, differing by 1, with the longer ones evenly spaced — checked across five ratios so a future change to the resample has to preserve it for all of them.- **[issue-3052] Stop the requested phase count from hiding a shorter gait period** — a walk read as janky leg movement (the legs visibly jump mid-loop) even though the endpoint seam scored well and validation passed. `selectCycleIndices` searched only windows of at least `frameCount`, on the grounds that a shorter one cannot yield that many *distinct* source frames — but that floor also made any gait whose real period is shorter **invisible to the detector**. On a real clip the gait ran 11 frames against 12 requested phases, so the search could only offer a 15-frame window: **1.36 gait cycles**, which replays a third of a stride. It scored well because a front-facing walk is near-symmetric, so 15 frames lands on the *mirrored* pose and an image-distance metric reads that as the same one — `endpointSeamScore` 0.53 while the legs were plainly wrong. The detector now probes for the true period without the output-count floor and prefers it when it is only mildly shorter (`MIN_PERIOD_RATIO = 0.8`), holding one frame to reach the requested count: a far smaller artifact than replaying part of a stride, and bounded so a much shorter period still falls back to the longer window. `cycleSelection.heldFrames` records how many phases repeat, and `validateFrames` takes it so an intentional hold is not confused with the "packer picked the same frame twice" failure that guard exists for. Across one character's seven directions the probe found better (lower-seam) windows on five — south 15→11 (0.531→0.476), south-east 12→11 (1.082→**0.438**), north-east 12→11 (0.985→**0.600**). **Rejected on evidence:** re-extracting at `WALK_FPS * frameCount / period` so the period lands exactly on the count was built and measured, and is wrong twice over — ffmpeg's `fps` filter picks the nearest source frame, so any rate that is not `sourceFps / k` samples unevenly (13.09fps from a 24fps source gives source-frame steps `[2,2,2,1,2,2,2,2,2,1,2,2]`, widening the adjacent-motion range from 2.2× to 11×), and extracting denser gains nothing because the clip is 12fps content encoded at 24fps with every frame duplicated (adjacent scores at 24fps alternate `1.29, 0.21, 2.65, 0.10…`). `WALK_FPS = 12` is already the native content rate, so an 11-frame period genuinely cannot yield 12 distinct phases.+- **[issue-3044] Let a clipless imported walk direction be reopened for regeneration** — per-direction Reopen now uses the same server resolver and informed `acknowledgeNoClips` escape as set-wide Unlock, with the `{ blocked, stranded, acknowledgeable }` result stamped on its run. A blocked card explains the one-new-render cost and offers an inline **Reopen anyway** confirmation when its locked anchor makes regeneration safe; otherwise it shows no guaranteed-409 control. The copy is shared with the Unlock panel, so their cost and recovery wording stay in sync.diff --git a/client/src/components/sprites/WalkWorkflow.jsx b/client/src/components/sprites/WalkWorkflow.jsxindex fecc3a85de..3a2af0694b 100644--- a/client/src/components/sprites/WalkWorkflow.jsx+++ b/client/src/components/sprites/WalkWorkflow.jsx@@ -236,13 +236,15 @@ function DirectionCard({// approved strip replaces it as soon as there is an animation to inspect.const hasWalkPreview = Boolean((approved || candidate) && run?.stripPreview?.stripPath);const hasSourceClip = hasClip(run);- // The dead end: still packaged by the source pipeline AND no clip to re-derive- // from. Everything the server refuses for this direction refuses on exactly- // this, so every affordance below reads it rather than the import label alone.- // `run.importedPackaging` is the load-bearing half: the set-level `imported`- // prop comes off the frozen walk set, which is GONE after an unlock or the- // first reopen — exactly when the remaining directions still need gating.+ // Used only by the drift explanation: a source-packaged run without a clip+ // cannot be reprocessed. Reopen reads the server-stamped block below instead,+ // including its fresh-render escape after the frozen set disappears.const importedNoClip = (imported || Boolean(run?.importedPackaging)) && !hasSourceClip;+ // The server stamps the reopen block with the exact same resolver that will+ // validate the POST. A missing block from an older peer remains an ordinary+ // reopen; only a stamped block changes the affordance.+ const reopenCopy = walkUnlockCopy(run?.reopen, { mode: 'reopen', direction });+ const reopenBlocked = Boolean(reopenCopy);const statusLabel = approved ? 'approved': (pending || rendering) ? 'rendering…': run?.status === 'postprocessing' ? 'packaging…'@@ -299,8 +301,8 @@ function DirectionCard({be the first and only place a ragged set showed up. The remedy dependson what the direction still has behind it: an unapproved candidate canbe re-derived from its on-disk clip with the Reprocess button below, an- approved one has to be reopened first, and an import with no clip needs- the source clip imported before it can be re-derived at all. */}+ approved one has to be reopened first, and a clipless import follows+ the server-backed reopen recovery shown below. */}{drift && (<p className="text-[10px] text-port-warning border border-port-warning/60 rounded px-1.5 py-1 leading-tight">{[drift.frameCountDrifts && `${drift.frameCount}f`, drift.fpsDrifts && `${drift.fps}fps`]@@ -314,18 +316,17 @@ function DirectionCard({{/* The server dropped this run's stripPath because its packed strip isgone on disk (stripMissing) — render an explicit indicator in place ofthe blank loop, pointing at the recovery that actually works for this- direction's state: a finalized set must be unlocked first, an- unapproved candidate can just be regenerated (the Generate button- below). Deliberately not the status==='error' path, which offers a+ direction's state: a finalized direction uses its server-backed walk+ action, while an unapproved candidate can just be regenerated (the+ Generate button below). Deliberately not the status==='error' path, which offers a"Retry postprocess" that 409s for a finalized/approved run. */}{(approved || candidate) && run?.stripMissing && (<p className="text-[10px] text-port-error border border-port-error/60 rounded px-1.5 py-1 leading-tight">- {/* An import with no clip behind it still refuses unlock/reopen, so- naming them there would advise a guaranteed-409 the drift badge and- the hidden Reopen/Unlock buttons already avoid. With a clip it- recovers exactly like a native direction. */}- Walk strip missing on disk — {importedNoClip ? REIMPORT_REMEDY- : finalized ? 'unlock the set to regenerate this direction' : 'regenerate to repack it'}.+ {/* A missing strip has its own recovery path. The action below carries+ the server's exact reopen/unlock decision, including whether a+ clipless import can be regenerated from its locked anchor. */}+ Walk strip missing on disk — {finalized+ ? 'use the walk action below to regenerate this direction' : 'regenerate to repack it'}.</p>)}@@ -442,13 +443,34 @@ function DirectionCard({reprocessed / re-approved — for when one walk is too fast or wrong andthe rest are fine. Un-freezes a finalized set but keeps the other sevenapprovals; the rendered clip is preserved, so re-approval is one click.- Inline confirm (not a hidden two-click arm) per the repo's UX.- Hidden only for an imported direction with NO clip on disk — there the- server refuses reopen (LEGACY_IMPORTED_WALK_SET) exactly as it refuses- unlock, so offering the button would guarantee a 409 on click. An- imported direction whose clip came across reopens like any other.- Mirrors how the header gates Unlock. */}- {approved && !importedNoClip && (+ A stamped blocked branch names the fresh-render cost before sending the+ acknowledgement; an ordinary branch stays the compact existing action. */}+ {approved && (reopenBlocked ? (+ <Banner tone="warning" size="sm" icon={RotateCcw} className="space-y-1.5">+ <p className="leading-relaxed">{reopenCopy.text}</p>+ {reopenCopy.action && (reopening ? (+ <ConfirmButtonPair+ prompt={reopenCopy.prompt}+ confirmText={reopenCopy.action}+ confirmIcon={RotateCcw}+ tone="warning"+ ariaLabel={`Confirm reopen ${direction} without source clips`}+ onConfirm={() => {+ setReopening(false);+ onReopen(direction, reopenCopy.acknowledgeNoClips, reopenCopy.toast);+ }}+ onCancel={() => setReopening(false)}+ />+ ) : (+ <button+ onClick={() => setReopening(true)}+ className="flex items-center gap-1 px-1.5 py-0.5 text-xs bg-port-bg border border-port-warning/60 rounded text-port-warning hover:bg-port-warning/10"+ >+ <RotateCcw className="w-3 h-3" /> {reopenCopy.action}+ </button>+ ))}+ </Banner>+ ) : (reopening ? (<ConfirmButtonPairprompt={finalized ? 'Reopen (un-freezes set)?' : 'Reopen this direction?'}@@ -468,7 +490,7 @@ function DirectionCard({<RotateCcw className="w-3 h-3" /> Reopen</button>)- )}+ ))}{/* The single trim UI now lives in the Loop Trimmer workspace (#2933);each card just links into it, deep-linked to this run. Shown for@@ -615,9 +637,9 @@ export default function WalkWorkflow({}, { errorMessage: 'Reprocess failed' });// Re-open ONE approved direction (finer-grained than the set-wide Unlock).- const [reopen] = useAsyncAction(async (direction) => {- await reopenSpriteWalk(recordId, { direction }, { silent: true });- toast.success(`Walk ${direction} reopened — regenerate or reprocess it`);+ const [reopen] = useAsyncAction(async (direction, acknowledgeNoClips = false, successMessage = null) => {+ await reopenSpriteWalk(recordId, { direction, acknowledgeNoClips }, { silent: true });+ toast.success(successMessage || `Walk ${direction} reopened — regenerate or reprocess it`);onChanged();}, { errorMessage: 'Reopen failed' });diff --git a/client/src/components/sprites/WalkWorkflow.test.jsx b/client/src/components/sprites/WalkWorkflow.test.jsxindex 2cb80201dd..67f74e6e01 100644--- a/client/src/components/sprites/WalkWorkflow.test.jsx+++ b/client/src/components/sprites/WalkWorkflow.test.jsx@@ -162,8 +162,9 @@ describe('WalkWorkflow loop preview', () => {// When the server flags a run stripMissing (its packed strip is gone on disk)// it drops the stripPath, so the loop can't render. The card must show an// explicit indicator pointing at the recovery that works for the direction's- // state — regenerate an unapproved/unfinalized direction, unlock a finalized- // set — never the status==='error' "Retry postprocess" that would 409.+ // state — regenerate an unapproved/unfinalized direction, use the server-backed+ // walk action for a finalized set — never the status==='error' "Retry+ // postprocess" that would 409.const renderMissing = ({ finalized }) => render(<MemoryRouter><WalkWorkflow@@ -191,9 +192,9 @@ describe('WalkWorkflow loop preview', () => {expect(screen.queryByRole('img', { name: 'walk loop preview' })).toBeNull();});- it('points a finalized direction at unlock instead of regenerate', () => {+ it('points a finalized direction at its server-backed walk action', () => {renderMissing({ finalized: true });- expect(screen.getByText(/Walk strip missing on disk — unlock the set to regenerate this direction\./)).toBeInTheDocument();+ expect(screen.getByText(/Walk strip missing on disk — use the walk action below to regenerate this direction\./)).toBeInTheDocument();});it('scales the preview box to a non-square cell', () => {@@ -559,20 +560,24 @@ describe('WalkWorkflow reprocess + reopen', () => {act(() => { screen.getByRole('button', { name: /^Reopen$/ }).click(); });// Inline confirm surfaces, then the confirm fires the API.await act(async () => { screen.getByRole('button', { name: /^Reopen$/ }).click(); });- expect(reopenSpriteWalk).toHaveBeenCalledWith('example-walker', { direction: 'east' }, { silent: true });+ expect(reopenSpriteWalk).toHaveBeenCalledWith(+ 'example-walker', { direction: 'east', acknowledgeNoClips: false }, { silent: true },+ );});- it('hides Reopen on an import whose clip is not on disk, whose server refuses it', async () => {- // An imported direction with no clip behind it has nothing to re-derive- // from, so reopen (like unlock) 409s LEGACY_IMPORTED_WALK_SET — offering the- // button would guarantee an error on click. The remedy is re-importing.+ it('uses the server-stamped block to offer acknowledged Reopen on a clipless import', async () => {+ reopenSpriteWalk.mockClear();render(<MemoryRouter><WalkWorkflowrecord={{ id: 'example-walker' }}reference={{ manifest: { mainReference: { locked: true }, anchors: [{ direction: 'east', status: 'locked' }] } }}walk={{- runs: [{ id: 'run-east', direction: 'east', status: 'approved', stripPreview: { stripPath: 'runs/run-east/generated/strip.png', frameCount: 12, fps: 10, cellWidth: 384, cellHeight: 384 } }],+ runs: [{+ id: 'run-east', direction: 'east', status: 'approved',+ reopen: { blocked: true, stranded: ['east'], acknowledgeable: true },+ stripPreview: { stripPath: 'runs/run-east/generated/strip.png', frameCount: 12, fps: 10, cellWidth: 384, cellHeight: 384 },+ }],selection: { directions: { east: { status: 'approved', runId: 'run-east' } } },walkSet: {imported: true,@@ -592,10 +597,12 @@ describe('WalkWorkflow reprocess + reopen', () => {</MemoryRouter>,);expect(screen.queryByRole('button', { name: /^Reopen$/ })).toBeNull();- expect(screen.getByText(/imported · no clips to re-derive/)).toBeTruthy();- // …but re-deriving being impossible is NOT the same as the set being frozen- // forever (#3043): the anchor is locked, so regeneration is offered.- expect(screen.getByRole('button', { name: /Unlock anyway/ })).toBeTruthy();+ expect(screen.getByText(/Reopening anyway lets east be regenerated/)).toBeTruthy();+ fireEvent.click(screen.getByRole('button', { name: /^Reopen anyway$/ }));+ fireEvent.click(screen.getByRole('button', { name: /^Reopen anyway$/ }));+ await waitFor(() => expect(reopenSpriteWalk).toHaveBeenCalledWith(+ 'example-walker', { direction: 'east', acknowledgeNoClips: true }, { silent: true },+ ));});// The acknowledged unlock is an override of the CLIP requirement only. When the@@ -748,11 +755,11 @@ describe('WalkWorkflow reprocess + reopen', () => {expect(screen.getByRole('button', { name: /^Reopen$/ })).toBeTruthy();});- // Once a set is un-frozen (an unlock, or a reopen of some OTHER direction)- // there is no walkSet to carry the imported flag — but the still-approved- // directions behind it must stay gated, or a clipless one is strandable by- // clicking twice. The run's own `importedPackaging` is what survives.- it('keeps a clipless imported direction gated after the set is un-frozen', async () => {+ // Once a set is un-frozen (an unlock, or a reopen of some OTHER direction),+ // the remaining source-packaged direction has no walkSet to carry a block.+ // Its stamped run block survives instead, so the client still names the fresh+ // render cost before it sends the acknowledgement.+ it('keeps the acknowledged reopen affordance after the set is un-frozen', async () => {render(<MemoryRouter><WalkWorkflow@@ -764,6 +771,7 @@ describe('WalkWorkflow reprocess + reopen', () => {direction: 'east',status: 'approved',importedPackaging: true,+ reopen: { blocked: true, stranded: ['east'], acknowledgeable: true },stripPreview: { stripPath: 'grok/run-east/generated/strip.png', frameCount: 12, fps: 10, cellWidth: 384, cellHeight: 384 },}],selection: { directions: { east: { status: 'approved', runId: 'run-east' } } },@@ -780,21 +788,22 @@ describe('WalkWorkflow reprocess + reopen', () => {/></MemoryRouter>,);- expect(screen.queryByRole('button', { name: /^Reopen$/ })).toBeNull();+ expect(screen.getByRole('button', { name: /^Reopen anyway$/ })).toBeTruthy();});- // The set-level flag stays true while ANY direction is still source-packaged,- // so a card must read the per-direction list the server stamps — otherwise a- // direction already re-derived here keeps being treated as un-reopenable.- it('reads the per-direction imported list, not the set-level flag', async () => {+ // A card does not recreate the source-path/clip rule from legacy import+ // metadata. An unblocked stamp (or a block absent from an older peer) keeps+ // the ordinary Reopen affordance; current servers attach the authoritative+ // block directly to the selected run.+ it('does not derive the reopen block from imported metadata', async () => {render(<MemoryRouter><WalkWorkflowrecord={{ id: 'example-walker' }}reference={{ manifest: { mainReference: { locked: true }, anchors: [{ direction: 'east', status: 'locked' }] } }}walk={{- // East carries no clip, but it is NOT in importedDirections — it was- // already re-derived here, so the server no longer refuses it.+ // East carries no clip, but has no server block; the card must not+ // re-create one from the surrounding imported walk metadata.runs: [{ id: 'run-east', direction: 'east', status: 'approved', stripPreview: { stripPath: 'runs/run-east/generated/strip.png', frameCount: 12, fps: 10, cellWidth: 384, cellHeight: 384 } }],selection: { directions: { east: { status: 'approved', runId: 'run-east' } } },walkSet: {diff --git a/client/src/lib/README.md b/client/src/lib/README.mdindex 2ee4909968..c16099e11f 100644--- a/client/src/lib/README.md+++ b/client/src/lib/README.md@@ -142,7 +142,7 @@ grep -i "what you want to do" client/src/lib/README.md| `spriteFacets.js` | Client-side facet classifier for the Sprite Manager's asset collection (#2931), mirroring the source pipeline's `classify_asset()`. `classifySpriteAsset(path)` decodes a record-relative asset path into `{ family, status, role, direction, runId }` — `status ∈ runtime/approved/candidate/superseded/rejected/source`, `role ∈ reference/strip/animation/frame/atlas/evidence/sprite/manifest` — and is total (an unknown path degrades to `sprite`/`source` rather than throwing). `classifySpriteAssets(assets)` adds the one facet only knowable across a listing: an approved asset below the highest `-vN` of its stem becomes `superseded`. `groupSpriteAssetsByRole(assets)` returns render-ready `{ role, label, assets }` sections in `SPRITE_ASSET_ROLES` order — it does NOT render a `manifest` group: each runtime atlas's sidecar manifest is folded onto its atlas row as `row.manifest`, and other behind-the-scenes JSON is omitted. `runtimeVersionDir(path)` / `isRuntimeVersionPath(path)` / `isRuntimeSidecarManifest(path)` expose the `runtime/vN` grammar (the sidecar-pairing key and the "is this a build manifest" predicate) so callers like `AssetInspector` reuse one definition instead of re-regexing. Also exports `SPRITE_DIRECTIONS` (mirror of `server/services/sprites/prompts.js`) — the `direction`/`runId` facets are what drive the collection's Regenerate and Edit-in-Loop-Trimmer actions. Pure — no React, no I/O. || `spriteRecordGroups.js` | Grouping + search for the Sprite Manager sidebar's record picker (#2932). `groupSpriteRecords(records)` → ordered `[{ key, label, records }]` under **Characters / Places / Objects** (`props` folded into Objects alongside `object`, no migration). `filterSpriteRecords(records, query, limit=8)` is the autocomplete filter — multi-term (AND) substring over `name`/`id`/`kind`, capped at `limit`. `groupKeyForKind(kind)` maps a kind to its group key (unknown → `objects`). `SPRITE_RECORD_GROUPS` / `NEW_SPRITE_KINDS` back the browse disclosure and the create-panel kind selector. Pure — no React, no I/O; the page owns the per-group icons. || `spriteTrimmer.js` | Pure geometry + source-list math behind the Sprite Manager's Loop Trimmer workspace (#2933). `buildTrimmerSources(walk, assets)` → the ordered animation sources the trimmer can load (every preview-strip run first, then saved trims read from the asset listing), each `{ id, kind: 'run'\|'trim', runId, direction, label, stripPath, frameCount, fps, trimmable }` — every packed-strip run is `trimmable` (layout-agnostic), while saved trims are preview-only, mirroring `spriteCollectionActions`' gate. `stripFrameGeometry(stripPreview)` → `{ frameCount, fps, cellWidth, cellHeight }` with the native 8-phase / 12fps fallback; `phaseLabelFor(index, frameCount)` names the 8 walk phases (bare `frame N` for any other length); `sanitizeTrimSlug(name)` → the server's `[a-z0-9-]+` output slug; `allColumns(n)` / `invertColumns(n, enabled)` for the frame-toggle set. `WALK_PHASES` is the shared phase-label constant (WalkWorkflow imports it here). Also holds the walk-cycle authoring knobs mirrored from `walkBounds.js` — `WALK_DEFAULT_FRAME_COUNT` / `WALK_DEFAULT_FPS`, the `WALK_FRAME_COUNT_OPTIONS` list and `walkFpsOptionsFor(fps)` (splices a current odd fps into the even-step list so the `<select>` never lies) — feeding the shared `CycleTarget` control used by both the walk workflow and the trimmer's re-derive panel (#2980). Pure — no React, no canvas, no I/O. |-| `spriteWalkUnlock.js` | The user-facing copy for a BLOCKED walk-set unlock (#3043), shared by the Walk Cycles header panel and the Loop Trimmer lock block so one server-stamped `walkSet.unlock` can never be described two different ways. `walkUnlockCopy(unlock)` → `{ text, action, prompt, acknowledgeNoClips, toast }` for a blocked set (null when it is not blocked): a blocked-but-`acknowledgeable` set gets the regeneration offer plus the `acknowledgeNoClips` consent flag the unlock POST carries, a non-acknowledgeable one gets the dead-end explanation and no action. `WALK_UNLOCK_TOAST` is the ordinary unlock success message. Pure — no React, no I/O. |+| `spriteWalkUnlock.js` | The user-facing copy for a BLOCKED walk re-open (#3043/#3044), shared by the Walk Cycles header, per-direction cards, and Loop Trimmer so one server-stamped block can never be described two different ways. `walkUnlockCopy(unlock, { mode?, direction? })` → `{ text, action, prompt, acknowledgeNoClips, toast }` for a blocked scope (null when it is not blocked): a blocked-but-`acknowledgeable` scope gets the regeneration offer plus the `acknowledgeNoClips` consent flag its POST carries, a non-acknowledgeable one gets the dead-end explanation and no action. `WALK_UNLOCK_TOAST` is the ordinary unlock success message. Pure — no React, no I/O. || `tribe.js` | Pure Tribe domain helpers shared by the Tribe page and its `TribeCircleMap` visualization: `RINGS` (support→core→tribe→village Dunbar rings + the uncapped `external` "outside the tribe" classification — caps, cadence defaults, Tailwind tones + `hex`), `TRIBE_RINGS` (the four inner rings the care queue/capacity/overdue counts operate over, excluding `external`), `ENERGY` (energy tiers + `hex`), `STATUS_HEX` (cadence-status → SVG stroke color), `contactStatus(contact)` (presentation wrapper over the shared `cadenceStatus` — attaches label/tone to the missing/overdue/soon/steady/`external` state) / `daysBetween(date)` (alias of the shared `daysSinceDate`), `ringFor` / `energyFor` lookups, `tagsToArray` / `tagsToInput`, and `initialsFor(name)` (node glyph). Ring `cadenceDays` mirror `DEFAULT_RING_CADENCE` in `server/services/tribe.js`; the cadence STATE MACHINE lives in `tribeCadence.js`. || `tribeCadence.js` | Mirror of `server/lib/tribeCadence.js` — the single authoritative Tribe care-cadence rules shared by the page, the Care dashboard widget, and the proactive alert: `cadenceStatus(entity)` → `{ state, daysRemaining, daysOverdue }`, `daysSinceDate(dateStr)`, `DEFAULT_CADENCE_DAYS`, `SOON_WINDOW_DAYS`. A cross-boundary contract test asserts it never drifts from the server copy. || `streakGlyph.js` | `streakGlyph(streak)` — the single POST streak emoji (✨ / ⚡ / 🔥 by day count) shared by the POST launcher, Morse trainer, daily widget, and dashboard streak widget. |diff --git a/client/src/lib/spriteWalkUnlock.js b/client/src/lib/spriteWalkUnlock.jsindex 7f092cb5ce..132f7131b1 100644--- a/client/src/lib/spriteWalkUnlock.js+++ b/client/src/lib/spriteWalkUnlock.js@@ -1,22 +1,22 @@-// The user-facing explanation of a BLOCKED walk-set unlock (#3043), in one-// place because two surfaces render it: the Walk Cycles header panel and the-// Loop Trimmer's lock block. Both describe the same server-stamped-// `walkSet.unlock` — two hand-written copies drifted within the same change-// ("one new grok render each" vs "…per direction"), which is exactly how a user-// meets two different accounts of one irreversible-ish action depending on which-// panel they happened to open.+// The user-facing explanation of a BLOCKED walk re-open (#3043/#3044), in one+// place because the set-wide Unlock, per-direction Reopen, and Loop Trimmer+// describe the same server-stamped block. Two hand-written copies drifted within+// the same change ("one new grok render each" vs "…per direction"), which is+// exactly how a user meets two different accounts of one irreversible-ish action+// depending on which panel they happened to open.//// Pure: takes the stamped block, returns strings. No React, no I/O.-// The three facts a blocked unlock has to convey, assembled once.+// The three facts a blocked walk re-open has to convey, assembled once.//-// `blocked: false` returns null — the caller renders its ordinary Unlock. A-// blocked-but-`acknowledgeable` set gets the regeneration offer and the+// `blocked: false` returns null — the caller renders its ordinary action. A+// blocked-but-`acknowledgeable` scope gets the regeneration offer and the// `acknowledgeNoClips` flag that carries the user's consent to the server; a-// blocked and NON-acknowledgeable set gets the dead-end explanation and no+// blocked and NON-acknowledgeable scope gets the dead-end explanation and no// action, because there is genuinely nothing to offer.-export function walkUnlockCopy(unlock) {+export function walkUnlockCopy(unlock, { mode = 'unlock', direction = null } = {}) {if (!unlock?.blocked) return null;+ const reopening = mode === 'reopen';const stranded = unlock.stranded || [];const one = stranded.length === 1;const who = stranded.length@@ -44,6 +44,16 @@ export function walkUnlockCopy(unlock) {// — a non-stranded direction whose anchor happens to be unlocked is not// covered by the gate, and telling the user otherwise is the same// promise-more-than-you-proved mistake the gate itself avoids.+ if (reopening) {+ const target = direction || stranded[0] || 'this direction';+ return {+ text: `${who} Reopening anyway lets ${target} be regenerated from its locked anchor — one new grok render. Nothing on disk is deleted, but this direction's approval is dropped and the set stops compiling until it is approved again.`,+ action: 'Reopen anyway',+ prompt: `Re-open ${target} for regeneration?`,+ acknowledgeNoClips: true,+ toast: `Walk ${target} reopened — regenerate it from its locked anchor`,+ };+ }const regenerated = stranded.length? `${stranded.join(', ')} can be regenerated from ${one ? 'its' : 'their'} locked anchor — one new grok render ${one ? 'for it' : 'each'}`: 'each direction can be regenerated from its locked anchor — one new grok render per direction';diff --git a/client/src/lib/spriteWalkUnlock.test.js b/client/src/lib/spriteWalkUnlock.test.jsindex 07ba06b95f..92eaafe5c9 100644--- a/client/src/lib/spriteWalkUnlock.test.js+++ b/client/src/lib/spriteWalkUnlock.test.js@@ -22,6 +22,19 @@ describe('walkUnlockCopy', () => {expect(copy.text).toMatch(/every approval is dropped/);});+ it('uses the same cost-bearing copy for a blocked per-direction reopen', () => {+ const copy = walkUnlockCopy(+ { blocked: true, stranded: ['east'], acknowledgeable: true },+ { mode: 'reopen', direction: 'east' },+ );+ expect(copy.action).toBe('Reopen anyway');+ expect(copy.prompt).toBe('Re-open east for regeneration?');+ expect(copy.acknowledgeNoClips).toBe(true);+ expect(copy.text).toMatch(/one new grok render/);+ expect(copy.text).toMatch(/this direction's approval is dropped/);+ expect(copy.toast).toMatch(/east reopened/);+ });+// The server only verifies locked anchors for the STRANDED directions, so the// copy must not claim regeneration for all eight. Pinned as a property: the// regeneration clause names the stranded list, and never asserts a blanketdiff --git a/client/src/services/apiSprites.js b/client/src/services/apiSprites.jsindex 75cd70a9ea..5b922a5a93 100644--- a/client/src/services/apiSprites.js+++ b/client/src/services/apiSprites.js@@ -158,7 +158,7 @@ export const unlockSpriteWalk = (id, body = {}, options = {}) => request(`/sprit});// Re-open ONE approved direction (finer-grained than unlock) so it can be-// regenerated/reprocessed/re-approved. Body: { direction }.+// regenerated/reprocessed/re-approved. Body: { direction, acknowledgeNoClips }.export const reopenSpriteWalk = (id, body, options = {}) => request(`/sprites/${encodeURIComponent(id)}/walk/reopen`, {method: 'POST', body: JSON.stringify(body), ...options,});diff --git a/server/lib/validation.js b/server/lib/validation.jsindex e5fd1199c6..73348f6683 100644--- a/server/lib/validation.js+++ b/server/lib/validation.js@@ -1251,16 +1251,18 @@ export const spriteWalkApproveSchema = z.object({runId: spriteResolvableRunIdSchema,});+// The optional acknowledgement is shared by both ways to re-open imported walk+// work. Defaulted rather than `.optional()` so the service's own default and the+// wire shape agree, and an older client's body still means "do not override".+const spriteWalkAcknowledgeNoClipsSchema = z.boolean().default(false);+export const spriteWalkReopenSchema = z.object({direction: spriteWalkDirectionSchema,+ acknowledgeNoClips: spriteWalkAcknowledgeNoClipsSchema,});-// Unlock takes no required input; the one optional flag is the user's informed-// override of the "imported set has no clips to re-derive from" refusal (#3043).-// Defaulted rather than `.optional()` so the service's own default and the wire-// shape agree, and an older client's empty body still means "do not override".export const spriteWalkUnlockSchema = z.object({- acknowledgeNoClips: z.boolean().default(false),+ acknowledgeNoClips: spriteWalkAcknowledgeNoClipsSchema,});export const spriteWalkPostprocessSchema = z.object({diff --git a/server/routes/sprites.js b/server/routes/sprites.jsindex 31525081da..27e7905b3c 100644--- a/server/routes/sprites.js+++ b/server/routes/sprites.js@@ -243,6 +243,7 @@ router.post('/:id/walk/unlock', asyncHandler(async (req, res) => {// Re-open ONE approved direction (finer-grained than unlock) so it can be// regenerated/reprocessed/re-approved — the user noticed one walk is too fast// or wrong. Un-finalizes a frozen set but keeps other directions' approvals.+// A clipless source import accepts the same informed acknowledgement as unlock.router.post('/:id/walk/reopen', asyncHandler(async (req, res) => {const body = validateRequest(spriteWalkReopenSchema, req.body);res.json(await reopenWalkDirection(req.params.id, body));diff --git a/server/routes/sprites.test.js b/server/routes/sprites.test.jsindex 5c3ee92bd4..dc268f7fde 100644--- a/server/routes/sprites.test.js+++ b/server/routes/sprites.test.js@@ -509,11 +509,19 @@ describe('sprites routes', () => {.send({ frameCount: 14, fps: 99 })).status).toBe(400);});- it('POST /:id/walk/reopen validates the direction and delegates', async () => {+ it('POST /:id/walk/reopen validates the direction and delegates its acknowledgement', async () => {const r = await request(app).post('/api/sprites/pioneer/walk/reopen').send({ direction: 'east' });expect(r.status).toBe(200);- expect(walk.reopenWalkDirection).toHaveBeenCalledWith('pioneer', { direction: 'east' });+ expect(walk.reopenWalkDirection).toHaveBeenCalledWith('pioneer', {+ direction: 'east', acknowledgeNoClips: false,+ });+ const acknowledged = await request(app).post('/api/sprites/pioneer/walk/reopen')+ .send({ direction: 'east', acknowledgeNoClips: true });+ expect(acknowledged.status).toBe(200);+ expect(walk.reopenWalkDirection).toHaveBeenLastCalledWith('pioneer', {+ direction: 'east', acknowledgeNoClips: true,+ });expect((await request(app).post('/api/sprites/pioneer/walk/reopen').send({ direction: 'up' })).status).toBe(400);});diff --git a/server/services/sprites/walk.js b/server/services/sprites/walk.jsindex 5d0dbcc9b8..a581109397 100644--- a/server/services/sprites/walk.js+++ b/server/services/sprites/walk.js@@ -729,11 +729,31 @@ export async function getWalkState(recordId) {const clipByDirection = Object.fromEntries(allRuns.filter((run) => resolvedRunIds.has(run.id)).map((run) => [run.direction, Boolean(run.sourceVideoPath) && !run.sourceClipMissing]));+ // Reopen has the same informed escape as the set-wide unlock, but its scope is+ // one approved direction. Stamp the resolver's result on that direction's run+ // so the card never recreates the import/clip rule from a second reading. When+ // the frozen set is gone, the selection retains the source-path provenance the+ // resolver needs for the still-approved directions.+ const reopenState = walkSet || selection;+ const reopenByDirection = Object.fromEntries(await Promise.all(+ Object.keys(approvedDirections).map(async (direction) => [+ direction,+ await resolveUnlockBlock(recordId, reopenState, clipByDirection, [direction]),+ ]),+ ));+ const stampedRuns = allRuns.map((run) => (+ run.direction in reopenByDirection ? { ...run, reopen: reopenByDirection[run.direction] } : run+ ));const stampedWalkSet = walkSet ? {...walkSet,imported: isImportedWalkSet(walkSet),importedDirections: importedWalkDirections(walkSet),- unlock: await resolveUnlockBlock(recordId, walkSet, clipByDirection),+ unlock: await resolveUnlockBlock(+ recordId,+ walkSet,+ clipByDirection,+ importedWalkDirections(walkSet),+ ),} : null;const walkTarget = resolveWalkTargetFor({record: await recordPromise,@@ -741,7 +761,7 @@ export async function getWalkState(recordId) {packagedCycles: packagedCyclesFrom(allRuns, approvedDirections),});return {- runs: allRuns, selection, walkSet: stampedWalkSet, walkTarget,+ runs: stampedRuns, selection, walkSet: stampedWalkSet, walkTarget,};}@@ -1589,10 +1609,13 @@ async function directionsWithoutClip(recordId, walkSet, scope) {* clients already read, so a second code would be an unread parallel channel for* a fact they have — while forking a string three call sites match on (#3043).*/-const notReDerivable = (detail, { regenerable = false } = {}) => new ServerError(+const notReDerivable = (detail, {+ regenerable = false,+ acknowledgement = 're-open the set and regenerate each direction from its locked anchor instead (one new render each)',+} = {}) => new ServerError([detail,- regenerable && 'Re-submit with acknowledgeNoClips to re-open the set and regenerate each direction from its locked anchor instead (one new render each).',+ regenerable && `Re-submit with acknowledgeNoClips to ${acknowledgement}.`,'Re-import this character to bring its walk clips across, or create a new character version to revise it.',].filter(Boolean).join(' '),{ status: 409, code: 'LEGACY_IMPORTED_WALK_SET' },@@ -1616,16 +1639,20 @@ const notReDerivable = (detail, { regenerable = false } = {}) => new ServerError* `unlock` drops EVERY approval and the frozen set with them — and a* source-packaged direction with no clip can be neither reprocessed (nothing to* re-derive from) nor re-approved (its frames were never imported, so- * RUN_FRAMES_MISSING), which would strand that direction permanently with no way- * back short of re-importing. So unlock requires that every still-imported- * direction be re-derivable, and names the ones that aren't — pointing at the- * per-direction reopen, which is safe precisely because it leaves the rest frozen.+ * RUN_FRAMES_MISSING), which means unlock must name the dropped directions before+ * it un-approves every run. A usable locked anchor permits the user to+ * acknowledge a fresh-render recovery; otherwise the refusal remains.*/async function assertSetReDerivable(recordId, walkSet, { acknowledgeNoClips = false } = {}) {// No `isImportedWalkSet` pre-check: the resolver encodes that same answer as// `blocked: false`, and enforcing "native sets are never gated" in two places// is how the two would eventually disagree.- const { blocked, stranded, acknowledgeable } = await resolveUnlockBlock(recordId, walkSet);+ const { blocked, stranded, acknowledgeable } = await resolveUnlockBlock(+ recordId,+ walkSet,+ null,+ importedWalkDirections(walkSet),+ );if (!blocked) return;// Acknowledged: the caller was shown what they lose (re-derivation) and what it// costs them instead (a fresh render per stranded direction), and said yes.@@ -1650,10 +1677,12 @@ async function assertSetReDerivable(recordId, walkSet, { acknowledgeNoClips = fa}/**- * Why unlock is (or is not) blocked for a walk set, and whether the block can be- * acknowledged past. One resolver for both the gate above and the read the- * clients render, so the button they offer and the 409 they might hit are- * computed from the same evidence rather than two copies of the rule.+ * Why a walk re-open action is (or is not) blocked for a scope, and whether that+ * block can be acknowledged past. Set-wide unlock passes every imported+ * direction; per-direction reopen passes one direction. One resolver for both+ * gates and the reads clients render, so the button they offer and the 409 they+ * might hit are computed from the same evidence rather than two copies of the+ * rule.** `blocked` is its own field rather than something a reader infers from* `stranded`: the evidence-free set-level-marker case IS blocked and strands an@@ -1699,10 +1728,22 @@ async function strandedDirections(recordId, walkSet, scope, clipByDirection) {: probed.has(direction)));}-async function resolveUnlockBlock(recordId, walkSet, clipByDirection = null) {+async function resolveUnlockBlock(+ recordId,+ walkSet,+ clipByDirection = null,+ scope = importedWalkDirections(walkSet),+) {const notBlocked = { blocked: false, stranded: [], acknowledgeable: false };- if (!isImportedWalkSet(walkSet)) return notBlocked;- const stale = importedWalkDirections(walkSet);+ const imported = importedWalkDirections(walkSet);+ // A source selection pointer with no source-packaged entry is the legacy+ // evidence-free import shape. It is set-level for unlock (all eight directions+ // must be renderable) and one-direction for reopen; once any explicit source+ // entry exists, a native direction in the same mixed set is not blocked by a+ // different direction's provenance.+ const stale = scope.filter((direction) => imported.includes(direction));+ const setLevelImport = isSourcePipelinePath(walkSet?.selectionPath);+ if (!stale.length && (!setLevelImport || imported.length)) return notBlocked;// `resolveWalkRenderability` is deliberately I/O-free, so it checks the// manifest's CLAIM that an anchor is locked but not that the file is still// there — and the render path's own `ANCHOR_MISSING` probe does. A manifest@@ -1719,10 +1760,12 @@ async function resolveUnlockBlock(recordId, walkSet, clipByDirection = null) {.map((r) => pathExists(resolveSpriteAssetPath(recordId, r.anchor.path))));return present.every(Boolean);};- // No per-direction evidence to examine, and unlock re-opens the whole set — so- // the whole set has to be regenerable before the escape is honest.+ // No per-direction evidence to examine: unlock re-opens the whole set, while a+ // reopen has already supplied its one-direction scope. Each action only promises+ // regeneration for exactly what it will re-open.if (!stale.length) {- return { blocked: true, stranded: [], acknowledgeable: await regenerable(SPRITE_DIRECTIONS) };+ const regenerationScope = scope.length ? scope : SPRITE_DIRECTIONS;+ return { blocked: true, stranded: [], acknowledgeable: await regenerable(regenerationScope) };}const stranded = await strandedDirections(recordId, walkSet, stale, clipByDirection);if (!stranded.length) return notBlocked;@@ -1730,24 +1773,30 @@ async function resolveUnlockBlock(recordId, walkSet, clipByDirection = null) {}/**- * Reopen's per-direction twin of the gate above.- *- * Keyed on the DIRECTION's own entry as well as the frozen set, because reopen- * un-freezes: after the first one `loadWalkSet` returns null, so a gate that- * consulted only the walk set would be dead for every reopen after it — and a- * clipless source-packaged direction could still be stranded, two clicks in,- * by following the advice the unlock refusal prints. The entry survives the- * un-freeze and carries the same provenance. The set-level marker stays in the- * OR so a copied `selectionPath` with entries that name no run at all is still- * refused, as it was before evidence entered the picture.+ * Reopen's one-direction use of the shared scope resolver. `walkState` is the+ * frozen set when present, otherwise the editable selection; that selection keeps+ * source-packaged entries after an earlier reopen, so later directions are still+ * protected and offered the same acknowledged regeneration escape.*/-async function assertDirectionReDerivable(recordId, walkSet, entry, direction) {- const imported = isSourcePipelinePath(entry?.runPath)- || isSourcePipelinePath(entry?.runManifest)- || isImportedWalkSet(walkSet);- if (!imported) return;- if (await directionClipRel(recordId, entry)) return;- throw notReDerivable(`The ${direction} direction is still packaged by the source pipeline and has no source clip on disk — reopening is not supported, because there would be nothing to re-derive from and its packaged frames were never imported.`);+async function assertDirectionReDerivable(recordId, walkState, direction, { acknowledgeNoClips = false } = {}) {+ const { blocked, acknowledgeable } = await resolveUnlockBlock(+ recordId,+ walkState,+ null,+ [direction],+ );+ if (!blocked) return;+ if (acknowledgeNoClips && acknowledgeable) {+ console.log(`🔓 sprite walk reopen acknowledged without a re-derivable clip for ${recordId}/${direction}`);+ return;+ }+ throw notReDerivable(+ `The ${direction} direction is still packaged by the source pipeline and has no source clip on disk — reopening would leave nothing to re-derive from and its packaged frames were never imported.`,+ {+ regenerable: acknowledgeable,+ acknowledgement: `re-open ${direction} and regenerate it from its locked anchor instead (one new render)`,+ },+ );}// Un-finalize: drop the canonical "finalized" signal (the walk-set file) FIRST,@@ -1796,11 +1845,12 @@ async function unlockWalkSetImpl(recordId, { acknowledgeNoClips = false } = {})* every OTHER direction's selection entry intact, so re-freezing is a single* re-approval of the one direction rather than all eight. The rendered clip is* preserved on disk, so the reopened direction can be reprocessed at a new- * speed/frame-count with no regeneration. An imported direction is refused only- * when its clip is genuinely absent (mirrors unlock — see `assertReDerivable`).+ * speed/frame-count with no regeneration. A clipless source-packaged direction+ * requires an acknowledgement only when the shared resolver proves a locked+ * anchor can provide its fresh-render recovery.*/-export function reopenWalkDirection(recordId, { direction }) {- return walkWriteTail(recordId, () => reopenWalkDirectionImpl(recordId, direction));+export function reopenWalkDirection(recordId, { direction, acknowledgeNoClips = false }) {+ return walkWriteTail(recordId, () => reopenWalkDirectionImpl(recordId, direction, { acknowledgeNoClips }));}/**@@ -1894,13 +1944,13 @@ async function invalidateWalkDirectionForAnchorRevisionImpl(recordId, direction)return true;}-async function reopenWalkDirectionImpl(recordId, direction) {+async function reopenWalkDirectionImpl(recordId, direction, { acknowledgeNoClips = false } = {}) {await requireCharacter(recordId);const [walkSet, loaded] = await Promise.all([loadWalkSet(recordId), loadSelection(recordId)]);const selection = loaded || seedSelection(recordId);- // The selection entry is the gate's evidence, so it is read BEFORE the- // re-derivability check (which needs it) and before the approval check.- await assertDirectionReDerivable(recordId, walkSet, selection.directions?.[direction], direction);+ // The frozen set is canonical until the first reopen; afterwards its editable+ // selection retains the source-path entry the scope resolver reads.+ await assertDirectionReDerivable(recordId, walkSet || selection, direction, { acknowledgeNoClips });if (selection.directions?.[direction]?.status !== 'approved') {throw new ServerError(`Direction ${direction} is not approved`, { status: 409, code: 'DIRECTION_NOT_APPROVED' });}diff --git a/server/services/sprites/walk.test.js b/server/services/sprites/walk.test.jsindex 40750cf553..b5d1821e55 100644--- a/server/services/sprites/walk.test.js+++ b/server/services/sprites/walk.test.js@@ -1216,8 +1216,12 @@ describe('imported walk sets — evidence-based re-derive', () => {// hit cannot be computed from two different readings of the set.it('stamps the unlock block on the walk state', async () => {const clipless = await characterWithLockedAnchors(newId(), ['east']);- await importedCharacter(clipless, { east: { clip: false } });- expect((await getWalkState(clipless)).walkSet.unlock).toEqual({+ const cliplessRunIds = await importedCharacter(clipless, { east: { clip: false } });+ const cliplessState = await getWalkState(clipless);+ expect(cliplessState.walkSet.unlock).toEqual({+ blocked: true, stranded: ['east'], acknowledgeable: true,+ });+ expect(cliplessState.runs.find((run) => run.id === cliplessRunIds.east).reopen).toEqual({blocked: true, stranded: ['east'], acknowledgeable: true,});@@ -1243,24 +1247,46 @@ describe('imported walk sets — evidence-based re-derive', () => {expect((await getWalkState(id)).walkSet).not.toBeNull();});- it('reopens the imported direction that has a clip and refuses the one that does not', async () => {- const id = await characterWithLockedAnchors(newId(), ['east']);- await importedCharacter(id, { east: {}, north: { clip: false } });+ it('reopens a clipless imported direction only after acknowledging regeneration', async () => {+ const id = await characterWithLockedAnchors(newId(), ['east', 'north']);+ const runIds = await importedCharacter(id, { east: {}, north: { clip: false } });await expect(reopenWalkDirection(id, { direction: 'north' }))- .rejects.toMatchObject({ code: 'LEGACY_IMPORTED_WALK_SET' });+ .rejects.toMatchObject({+ code: 'LEGACY_IMPORTED_WALK_SET',+ message: expect.stringContaining('acknowledgeNoClips'),+ });+ // Reopen is a narrower scope than unlock: reopening east leaves north+ // frozen, then state supplies north's same per-direction recovery block.const state = await reopenWalkDirection(id, { direction: 'east' });expect(state.walkSet).toBeNull();expect(state.selection.directions.east).toBeUndefined();expect(state.selection.directions.north.status).toBe('approved');- // …and STILL refuses north now that the set is un-frozen. Reopen un-freezes,- // so a gate keyed only on the frozen walk set would be dead from here on and- // north could be stranded by simply clicking twice — which is what the unlock- // refusal's own "reopen them one at a time" advice would have walked into.- await expect(reopenWalkDirection(id, { direction: 'north' }))- .rejects.toMatchObject({ code: 'LEGACY_IMPORTED_WALK_SET' });+ // The source-packaged entry for north survives the first reopen in the+ // editable selection, so its per-direction block is still stamped from the+ // same resolver after the frozen set has gone away.+ const afterReopen = await getWalkState(id);+ expect(afterReopen.runs.find((run) => run.id === runIds.north).reopen)+ .toEqual({ blocked: true, stranded: ['north'], acknowledgeable: true });++ const acknowledged = await reopenWalkDirection(id, {+ direction: 'north', acknowledgeNoClips: true,+ });+ expect(acknowledged.selection.directions.north).toBeUndefined();+ });++ it('refuses an acknowledged reopen when its stranded direction cannot render', async () => {+ const id = await characterWithLockedAnchors(newId(), ['east']);+ await importedCharacter(id, { east: {}, north: { clip: false } });++ await expect(reopenWalkDirection(id, {+ direction: 'north', acknowledgeNoClips: true,+ })).rejects.toMatchObject({+ status: 409,+ code: 'LEGACY_IMPORTED_WALK_SET',+ });expect((await getWalkState(id)).selection.directions.north.status).toBe('approved');});