Repository navigation
ci(stack-breadcrumb): bring forward the evolved topology-aware breadcrumb - #56
Merged
Merged
Conversation
theCodeDrift
marked this pull request as ready for review
July 10, 2026 01:46
…rumb We sent an early stack-breadcrumb workflow to the taskless/taskless team; they evolved it with a series of fixes. This brings that version (the zero-dependency script + its tests + the workflow) back into this repo, reformatted to our Prettier style and MIT-licensed with permission. Notable improvements over our current version: - Topology-aware markers: the stack marker now encodes each member's parent (`pr=82,83:82,84:83`) instead of a flat list, so the tree shape is durable. - Additive tree: a PR stays in the breadcrumb after it merges, rendered `✅ merged` (vs `⛔ closed`), instead of vanishing. - Recorded-parent resolution: when a parent merges, GitHub deletes its branch and retargets the child onto the default branch, severing the live base/head edge. The recorded parent survives that, so the merged ancestor stays in the tree rather than disappearing. - Defensive cycle guard in the region renderer; legacy flat markers self-migrate to the recorded form on the next reconcile. The logic is repo-agnostic (no taskless/taskless-specific wiring). All 54 unit tests pass via `node --test`; CI already runs `.github/scripts/*.test.cjs`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
theCodeDrift
force-pushed
the
jakob/stack-breadcrumb-forward
branch
from
July 10, 2026 01:46
c65ef2e to
ade2265
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the stack-breadcrumb GitHub Actions workflow and its zero-dependency implementation to preserve durable stack topology across merges/retargets, and to keep merged/closed ancestors visible in the rendered breadcrumb.
Changes:
- Encode stack topology in the marker as
member:parentpairs and consolidate recorded parent links across PR bodies for retarget resilience. - Render merged vs. closed members distinctly (
✅ mergedvs⛔ closed) and keep merged ancestors in the breadcrumb (additive tree). - Expand/adjust the unit test suite to cover topology encoding, retarget scenarios, cycle-guard rendering, and merged/closed annotations.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/stack-breadcrumb.yml | Fetches historical (non-open) stack members and supplies merged-vs-closed info for additive breadcrumb rendering. |
| .github/scripts/stack-breadcrumb.cjs | Implements recorded-parent topology parsing/union, additive tree construction, merged/closed rendering, and recursion safety guard. |
| .github/scripts/stack-breadcrumb.test.cjs | Adds/updates tests for topology parsing, recorded-parent consolidation, merged/closed annotation, and retarget preservation behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Pull the newer stack-breadcrumb improvements the team landed on
taskless/taskless main since the initial port, reformatted to our
Prettier style with the MIT/provenance headers preserved.
New over the previous version:
- Breadcrumb titles: entries render bare `#N` so GitHub autolinks the
title + state, instead of a plain number.
- Carry-forward job: on a stack member's merge, embed its body into its
parent PR (keyed), so an incrementally-landed stack keeps its history.
The job runs with contents:read (top-level `permissions: {}` grants no
default) and skips merges into the default branch.
- Topology hardening against crafted markers and cycles.
Repo-agnostic (owner/repo/default-branch all resolved dynamically). All
59 unit tests pass via `node --test`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…he code The tree-derivation block comment and buildTree docstring said the RECORDED parent wins, but the implementation (and the inline comment at the resolver) makes the LIVE edge authoritative — the recorded parent is a contained fallback used only for a severed edge that names a known merged/closed ancestor. That containment is a security property (PR bodies are user-editable, so a crafted marker must not re-parent an unrelated PR), so the stale "recorded must win" framing was not just imprecise — following it could reintroduce the crafted-marker hole the hardening pass closed. Also drop the "rendered ✅ merged" aside: entries render bare #N and GitHub supplies the status icon. Comment-only; no behavior change. Flagged by Copilot review on #56; applies cleanly back onto taskless/taskless (prose-only, quote-agnostic). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We sent an early version of the stack-breadcrumb workflow to the taskless/taskless team; they evolved it with a series of fixes. This brings that improved version back into our repo — the zero-dependency script, its test suite, and the workflow — reformatted to our Prettier style and MIT-licensed (with permission; the repo is already MIT, headers added for provenance).
What improved over our current version
pr=82,83:82,84:83) rather than a flat list (pr=82,83,84), so the tree shape is durable and not re-inferred from scratch each run.✅ merged(vs⛔ closed), instead of vanishing from the stack.base/headedge. The recorded parent survives that, sobuildTreeclimbs back to the true root and keeps the merged ancestor in the tree. Because the marker is written while edges are still live, topology is captured before any retarget can sever it.childrenOf; legacy flat markers self-migrate to the recorded form on their next reconcile.Provenance & licensing
The logic is repo-agnostic — no taskless/taskless-specific wiring (repo/owner refs are all dynamic via
github.repository/context.repo). Files carry anSPDX-License-Identifier: MITheader plus a note that they were adapted from the taskless/taskless implementation.Validation
node --test .github/scripts/*.test.cjs→ 54 pass, 0 fail (CI already runs this).node --checkclean on both scripts; workflow reformatted with our Prettier config.