Repository navigation
Report missing ledger transaction artifacts clearly - #77644
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: 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.
|
|
✅ 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: 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.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: 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.
|
|
❌ PR Specification Reviewer failed to deliver outputs. Please review the logs for details. PR Specification ReviewerOutcome: 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.
|
There was a problem hiding this comment.
🟢 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_changeshandoff 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)
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
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
| var uploadState safeOutputsHandlerOutputsAndActionState | ||
| NewCompiler().appendLedgerTransactionsArtifactUpload(data, &uploadState) | ||
| uploadSteps := strings.Join(uploadState.steps, "") | ||
| transactionPath := "${{ runner.temp }}/gh-aw/ledger-transactions.json" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Added the missing download destination check alongside the writer, upload, and consumer path contract in 550aadc.
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
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
filewhile the read usespath.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
ENOENTcause.
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 }); |
There was a problem hiding this comment.
[/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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| var uploadState safeOutputsHandlerOutputsAndActionState | ||
| NewCompiler().appendLedgerTransactionsArtifactUpload(data, &uploadState) | ||
| uploadSteps := strings.Join(uploadState.steps, "") | ||
| transactionPath := "${{ runner.temp }}/gh-aw/ledger-transactions.json" |
There was a problem hiding this comment.
[/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.
There was a problem hiding this comment.
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/); |
There was a problem hiding this comment.
[/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.
There was a problem hiding this comment.
The missing-artifact regression now asserts that the original ENOENT is retained as cause. Fixed in 550aadc.
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
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"
}
|
…air-missing-ledger-transaction-artifa Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged the latest |
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
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"
}
|
…air-missing-ledger-transaction-artifa Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
Category: bug | Risk: high | Score: 70 (impact 35 + urgency 20 + quality 15)
|
|
🎉 This pull request is included in a new release. Release: |
When the transaction artifact is unavailable,
push_ledger_changescan proceed to read a missing file and report only a generic error. The writer, uploader, and consumer use the same transaction path.safe_outputs→push_ledger_changeshandoff.