checker-sdk-go/checker
Pierre-Olivier Mercier 7567271536 checker: cross-checker observation composition via ReportContext
Add the plumbing that lets a checker receive (at evaluation, report
rendering, and metrics extraction) observations produced by other
checkers on DiscoveryEntry records it originally published.

Surface changes:

  - RelatedObservation struct: one downstream observation, tagged with
    the producing CheckerID and the Ref matching the DiscoveryEntry
    it covers.

  - ObservationGetter gains GetRelated(ctx, key), so rules can opt in
    to cross-checker composition. mapObservationGetter (remote
    /evaluate path) returns empty; the host owns lineage resolution.

  - ReportContext interface: Data() + Related(key). Reporters consume
    it instead of a raw json.RawMessage, which collapses the former
    legacy/Ctx duplicate and gives one uniform signature:

        GetHTMLReport(ctx ReportContext) (string, error)
        ExtractMetrics(ctx ReportContext, t time.Time) ([]CheckMetric, error)

  - NewReportContext(data, related) and StaticReportContext(data) build
    fixed-payload contexts for entry points without an ObservationContext.

  - ExternalReportRequest gains a Related map so the host can ship
    pre-composed lineage to a remote checker over /report. The SDK's
    /report handler threads it through to the reporter via
    NewReportContext, closing the wire gap that previously forced
    remote reports to a StaticReportContext with no related data.

Tests cover the Related map round-trip end-to-end via a peeking provider.
2026-04-22 16:50:59 +07:00
..
options.go Initial commit 2026-04-08 00:53:15 +07:00
options_test.go tests: add coverage for options, types, and HTTP server 2026-04-10 16:35:50 +07:00
registry.go registry: reject checker registration with empty ID 2026-04-10 16:24:39 +07:00
registry_test.go tests: add coverage for options, types, and HTTP server 2026-04-10 16:35:50 +07:00
server.go checker: cross-checker observation composition via ReportContext 2026-04-22 16:50:59 +07:00
server_test.go checker: cross-checker observation composition via ReportContext 2026-04-22 16:50:59 +07:00
types.go checker: cross-checker observation composition via ReportContext 2026-04-22 16:50:59 +07:00
types_test.go Revert "checker: reorder Status with negatives for good, JSON as string" 2026-04-16 00:50:23 +07:00