Skip to content

test: add structural error proof evidence - #351

Merged
Sinity merged 2 commits into
masterfrom
feature/test/structural-error-proof
Apr 22, 2026
Merged

Sinity merged 2 commits into
masterfrom
feature/test/structural-error-proof

Conversation

@Sinity

@Sinity Sinity commented Apr 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #340.

Adds structural proof subjects and evidence runners for runtime artifact paths, maintenance repair crash-consistency, parser quarantine redaction, and machine/user error context. Also fixes a markdown rendering preservation bug exposed by the full local verification baseline.

Problem

The proof catalog covered CLI, schema, provider, and operation metadata, but it did not yet prove archive structure, destructive/repair state effects, parser quarantine diagnostics, or machine-readable/user-facing error context. #340 also requires at least one synthetic archive exercise for crash/interruption semantics and privacy-safe quarantine evidence.

While running the full baseline, Hypothesis exposed that a message body line beginning with ## could masquerade as a renderer message section and break markdown message-count preservation.

Solution

  • Added artifact.path, maintenance.target, and error.surface proof subjects.
  • Added the raw-session-product-repair-loop curated artifact path so one structural invariant spans raw validation, archive core rows, derived session-product rows, FTS, and projected readiness.
  • Added catalog claims and runner bindings for:
    • artifact.path.dependency_closure
    • maintenance.repair.crash_consistency
    • parser.quarantine.context_redaction
    • error.machine_user_context
  • Added observation-based proof runners for structural paths, maintenance repair state effects, quarantine context/redaction, and generic machine/user error context.
  • Added synthetic tests that exercise orphan-message dry-run/repair/idempotence, ambiguous vs rolled-back repair failure state, malformed Codex JSONL quarantine redaction, and structured error context.
  • Escaped markdown message body lines starting with ## so body text cannot be counted as renderer section headers.
  • Regenerated docs/verification-catalog.md and docs/test-quality-workflows.md.

Verification

  • pytest tests/unit/proof/test_catalog.py tests/unit/proof/test_structural_error_evidence.py -q
  • pytest tests/unit/proof -q
  • ruff check polylogue/artifacts.py polylogue/proof tests/unit/proof
  • ruff format --check polylogue/artifacts.py polylogue/proof tests/unit/proof
  • devtools render-all --check
  • mypy polylogue/
  • pytest tests/unit/core/test_artifact_graph.py tests/unit/core/test_artifact_specs.py tests/unit/devtools/test_scenario_coverage.py tests/unit/proof -q
  • pytest tests/property/test_rendering_preservation.py::test_markdown_preserves_message_count tests/unit/rendering/test_rendering.py::TestFormatConversationMarkdownNoneGuards::test_message_text_heading_marker_does_not_create_extra_section -q
  • devtools verify
  • pre-push devtools verify --quick

@Sinity
Sinity merged commit 87b1a4e into master Apr 22, 2026
11 checks passed
@Sinity
Sinity deleted the feature/test/structural-error-proof branch April 22, 2026 06:41
@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: e2eb21c4-4f7d-44ab-814d-203b4a6c7a9f

📥 Commits

Reviewing files that changed from the base of the PR and between 1a85e36 and 19a1aaa.

📒 Files selected for processing (13)
  • docs/test-quality-workflows.md
  • docs/verification-catalog.md
  • polylogue/artifacts.py
  • polylogue/proof/catalog.py
  • polylogue/proof/runners.py
  • polylogue/proof/subjects.py
  • polylogue/rendering/core_markdown.py
  • tests/unit/core/test_artifact_graph.py
  • tests/unit/core/test_artifact_specs.py
  • tests/unit/devtools/test_scenario_coverage.py
  • tests/unit/proof/test_catalog.py
  • tests/unit/proof/test_structural_error_evidence.py
  • tests/unit/rendering/test_rendering.py

📝 Walkthrough

Walkthrough

The pull request introduces structural graph, error semantics, and crash consistency proof capabilities to the verification subsystem by adding new artifact path definitions, proof claims (artifact.path.dependency_closure, maintenance.repair.crash_consistency, parser.quarantine.context_redaction, error.machine_user_context), corresponding subject compilation functions, runner implementations with observation types, and comprehensive unit tests validating evidence generation.

Changes

Cohort / File(s) Summary
Proof Catalog & Claims
polylogue/proof/catalog.py
Added four new claim definitions with subject queries, evidence schemas, bug classes, and breaker metadata; extended default_runner_bindings() to recognize new claim ID prefixes and bind them to runner contracts (artifact-path-static-contract, maintenance-repair-state-contract, parser-quarantine-error-contract, error-context-contract).
Proof Runners & Observations
polylogue/proof/runners.py
Introduced three new observation dataclasses (MaintenanceRepairObservation, QuarantineErrorObservation, ErrorContextObservation) and four public runner functions (run_artifact_path_evidence, run_maintenance_repair_state_evidence, run_quarantine_error_evidence, run_error_context_evidence) validating structural closure, repair idempotency, quarantine context preservation, and error message privacy.
Proof Subjects
polylogue/proof/subjects.py
Added three new subject compilation functions (artifact_path_subjects, maintenance_target_subjects, error_surface_subjects) building subjects from artifact graph, maintenance targets, and error family definitions; integrated into build_catalog_subjects().
Artifact Definitions
polylogue/artifacts.py
Added new runtime artifact path raw-session-product-repair-loop traversing session product construction nodes from configured sources through durable product rows to readiness.
Message Rendering
polylogue/rendering/core_markdown.py
Added _escape_message_section_markers() helper to prevent message text starting with ## from being misinterpreted as renderer section headers by prefixing matching lines with backslash.
Generated Documentation
docs/test-quality-workflows.md, docs/verification-catalog.md
Updated registry snapshots: runtime coverage path count increased to 27; verification catalog extended with new subject kinds (artifact.path, error.surface, maintenance.target), claims, runner bindings, and proof obligations.
Unit Tests
tests/unit/core/test_artifact_graph.py, tests/unit/core/test_artifact_specs.py, tests/unit/devtools/test_scenario_coverage.py, tests/unit/proof/test_catalog.py
Updated assertion sets to include new artifact path raw-session-product-repair-loop and new claim IDs in catalog; extended subject-kind expectations.
Structural Error Evidence Tests
tests/unit/proof/test_structural_error_evidence.py
Added comprehensive test suite (315 lines) with six tests validating artifact path evidence, maintenance repair state transitions and idempotency, quarantine error context preservation without payload leaks, and error context privacy checks; included database setup helpers and synthetic archive construction utilities.
Rendering Tests
tests/unit/rendering/test_rendering.py
Added test verifying that message text with heading markers (## ) is properly escaped to prevent section header misinterpretation in rendered markdown.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 Hops with glee through structured graphs,
New claims and runners close the gaps,
Errors quarantined, context preserved,
Repair idempotent as it's deserved!
One path to proof, the truth rings clear. 🌟

✨ 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/test/structural-error-proof

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.

@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: 19a1aaa59f

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

Closes #340.

Adds structural proof subjects and evidence runners for runtime artifact paths, maintenance repair crash-consistency, parser quarantine redaction, and machine/user error context. Also fixes a markdown rendering preservation bug exposed by the full local verification baseline.

## Problem

The proof catalog covered CLI, schema, provider, and operation metadata, but it did not yet prove archive structure, destructive/repair state effects, parser quarantine diagnostics, or machine-readable/user-facing error context. #340 also requires at least one synthetic archive exercise for crash/interruption semantics and privacy-safe quarantine evidence.

While running the full baseline, Hypothesis exposed that a message body line beginning with `## ` could masquerade as a renderer message section and break markdown message-count preservation.

## Solution

- Added `artifact.path`, `maintenance.target`, and `error.surface` proof subjects.
- Added the `raw-session-product-repair-loop` curated artifact path so one structural invariant spans raw validation, archive core rows, derived session-product rows, FTS, and projected readiness.
- Added catalog claims and runner bindings for:
  - `artifact.path.dependency_closure`
  - `maintenance.repair.crash_consistency`
  - `parser.quarantine.context_redaction`
  - `error.machine_user_context`
- Added observation-based proof runners for structural paths, maintenance repair state effects, quarantine context/redaction, and generic machine/user error context.
- Added synthetic tests that exercise orphan-message dry-run/repair/idempotence, ambiguous vs rolled-back repair failure state, malformed Codex JSONL quarantine redaction, and structured error context.
- Escaped markdown message body lines starting with `## ` so body text cannot be counted as renderer section headers.
- Regenerated `docs/verification-catalog.md` and `docs/test-quality-workflows.md`.

## Verification

- `pytest tests/unit/proof/test_catalog.py tests/unit/proof/test_structural_error_evidence.py -q`
- `pytest tests/unit/proof -q`
- `ruff check polylogue/artifacts.py polylogue/proof tests/unit/proof`
- `ruff format --check polylogue/artifacts.py polylogue/proof tests/unit/proof`
- `devtools render-all --check`
- `mypy polylogue/`
- `pytest tests/unit/core/test_artifact_graph.py tests/unit/core/test_artifact_specs.py tests/unit/devtools/test_scenario_coverage.py tests/unit/proof -q`
- `pytest tests/property/test_rendering_preservation.py::test_markdown_preserves_message_count tests/unit/rendering/test_rendering.py::TestFormatConversationMarkdownNoneGuards::test_message_text_heading_marker_does_not_create_extra_section -q`
- `devtools verify`
- pre-push `devtools verify --quick`
Sinity added a commit that referenced this pull request Apr 22, 2026
The proof catalog covered CLI, schema, provider, and operation
metadata, but didn't yet prove archive structure, destructive/
repair state effects, parser quarantine diagnostics, or
machine-readable/user-facing error context. #340 also required at
least one synthetic archive exercise for crash/interruption
semantics and privacy-safe quarantine evidence. While running the
full baseline, Hypothesis exposed that a message body line
beginning with `## ` could masquerade as a renderer message section
and break markdown message-count preservation.

Adds `artifact.path`, `maintenance.target`, and `error.surface`
proof subjects. Adds the `raw-session-product-repair-loop` curated
artifact path so one structural invariant spans raw validation,
archive core rows, derived session-product rows, FTS, and
projected readiness. Adds catalog claims and runner bindings for
`artifact.path.dependency_closure`,
`maintenance.repair.crash_consistency`,
`parser.quarantine.context_redaction`, and
`error.machine_user_context`. Adds observation-based proof runners
and synthetic tests exercising orphan-message dry-run/repair/
idempotence, ambiguous vs rolled-back repair failure state,
malformed Codex JSONL quarantine redaction, and structured error
context. Escapes markdown message body lines starting with `## `
so body text can't be counted as renderer section headers.

Verification: ruff + mypy + pytest over proof / artifact-graph /
scenario-coverage / rendering suites; devtools render-all --check,
verify and --quick green.

Closes #340
Sinity added a commit that referenced this pull request Apr 22, 2026
The proof catalog covered CLI, schema, provider, and operation
metadata, but didn't yet prove archive structure, destructive/
repair state effects, parser quarantine diagnostics, or
machine-readable/user-facing error context. #340 also required at
least one synthetic archive exercise for crash/interruption
semantics and privacy-safe quarantine evidence. While running the
full baseline, Hypothesis exposed that a message body line
beginning with `## ` could masquerade as a renderer message section
and break markdown message-count preservation.

Adds `artifact.path`, `maintenance.target`, and `error.surface`
proof subjects. Adds the `raw-session-product-repair-loop` curated
artifact path so one structural invariant spans raw validation,
archive core rows, derived session-product rows, FTS, and
projected readiness. Adds catalog claims and runner bindings for
`artifact.path.dependency_closure`,
`maintenance.repair.crash_consistency`,
`parser.quarantine.context_redaction`, and
`error.machine_user_context`. Adds observation-based proof runners
and synthetic tests exercising orphan-message dry-run/repair/
idempotence, ambiguous vs rolled-back repair failure state,
malformed Codex JSONL quarantine redaction, and structured error
context. Escapes markdown message body lines starting with `## `
so body text can't be counted as renderer section headers.

Verification: ruff + mypy + pytest over proof / artifact-graph /
scenario-coverage / rendering suites; devtools render-all --check,
verify and --quick green.

Closes #340
Sinity added a commit that referenced this pull request Apr 22, 2026
The proof catalog covered CLI, schema, provider, and operation
metadata, but didn't yet prove archive structure, destructive/
repair state effects, parser quarantine diagnostics, or
machine-readable/user-facing error context. #340 also required at
least one synthetic archive exercise for crash/interruption
semantics and privacy-safe quarantine evidence. While running the
full baseline, Hypothesis exposed that a message body line
beginning with `## ` could masquerade as a renderer message section
and break markdown message-count preservation.

Adds `artifact.path`, `maintenance.target`, and `error.surface`
proof subjects. Adds the `raw-session-product-repair-loop` curated
artifact path so one structural invariant spans raw validation,
archive core rows, derived session-product rows, FTS, and
projected readiness. Adds catalog claims and runner bindings for
`artifact.path.dependency_closure`,
`maintenance.repair.crash_consistency`,
`parser.quarantine.context_redaction`, and
`error.machine_user_context`. Adds observation-based proof runners
and synthetic tests exercising orphan-message dry-run/repair/
idempotence, ambiguous vs rolled-back repair failure state,
malformed Codex JSONL quarantine redaction, and structured error
context. Escapes markdown message body lines starting with `## `
so body text can't be counted as renderer section headers.

Verification: ruff + mypy + pytest over proof / artifact-graph /
scenario-coverage / rendering suites; devtools render-all --check,
verify and --quick green.

Closes #340
@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

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

test: prove structural graph, error, and crash consistency semantics

2 participants