Skip to content

Report missing ledger transaction artifacts clearly - #77644

Merged
pelikhan merged 6 commits into
mainfrom
copilot/aw-top-10-repair-missing-ledger-transaction-artifa
Nov 14, 2026
Merged

pelikhan merged 6 commits into
mainfrom
copilot/aw-top-10-repair-missing-ledger-transaction-artifa

Conversation

@gh-aw-bot

@gh-aw-bot gh-aw-bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

When the transaction artifact is unavailable, push_ledger_changes can proceed to read a missing file and report only a generic error. The writer, uploader, and consumer use the same transaction path.

  • Missing-artifact diagnostics: Identify the missing file and the expected safe_outputs → push_ledger_changes handoff.
  • Regression coverage: Verify the missing-file error and confirm the writer, upload artifact, and consumer paths agree.
Missing validated ledger transaction artifact at <path>;
ensure safe_outputs uploads gh-aw-ledger-transactions before push_ledger_changes

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@gh-aw-bot gh-aw-bot changed the title [WIP] Fix missing ledger transaction artifact issue before push Report missing ledger transaction artifacts clearly Nov 14, 2026
@pelikhan
pelikhan marked this pull request as ready for review November 14, 2026 05:52
Copilot AI adaptive review requested due to automatic review settings November 14, 2026 05:52
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~3 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 1.5K · ◷

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail 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 by Ponytail Reviewer for #77644 · codex · routed: gpt61 medium · ~4 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 182 · ◷

@github-actions

github-actions Bot commented Nov 14, 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.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · routed: sonnet55 high · ~6 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 8.6K · ◷

@github-actions

github-actions Bot commented Nov 14, 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 · copilot · routed: haiku55 xhigh · ~6 AIC · ⌖ ~2 AIC · ⊞ 6.6K · ◷

@github-actions

github-actions Bot commented Nov 14, 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.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 7.2K · ◷

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

❌ PR Specification Reviewer failed to deliver outputs. Please review the logs for details.

PR Specification Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

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

Generated by PR Specification Reviewer for #77644 · copilot · gpt56 · ~2 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 1.6K · ◷

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.

🟢 Approval recommended

No active review issues block approval of the missing-file diagnostic and artifact-handoff coverage changes.

No open issues 🎉

What changed in this PR

This PR improves diagnostics for missing ledger transaction files in gh-aw’s persistence flow and adds regression coverage for the artifact handoff described in #77383.

Changes:

  • Report the missing file path and expected safe_outputs → push_ledger_changes handoff while preserving the original error as the cause.
  • Add a regression test for the missing-file diagnostic.
  • Assert that the writer, artifact uploader, and consumer use the expected transaction path.
File Description
pkg/​workflow/​ledger_test.go Checks artifact upload naming and upload/consumer path alignment.
actions/​setup/​js/​push_ledger_changes.test.cjs Tests the missing transaction file diagnostic.
actions/​setup/​js/​push_ledger_changes.cjs Adds a specific error for missing transaction files.
actions/​setup/​js/​ledger_append.test.cjs Checks the producer’s transaction file path.

Review effort: Balanced (dynamic)

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-14T05:55:14Z
review_event: REQUEST_CHANGES
top_themes:
  - ledger artifact handoff test coverage
files_reviewed:
  - actions/setup/js/ledger_append.test.cjs
  - actions/setup/js/push_ledger_changes.cjs
  - actions/setup/js/push_ledger_changes.test.cjs
  - pkg/workflow/ledger_test.go
comment_count: 1
History

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 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.5K · ◷
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.

Found one blocking test-coverage gap: the new handoff assertion does not verify the download-artifact destination, so upload/download/consumer path drift could go undetected. The missing-artifact diagnostic itself is covered; no runtime tests were run per the static-review instructions.

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

Comment thread pkg/workflow/ledger_test.go Outdated
var uploadState safeOutputsHandlerOutputsAndActionState
NewCompiler().appendLedgerTransactionsArtifactUpload(data, &uploadState)
uploadSteps := strings.Join(uploadState.steps, "")
transactionPath := "${{ runner.temp }}/gh-aw/ledger-transactions.json"

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.

The handoff assertion still misses the download step’s destination. It only checks the upload path and GH_AW_LEDGER_TRANSACTIONS against a separately hard-coded literal, so a change to actions/download-artifact’s path could make the consumer read a file the download never creates while this test continues to pass. Please assert the download step path (ideally derive the expected path once) so the writer → upload → download → consumer agreement is actually covered.

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.

Added the missing download destination check alongside the writer, upload, and consumer path contract in 550aadc.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-871126a4-8415-40c2-bb15-6e2f413d45c2","parents":[],"payload":{"id":"ldg-2afcb191-ea46-416b-8952-c00bd015ae6d","operation":"append","value":{"finding_count":1,"head_sha":"fc0fb5124d5cdb12829733814a8783136ba17c6e","outcome":"findings"}},"sha":"sha256:285fd83d6e16c7a316b2b273a49b93c1081aa27f8f079a4702c98678bd748df4","timestamp":"2026-11-14T06:01:30.437Z","type":"ledger_append","version":1}
History

@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 /diagnosing-bugs and /tdd. The fix is correct: an ENOENT on the transaction artifact now names the missing path and the safe_outputs upload handoff, and the Go wiring test passes. The gaps are in regression strength, not behavior.

📋 Key Themes & Highlights

Key Themes

  • Path mismatch in message: the error prints the raw file while the read uses path.resolve(file).
  • Split source of truth: writer, upload, and consumer paths are pinned by separate string literals in JS and Go tests, and the JS error hardcodes the artifact name.
  • Weak assertion: the new test checks only message text, not the preserved ENOENT cause.

Positive Highlights

  • ✅ Clear, actionable error text that points to the exact handoff step.
  • ✅ Preserves the original error via { cause }.
  • ✅ Writer, upload, and consumer paths are now covered by tests in both suites.

Verification Note

The Go test TestStandaloneLedgerWiresValidationArtifactAndPersistenceJobs passes locally. The vitest suites could not run here because npm ci failed on a self-signed certificate from the package proxy, so the JS changes are reviewed by reading only.

@copilot please address the review comments above.

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

} catch (error) {
if (error instanceof TypeError && error.message === "Invalid ledger transaction artifact") throw error;
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
throw new Error(`Missing validated ledger transaction artifact at ${file}; ensure safe_outputs uploads gh-aw-ledger-transactions before push_ledger_changes`, { cause: error });

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.

[/diagnosing-bugs] The error interpolates the raw file value, but the open call uses path.resolve(file). With a relative GH_AW_LEDGER_TRANSACTIONS, the message names a different path from the one that failed. Resolve once and reuse it in both places.

💡 Suggested change
const resolved = path.resolve(file);
// use resolved in fs.openSync(...) and in the Missing artifact message

@copilot please address this.

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.

Resolved the path once and now use it for both the file open and missing-file diagnostic; the test covers a relative input path. Fixed in 550aadc.

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.

Resolved the path once and now use it for both the file open and missing-file diagnostic; the test covers a relative input path. Fixed in 550aadc.

Comment thread pkg/workflow/ledger_test.go Outdated
var uploadState safeOutputsHandlerOutputsAndActionState
NewCompiler().appendLedgerTransactionsArtifactUpload(data, &uploadState)
uploadSteps := strings.Join(uploadState.steps, "")
transactionPath := "${{ runner.temp }}/gh-aw/ledger-transactions.json"

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.

[/diagnosing-bugs] Writer, upload, and consumer agreement rests on identical string literals in separate suites. ledger_append.test.cjs pins only the JS writer path, and this test pins only the Go upload and env literals, so changing one side can leave the other test passing. The JS error also hardcodes gh-aw-ledger-transactions rather than the Go ledgerTransactionsArtifactName constant. Consider one source of truth that both suites read.

@copilot please address this.

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.

The generated workflow now sources the artifact path and name from Go constants, passes the shared path to the writer and consumer, and checks upload/download/consumer agreement. Fixed in 550aadc.

const directory = fs.mkdtempSync(path.join(os.tmpdir(), "ledger-missing-"));
const file = path.join(directory, "ledger-transactions.json");
try {
await assert.rejects(main({ file, ledgerConfigs }), /Missing validated ledger transaction artifact.*safe_outputs uploads gh-aw-ledger-transactions before push_ledger_changes/);

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.

[/tdd] The test checks only the message text. Also assert that the original ENOENT error is kept as cause, so a later refactor cannot silently drop the diagnostic chain.

💡 Suggested assertion
await assert.rejects(main({ file, ledgerConfigs }), error => {
  assert.match(error.message, /Missing validated ledger transaction artifact/);
  assert.equal(error.cause.code, "ENOENT");
  return true;
});

@copilot please address this.

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.

The missing-artifact regression now asserts that the original ENOENT is retained as cause. Fixed in 550aadc.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator Author

@copilot

🍳 A little prep to help this PR along! 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 (pkg/workflow/ledger_test.go:714): address unresolved feedback - Review comment
  3. Review (actions/setup/js/push_ledger_changes.cjs:37): address unresolved feedback - Review comment
  4. Review (pkg/workflow/ledger_test.go:714): address unresolved feedback - Review comment
  5. Review (actions/setup/js/push_ledger_changes.test.cjs:63): address unresolved feedback - Review comment
  6. Fix failing check safe_outputs (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "fc0fb5124d5cdb12829733814a8783136ba17c6e",
  "kind": "requested",
  "schema_version": "1",
  "state": "ac3aec0fd2102b1d9653c472f22ca857c26da3e7a420abdd16b0157bc6e61e45",
  "work": [
    "0bb02bbf015879f1b4dccf34108129e313c813cbdae02ab210189a200b4c1c9f",
    "5430049f2bb1463ab23f32ce6eb839e1483a0f6c705cf0d7a21a6352e938f4a2",
    "82bb3a75abbdb4b6bc8d63581a50841dc3221d1c6fd5a23f1bd67277d808edfc",
    "c7cf93e497befdd5e698d00101b0703e4101fe4133d86d433f7c170d07402b7e",
    "ebb2ffd1b992d8540aaaacd194e11aaf9d440b62b96bca66b6bf0a873e9c1723"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~3 AIC · ⌖ ~2 AIC · ⊞ 6.9K · ◷
Comment /souschef to run again

gh-aw-bot and others added 2 commits November 14, 2026 06:33
…air-missing-ledger-transaction-artifa

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

Merged the latest main and addressed the four linked review threads in 550aadc. The safe_outputs failure was traced to an invalid reviewer-generated ledger append (record where operation is required), not the artifact handoff. Focused tests pass; the full workflow package run also reported unrelated evals/artifact-collection test failures.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator Author

@copilot

🍳 A little prep to help this PR along! 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 build (FAILURE): Check run.
  3. Fix failing check impacted-go-tests (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "550aadcf95a9efcd0a92ec2cb2be2db6a07046be",
  "kind": "requested",
  "schema_version": "1",
  "state": "6f4c9eb38f7e139c1410912eae43d63e1c5d86fba0a4819e8ee611dcc9079840",
  "work": [
    "42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac",
    "f7883e8c8105930e955354caa741d783bcca067e66097fe9612fb72b90823998"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 6.9K · ◷
Comment /souschef to run again

gh-aw-bot and others added 2 commits November 14, 2026 07:38
…air-missing-ledger-transaction-artifa

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Category: bug | Risk: high | Score: 70 (impact 35 + urgency 20 + quality 15)
Recommended action: fast_track | Batch: pr-batch:health-ops
Why: Missing ledger-artifact errors were poorly surfaced; CI is green and the fix is user-facing and regression-tested.

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~6 AIC · ⌖ ~2 AIC · ⊞ 14.4K · ◷

@pelikhan
pelikhan merged commit ceae77d into main Nov 14, 2026
66 checks passed
@pelikhan
pelikhan deleted the copilot/aw-top-10-repair-missing-ledger-transaction-artifa branch November 14, 2026 14:09
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.3.0

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AW Top 10] 05 Repair missing ledger transaction artifact before push

4 participants