Skip to content

fix: replace orphaned liveness status and diagnose amended refs - #559

Merged
kevinswiber merged 1 commit into
mainfrom
fix/issue-540-liveness-status-axes
Jul 17, 2026
Merged

fix: replace orphaned liveness status and diagnose amended refs#559
kevinswiber merged 1 commit into
mainfrom
fix/issue-540-liveness-status-axes

Conversation

@kevinswiber

Copy link
Copy Markdown
Member

Summary

  • split the derived commit condition into merged / live / unreachable / missing — object availability and live-ref reachability stay distinguishable, and nothing user-facing calls a commit or revision orphaned any more (the token survives only in the unrelated note-anchor ResolutionStatus)
  • fix the narrow integration mode misreading side-branch-carried work: a commit some live branch still carries reads live (labeled by a containing tip best-effort), so the aggregate reads open — reachability is a broad axis, only the landing answer narrows
  • aggregate merge status becomes merged | open | unreachable | unknown; present-but-unreachable and gc'd objects collapse to unreachable deliberately, keeping object retention out of the aggregate, with the per-commit matrix carrying the distinction
  • qualify unreachable commits with best-effort reflog retention (reflog | none, omitted when the probe cannot answer) — one lazy rev-list --reflog per read
  • diagnose recorded-ref continuity: current / advanced / rewritten / moved / deleted / unknown. A rewrite is claimed only on reflog evidence (commit (amend) / rebase actions), naming the recorded and current OIDs and same-tree equivalence, and adds a ref_rewritten diagnostic with the suggested explicit follow-up; expired/absent reflogs degrade to moved, a reset is a move, and reflog evidence never mutates the durable record
  • agree across surfaces: revision show JSON, /api/revisions/{id}, and the inspector detail page carry the same liveness + continuity block; revision list, the association text digest, and inspector cards share the landing vocabulary
  • rename revision list --orphans and store remove --orphans to --unreachable (deprecated aliases kept), OrphanVisibilityUnreachableVisibility, and tighten --ref --by liveness to commits the named ref's tip reaches
  • amend ADR-0014 (new 2026-07-16 amendment) and update ADR-0015/0016/0033 and the CLI reference; headless fixtures cover changed-tree amend, same-tree amend, multi-amend chains, a linked-worktree amend, reflog expiry, gc'd objects, deleted refs, and reset

Closes #540.

Validation

  • just check — 2,571 tests passed, 1 skipped (fmt + clippy + full suite)
  • npm run check && npm run build — 936 inspector tests passed; checked-in app.js rebuilt from the TS sources
  • red-first fixtures: all 15 new integration tests failed on main's behavior before the change and pass after

Checklist

  • Public docs are updated if command behavior, JSON output, setup, or release flow changed.
  • Commits are conventional and unscoped unless cog.toml explicitly allows the scope.
  • The diff does not include unrelated local files.

The derived commit condition folded two distinct axes — object
availability and live-ref reachability — into one misleading "orphaned"
token, and the narrow integration mode misread side-branch-carried work
as orphaned. Split the condition into merged/live/unreachable/missing:
unreachable means the object survives but no live ref reaches it,
missing means the object is gone, and a commit some live branch still
carries stays live under a narrow integration ref (only the landing
answer narrows). The aggregate merge status reads
merged|open|unreachable|unknown, with best-effort reflog retention
(reflog|none) qualifying unreachable commits.

Recorded ref associations gain a read-time continuity diagnosis:
current, advanced, rewritten (best-effort reflog evidence naming the
amend/rebase action, the recorded and current OIDs, and same-tree
equivalence), moved (expired or absent reflog degrades gracefully, and
a reset is a move, not a rewrite), deleted, or unknown. A rewritten ref
surfaces a ref_rewritten diagnostic suggesting the explicit follow-up;
reflog evidence is read-only and never mutates the durable record.

revision show, /api/revisions/{id}, and the inspector detail page carry
the same liveness block; the revision list, association digest, and
inspector cards share the landing vocabulary. revision list
--unreachable and store remove --unreachable replace --orphans (kept as
deprecated aliases); OrphanVisibility is renamed UnreachableVisibility;
the --ref --by liveness filter tightens to commits the named ref's tip
reaches. ADR-0014 is amended and older orphan wording in ADR-0015/0016/
0033 and the CLI reference is updated.
@kevinswiber
kevinswiber force-pushed the fix/issue-540-liveness-status-axes branch from 968a343 to 3922bb9 Compare July 17, 2026 04:18
@kevinswiber
kevinswiber merged commit 3922bb9 into main Jul 17, 2026
15 checks passed
@kevinswiber
kevinswiber deleted the fix/issue-540-liveness-status-axes branch July 17, 2026 04:25
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.

revision liveness: replace orphaned status and diagnose amended refs

1 participant