Skip to content

test: compile schema provider obligations - #344

Merged
Sinity merged 1 commit into
masterfrom
feature/test/schema-provider-obligations
Apr 22, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/test/schema-provider-obligations

Conversation

@Sinity

@Sinity Sinity commented Apr 22, 2026 •

Copy link
Copy Markdown
Owner

Closes #332

Summary

  • Add typed provider capability metadata for codex, claude-code, and chatgpt.
  • Compile provider capability subjects into the proof catalog and bind identity/partial-coverage claims.
  • Translate x-polylogue-values into JSON Schema enum for schema-driven Hypothesis generation.
  • Add evidence runners and tests proving schema value generation and provider capability obligations.

Problem

Schema annotations and provider semantics were still partly outside the proof-obligation vocabulary. The catalog had initial schema annotation subjects, but provider capability semantics were not typed subjects, and schema_conformant_payload() stripped x-polylogue-* metadata before Hypothesis generation could use it.

Solution

  • Added polylogue/lib/provider_capabilities.py as the substrate record for provider capability facts and native-to-canonical identity mappings.
  • Added provider.capability.* subjects in polylogue/proof/subjects.py.
  • Added provider.capability.identity_bridge and provider.capability.partial_coverage_declared claims plus static runner bindings in polylogue/proof/catalog.py.
  • Added provider capability rendering to docs/verification-catalog.md.
  • Added proof runners for schema value-generation closure and provider capability metadata checks in polylogue/proof/runners.py.
  • Updated tests/infra/strategies/schema_driven.py so x-polylogue-values drives generation as JSON Schema enum before the extension key is stripped.

Verification

pytest -q -n 0 tests/unit/proof tests/unit/sources/test_schema_driven.py
ruff check polylogue/lib/provider_capabilities.py polylogue/proof tests/unit/proof tests/unit/sources/test_schema_driven.py tests/infra/strategies/schema_driven.py
mypy polylogue/lib/provider_capabilities.py polylogue/proof tests/unit/proof/test_schema_provider_obligations.py tests/infra/strategies/schema_driven.py
devtools render-all --check
pytest -q -n 0 tests/unit/sources/test_parser_crashlessness.py tests/property/test_schema_roundtrip.py tests/property/test_semantic_properties.py
devtools verify --quick
devtools verify
git push -u origin feature/test/schema-provider-obligations

The push hook reran devtools verify --quick successfully.

@coderabbitai

coderabbitai Bot commented Apr 22, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 42 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 5 minutes and 42 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2b5b2b3e-ee5c-4fbd-85fa-277e2214ac53

📥 Commits

Reviewing files that changed from the base of the PR and between 1a6f9a3 and 3f677dc.

📒 Files selected for processing (10)
  • docs/verification-catalog.md
  • polylogue/lib/provider_capabilities.py
  • polylogue/proof/catalog.py
  • polylogue/proof/rendering.py
  • polylogue/proof/runners.py
  • polylogue/proof/subjects.py
  • tests/infra/strategies/schema_driven.py
  • tests/unit/proof/test_catalog.py
  • tests/unit/proof/test_schema_provider_obligations.py
  • tests/unit/sources/test_schema_driven.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/test/schema-provider-obligations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit 531d5ca into master Apr 22, 2026
13 checks passed
@Sinity
Sinity deleted the feature/test/schema-provider-obligations branch April 22, 2026 03:55

@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: 3f677dc9b2

ℹ️ 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 on lines +36 to +38
enum_values = _polylogue_value_enum(schema)
if enum_values and "enum" not in cleaned:
cleaned["enum"] = enum_values

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 Restrict enum injection to type-compatible schema nodes

strip_schema_extensions() now adds enum to every object containing x-polylogue-values, but annotations are also present on non-scalar combinator branches. In the current codex schema (polylogue/schemas/providers/codex/versions/v1/elements/conversation_record_stream.schema.json.gz), $.properties.payload.properties.source.anyOf[1] is type: object with x-polylogue-values: ["cli"]; this logic turns that branch into type: object + enum: ["cli"], which is unsatisfiable and prevents generation of that object variant. That silently reduces schema-driven crashlessness coverage and can hide parser defects in now-unreachable branches.

Useful? React with 👍 / 👎.

Comment thread polylogue/proof/runners.py Resolved
Sinity added a commit that referenced this pull request Apr 22, 2026
Closes #332

## Summary

- Add typed provider capability metadata for `codex`, `claude-code`, and `chatgpt`.
- Compile provider capability subjects into the proof catalog and bind identity/partial-coverage claims.
- Translate `x-polylogue-values` into JSON Schema `enum` for schema-driven Hypothesis generation.
- Add evidence runners and tests proving schema value generation and provider capability obligations.

## Problem

Schema annotations and provider semantics were still partly outside the proof-obligation vocabulary. The catalog had initial schema annotation subjects, but provider capability semantics were not typed subjects, and `schema_conformant_payload()` stripped `x-polylogue-*` metadata before Hypothesis generation could use it.

## Solution

- Added `polylogue/lib/provider_capabilities.py` as the substrate record for provider capability facts and native-to-canonical identity mappings.
- Added `provider.capability.*` subjects in `polylogue/proof/subjects.py`.
- Added `provider.capability.identity_bridge` and `provider.capability.partial_coverage_declared` claims plus static runner bindings in `polylogue/proof/catalog.py`.
- Added provider capability rendering to `docs/verification-catalog.md`.
- Added proof runners for schema value-generation closure and provider capability metadata checks in `polylogue/proof/runners.py`.
- Updated `tests/infra/strategies/schema_driven.py` so `x-polylogue-values` drives generation as JSON Schema `enum` before the extension key is stripped.

## Verification

```text
pytest -q -n 0 tests/unit/proof tests/unit/sources/test_schema_driven.py
ruff check polylogue/lib/provider_capabilities.py polylogue/proof tests/unit/proof tests/unit/sources/test_schema_driven.py tests/infra/strategies/schema_driven.py
mypy polylogue/lib/provider_capabilities.py polylogue/proof tests/unit/proof/test_schema_provider_obligations.py tests/infra/strategies/schema_driven.py
devtools render-all --check
pytest -q -n 0 tests/unit/sources/test_parser_crashlessness.py tests/property/test_schema_roundtrip.py tests/property/test_semantic_properties.py
devtools verify --quick
devtools verify
git push -u origin feature/test/schema-provider-obligations
```

The push hook reran `devtools verify --quick` successfully.
Sinity added a commit that referenced this pull request Apr 22, 2026
Schema annotations and provider semantics were still partly outside
the proof-obligation vocabulary. The catalog had initial schema
annotation subjects, but provider capability semantics weren't
typed subjects, and `schema_conformant_payload()` stripped
`x-polylogue-*` metadata before Hypothesis generation could use it.

Adds `lib/provider_capabilities.py` as the substrate record for
provider capability facts and native-to-canonical identity
mappings for `codex`, `claude-code`, and `chatgpt`. Adds
`provider.capability.*` subjects in `proof/subjects.py`, plus
`provider.capability.identity_bridge` and
`provider.capability.partial_coverage_declared` claims with static
runner bindings in `proof/catalog.py`. Adds provider capability
rendering to `docs/verification-catalog.md` and proof runners for
schema value-generation closure and provider capability metadata
checks in `proof/runners.py`. Updates
`tests/infra/strategies/schema_driven.py` so `x-polylogue-values`
drives generation as JSON Schema `enum` before the extension key
is stripped.

Verification: ruff + mypy + pytest over proof, schema-driven,
parser-crashlessness, schema-roundtrip, and semantic-properties
suites; devtools render-all --check, verify and --quick green.

Closes #332
Sinity added a commit that referenced this pull request Apr 22, 2026
Schema annotations and provider semantics were still partly outside
the proof-obligation vocabulary. The catalog had initial schema
annotation subjects, but provider capability semantics weren't
typed subjects, and `schema_conformant_payload()` stripped
`x-polylogue-*` metadata before Hypothesis generation could use it.

Adds `lib/provider_capabilities.py` as the substrate record for
provider capability facts and native-to-canonical identity
mappings for `codex`, `claude-code`, and `chatgpt`. Adds
`provider.capability.*` subjects in `proof/subjects.py`, plus
`provider.capability.identity_bridge` and
`provider.capability.partial_coverage_declared` claims with static
runner bindings in `proof/catalog.py`. Adds provider capability
rendering to `docs/verification-catalog.md` and proof runners for
schema value-generation closure and provider capability metadata
checks in `proof/runners.py`. Updates
`tests/infra/strategies/schema_driven.py` so `x-polylogue-values`
drives generation as JSON Schema `enum` before the extension key
is stripped.

Verification: ruff + mypy + pytest over proof, schema-driven,
parser-crashlessness, schema-roundtrip, and semantic-properties
suites; devtools render-all --check, verify and --quick green.

Closes #332
Sinity added a commit that referenced this pull request Apr 22, 2026
Schema annotations and provider semantics were still partly outside
the proof-obligation vocabulary. The catalog had initial schema
annotation subjects, but provider capability semantics weren't
typed subjects, and `schema_conformant_payload()` stripped
`x-polylogue-*` metadata before Hypothesis generation could use it.

Adds `lib/provider_capabilities.py` as the substrate record for
provider capability facts and native-to-canonical identity
mappings for `codex`, `claude-code`, and `chatgpt`. Adds
`provider.capability.*` subjects in `proof/subjects.py`, plus
`provider.capability.identity_bridge` and
`provider.capability.partial_coverage_declared` claims with static
runner bindings in `proof/catalog.py`. Adds provider capability
rendering to `docs/verification-catalog.md` and proof runners for
schema value-generation closure and provider capability metadata
checks in `proof/runners.py`. Updates
`tests/infra/strategies/schema_driven.py` so `x-polylogue-values`
drives generation as JSON Schema `enum` before the extension key
is stripped.

Verification: ruff + mypy + pytest over proof, schema-driven,
parser-crashlessness, schema-roundtrip, and semantic-properties
suites; devtools render-all --check, verify and --quick green.

Closes #332
@Sinity

Sinity commented Apr 28, 2026

Copy link
Copy Markdown
Owner Author

🤖 Post-hoc audit note: this PR received bot review feedback verified against current HEAD as part of #544. 2 finding(s) confirmed still present → tracked in #550.

@Sinity
Sinity requested review from Copilot and removed request for Copilot May 1, 2026 00:43
@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: compile schema annotations and provider semantics into obligations

1 participant