Skip to content

Capture real UserPromptSubmit stdin fixture per #664 §8.7 #672

Description

@michael-wojcik

Problem

pact-plugin/tests/fixtures/userpromptsubmit_stdin_post_bootstrap.json is a synthetic placeholder fixture for the bootstrap_marker_writer.py writer's stdin shape. PR #671 (which closed #664) shipped this synthetic fixture per architect §8.7 with a TODO(#NNN) placeholder comment, deferring real-fixture capture to a follow-up.

The synthetic fixture matches the architect-documented platform schema and exercises the writer's parser correctly, but it cannot verify production-shape parity. The wake_lifecycle_emitter precedent (#612 / #638) is the cautionary tale: synthetic fixtures missed the real-world stdin shape divergence.

Capture procedure (architect §8.7)

  1. Cut a separate scratch branch off main (capture-only — does not merge).
  2. Add a logging shim to bootstrap_marker_writer.py source that writes stdin JSON to a fixture file before normal handling.
  3. Run a fresh-startup PACT session through bootstrap (Steps 1-4 + first real user prompt). The shim captures the actual UserPromptSubmit stdin shape.
  4. Save the captured JSON as pact-plugin/tests/fixtures/userpromptsubmit_stdin_post_bootstrap.json, overwriting the synthetic placeholder.
  5. Remove the shim from the source.
  6. Open a small PR replacing the synthetic fixture with the captured one. Substitute the TODO(#NNN) placeholder in the fixture's _comment field with this issue's number.

Why this matters

Acceptance

  • Captured fixture replaces the synthetic placeholder.
  • TODO(#NNN) placeholder in fixture comment substituted with this issue number.
  • Existing fixture-load tests continue to pass against the captured shape.
  • Follow-up PR notes the capture procedure used so future re-captures can repeat it.

Out of scope: re-capturing on every plugin version bump (only re-capture when suite failure suggests stdin-shape drift, same as wake_lifecycle_emitter precedent).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions