Conversation
|
| try { | ||
| raw = execFileSync( | ||
| "gh", | ||
| ["pr", "view", String(pr), "--json", "state", "--jq", ".state"], |
There was a problem hiding this comment.
Wrong repository for PR lookup
If the stacker's checkout has a fork remote or multiple remotes, this gh pr view call has no explicit base repository, so it can look up the PR number in a different repository from the one Graphite used. PR numbers are repository-local: the lookup may read another PR's state or fail, leaving the lowest-unmerged frontier incorrect or unchanged. The PR workflow requires passing the canonical base repository to gh pr commands.
Knowledge Base Used: Poteto-mode automation
| ); | ||
| } | ||
| return parseGtPullRequest({ branch, detail: rows[0] ?? "" }); | ||
| const cached = parseGtPullRequest({ branch, detail: rows[0] ?? "" }); |
There was a problem hiding this comment.
Cached status still gates lookup
This parses and validates Graphite's cached status even though the result uses only its PR number. If Graphite introduces a new status, parsing throws before GitHub can provide the live state, so frontier recomputation stops unnecessarily. Parsing the PR identity independently would avoid tying the new lookup to Graphite's status vocabulary.
| raw = execFileSync( | ||
| "gh", | ||
| ["pr", "view", String(pr), "--json", "state", "--jq", ".state"], | ||
| { | ||
| cwd: repo, | ||
| encoding: "utf8", | ||
| env: process.env, | ||
| stdio: ["ignore", "pipe", "pipe"], | ||
| } |
There was a problem hiding this comment.
Unbounded serial GitHub lookups
Frontier recomputation now runs this synchronous remote call once for every branch, with no timeout. On a large stack, slow calls add up, and a hung call can block recomputation indefinitely while the previous frontier remains in place. A time bound and fewer serial requests would limit that cost.
Knowledge Base Used: Poteto-mode automation
|
Opened in error by an automated agent session without the account owner's approval. Withdrawn — sorry for the noise. |
Closes #86
What changed
Graphite can report cached OPEN state while its background PR refresh is still running, leaving a just-merged PR as the lowest unmerged frontier entry. Keep Graphite for stack order and PR identity, then read current lifecycle state from GitHub using the canonical repository in Graphite's adjacent PR URL. Fork remotes and
GH_HOSTcannot redirect the lookup. Cached status vocabulary no longer controls live-state resolution.Missing or mismatched metadata, failed GitHub requests and invalid states preserve the existing frontier. Commit-body PR links are ignored. Branching graphs remain rejected; the playbook explains how to select the intended linear stack.
Verification
The initial runtime change passed the full 158-test suite, configured and additional strict orch typechecks, static invariants, manifest parsing and Claude plugin validation. After the scoped identity corrections, all 17 orch tests and 88 assertions passed with strict orch typecheck and diff checks. Regression coverage includes stale cache, canonical base repository despite a fork remote, unknown cached status, unrelated commit-body links, and preservation of the prior frontier on identity or GitHub failures.
Live evidence: installed Open Pstack 1.4.0 on Codex desktop exhibited the cache race. The final candidate source CLI, run from the submitted linear-stack worktree, resolved the merged PR as MERGED with no lowest unmerged entry. A branching trunk remained rejected. The exact candidate has not been installed and qualified from both Claude and Codex plugin surfaces, so this PR remains a draft. No merge, tag, release or installed-plugin rollout is requested.