Repository navigation
[lint-monster] Handle ignored errors and discarded results - #79402
Conversation
|
✅ PR Specification Reviewer completed successfully! 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.
|
|
✅ 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.
|
|
✅ 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.
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality 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.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ Matt Pocock Skills 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.
|
This comment has been minimized.
This comment has been minimized.
Comment MemoryPeek at saved memory (spec-review-history)History |
There was a problem hiding this comment.
I found two correctness issues in the new scanner-error handling: oversized eval records now abort analysis due to the unchanged 64 KiB scanner limit, and nested include scan errors are swallowed by the caller in the normal (non-verbose) path. Please address these before merging.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~5 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
| @@ -93,7 +101,10 @@ func parseEvalResultRecords(data []byte) []evalResultRecord { | |||
| records = append(records, record) | |||
There was a problem hiding this comment.
This turns any eval JSONL record over bufio.Scanner's default 64 KiB token limit into a fatal analysis error, even though oversized records were previously ignored and other valid records could still be summarized. Eval answers can contain arbitrarily long text, so a single large record now aborts both metric summary and observation attribution. Please raise the scanner buffer (or use a reader without this limit) before treating the scanner error as fatal, and add coverage for a valid large record.
| queue = append(queue, nestedFilePath) | ||
| } | ||
| } | ||
| if err := nestedScanner.Err(); err != nil { |
There was a problem hiding this comment.
The new error is not actually propagated to the caller: add_workflow_content.go logs this error only in verbose mode and returns the original content with a nil error. Thus a nested include that hits Scanner's 64 KiB limit still silently succeeds in the normal path, while the new check only changes verbose output. Please either propagate this error or explicitly make the best-effort behavior clear and test it; otherwise this fix does not prevent truncated nested include processing.
ADR RequiredThis PR meets the ADR threshold. It has no Draft committed: Decision captured in the draft: check ADR-60660 defines the analyzer that reports these loops. It does not record this error-propagation decision. Next action (author): Review the draft, resolve the two
|
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
🔵 Needs a closer look
Changes to the exported parser API and scanner failures now aborting compilation, recursive include processing, and experiment analysis require human compatibility and operational review.
No open issues 🎉
What changed in this PR
This PR addresses seven unchecked scanner loops in gh-aw, making parsing failures explicit rather than silently returning incomplete results. It covers the scanner-related subset of #71980; the remaining ignored-result findings stay tracked separately.
Changes:
- Check scanner errors in markdown parsing, import/include processing, eval JSONL parsing, and zizmor output handling.
- Propagate errors through affected compiler and CLI callers.
- Add oversized-token regression tests and update existing tests for error-returning signatures.
| File | Description |
|---|---|
pkg/workflow/compiler_orchestrator_tools.go |
Propagates runtime-import scanning errors during compilation. |
pkg/parser/include_expander.go |
Returns scanning errors from runtime-import extraction and include expansion. |
pkg/parser/include_expander_relativize_test.go |
Adds scanner error tests for import extraction and expansion. |
pkg/parser/frontmatter_extraction_test.go |
Tests oversized tokens during section extraction. |
pkg/parser/frontmatter_content.go |
Reports scanner errors when extracting markdown sections. |
pkg/cli/zizmor.go |
Reports errors while scanning zizmor stderr. |
pkg/cli/zizmor_test.go |
Adds a zizmor scanner error regression test. |
pkg/cli/remote_workflow_test.go |
Tests remote include scanning failures. |
pkg/cli/includes.go |
Propagates runtime-import and remote include scanning errors. |
pkg/cli/imports.go |
Reports nested include scanning failures. |
pkg/cli/imports_test.go |
Tests oversized tokens in nested includes. |
pkg/cli/experiments_fetch.go |
Returns eval JSONL scanning errors through result loaders. |
pkg/cli/experiments_eval_observations_test.go |
Tests eval scanner failures and updates parser calls. |
pkg/cli/experiments_command.go |
Propagates eval loading errors through experiment analysis. |
pkg/cli/experiments_command_test.go |
Updates summary tests for the parser’s error return. |
Review effort: Balanced (adaptive)
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs, /tdd and /codebase-design. No blocking correctness issues found; three follow-ups to consider.
📋 Key Themes & Highlights
Key Themes
- Silent success on scan failure:
experiments analyzestill exits 0 when the eval-results scan fails (inline comment onexperiments_command.go). - Scanner limit consistency: parser scanners keep the default 64 KiB limit while CLI scanners use 1 MiB (inline comment on
include_expander.go). - Boundary coverage: the new tests only cover the over-limit error path (inline comment on the eval observations test).
Positive Highlights
- ✅ Every touched
bufio.Scannernow checksErr(), so truncated input is no longer treated as complete. - ✅ Error returns are propagated through all in-repo callers, including the compiler path in
compiler_orchestrator_tools.go. - ✅ Error-path tests use a 64 KiB+1 line to trigger
ErrTooLongreliably. - ✅ Targeted
pkg/parserandpkg/clitests pass, andgofmtis clean on changed files.
Verification Notes
- A full
go vetofpkg/workflowwas OOM-killed on the runner, so its compile is inferred frompkg/cli, which imports it.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~9 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| } | ||
|
|
||
| func TestParseEvalResultRecordsReturnsScannerErrors(t *testing.T) { | ||
| data := []byte(strings.Repeat("x", 64*1024+1)) |
There was a problem hiding this comment.
[/tdd] The new coverage only exercises the error path with a 64 KiB+1 line. Add a success-path case so the boundary is pinned on both sides: a valid record followed by a line just under the limit should still parse and return the valid records with no error.
💡 Suggested test
Assert that a payload at the limit parses, and that limit+1 returns the wrapped scan error. Name the cases as specs, for example returns valid records when lines are within the scanner limit.
@copilot please address this.
| }) | ||
| } | ||
| return results | ||
| if err := scanner.Err(); err != nil { |
There was a problem hiding this comment.
[/codebase-design] The parser scanners use the default 64 KiB token limit with no Buffer() call, while some CLI scanners in this PR raise it to 1 MiB. A single line over 64 KiB in an imported or runtime-imported file now fails hard, where before it was silently truncated. The same applies to frontmatter_content.go:284. Confirm the 64 KiB limit is intended, or share one buffer-size constant between parser and CLI.
💡 Suggested change
Set an explicit limit on each parser scanner, for example scanner.Buffer(make([]byte, 0, 64*1024), maxLine), with maxLine defined once in pkg/parser so both paths stay consistent.
@copilot please address this.
| return frontmatter, details, loadRemoteMetricEvalResults(config.RepoOverride, details.WorkflowID), nil | ||
| metricEvalResults, err := loadRemoteMetricEvalResults(config.RepoOverride, details.WorkflowID) | ||
| if err != nil { | ||
| return frontmatter, details, nil, err |
There was a problem hiding this comment.
[/diagnosing-bugs] The helpers now return scan errors, but the caller at experiments_command.go:196-200 prints them and returns nil, so experiments analyze exits 0 when the eval-results file cannot be fully read. The comment at lines 192-195 documents config loading as best-effort, which may justify this. Decide explicitly: either return the error from the caller, or keep the non-fatal path and add a test that pins the exit-0 behavior.
💡 Suggested change
Return scan failures from runExperimentsAnalyze and reserve the best-effort path for missing config, so a truncated input cannot produce a silent success exit.
@copilot please address this.
Evidence
The pre-check
make golint-customoutput identified seven scanner loops that omitScanner.Err()checks across six source files. The ignored-results tracker #71980 now records 727 remaining findings after these seven fixes.Implementation
Validation
make fmt— passed.go test ./pkg/parser— passed in the combined package run before CLI compilation was killed.make golint-custom— completed with status 2 because repository-wide findings remain (2,956 diagnostics in the output). The broad combined package test invocation did not complete because the CLI compiler was killed under runner memory pressure.