Skip to content

feat: pin the reference-client conformance profile and canary vectors - #3

Open
CompleteDotTech wants to merge 1 commit into
mainfrom
agent/issue-13-prove-psyche-build-as-the-first
Open

feat: pin the reference-client conformance profile and canary vectors#3
CompleteDotTech wants to merge 1 commit into
mainfrom
agent/issue-13-prove-psyche-build-as-the-first

Conversation

@CompleteDotTech

@CompleteDotTech CompleteDotTech commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Summary

Publish the pinned reference-client conformance artifact that issue OpenCoven#13 requires before Psyche Build can prove itself as the first conforming Psyche reference client, and record the adapter plan around it. This is the protocol repo's half of the "pinned conformance canary" delivery slice (cross-repository owner: OpenCoven/psyche-build#201; product-side mapping is at Stage 0 in psyche-build#253/#254). Slice 1 of the canary track — the artifact and its enforcement; Psyche Build adoption, lifecycle vectors, and the adapters remain (see below).

The pinned artifact lives in crates/psyche-core/tests/fixtures/reference-client/:

  • profile.v1.json — the profile manifest: freezes the v1 registry (sixteen kinds at supported major 1) and digest-pins every vector with its class and expected outcome. Profile digest sha256:0d4851e449f622f2ec27a3c0ec68c42b295ad25dc68234b42643e292fd76a934.
  • vectors/positive-*.json (6) — byte-exact copies of the proven canonical goldens (intent, graph node, surface event/effect, delivery, error envelope) that a reference client must accept, validate, and round-trip canonically (RFC 8785), with declared persistability (error envelopes are never persistable).
  • vectors/denial-*.json (8) — single deliberate mutations a reference client must reject and quarantine, covering exactly the failure modes the issue names:
    • unknown major (psyche.intent.v2) and incompatible downgrade (psyche.intent.v0) → UnsupportedMajor;
    • a product-local psyche.task.v1 kind → UnknownSchema (product-local pane/worktree/tmux/provider IDs cannot become protocol identity);
    • widening (deny_unknown_fields on a smuggled product-local ID) and stale correlation (effect moved, claimed digest did not) → InvalidShape;
    • raw product-local status and unknown error code → UnknownEnumValue;
    • an ambiguous duplicated key → InvalidShape at the strict-JSON boundary.

crates/psyche-core/tests/reference_client_canary.rs enforces the pin: any byte of drift in the profile (pinned by the PROFILE_SHA256 constant) or any vector (pinned inside the manifest) fails CI; the expected registry is derived from the code (RecordKind::ALL plus the non-persistable error kind) so the manifest cannot drift from the schema registry; each positive vector must decode, validate, round-trip canonically, and match its declared persistability; each denial vector must be rejected with its declared quarantine class through the public RejectedDocument path, producing authentic quarantine input.

docs/REFERENCE-CLIENT.md records the canary design (including where restart and dispatch-ambiguity canaries map onto the existing C-S6/C-S11/crash suites), the pinned adapter plan for Psyche Build with the proposed record mapping and identity-boundary rules, the migration/rollback requirements, and the acceptance-criteria status.

No existing behavior changes: the slice is additive (test artifact, enforcement test, docs). No new dependencies; sha2, serde, and serde_json are already psyche-core dependencies, so Cargo.lock is unchanged.

Issue

Refs OpenCoven#13. The issue stays open: acceptance criteria for Psyche Build CI adoption, the identity/lifecycle adapters, and the executable reference flow land in later slices tracked by OpenCoven/psyche-build#201.

Test plan

  • Independent local verification of the artifact: every JSON file parses; manifest digests recomputed and matched; profile digest matches the pinned test constant; positive vectors are byte-identical to the proven goldens; each denial vector is exactly the intended single mutation of its golden; manifest keys/outcome vocabulary match the test structs (node script, no cargo in this environment).
  • Formatting/width audit of the new Rust test against the workspace rustfmt policy (max_width 100), and a clippy-constraint review (no unwrap/expect outside the file-level allow, no nonminimal booleans, deny-unknown-fields symmetry with the manifest).
  • cargo fmt --all -- --check — deferred to CI (no Rust toolchain in the authoring environment).
  • cargo clippy --workspace --all-targets -- -D warnings — deferred to CI.
  • cargo test --workspace --locked (includes the new reference_client_canary target) — deferred to CI.
  • cargo deny check licenses advisories bans sources and secret scan — deferred to CI (no dependency or manifest changes).

Vehicle note: opened in the fork CompleteDotTech/psyche as the CI vehicle — this token cannot write to OpenCoven/psyche. Re-target upstream once write access is restored. Refs OpenCoven#13.

CI note: this repository has no CI checks: gh pr checks reported no checks for more than 10 minutes after opening, the commits API returns total_count: 0 check-runs for head c4e6a9a43d9637c5b6413e411ae668e8fc3ea67b, and the repository has zero workflow runs. Per the CI contract for a checkless repo, this PR proceeds without a green verdict; the diff would be exercised upstream by the existing .github/workflows/ci.yml (rustfmt, clippy, cargo test --workspace --locked including the new reference_client_canary target, cargo-deny, gitleaks).

Issue OpenCoven#13 asks Psyche Build to prove itself as the first conforming Psyche
reference client by pinning one immutable Psyche protocol artifact and
failing on unknown majors, widening, stale correlation, ambiguous effects,
and incompatible downgrades. The cross-repository mapping work is at Stage
0 in OpenCoven/psyche-build#253/#254; the protocol repo's contribution is
the artifact the adapter pins.

Publish that artifact: a reference-client profile manifest that freezes the
v1 registry (sixteen kinds at major 1) and digest-pins six positive vectors
(byte-exact copies of the proven canonical goldens) and eight denial vectors
(single deliberate mutations), plus an enforcement test. The test rejects
any byte of drift in the pinned profile or vectors, derives the expected
registry from the code, proves every positive vector decodes, validates,
round-trips canonically, and matches its declared persistability, and proves
every denial vector is rejected with the declared quarantine class through
the public RejectedDocument path. docs/REFERENCE-CLIENT.md records the pin,
the canary design, the pinned adapter plan, and the current state of the
issue.

Signed-off-by: Timothy Wayne Gregg <5861166+CompleteDotTech@users.noreply.github.com>
@CompleteDotTech CompleteDotTech self-assigned this Aug 30, 2026
@CompleteDotTech
CompleteDotTech marked this pull request as ready for review August 30, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant