Skip to content

Add upstream HTML contract fixtures and parser-drift diagnostics #6

Description

@unes07

Problem

Fertimap responses do not expose a stable structured contract, so an HTML change can silently remove optional product or cost data. Current inline fixtures do not cover enough upstream variants or provide explicit drift diagnostics.

Proposed work

  • Store sanitized fixtures for generic-formula, regional-formula, missing-section, malformed-line, encoding, and changed-markup responses.
  • Add structured parser warnings containing the affected section, raw line or selector context, and reason.
  • Preserve raw upstream text for any partially parsed recommendation.
  • Keep valid N/P/K results available when an optional recommendation section changes.

Acceptance criteria

  • Contract tests exercise every stored response variant.
  • Optional-section drift produces warnings instead of silently dropping data.
  • Parser warnings survive Python, JSON, CSV, and batch outputs.
  • Existing valid recommendation behavior remains backward compatible.
  • Fixtures contain no personal or confidential data.

Related to #1, #2, and #3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions