Skip to content

Fix Claim asset branch collisions with legacy refs - #75490

Closed
pelikhan wants to merge 9 commits into
mainfrom
pelikhan/chronicle-delivery-failure
Closed

pelikhan wants to merge 9 commits into
mainfrom
pelikhan/chronicle-delivery-failure

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Claim-scoped asset uploads currently create child refs beneath the configured asset branch. When a legacy branch already exists, Git rejects both chart uploads with a reference namespace conflict. Historical run 42218926247 published discussion #75424 with broken chart links and correctly failed whole-Claim delivery verification.

Changes

  • Use Claim-suffixed sibling branches in both asset staging URLs and the privileged publisher, retaining Claim-scoped content paths.
  • Preserve legacy branches, immutable Claim authorization, non-force updates and original private delivery receipt checks.
  • Exercise the old ref conflict with real local Git and verify matching producer/publisher URLs, two uploads per Claim, and singleton/batch isolation.
  • Document the prospective layout and prohibition on historical repair.

Validation

  • Focused asset, producer and delivery regressions: 519 tests passed.
  • Required make agent-report-progress gate passed, including build, TypeScript checks, JavaScript lint and impacted tests. Lint reported only warnings on unchanged existing error-handling lines.
  • Read-only security review: PASS for the candidate and lifecycle-disabled local validation path; no confirmed vulnerabilities.

This is a prospective fix only. It does not repair the old failed barrier, establish a historical Result, retry uncertain effects, edit the published discussion, mutate the queue, or dispatch workflows.

Use matching Claim-suffixed branches for staged URLs and native publication. Add real-Git regression coverage and preserve historical delivery barriers.

Co-authored-by: Copilot App <[email protected]>
@pelikhan
pelikhan marked this pull request as ready for review November 6, 2026 22:19
Copilot AI adaptive review requested due to automatic review settings November 6, 2026 22:19
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #75490

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: gpt56 max · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · routed: gpt56 max · ~1 AIC · ⌖ ~1 AIC · ⊞ 6.3K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from PR Specification Reviewer · gpt56 · ~6 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷

Generated by PR Specification Reviewer for #75490

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What this change does: Claim-scoped asset uploads now use Claim-suffixed sibling branches while retaining claims/<namespace>/ paths. The new parity test exercises both the producer and publisher against a legacy Git ref conflict and checks singleton and batch receipt isolation.

Should fix:

  1. The parity test carries dead environment cleanup (actions/setup/js/work_queue_git_adapter_parity.test.cjs:L101-L116)

    • What this is: The test passes Git isolation settings only through the child process environment.
    • Problem: It never changes process.env.GIT_CONFIG_*, so the snapshot and restore block adds global-state handling without doing work.
    • Fix: Remove gitConfigEnvironment and its before/after cleanup lines.
    • If we skip it: Future edits must maintain misleading cleanup code around a test that does not need it.

Verdict: fix 1 first.
Lean: -4 lines possible.

Generated by ✂️ Ponytail Reviewer for #75490 · codex · routed: gpt56 max · ~5 AIC · ⌖ ~1 AIC · ⊞ 118
Comment /ponytail to run again

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-06T22:22:25Z
review_event: COMMENT
top_themes: [empty normalized asset branch can produce malformed ref and URL]
files_reviewed: [actions/setup/js/safe_outputs_handlers.cjs, actions/setup/js/work_queue_upload_assets.cjs, actions/setup/js/work_queue_git_adapter_parity.test.cjs, .github/aw/work-queue.md]
comment_count: 1

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~4 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changed asset branch handling. One medium correctness issue is noted inline: all-invalid branch input can produce an empty ref and malformed URL instead of failing early. The legacy-ref collision fix and Claim namespace isolation otherwise look consistent from the diff; no tests or builds were run during this static review.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~4 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /tdd and /diagnosing-bugs. The producer and publisher fix is sound and the branch-collision root cause is addressed. Three test-quality points are commented inline.

📋 Key Themes & Highlights

Verified

  • ✅ Producer (safe_outputs_handlers.cjs:822) and publisher (work_queue_upload_assets.cjs:40) both salt the same base with claim-<namespace>, so the upload URL and the publish branch match.
  • ✅ The compiler sets GH_AW_ASSETS_BRANCH from one source (UploadAssets.BranchName), so config.branch and the producer input agree in production wiring.
  • ✅ The regression test reproduces the legacy refs/heads/assets/audit conflict with real git update-ref (cannot lock ref), so it guards the actual bug.

Themes

  • Test clarity: expect inside mocks throws from production code, and the cross-receipt guard is hard to read (inline).
  • Unexplained magic numbers: count + 1 (inline).

Limits and follow-up

  • The focused test was not run. npm ci failed on a TLS self-signed certificate in this environment, so these findings come from reading the diff, not from a test run. Please confirm CI is green.
  • work_queue_git_tree_adapter.cjs:132 still builds ${branch-prefix}/claims/<ns>, which has the same ref-namespace conflict. It is outside this PR and is a follow-up, not a blocker.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The second upload causes the first receipt to fail verification at settlement, while tests miss that failure and still expect the old ref layout.

2 open issues
What changed in this PR

This PR moves Claim asset uploads to sibling branches, avoiding Git ref conflicts with legacy asset branches while retaining Claim-scoped content paths.

Changes:

  • Aligns staging URLs and the privileged publisher on -claim-<namespace> branch suffixes.
  • Extends regression coverage with real local Git, two uploads per Claim, and singleton/batch isolation checks.
  • Documents the prospective layout and prohibition on historical repair.
File Description
actions/​setup/​js/​work_queue_upload_assets.cjs Publishes assets to Claim-suffixed sibling branches.
actions/​setup/​js/​work_queue_git_adapter_parity.test.cjs Exercises legacy ref conflicts, matching URLs, and multiple uploads.
actions/​setup/​js/​safe_outputs_handlers.cjs Generates staging URLs using the matching branch layout.
.github/​aw/​work-queue.md Documents branch naming and historical-repair restrictions.

Review effort: Max (auto)

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/work_queue_git_adapter_parity.test.cjs:101): What this is: The test only passes GIT_CONFIG_* values in the child env object at line 368. Problem: It never mutates process.env, so snapshotting every GIT_CONFIG_* key and deleting/restoring them in afterEach adds global-state machinery with no effect. Fix: Remove gitConfigEnvironment and the related beforeEach/afterEach cleanup. If we skip it: This parity test carries misleading environment cleanup that future changes must maintain. - Fix Claim asset branch collisions with legacy refs #75490 (comment)
  3. Review (actions/setup/js/safe_outputs_handlers.cjs:822): An all-invalid GH_AW_ASSETS_BRANCH can normalize to an empty string, so this claim branch becomes empty and emits a blob//... URL instead of failing before staging. - Fix Claim asset branch collisions with legacy refs #75490 (comment)
  4. Review (actions/setup/js/work_queue_git_adapter_parity.test.cjs:415): [/tdd] The expect calls inside the fake updateRef run inside production handler code. A failed assertion throws from within the upload path, so handler error handling can wrap it and report a generic upload failure instead of a clear assertion message. - Fix Claim asset branch collisions with legacy refs #75490 (comment)
  5. Review (actions/setup/js/work_queue_git_adapter_parity.test.cjs:445): [/tdd] The cross-receipt check is gated on member.handle !== original.claims[0].handle, which hides the intent. It is hard to tell what it asserts for count = 1 versus count = 2, and the test name does not explain why a receipt from results[0] must not verify for another Claim. - Fix Claim asset branch collisions with legacy refs #75490 (comment)
  6. Review (actions/setup/js/work_queue_git_adapter_parity.test.cjs:451): [/tdd] expect(refs.size).toBe(count + 1) encodes one legacy ref plus one ref per Claim, but the + 1 is unexplained. A named variable such as legacyRefCount or a short comment makes the expectation self-documenting. - Fix Claim asset branch collisions with legacy refs #75490 (comment)
  7. Fix failing check JS Tests (shard 4/8) (FAILURE): https://github.com/github/gh-aw/actions/runs/42303783576/job/128188114054.
  8. Fix failing check JS Tests (shard 4/8) (FAILURE): https://github.com/github/gh-aw/actions/runs/42294953105/job/128157850088.

Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: db0d1c8
Sous-chef requested-work: 0d5a12eb4ec018c4ee114b47ce7e991620be3a1b2d47946937e0b0463a23d0fc 1b314db726c579afa2fb3a5991ad325ebdbe740d78e90b4a323f93daa1d6eccf 5cc61dcd7236884ed79abae5bc89af4373a1f6aa3b510aff353199ccee320ef6 6a820f889d9190afa57432d7fd30fd56db37c08676278a49605c1fd6423eec78 82cc3efddaa6b3bdd068bb1341ff6511ae6b4599233014c154b5528d4783c155 ca202dd95468ef1b8eee97ac00b6915efe4b3afc6396492cdaee439aef3f56f7
Sous-chef requested-state: 2e5a472913d3f995078c4aafa4424d2b1b563e2381bc497f2335329a8dda5fa7

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~11 AIC · ⌖ ~10 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

Copilot AI commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

@copilot

Copilot assignment requested for the following outstanding work:...

Sous-chef requested-head: db0d1c8
Sous-chef requested-work: 0d5a12eb4ec018c4ee114b47ce7e991620be3a1b2d47946937e0b0463a23d0fc 1b314db726c579afa2fb3a5991ad325ebdbe740d78e90b4a323f93daa1d6eccf 5cc61dcd7236884ed79abae5bc89af4373a1f6aa3b510aff353199ccee320ef6 6a820f889d9190afa57432d7fd30fd56db37c08676278a49605c1fd6423eec78 82cc3efddaa6b3bdd068bb1341ff6511ae6b4599233014c154b5528d4783c155 ca202dd95468ef1b8eee97ac00b6915efe4b3afc6396492cdaee439aef3f56f7
Sous-chef requested-state: 2e5a472913d3f995078c4aafa4424d2b1b563e2381bc497f2335329a8dda5fa7

pelikhan and others added 2 commits November 6, 2026 18:47
Verify original private receipts against a stable descendant head and preserved asset content. Cover final batch settlement, malformed refs, receipt isolation, and native adapter regressions.

Co-authored-by: Copilot App <[email protected]>
@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to #75490 (comment)

The Ponytail review was evaluated. The cleanup-removal suggestion is declined because createHandlers injects process.env Git trust settings; the cleanup is retained with an explicit explanation and regression coverage.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to #75490 (comment)

The code-quality finding is addressed: empty normalized branch names are rejected before staging, and the publisher now has the matching early validation. The completion notification itself requires no additional code change.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to #75490 (comment)

The three test-clarity suggestions are addressed through post-upload mock assertions, explicit foreign-Claim receipt checks, and legacyRefCount. The focused regression suites were run locally; no workflow was dispatched.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to #75490 (comment)

The design gate reported no actionable design change, so no ADR was added. Its notification is not treated as delivery evidence or as a substitute for the local validation gates.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to #75490 (comment)

The sentinel reported no actionable change. The batch nevertheless adds settlement-time verification and negative receipt regressions, and validates them locally rather than inferring correctness from this notification.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to #75490 (comment)

The specification review reported no actionable change. The fix remains prospective and preserves Claim authorization, private receipts, exact content verification, and the historical failed delivery barrier.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to #75490 (comment)

The managed memory block was left unchanged. Its underlying empty-normalized-branch finding is addressed by the producer guard and matching publisher validation, with focused regression coverage.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to #75490 (comment)

The branch was updated with latest main using make merge-main, and the listed feedback was evaluated alongside the remaining settlement bug. The historical shard failures were the 829/800 documentation cap; the merged instructions satisfy that cap and its regression is included in local validation. No CI rerun or workflow dispatch was triggered.

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to #75490 (comment)

The requested-head/work/state lines describe the earlier assignment, not a new action or proof of delivery. The current branch preserves those earlier fixes, includes latest main and the validated settlement correction; no historical queue effects were retried.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check Docker root-owned staging cleanup (FAILURE): https://github.com/github/gh-aw/actions/runs/42332492230/job/128282031172.
  3. Fix failing check JS Tests (shard 7/8) (FAILURE): https://github.com/github/gh-aw/actions/runs/42332492230/job/128282031369.

Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: a1cf81a
Sous-chef requested-work: 1233d7d521d5a5d4c95d951ce598fd234d873db85a7b5b39aa899a83269fe32b 47f188a12b316525c2202f4f75b82185d76be0a140c0f99eae185cf2b7d8acb1
Sous-chef requested-state: 3c600010627dbf88e0ecbdd83757ca954e4a629ef997168995600b04f84a4455

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~9 AIC · ⌖ ~11 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

@copilot

Copilot assignment requested for the following outstanding work:...

Investigating the assigned failures and updating this branch with latest main.

Sous-chef requested-head: a1cf81a
Sous-chef requested-work: 1233d7d521d5a5d4c95d951ce598fd234d873db85a7b5b39aa899a83269fe32b 47f188a12b316525c2202f4f75b82185d76be0a140c0f99eae185cf2b7d8acb1
Sous-chef requested-state: 3c600010627dbf88e0ecbdd83757ca954e4a629ef997168995600b04f84a4455

@pelikhan

pelikhan commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts on this branch.

…livery-failure

# Conflicts:
#	actions/setup/js/release_staging.test.cjs

Co-authored-by: pelikhan <[email protected]>

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

Resolved the conflict with latest main and pushed merge commit 09aa29e. Both the exact path/admin-guidance assertions and the full rootless non-reclaim diagnostic assertions are preserved; focused tests and the required validation gate pass.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check JS Tests (shard 7/8) (FAILURE): https://github.com/github/gh-aw/actions/runs/42340913346/job/128308248480.

Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI.

Sous-chef requested-head: 09aa29e
Sous-chef requested-work: 47f188a12b316525c2202f4f75b82185d76be0a140c0f99eae185cf2b7d8acb1
Sous-chef requested-state: 9825ebb24d79bbbe8b46fdc8119d9dd1ea4ba973dd866dc70fe8dd3c888f06a7

Generated by 👨🍳 PR Sous Chef · pi · haiku45 · ~5 AIC · ⌖ ~8 AIC · ⊞ 1.2K · ◷
Comment /souschef to run again

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

@copilot

Copilot assignment requested for the following outstanding work:...

Investigating the shard-7 timeout and merging refreshed main as requested.

Sous-chef requested-head: 09aa29e
Sous-chef requested-work: 47f188a12b316525c2202f4f75b82185d76be0a140c0f99eae185cf2b7d8acb1
Sous-chef requested-state: 9825ebb24d79bbbe8b46fdc8119d9dd1ea4ba973dd866dc70fe8dd3c888f06a7

@pelikhan pelikhan closed this Nov 7, 2026
Copilot stopped work on behalf of gh-aw-bot due to an error November 7, 2026 05:38
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.

4 participants