Support change-set renumbering and ID collision resolution in ears-manager for concurrent PR branches
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with ears-manager/internal/cli/branch.go and highestChangeSetNumber, then inspect change-set commands and tests in ears-manager/internal/cli/changeset_test.go. Reproduce the concurrent branch collision described in the issue and trace how manifests, .protobot/project.yaml, references, and store digests are maintained. Done when renumbering updates those records and change-set update --base-commit reports collisions with recovery guidance; the specified test should pass ears-manager check.
Written by the indexing model from the issue text.
Description
What happened
On PR #245 (https://github.com/redhat-et/ProtoBot/pull/245), the fix agent authored proposed change set CS-00002 (.protobot/change-sets/cs-00002.yaml) via ears-manager change-set create to govern updates to docs/architecture.md per AGENTS.md Rule 5.
Concurrently, PR #221 (evaluation corpus specification updates) was developed from main when main only contained CS-00001. Because both branches were isolated, PR #221 also created CS-00002 (.protobot/change-sets/cs-00002.yaml). PR #221 merged into main first (commit f13e178).
When maintainer @jerry-ng2 merged main into PR #245 (commit 22aba0f), both branches claimed CS-00002 for distinct change sets, creating a direct ID collision. ears-manager provides no command or migration procedure to renumber an existing change set or resolve duplicate sequence numbers. Because AGENTS.md Rule 5 strictly forbids editing change-set manifests or .protobot/project.yaml by hand, and ears-manager check validates store integrity and digests, the maintainer had to perform manual file surgery across multiple commits (37b3290, 7b4383c, 19b1b83): manually deleting cs-00002.yaml, recreating cs-00003.yaml, reapplying artifact operations via ears-manager artifact put, updating .protobot/project.yaml, and re-running impact analysis.
What could go better
High confidence that this is a recurring architectural problem for ProtoBot. ears-manager allocates sequential integer IDs (CS-00001, CS-00002, etc.) using highestChangeSetNumber in ears-manager/internal/cli/branch.go. In any repository where multiple pull requests containing proposed specification changes are developed concurrently, each branch will independently select the same sequential sequence number from its local baseline. When branches merge out of order, collisions are mathematically guaranteed.
Because ears-manager provides no change-set renumber command or automated collision recovery during change-set update --base-commit, recovering from a collision requires error-prone manual manifest surgery that directly violates AGENTS.md conventions against hand-editing registered artifacts. Neither autonomous agents nor human maintainers have a supported CLI path to resolve change-set ID collisions.
Proposed change
In redhat-et/ProtoBot, add change-set renumbering and collision-resolution capabilities to ears-manager:
-
Add a new command:
ears-manager change-set renumber --change-set <old-id> [--to <new-id>]:- If
--tois omitted, calculate the next available sequence number across the working tree and canonical default branch refs usinghighestChangeSetNumber. - Rename
.protobot/change-sets/<old-manifest>.yamlto<new-manifest>.yaml. - Update the
id:field in the manifest. - Update all corresponding change-set references in
.protobot/project.yaml. - Update any child records or active change-set operations referencing the old ID.
- Re-calculate store digests so
ears-manager checksucceeds immediately.
- If
-
In
ears-manager change-set update --base-commit <new-base>:- Check whether the proposed change-set ID already exists in the target base commit tree.
- When a collision is detected, fail with a specific diagnostic (
change_set.id_collision) and output actionable recovery instructions recommendingears-manager change-set renumber.
Validation criteria
In ears-manager/internal/cli/changeset_test.go, add an automated test exercising change-set renumbering:
- Initialize a test repository with
CS-00001merged onmain. - Create a proposed change set
CS-00002on a feature branch. - On
main, commit an independent proposed change setCS-00002. - On the feature branch, run
ears-manager change-set renumber --change-set CS-00002. - Verify that the manifest is renamed to
cs-00003.yaml,.protobot/project.yamlis updated withCS-00003, andears-manager checkpasses with exit code 0 without manual file edits.
Generated by retro agent from https://github.com/redhat-et/ProtoBot/pull/245
- Dominant language
- Go
- Stars
- 6
- Forks
- 8
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 84
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from redhat-et/ProtoBot
-
bug infra ready-for-triage triaged
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
redhat-et/ProtoBot#301 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Enforce change-set base freshness and project.yaml metadata hand-edit checks in review-pr skillPossibly taken @fullsend-ai-coder claimed this 4 days ago. Opencomponent:specification-toolkit documentation ready-for-triage ready-to-code
Difficulty 3/5 1-2 days Newbie friendliness 35/100
redhat-et/ProtoBot#294 · 3 comments · 2 reactions ·
Maintainers usually reply within 1 day
-
Add multi-remote fork topology and non-candidate ref test fixtures to ears-manager self-host suiteOpenblocked component:ears-manager ready-for-triage
Difficulty 4/5 3-5 days Newbie friendliness 53/100
redhat-et/ProtoBot#293 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Enable issue-driven Fullsend Code/Fix runs to create ears-manager-compliant PRsPossibly taken @JohnStrunk claimed this 5 days ago. Opencomponent:ears-manager enhancement feature infra triaged
redhat-et/ProtoBot#292 · 10 comments · 2 reactions · 1 assignee ·
Maintainers usually reply within 1 day
-
enhancement feature infra ready-for-triage triaged
Difficulty 3/5 1-2 days Newbie friendliness 55/100
redhat-et/ProtoBot#288 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
All issues in redhat-et/ProtoBot
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
grafana/tempo-operator#1691 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
hashicorp/terraform-mcp-server#583 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
backend bug low-priority
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
lognorman20/monaco#6225 ·