upstream-data 3.39.0__py3-none-any.whl
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.
- upstream_data/__init__.py +16 -0
- upstream_data/_version_registry.py +116 -0
- upstream_data/access_policy.py +324 -0
- upstream_data/adjudication/__init__.py +19 -0
- upstream_data/adjudication/traces.py +473 -0
- upstream_data/category/__init__.py +189 -0
- upstream_data/category/commercial_launch.py +778 -0
- upstream_data/category/developer_distribution.py +735 -0
- upstream_data/category/ecosystem_standard.py +1333 -0
- upstream_data/category/embedded_platform.py +962 -0
- upstream_data/category/enterprise_launch.py +854 -0
- upstream_data/category/flywheel.py +1194 -0
- upstream_data/category/network_effects.py +1149 -0
- upstream_data/category/operator_launch.py +496 -0
- upstream_data/category/ownership.py +732 -0
- upstream_data/category/platform_product.py +1231 -0
- upstream_data/category/standard.py +737 -0
- upstream_data/category/workflow_replay.py +1362 -0
- upstream_data/certification/__init__.py +1 -0
- upstream_data/certification/cohort.py +181 -0
- upstream_data/certification/signing.py +183 -0
- upstream_data/cli/__init__.py +25 -0
- upstream_data/cli/api_cli.py +107 -0
- upstream_data/cli/app.py +36 -0
- upstream_data/cli/category.py +306 -0
- upstream_data/cli/certification.py +184 -0
- upstream_data/cli/control_plane.py +352 -0
- upstream_data/cli/db.py +71 -0
- upstream_data/cli/helpers.py +19 -0
- upstream_data/cli/integrations.py +114 -0
- upstream_data/cli/marketplace.py +366 -0
- upstream_data/cli/providers.py +92 -0
- upstream_data/cli/replay.py +342 -0
- upstream_data/cli/reports.py +152 -0
- upstream_data/cli/synthesis.py +1021 -0
- upstream_data/cli/upstream_v2.py +337 -0
- upstream_data/client.py +131 -0
- upstream_data/contracts/__init__.py +29 -0
- upstream_data/contracts/fee_schedule.py +482 -0
- upstream_data/datascience/__init__.py +15 -0
- upstream_data/datascience/controls.py +389 -0
- upstream_data/denials/appeals.py +67 -0
- upstream_data/denials/archetypes.py +19 -0
- upstream_data/denials/calibration.py +766 -0
- upstream_data/denials/carcrarc.py +98 -0
- upstream_data/denials/engine.py +151 -0
- upstream_data/distribution/__init__.py +27 -0
- upstream_data/distribution/bundle.py +772 -0
- upstream_data/economy/__init__.py +37 -0
- upstream_data/economy/kernel.py +874 -0
- upstream_data/episodes/__init__.py +15 -0
- upstream_data/episodes/builder.py +714 -0
- upstream_data/episodes/models.py +163 -0
- upstream_data/evaluation/__init__.py +19 -0
- upstream_data/evaluation/coverage_rule.py +261 -0
- upstream_data/evaluation/harness.py +506 -0
- upstream_data/evaluation/models.py +85 -0
- upstream_data/events/__init__.py +23 -0
- upstream_data/events/builder.py +824 -0
- upstream_data/events/models.py +126 -0
- upstream_data/generators/commercial.py +226 -0
- upstream_data/generators/encounters.py +111 -0
- upstream_data/generators/entities.py +92 -0
- upstream_data/governance/__init__.py +29 -0
- upstream_data/governance/publication.py +401 -0
- upstream_data/integrations/__init__.py +45 -0
- upstream_data/integrations/adjacent_repos.py +823 -0
- upstream_data/integrations/synthetic_contract.py +1279 -0
- upstream_data/integrations/upstream_bridge.py +1935 -0
- upstream_data/integrations/v2_bridge.py +137 -0
- upstream_data/intelligence/__init__.py +17 -0
- upstream_data/intelligence/reports.py +326 -0
- upstream_data/intelligence/training_corpus.py +74 -0
- upstream_data/io/__init__.py +24 -0
- upstream_data/io/csv_writer.py +22 -0
- upstream_data/io/data_reader.py +182 -0
- upstream_data/io/jsonl_writer.py +24 -0
- upstream_data/io/parquet_writer.py +17 -0
- upstream_data/marketplace/__init__.py +107 -0
- upstream_data/marketplace/catalog.py +265 -0
- upstream_data/marketplace/checkout.py +149 -0
- upstream_data/marketplace/delivery.py +355 -0
- upstream_data/marketplace/delivery_adapters.py +298 -0
- upstream_data/marketplace/fulfillment.py +137 -0
- upstream_data/marketplace/pages.py +245 -0
- upstream_data/marketplace/stripe.py +103 -0
- upstream_data/models/base.py +25 -0
- upstream_data/models/claims.py +95 -0
- upstream_data/models/entities.py +43 -0
- upstream_data/models/manifest.py +28 -0
- upstream_data/operating/__init__.py +275 -0
- upstream_data/operating/artifact_graph.py +1074 -0
- upstream_data/operating/ci_regression.py +656 -0
- upstream_data/operating/contract.py +1482 -0
- upstream_data/operating/flagship_world.py +740 -0
- upstream_data/operating/preview_gate.py +413 -0
- upstream_data/operating/product_canon.py +460 -0
- upstream_data/operating/replay_os.py +886 -0
- upstream_data/operating/replay_runtime.py +573 -0
- upstream_data/operating/v2_adapter.py +232 -0
- upstream_data/operating/workflow_replay_engine.py +1158 -0
- upstream_data/orchestration/synthesis_job.py +111 -0
- upstream_data/packaging/__init__.py +23 -0
- upstream_data/packaging/bundles.py +933 -0
- upstream_data/packs/catalog.py +210 -0
- upstream_data/packs/claim_context.py +137 -0
- upstream_data/packs/diagnosis_codes.py +1342 -0
- upstream_data/packs/profiles.py +1489 -0
- upstream_data/packs/realism.py +1227 -0
- upstream_data/packs/registry.py +629 -0
- upstream_data/packs/scenarios.py +269 -0
- upstream_data/packs/schema.py +513 -0
- upstream_data/packs/service_codes.py +507 -0
- upstream_data/packs/smoketest.py +16 -0
- upstream_data/packs/smoketest_rules.py +52 -0
- upstream_data/policies/__init__.py +23 -0
- upstream_data/policies/engine.py +397 -0
- upstream_data/policies/provenance.py +131 -0
- upstream_data/priors/__init__.py +5 -0
- upstream_data/priors/calibration_loader.py +40 -0
- upstream_data/priors/cms_fetch.py +139 -0
- upstream_data/priors/loader.py +85 -0
- upstream_data/priors/refresh.py +405 -0
- upstream_data/priors/schemas.py +133 -0
- upstream_data/providers/__init__.py +37 -0
- upstream_data/providers/contracts.py +319 -0
- upstream_data/providers/live_readiness.py +171 -0
- upstream_data/providers/runtime.py +449 -0
- upstream_data/publishing/__init__.py +15 -0
- upstream_data/publishing/huggingface.py +82 -0
- upstream_data/py.typed +0 -0
- upstream_data/qa/__init__.py +13 -0
- upstream_data/qa/package.py +224 -0
- upstream_data/quality/__init__.py +25 -0
- upstream_data/quality/reports.py +813 -0
- upstream_data/release/__init__.py +9 -0
- upstream_data/release/ledger.py +177 -0
- upstream_data/reports/__init__.py +0 -0
- upstream_data/reports/dataset_diff.py +559 -0
- upstream_data/reports/dataset_explorer.py +473 -0
- upstream_data/research/__init__.py +39 -0
- upstream_data/research/provenance.py +178 -0
- upstream_data/research/public_sources.py +1873 -0
- upstream_data/runtime/seeding.py +31 -0
- upstream_data/scenarios/__init__.py +17 -0
- upstream_data/scenarios/dsl.py +177 -0
- upstream_data/scenarios/engine.py +314 -0
- upstream_data/security/http.py +58 -0
- upstream_data/security/leakage_denylist.py +160 -0
- upstream_data/security/xml.py +23 -0
- upstream_data/server/__init__.py +0 -0
- upstream_data/server/compare.py +410 -0
- upstream_data/server/explore.py +155 -0
- upstream_data/server/mcp_server.py +283 -0
- upstream_data/service/__init__.py +115 -0
- upstream_data/service/app.py +748 -0
- upstream_data/service/asgi.py +11 -0
- upstream_data/service/async_synthesis.py +214 -0
- upstream_data/service/checkout_gateway.py +80 -0
- upstream_data/service/control_plane.py +657 -0
- upstream_data/service/delivery_contacts.py +98 -0
- upstream_data/service/delivery_signing.py +70 -0
- upstream_data/service/email_sending.py +75 -0
- upstream_data/service/evaluation_api.py +382 -0
- upstream_data/service/hosted_fulfillment.py +1051 -0
- upstream_data/service/jobs.py +438 -0
- upstream_data/service/middleware.py +427 -0
- upstream_data/service/models.py +108 -0
- upstream_data/service/order_delivery.py +50 -0
- upstream_data/service/order_worker.py +71 -0
- upstream_data/service/orders.py +92 -0
- upstream_data/service/orders_store.py +135 -0
- upstream_data/service/production.py +121 -0
- upstream_data/service/proof_serving.py +181 -0
- upstream_data/service/queue.py +495 -0
- upstream_data/service/replay_api.py +104 -0
- upstream_data/service/stedi_adapter.py +260 -0
- upstream_data/service/synthesis_api.py +334 -0
- upstream_data/service/trust.py +251 -0
- upstream_data/service/webhook.py +123 -0
- upstream_data/service/worker_main.py +81 -0
- upstream_data/settings.py +30 -0
- upstream_data/simulator/__init__.py +41 -0
- upstream_data/simulator/configurable.py +408 -0
- upstream_data/simulator/models.py +120 -0
- upstream_data/standards/__init__.py +1 -0
- upstream_data/standards/claim_edits.py +299 -0
- upstream_data/synthesis/pipeline.py +847 -0
- upstream_data/transactions/__init__.py +17 -0
- upstream_data/transactions/envelopes.py +389 -0
- upstream_data/transactions/models.py +245 -0
- upstream_data/transactions/surface.py +744 -0
- upstream_data/twin/__init__.py +29 -0
- upstream_data/twin/calibration.py +550 -0
- upstream_data/validation/claim_realism.py +513 -0
- upstream_data/validation/distributions.py +107 -0
- upstream_data/validation/episodes.py +127 -0
- upstream_data/validation/events.py +329 -0
- upstream_data/validation/packs.py +990 -0
- upstream_data/validation/reporting.py +17 -0
- upstream_data/validation/transactions.py +327 -0
- upstream_data/world/__init__.py +19 -0
- upstream_data/world/builder.py +904 -0
- upstream_data/world/models.py +233 -0
- upstream_data-3.39.0.dist-info/METADATA +437 -0
- upstream_data-3.39.0.dist-info/RECORD +208 -0
- upstream_data-3.39.0.dist-info/WHEEL +4 -0
- upstream_data-3.39.0.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Upstream Data — synthetic healthcare claims for testing your RCM pipeline.
|
|
2
|
+
|
|
3
|
+
pip install upstream-data
|
|
4
|
+
|
|
5
|
+
from upstream_data import UpstreamClient
|
|
6
|
+
|
|
7
|
+
client = UpstreamClient(api_key="sk-...")
|
|
8
|
+
result = client.synthesize(pack="aba", rows=50_000)
|
|
9
|
+
client.download(result["dataset_id"], "aba_test.csv")
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
__all__ = ["__version__", "UpstreamClient"]
|
|
13
|
+
|
|
14
|
+
__version__ = "3.39.0"
|
|
15
|
+
|
|
16
|
+
from upstream_data.client import UpstreamClient
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"""Centralized schema version registry for all upstream-data artifacts.
|
|
2
|
+
|
|
3
|
+
This file is the single source of truth for all version constants.
|
|
4
|
+
Modules import their version from here rather than defining locally.
|
|
5
|
+
Adding a new artifact? Register its version here.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
11
|
+
# Source / Registry / Prior
|
|
12
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
13
|
+
PUBLIC_SOURCE_REGISTRY_VERSION: str = "2026-05-27.v3.0"
|
|
14
|
+
SOURCE_REGISTRY_VERSION: str = "2026-05-26.v1.8"
|
|
15
|
+
|
|
16
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
17
|
+
# Models / Schema
|
|
18
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
19
|
+
SCHEMA_VERSION: str = "0.4.0" # canonical — used by build_pack_schema()
|
|
20
|
+
ARTIFACT_SCHEMA_VERSION: str = "upstream-data-artifacts-v1.8"
|
|
21
|
+
DATASET_EULA_VERSION: str = "upstream-data-dataset-eula-v0"
|
|
22
|
+
|
|
23
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
24
|
+
# Claim Generators / Encounters
|
|
25
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
26
|
+
CLAIM_REALISM_VERSION: str = "upstream-data-claim-realism-v1.7"
|
|
27
|
+
CLAIM_EDIT_SIMULATION_VERSION: str = "upstream-data-claim-edits-v1.7"
|
|
28
|
+
ADJUDICATION_TRACE_VERSION: str = "upstream-data-adjudication-trace-v1.7"
|
|
29
|
+
TRANSACTION_ARTIFACT_VERSION: str = "upstream-data-transactions-v1.3"
|
|
30
|
+
TRANSACTION_SURFACE_ARTIFACT_VERSION: str = "upstream-data-transaction-surface-v2.0"
|
|
31
|
+
CONTRACT_FEE_SCHEDULE_VERSION: str = "upstream-data-contract-fee-schedule-v3.4"
|
|
32
|
+
PAYER_POLICY_VERSION: str = "upstream-data-policy-engine-v3.3"
|
|
33
|
+
PAYER_CONTRACT_SIMULATOR_VERSION: str = "upstream-data-payer-contract-simulator-v2.3"
|
|
34
|
+
|
|
35
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
36
|
+
# World / Economy / Demographics
|
|
37
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
38
|
+
WORLD_ARTIFACT_VERSION: str = "upstream-data-world-model-v2.1"
|
|
39
|
+
ECONOMY_KERNEL_VERSION: str = "2026-05-28.v3.33"
|
|
40
|
+
|
|
41
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
42
|
+
# Episodes / Events / Scenarios
|
|
43
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
44
|
+
EPISODE_ARTIFACT_VERSION: str = "upstream-data-episodes-v1.8"
|
|
45
|
+
EVENT_SIMULATION_ARTIFACT_VERSION: str = "upstream-data-events-v1.4"
|
|
46
|
+
SCENARIO_DSL_VERSION: str = "upstream-data-scenario-dsl-v1.8"
|
|
47
|
+
SCENARIO_MANIFEST_VERSION: str = "2026-05-26.v1.4"
|
|
48
|
+
|
|
49
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
50
|
+
# Quality / Validation / Data Science
|
|
51
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
52
|
+
QUALITY_REPORT_VERSION: str = "2026-05-26.v2.1"
|
|
53
|
+
POPULATION_CONTROL_REPORT_VERSION: str = "2026-05-27.v3.1"
|
|
54
|
+
EVALUATION_REPORT_VERSION: str = "2026-05-27.v2.3"
|
|
55
|
+
EVALUATION_ARTIFACT_VERSION: str = "upstream-data-evaluation-v2.3"
|
|
56
|
+
SPECIALTY_REALISM_VERSION: str = "2026-05-26.v1.8"
|
|
57
|
+
|
|
58
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
59
|
+
# Twin / Simulator / Operating
|
|
60
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
61
|
+
SYNTHETIC_TWIN_VERSION: str = "upstream-data-synthetic-twin-v3.2"
|
|
62
|
+
|
|
63
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
64
|
+
# CI / Certification / Cohort
|
|
65
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
66
|
+
CI_REGRESSION_VERSION: str = "2026-05-28.v3.32"
|
|
67
|
+
CERTIFICATION_SIGNING_VERSION: str = "upstream-data-cert-v1.0"
|
|
68
|
+
COHORT_ROTATION_VERSION: str = "upstream-data-cohort-v1.0"
|
|
69
|
+
|
|
70
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
71
|
+
# Integration / Bridge / Distribution
|
|
72
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
73
|
+
BRIDGE_VERSION: str = "2026-05-27.v3.4"
|
|
74
|
+
SYNTHETIC_HEALTHCARE_CONTRACT_VERSION: str = "2026-05-27.v3.6"
|
|
75
|
+
PAYLOAD_VERSION: str = "2026-05-26.v1.8"
|
|
76
|
+
ADJACENT_AUDIT_VERSION: str = "2026-05-28.v3.34"
|
|
77
|
+
PACKAGE_CATALOG_VERSION: str = "upstream-data-packaging-v2.3"
|
|
78
|
+
|
|
79
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
80
|
+
# Operating System / Replay / Preview
|
|
81
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
82
|
+
COMPANY_OPERATING_SYSTEM_VERSION: str = "2026-05-27.v3.7"
|
|
83
|
+
OPERATING_ARTIFACT_GRAPH_VERSION: str = "2026-05-28.v3.22"
|
|
84
|
+
REPLAY_OS_VERSION: str = "2026-05-28.v3.34"
|
|
85
|
+
REPLAY_RUNTIME_VERSION: str = "2026-05-28.v3.31"
|
|
86
|
+
WORKFLOW_REPLAY_ENGINE_VERSION: str = "2026-05-28.v3.29"
|
|
87
|
+
WORKFLOW_REPLAY_FORMAT_VERSION: str = "2026-05-28.v3.27"
|
|
88
|
+
PREVIEW_DEPTH_GATE_VERSION: str = "2026-05-28.v3.39"
|
|
89
|
+
FLAGSHIP_WORLD_VERSION: str = "2026-05-28.v3.38"
|
|
90
|
+
CONTROL_PLANE_VERSION: str = "2026-05-27.v3.11"
|
|
91
|
+
JOB_QUEUE_VERSION: str = "2026-05-27.v3.13"
|
|
92
|
+
|
|
93
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
94
|
+
# Providers / Service / Marketplace
|
|
95
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
96
|
+
PROVIDER_CONTRACT_VERSION: str = "2026-05-26.v1.8"
|
|
97
|
+
PROVIDER_READINESS_VERSION: str = "2026-05-27.v3.15"
|
|
98
|
+
PROVIDER_RUNTIME_VERSION: str = "2026-05-28.v3.37"
|
|
99
|
+
HOSTED_FULFILLMENT_VERSION: str = "2026-05-28.v3.37"
|
|
100
|
+
DELIVERY_CONTACTS_VERSION: str = "2026-05-29.v1"
|
|
101
|
+
PRODUCT_CANON_EXPORT_VERSION: str = "2026-05-27.v3.8"
|
|
102
|
+
|
|
103
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
104
|
+
# Category / Commercial / Launch
|
|
105
|
+
# ═══════════════════════════════════════════════════════════════════
|
|
106
|
+
CATEGORY_OWNERSHIP_VERSION: str = "2026-05-27.v3.16"
|
|
107
|
+
CATEGORY_STANDARD_VERSION: str = "2026-05-27.v3.17"
|
|
108
|
+
CATEGORY_FLYWHEEL_VERSION: str = "2026-05-28.v3.30"
|
|
109
|
+
COMMERCIAL_LAUNCH_VERSION: str = "2026-05-28.v3.19"
|
|
110
|
+
DEVELOPER_DISTRIBUTION_VERSION: str = "2026-05-27.v3.18"
|
|
111
|
+
EMBEDDED_PLATFORM_MOAT_VERSION: str = "2026-05-28.v3.23"
|
|
112
|
+
NETWORK_EFFECTS_MOAT_VERSION: str = "2026-05-28.v3.25"
|
|
113
|
+
PLATFORM_PRODUCT_CANON_VERSION: str = "2026-05-28.v3.26"
|
|
114
|
+
ECOSYSTEM_STANDARD_VERSION: str = "2026-05-28.v3.24"
|
|
115
|
+
ENTERPRISE_LAUNCH_COMPILER_VERSION: str = "2026-05-28.v3.38"
|
|
116
|
+
OPERATOR_LAUNCH_PROOF_VERSION: str = "2026-05-28.v3.20"
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
"""Access-policy compiler for public, paid, and service-token artifacts."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Literal
|
|
6
|
+
|
|
7
|
+
from pydantic import Field
|
|
8
|
+
|
|
9
|
+
from upstream_data.models.base import UpstreamBaseModel
|
|
10
|
+
|
|
11
|
+
AccessPolicy = Literal[
|
|
12
|
+
"public-read",
|
|
13
|
+
"paid-api-key",
|
|
14
|
+
"account-authenticated",
|
|
15
|
+
"service-token",
|
|
16
|
+
"webhook-secret",
|
|
17
|
+
]
|
|
18
|
+
RedactionClass = Literal["public_teaser", "schema_only", "paid_depth", "internal_ops"]
|
|
19
|
+
|
|
20
|
+
PUBLIC_SAFE_ARTIFACT_IDS: frozenset[str] = frozenset(
|
|
21
|
+
{
|
|
22
|
+
"community_fixture_exports",
|
|
23
|
+
"integration_guardrails",
|
|
24
|
+
"public_sample_manifest",
|
|
25
|
+
"public_source_manifest",
|
|
26
|
+
"synthetic_only_attestation",
|
|
27
|
+
"dataset",
|
|
28
|
+
"readme",
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"specialty_realism_teasers",
|
|
31
|
+
"skill_prompt_fixtures",
|
|
32
|
+
"workflow_replay_public_index",
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
SCHEMA_ONLY_PUBLIC_ARTIFACT_IDS: frozenset[str] = frozenset(
|
|
37
|
+
{
|
|
38
|
+
"marketplace_catalog",
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
PAID_DEPTH_ARTIFACT_IDS: frozenset[str] = frozenset(
|
|
43
|
+
{
|
|
44
|
+
"adjudication_trace",
|
|
45
|
+
"adjudication_trace_summary",
|
|
46
|
+
"attachment_275_workflows",
|
|
47
|
+
"claim_status_276_277",
|
|
48
|
+
"claim_edit_simulation_report",
|
|
49
|
+
"claim_edit_simulation_reports",
|
|
50
|
+
"claim_envelopes",
|
|
51
|
+
"claim_realism_report",
|
|
52
|
+
"ci_drift_report",
|
|
53
|
+
"ci_failure_report",
|
|
54
|
+
"ci_junit_report",
|
|
55
|
+
"ci_markdown_report",
|
|
56
|
+
"ci_phi_leakage_report",
|
|
57
|
+
"ci_run_manifest",
|
|
58
|
+
"ci_scorecard",
|
|
59
|
+
"ci_validation",
|
|
60
|
+
"contract_fee_schedule_lines",
|
|
61
|
+
"contract_fee_schedule_manifest",
|
|
62
|
+
"contract_fee_schedule_report",
|
|
63
|
+
"contract_terms",
|
|
64
|
+
"economy_claim_intents",
|
|
65
|
+
"economy_impact_report",
|
|
66
|
+
"economy_kernel_manifest",
|
|
67
|
+
"economy_kernel_validation",
|
|
68
|
+
"economy_operating_timeline",
|
|
69
|
+
"episode_journeys",
|
|
70
|
+
"episode_manifest",
|
|
71
|
+
"episode_validation_report",
|
|
72
|
+
"artifact_trace_graph",
|
|
73
|
+
"event_simulation_manifest",
|
|
74
|
+
"event_validation_report",
|
|
75
|
+
"evaluation_harness_report",
|
|
76
|
+
"evaluation_suite_manifest",
|
|
77
|
+
"fhir_claim_eob_bundle",
|
|
78
|
+
"pack_readiness_reports",
|
|
79
|
+
"pack_scenarios",
|
|
80
|
+
"pack_source_summaries",
|
|
81
|
+
"payer_contract_simulation_manifest",
|
|
82
|
+
"payer_contract_simulation_report",
|
|
83
|
+
"payer_contract_simulator_config",
|
|
84
|
+
"payer_policy_rules",
|
|
85
|
+
"payer_policy_decision_summary",
|
|
86
|
+
"payer_policy_decisions",
|
|
87
|
+
"population_control_report",
|
|
88
|
+
"scorecard",
|
|
89
|
+
"scorecard_taxonomy",
|
|
90
|
+
"synthetic_twin_aggregate_config",
|
|
91
|
+
"synthetic_twin_calibration_report",
|
|
92
|
+
"synthetic_twin_reproducibility_packet",
|
|
93
|
+
"qa_package_manifest",
|
|
94
|
+
"reproducibility_packet",
|
|
95
|
+
"validation_scorecard",
|
|
96
|
+
"checksum_manifest",
|
|
97
|
+
"remittance_advices",
|
|
98
|
+
"replay_runtime_audit_trace",
|
|
99
|
+
"replay_runtime_events",
|
|
100
|
+
"replay_runtime_report",
|
|
101
|
+
"replay_runtime_task_scores",
|
|
102
|
+
"replay_runtime_validation",
|
|
103
|
+
"trace_audit",
|
|
104
|
+
"failure_cases",
|
|
105
|
+
"rcm_os_bundle_manifest",
|
|
106
|
+
"revenue_cycle_events",
|
|
107
|
+
"specialty_realism_catalog",
|
|
108
|
+
"synthetic_edi_transactions",
|
|
109
|
+
"transaction_bundle_manifest",
|
|
110
|
+
"transaction_surface_manifest",
|
|
111
|
+
"transaction_surface_validation_report",
|
|
112
|
+
"transaction_validation_report",
|
|
113
|
+
"operations_states",
|
|
114
|
+
"operating_artifact_graph_manifest",
|
|
115
|
+
"operating_artifact_graph_validation",
|
|
116
|
+
"operating_timeline",
|
|
117
|
+
"synthetic_documents",
|
|
118
|
+
"workflow_replays",
|
|
119
|
+
"workflow_replay_engine_manifest",
|
|
120
|
+
"workflow_replay_engine_validation",
|
|
121
|
+
"world_entities",
|
|
122
|
+
"world_model_manifest",
|
|
123
|
+
"world_validation_report",
|
|
124
|
+
"certification_manifest",
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
INTERNAL_OPS_ARTIFACT_IDS: frozenset[str] = frozenset(
|
|
129
|
+
{
|
|
130
|
+
"api_contracts",
|
|
131
|
+
"consumer_repos",
|
|
132
|
+
"audit_log",
|
|
133
|
+
"generation_job_request",
|
|
134
|
+
"generation_job_status",
|
|
135
|
+
"governance_gate_report",
|
|
136
|
+
"publication_candidates",
|
|
137
|
+
"launch_readiness_checklist",
|
|
138
|
+
"mcp_tool_hints",
|
|
139
|
+
"moat_report",
|
|
140
|
+
"openapi_fragments",
|
|
141
|
+
"pack_bindings",
|
|
142
|
+
"provider_dry_run_bundle",
|
|
143
|
+
"route_readiness_matrix",
|
|
144
|
+
"upstream_bridge_handoff",
|
|
145
|
+
"usage_metering_events",
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
PUBLIC_FORBIDDEN_SUBSTRINGS: tuple[str, ...] = (
|
|
150
|
+
"adjudication_trace",
|
|
151
|
+
"agent_evaluation_tasks",
|
|
152
|
+
"attachment_275_workflows",
|
|
153
|
+
"claim_status_276_277",
|
|
154
|
+
"claim_edit_simulation",
|
|
155
|
+
"claim_envelopes",
|
|
156
|
+
"claim_realism_report",
|
|
157
|
+
"ci_",
|
|
158
|
+
"contract_fee_schedule",
|
|
159
|
+
"contract_terms",
|
|
160
|
+
"economy_",
|
|
161
|
+
"artifact_trace_graph",
|
|
162
|
+
"episode_journeys",
|
|
163
|
+
"episode_validation_report",
|
|
164
|
+
"evaluation_harness",
|
|
165
|
+
"evaluation_suite",
|
|
166
|
+
"generation_job",
|
|
167
|
+
"governance_gate",
|
|
168
|
+
"fhir_claim_eob_bundle",
|
|
169
|
+
"moat_report",
|
|
170
|
+
"pack_readiness_reports",
|
|
171
|
+
"pack_scenarios",
|
|
172
|
+
"payer_contract_simulation",
|
|
173
|
+
"payer_contract_simulator",
|
|
174
|
+
"payer_policy_rules",
|
|
175
|
+
"payer_policy_decision",
|
|
176
|
+
"population_control",
|
|
177
|
+
"scorecard_taxonomy",
|
|
178
|
+
"synthetic_twin",
|
|
179
|
+
"qa_package",
|
|
180
|
+
"reproducibility_packet",
|
|
181
|
+
"validation_scorecard",
|
|
182
|
+
"checksum_manifest",
|
|
183
|
+
"provider_dry_run",
|
|
184
|
+
"publication_candidates",
|
|
185
|
+
"release_ledger",
|
|
186
|
+
"remittance_advices",
|
|
187
|
+
"replay_runtime",
|
|
188
|
+
"trace_audit",
|
|
189
|
+
"failure_cases",
|
|
190
|
+
"rcm_os_bundle",
|
|
191
|
+
"revenue_cycle_events",
|
|
192
|
+
"specialty_realism_catalog",
|
|
193
|
+
"synthetic_edi_transactions",
|
|
194
|
+
"transaction_bundle",
|
|
195
|
+
"transaction_surface",
|
|
196
|
+
"transaction_validation_report",
|
|
197
|
+
"operations_states",
|
|
198
|
+
"operating_artifact_graph",
|
|
199
|
+
"operating_timeline",
|
|
200
|
+
"synthetic_documents",
|
|
201
|
+
"workflow_replays",
|
|
202
|
+
"workflow_replay_engine",
|
|
203
|
+
"world_entities",
|
|
204
|
+
"world_model",
|
|
205
|
+
"world_validation",
|
|
206
|
+
"usage_metering",
|
|
207
|
+
"audit_log",
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
class ArtifactAccessPolicy(UpstreamBaseModel):
|
|
212
|
+
artifact_id: str
|
|
213
|
+
access_policy: AccessPolicy
|
|
214
|
+
redaction_class: RedactionClass
|
|
215
|
+
publishable: bool
|
|
216
|
+
max_public_rows: int = Field(ge=0)
|
|
217
|
+
rationale: str
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
class AccessPolicyIssue(UpstreamBaseModel):
|
|
221
|
+
artifact_id: str
|
|
222
|
+
severity: Literal["error", "warning"]
|
|
223
|
+
code: str
|
|
224
|
+
detail: str
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
class AccessPolicyValidationReport(UpstreamBaseModel):
|
|
228
|
+
passed: bool
|
|
229
|
+
issues: tuple[AccessPolicyIssue, ...]
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def classify_artifact_access(artifact_id: str, access_policy: AccessPolicy) -> ArtifactAccessPolicy:
|
|
233
|
+
"""Classify an artifact into public, paid, or internal policy lanes."""
|
|
234
|
+
if artifact_id in PUBLIC_SAFE_ARTIFACT_IDS:
|
|
235
|
+
return ArtifactAccessPolicy(
|
|
236
|
+
artifact_id=artifact_id,
|
|
237
|
+
access_policy=access_policy,
|
|
238
|
+
redaction_class="public_teaser",
|
|
239
|
+
publishable=access_policy == "public-read",
|
|
240
|
+
max_public_rows=0,
|
|
241
|
+
rationale="Public-safe teaser or methodology metadata with paid-depth fields redacted.",
|
|
242
|
+
)
|
|
243
|
+
if artifact_id in SCHEMA_ONLY_PUBLIC_ARTIFACT_IDS:
|
|
244
|
+
return ArtifactAccessPolicy(
|
|
245
|
+
artifact_id=artifact_id,
|
|
246
|
+
access_policy=access_policy,
|
|
247
|
+
redaction_class="schema_only",
|
|
248
|
+
publishable=access_policy == "public-read",
|
|
249
|
+
max_public_rows=0,
|
|
250
|
+
rationale="Public schema/catalog metadata only; no generated row payloads.",
|
|
251
|
+
)
|
|
252
|
+
if artifact_id in PAID_DEPTH_ARTIFACT_IDS:
|
|
253
|
+
return ArtifactAccessPolicy(
|
|
254
|
+
artifact_id=artifact_id,
|
|
255
|
+
access_policy=access_policy,
|
|
256
|
+
redaction_class="paid_depth",
|
|
257
|
+
publishable=False,
|
|
258
|
+
max_public_rows=5,
|
|
259
|
+
rationale=(
|
|
260
|
+
"Commercial-depth artifact must stay behind paid API key or tiny fixture approval."
|
|
261
|
+
),
|
|
262
|
+
)
|
|
263
|
+
return ArtifactAccessPolicy(
|
|
264
|
+
artifact_id=artifact_id,
|
|
265
|
+
access_policy=access_policy,
|
|
266
|
+
redaction_class="internal_ops",
|
|
267
|
+
publishable=False,
|
|
268
|
+
max_public_rows=0,
|
|
269
|
+
rationale="Operational integration payload for backend or service-token consumers.",
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
def validate_artifact_access_policy(
|
|
274
|
+
artifact_id: str,
|
|
275
|
+
access_policy: AccessPolicy,
|
|
276
|
+
publishable: bool,
|
|
277
|
+
path: str,
|
|
278
|
+
) -> AccessPolicyValidationReport:
|
|
279
|
+
"""Fail closed when public/publishable surfaces expose paid or internal artifacts."""
|
|
280
|
+
policy = classify_artifact_access(artifact_id, access_policy)
|
|
281
|
+
issues: list[AccessPolicyIssue] = []
|
|
282
|
+
path_text = path.lower()
|
|
283
|
+
if policy.redaction_class in {"paid_depth", "internal_ops"} and publishable:
|
|
284
|
+
issues.append(
|
|
285
|
+
AccessPolicyIssue(
|
|
286
|
+
artifact_id=artifact_id,
|
|
287
|
+
severity="error",
|
|
288
|
+
code="publishable_paid_or_internal_artifact",
|
|
289
|
+
detail=f"redaction_class={policy.redaction_class}",
|
|
290
|
+
)
|
|
291
|
+
)
|
|
292
|
+
if access_policy == "public-read" and artifact_id in PAID_DEPTH_ARTIFACT_IDS:
|
|
293
|
+
issues.append(
|
|
294
|
+
AccessPolicyIssue(
|
|
295
|
+
artifact_id=artifact_id,
|
|
296
|
+
severity="error",
|
|
297
|
+
code="paid_artifact_public_read",
|
|
298
|
+
detail=f"artifact_id={artifact_id}",
|
|
299
|
+
)
|
|
300
|
+
)
|
|
301
|
+
if access_policy == "public-read" and any(
|
|
302
|
+
forbidden in path_text for forbidden in PUBLIC_FORBIDDEN_SUBSTRINGS
|
|
303
|
+
):
|
|
304
|
+
issues.append(
|
|
305
|
+
AccessPolicyIssue(
|
|
306
|
+
artifact_id=artifact_id,
|
|
307
|
+
severity="error",
|
|
308
|
+
code="public_path_reveals_paid_depth",
|
|
309
|
+
detail=f"path={path}",
|
|
310
|
+
)
|
|
311
|
+
)
|
|
312
|
+
if publishable != policy.publishable:
|
|
313
|
+
issues.append(
|
|
314
|
+
AccessPolicyIssue(
|
|
315
|
+
artifact_id=artifact_id,
|
|
316
|
+
severity="error",
|
|
317
|
+
code="publishable_policy_mismatch",
|
|
318
|
+
detail=f"publishable={publishable} expected={policy.publishable}",
|
|
319
|
+
)
|
|
320
|
+
)
|
|
321
|
+
return AccessPolicyValidationReport(
|
|
322
|
+
passed=not issues,
|
|
323
|
+
issues=tuple(issues),
|
|
324
|
+
)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Adjudication explainability artifacts."""
|
|
2
|
+
|
|
3
|
+
from upstream_data.adjudication.traces import (
|
|
4
|
+
ADJUDICATION_TRACE_FILE,
|
|
5
|
+
ADJUDICATION_TRACE_SUMMARY_FILE,
|
|
6
|
+
AdjudicationTraceArtifacts,
|
|
7
|
+
build_adjudication_trace_summary,
|
|
8
|
+
build_adjudication_traces,
|
|
9
|
+
write_adjudication_trace_bundle,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"ADJUDICATION_TRACE_FILE",
|
|
14
|
+
"ADJUDICATION_TRACE_SUMMARY_FILE",
|
|
15
|
+
"AdjudicationTraceArtifacts",
|
|
16
|
+
"build_adjudication_trace_summary",
|
|
17
|
+
"build_adjudication_traces",
|
|
18
|
+
"write_adjudication_trace_bundle",
|
|
19
|
+
]
|