Skip to content

feat(verification): native receipts bind each check to the artifact digest it ran (#730) - #948

Open
cdeust wants to merge 1 commit into
mainfrom
fix/730-native-receipt-schema
Open

cdeust wants to merge 1 commit into
mainfrom
fix/730-native-receipt-schema

Conversation

@cdeust

@cdeust cdeust commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Summary

Refs #730 (tranche 2 ; l'issue reste ouverte).

Cause racine : les reçus natifs commités ne lient pas chaque check à l'artefact qui l'a exécuté. Le reçu v4.23.4 nomme une version, le reçu de handoff du 2026-09-22 n'en nomme aucune : un check mesuré sur un checkout source pouvait être lu comme preuve de support pour une wheel distribuée (docs/audits/platform-support-matrix-2026-11-05.md, tranche restante 1).

Changement : scripts/native_receipt.py valide le schéma cortex-native-receipt/1 :

  • artifact reprend l'identité que calcule cortex doctor (mcp_server/doctor_artifact.py) : kind (wheel / source-tree), version, revision, modified, members_digest ;
  • chaque check porte host et artifact_digest. Le digest doit être égal à artifact.members_digest et l'hôte doit figurer dans hosts, donc un reçu ne peut pas fusionner des checks lancés sur deux artefacts ou deux hôtes ;
  • le rapport CLI dit si le reçu est une preuve distribuée (wheel non modifiée) ou une preuve source, et quels parcours exigés par test: gate platform support claims with native Claude and Codex journey receipts #730 sont passés, échoués ou absents.

Tranches restantes de #730 : le gate qui refuse une affirmation de support sans reçu courant de ce schéma, puis les reçus natifs des cellules — (Windows, macOS x86_64, .mcpb).

Type of change

  • New feature (non-breaking change which adds functionality)

Test plan

  • pytest tests_py/scripts/test_native_receipt.py : 13 passed.
  • ruff check et ruff format --check sur les fichiers touchés : propres. python scripts/check_craftsmanship.py : OK. python scripts/check_doc_claims.py : code de sortie 0.

Non vérifié : la suite complète en local (l'environnement n'a pas pu télécharger torch, donc seules les dépendances de ces tests sont installées). Aucun reçu existant n'est converti au nouveau schéma, faute d'un members_digest enregistré dans ces reçus.

Audit notes

Identifiants de checks exigés repris des critères d'acceptation 2 à 4 de #730. Le schéma s'appuie sur le digest de #729, sans le modifier.

Coding-standards compliance

  • Fichiers < 300 lignes, fonctions < 40 lignes, # source: sur chaque constante (gate craftsmanship OK).
  • Aucune modification de couche de production : un script et ses tests.

Breaking changes

Aucun.

Reviewer checklist

  • CHANGELOG.md mis à jour (Added).
  • Pas de secret dans le diff.
  • CI sur le dernier commit (en cours à l'ouverture).

Generated by Claude Code

…igest it ran (#730)

scripts/native_receipt.py validates the cortex-native-receipt/1 schema: every
check names the host that ran it and the members_digest of the artifact it ran,
which must equal the receipt's artifact digest (the one `cortex doctor`
reports). A receipt can no longer merge checks from two artifacts or hosts, and
the report separates distributed evidence (unmodified wheel) from source
evidence and lists which of #730's required journeys passed, failed or lack a
check. Slice 2 of #730; the claim gate is the next slice.

Refs #730

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018kyZYroeZLnMzE7EWCVCWK
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T14:33:17.769521Z 7b4aba2 PR opened
🔒 Security Review ✅ Completed 2026-11-07T14:34:49.985342Z 7b4aba2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Claude encountered an error after 1m 28s —— View job


PR #948 review (1 of 3)

  • Read the diff
  • Run the five reviews (quality, docs, security, performance, tests)
  • Check the findings and post the verdict

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7b4aba2d89

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/native_receipt.py
Comment on lines +124 to +127
for section, keys in _FIELDS.items():
errors += _missing(section, receipt.get(section), keys)
if "backend" not in receipt:
errors.append("backend: missing")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate receipt metadata values, not just key presence

A receipt with null for artifact.version, every platform field, backend, and both host fields still passes validation when the check also uses host: null. With a valid digest and modified: false, the CLI then reports distributed evidence and passed journeys despite identifying neither the release nor the platform or host being qualified. _missing only checks whether keys exist, and these fields receive no subsequent value validation. Require appropriately typed, non-empty metadata before accepting the receipt so unknown support cells cannot be reported as valid evidence.

Useful? React with 👍 / 👎.

Comment thread scripts/native_receipt.py
Comment on lines +102 to +103
if not str(check["evidence"]).strip():
errors.append(f"{where}.evidence: empty")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject missing evidence instead of stringifying it

For an otherwise valid receipt, evidence: null passes this check because str(None) is the non-empty string "None"; empty JSON arrays and objects likewise pass. Consequently, the CLI reports a journey as passed even though the receipt contains no evidence for it. Validate the evidence value itself and reject null or empty evidence rather than treating its Python string representation as proof.

Useful? React with 👍 / 👎.

Comment thread scripts/native_receipt.py
Comment on lines +113 to +114
names = {h["name"] for h in hosts if isinstance(h, dict) and "name" in h}
return names, errors

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject duplicate host names with ambiguous versions

When hosts contains the same name with different versions—for example, Claude Code 2.1.280 and 2.1.306—the set comprehension silently collapses both entries and validation succeeds. Since each check references only the host name, a passed check can no longer be attributed to either installed version, leaving the receipt ambiguous about which support combination was actually measured. Reject duplicate host names or give host entries unique identifiers that checks must reference.

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
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.

2 participants