Skip to content

PTD-23.1.4: Harden portable Python binding contracts - #149

Merged
omry merged 1 commit into
pr147from
pr149
Sep 15, 2026
Merged

omry merged 1 commit into
pr147from
pr149

Conversation

@omry

@omry omry commented Sep 14, 2026

Copy link
Copy Markdown
Owner

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T20:10:17.271932Z dd10177 Manual request
🔒 Security Review Completed 2026-09-14T13:06:00.134603Z f282028 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.

@omry
omry changed the base branch from main to pr147 September 14, 2026 12:57
@omry
omry added this pull request to stack #151 September 14, 2026 13:00
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

for _, artifact := range artifacts {
matches, err := pythonprovider.PythonRequiresPythonCoversClaimV1(artifact.RequiresPython, claim)
if err != nil {
return fmt.Errorf("artifact %q requires_python is invalid: %w", artifact.ID, err)
}
covered = covered || matches

P2 Badge Enforce one artifact per schema-v1 binding

When a target lists multiple artifacts, this per-claim OR permits one artifact to cover Python 3.11 and another to cover 3.12. The schema-v1 contract added in docs/PORTABLE_TOOL_DEFINITION_IMPLEMENTATION_PLAN.md states that each binding and target platform selects exactly one artifact, while target validation still merely requires a nonempty list; consequently an invalid closure passes composition and leaves the later singular binding projection ambiguous. Reject artifact lists whose length is not exactly one rather than aggregating their coverage.


contractSegments := strings.Split(contract.ID, "/")
if len(contractSegments) != 6 || contractSegments[3] != "bindings" ||
validatePortableRecordIdentifier("binding", contractSegments[4]) != nil || contractSegments[5] != "contract" {

P2 Badge Validate the release namespace in binding references

For a pair such as tool:demo/foo/bar/bindings/python/contract and the corresponding artifact path, the generic ID validation succeeds and these checks return nil because they inspect only segments 3 onward. This contradicts the helper's canonical-reference contract and can allow projected references outside /releases/<encoded-version>/; check segment 1 and validate segment 2 here, as ValidateBindingArtifactReferencePlatformV1 already does.

ℹ️ 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".

@omry

omry commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

PR-cycle state — maintained automatically. Do not edit by hand.

Mechanical PR-cycle state (JSON)
{
  "approval": {
    "candidate_revision_fingerprint": "sha256:b593183cc11bea943e65d0d1cfd43f9d9d2cd4f0790c1db127a23d10a6af19e3",
    "evidence": {
      "attestations": [],
      "candidate_revision_fingerprint": "sha256:b593183cc11bea943e65d0d1cfd43f9d9d2cd4f0790c1db127a23d10a6af19e3",
      "check_conclusions": [],
      "delivery_deferral_ledger_digest": "sha256:4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945",
      "finding_dispositions_digest": "sha256:72456ace86c27bb1bb1e2cd702fe6900543285dc9e0b5cff0c1b7e11fc86faf2",
      "operation_identity": "sha256:da4208dcd9f57e6f63f366bb2598f6ff3193ad3e619f513c46554f49c3899494",
      "review_request": {
        "body_digest": "sha256:e352cfa875e4286cbee33e7c3f951b8022b9c5fcc73edfeeb2214c461b84d375",
        "id": 5670082011
      },
      "review_result": {
        "body_digest": "sha256:a5f781e3471d75f49a1a802886c2cf62aeb8f0f3d9c76252e0317384ea79679d",
        "id": 5670132471
      }
    },
    "evidence_fingerprint": "sha256:f717eae48dbeaf478dddcf83547d6fdba25e6f506b0e4340ca2e71a3b4f1140f",
    "head_sha": "dd10177e7a1b5f46ddd54e7b93b24cbaddef6d05",
    "operation_identity": "sha256:da4208dcd9f57e6f63f366bb2598f6ff3193ad3e619f513c46554f49c3899494",
    "review_request_id": 5670082011,
    "review_result_id": 5670132471,
    "status": "approved-evidence-recorded"
  },
  "candidate_revision_fingerprint": "sha256:b593183cc11bea943e65d0d1cfd43f9d9d2cd4f0790c1db127a23d10a6af19e3",
  "check_conclusions": [],
  "check_observations": [
    {
      "checks": [],
      "head_sha": "dd10177e7a1b5f46ddd54e7b93b24cbaddef6d05",
      "id": "sha256:7eab46536997cfecface9e442f834efdd06cbcef1303110b78c466fc8cc5a50c",
      "required_checks": [],
      "status": "success"
    },
    {
      "checks": [],
      "head_sha": "f2820285cfbc5b2d81271c28c536bdf210a30e54",
      "id": "sha256:91c0839bd31a9de0005b479357753f973b23236121ecdb550a74da07ba0d8d1b",
      "required_checks": [],
      "status": "success"
    }
  ],
  "delivery_deferral_ledger_digest": "sha256:4f53cda18c2baa0c0354bb5f9a3ecbe5ed12ab4d8e11ba873c2f11161202b945",
  "delivery_deferrals": [],
  "findings": [
    {
      "discussion_url": "https://github.com/omry/reploy/pull/149#discussion_r4005607720",
      "disposition": "accepted",
      "id": "ptd2314-contract-hardening-changelog",
      "invariant": "User-visible resolution behavior changes carry a Changie fragment under .changes/unreleased.",
      "line": 82,
      "path": "internal/portabletool/python.go",
      "proposed_fix_paths": [
        ".changes/unreleased/+portable-python-root-compatibility.yaml"
      ],
      "rationale": "PR #149 independently changes rejection behavior for conflicting prerelease, local, arbitrary-equality, and internally contradictory roots. Its release-note fragment belongs with this prerequisite slice rather than relying on the descendant projection PR.",
      "severity": "P2",
      "status": "current-slice",
      "thread_id": "PRRT_kwDOTFQCkM6iH9Pg",
      "title": "Add a changelog fragment for shared compatibility hardening"
    },
    {
      "discussion_url": "https://github.com/omry/reploy/pull/149#discussion_r4005607709",
      "disposition": "accepted",
      "id": "ptd2314-single-root-self-contradiction",
      "invariant": "Every admitted direct Python package-root requirement must have a nonempty PEP 440 intersection, including contradictions contained inside one canonical requirement string.",
      "line": 105,
      "path": "internal/portabletool/python.go",
      "proposed_fix_paths": [
        "internal/portabletool/python.go",
        "internal/providers/python/package_request_test.go"
      ],
      "rationale": "The current unique-root fast path validates spelling but skips the requirement's internal conjunction, so an impossible sole requirement such as demo>=3,<3 reaches later resolution. The compatibility helper already owns this fail-closed proof and should retain acceptance of satisfiable prerelease and epoch ranges while rejecting self-contradictory ones.",
      "severity": "P2",
      "status": "current-slice",
      "thread_id": "PRRT_kwDOTFQCkM6iH9PY",
      "title": "Check contradictions inside a sole package-root requirement"
    }
  ],
  "pr": {
    "base_ref": "pr147",
    "base_sha": "ed41a7e6786e3089c76cd7c94ad921cdb7100d36",
    "body_digest": "sha256:c4e675006d5073d90908cde13f43176fc1b47dd459c0e04f04d0c5ad62d38aea",
    "diff_digest": "sha256:92fd3eb86150621eab6531877fb957cb74ea82543615496872d8e7791c8a06b0",
    "head_ref": "pr149",
    "head_sha": "dd10177e7a1b5f46ddd54e7b93b24cbaddef6d05",
    "pr": 149,
    "repository": "omry/reploy",
    "scope_authority": [],
    "title_digest": "sha256:a4da62eaa2f7f1658da3afc8a320bec79e28e6ea32d6bf98861b8b185ace6cff"
  },
  "record_version": 7,
  "review_observations": [],
  "review_requests": [
    {
      "base_established_at": "2026-09-14T12:57:54Z",
      "base_ref": "pr147",
      "base_sha": "ed41a7e6786e3089c76cd7c94ad921cdb7100d36",
      "body_digest": "sha256:534f9234a311fc7fffd0edb7d654167f886f18723f7e509a10875cdc5b0f36ff",
      "created_at": "2026-09-14T13:19:52Z",
      "head_sha": "f2820285cfbc5b2d81271c28c536bdf210a30e54",
      "id": 5664621922,
      "kind": "regular-review"
    },
    {
      "base_established_at": "2026-09-14T12:57:54Z",
      "base_ref": "pr147",
      "base_sha": "ed41a7e6786e3089c76cd7c94ad921cdb7100d36",
      "body_digest": "sha256:e352cfa875e4286cbee33e7c3f951b8022b9c5fcc73edfeeb2214c461b84d375",
      "created_at": "2026-09-14T20:06:12Z",
      "head_sha": "dd10177e7a1b5f46ddd54e7b93b24cbaddef6d05",
      "id": 5670082011,
      "kind": "regular-review"
    }
  ],
  "review_results": [
    {
      "base_ref": "pr147",
      "base_sha": "ed41a7e6786e3089c76cd7c94ad921cdb7100d36",
      "body_digest": "sha256:66d799368994d079aa84188c064b3906161e3705bdb14e83db46f2a5fa7c55a8",
      "commit_id": "f2820285cfbc5b2d81271c28c536bdf210a30e54",
      "id": 5198199785,
      "inline_message_ids": [
        4005607709,
        4005607720
      ],
      "request_comment_id": 5664621922,
      "result_kind": "findings",
      "status": "result",
      "submitted_at": "2026-09-14T13:22:47Z",
      "unresolved_thread_ids": [
        "PRRT_kwDOTFQCkM6iH9PY",
        "PRRT_kwDOTFQCkM6iH9Pg"
      ]
    },
    {
      "base_ref": "pr147",
      "base_sha": "ed41a7e6786e3089c76cd7c94ad921cdb7100d36",
      "body_digest": "sha256:a5f781e3471d75f49a1a802886c2cf62aeb8f0f3d9c76252e0317384ea79679d",
      "commit_id": "dd10177e7a1b5f46ddd54e7b93b24cbaddef6d05",
      "id": 5670132471,
      "inline_message_ids": [],
      "request_comment_id": 5670082011,
      "result_kind": "clean",
      "status": "result",
      "submitted_at": "2026-09-14T20:10:16Z",
      "unresolved_thread_ids": []
    }
  ],
  "revision_fingerprint": "sha256:b593183cc11bea943e65d0d1cfd43f9d9d2cd4f0790c1db127a23d10a6af19e3",
  "rounds": [
    {
      "applied_fix_paths": [
        ".changes/unreleased/+portable-python-root-compatibility.yaml",
        "internal/portabletool/python.go",
        "internal/portabletool/record_validate.go",
        "internal/portabletool/record_validate_test.go",
        "internal/providers/portable_tool_dag.go",
        "internal/providers/portable_tool_dag_test.go",
        "internal/providers/python/package_request.go",
        "internal/providers/python/package_request_test.go",
        "internal/toolcatalog/solver.go",
        "internal/toolcatalog/solver_test.go"
      ],
      "disposition_changes": [],
      "effective_diff_digest": "sha256:92fd3eb86150621eab6531877fb957cb74ea82543615496872d8e7791c8a06b0",
      "finding_ids": [
        "ptd2314-single-root-self-contradiction",
        "ptd2314-contract-hardening-changelog"
      ],
      "invariants": [
        "Every admitted direct Python package-root requirement has a nonempty PEP 440 intersection, including contradictions inside one canonical requirement string.",
        "User-visible portable Python compatibility behavior carries a Changie fragment in the slice that changes it.",
        "The shared portable Python compatibility boundary fails closed under bounded work for malformed, contradictory, and unsupported claims."
      ],
      "outcome": "corrected-head-needs-review",
      "proposed_fix_paths": [
        ".changes/unreleased/+portable-python-root-compatibility.yaml",
        "internal/portabletool/python.go",
        "internal/providers/python/package_request_test.go"
      ],
      "resulting_head": "dd10177e7a1b5f46ddd54e7b93b24cbaddef6d05",
      "review_observation_id": null,
      "review_request_id": 5664621922,
      "review_result_id": 5198199785,
      "reviewed_head": "f2820285cfbc5b2d81271c28c536bdf210a30e54",
      "root_cause": "The original fast path treated a single canonical package-root string as inherently satisfiable and the slice did not yet carry its own user-facing release note. Correcting those findings exposed adjacent fail-closed and bounded-work invariants in the same shared compatibility boundary; the mandated local deep-review loop fixed and validated them before this synchronized head was presented for another PR review.",
      "round": 1,
      "unresolved_current_slice_findings": 0,
      "unresolved_design_blockers": 0
    },
    {
      "applied_fix_paths": [],
      "disposition_changes": [],
      "effective_diff_digest": "sha256:92fd3eb86150621eab6531877fb957cb74ea82543615496872d8e7791c8a06b0",
      "finding_ids": [],
      "invariants": [
        "Every admitted direct Python package-root requirement has a nonempty PEP 440 intersection.",
        "Portable Python compatibility validation fails closed under bounded work.",
        "User-visible compatibility behavior carries its release-note fragment in this slice."
      ],
      "outcome": "clean",
      "proposed_fix_paths": [],
      "resulting_head": "dd10177e7a1b5f46ddd54e7b93b24cbaddef6d05",
      "review_observation_id": null,
      "review_request_id": 5670082011,
      "review_result_id": 5670132471,
      "reviewed_head": "dd10177e7a1b5f46ddd54e7b93b24cbaddef6d05",
      "root_cause": null,
      "round": 2,
      "unresolved_current_slice_findings": 0,
      "unresolved_design_blockers": 0
    }
  ],
  "schema": "awd:swe:pr-cycle-state",
  "version": 2
}

@omry

omry commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

@codex, regular review f282028

@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: f2820285cf

ℹ️ 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 internal/portabletool/python.go Outdated
Comment thread internal/portabletool/python.go
Expose strict shared binding-record helpers and fail-closed PEP 440 compatibility checks.

Accept single and byte-identical prerelease or epoch dependency roots across projection, DAG, and solver paths while retaining conflict rejection.
@gitar-bot

gitar-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Hardens portable Python binding contracts by exposing strict shared binding-record helpers and implementing fail-closed PEP 440 compatibility checks. Accepts single and byte-identical prerelease or epoch dependency roots across projection, DAG, and solver paths while retaining conflict rejection. No issues found.

Review coverage

Rules No rules evaluated

Functional validation Not enabled · Set up

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@omry

omry commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

@codex, regular review dd10177

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: dd10177e7a

ℹ️ 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".

@omry omry added the approved PR reviewed and approved label Sep 14, 2026
@omry
omry merged commit 12c28dd into main Sep 15, 2026
8 checks passed
@omry
omry deleted the pr149 branch September 15, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved PR reviewed and approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant