Skip to content

P1: Add Hosted QA run projection and digest-sensitive ingestion receipts #635

Description

@wanghuan-520

What needs doing

Add a stable, pointer-only Testing Packages → Hosted QA Run projection and digest-sensitive ingestion receipt contract.

The current aggregate GitHub/filesystem report is a publication artifact, not a Hosted ingestion boundary. Hosted must be able to ingest immutable plan/result/evidence/lifecycle facts without reading internal Lua artifacts or interpreting GitHub comment text. This repository owns the projection and adapter contract, not the Hosted server implementation.

Dependencies

Foundation depends on:

Final production fixtures depend on:

Do not route this issue to FKST until the relevant foundations are merged. The interface/schema portion may be prepared earlier only if it does not guess unfinished result or PQL shapes.

Required implementation

Define hosted.qa-run-projection.v1 with pointer-only fields for:

  • projection ID, idempotency key, trace ID, and dedup key;
  • repository identity and exact commit;
  • ProjectPackSnapshot/TestCaseAsset/Requirement lineage;
  • execution status/modes/counts;
  • StructuredPlan ref/digest;
  • CaseResultSet ref/digest;
  • EvidenceManifest ref/digest;
  • environment and cleanup receipt refs/digests;
  • aggregate report ref/digest;
  • residual risks;
  • defect publication refs;
  • artifact root and completion timestamps.

Define hosted.qa-run-ingestion-receipt.v1 with:

  • projection ID and projection digest;
  • idempotency key;
  • accepted, replayed, or rejected status;
  • Hosted Run ID and optional canonical URL;
  • ingestion timestamp;
  • bounded validation/error code;
  • original accepted identity for replay.

Add a Hosted adapter interface/test double that proves:

  • same idempotency key + same projection digest replays the original receipt;
  • same key + different digest fails closed;
  • rejected projections do not mutate accepted identity;
  • transport/provider errors are separate from validation rejection;
  • Hosted ingestion and GitHub/filesystem publication can be retried/repaired independently.

Likely files

  • libraries/contract/**
  • contracts/**
  • a narrow Hosted adapter package/library following existing runtime-port conventions
  • packages/test-publication/** only for decoupling publication from ingestion
  • cross-repo fixtures and Generic Host tests

Out of scope

  • Implementing the Hosted server/API or durable Run store.
  • Uploading Artifact bytes.
  • Computing QualityEvaluation or ReportRecord.
  • Implementing NyxID transport.
  • Replacing GitHub publication.

Acceptance criteria

  • Both versioned contracts are closed, bounded, documented, and validated.
  • Projection identity binds Plan, ResultSet, EvidenceManifest, environment, cleanup, aggregate report, and PQL lineage digests.
  • Same-key/same-digest replay returns the original receipt.
  • Same-key/different-digest conflict fails closed.
  • Receipt replay cannot point to a different Hosted Run.
  • Hosted adapter transport failure is distinguishable from validation rejection.
  • GitHub publication failure does not prevent Hosted ingestion replay; Hosted failure does not repeat GitHub publication.
  • Cross-repo fixtures can be consumed by fkst-hosted without importing internal Lua modules.
  • No projection contains raw evidence bytes, credentials, cookies, headers, environments, argv, or absolute local paths.
  • Focused contract/adapter tests pass.
  • scripts/run.sh check passes.
  • Full scripts/run.sh test passes, or an exact unrelated failure and targeted rerun are reported.

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