Skip to content

refactor: rebuild schema generation and audit boundary contracts - #258

Merged
Sinity merged 5 commits into
masterfrom
feature/refactor/schema-audit-generation-boundaries
Apr 20, 2026
Merged

Sinity merged 5 commits into
masterfrom
feature/refactor/schema-audit-generation-boundaries

Conversation

@Sinity

@Sinity Sinity commented Apr 20, 2026

Copy link
Copy Markdown
Owner

Summary

Renew the schema generation, audit, and tooling boundary layer around explicit JSON/document contracts instead of loose schema-payload traversal.

Problem

The schema authoring and audit surface was still one of the remaining path-dependent strata in the renewal program. Audit walkers/checks, generation helpers, sampling utilities, validator resolution, and tooling registry seams still mixed runtime meaning with broad mapping/object payload flow, while the surrounding tests relied on repeated deep indexing into JSON unions.

Closes #257
Ref #250

Solution

  • rebuilt schema audit walkers/checks around explicit JSON normalization and typed traversal helpers
  • tightened generation, sampling, redaction, observation-identity, tooling-diff, validator-resolution, and operator-inference contracts so internal flow stays on modeled payload/document shapes
  • widened selected source-side entry contracts only where callers naturally provide schema-like mappings, instead of forcing spurious narrowing at the public edge
  • added shared schema-access helpers for tests and aligned the schema contract/property tests around those helpers
  • suppressed the known Hypothesis filter-too-much false negative in rendering preservation so the verification baseline stays honest and green

Verification

  • mypy tests/unit/core/test_schema_generation.py tests/unit/core/test_privacy_guards.py tests/unit/core/test_schema_privacy.py tests/unit/core/test_sampling.py tests/unit/core/test_schema_laws.py tests/unit/core/test_schema_annotation_contracts.py tests/unit/core/test_audit.py polylogue/schemas/audit_checks.py polylogue/schemas/operator_inference.py polylogue/schemas/generation_models.py polylogue/schemas/tooling_registry.py polylogue/schemas/validator_resolution.py tests/infra/schema_access.py
  • pytest -q tests/unit/core/test_audit.py tests/unit/core/test_sampling.py tests/unit/core/test_schema_generation.py tests/unit/core/test_schema_privacy.py tests/unit/core/test_privacy_guards.py tests/unit/core/test_schema_laws.py tests/unit/core/test_schema_annotation_contracts.py
  • pytest -q tests/property/test_rendering_preservation.py -k json_yaml_agree_on_identity
  • devtools verify

@coderabbitai

coderabbitai Bot commented Apr 20, 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 3 minutes and 20 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 3 minutes and 20 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: 0e4ec10b-8b9d-4ef1-bcfe-4bd822b0ee5d

📥 Commits

Reviewing files that changed from the base of the PR and between 34386fb and 112cdd7.

📒 Files selected for processing (27)
  • polylogue/schemas/audit_checks.py
  • polylogue/schemas/audit_walkers.py
  • polylogue/schemas/generation_cluster_support.py
  • polylogue/schemas/generation_dynamic_keys.py
  • polylogue/schemas/generation_models.py
  • polylogue/schemas/generation_provider_bundle.py
  • polylogue/schemas/generation_provider_bundle_packages.py
  • polylogue/schemas/generation_redaction.py
  • polylogue/schemas/generation_schema_builder.py
  • polylogue/schemas/generation_support.py
  • polylogue/schemas/generation_workflow.py
  • polylogue/schemas/observation_identity.py
  • polylogue/schemas/operator_inference.py
  • polylogue/schemas/sampling.py
  • polylogue/schemas/sampling_db.py
  • polylogue/schemas/sampling_sessions.py
  • polylogue/schemas/tooling_diff.py
  • polylogue/schemas/tooling_registry.py
  • polylogue/schemas/validator_resolution.py
  • tests/infra/schema_access.py
  • tests/property/test_rendering_preservation.py
  • tests/unit/core/test_privacy_guards.py
  • tests/unit/core/test_sampling.py
  • tests/unit/core/test_schema_annotation_contracts.py
  • tests/unit/core/test_schema_generation.py
  • tests/unit/core/test_schema_laws.py
  • tests/unit/core/test_schema_privacy.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refactor/schema-audit-generation-boundaries

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: 112cdd7aa6

ℹ️ 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/schemas/operator_inference.py Resolved
@Sinity
Sinity merged commit a88ed40 into master Apr 20, 2026
13 checks passed
@Sinity
Sinity deleted the feature/refactor/schema-audit-generation-boundaries branch April 20, 2026 08:15
Sinity added a commit that referenced this pull request Apr 22, 2026
## Summary
Renew the schema generation, audit, and tooling boundary layer around explicit JSON/document contracts instead of loose schema-payload traversal.

## Problem
The schema authoring and audit surface was still one of the remaining path-dependent strata in the renewal program. Audit walkers/checks, generation helpers, sampling utilities, validator resolution, and tooling registry seams still mixed runtime meaning with broad mapping/object payload flow, while the surrounding tests relied on repeated deep indexing into JSON unions.

Closes #257
Ref #250

## Solution
- rebuilt schema audit walkers/checks around explicit JSON normalization and typed traversal helpers
- tightened generation, sampling, redaction, observation-identity, tooling-diff, validator-resolution, and operator-inference contracts so internal flow stays on modeled payload/document shapes
- widened selected source-side entry contracts only where callers naturally provide schema-like mappings, instead of forcing spurious narrowing at the public edge
- added shared schema-access helpers for tests and aligned the schema contract/property tests around those helpers
- suppressed the known Hypothesis filter-too-much false negative in rendering preservation so the verification baseline stays honest and green

## Verification
- `mypy tests/unit/core/test_schema_generation.py tests/unit/core/test_privacy_guards.py tests/unit/core/test_schema_privacy.py tests/unit/core/test_sampling.py tests/unit/core/test_schema_laws.py tests/unit/core/test_schema_annotation_contracts.py tests/unit/core/test_audit.py polylogue/schemas/audit_checks.py polylogue/schemas/operator_inference.py polylogue/schemas/generation_models.py polylogue/schemas/tooling_registry.py polylogue/schemas/validator_resolution.py tests/infra/schema_access.py`
- `pytest -q tests/unit/core/test_audit.py tests/unit/core/test_sampling.py tests/unit/core/test_schema_generation.py tests/unit/core/test_schema_privacy.py tests/unit/core/test_privacy_guards.py tests/unit/core/test_schema_laws.py tests/unit/core/test_schema_annotation_contracts.py`
- `pytest -q tests/property/test_rendering_preservation.py -k json_yaml_agree_on_identity`
- `devtools verify`
@Sinity Sinity added area:schema Schema tool:claude Claude type:refactor Code restructuring labels Apr 22, 2026
Sinity added a commit that referenced this pull request Apr 22, 2026
The schema authoring and audit surface was one of the remaining
path-dependent strata. Audit walkers/checks, generation helpers,
sampling utilities, validator resolution, and tooling registry
seams mixed runtime meaning with broad mapping/object payload flow,
while the surrounding tests relied on repeated deep indexing into
JSON unions.

Rebuilds schema audit walkers/checks around explicit JSON
normalization and typed traversal helpers. Tightens generation,
sampling, redaction, observation-identity, tooling-diff, validator-
resolution, and operator-inference contracts so internal flow stays
on modeled payload/document shapes. Widens selected source-side
entry contracts only where callers naturally provide schema-like
mappings, instead of forcing spurious narrowing at the public edge.
Adds shared schema-access helpers for tests and aligns the schema
contract/property tests around those helpers.

Also suppresses the known Hypothesis filter-too-much false negative
in rendering preservation so the verification baseline stays honest
and green.

Verification: mypy + pytest over schema generation / privacy /
sampling / audit / annotation-contract suites; property test for
JSON/YAML rendering identity; devtools verify green.

Closes #257
Ref #250
Sinity added a commit that referenced this pull request Apr 22, 2026
The schema authoring and audit surface was one of the remaining
path-dependent strata. Audit walkers/checks, generation helpers,
sampling utilities, validator resolution, and tooling registry
seams mixed runtime meaning with broad mapping/object payload flow,
while the surrounding tests relied on repeated deep indexing into
JSON unions.

Rebuilds schema audit walkers/checks around explicit JSON
normalization and typed traversal helpers. Tightens generation,
sampling, redaction, observation-identity, tooling-diff, validator-
resolution, and operator-inference contracts so internal flow stays
on modeled payload/document shapes. Widens selected source-side
entry contracts only where callers naturally provide schema-like
mappings, instead of forcing spurious narrowing at the public edge.
Adds shared schema-access helpers for tests and aligns the schema
contract/property tests around those helpers.

Also suppresses the known Hypothesis filter-too-much false negative
in rendering preservation so the verification baseline stays honest
and green.

Verification: mypy + pytest over schema generation / privacy /
sampling / audit / annotation-contract suites; property test for
JSON/YAML rendering identity; devtools verify green.

Closes #257
Ref #250
Sinity added a commit that referenced this pull request Apr 22, 2026
The schema authoring and audit surface was one of the remaining
path-dependent strata. Audit walkers/checks, generation helpers,
sampling utilities, validator resolution, and tooling registry
seams mixed runtime meaning with broad mapping/object payload flow,
while the surrounding tests relied on repeated deep indexing into
JSON unions.

Rebuilds schema audit walkers/checks around explicit JSON
normalization and typed traversal helpers. Tightens generation,
sampling, redaction, observation-identity, tooling-diff, validator-
resolution, and operator-inference contracts so internal flow stays
on modeled payload/document shapes. Widens selected source-side
entry contracts only where callers naturally provide schema-like
mappings, instead of forcing spurious narrowing at the public edge.
Adds shared schema-access helpers for tests and aligns the schema
contract/property tests around those helpers.

Also suppresses the known Hypothesis filter-too-much false negative
in rendering preservation so the verification baseline stays honest
and green.

Verification: mypy + pytest over schema generation / privacy /
sampling / audit / annotation-contract suites; property test for
JSON/YAML rendering identity; devtools verify green.

Closes #257
Ref #250
@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. 1 finding(s) confirmed still present → tracked in #550.

@Sinity
Sinity requested a review from Copilot May 1, 2026 00:43
@Sinity
Sinity requested review from Copilot and removed request for Copilot May 1, 2026 01:05
@Sinity
Sinity removed the request for review from Copilot May 1, 2026 02:15
@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

Labels

area:schema Schema tool:claude Claude type:refactor Code restructuring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: rebuild schema generation and audit boundary contracts

1 participant