Unify pipeline warning/error reporting into PipelineMessages module#1093
Open
joehendrix wants to merge 6 commits intomainfrom
Open
Unify pipeline warning/error reporting into PipelineMessages module#1093joehendrix wants to merge 6 commits intomainfrom
joehendrix wants to merge 6 commits intomainfrom
Conversation
3b069cf to
04b30cc
Compare
tautschnig
reviewed
May 4, 2026
Contributor
tautschnig
left a comment
There was a problem hiding this comment.
verboseWarnings : Bool := false is a hardcoded constant — there's no way for users to enable verbose warnings without editing source code. This should either be:
- A CLI flag (e.g.,
--verbose-pyspec-warnings) passed through topythonAndSpecToLaurel, or - Controlled by the existing
--verboseflag that's already available in the pipeline
The existing quiet parameter already suppresses the count line. Adding a verbose parameter (or reusing the one from the caller) would be cleaner than a dead constant.
Replace WarningKind/SpecError with MessageKind/PipelineMessage in a new Strata.Languages.Python.PipelineMessages module. Each MessageKind now carries a typed Phase (with ordering) and a MessageImpact level (internalError, internalWarning, knownLimitation, userCodeIssue). Change pythonAndSpecToLaurel to return PythonToLaurelResult (success or failure with accumulated warnings) instead of printing to stderr, so callers control output. Extract printSummary/writeSummaryJson utilities. Convert ad-hoc stderr warnings (invalid module name, overload resolve, missing pyspec) into structured PipelineMessage entries. Make FunctionOverloads.paramName non-optional. Extract reportUserCodeError helper in StrataMain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…orting Replace EIO String with BaseIO-based PipelineM (StateT PipelineState BaseIO) so pipeline steps accumulate structured messages without exceptions. This enables end-to-end warning reporting where all errors and warnings are collected with their source locations, even when multiple failures occur. Key changes: - PipelineState carries messages array and shouldAbort flag - addMessage/addMessages/fatalPipelineError combinators replace raw modify - resolveModules combinator deduplicates three resolve-and-iterate loops - File read errors, signature errors, and name collisions are now fatal but report ALL failures (not just the first) - Collision checks use first-wins with deduplication - Public wrappers (buildPySpecLaurel, readDispatchOverloads) return PipelineState so callers can check shouldAbort Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace separate addMessage/fatalPipelineError with a single emitMessage combinator. Whether a message aborts the pipeline is now determined by kind.impact.isFatal rather than the caller choosing which function to call. Also adds configurationError impact for cases where the tool was invoked with invalid arguments or on-disk pyspecs are unreadable (previously misclassified as userCodeIssue or internalError). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
59340c0 to
50adc34
Compare
Remove the `printSummary` helper (only had one call site) and inline the warning printing directly in pyAnalyzeLaurel where the `verbose` flag is available. Simplify `writeSummaryJson` from `BaseIO` with manual error handling to plain `IO`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidate WarningKind/SpecError into a new PipelineMessages module with typed phases, impact levels, and structured output. Callers now receive warnings in the result rather than having them printed to stderr.
Motivation
The pySpecLaurel pipeline previously mixed exception-based error handling (
EIO String) with ad-hoc warning printing. This made it impossible to:This PR establishes structured warning infrastructure as a foundation for end-to-end robust warning reporting across the full pipeline.
Design: impact drives behavior
Each
MessageKindhas aMessageImpactthat determines pipeline behavior viaisFatal:configurationErrorinternalErrorinternalWarningknownLimitationuserCodeIssueArchitecture
PipelineMis aStateT PipelineState BaseIOmonad wherePipelineStatecarries:messages : Array PipelineMessage— all warnings and errors with source locationsshouldAbort : Bool— set automatically when a fatal message is emittedThere may be multiple fatal errors collected (e.g., listing every missing module, not just the first).
Output changes
pythonAndSpecToLaurelreturnsBaseIO PythonToLaurelResult(.success program warningsor.failure error warnings). Callers invokePipelineMessage.printSummary/writeSummaryJsonexplicitly.JSON warning summary gains
"impact"field:{"phase": "pySpecToLaurel", "category": "unsupportedUnion", "impact": "knownLimitation", "count": 3}Other changes
resolveModulescombinator deduplicates three resolve-and-iterate loopsPhasehasphaseNumberfor display ordering and a private constructorFunctionOverloads.paramNamechanged fromOption StringtoStringSpecs/Error.leandeleted; extractreportUserCodeErrorhelper in StrataMainBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.