Skip to content

fix(roadmap): remove the orphan draft of a failed stage marks write - #4142

Open
dan-petty wants to merge 4 commits into
mainfrom
fix/4051-stage-orphan-draft
Open

dan-petty wants to merge 4 commits into
mainfrom
fix/4051-stage-orphan-draft

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The stage job pushed a branch and opened a draft before it wrote the marks. If the marks write failed, a draft stayed with no stage.pr mark. The job now writes a stage.pending mark (branch and time) before the push. An open item with that mark, a pushed branch, a draft and no stage.pr, older than 1 hour, is an orphan: the job closes the draft, deletes the branch and clears the mark. A pushed branch without the mark is never touched.

Closes #4051

Change: openspec/changes/archive/2026-11-08-4051-remove-the-orphan-draft-that-a/

@dan-petty dan-petty added type/bug Defect, regression, or incorrect runtime behavior scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 8, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Point to review (the owner has not confirmed this approach): the job removes an orphan draft by an intent mark, stage.pending (branch name and time), that a Service-only write sets BEFORE the push. An orphan is an open item with that mark, a pushed branch, a draft and no stage.pr, and a mark at least 1 hour old. A pushed branch without the mark is never touched, and a young mark is left alone. This replaces the plain branch-pattern rule, which could delete the branch of a person or of another agent. Cost: one more set_marks write per staged item (1 read and 1 PATCH), and one open_pulls read per round, only when an orphan exists.

Known gap: a CLOSED item with a stage.pending mark and no stage.pr is not judged. The issue names open items, and _reconcile already covers closed items that hold the branch mark.

Rollout: no setting is added, renamed, removed or tightened. The 1-hour age is a constant (CONST_ROADMAP_STAGE_ORPHAN_AGE_SECONDS). The example ConfigMap key-walk test (#4093) passes (tests/k8s/test_k8s_configmap_keys.py). Nothing was applied to the cluster.

Test record:

  • Fail-to-pass run on origin/main (devops ci fail-to-pass --base origin/main): 17 failed, 1 passed (a guard test). Output: .data/agent/state/4051-fail-to-pass.txt in the author worktree.
  • Full devops ci under the lock: all rows passed except one test of mine (limit class of the new constant), fixed in ccc8cd2. After the fix: 21221 other tests passed, coverage 92.98 percent. The pytest row took 12m15s (known issue fix(ci): the pytest step of devops ci exceeds the 5-minute budget #3593).
  • After the rebase onto origin/main (682d206): docs generate --check clean; tests/roadmap/test_roadmap_limit_classes.py, tests/roadmap/stage and tests/k8s/test_k8s_configmap_keys.py gave 1681 passed, 1 skipped.

@dan-petty
dan-petty marked this pull request as ready for review November 8, 2026 06:03

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Defect, regression, or incorrect runtime behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): remove the orphan draft that a failed marks write left

1 participant