Skip to content

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

address review (claude): restore the wedged-packaging recovery the retry gate broke

[._.]/ Adam Eivy5e00c1dbc176
diff --git a/client/src/components/sprites/WalkWorkflow.jsx b/client/src/components/sprites/WalkWorkflow.jsx
index b55c7cb550..c092f4e6e2 100644
--- a/client/src/components/sprites/WalkWorkflow.jsx
+++ b/client/src/components/sprites/WalkWorkflow.jsx
@@ -341,10 +341,16 @@ function DirectionCard({
{run.status === 'error' && (
<p className="text-[10px] text-port-error break-words">{run.postprocessError || 'postprocess failed'}</p>
)}
- {/* Gated on the same in-flight target write as the other render
- actions — it repacks against the set target, so firing it before
- a target PATCH lands would use the value the server still holds. */}
- <button onClick={() => onRetry(run)} disabled={busy} className="px-2 py-0.5 text-[10px] bg-port-card border border-port-border rounded text-gray-300 hover:border-port-accent disabled:opacity-50">
+ {/* Gated on the in-flight target write (it repacks against the set
+ target, so firing it before a target PATCH lands would use the
+ value the server still holds) — but deliberately NOT on `busy`:
+ that includes status==='postprocessing', which is precisely the
+ wedged state this button exists to recover (attachTuiWalkResult
+ persists 'postprocessing' before packaging, and nothing normalizes
+ it if the server dies mid-package). Disabling on `busy` would make
+ the "Re-run postprocess" branch permanently unclickable and leave
+ that direction with no enabled action at all. */}
+ <button onClick={() => onRetry(run)} disabled={pending || targetSaving} className="px-2 py-0.5 text-[10px] bg-port-card border border-port-border rounded text-gray-300 hover:border-port-accent disabled:opacity-50">
{run.status === 'postprocessing' ? 'Re-run postprocess' : 'Retry postprocess'}
</button>
</div>
@@ -406,8 +412,12 @@ function DirectionCard({
reprocessed / re-approved — for when one walk is too fast or wrong and
the rest are fine. Un-freezes a finalized set but keeps the other seven
approvals; the rendered clip is preserved, so re-approval is one click.
- Inline confirm (not a hidden two-click arm) per the repo's UX. */}
- {approved && (
+ Inline confirm (not a hidden two-click arm) per the repo's UX.
+ Hidden for a source-pipeline import, whose set has no regenerable clips
+ behind it — the server refuses reopen there (LEGACY_IMPORTED_WALK_SET)
+ exactly as it refuses unlock, so offering the button would guarantee a
+ 409 on click. Mirrors how the header hides Unlock for imports. */}
+ {approved && !imported && (
reopening ? (
<ConfirmButtonPair
prompt={finalized ? 'Reopen (un-freezes set)?' : 'Reopen this direction?'}
diff --git a/client/src/components/sprites/WalkWorkflow.test.jsx b/client/src/components/sprites/WalkWorkflow.test.jsx
index 29fa651b77..5972228196 100644
--- a/client/src/components/sprites/WalkWorkflow.test.jsx
+++ b/client/src/components/sprites/WalkWorkflow.test.jsx
@@ -278,6 +278,18 @@ describe('WalkWorkflow observable render', () => {
});
expect(screen.queryByRole('link', { name: /Watch in Shell/ })).toBeNull();
});
+
+ it('keeps "Re-run postprocess" clickable on a run wedged at packaging', () => {
+ // attachTuiWalkResult persists 'postprocessing' before packaging and nothing
+ // normalizes it, so a server death mid-package strands the run there — this
+ // button is the documented way out. Gating it on the generic `busy` (which
+ // includes status==='postprocessing') would make it permanently dead and
+ // leave the direction with no enabled action at all.
+ renderRun({
+ id: 'walk-east-abc12345', direction: 'east', status: 'postprocessing',
+ });
+ expect(screen.getByRole('button', { name: /Re-run postprocess/ })).not.toBeDisabled();
+ });
});
describe('WalkWorkflow authoring controls', () => {
diff --git a/server/services/sprites/walk.js b/server/services/sprites/walk.js
index a8caa5678e..1f602b4d55 100644
--- a/server/services/sprites/walk.js
+++ b/server/services/sprites/walk.js
@@ -361,20 +361,24 @@ async function loadRunForEntry(recordId, direction, entry) {
* runs only carry them inside `stripPreview`, so read through both or every
* imported set would resolve as "no packaged geometry" and drift silently.
*
- * A run the server flagged `stripMissing` is excluded: its packed strip is gone
- * from disk, so it can never compile, and letting it win the first-packaged slot
- * would derive the whole set's target from artwork that no longer exists —
- * badging every healthy direction as drifted against a dead one. It keeps its
- * `stripPreview` (only `stripPath` is dropped), so the filter has to name it.
+ * A run the server flagged `stripMissing` contributes nothing: its packed strip
+ * is gone from disk, so it can never compile, and letting it win the
+ * first-packaged slot would derive the whole set's target from artwork that no
+ * longer exists — badging every healthy direction as drifted against a dead one.
+ * It is dropped AFTER the per-direction pick, not filtered out before it, so a
+ * direction whose approved run lost its strip reports no geometry rather than
+ * silently falling back to a superseded older candidate that will never be
+ * frozen. (A stripMissing run keeps its `stripPreview`; only `stripPath` is
+ * dropped, so the check has to name the flag.)
*/
function packagedCyclesFrom(runs, approvedDirections) {
return SPRITE_DIRECTIONS.flatMap((direction) => {
- const forDirection = runs.filter((r) => r.direction === direction && r.stripPreview && !r.stripMissing);
+ const forDirection = runs.filter((r) => r.direction === direction && r.stripPreview);
const approvedRunId = approvedDirections?.[direction]?.runId;
const run = forDirection.find((r) => r.id === approvedRunId)
|| forDirection.find((r) => r.status === 'approved')
|| forDirection.find((r) => r.status === 'candidate');
- if (!run) return [];
+ if (!run || run.stripMissing) return [];
return [{
direction,
frameCount: run.frameCount ?? run.stripPreview?.frameCount,