open-code-review-toolkit 0.14.7__tar.gz → 0.15.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/PKG-INFO +3 -2
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/README.md +2 -1
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/_version.py +2 -2
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/cli.py +0 -6
- open_code_review_toolkit-0.15.0/src/ocr_toolkit/common/provider_http.py +25 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/configure.py +4 -0
- open_code_review_toolkit-0.15.0/src/ocr_toolkit/context/dlp/contact_labels.py +129 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/dlp/datetimes.py +25 -4
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/dlp/numeric.py +49 -41
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/artifacts.py +0 -2
- open_code_review_toolkit-0.15.0/src/ocr_toolkit/evidence/budgets.py +77 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/categorize.py +9 -5
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/collect.py +39 -36
- open_code_review_toolkit-0.15.0/src/ocr_toolkit/evidence/collectors/admission.py +197 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/collectors/orchestration.py +20 -1
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/collectors/registry.py +20 -0
- open_code_review_toolkit-0.15.0/src/ocr_toolkit/evidence/container_paths.py +15 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/coverage.py +43 -1
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/ecosystems/contracts.py +2 -0
- open_code_review_toolkit-0.15.0/src/ocr_toolkit/evidence/ecosystems/dotnet/__init__.py +6 -0
- open_code_review_toolkit-0.15.0/src/ocr_toolkit/evidence/ecosystems/dotnet/json.py +188 -0
- open_code_review_toolkit-0.15.0/src/ocr_toolkit/evidence/ecosystems/dotnet/limits.py +51 -0
- open_code_review_toolkit-0.15.0/src/ocr_toolkit/evidence/ecosystems/dotnet/linking.py +155 -0
- open_code_review_toolkit-0.15.0/src/ocr_toolkit/evidence/ecosystems/dotnet/xml.py +343 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/frameworks/providers/__init__.py +2 -1
- open_code_review_toolkit-0.15.0/src/ocr_toolkit/evidence/frameworks/providers/dotnet.py +150 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/frameworks/registry.py +2 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/frameworks/schema.py +4 -2
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/infrastructure.py +4 -2
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/mcp.py +9 -4
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/repository.py +21 -4
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/store/contracts.py +17 -2
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/store/core.py +58 -86
- open_code_review_toolkit-0.15.0/src/ocr_toolkit/evidence/store/serialization.py +38 -0
- open_code_review_toolkit-0.15.0/src/ocr_toolkit/evidence/store/target.py +100 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/store/values.py +36 -1
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/native_capabilities.py +15 -1
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/gitlab.py +40 -4
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/workflow.py +20 -8
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/pre_execution.py +54 -7
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/preflight.py +48 -6
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/provider_config.py +38 -3
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/providers/gitlab.py +32 -3
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/providers/gitlab_ci.py +22 -3
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/providers/gitlab_discussions.py +19 -3
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/review_debug.py +12 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/review_runner.py +123 -282
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/.gitignore +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/LICENSE +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/pyproject.toml +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/common/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/common/filesystem.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/common/git.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/common/language.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/common/literal_context.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/common/markdown.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/common/redaction.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/common/value_boundaries.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/config_writer.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/broker.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/ci_outcomes.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/code_text.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/contracts.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/dlp/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/dlp/admission.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/dlp/credentials.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/dlp/decoding.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/dlp/email.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/dlp/markup.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/dlp/presentation.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/dlp/projection.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/dlp/result_prose.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/mcp.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/policy.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/recognizers.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/context/store.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/diagrams/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/diagrams/admission.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/diagrams/collector.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/diagrams/contracts.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/diagrams/diagnostics.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/diagrams/lifecycle.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/diagrams/mcp.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/diagrams/persistence.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/diagrams/sources.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/dlp_audit/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/dlp_audit/__main__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/dlp_audit/cli.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/dlp_audit/corpus.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/dlp_audit/limits.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/dlp_audit/proof.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/dlp_audit/report.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/dlp_audit/scanner.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/dlp_audit/state.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/dlp_audit/worker_process.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/__main__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/actions.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/collectors/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/collectors/graphs.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/collectors/projections.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/collectors/sources.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/ecosystems/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/ecosystems/ansible/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/ecosystems/ansible/requirements.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/ecosystems/ansible/topology.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/ecosystems/go.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/ecosystems/javascript.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/ecosystems/php.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/ecosystems/python.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/frameworks/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/frameworks/contracts.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/frameworks/detection.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/frameworks/providers/frontend.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/frameworks/providers/go.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/frameworks/providers/php.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/frameworks/providers/python.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/frameworks/templates.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/gitlink_projection.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/gitlinks.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/invocation.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/model.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/opaque_code.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/policy/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/policy/contracts.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/policy/decisions.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/policy/guidance.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/policy/registry.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/policy/schema.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/policy/scopes.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/project.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/review_context.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/review_range.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/source_reader.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/source_syntax.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/store/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/store/atomic.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/store/readback.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/text_contracts.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/text_excerpts.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/evidence/text_metadata.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/federation/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/federation/admission.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/federation/contracts.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/federation/gateway.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/federation/registry.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/federation/relay.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/federation/runtime.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/federation/transport.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/local_chatgpt.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/mcp_config.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/ocr_result.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/__main__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/approval.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/comments.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/formatting.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/freshness.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/gitlab_approval.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/markers.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/payloads.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/reconciliation.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/result.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/settings.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/snapshot.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/source_suggestions.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/suggestions.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/posting/transaction.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/provider_failure.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/providers/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/providers/gitlab_context.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/providers/gitlab_identity.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/providers/gitlab_remediation.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/providers/local.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/providers/local_config.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/py.typed +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/reporting/__init__.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/reporting/diagram.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/reporting/diagram_layout.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/reporting/dlp.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/reporting/federation.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/reporting/metadata.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/reporting/model.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/reporting/outcome.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/reporting/result.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/reporting/sections.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/reporting/text.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/reporting/usage.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/reporting/warnings.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/repository_coverage.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/result_contract.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/result_usage.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/review_identity.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/review_progress.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/review_range.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/review_receipt.py +0 -0
- {open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/review_trace.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: open-code-review-toolkit
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.15.0
|
|
4
4
|
Summary: Unofficial GitLab CI integration layer for Open Code Review
|
|
5
5
|
Project-URL: Homepage, https://github.com/xeonvs/open-code-review-toolkit
|
|
6
6
|
Project-URL: Repository, https://github.com/xeonvs/open-code-review-toolkit
|
|
@@ -353,7 +353,8 @@ The shipped Repository Evidence Engine reads immutable base/head Git objects, st
|
|
|
353
353
|
|
|
354
354
|
- [Toolkit strategy](docs/engineering/toolkit_strategy.md) - durable product boundaries, architecture, invariants, and non-goals.
|
|
355
355
|
- [Bounded review context](docs/review-context.md) - protected policy, GitLab discussions and same-revision CI outcomes, legacy reference migration, opaque handles, DLP, receipt, and cleanup contracts.
|
|
356
|
-
- [
|
|
356
|
+
- [Static .NET evidence](docs/review-context.md#static-net-evidence) - project SDK/framework settings, declared and locked packages, and source-scoped central-version provenance through the same evidence MCP.
|
|
357
|
+
- [Roadmap](ROADMAP.md) - nearest and conditional outcomes with activation signals.
|
|
357
358
|
- [Backlog](docs/codex/TASKS_BACKLOG.md) - inactive implementation-ready work; active execution remains in `PLANS.md`.
|
|
358
359
|
|
|
359
360
|
## GitLab CI quick start
|
|
@@ -115,7 +115,8 @@ The shipped Repository Evidence Engine reads immutable base/head Git objects, st
|
|
|
115
115
|
|
|
116
116
|
- [Toolkit strategy](docs/engineering/toolkit_strategy.md) - durable product boundaries, architecture, invariants, and non-goals.
|
|
117
117
|
- [Bounded review context](docs/review-context.md) - protected policy, GitLab discussions and same-revision CI outcomes, legacy reference migration, opaque handles, DLP, receipt, and cleanup contracts.
|
|
118
|
-
- [
|
|
118
|
+
- [Static .NET evidence](docs/review-context.md#static-net-evidence) - project SDK/framework settings, declared and locked packages, and source-scoped central-version provenance through the same evidence MCP.
|
|
119
|
+
- [Roadmap](ROADMAP.md) - nearest and conditional outcomes with activation signals.
|
|
119
120
|
- [Backlog](docs/codex/TASKS_BACKLOG.md) - inactive implementation-ready work; active execution remains in `PLANS.md`.
|
|
120
121
|
|
|
121
122
|
## GitLab CI quick start
|
{open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/_version.py
RENAMED
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.
|
|
22
|
-
__version_tuple__ = version_tuple = (0,
|
|
21
|
+
__version__ = version = '0.15.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 15, 0)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -63,11 +63,6 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
63
63
|
review_parser.add_argument(
|
|
64
64
|
"--debug-dir", help="Fresh private diagnostic bundle directory (requires --local)."
|
|
65
65
|
)
|
|
66
|
-
review_parser.add_argument(
|
|
67
|
-
"--preserve-private-artifacts",
|
|
68
|
-
action="store_true",
|
|
69
|
-
help="Retain sensitive OCR session artifacts after a local diagnostic review.",
|
|
70
|
-
)
|
|
71
66
|
review_parser.add_argument(
|
|
72
67
|
"ocr_args", nargs=argparse.REMAINDER, help="OCR review arguments after --."
|
|
73
68
|
)
|
|
@@ -118,7 +113,6 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|
|
118
113
|
Path(args.result),
|
|
119
114
|
Path(args.stderr),
|
|
120
115
|
ocr_args,
|
|
121
|
-
preserve_private_artifacts=args.preserve_private_artifacts,
|
|
122
116
|
**({"local": True} if args.local else {}),
|
|
123
117
|
**({"report_path": Path(args.report)} if args.report is not None else {}),
|
|
124
118
|
**({"debug_dir": Path(args.debug_dir)} if args.debug_dir is not None else {}),
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Small provider-neutral policy for outbound forge API request identity."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
|
|
5
|
+
DEFAULT_FORGE_API_USER_AGENT = "open-code-review-toolkit-provider/1"
|
|
6
|
+
FORGE_API_USER_AGENT_VARIABLE = "OCR_FORGE_API_USER_AGENT"
|
|
7
|
+
_UNSET = object()
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def resolve_forge_api_user_agent(environment: Mapping[str, str]) -> str:
|
|
11
|
+
"""Resolve a bounded printable ASCII agent without exposing invalid input."""
|
|
12
|
+
|
|
13
|
+
value = environment.get(FORGE_API_USER_AGENT_VARIABLE, _UNSET)
|
|
14
|
+
if value is _UNSET:
|
|
15
|
+
return DEFAULT_FORGE_API_USER_AGENT
|
|
16
|
+
if (
|
|
17
|
+
not isinstance(value, str)
|
|
18
|
+
or not 1 <= len(value) <= 256
|
|
19
|
+
or any(not 32 <= ord(character) <= 126 for character in value)
|
|
20
|
+
or not value.strip()
|
|
21
|
+
):
|
|
22
|
+
raise ValueError(
|
|
23
|
+
f"{FORGE_API_USER_AGENT_VARIABLE} must be nonblank printable ASCII (1-256 bytes)"
|
|
24
|
+
)
|
|
25
|
+
return value
|
{open_code_review_toolkit-0.14.7 → open_code_review_toolkit-0.15.0}/src/ocr_toolkit/configure.py
RENAMED
|
@@ -13,6 +13,7 @@ from ocr_toolkit.local_chatgpt import LocalChatGPTError, auth_mode, provider_ent
|
|
|
13
13
|
from ocr_toolkit.provider_config import (
|
|
14
14
|
ProviderConfigError,
|
|
15
15
|
provider_config_from_environment,
|
|
16
|
+
provider_url_notice,
|
|
16
17
|
)
|
|
17
18
|
|
|
18
19
|
|
|
@@ -74,6 +75,9 @@ def build_config_updates(*, local: bool = False) -> dict[str, Any]:
|
|
|
74
75
|
updates["llm.extra_headers"] = request_controls.extra_headers
|
|
75
76
|
if request_controls.extra_body is not None:
|
|
76
77
|
updates["llm.extra_body"] = request_controls.extra_body
|
|
78
|
+
notice = provider_url_notice(provider)
|
|
79
|
+
if notice:
|
|
80
|
+
print(f"WARNING: {redact_sensitive(notice)}", file=sys.stderr)
|
|
77
81
|
except (ProviderConfigError, LocalChatGPTError) as exc:
|
|
78
82
|
raise OCRRuntimeConfigError(str(exc)) from exc
|
|
79
83
|
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"""Recognize bounded contact labels without evaluating source-language expressions."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
import unicodedata
|
|
7
|
+
|
|
8
|
+
_CONTACT_HINT = re.compile(r"phone|tel|contact|call", re.IGNORECASE)
|
|
9
|
+
_CONTACT_WORDS = frozenset({"call", "phone", "telephone", "tel", "contact"})
|
|
10
|
+
_QUOTES = {'"': '"', "'": "'", "\u201c": "\u201d", "\u2018": "\u2019"}
|
|
11
|
+
_LABEL_WINDOW = 256
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _contact_context(prefix: str) -> bool:
|
|
15
|
+
"""Recognize contact words in human labels and identifier components."""
|
|
16
|
+
|
|
17
|
+
prefix = prefix[-64:].rstrip(" \t")
|
|
18
|
+
if not prefix or not prefix[-1].isalnum() or _CONTACT_HINT.search(prefix) is None:
|
|
19
|
+
return False
|
|
20
|
+
parts: list[str] = []
|
|
21
|
+
word = ""
|
|
22
|
+
for index, char in enumerate(prefix):
|
|
23
|
+
if not char.isalnum():
|
|
24
|
+
if word:
|
|
25
|
+
parts.append(word.casefold())
|
|
26
|
+
word = ""
|
|
27
|
+
continue
|
|
28
|
+
previous = prefix[index - 1] if index else ""
|
|
29
|
+
camel_boundary = (
|
|
30
|
+
bool(word)
|
|
31
|
+
and char.isupper()
|
|
32
|
+
and (
|
|
33
|
+
not previous.isupper() or (index + 1 < len(prefix) and prefix[index + 1].islower())
|
|
34
|
+
)
|
|
35
|
+
)
|
|
36
|
+
if camel_boundary:
|
|
37
|
+
parts.append(word.casefold())
|
|
38
|
+
word = ""
|
|
39
|
+
word += char
|
|
40
|
+
parts.append(word.casefold())
|
|
41
|
+
last = parts[-1]
|
|
42
|
+
if last in {"number", "no"} and len(parts) > 1:
|
|
43
|
+
return parts[-2] in _CONTACT_WORDS
|
|
44
|
+
return last in _CONTACT_WORDS or any(
|
|
45
|
+
last.endswith(suffix) and last[: -len(suffix)] in _CONTACT_WORDS
|
|
46
|
+
for suffix in ("number", "no")
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _key_label(key: str) -> str | None:
|
|
51
|
+
"""Read a literal or bare key; computed and interpolated keys are not labels."""
|
|
52
|
+
key = key.strip()
|
|
53
|
+
if not key or len(key) > 64:
|
|
54
|
+
return None
|
|
55
|
+
quoted = key[0] in _QUOTES
|
|
56
|
+
if quoted:
|
|
57
|
+
if key[-1] != _QUOTES[key[0]] or len(key) < 3:
|
|
58
|
+
return None
|
|
59
|
+
key = key[1:-1]
|
|
60
|
+
separators = "_-. \t" if quoted else "_"
|
|
61
|
+
if not key or not all(char.isalnum() or char in separators for char in key):
|
|
62
|
+
return None
|
|
63
|
+
return key
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _closed_label(target: str, *, left_complete: bool) -> bool:
|
|
67
|
+
"""Read the terminal key, allowing ordinal postfixes but not calls or expressions."""
|
|
68
|
+
target = target.rstrip()
|
|
69
|
+
while target.endswith("]"):
|
|
70
|
+
opening = target.rfind("[")
|
|
71
|
+
if opening < 0:
|
|
72
|
+
return False
|
|
73
|
+
key = _key_label(target[opening + 1 : -1])
|
|
74
|
+
if key is None:
|
|
75
|
+
return False
|
|
76
|
+
if not key.isdecimal():
|
|
77
|
+
return _contact_context(key)
|
|
78
|
+
target = target[:opening].rstrip()
|
|
79
|
+
if target.endswith(")"):
|
|
80
|
+
opening = target.rfind("(")
|
|
81
|
+
preceding = target[:opening].rstrip()
|
|
82
|
+
if (
|
|
83
|
+
opening < 0
|
|
84
|
+
or (preceding and (preceding[-1].isalnum() or preceding[-1] in "_])"))
|
|
85
|
+
or (not preceding and not left_complete)
|
|
86
|
+
):
|
|
87
|
+
return False
|
|
88
|
+
key = _key_label(target[opening + 1 : -1])
|
|
89
|
+
return key is not None and _contact_context(key)
|
|
90
|
+
# A terminal non-contact field must not inherit an earlier contact selector.
|
|
91
|
+
cursor = len(target)
|
|
92
|
+
while cursor and (target[cursor - 1].isalnum() or target[cursor - 1] in "_.-"):
|
|
93
|
+
cursor -= 1
|
|
94
|
+
return _contact_context(target[cursor:])
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def _structured_label(prefix: str, *, left_complete: bool) -> bool:
|
|
98
|
+
"""Require an adjacent binding separator before traversing a closed target."""
|
|
99
|
+
cursor = len(prefix)
|
|
100
|
+
while cursor and (prefix[cursor - 1].isspace() or prefix[cursor - 1] in "\"'\u201c\u2018([{"):
|
|
101
|
+
cursor -= 1
|
|
102
|
+
if not cursor or prefix[cursor - 1] not in "=:":
|
|
103
|
+
return False
|
|
104
|
+
separator = cursor - 1
|
|
105
|
+
# Comparisons, arrows and compound operators do not establish label intent.
|
|
106
|
+
if separator and prefix[separator - 1] in "=!<>+-*/%&|^?:":
|
|
107
|
+
return False
|
|
108
|
+
return _closed_label(prefix[:separator], left_complete=left_complete)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def _explicit_context(value: str, start: int) -> bool:
|
|
112
|
+
"""Bind a candidate to a nearby human label or a closed structured label target."""
|
|
113
|
+
lower = max(0, start - _LABEL_WINDOW)
|
|
114
|
+
if _structured_label(value[lower:start], left_complete=lower == 0):
|
|
115
|
+
return True
|
|
116
|
+
cursor = start
|
|
117
|
+
while cursor > lower:
|
|
118
|
+
char = value[cursor - 1]
|
|
119
|
+
category = unicodedata.category(char)
|
|
120
|
+
if char == "=" and cursor > lower + 1 and value[cursor - 2] in "=<>!+-*/%&|^":
|
|
121
|
+
return False
|
|
122
|
+
if (
|
|
123
|
+
char in "+-/*%&\\!,;?"
|
|
124
|
+
or category == "Pe"
|
|
125
|
+
or not (char in "\t=" or category.startswith("P") or category == "Zs")
|
|
126
|
+
):
|
|
127
|
+
break
|
|
128
|
+
cursor -= 1
|
|
129
|
+
return _contact_context(value[max(lower, cursor - 64) : cursor])
|
|
@@ -4,10 +4,11 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import re
|
|
6
6
|
import unicodedata
|
|
7
|
-
from datetime import datetime
|
|
7
|
+
from datetime import date, datetime
|
|
8
8
|
|
|
9
|
+
CALENDAR_DAY_PATTERN = r"(?:\d{4}-\d{2}-\d{2}|\d{2}\.\d{2}\.\d{4})"
|
|
9
10
|
_DATETIME = re.compile(
|
|
10
|
-
|
|
11
|
+
rf"(?P<day>{CALENDAR_DAY_PATTERN})(?:T|[ \t]+)"
|
|
11
12
|
r"(?P<clock>\d{2}:\d{2}(?::\d{2}(?:[.,]\d{1,9})?)?)"
|
|
12
13
|
r"(?P<zone>Z|[ \t]+UTC|[+-]\d{2}:?\d{2})?",
|
|
13
14
|
re.IGNORECASE,
|
|
@@ -16,7 +17,17 @@ _CONTINUED_ZONE = re.compile(r"(?:UTC|Z(?:$|[^a-z]))", re.IGNORECASE)
|
|
|
16
17
|
_WINDOW = 128
|
|
17
18
|
|
|
18
19
|
|
|
20
|
+
def calendar_day(value: str) -> str:
|
|
21
|
+
"""Validate ISO or dotted day/month/year with one calendar implementation."""
|
|
22
|
+
|
|
23
|
+
value = "".join(str(int(char)) if char.isdecimal() else char for char in value)
|
|
24
|
+
if "." in value:
|
|
25
|
+
value = f"{value[6:10]}-{value[3:5]}-{value[:2]}"
|
|
26
|
+
return date.fromisoformat(value).isoformat()
|
|
27
|
+
|
|
28
|
+
|
|
19
29
|
def _word_part(char: str) -> bool:
|
|
30
|
+
"""Recognize Unicode word continuations at numeric token boundaries."""
|
|
20
31
|
return char.isalnum() or unicodedata.category(char).startswith("M")
|
|
21
32
|
|
|
22
33
|
|
|
@@ -34,8 +45,18 @@ def complete_datetime(value: str, start: int, end: int) -> bool:
|
|
|
34
45
|
right = tail[:1]
|
|
35
46
|
if left and (_word_part(left) or left in "_.:+/-"):
|
|
36
47
|
continue
|
|
37
|
-
if right and (_word_part(right) or right in "_
|
|
48
|
+
if right and (_word_part(right) or right in "_+/-"):
|
|
38
49
|
continue
|
|
50
|
+
if right == ":":
|
|
51
|
+
remainder = tail[1:]
|
|
52
|
+
separated = bool(remainder) and (
|
|
53
|
+
remainder[0].isspace()
|
|
54
|
+
or (remainder.startswith("\\") and remainder[1:2] in {"n", "r", "t"})
|
|
55
|
+
)
|
|
56
|
+
# Prose punctuation may precede real or escaped whitespace. Do not
|
|
57
|
+
# decode material or extend the proof span over that separator.
|
|
58
|
+
if not separated and (remainder or not block["zone"]):
|
|
59
|
+
continue
|
|
39
60
|
if right == "." and len(tail) > 1 and (_word_part(tail[1]) or tail[1] in "_.:+/-"):
|
|
40
61
|
continue
|
|
41
62
|
if _CONTINUED_ZONE.match(tail.lstrip(" \t")):
|
|
@@ -53,7 +74,7 @@ def complete_datetime(value: str, start: int, end: int) -> bool:
|
|
|
53
74
|
if int(digits[:2]) > 23 or int(digits[2:]) > 59:
|
|
54
75
|
continue
|
|
55
76
|
try:
|
|
56
|
-
token = f"{block['day']}T{block['clock']}{zone}"
|
|
77
|
+
token = f"{calendar_day(block['day'])}T{block['clock']}{zone}"
|
|
57
78
|
# PHONE_RE recognizes every Unicode decimal digit. Preserve that
|
|
58
79
|
# semantic domain while feeding the ASCII-only calendar parser;
|
|
59
80
|
# no code-point positions are changed for containment checks.
|
|
@@ -6,11 +6,16 @@ import ipaddress
|
|
|
6
6
|
import re
|
|
7
7
|
import unicodedata
|
|
8
8
|
import uuid
|
|
9
|
-
from datetime import date
|
|
10
9
|
|
|
11
10
|
import regex
|
|
12
11
|
|
|
13
|
-
from ocr_toolkit.context.dlp.
|
|
12
|
+
from ocr_toolkit.context.dlp.contact_labels import _contact_context, _explicit_context
|
|
13
|
+
from ocr_toolkit.context.dlp.datetimes import (
|
|
14
|
+
CALENDAR_DAY_PATTERN,
|
|
15
|
+
_word_part,
|
|
16
|
+
calendar_day,
|
|
17
|
+
complete_datetime,
|
|
18
|
+
)
|
|
14
19
|
from ocr_toolkit.context.dlp.decoding import _technical_decode, bounded_nfkc
|
|
15
20
|
|
|
16
21
|
_DIGIT_MARKS = regex.compile(r"(?<=\p{Nd})\p{M}+")
|
|
@@ -29,7 +34,10 @@ def phone_markup_view(value: str, *, formatting: bool = True) -> str:
|
|
|
29
34
|
return _DIGIT_MARKS.sub(" ", value, timeout=0.05)
|
|
30
35
|
|
|
31
36
|
|
|
32
|
-
PHONE_RE = re.compile(
|
|
37
|
+
PHONE_RE = re.compile(
|
|
38
|
+
rf"(?<!\w)(?:\+?{CALENDAR_DAY_PATTERN}(?=[Tt]\d{{2}}:)|"
|
|
39
|
+
r"(?:\+?\d[\d .()/-]{5,62}\d)(?!\w))"
|
|
40
|
+
)
|
|
33
41
|
MIN_PHONE_DIGITS = 7
|
|
34
42
|
|
|
35
43
|
|
|
@@ -42,9 +50,6 @@ def _phone_shape(value: str, match: re.Match[str]) -> bool:
|
|
|
42
50
|
return digits >= MIN_PHONE_DIGITS or (digits >= 6 and len(match[0]) >= 9)
|
|
43
51
|
|
|
44
52
|
|
|
45
|
-
ISO_DATE_RE = re.compile(r"(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})")
|
|
46
|
-
|
|
47
|
-
|
|
48
53
|
_NETWORK_TOKEN_CHARS = frozenset("0123456789abcdefABCDEF:./")
|
|
49
54
|
|
|
50
55
|
|
|
@@ -61,19 +66,11 @@ VERSION_CONTEXT_RE = re.compile(
|
|
|
61
66
|
)
|
|
62
67
|
|
|
63
68
|
|
|
64
|
-
DATE_CONTEXT_RE = re.compile(
|
|
65
|
-
rf"(?i)\b(?:date|dated|on|since|until|before|after|expires)"
|
|
66
|
-
rf"(?:[ \t]+on)?{_TECHNICAL_SEPARATOR}$"
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
|
|
70
69
|
IP_CONTEXT_RE = re.compile(
|
|
71
70
|
r"(?i)(?:\b|_)(?:ipv4|ip|cidr|subnet|address|host|loginhost|listen|allow|network)\b"
|
|
72
71
|
)
|
|
73
72
|
|
|
74
73
|
|
|
75
|
-
PHONE_CONTEXT_RE = re.compile(r"(?i)\b(?:call|phone|tel|contact)[ \t]*$")
|
|
76
|
-
|
|
77
74
|
_VERSION = r"(?:0|[1-9][0-9]{0,2})(?:\.(?:0|[1-9][0-9]{0,2})){1,3}"
|
|
78
75
|
_DATE = r"[0-9]{4}-[0-9]{2}-[0-9]{2}"
|
|
79
76
|
_TECHNICAL_BLOCK = re.compile(
|
|
@@ -83,19 +80,12 @@ _TECHNICAL_BLOCK = re.compile(
|
|
|
83
80
|
rf"(?P<versions>{_VERSION}(?:/|-|\.\.\.){_VERSION})|"
|
|
84
81
|
r"(?P<iteration>for[ \t]+[A-Za-z_][A-Za-z0-9_]{0,63}[ \t]+in[ \t]+"
|
|
85
82
|
r"[0-9](?:[ \t]+[0-9]){1,31}[ \t]*;[ \t]*do)|"
|
|
86
|
-
rf"(?P<date>{
|
|
83
|
+
rf"(?P<date>{CALENDAR_DAY_PATTERN})"
|
|
87
84
|
rf")(?!\w)",
|
|
88
85
|
re.IGNORECASE,
|
|
89
86
|
)
|
|
90
87
|
|
|
91
88
|
|
|
92
|
-
def _explicit_context(value: str, start: int) -> bool:
|
|
93
|
-
cursor = start
|
|
94
|
-
while cursor and value[cursor - 1] in " \t'\"=:[{(":
|
|
95
|
-
cursor -= 1
|
|
96
|
-
return PHONE_CONTEXT_RE.search(value[max(0, cursor - 64) : cursor]) is not None
|
|
97
|
-
|
|
98
|
-
|
|
99
89
|
def _complete_technical_block(value: str, start: int, end: int) -> bool:
|
|
100
90
|
"""Require complete bounded typed syntax around the whole phone candidate."""
|
|
101
91
|
|
|
@@ -107,7 +97,7 @@ def _complete_technical_block(value: str, start: int, end: int) -> bool:
|
|
|
107
97
|
if block["uuid"]:
|
|
108
98
|
uuid.UUID(block["uuid"])
|
|
109
99
|
elif block["date"] or block["release_date"]:
|
|
110
|
-
|
|
100
|
+
calendar_day(block["date"] or block["release_date"])
|
|
111
101
|
elif block["iteration"]:
|
|
112
102
|
return True
|
|
113
103
|
else:
|
|
@@ -152,7 +142,7 @@ def _network_number(value: str, start: int, end: int) -> bool:
|
|
|
152
142
|
while end < len(value) and end - start < 64 and value[end] in _NETWORK_TOKEN_CHARS:
|
|
153
143
|
end += 1
|
|
154
144
|
contact_prefix = value[max(0, start - 25) : start].rstrip(": \t")
|
|
155
|
-
if
|
|
145
|
+
if _contact_context(contact_prefix):
|
|
156
146
|
return False
|
|
157
147
|
left = value[start - 1] if start and not label_separator else ""
|
|
158
148
|
for neighbor in (left, value[end : end + 1]):
|
|
@@ -188,6 +178,37 @@ def _decoded_network_number(before: str, candidate: str, after: str) -> bool:
|
|
|
188
178
|
)
|
|
189
179
|
|
|
190
180
|
|
|
181
|
+
_DECIMAL_TOKEN = re.compile(r"(?<![\w.])(?:\d{1,3}(?: \d{3})+|\d+)\.\d+")
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def _decimal_partition(value: str, start: int, end: int) -> bool:
|
|
185
|
+
"""Cover complete decimals independently, never join adjacent numeric spans."""
|
|
186
|
+
|
|
187
|
+
cursor = start
|
|
188
|
+
found = False
|
|
189
|
+
for token in _DECIMAL_TOKEN.finditer(value, max(0, start - 64), min(len(value), end + 64)):
|
|
190
|
+
if token.end() <= start or token.start() >= end:
|
|
191
|
+
continue
|
|
192
|
+
# Validate real neighbors beyond the bounded search window. A prefix
|
|
193
|
+
# match or a network/timestamp fragment does not prove a complete token.
|
|
194
|
+
left = value[token.start() - 1] if token.start() else ""
|
|
195
|
+
tail = value[token.end() : token.end() + 2]
|
|
196
|
+
right = tail[:1]
|
|
197
|
+
if (left and (_word_part(left) or left in "_.:/+")) or (
|
|
198
|
+
right and (_word_part(right) or right in "_:/+-")
|
|
199
|
+
):
|
|
200
|
+
continue
|
|
201
|
+
if right == "." and len(tail) > 1 and (_word_part(tail[1]) or tail[1] in "_.:/+-"):
|
|
202
|
+
continue
|
|
203
|
+
if any(char not in " ()" for char in value[cursor : max(cursor, token.start())]):
|
|
204
|
+
return False
|
|
205
|
+
cursor = min(end, token.end())
|
|
206
|
+
found = True
|
|
207
|
+
if cursor == end:
|
|
208
|
+
return True
|
|
209
|
+
return found and all(char in " ()" for char in value[cursor:end])
|
|
210
|
+
|
|
211
|
+
|
|
191
212
|
def _technical_number(value: str, match: re.Match[str]) -> bool:
|
|
192
213
|
"""Exclude only bounded, parsed technical syntax from phone candidates."""
|
|
193
214
|
|
|
@@ -206,7 +227,7 @@ def _technical_number(value: str, match: re.Match[str]) -> bool:
|
|
|
206
227
|
# document per candidate when a file contains many valid technical tokens.
|
|
207
228
|
before = value[max(0, match.start() - 1024) : match.start()]
|
|
208
229
|
after = value[match.end() : match.end() + 1024]
|
|
209
|
-
if
|
|
230
|
+
if _contact_context(before[-64:]):
|
|
210
231
|
return False
|
|
211
232
|
network = "/" in candidate or re.match(r"/[+-]?[0-9]", after) is not None
|
|
212
233
|
if network and _network_number(value, *match.span()):
|
|
@@ -215,6 +236,8 @@ def _technical_number(value: str, match: re.Match[str]) -> bool:
|
|
|
215
236
|
return True
|
|
216
237
|
if network:
|
|
217
238
|
return False
|
|
239
|
+
if _decimal_partition(value, *match.span()):
|
|
240
|
+
return True
|
|
218
241
|
if before.endswith((".", "/", "-")) or re.match(r"(?:[./-]\d)", after):
|
|
219
242
|
return False
|
|
220
243
|
try:
|
|
@@ -234,26 +257,11 @@ def _technical_number(value: str, match: re.Match[str]) -> bool:
|
|
|
234
257
|
and re.fullmatch(r"[0-9]+(?:\.[0-9]+){2,7}", candidate)
|
|
235
258
|
):
|
|
236
259
|
return True
|
|
237
|
-
if ISO_DATE_RE.fullmatch(candidate) and DATE_CONTEXT_RE.search(technical_prefix):
|
|
238
|
-
try:
|
|
239
|
-
date(int(candidate[:4]), int(candidate[5:7]), int(candidate[8:10]))
|
|
240
|
-
except ValueError:
|
|
241
|
-
return False
|
|
242
|
-
return True
|
|
243
|
-
if re.fullmatch(r"\d{4}\.\d{1,2}\.\d{1,3}", candidate):
|
|
244
|
-
return bool(VERSION_CONTEXT_RE.search(technical_prefix))
|
|
245
|
-
if re.fullmatch(r"\d+\.\d+", candidate):
|
|
246
|
-
return bool(
|
|
247
|
-
re.search(r"(?i)\bdecimal\([ \t]*['\"]$", technical_prefix)
|
|
248
|
-
and (
|
|
249
|
-
re.match(r"['\"][ \t]*\)", after)
|
|
250
|
-
or re.match(r"['\"][ \t]*\)", _technical_decode(after[:64]))
|
|
251
|
-
)
|
|
252
|
-
)
|
|
253
260
|
return False
|
|
254
261
|
|
|
255
262
|
|
|
256
263
|
def _explicit_contact_phone(value: str) -> bool:
|
|
264
|
+
"""Preserve explicit contact priority in verified literal-code sinks."""
|
|
257
265
|
for match in PHONE_RE.finditer(value):
|
|
258
266
|
candidate = match.group(0)
|
|
259
267
|
if (
|
|
@@ -24,7 +24,6 @@ class EvidenceArtifacts:
|
|
|
24
24
|
review_run_lock: Path
|
|
25
25
|
action_receipt: Path
|
|
26
26
|
action_receipt_lock: Path
|
|
27
|
-
dlp_decisions: Path
|
|
28
27
|
diagram: Path
|
|
29
28
|
diagram_lock: Path
|
|
30
29
|
|
|
@@ -44,7 +43,6 @@ def repository_artifacts(root: Path | None = None) -> EvidenceArtifacts:
|
|
|
44
43
|
review_run_lock=directory / ".review-run.lock",
|
|
45
44
|
action_receipt=directory / "evidence-actions.json",
|
|
46
45
|
action_receipt_lock=directory / ".evidence-actions.json.lock",
|
|
47
|
-
dlp_decisions=directory / "private-dlp-decisions.json",
|
|
48
46
|
diagram=directory / "diagram.json",
|
|
49
47
|
diagram_lock=directory / ".diagram.json.lock",
|
|
50
48
|
)
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""Pure structural evidence sizing and closed resource-exhaustion facts."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Mapping
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
|
|
8
|
+
MAX_EVIDENCE_RECORDS = 100_000
|
|
9
|
+
MAX_EVIDENCE_BYTES = 20_000_000
|
|
10
|
+
MAX_TREE_ENTRIES = 20_000
|
|
11
|
+
MAX_CHANGED_PATHS = 10_000
|
|
12
|
+
MAX_TARGET_FILE_RECORDS = 64
|
|
13
|
+
MAX_TARGET_DEPENDENCY_RECORDS = 64
|
|
14
|
+
OPTIONAL_RECORDS = 4_096
|
|
15
|
+
OPTIONAL_RECORDS_PER_KIND = 512
|
|
16
|
+
# Invocation facts and normalized MR intent are added by the runner after collection.
|
|
17
|
+
INVOCATION_RECORD_RESERVE = 8
|
|
18
|
+
INVOCATION_BYTE_RESERVE = 128_000
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class EvidenceBudgetExceeded(ValueError):
|
|
22
|
+
"""Carry only validated numeric resource facts, never source content."""
|
|
23
|
+
|
|
24
|
+
def __init__(self, actual: int, limit: int, unit: str, *, message: str | None = None) -> None:
|
|
25
|
+
"""Bind a closed hard-limit diagnostic to validated numeric facts and a resource unit."""
|
|
26
|
+
if (
|
|
27
|
+
type(actual) is not int
|
|
28
|
+
or type(limit) is not int
|
|
29
|
+
or not 0 < limit < actual
|
|
30
|
+
or not isinstance(unit, str)
|
|
31
|
+
or unit not in {"records", "bytes", "entries"}
|
|
32
|
+
):
|
|
33
|
+
raise ValueError("invalid evidence budget facts")
|
|
34
|
+
self.actual, self.limit, self.unit = actual, limit, unit
|
|
35
|
+
super().__init__(
|
|
36
|
+
message or f"repository evidence budget exceeded: {actual} {unit}, limit {limit}"
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass(frozen=True, slots=True)
|
|
41
|
+
class StructuralBudget:
|
|
42
|
+
"""Keep structural capacity independent from optional fact allowances."""
|
|
43
|
+
|
|
44
|
+
max_records: int
|
|
45
|
+
max_records_per_kind: int
|
|
46
|
+
optional_records: int
|
|
47
|
+
max_bytes: int = MAX_EVIDENCE_BYTES
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def structural_budget(
|
|
51
|
+
counts: Mapping[str, int], coverage_count: int, *, include_target: bool = False
|
|
52
|
+
) -> StructuralBudget:
|
|
53
|
+
"""Size complete snapshot/category indexes, preserving a bounded optional pool."""
|
|
54
|
+
|
|
55
|
+
if (
|
|
56
|
+
type(coverage_count) is not int
|
|
57
|
+
or coverage_count < 0
|
|
58
|
+
or type(include_target) is not bool
|
|
59
|
+
or any(type(count) is not int or count < 0 for count in counts.values())
|
|
60
|
+
):
|
|
61
|
+
raise ValueError("invalid structural evidence counts")
|
|
62
|
+
required = sum(counts.values()) + coverage_count + INVOCATION_RECORD_RESERVE
|
|
63
|
+
if required > MAX_EVIDENCE_RECORDS:
|
|
64
|
+
raise EvidenceBudgetExceeded(required, MAX_EVIDENCE_RECORDS, "records")
|
|
65
|
+
return StructuralBudget(
|
|
66
|
+
min(MAX_EVIDENCE_RECORDS, required + OPTIONAL_RECORDS),
|
|
67
|
+
min(
|
|
68
|
+
MAX_EVIDENCE_RECORDS,
|
|
69
|
+
max(
|
|
70
|
+
OPTIONAL_RECORDS_PER_KIND,
|
|
71
|
+
max(counts.values(), default=0),
|
|
72
|
+
counts.get("repository.file", 0)
|
|
73
|
+
+ (MAX_TARGET_FILE_RECORDS if include_target else 0),
|
|
74
|
+
),
|
|
75
|
+
),
|
|
76
|
+
min(OPTIONAL_RECORDS, MAX_EVIDENCE_RECORDS - required),
|
|
77
|
+
)
|
|
@@ -5,6 +5,8 @@ from __future__ import annotations
|
|
|
5
5
|
import re
|
|
6
6
|
from collections.abc import Iterable, Mapping, Sequence
|
|
7
7
|
|
|
8
|
+
from ocr_toolkit.evidence.container_paths import is_container_build_file
|
|
9
|
+
|
|
8
10
|
CATEGORY_ORDER = (
|
|
9
11
|
"ansible_playbooks",
|
|
10
12
|
"ocr_integration",
|
|
@@ -19,6 +21,7 @@ CATEGORY_ORDER = (
|
|
|
19
21
|
"templates",
|
|
20
22
|
"terraform_hcl",
|
|
21
23
|
"python",
|
|
24
|
+
"csharp",
|
|
22
25
|
"go",
|
|
23
26
|
"php",
|
|
24
27
|
"javascript_typescript",
|
|
@@ -34,7 +37,7 @@ DEPENDENCY_MANIFEST_PATTERN = re.compile(
|
|
|
34
37
|
r"package(-lock)?\.json|"
|
|
35
38
|
r"pnpm-lock\.yaml|yarn\.lock|composer\.(json|lock)|go\.(mod|sum)|"
|
|
36
39
|
r"Cargo\.(toml|lock)|Gemfile(\.lock)?|pom\.xml|build\.gradle(\.kts)?|"
|
|
37
|
-
r"gradle\.lockfile)$",
|
|
40
|
+
r"gradle\.lockfile|[^/]+\.(?:csproj|fsproj|vbproj)|Directory\.(?:Build\.(?:props|targets)|Packages\.props)|packages\.lock\.json|global\.json)$",
|
|
38
41
|
re.I,
|
|
39
42
|
)
|
|
40
43
|
|
|
@@ -55,9 +58,7 @@ CATEGORY_PATTERNS: tuple[tuple[str, re.Pattern[str]], ...] = (
|
|
|
55
58
|
(
|
|
56
59
|
"containers",
|
|
57
60
|
re.compile(
|
|
58
|
-
r"(^|/)(
|
|
59
|
-
r"[^/]+\.Dockerfile|docker-compose.*\.ya?ml|"
|
|
60
|
-
r"compose(?:\.[^/]+)?\.ya?ml)$|\.dockerfile$",
|
|
61
|
+
r"(^|/)(docker-compose.*\.ya?ml|compose(?:\.[^/]+)?\.ya?ml)$",
|
|
61
62
|
re.I,
|
|
62
63
|
),
|
|
63
64
|
),
|
|
@@ -74,6 +75,7 @@ CATEGORY_PATTERNS: tuple[tuple[str, re.Pattern[str]], ...] = (
|
|
|
74
75
|
("templates", re.compile(r"\.(j2|jinja|jinja2|tpl|tmpl)$", re.I)),
|
|
75
76
|
("terraform_hcl", re.compile(r"\.(tf|tfvars|hcl)$", re.I)),
|
|
76
77
|
("python", re.compile(r"\.(py|pyi)$", re.I)),
|
|
78
|
+
("csharp", re.compile(r"\.(cs|csx)$", re.I)),
|
|
77
79
|
("go", re.compile(r"\.go$", re.I)),
|
|
78
80
|
("php", re.compile(r"\.php$", re.I)),
|
|
79
81
|
("javascript_typescript", re.compile(r"\.(js|jsx|ts|tsx|mjs|cjs)$", re.I)),
|
|
@@ -90,7 +92,9 @@ def categorize_paths(
|
|
|
90
92
|
playbooks = set(ansible_playbooks)
|
|
91
93
|
categorized: dict[str, list[str]] = {}
|
|
92
94
|
for path in sorted(set(paths)):
|
|
93
|
-
matched =
|
|
95
|
+
matched = is_container_build_file(path)
|
|
96
|
+
if matched:
|
|
97
|
+
categorized.setdefault("containers", []).append(path)
|
|
94
98
|
if path in playbooks:
|
|
95
99
|
categorized.setdefault("ansible_playbooks", []).append(path)
|
|
96
100
|
matched = True
|