Skip to content

feat(core): finalize orphaned multi-process evidence runs - #134

Merged
ElbertePlinio merged 3 commits into
mainfrom
feat/110-finalize-orphaned-runs
Sep 9, 2026
Merged

ElbertePlinio merged 3 commits into
mainfrom
feat/110-finalize-orphaned-runs

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Short-lived CLI, MCP, and DevTools processes against one browser session were leaving evidence runs running without report.html, even though actions.jsonl was intact. After producers stop, pickforge-lab artifacts report --finalize-orphans and MCP artifact_report with finalizeOrphans: true recover those runs in the configured write root.

Dead owners are detected from the session pointer. Interrupted runs are marked orphaned rather than completed. Reports and artifact inventories are rebuilt from existing files and the journal. Each recovered session gets one session-<sessionId>.html index. Journals, run directories, and pointers are never rewritten, moved, or deleted. Torn tails stay on disk and are omitted from the report. A corrupt journal keeps its valid prefix and is labeled journal: "corrupt" with actions: N and a warning; a missing journal is labeled unavailable. Completed and failed runs with a report stay read-only inputs for the session index and are not stamped evidenceRecovery. Live owners, ambiguous pointers, invalid manifests, and disappeared run directories are skipped with a reason. Stale adopters cannot append to a recovered orphan. Layout claims and writes stay on verified descriptors from #91/#104/#109; recovery never creates a missing root.

Known limits: pointers and locks do not record a hostname, so pid probes on shared storage are meaningless (pre-existing). Orphaned runs are never pruned by retention. Session index links can dangle after retention.

Closes #110

Validation on 222e824 in /home/dev/Projects/.worktrees/picklab/feat-110-orphaned-runs: bun install --frozen-lockfile, bun run typecheck, bun run lint, bun run test (116 files, 1548 passed, 4 skipped), bun run build, complexity-gate check --changed (no violations).

Recover interrupted evidence when the owner process is dead, rebuild
reports from the append-only journal, and add one session index for
short-lived CLI and MCP processes. Journals stay in place and are
never rewritten. Expose recovery on artifacts report and MCP
artifact_report.
Unreadable /proc start times no longer reclaim a live owner. Corrupt
journals keep their valid prefix. Completed runs stay read-only index
inputs. Unknown action status is tolerated on reads. Artifact names may
contain spaces. Invalid and disappeared runs are skipped with a reason.
@ElbertePlinio
ElbertePlinio force-pushed the feat/110-finalize-orphaned-runs branch from 174292d to e9d8f12 Compare September 9, 2026 13:44
@ElbertePlinio
ElbertePlinio merged commit 30679ff into main Sep 9, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the feat/110-finalize-orphaned-runs branch September 9, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Finalize orphaned multi-process evidence runs and reports

1 participant