Phase 18: Structured IngestError + CLI integration#33
Conversation
- Cover errors.As and pkg/errors.Cause extraction - Pin IngestError formatting and staged numeric formatting
- Export IngestLayer and IngestError with wrapping helpers - Add deterministic staged numeric value formatting
- Cover parser, transformer, and schema IngestError extraction - Assert parser contract errors remain outside IngestError
- Return parser IngestError after stage callback and soft-skip checks - Wrap transformer and unsupported value failures with source path context
- Cover malformed literal and validator rejected promotion values - Assert soft parser numeric and transformer paths return nil
- Return numeric IngestError for malformed literals and mixed promotion - Preserve raw numeric value strings through validator replay - Update affected expectations for structured error messages
- Add execution summary with verification and deviations - Update phase progress and requirement traceability
- Assert IngestError extraction through outer wrapping - Prove hard failures leave builders reusable and exceptions unstructured
- Parse builder.go and inspect named hard-ingest functions - Fail direct plain errors returns outside IngestError wrappers
- Add 18-02 execution summary - Advance Phase 18 progress to plan 03
- Cover deterministic layer ordering for ingest failure aggregation - Assert parser sample line, input index, value, and message fields
- Add structured failure groups and samples to experiment summaries - Convert accumulated IngestError groups in deterministic layer order
- Assert continue mode renders grouped parser failure samples - Assert abort mode returns parser ingest error without grouped summary
- Record structured IngestError failures during continue-mode ingest - Print grouped failure samples after error counts in text reports
- Assert grouped JSON failure samples and ordering - Add deterministic 100-line fixture with parser, transformer, and numeric failures
- Add overridable experiment default config for package tests - Verify JSON failure groups with deterministic 100-line parser transformer numeric fixture
- Add execution summary and verification evidence - Update roadmap, requirements, and state for completed IERR-03 work
- Add Godoc for exported IngestError API surface - Note verbatim Value policy and CLI grouped summaries in changelog
- Mark Phase 18 validation rows green with final command evidence - Fix lint findings blocking the final make lint gate
- Add plan summary with verification and deviation details - Mark Phase 18 complete in state and roadmap
|
Claude finished @tazarov's task in 3m 19s —— View job Code Review — Phase 18: Structured IngestError + CLI IntegrationTasks:
SummaryPhase 18 is a well-executed structured-error milestone. The
|
The AST guard previously matched any comment containing the substring '+hard-ingest', allowing free-text trailing on the same line and near-identical tokens like '+hard-ingest-foo' to pass as directives. Require the canonical standalone form (the directive on its own trimmed comment line) and migrate the existing call site. Addresses PR #33 review item 4.
withExperimentDefaultConfig swaps the same kind of package-global seam as withExperimentBuilderFactory but lacked the matching warning that callers must not run in parallel while the override is active. Add the comment for symmetry to prevent a future caller from accidentally adding t.Parallel(). Addresses PR #33 review item 5.
|
Claude finished @tazarov's task in 2m 0s —— View job Claude finished @tazarov's task —— Follow-up Review — Phase 18: Prior Review ItemsTasks:
All five items flagged in the initial review have been addressed. Here's the rundown: Item 4 —
|
Summary
Phase 18: Structured
IngestError+ CLI integrationGoal: Make per-document failures actionable by callers through a structured
IngestError, then surface the same structure ingin-index experiment --on-error continuesummaries.Status: Verified
Phase 18 completes the v1.2 ingest-correctness milestone by adding an exported structured ingest error API, wiring hard parser/transformer/numeric/schema document failures into that API, and reporting grouped ingest failures from the experiment CLI in both text and JSON output. It preserves Phase 17 soft-skip behavior and keeps parser contract/internal tragic errors outside the public per-document
IngestErrorboundary.Changes
Plan 18-01: Public
IngestErrorAPIAdded
IngestLayerandIngestErrorwithPath,Layer,Value, andErr, plusError,Unwrap, andCausecompatibility.Key files:
ingest_error.gobuilder.go,failure_modes_test.go,parser_test.go,gin_test.go,examples/failure-modes/main_test.goPlan 18-02: Structured Error Guard Coverage
Added behavioral and AST guard coverage so hard ingest sites do not drift back to opaque plain errors.
Key files:
ingest_error_guard_test.gofailure_modes_test.goPlan 18-03: Experiment CLI Grouped Failures
Added deterministic grouped failure summaries for
gin-index experiment --on-error continue, including bounded structured samples in text and JSON reports.Key files:
cmd/gin-index/experiment.go,cmd/gin-index/experiment_output.go,cmd/gin-index/experiment_test.goPlan 18-04: Docs and Final Verification
Documented the public API and release-facing behavior, including the verbatim caller-owned
Valuepolicy, then recorded final validation evidence.Key files:
CHANGELOG.md,ingest_error.go,.planning/phases/18-structured-ingesterror-cli-integration/18-VALIDATION.mdRequirements Addressed
IERR-01: ExportedIngestErrorcarriesPath,Layer,Value, andErr;errors.Asextraction is tested.IERR-02: Hard ingest sites wrap underlying parser, transformer, numeric, and schema errors inIngestError; behavior matrix and AST guard coverage enforce this.IERR-03:gin-index experiment --on-error continuegroups failures by layer with structured samples in text and JSON output.Verification
.planning/phases/18-structured-ingesterror-cli-integration/18-VERIFICATION.mdreportsstatus: passedwith 16/16 must-haves verified.go test ./...make lintKey Decisions
IngestError.Valueis verbatim, not redacted or truncated by the library; callers own redaction and output-size policy.IngestError.