Skip to content

fix(proof): drop x-polylogue-mutually-exclusive from catalog subjects - #521

Merged
Sinity merged 1 commit into
masterfrom
feature/fix/proof-drop-mutual-exclusion
Apr 27, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/fix/proof-drop-mutual-exclusion

Conversation

@Sinity

@Sinity Sinity commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

Stops generating proof catalog subjects from x-polylogue-mutually-exclusive. Catalog drops from 9046 subjects / 9149 obligations to 246 / 351.

Closes #496.

Problem

8802 of 9046 proof catalog subjects (97%) were kind="schema.annotation" rows derived from inferred x-polylogue-mutually-exclusive pairs. They drowned out the rest of the catalog and verified almost nothing:

  1. Sampling artifact, not invariant. A pair like {fields: ['email', 'title'], parent: '$'} (chatgpt) means "in 2122 samples, email and title never co-occurred" — not "they are mutually exclusive in the format."
  2. Self-referential. The runner (schema.mutual_exclusion.exclusive, runner class schema_static) checks that the synthetic-payload generator does not co-populate exclusive fields. But the generator reads the same annotations to know what to avoid. Both sides of the obligation come from the same inference output. The obligation cannot detect what would matter — fresh provider data co-populating fields the inference said were exclusive — because nothing on either side looks at fresh provider data.

The result: a catalog reporting 9149 obligations that looked deeply covered, while one claim accounted for 96% of obligations and produced no signal.

Solution

  • polylogue/proof/subjects.py: drop "x-polylogue-mutually-exclusive" from SELECTED_SCHEMA_ANNOTATIONS and the corresponding branch in _annotation_subjects_for_schema().
  • polylogue/proof/catalog.py: drop mutual_exclusion_query and the schema.mutual_exclusion.exclusive Claim from default_claims(). The schema-annotation-static-contract runner binding stays — it still serves schema.values.value_closure and schema.foreign_key.resolves.
  • tests/unit/proof/test_catalog.py: drop the claim id from the expected set and the obligation-count assertion for it.
  • docs/verification-catalog.md: regenerated by devtools render-verification-catalog.

What we keep:

  • x-polylogue-values subjects (88) — discriminated-union tags and status enums; runner checks observed_values ⊆ declared_values, which catches genuine provider drift.
  • x-polylogue-foreign-keys subjects (7) — small, structurally verifiable.
  • The x-polylogue-mutually-exclusive annotation itself in committed schemas (still used by the generator and inference). Only the proof-subject minting goes away.

Bundles a one-line uv.lock regeneration: typing-extensions has been declared in pyproject.toml since the TypedDict pinning landed; the lockfile was out of sync.

Verification

$ nix develop -c python -c "from polylogue.proof.subjects import build_catalog_subjects; from collections import Counter; print(dict(Counter(s.kind for s in build_catalog_subjects())))"
{'cli.command': 52, 'cli.json_command': 2, 'archive.query_law': 1, 'provider.capability': 3,
 'operation.spec': 43, 'artifact.path': 27, 'maintenance.target': 8, 'error.surface': 2,
 'trace.operation': 1, 'diagnostic.observable': 1, 'generated.scenario_family': 9,
 'schema.annotation': 95, 'workflow.claim': 2}

$ nix develop -c devtools verify
verify: all checks passed
  ruff format ... ok
  ruff check ... ok
  mypy ... ok
  render-all ... ok
  verify-topology / file-budgets / test-ownership / migrations / cross-cuts ... ok
  pytest ... ok (172.2s)

Catalog snapshot delta:

subjects claims obligations
before 9046 22 9149
after 246 21 351

Related

Closes #496.

8802 of 9046 proof catalog subjects (97%) were schema.annotation rows
derived from inferred x-polylogue-mutually-exclusive pairs. They drowned
out the rest of the catalog and verified almost nothing — the obligation
is self-referential (the runner checks that the synthetic generator
respects annotations the inference produced from the same corpus, so
both sides come from the same inference output).

Drops:
- "x-polylogue-mutually-exclusive" from SELECTED_SCHEMA_ANNOTATIONS
- the corresponding branch in _annotation_subjects_for_schema()
- mutual_exclusion_query and the schema.mutual_exclusion.exclusive
  Claim from default_claims()
- two assertions in tests/unit/proof/test_catalog.py

Keeps the annotation itself in committed schemas (still useful for
generator constraints, documentation, future operator review). Only the
proof-subject minting goes away.

Effect on the verification catalog snapshot:

  before: subjects=9046  claims=22  obligations=9149
  after:  subjects=246   claims=21  obligations=351

Also regenerates uv.lock (typing-extensions has been in pyproject.toml
since the TypedDict pinning landed; lockfile was out of sync).

Verification: devtools verify (full, ~4min) all green.

Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 27, 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 22 minutes and 24 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ 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: 73145c8b-869e-490c-8771-99dbf79b9918

📥 Commits

Reviewing files that changed from the base of the PR and between f1135e9 and 27189a0.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock, !**/*.lock
📒 Files selected for processing (4)
  • docs/verification-catalog.md
  • polylogue/proof/catalog.py
  • polylogue/proof/subjects.py
  • tests/unit/proof/test_catalog.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix/proof-drop-mutual-exclusion

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 cae8ef7 into master Apr 27, 2026
13 checks passed
@Sinity
Sinity deleted the feature/fix/proof-drop-mutual-exclusion branch April 27, 2026 03:22
@Sinity

Sinity commented May 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

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

@Sinity
Sinity requested review from Copilot and removed request for Copilot May 1, 2026 01:55
Sinity added a commit that referenced this pull request May 7, 2026
…#521)

## Summary

Stops generating proof catalog subjects from
`x-polylogue-mutually-exclusive`. Catalog drops from 9046 subjects /
9149 obligations to 246 / 351.

Closes #496.

## Problem

8802 of 9046 proof catalog subjects (97%) were
`kind="schema.annotation"` rows derived from inferred
`x-polylogue-mutually-exclusive` pairs. They drowned out the rest of the
catalog and verified almost nothing:

1. **Sampling artifact, not invariant.** A pair like `{fields: ['email',
'title'], parent: '$'}` (chatgpt) means "in 2122 samples, email and
title never co-occurred" — not "they are mutually exclusive in the
format."
2. **Self-referential.** The runner
(`schema.mutual_exclusion.exclusive`, runner class `schema_static`)
checks that the synthetic-payload generator does not co-populate
exclusive fields. But the generator reads the same annotations to know
what to avoid. Both sides of the obligation come from the same inference
output. The obligation cannot detect what would matter — fresh provider
data co-populating fields the inference said were exclusive — because
nothing on either side looks at fresh provider data.

The result: a catalog reporting 9149 obligations that looked deeply
covered, while one claim accounted for 96% of obligations and produced
no signal.

## Solution

- `polylogue/proof/subjects.py`: drop `"x-polylogue-mutually-exclusive"`
from `SELECTED_SCHEMA_ANNOTATIONS` and the corresponding branch in
`_annotation_subjects_for_schema()`.
- `polylogue/proof/catalog.py`: drop `mutual_exclusion_query` and the
`schema.mutual_exclusion.exclusive` Claim from `default_claims()`. The
`schema-annotation-static-contract` runner binding stays — it still
serves `schema.values.value_closure` and `schema.foreign_key.resolves`.
- `tests/unit/proof/test_catalog.py`: drop the claim id from the
expected set and the obligation-count assertion for it.
- `docs/verification-catalog.md`: regenerated by `devtools
render-verification-catalog`.

What we keep:
- `x-polylogue-values` subjects (88) — discriminated-union tags and
status enums; runner checks `observed_values ⊆ declared_values`, which
catches genuine provider drift.
- `x-polylogue-foreign-keys` subjects (7) — small, structurally
verifiable.
- The `x-polylogue-mutually-exclusive` annotation itself in committed
schemas (still used by the generator and inference). Only the
proof-subject minting goes away.

Bundles a one-line `uv.lock` regeneration: `typing-extensions` has been
declared in `pyproject.toml` since the TypedDict pinning landed; the
lockfile was out of sync.

## Verification

```
$ nix develop -c python -c "from polylogue.proof.subjects import build_catalog_subjects; from collections import Counter; print(dict(Counter(s.kind for s in build_catalog_subjects())))"
{'cli.command': 52, 'cli.json_command': 2, 'archive.query_law': 1, 'provider.capability': 3,
 'operation.spec': 43, 'artifact.path': 27, 'maintenance.target': 8, 'error.surface': 2,
 'trace.operation': 1, 'diagnostic.observable': 1, 'generated.scenario_family': 9,
 'schema.annotation': 95, 'workflow.claim': 2}

$ nix develop -c devtools verify
verify: all checks passed
  ruff format ... ok
  ruff check ... ok
  mypy ... ok
  render-all ... ok
  verify-topology / file-budgets / test-ownership / migrations / cross-cuts ... ok
  pytest ... ok (172.2s)
```

Catalog snapshot delta:

| | subjects | claims | obligations |
| --- | ---: | ---: | ---: |
| before | 9046 | 22 | 9149 |
| after  |  246 | 21 |  351 |

## Related

- #506 — holistic assurance umbrella
- #421 — claim depth (now operates on an honest base)
- #494 — evidence freshness SLA (mutual-exclusion would distort the
metric trivially)

Co-authored-by: Claude <[email protected]>
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.

fix(proof): drop x-polylogue-mutually-exclusive from catalog subjects

1 participant