Skip to content

incident-replay: reject unrecognized document objects before healthy classification #1373

Description

@erskingardner

Summary

AgentStateExport intentionally defaults every modeled field and ignores unknown fields for forward compatibility. Consequently, any valid top-level JSON object with no streamed t discriminator — including {} or an unrelated document such as a package.json fragment — parses as an empty export and the CLI reports healthy: 0 vectors with exit 0.

#1037 and #1140 close the concrete manifest-less NDJSON case by reserving top-level t, but they do not close this broader document-validity class.

Desired contract

Before classifying the document shape, require positive evidence that the object is an agent-state export, such as at least one recognized top-level key (events, derived_projections, or normalized_scenario_history). Preserve the current tolerance for unknown additional fields and future event kinds.

The exact marker set should be checked against the Goggles producer contract before implementation so valid sparse exports remain accepted.

Acceptance criteria

  • {} and unrelated top-level objects fail parsing and cannot print a healthy verdict.
  • Valid sparse/current agent-state exports continue to parse.
  • Unknown additional top-level fields remain tolerated.
  • An executable CLI regression proves unrecognized document objects exit 2 rather than reporting healthy: 0 vectors.

Relationship

Follow-up to #1037 / #1140; intentionally separate so the narrow streamed-format fix remains surgical.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions