sflow-recover

Diagnose publication, artifact, projection, generation, branch, and transport blockers and explicitly apply only hash-bound safe recovery.

SKILL.md

GitHub

Safe recovery

<!-- sflow-copilot-pause -->

Reuse a verified pause-aware entry supplied in this invocation before any mutation or selection change; otherwise first run singularity-flow session current --for-agent --json once; pause precedes Git. If paused: native Copilot, only /sf-pause off, never resume implicitly. Reuse binding/personalization.replyName; fresh operation checks/consent remain required.

<!-- sflow-output-contract: deterministic-mutation -->

Output contract: CLI validates/mutates; preserve exact results, warnings, publication status, artifacts/actions. Summarize artifacts with verified Markdown-preview links; never paste document bodies, code or diffs into Copilot. For code, list touched paths and observed added/deleted/created line counts; unavailable stays unavailable. Use existing evidence, not extra calls solely for display. Summaries, links and opened previews are not human review or approval. For every next action, honor returned commandGuidance in order: Copilot, Shell, VS Code (model-free) using modelFreeCommand; if absent, say "not available for this action". Missing Copilot: "no verified equivalent". Never invent routes. On a refusal read remediationPlan: run its first read-only step once and follow context.strategy; never retry an unchanged condition or edit an earlier phase to clear it. One returned automatic plan-hash action (such as sync) may run once, then re-enter once. Run a check only when a returned field or command asks for it; never decide from a step's name, kind or route that it applies. A refusal saying a check does not apply to this step is not a blocker: skip it and continue. Act on a result's act first: its state, do routes and any ask. A bounded result names agentOutput.read ranges and omittedFields text files; read all in one response with your file tool. If your host saved a result to a file you cannot open, run that command again with --for-agent --json; never read the host's copy with shell tools.

<!-- sflow-execution-boundary -->

Boundary: reuse entry ready/workId, cwd=repositoryPath; CLI/workItemRoot paths only; never $HOME. No duplicate lookup. Use exact CLI-returned paths. repositoryPath is command cwd, not a prefix for absolute file paths. Never rebase paths or strip .git/worktrees. Issued private/external files are exact exceptions to repository confinement, not wider read/write permission; writes still need authorization. Resolve relative paths only against their declared base. On failure, preserve the path and error; never search or recreate it.

  1. singularity-flow recover $ARGUMENTS --fetch --for-agent --json: keep planId; inspection never --apply.
  2. Follow action classifications, not blanket dirty-tree stops. requiresRecovery: false/no blockers: no gate. current-phase-review-required/confirmation: none: review diff, preserve validated preparation context and exactly declared phase evidence; continue draft checks. Preserve untracked .sflow/results/**; tracked/staged reports and source require review. Divergence: /sf-refresh-branch, then a human-reviewed merge; authority, repair-publication-authority:<phase>/repair-generation-change-set:<phase>: diagnose via /sf-doctor//sf-admin before rollover; never waive. Then the person reruns /sf-recover.
  3. Preserve bytes/pins/generations. argvWithheld: true needs no adoption; follow testExecution.handoff. Runner repair: the returned authoringSkill. Missing policy: singularity-flow story test-policy amend <WORK-ID> --reason "<reason>" --json: approved-pin adoption, not config repair. Live human review: Amend test command or Enter cancels; never answer. Approval refusal ends turn; /sf-reject later for changed bytes. Telemetry/session advisory.
  4. Human amendment acknowledgement. Author/reviewer conflict: successor, not history edits. Differing hash domains: not stale. Automatic: human-confirm planId, use applyCommand; guided/manual never --apply. Reinspect stale plans.
  5. Review diffs/untracked bytes. commit-reviewed-worktree: human consent to exact paths/planId; returned command only, no unlisted files/--allow-dirty. Preserve reports/index; no gate waiver. Revalidate source/consent. Protected/unrelated/conflicted/removed/symlink paths stay separate. review-evidence-contract: preserve screenshot; returned /sf-appeal for plan-authority correction—not visual proof.
  6. begin-new-generation:<phase> needs matching branch/phase, authenticated changed publication, no lifecycle/transport blocker. Preview singularity-flow phase rollover <phase> --json; match identity/confirmation to recovery. Human-confirm then run returned command once. After rollover succeeds, relay the step's nextsteps authoring skill; never author here.
  7. Read argv/cwd/exit/stderr. Proven authorized dependency repair permits retry without republishing unchanged source. Stop on unchanged conditions or three distinct repairs: automation only, not manual correction. Integrity cannot be waived; no submit/approve, reset/rebase, force-push or stash/discard.

TRP: singularity-flow explain test-recovery; live review for exceptions. Never answer approval cards or label failed/skipped/unavailable passed.

Follow resolution.issues[].choices/repairLoop.protocol. Owned repair saves copies. /sf-appeal: preservation/eligible risks, live decisions; not approval/passes. Backup failure preserves originals; no cleaning.