Skip to content

refactor(core): move JSON utilities out of lib - #659

Merged
Sinity merged 1 commit into
masterfrom
feature/refactor/core-json-clean
May 1, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/refactor/core-json-clean

Conversation

@Sinity

@Sinity Sinity commented May 1, 2026

Copy link
Copy Markdown
Owner

Summary

Introduce polylogue.core and move the shared JSON type/serialization contract from polylogue.lib.json to polylogue.core.json.

Problem

json.py is a low-level runtime primitive used by archive, storage, schema, proof, devtools, tests, and surfaces. Keeping it under lib preserved one of the largest remaining catch-all dependencies after the archive-domain package cleanup tracked by #635.

Solution

Create polylogue/core/, move json.py there, update all imports and generated topology ownership, and refresh generated docs. No compatibility shim is kept; consumers now import the primitive from its core home.

Verification

  • devtools build-topology-projection && devtools verify-topology — realized=697 declared=697 blocking=False
  • ruff check polylogue/ tests/ devtools/ — all checks passed
  • mypy --no-incremental — no issues found in 1217 source files
  • mypy — no issues found in 1217 source files
  • pytest -q tests/unit/core/test_json.py tests/infra/test_json_contracts.py tests/unit/devtools/test_verify_test_ownership.py tests/unit/test_mutmut_campaign.py — 68 passed
  • pytest -q tests/unit/cli/test_json_envelope_contract.py tests/unit/cli/test_query_exec_laws.py tests/unit/mcp/test_tool_contracts.py tests/unit/mcp/test_server_surfaces.py — 214 passed
  • pytest -q tests/unit/core/test_schema_registry.py tests/unit/core/test_schema_laws.py tests/unit/devtools/test_verify_schema_roundtrip.py tests/property/test_schema_roundtrip.py — 58 passed
  • devtools render-all --check — sync OK
  • devtools verify --quick — all checks passed
  • pre-push devtools verify --quick — all checks passed

Ref #635

Copilot AI review requested due to automatic review settings May 1, 2026 18:51
@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 201 files, which is 51 over the limit of 150.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 64e6f2dd-a040-4b78-90e1-11f51faff218

📥 Commits

Reviewing files that changed from the base of the PR and between 697fb01 and d386c12.

📒 Files selected for processing (201)
  • devtools/benchmark_campaign.py
  • devtools/build_topology_projection.py
  • devtools/inject_semantic_annotations.py
  • devtools/mutation_scenario_catalog.py
  • devtools/obligation_diff.py
  • devtools/pipeline_probe.py
  • devtools/regression_cases.py
  • devtools/scenario_coverage.py
  • devtools/semantic_axis_evidence.py
  • devtools/verify_layering.py
  • devtools/verify_witness_lifecycle.py
  • devtools/witness_discover.py
  • devtools/witness_minimize.py
  • docs/plans/campaign-coverage.yaml
  • docs/plans/topology-target.yaml
  • docs/test-quality-workflows.md
  • docs/topology-status.md
  • polylogue/archive/action_event/parsing.py
  • polylogue/archive/artifact_taxonomy/runtime.py
  • polylogue/archive/artifact_taxonomy/support.py
  • polylogue/archive/message/model_runtime.py
  • polylogue/archive/provider/capabilities.py
  • polylogue/archive/provider/semantics.py
  • polylogue/archive/query/miss_diagnostics.py
  • polylogue/archive/raw_payload/__init__.py
  • polylogue/archive/raw_payload/decode.py
  • polylogue/archive/raw_payload/sampling_buckets.py
  • polylogue/archive/raw_payload/sampling_extract.py
  • polylogue/archive/semantic/models.py
  • polylogue/archive/viewport/tools.py
  • polylogue/artifacts/__init__.py
  • polylogue/artifacts/graph.py
  • polylogue/browser_capture/models.py
  • polylogue/browser_capture/server.py
  • polylogue/cli/commands/browser_capture.py
  • polylogue/cli/query.py
  • polylogue/cli/query_output.py
  • polylogue/cli/query_output_contracts.py
  • polylogue/cli/shared/check_models.py
  • polylogue/cli/shared/check_rendering_json.py
  • polylogue/cli/shared/check_workflow.py
  • polylogue/cli/shared/machine_errors.py
  • polylogue/core/__init__.py
  • polylogue/core/json.py
  • polylogue/lib/metrics.py
  • polylogue/lib/outcomes.py
  • polylogue/lib/pricing.py
  • polylogue/maintenance/models.py
  • polylogue/maintenance/targets.py
  • polylogue/mcp/payloads.py
  • polylogue/operations/specs.py
  • polylogue/pipeline/ids.py
  • polylogue/pipeline/materialization_runtime.py
  • polylogue/pipeline/payload_types.py
  • polylogue/pipeline/run_execution.py
  • polylogue/pipeline/run_finalization.py
  • polylogue/pipeline/run_support.py
  • polylogue/pipeline/semantic_capture.py
  • polylogue/pipeline/semantic_metadata.py
  • polylogue/pipeline/services/acquisition.py
  • polylogue/pipeline/services/acquisition_streams.py
  • polylogue/pipeline/services/ingest_worker.py
  • polylogue/products/export_bundles.py
  • polylogue/proof/catalog.py
  • polylogue/proof/coverage_manifests.py
  • polylogue/proof/diffing.py
  • polylogue/proof/generated_scenarios.py
  • polylogue/proof/models.py
  • polylogue/proof/runners.py
  • polylogue/proof/subjects.py
  • polylogue/proof/traces.py
  • polylogue/proof/witnesses.py
  • polylogue/protocols.py
  • polylogue/readiness/__init__.py
  • polylogue/rendering/block_models.py
  • polylogue/schemas/audit/checks.py
  • polylogue/schemas/audit/models.py
  • polylogue/schemas/audit/walkers.py
  • polylogue/schemas/code_detection/extractors.py
  • polylogue/schemas/extraction.py
  • polylogue/schemas/generation/dynamic_keys.py
  • polylogue/schemas/generation/field_annotations.py
  • polylogue/schemas/generation/models.py
  • polylogue/schemas/generation/provider_bundle_packages.py
  • polylogue/schemas/generation/schema_builder.py
  • polylogue/schemas/generation/semantic_relations.py
  • polylogue/schemas/generation/support.py
  • polylogue/schemas/inference/relational/models.py
  • polylogue/schemas/observation_models.py
  • polylogue/schemas/observation_runtime.py
  • polylogue/schemas/operator/annotations.py
  • polylogue/schemas/operator/inference.py
  • polylogue/schemas/operator/registry.py
  • polylogue/schemas/packages.py
  • polylogue/schemas/pinning.py
  • polylogue/schemas/redaction_report.py
  • polylogue/schemas/runtime_registry.py
  • polylogue/schemas/sampling.py
  • polylogue/schemas/sampling_db.py
  • polylogue/schemas/sampling_sessions.py
  • polylogue/schemas/shape_fingerprint.py
  • polylogue/schemas/synthetic/build_batch.py
  • polylogue/schemas/tooling_diff.py
  • polylogue/schemas/tooling_models.py
  • polylogue/schemas/tooling_registry.py
  • polylogue/schemas/unified/adapters.py
  • polylogue/schemas/unified/fallbacks.py
  • polylogue/schemas/unified/models.py
  • polylogue/schemas/unified/provider_meta_coercion.py
  • polylogue/schemas/unified/provider_meta_harmonize.py
  • polylogue/schemas/unified/provider_meta_runtime.py
  • polylogue/schemas/unified/unified.py
  • polylogue/schemas/validator.py
  • polylogue/schemas/validator_resolution.py
  • polylogue/showcase/report_files.py
  • polylogue/sources/assembly_codex.py
  • polylogue/sources/dispatch.py
  • polylogue/sources/drive/gateway.py
  • polylogue/sources/drive/source_client.py
  • polylogue/sources/drive/source_protocol.py
  • polylogue/sources/drive/source_support.py
  • polylogue/sources/emitter.py
  • polylogue/sources/parsers/drive.py
  • polylogue/sources/parsers/drive_support_attachments.py
  • polylogue/sources/parsers/drive_support_blocks.py
  • polylogue/sources/providers/claude_code_models.py
  • polylogue/sources/providers/claude_code_record.py
  • polylogue/sources/providers/codex.py
  • polylogue/sources/providers/gemini_message.py
  • polylogue/sources/source_acquisition.py
  • polylogue/sources/source_acquisition_components.py
  • polylogue/storage/backends/queries/conversations_identity.py
  • polylogue/storage/backends/queries/mappers_product_legacy.py
  • polylogue/storage/backends/queries/mappers_support.py
  • polylogue/storage/backends/queries/publications.py
  • polylogue/storage/backends/queries/runs.py
  • polylogue/storage/hydrators.py
  • polylogue/storage/repair.py
  • polylogue/storage/repository/archive/repository_writes.py
  • polylogue/storage/repository/archive/writes/conversations.py
  • polylogue/storage/repository/archive/writes/metadata.py
  • polylogue/storage/runtime/__init__.py
  • polylogue/storage/runtime/archive/records.py
  • polylogue/surfaces/payloads.py
  • tests/benchmarks/test_pipeline.py
  • tests/infra/archive_scenarios.py
  • tests/infra/drive_mocks.py
  • tests/infra/json_contracts.py
  • tests/infra/large_batches.py
  • tests/infra/pipeline_roundtrip.py
  • tests/infra/schema_access.py
  • tests/infra/semantic_facts.py
  • tests/infra/state_machines.py
  • tests/infra/storage_records.py
  • tests/infra/strategies/providers.py
  • tests/infra/strategies/schema.py
  • tests/infra/strategies/schema_driven.py
  • tests/infra/strategies/sources.py
  • tests/integration/test_cli_machine_contract.py
  • tests/integration/test_workflows.py
  • tests/unit/cli/test_check.py
  • tests/unit/cli/test_click_app_main.py
  • tests/unit/cli/test_deterministic_output.py
  • tests/unit/cli/test_json_envelope_contract.py
  • tests/unit/cli/test_query_exec_laws.py
  • tests/unit/core/test_artifact_graph.py
  • tests/unit/core/test_code_detection.py
  • tests/unit/core/test_field_stats.py
  • tests/unit/core/test_filters_schemas.py
  • tests/unit/core/test_json.py
  • tests/unit/core/test_models.py
  • tests/unit/core/test_operator_inference.py
  • tests/unit/core/test_schema_annotation_contracts.py
  • tests/unit/core/test_schema_cluster_assignment.py
  • tests/unit/core/test_schema_corpus_alignment.py
  • tests/unit/core/test_schema_extraction_runtime.py
  • tests/unit/core/test_schema_laws.py
  • tests/unit/core/test_schema_pinning.py
  • tests/unit/core/test_schema_registry.py
  • tests/unit/core/test_schema_validation.py
  • tests/unit/core/test_synthetic_semantic_wiring.py
  • tests/unit/devtools/test_query_memory_budget.py
  • tests/unit/devtools/test_regression_capture.py
  • tests/unit/devtools/test_semantic_axis_evidence.py
  • tests/unit/devtools/test_verify_test_ownership.py
  • tests/unit/infra/test_regression_cases.py
  • tests/unit/pipeline/test_prepare_semantic.py
  • tests/unit/pipeline/test_run_sources.py
  • tests/unit/proof/test_schema_provider_obligations.py
  • tests/unit/proof/test_structural_error_evidence.py
  • tests/unit/scenarios/test_corpus.py
  • tests/unit/showcase/test_qa_markdown.py
  • tests/unit/sources/test_drive_ops.py
  • tests/unit/sources/test_parser_crashlessness.py
  • tests/unit/sources/test_parsers_drive.py
  • tests/unit/sources/test_parsers_props.py
  • tests/unit/sources/test_schema_driven.py
  • tests/unit/sources/test_source_laws.py
  • tests/unit/sources/test_unified_semantic_laws.py
  • tests/unit/storage/test_archive_search_contracts.py
  • tests/unit/test_mutmut_campaign.py

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refactor/core-json-clean

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 2a4a824 into master May 1, 2026
14 checks passed
@Sinity
Sinity deleted the feature/refactor/core-json-clean branch May 1, 2026 18:52
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Polylogue Proof Pack

Refs: origin/master..HEAD
Changed paths: 0

Affected Domains

  • none

Required Gates

  • devtools verify --quick — full PR gate remains explicit
  • devtools verify — full PR gate remains explicit
  • devtools build-package — deployment readiness gate; run when packaging or release confidence matters
  • nix flake check — deployment readiness gate; run when packaging or release confidence matters

Known Gaps

  • none for affected domains

Oracle / Cost

  • oracle mix: {}
  • cost tier: {}
  • stale evidence: 0
  • manual review cells: 0

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.

Pull request overview

This PR introduces a new polylogue.core package and relocates the project’s shared JSON typing/serialization contract from polylogue.lib.json to polylogue.core.json, reducing lib as a catch-all dependency and aligning with the ongoing package-boundary cleanup (ref #635).

Changes:

  • Add polylogue/core/json.py (orjson-backed JSON contract) and polylogue/core/__init__.py.
  • Update imports across runtime, devtools, docs, and tests to use polylogue.core.json (no compatibility shim retained).
  • Update topology ownership/projection and campaign/docs references to point at polylogue/core/json.py.

Reviewed changes

Copilot reviewed 199 out of 201 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/unit/test_mutmut_campaign.py Update mutation campaign paths/keys to polylogue/core/json.py / polylogue.core.json.*
tests/unit/storage/test_archive_search_contracts.py Switch JSONDocument import to polylogue.core.json
tests/unit/sources/test_unified_semantic_laws.py Switch JSON helpers import to polylogue.core.json
tests/unit/sources/test_source_laws.py Switch JSON types/helpers import to polylogue.core.json
tests/unit/sources/test_schema_driven.py Switch JSONValue import to polylogue.core.json
tests/unit/sources/test_parsers_props.py Switch JSON helpers import to polylogue.core.json
tests/unit/sources/test_parsers_drive.py Switch JSONDocument import to polylogue.core.json
tests/unit/sources/test_parser_crashlessness.py Switch JSONDocument import to polylogue.core.json
tests/unit/sources/test_drive_ops.py Switch JSON types import to polylogue.core.json
tests/unit/showcase/test_qa_markdown.py Switch JSON imports to polylogue.core.json
tests/unit/scenarios/test_corpus.py Switch JSONDocument import to polylogue.core.json
tests/unit/proof/test_structural_error_evidence.py Switch JSON imports to polylogue.core.json
tests/unit/proof/test_schema_provider_obligations.py Switch JSON imports to polylogue.core.json
tests/unit/pipeline/test_run_sources.py Switch JSON imports to polylogue.core.json
tests/unit/pipeline/test_prepare_semantic.py Switch JSON imports to polylogue.core.json
tests/unit/infra/test_regression_cases.py Switch JSONDocument import to polylogue.core.json
tests/unit/devtools/test_verify_test_ownership.py Update expected import string to polylogue.core.json
tests/unit/devtools/test_semantic_axis_evidence.py Switch JSONDocument import to polylogue.core.json
tests/unit/devtools/test_regression_capture.py Switch JSONDocument import to polylogue.core.json
tests/unit/devtools/test_query_memory_budget.py Switch json_document import to polylogue.core.json
tests/unit/core/test_synthetic_semantic_wiring.py Switch JSON imports to polylogue.core.json
tests/unit/core/test_schema_validation.py Switch json_document import to polylogue.core.json
tests/unit/core/test_schema_registry.py Switch JSON imports to polylogue.core.json
tests/unit/core/test_schema_pinning.py Switch JSONDocument import to polylogue.core.json
tests/unit/core/test_schema_laws.py Switch json_document import to polylogue.core.json
tests/unit/core/test_schema_extraction_runtime.py Switch JSONDocument import to polylogue.core.json
tests/unit/core/test_schema_corpus_alignment.py Switch JSON imports to polylogue.core.json
tests/unit/core/test_schema_cluster_assignment.py Switch JSON imports to polylogue.core.json
tests/unit/core/test_schema_annotation_contracts.py Switch JSONDocument import to polylogue.core.json
tests/unit/core/test_operator_inference.py Switch JSONDocument import to polylogue.core.json
tests/unit/core/test_models.py Switch JSON imports to polylogue.core.json
tests/unit/core/test_json.py Switch core JSON module import to polylogue.core package
tests/unit/core/test_filters_schemas.py Switch JSONDocument import to polylogue.core.json
tests/unit/core/test_field_stats.py Switch JSONDocument import to polylogue.core.json
tests/unit/core/test_code_detection.py Switch JSONDocument import to polylogue.core.json
tests/unit/core/test_artifact_graph.py Switch JSON imports to polylogue.core.json
tests/unit/cli/test_query_exec_laws.py Switch JSONDocument import to polylogue.core.json
tests/unit/cli/test_json_envelope_contract.py Switch JSONDocument import to polylogue.core.json
tests/unit/cli/test_deterministic_output.py Switch JSONDocument import to polylogue.core.json
tests/unit/cli/test_click_app_main.py Switch JSONDocument import to polylogue.core.json
tests/unit/cli/test_check.py Switch JSONDocument import to polylogue.core.json
tests/integration/test_workflows.py Switch JSONDocument import to polylogue.core.json
tests/integration/test_cli_machine_contract.py Switch JSON imports to polylogue.core.json
tests/infra/strategies/sources.py Switch JSON imports to polylogue.core.json
tests/infra/strategies/schema_driven.py Switch JSON imports to polylogue.core.json
tests/infra/strategies/schema.py Switch JSONDocument import to polylogue.core.json
tests/infra/strategies/providers.py Switch JSON imports to polylogue.core.json
tests/infra/storage_records.py Switch JSON helpers import to polylogue.core.json
tests/infra/state_machines.py Switch JSON imports to polylogue.core.json
tests/infra/semantic_facts.py Switch JSON imports to polylogue.core.json
tests/infra/schema_access.py Switch JSON imports to polylogue.core.json
tests/infra/pipeline_roundtrip.py Switch JSON imports to polylogue.core.json
tests/infra/large_batches.py Switch JSONDocument import to polylogue.core.json
tests/infra/json_contracts.py Switch JSON imports to polylogue.core.json
tests/infra/drive_mocks.py Switch JSON helpers import to polylogue.core.json
tests/infra/archive_scenarios.py Switch JSON imports to polylogue.core.json
tests/benchmarks/test_pipeline.py Switch JSONDocument import to polylogue.core.json
polylogue/surfaces/payloads.py Switch JSON imports to polylogue.core.json
polylogue/storage/runtime/archive/records.py Switch json_document import to polylogue.core.json
polylogue/storage/runtime/init.py Switch json_dumps import to polylogue.core.json
polylogue/storage/repository/archive/writes/metadata.py Switch JSONDocument import to polylogue.core.json
polylogue/storage/repository/archive/writes/conversations.py Switch JSON imports to polylogue.core.json
polylogue/storage/repository/archive/repository_writes.py Switch JSON imports to polylogue.core.json
polylogue/storage/repair.py Switch JSON imports to polylogue.core.json
polylogue/storage/hydrators.py Switch loads import to polylogue.core.json
polylogue/storage/backends/queries/runs.py Switch json_document import to polylogue.core.json
polylogue/storage/backends/queries/publications.py Switch json_document import to polylogue.core.json
polylogue/storage/backends/queries/mappers_support.py Switch JSON imports to polylogue.core.json
polylogue/storage/backends/queries/mappers_product_legacy.py Switch JSON imports to polylogue.core.json
polylogue/storage/backends/queries/conversations_identity.py Switch JSON imports to polylogue.core.json
polylogue/sources/source_acquisition_components.py Switch JSON imports to polylogue.core.json
polylogue/sources/source_acquisition.py Switch JSONValue import to polylogue.core.json
polylogue/sources/providers/gemini_message.py Switch json_document import to polylogue.core.json
polylogue/sources/providers/codex.py Switch JSON imports to polylogue.core.json
polylogue/sources/providers/claude_code_record.py Switch JSON imports to polylogue.core.json
polylogue/sources/providers/claude_code_models.py Switch json_document import to polylogue.core.json
polylogue/sources/parsers/drive_support_blocks.py Switch JSON imports to polylogue.core.json
polylogue/sources/parsers/drive_support_attachments.py Switch JSON imports to polylogue.core.json
polylogue/sources/parsers/drive.py Switch JSON imports to polylogue.core.json
polylogue/sources/emitter.py Switch dumps_bytes import to polylogue.core.json
polylogue/sources/drive/source_support.py Switch JSON imports to polylogue.core.json
polylogue/sources/drive/source_protocol.py Switch JSONValue import to polylogue.core.json
polylogue/sources/drive/source_client.py Switch JSON imports to polylogue.core.json
polylogue/sources/drive/gateway.py Switch JSON imports to polylogue.core.json
polylogue/sources/dispatch.py Switch JSON imports to polylogue.core.json
polylogue/sources/assembly_codex.py Switch json_document import to polylogue.core.json
polylogue/showcase/report_files.py Switch JSON imports to polylogue.core.json
polylogue/schemas/validator_resolution.py Switch JSONDocument import to polylogue.core.json
polylogue/schemas/validator.py Switch JSON imports to polylogue.core.json
polylogue/schemas/unified/unified.py Switch JSONDocument import to polylogue.core.json
polylogue/schemas/unified/provider_meta_runtime.py Switch JSON imports to polylogue.core.json
polylogue/schemas/unified/provider_meta_harmonize.py Switch JSON imports to polylogue.core.json
polylogue/schemas/unified/provider_meta_coercion.py Switch JSON imports to polylogue.core.json
polylogue/schemas/unified/models.py Switch JSONDocument import to polylogue.core.json
polylogue/schemas/unified/fallbacks.py Switch JSON imports to polylogue.core.json
polylogue/schemas/unified/adapters.py Switch JSONDocument import to polylogue.core.json
polylogue/schemas/tooling_registry.py Switch JSON imports to polylogue.core.json
polylogue/schemas/tooling_models.py Switch JSON imports to polylogue.core.json
polylogue/schemas/tooling_diff.py Switch JSON imports to polylogue.core.json
polylogue/schemas/synthetic/build_batch.py Switch JSON imports to polylogue.core.json
polylogue/schemas/shape_fingerprint.py Switch JSONDocument import to polylogue.core.json
polylogue/schemas/sampling_sessions.py Switch JSON imports to polylogue.core.json
polylogue/schemas/sampling_db.py Switch JSONDocument import to polylogue.core.json
polylogue/schemas/sampling.py Switch JSONDocument import to polylogue.core.json
polylogue/schemas/runtime_registry.py Switch json_document import to polylogue.core.json
polylogue/schemas/redaction_report.py Switch JSON imports to polylogue.core.json
polylogue/schemas/pinning.py Switch JSON imports to polylogue.core.json
polylogue/schemas/packages.py Switch JSON imports to polylogue.core.json
polylogue/schemas/operator/registry.py Switch JSONDocument import to polylogue.core.json
polylogue/schemas/operator/inference.py Switch JSONDocument import to polylogue.core.json
polylogue/schemas/operator/annotations.py Switch JSON imports to polylogue.core.json
polylogue/schemas/observation_runtime.py Switch JSON imports to polylogue.core.json
polylogue/schemas/observation_models.py Switch JSON imports to polylogue.core.json
polylogue/schemas/inference/relational/models.py Switch JSONDocument import to polylogue.core.json
polylogue/schemas/generation/support.py Switch JSON imports to polylogue.core.json
polylogue/schemas/generation/semantic_relations.py Switch JSON imports to polylogue.core.json
polylogue/schemas/generation/schema_builder.py Switch JSON imports to polylogue.core.json
polylogue/schemas/generation/provider_bundle_packages.py Switch JSON imports to polylogue.core.json
polylogue/schemas/generation/models.py Switch JSONDocument import to polylogue.core.json
polylogue/schemas/generation/field_annotations.py Switch JSON imports to polylogue.core.json
polylogue/schemas/generation/dynamic_keys.py Switch JSON imports to polylogue.core.json
polylogue/schemas/extraction.py Switch JSON imports to polylogue.core.json
polylogue/schemas/code_detection/extractors.py Switch JSON imports to polylogue.core.json
polylogue/schemas/audit/walkers.py Switch JSON imports to polylogue.core.json
polylogue/schemas/audit/models.py Switch JSON imports to polylogue.core.json
polylogue/schemas/audit/checks.py Switch JSON imports to polylogue.core.json
polylogue/rendering/block_models.py Switch JSON imports to polylogue.core.json
polylogue/readiness/init.py Switch JSON imports to polylogue.core.json
polylogue/protocols.py Switch JSON imports to polylogue.core.json
polylogue/proof/witnesses.py Switch JSON imports to polylogue.core.json
polylogue/proof/traces.py Switch JSON imports to polylogue.core.json
polylogue/proof/subjects.py Switch JSON imports to polylogue.core.json
polylogue/proof/runners.py Switch JSON imports to polylogue.core.json
polylogue/proof/models.py Switch JSON imports to polylogue.core.json
polylogue/proof/generated_scenarios.py Switch JSON imports to polylogue.core.json
polylogue/proof/diffing.py Switch JSONDocument import to polylogue.core.json
polylogue/proof/coverage_manifests.py Switch JSON imports to polylogue.core.json
polylogue/proof/catalog.py Switch JSONDocument import to polylogue.core.json
polylogue/products/export_bundles.py Switch JSON imports to polylogue.core.json
polylogue/pipeline/services/ingest_worker.py Switch dumps import to polylogue.core.json
polylogue/pipeline/services/acquisition_streams.py Switch JSONDocument import to polylogue.core.json
polylogue/pipeline/services/acquisition.py Switch JSONDocument import to polylogue.core.json
polylogue/pipeline/semantic_metadata.py Switch JSON imports to polylogue.core.json
polylogue/pipeline/semantic_capture.py Switch JSON imports to polylogue.core.json
polylogue/pipeline/run_support.py Switch JSON imports to polylogue.core.json
polylogue/pipeline/run_finalization.py Switch JSONDocument import to polylogue.core.json
polylogue/pipeline/run_execution.py Switch JSON imports to polylogue.core.json
polylogue/pipeline/payload_types.py Switch JSONDocument import to polylogue.core.json
polylogue/pipeline/materialization_runtime.py Switch JSON imports to polylogue.core.json
polylogue/pipeline/ids.py Switch JSONValue import to polylogue.core.json
polylogue/operations/specs.py Switch JSON imports to polylogue.core.json
polylogue/mcp/payloads.py Switch JSONDocument import to polylogue.core.json
polylogue/maintenance/targets.py Switch JSON imports to polylogue.core.json
polylogue/maintenance/models.py Switch JSON imports to polylogue.core.json
polylogue/lib/pricing.py Switch json_document import to polylogue.core.json
polylogue/lib/outcomes.py Switch JSON imports to polylogue.core.json
polylogue/lib/metrics.py Switch JSON imports to polylogue.core.json
polylogue/core/json.py New core JSON contract module (typed JSON + orjson/stdlib fallback)
polylogue/core/init.py New polylogue.core package marker
polylogue/cli/shared/machine_errors.py Switch JSON imports to polylogue.core.json
polylogue/cli/shared/check_workflow.py Switch JSON imports to polylogue.core.json
polylogue/cli/shared/check_rendering_json.py Switch json_document import to polylogue.core.json
polylogue/cli/shared/check_models.py Switch JSON imports to polylogue.core.json
polylogue/cli/query_output_contracts.py Switch JSONDocument import to polylogue.core.json
polylogue/cli/query_output.py Switch JSONDocument import to polylogue.core.json
polylogue/cli/query.py Switch JSONDocument import to polylogue.core.json
polylogue/cli/commands/browser_capture.py Switch dumps import to polylogue.core.json
polylogue/browser_capture/server.py Switch dumps_bytes import to polylogue.core.json
polylogue/browser_capture/models.py Switch JSON helpers import to polylogue.core.json
polylogue/artifacts/graph.py Switch JSON imports to polylogue.core.json
polylogue/artifacts/init.py Switch JSON imports to polylogue.core.json
polylogue/archive/viewport/tools.py Switch JSONValue import to polylogue.core.json
polylogue/archive/semantic/models.py Switch JSON imports to polylogue.core.json
polylogue/archive/raw_payload/sampling_extract.py Switch JSON imports to polylogue.core.json
polylogue/archive/raw_payload/sampling_buckets.py Switch JSON imports to polylogue.core.json
polylogue/archive/raw_payload/decode.py Switch JSON imports to polylogue.core.json
polylogue/archive/raw_payload/init.py Re-export JSON types from polylogue.core.json
polylogue/archive/query/miss_diagnostics.py Switch JSONDocument import to polylogue.core.json
polylogue/archive/provider/semantics.py Switch JSON imports to polylogue.core.json
polylogue/archive/provider/capabilities.py Switch JSON imports to polylogue.core.json
polylogue/archive/message/model_runtime.py Switch JSON imports to polylogue.core.json
polylogue/archive/artifact_taxonomy/support.py Switch JSON imports to polylogue.core.json
polylogue/archive/artifact_taxonomy/runtime.py Switch JSON imports to polylogue.core.json
polylogue/archive/action_event/parsing.py Switch JSON imports to polylogue.core.json
docs/topology-status.md Add core-primitive bucket and update declared/realized counts
docs/test-quality-workflows.md Update JSON workflow path to polylogue/core/json.py
docs/plans/topology-target.yaml Assign polylogue/core/* files to core-primitive; remove lib/json.py
docs/plans/campaign-coverage.yaml Update mutation campaign path to polylogue/core/json.py
devtools/witness_minimize.py Switch dumps import to polylogue.core.json
devtools/witness_discover.py Switch dumps import to polylogue.core.json
devtools/verify_witness_lifecycle.py Switch dumps import to polylogue.core.json
devtools/verify_layering.py Switch dumps import to polylogue.core.json
devtools/semantic_axis_evidence.py Switch JSON imports to polylogue.core.json
devtools/scenario_coverage.py Switch JSON imports to polylogue.core.json
devtools/regression_cases.py Switch JSON imports to polylogue.core.json
devtools/pipeline_probe.py Switch JSON imports to polylogue.core.json
devtools/obligation_diff.py Switch dumps import to polylogue.core.json
devtools/mutation_scenario_catalog.py Update JSON mutation campaign path to polylogue/core/json.py
devtools/inject_semantic_annotations.py Switch JSON imports to polylogue.core.json
devtools/build_topology_projection.py Add polylogue/core/ classification and remove lib/json.py from lib-root primitives
devtools/benchmark_campaign.py Switch JSON imports to polylogue.core.json

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sinity added a commit that referenced this pull request May 1, 2026
## Summary

Move shared hashing helpers from `polylogue.lib.hashing` to
`polylogue.core.hashing`.

## Problem

The hashing helpers are low-level primitives used by archive IDs,
storage row IDs, browser capture artifact names, parser attachment IDs,
and benchmarks. They are not generic catch-all `lib` code and should
live with the new core primitive package introduced by #659.

## Solution

Rename `polylogue/lib/hashing.py` to `polylogue/core/hashing.py`, update
all imports and generated docs/topology references, and keep no old-path
shim.

## Verification

- `devtools build-topology-projection && devtools verify-topology` —
realized=697 declared=697 blocking=False
- `ruff check polylogue/ tests/ devtools/` — all checks passed
- `mypy polylogue/` — no issues found in 697 source files
- `pytest -q tests/unit/core/test_hashing.py
tests/unit/pipeline/test_pipeline_ids.py
tests/unit/storage/test_archive_search_contracts.py
tests/benchmarks/test_pipeline.py` — 84 passed
- `devtools render-all --check` — sync OK
- pre-push `devtools verify --quick` — all checks passed

Ref #635
Sinity added a commit that referenced this pull request May 7, 2026
## Summary

Introduce `polylogue.core` and move the shared JSON type/serialization
contract from `polylogue.lib.json` to `polylogue.core.json`.

## Problem

`json.py` is a low-level runtime primitive used by archive, storage,
schema, proof, devtools, tests, and surfaces. Keeping it under `lib`
preserved one of the largest remaining catch-all dependencies after the
archive-domain package cleanup tracked by #635.

## Solution

Create `polylogue/core/`, move `json.py` there, update all imports and
generated topology ownership, and refresh generated docs. No
compatibility shim is kept; consumers now import the primitive from its
core home.

## Verification

- `devtools build-topology-projection && devtools verify-topology` —
realized=697 declared=697 blocking=False
- `ruff check polylogue/ tests/ devtools/` — all checks passed
- `mypy --no-incremental` — no issues found in 1217 source files
- `mypy` — no issues found in 1217 source files
- `pytest -q tests/unit/core/test_json.py
tests/infra/test_json_contracts.py
tests/unit/devtools/test_verify_test_ownership.py
tests/unit/test_mutmut_campaign.py` — 68 passed
- `pytest -q tests/unit/cli/test_json_envelope_contract.py
tests/unit/cli/test_query_exec_laws.py
tests/unit/mcp/test_tool_contracts.py
tests/unit/mcp/test_server_surfaces.py` — 214 passed
- `pytest -q tests/unit/core/test_schema_registry.py
tests/unit/core/test_schema_laws.py
tests/unit/devtools/test_verify_schema_roundtrip.py
tests/property/test_schema_roundtrip.py` — 58 passed
- `devtools render-all --check` — sync OK
- `devtools verify --quick` — all checks passed
- pre-push `devtools verify --quick` — all checks passed

Ref #635
Sinity added a commit that referenced this pull request May 7, 2026
## Summary

Move shared hashing helpers from `polylogue.lib.hashing` to
`polylogue.core.hashing`.

## Problem

The hashing helpers are low-level primitives used by archive IDs,
storage row IDs, browser capture artifact names, parser attachment IDs,
and benchmarks. They are not generic catch-all `lib` code and should
live with the new core primitive package introduced by #659.

## Solution

Rename `polylogue/lib/hashing.py` to `polylogue/core/hashing.py`, update
all imports and generated docs/topology references, and keep no old-path
shim.

## Verification

- `devtools build-topology-projection && devtools verify-topology` —
realized=697 declared=697 blocking=False
- `ruff check polylogue/ tests/ devtools/` — all checks passed
- `mypy polylogue/` — no issues found in 697 source files
- `pytest -q tests/unit/core/test_hashing.py
tests/unit/pipeline/test_pipeline_ids.py
tests/unit/storage/test_archive_search_contracts.py
tests/benchmarks/test_pipeline.py` — 84 passed
- `devtools render-all --check` — sync OK
- pre-push `devtools verify --quick` — all checks passed

Ref #635
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.

2 participants