Skip to content

feat: add proof-obligation catalog - #342

Merged
Sinity merged 1 commit into
masterfrom
feature/feat/proof-obligation-kernel
Apr 22, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/feat/proof-obligation-kernel

Conversation

@Sinity

@Sinity Sinity commented Apr 22, 2026 •

Copy link
Copy Markdown
Owner

Closes #192

Summary

  • Add the importable polylogue.proof kernel for subjects, claims, runner bindings, proof obligations, and evidence envelopes.
  • Compile first-slice catalog subjects from visible CLI commands and selected packaged-schema annotations.
  • Add devtools render-verification-catalog plus generated documentation and focused proof/devtools tests.

Problem

Polylogue had verification registries and runners, but no shared proof vocabulary tying verifiable subjects, semantic claims, runner contracts, obligations, and evidence metadata together. That made follow-on work prone to one-off validation machinery instead of compiling into a durable catalog.

Solution

The new polylogue.proof package defines SourceSpan, SubjectRef, the serializable SubjectQuery AST (Kind, AttrEq, AttrIn, AttrContains, And, Or, Not), Claim, RunnerBinding, ProofObligation, EvidenceEnvelope, and trust/environment metadata. The catalog compiler now discovers command subjects from polylogue/cli/command_inventory.py::iter_command_paths() and schema annotation subjects for x-polylogue-values, x-polylogue-foreign-keys, and x-polylogue-mutually-exclusive.

The first claim set covers command help/no-traceback/plain-mode contracts and schema value-closure/foreign-key/mutual-exclusion contracts. Catalog self-quality checks expose missing source spans, stale or incomplete runner trust metadata, missing serious-claim bug classes, missing breakers or tracked exceptions, and zero-subject non-abstract claims. The showcase layer stays in place and only gains Invariant.to_claim() as the compatibility bridge.

devtools render-verification-catalog renders docs/verification-catalog.md, supports --check and --json, and is wired into devtools render-all, the docs map, and the devtools command catalog.

Verification

pytest -q -n 0 tests/unit/proof tests/unit/devtools/test_render_verification_catalog.py tests/unit/devtools/test_devtools_main.py tests/unit/devtools/test_command_catalog.py tests/unit/devtools/test_generated_surfaces.py
pytest -q -n 0 tests/unit/devtools/test_project_motd.py tests/unit/proof tests/unit/devtools/test_render_verification_catalog.py
devtools verify --quick
devtools verify

The final devtools verify passed locally. The push hook also reran devtools verify --quick successfully.

@coderabbitai

coderabbitai Bot commented Apr 22, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8e173edf-53fd-4019-ad0d-78ca7d550a05

📥 Commits

Reviewing files that changed from the base of the PR and between 4707e70 and 903bd3b.

📒 Files selected for processing (19)
  • devtools/command_catalog.py
  • devtools/docs_surface.py
  • devtools/generated_surfaces.py
  • devtools/render_quality_reference.py
  • devtools/render_verification_catalog.py
  • docs/README.md
  • docs/devtools.md
  • docs/verification-catalog.md
  • polylogue/proof/__init__.py
  • polylogue/proof/catalog.py
  • polylogue/proof/models.py
  • polylogue/proof/rendering.py
  • polylogue/proof/subjects.py
  • polylogue/showcase/invariants.py
  • tests/unit/devtools/test_devtools_main.py
  • tests/unit/devtools/test_project_motd.py
  • tests/unit/devtools/test_render_verification_catalog.py
  • tests/unit/proof/test_catalog.py
  • tests/unit/proof/test_models.py

📝 Walkthrough

Walkthrough

This PR establishes a proof-obligation kernel with verifiable object discovery, claim definitions, runner bindings, and quality validation. It adds CLI support to compile and render a verification catalog from command subjects, schema annotations, and proof obligations.

Changes

Cohort / File(s) Summary
Core proof models and kernel
polylogue/proof/models.py, polylogue/proof/catalog.py, polylogue/proof/subjects.py, polylogue/proof/rendering.py, polylogue/proof/__init__.py
Implements proof-obligation primitives (SubjectRef, Claim, RunnerBinding, ProofObligation, EvidenceEnvelope), catalog compilation with quality-check validation, subject discovery from CLI commands and schema annotations, and Markdown documentation rendering.
CLI and devtools integration
devtools/render_verification_catalog.py, devtools/command_catalog.py, devtools/generated_surfaces.py, devtools/docs_surface.py, devtools/render_quality_reference.py
Adds render-verification-catalog command with --json, --check, and --output flags; registers command in catalog; creates generated surface; adds documentation entry; exports quality-reference module symbols.
Showcase compatibility
polylogue/showcase/invariants.py
Adds Invariant.to_claim() method bridging showcase invariants to proof-kernel claims with evidence schema and breaker metadata.
Documentation
docs/README.md, docs/devtools.md, docs/verification-catalog.md
Extends documentation index with verification-catalog link, documents new CLI command, and includes generated catalog snapshot with subjects, claims, runners, and quality status.
Tests
tests/unit/devtools/test_render_verification_catalog.py, tests/unit/devtools/test_devtools_main.py, tests/unit/devtools/test_project_motd.py, tests/unit/proof/test_models.py, tests/unit/proof/test_catalog.py
Adds unit tests for catalog rendering, catalog compilation, proof models, and integration; updates existing tests to account for new generated surface.

Sequence Diagram(s)

sequenceDiagram
    actor CLI as CLI User
    participant RVC as render_verification_catalog
    participant SubjDisc as Subject Discovery
    participant CatalogBld as Catalog Builder
    participant QualityChk as Quality Checks
    participant Renderer as Markdown Renderer
    participant FileIO as File I/O

    CLI->>RVC: main(["--check"])
    RVC->>SubjDisc: command_subjects() + schema_annotation_subjects()
    SubjDisc-->>RVC: tuple[SubjectRef, ...]
    RVC->>CatalogBld: build_verification_catalog()
    CatalogBld->>CatalogBld: compile_obligations(subjects, claims, bindings)
    CatalogBld-->>RVC: VerificationCatalog
    RVC->>QualityChk: catalog_quality_checks(catalog)
    QualityChk-->>RVC: tuple[OutcomeCheck, ...]
    RVC->>Renderer: build_catalog_markdown(catalog)
    Renderer-->>RVC: markdown_string
    RVC->>FileIO: read existing file
    FileIO-->>RVC: existing_content
    RVC->>RVC: compare rendered vs. existing
    alt Content matches
        RVC-->>CLI: exit(0) "sync OK"
    else Content differs
        RVC->>FileIO: write rendered markdown
        RVC-->>CLI: exit(1) "out of sync"
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Poem

🐰 Hops past code with glee:
Proof obligations now flow free,
From subjects claimed to runners bound,
A catalog rendered, quality found!
The kernel's set, the claims take hold—
Polylogue's verification unfolds! 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/feat/proof-obligation-kernel

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 e8c5e2e into master Apr 22, 2026
11 of 12 checks passed
@Sinity
Sinity deleted the feature/feat/proof-obligation-kernel branch April 22, 2026 02:57

@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: 903bd3ba6f

ℹ️ 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 polylogue/proof/models.py Resolved
Comment thread polylogue/proof/catalog.py Resolved
Sinity added a commit that referenced this pull request Apr 22, 2026
Closes #192

## Summary

- Add the importable `polylogue.proof` kernel for subjects, claims, runner bindings, proof obligations, and evidence envelopes.
- Compile first-slice catalog subjects from visible CLI commands and selected packaged-schema annotations.
- Add `devtools render-verification-catalog` plus generated documentation and focused proof/devtools tests.

## Problem

Polylogue had verification registries and runners, but no shared proof vocabulary tying verifiable subjects, semantic claims, runner contracts, obligations, and evidence metadata together. That made follow-on work prone to one-off validation machinery instead of compiling into a durable catalog.

## Solution

The new `polylogue.proof` package defines `SourceSpan`, `SubjectRef`, the serializable `SubjectQuery` AST (`Kind`, `AttrEq`, `AttrIn`, `AttrContains`, `And`, `Or`, `Not`), `Claim`, `RunnerBinding`, `ProofObligation`, `EvidenceEnvelope`, and trust/environment metadata. The catalog compiler now discovers command subjects from `polylogue/cli/command_inventory.py::iter_command_paths()` and schema annotation subjects for `x-polylogue-values`, `x-polylogue-foreign-keys`, and `x-polylogue-mutually-exclusive`.

The first claim set covers command help/no-traceback/plain-mode contracts and schema value-closure/foreign-key/mutual-exclusion contracts. Catalog self-quality checks expose missing source spans, stale or incomplete runner trust metadata, missing serious-claim bug classes, missing breakers or tracked exceptions, and zero-subject non-abstract claims. The showcase layer stays in place and only gains `Invariant.to_claim()` as the compatibility bridge.

`devtools render-verification-catalog` renders `docs/verification-catalog.md`, supports `--check` and `--json`, and is wired into `devtools render-all`, the docs map, and the devtools command catalog.

## Verification

```bash
pytest -q -n 0 tests/unit/proof tests/unit/devtools/test_render_verification_catalog.py tests/unit/devtools/test_devtools_main.py tests/unit/devtools/test_command_catalog.py tests/unit/devtools/test_generated_surfaces.py
pytest -q -n 0 tests/unit/devtools/test_project_motd.py tests/unit/proof tests/unit/devtools/test_render_verification_catalog.py
devtools verify --quick
devtools verify
```

The final `devtools verify` passed locally. The push hook also reran `devtools verify --quick` successfully.
Sinity added a commit that referenced this pull request Apr 22, 2026
Polylogue had verification registries and runners, but no shared
proof vocabulary tying verifiable subjects, semantic claims, runner
contracts, obligations, and evidence metadata together. Follow-on
work was prone to one-off validation machinery instead of compiling
into a durable catalog.

Adds the importable `polylogue.proof` kernel for subjects, claims,
runner bindings, proof obligations, and evidence envelopes. The
package defines `SourceSpan`, `SubjectRef`, the serializable
`SubjectQuery` AST (`Kind`, `AttrEq`, `AttrIn`, `AttrContains`,
`And`, `Or`, `Not`), `Claim`, `RunnerBinding`, `ProofObligation`,
`EvidenceEnvelope`, and trust/environment metadata.

The catalog compiler discovers command subjects from
`cli/command_inventory.py::iter_command_paths()` and schema
annotation subjects for `x-polylogue-values`,
`x-polylogue-foreign-keys`, and `x-polylogue-mutually-exclusive`.
First claim set covers command help/no-traceback/plain-mode
contracts and schema value-closure/foreign-key/mutual-exclusion
contracts. Catalog self-quality checks expose missing source spans,
stale or incomplete runner trust metadata, missing serious-claim
bug classes, missing breakers or tracked exceptions, and
zero-subject non-abstract claims. The showcase layer stays in place
and only gains `Invariant.to_claim()` as the compatibility bridge.

`devtools render-verification-catalog` renders
`docs/verification-catalog.md`, supports `--check` and `--json`,
and is wired into `devtools render-all`, the docs map, and the
devtools command catalog.

Verification: pytest over `tests/unit/proof` and devtools render /
command-catalog / generated-surfaces / motd suites; devtools verify
--quick and verify green.

Closes #192
Sinity added a commit that referenced this pull request Apr 22, 2026
Polylogue had verification registries and runners, but no shared
proof vocabulary tying verifiable subjects, semantic claims, runner
contracts, obligations, and evidence metadata together. Follow-on
work was prone to one-off validation machinery instead of compiling
into a durable catalog.

Adds the importable `polylogue.proof` kernel for subjects, claims,
runner bindings, proof obligations, and evidence envelopes. The
package defines `SourceSpan`, `SubjectRef`, the serializable
`SubjectQuery` AST (`Kind`, `AttrEq`, `AttrIn`, `AttrContains`,
`And`, `Or`, `Not`), `Claim`, `RunnerBinding`, `ProofObligation`,
`EvidenceEnvelope`, and trust/environment metadata.

The catalog compiler discovers command subjects from
`cli/command_inventory.py::iter_command_paths()` and schema
annotation subjects for `x-polylogue-values`,
`x-polylogue-foreign-keys`, and `x-polylogue-mutually-exclusive`.
First claim set covers command help/no-traceback/plain-mode
contracts and schema value-closure/foreign-key/mutual-exclusion
contracts. Catalog self-quality checks expose missing source spans,
stale or incomplete runner trust metadata, missing serious-claim
bug classes, missing breakers or tracked exceptions, and
zero-subject non-abstract claims. The showcase layer stays in place
and only gains `Invariant.to_claim()` as the compatibility bridge.

`devtools render-verification-catalog` renders
`docs/verification-catalog.md`, supports `--check` and `--json`,
and is wired into `devtools render-all`, the docs map, and the
devtools command catalog.

Verification: pytest over `tests/unit/proof` and devtools render /
command-catalog / generated-surfaces / motd suites; devtools verify
--quick and verify green.

Closes #192
Sinity added a commit that referenced this pull request Apr 22, 2026
Polylogue had verification registries and runners, but no shared
proof vocabulary tying verifiable subjects, semantic claims, runner
contracts, obligations, and evidence metadata together. Follow-on
work was prone to one-off validation machinery instead of compiling
into a durable catalog.

Adds the importable `polylogue.proof` kernel for subjects, claims,
runner bindings, proof obligations, and evidence envelopes. The
package defines `SourceSpan`, `SubjectRef`, the serializable
`SubjectQuery` AST (`Kind`, `AttrEq`, `AttrIn`, `AttrContains`,
`And`, `Or`, `Not`), `Claim`, `RunnerBinding`, `ProofObligation`,
`EvidenceEnvelope`, and trust/environment metadata.

The catalog compiler discovers command subjects from
`cli/command_inventory.py::iter_command_paths()` and schema
annotation subjects for `x-polylogue-values`,
`x-polylogue-foreign-keys`, and `x-polylogue-mutually-exclusive`.
First claim set covers command help/no-traceback/plain-mode
contracts and schema value-closure/foreign-key/mutual-exclusion
contracts. Catalog self-quality checks expose missing source spans,
stale or incomplete runner trust metadata, missing serious-claim
bug classes, missing breakers or tracked exceptions, and
zero-subject non-abstract claims. The showcase layer stays in place
and only gains `Invariant.to_claim()` as the compatibility bridge.

`devtools render-verification-catalog` renders
`docs/verification-catalog.md`, supports `--check` and `--json`,
and is wired into `devtools render-all`, the docs map, and the
devtools command catalog.

Verification: pytest over `tests/unit/proof` and devtools render /
command-catalog / generated-surfaces / motd suites; devtools verify
--quick and verify green.

Closes #192
@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 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.

@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.

feat: add proof-obligation kernel and verification catalog

1 participant