Skip to content

Commit 50ea545

Browse files
authored
test(composition): switch non-verification tests from authorized to attached runtime (#994)
Replace authorized_complete_runtime with attached_complete_runtime in tests that exercise compute/explore/discovery modes but never invoke verification. Replace fresh_complete_runtime with attached_complete_runtime where clean portfolio state suffices but full rebuild is unnecessary. Files changed: - test_graph_capabilities.py (38 authorized + 3 fresh -> attached) - test_capability_discovery.py (5 authorized -> attached) - test_poset_discovery.py (6 fresh -> attached) - test_graph_installation_contract.py (1 fresh -> attached) - test_finite_partition_capability.py (2 fresh -> attached) - test_finite_coverage_capability.py (1 fresh -> attached) - test_topology_discovery.py (1 fresh -> attached) - test_universal_algebra_capabilities.py (4 fresh -> attached)
1 parent 40d25f2 commit 50ea545

8 files changed

Lines changed: 86 additions & 86 deletions

tests/composition/runtime/test_capability_discovery.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ def test_discovery_distinguishes_unknown_domain_from_lexical_absence(
142142

143143

144144
def test_discovery_recognizes_hidden_installed_domains_without_returning_them(
145-
authorized_complete_runtime: JacobianRuntime,
145+
attached_complete_runtime: JacobianRuntime,
146146
) -> None:
147-
discovered = authorized_complete_runtime.core.capabilities.discover(
147+
discovered = attached_complete_runtime.core.capabilities.discover(
148148
CapabilityDiscoveryRequest(domain="artifact")
149149
)
150150

@@ -156,9 +156,9 @@ def test_discovery_recognizes_hidden_installed_domains_without_returning_them(
156156

157157

158158
def test_storage_primitive_is_catalogued_but_not_discovered(
159-
authorized_complete_runtime: JacobianRuntime,
159+
attached_complete_runtime: JacobianRuntime,
160160
) -> None:
161-
capabilities = authorized_complete_runtime.core.capabilities
161+
capabilities = attached_complete_runtime.core.capabilities
162162
catalog_ids = {
163163
descriptor.capability_id for descriptor in capabilities.catalog().capabilities
164164
}
@@ -172,12 +172,12 @@ def test_storage_primitive_is_catalogued_but_not_discovered(
172172

173173

174174
def test_bounded_search_producers_advertise_produced_artifact_types(
175-
authorized_complete_runtime: JacobianRuntime,
175+
attached_complete_runtime: JacobianRuntime,
176176
) -> None:
177177
descriptors = {
178178
descriptor.capability_id: descriptor
179179
for descriptor in (
180-
authorized_complete_runtime.core.capabilities.catalog().capabilities
180+
attached_complete_runtime.core.capabilities.catalog().capabilities
181181
)
182182
}
183183
induced_tree = descriptors["graph.induced_tree.maximum.compute"]
@@ -187,22 +187,22 @@ def test_bounded_search_producers_advertise_produced_artifact_types(
187187

188188

189189
def test_materialize_to_width_produced_types_are_symmetric_and_discoverable(
190-
authorized_complete_runtime: JacobianRuntime,
190+
attached_complete_runtime: JacobianRuntime,
191191
) -> None:
192192
descriptors = {
193193
descriptor.capability_id: descriptor
194194
for descriptor in (
195-
authorized_complete_runtime.core.capabilities.catalog().capabilities
195+
attached_complete_runtime.core.capabilities.catalog().capabilities
196196
)
197197
}
198198
assert descriptors["poset.finite.compute"].produced_artifact_types == ()
199199
assert descriptors["poset.width.compute"].accepted_artifact_types == ()
200200

201201

202202
def test_discovery_distinguishes_strong_weak_and_absent_lexical_fit(
203-
authorized_complete_runtime: JacobianRuntime,
203+
attached_complete_runtime: JacobianRuntime,
204204
) -> None:
205-
runtime = authorized_complete_runtime
205+
runtime = attached_complete_runtime
206206

207207
strong = runtime.core.capabilities.discover(
208208
CapabilityDiscoveryRequest(

tests/composition/runtime/test_finite_coverage_capability.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ def test_finite_coverage_rejects_nfc_collisions_in_scope(
146146

147147

148148
def test_finite_coverage_is_unavailable_without_authorized_checker(
149-
fresh_complete_runtime,
149+
attached_complete_runtime,
150150
) -> None:
151151

152-
result = fresh_complete_runtime.core.capabilities.invoke(
152+
result = attached_complete_runtime.core.capabilities.invoke(
153153
_request(["alpha"], [["alpha"]])
154154
)
155155

tests/composition/runtime/test_finite_partition_capability.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ def _request(
3535

3636

3737
def test_finite_partition_explore_keeps_coverage_obligation_open(
38-
fresh_complete_runtime,
38+
attached_complete_runtime,
3939
) -> None:
4040

41-
result = fresh_complete_runtime.core.capabilities.invoke(
41+
result = attached_complete_runtime.core.capabilities.invoke(
4242
_request(CapabilityMode.EXPLORE)
4343
)
4444

@@ -159,12 +159,12 @@ def accept_with_unbound_obligation(
159159

160160

161161
def test_finite_partition_duplicate_case_ids_cannot_report_complete(
162-
fresh_complete_runtime,
162+
attached_complete_runtime,
163163
) -> None:
164164
request = _request(CapabilityMode.EXPLORE)
165165
request.input["cases"][1]["case_id"] = "even"
166166

167-
result = fresh_complete_runtime.core.capabilities.invoke(request)
167+
result = attached_complete_runtime.core.capabilities.invoke(request)
168168

169169
assert result.output["duplicate_case_ids"] == ["even"]
170170
assert result.completeness.status.value == "PARTIAL"

tests/composition/runtime/test_graph_capabilities.py

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515

1616
def test_generic_graph_artifacts_use_the_authoritative_bounded_model(
17-
authorized_complete_runtime,
17+
attached_complete_runtime,
1818
) -> None:
19-
runtime = authorized_complete_runtime
19+
runtime = attached_complete_runtime
2020
installation = runtime.portfolio.graph
2121
vertices = [f"v{index:03d}" for index in range(256)]
2222

@@ -69,10 +69,10 @@ def test_generic_graph_artifacts_use_the_authoritative_bounded_model(
6969
],
7070
)
7171
def test_generic_graph_artifacts_reject_noncanonical_simple_graphs(
72-
authorized_complete_runtime,
72+
attached_complete_runtime,
7373
payload: dict[str, object],
7474
) -> None:
75-
runtime = authorized_complete_runtime
75+
runtime = attached_complete_runtime
7676
installation = runtime.portfolio.graph
7777

7878
with pytest.raises(ArtifactValidationError, match="does not match its schema"):
@@ -84,9 +84,9 @@ def test_generic_graph_artifacts_reject_noncanonical_simple_graphs(
8484

8585

8686
def test_graph_consumers_reject_forged_malformed_payloads(
87-
authorized_complete_runtime,
87+
attached_complete_runtime,
8888
) -> None:
89-
runtime = authorized_complete_runtime
89+
runtime = attached_complete_runtime
9090
installation = runtime.portfolio.graph
9191
forged = runtime.core.store.put(
9292
schema_uri=installation.graph_schema_uri,
@@ -111,10 +111,10 @@ def test_graph_consumers_reject_forged_malformed_payloads(
111111

112112

113113
def test_explicit_graph_construction_canonicalizes_and_feeds_graph_capabilities(
114-
authorized_complete_runtime,
114+
attached_complete_runtime,
115115
) -> None:
116116

117-
constructed = authorized_complete_runtime.core.capabilities.invoke(
117+
constructed = attached_complete_runtime.core.capabilities.invoke(
118118
CapabilityRequest(
119119
capability_id="graph.construct.explicit",
120120
input={
@@ -131,19 +131,19 @@ def test_explicit_graph_construction_canonicalizes_and_feeds_graph_capabilities(
131131
"edges": [["a", "b"], ["b", "c"]],
132132
}
133133
graph_uri = constructed.output["graph_uri"]
134-
stored = authorized_complete_runtime.core.store.get(graph_uri)
134+
stored = attached_complete_runtime.core.store.get(graph_uri)
135135
assert stored.payload == constructed.output["graph"]
136136
assert (
137137
stored.manifest.schema_uri
138-
== authorized_complete_runtime.portfolio.graph.graph_schema_uri
138+
== attached_complete_runtime.portfolio.graph.graph_schema_uri
139139
)
140140
assert (
141141
stored.manifest.semantics_uri
142-
== authorized_complete_runtime.portfolio.graph.semantics_uri
142+
== attached_complete_runtime.portfolio.graph.semantics_uri
143143
)
144144
assert stored.manifest.object_digest == constructed.output["graph_object_digest"]
145145

146-
properties = authorized_complete_runtime.core.capabilities.invoke(
146+
properties = attached_complete_runtime.core.capabilities.invoke(
147147
CapabilityRequest(
148148
capability_id="graph.compute.properties",
149149
input={"graph_uri": graph_uri, "properties": ["order", "tree"]},
@@ -164,11 +164,11 @@ def test_explicit_graph_construction_canonicalizes_and_feeds_graph_capabilities(
164164
],
165165
)
166166
def test_explicit_graph_construction_fails_before_artifact_writes(
167-
authorized_complete_runtime,
167+
attached_complete_runtime,
168168
input_payload: dict[str, object],
169169
) -> None:
170170

171-
result = authorized_complete_runtime.core.capabilities.invoke(
171+
result = attached_complete_runtime.core.capabilities.invoke(
172172
CapabilityRequest(
173173
capability_id="graph.construct.explicit",
174174
input=input_payload,
@@ -182,10 +182,10 @@ def test_explicit_graph_construction_fails_before_artifact_writes(
182182

183183

184184
def test_graph_atlas_search_is_bounded_complete_and_replayable(
185-
authorized_complete_runtime,
185+
attached_complete_runtime,
186186
) -> None:
187187

188-
result = authorized_complete_runtime.core.capabilities.invoke(
188+
result = attached_complete_runtime.core.capabilities.invoke(
189189
CapabilityRequest(
190190
capability_id="graph.search.atlas",
191191
input={
@@ -213,25 +213,25 @@ def test_graph_atlas_search_is_bounded_complete_and_replayable(
213213

214214
for candidate in result.output["candidates"]:
215215
graph_uri = candidate["graph_uri"]
216-
graph = authorized_complete_runtime.core.store.get(graph_uri)
216+
graph = attached_complete_runtime.core.store.get(graph_uri)
217217
assert candidate["graph"] == graph.payload
218218
assert graph.payload["graph_schema_version"] == "1"
219219
assert len(graph.payload["vertices"]) == 5
220220
assert candidate["properties"]["connected"] is True
221221
assert candidate["properties"]["triangle_count"] == 0
222222
assert candidate["properties"]["independence_number"] == 3
223223

224-
scope = authorized_complete_runtime.core.store.get(result.scope.artifact_uri)
224+
scope = attached_complete_runtime.core.store.get(result.scope.artifact_uri)
225225
assert scope.payload["source"] == "networkx.graph_atlas_g"
226226
assert scope.payload["order"] == 5
227227
assert scope.payload["enumerated_count"] > 0
228228

229229

230230
def test_graph_atlas_search_reports_no_match_without_a_truth_claim(
231-
authorized_complete_runtime,
231+
attached_complete_runtime,
232232
) -> None:
233233

234-
result = authorized_complete_runtime.core.capabilities.invoke(
234+
result = attached_complete_runtime.core.capabilities.invoke(
235235
CapabilityRequest(
236236
capability_id="graph.search.atlas",
237237
input={
@@ -253,10 +253,10 @@ def test_graph_atlas_search_reports_no_match_without_a_truth_claim(
253253

254254

255255
def test_graph_capabilities_return_actionable_parameter_and_artifact_errors(
256-
authorized_complete_runtime,
256+
attached_complete_runtime,
257257
) -> None:
258258

259-
invalid_range = authorized_complete_runtime.core.capabilities.invoke(
259+
invalid_range = attached_complete_runtime.core.capabilities.invoke(
260260
CapabilityRequest(
261261
capability_id="graph.search.atlas",
262262
input={
@@ -272,7 +272,7 @@ def test_graph_capabilities_return_actionable_parameter_and_artifact_errors(
272272
assert invalid_range.diagnostics[0].code == "INVALID_CONSTRAINT_RANGE"
273273
assert invalid_range.diagnostics[0].path == "constraints/minimum_edges"
274274

275-
missing_graph = authorized_complete_runtime.core.capabilities.invoke(
275+
missing_graph = attached_complete_runtime.core.capabilities.invoke(
276276
CapabilityRequest(
277277
capability_id="graph.compute.properties",
278278
input={
@@ -286,9 +286,9 @@ def test_graph_capabilities_return_actionable_parameter_and_artifact_errors(
286286

287287

288288
def test_graph_property_batch_materializes_exact_computed_artifact(
289-
authorized_complete_runtime,
289+
attached_complete_runtime,
290290
) -> None:
291-
searched = authorized_complete_runtime.core.capabilities.invoke(
291+
searched = attached_complete_runtime.core.capabilities.invoke(
292292
CapabilityRequest(
293293
capability_id="graph.search.atlas",
294294
input={
@@ -300,7 +300,7 @@ def test_graph_property_batch_materializes_exact_computed_artifact(
300300
)
301301
graph_uri = searched.output["candidates"][0]["graph_uri"]
302302

303-
result = authorized_complete_runtime.core.capabilities.invoke(
303+
result = attached_complete_runtime.core.capabilities.invoke(
304304
CapabilityRequest(
305305
capability_id="graph.compute.properties",
306306
mode=CapabilityMode.EXPLORE,
@@ -369,7 +369,7 @@ def test_graph_property_batch_materializes_exact_computed_artifact(
369369
assert set(relationship.target_artifact_uris[1:]) == {
370370
binding["artifact_uri"] for binding in result.output["results"]
371371
}
372-
property_artifact = authorized_complete_runtime.core.store.get(
372+
property_artifact = attached_complete_runtime.core.store.get(
373373
result.output["property_artifact_uri"]
374374
)
375375
assert set(property_artifact.manifest.parents) == {
@@ -387,7 +387,7 @@ def test_graph_property_batch_materializes_exact_computed_artifact(
387387
"triangle_count",
388388
]
389389
for binding in result.output["results"]:
390-
invariant_artifact = authorized_complete_runtime.core.store.get(
390+
invariant_artifact = attached_complete_runtime.core.store.get(
391391
binding["artifact_uri"]
392392
)
393393
assert invariant_artifact.manifest.parents == (graph_uri,)
@@ -399,11 +399,11 @@ def test_graph_property_batch_materializes_exact_computed_artifact(
399399
[(24, "COMPUTED"), (25, "NOT_COMPUTED")],
400400
)
401401
def test_exact_independence_number_stops_at_the_order_boundary(
402-
authorized_complete_runtime,
402+
attached_complete_runtime,
403403
order: int,
404404
expected_status: str,
405405
) -> None:
406-
runtime = authorized_complete_runtime
406+
runtime = attached_complete_runtime
407407
installation = runtime.portfolio.graph
408408
graph = runtime.core.artifacts.put(
409409
schema_uri=installation.graph_schema_uri,
@@ -437,9 +437,9 @@ def test_exact_independence_number_stops_at_the_order_boundary(
437437

438438

439439
def test_graph_counterexample_invariant_batch_reproduces_path_five(
440-
fresh_complete_runtime,
440+
attached_complete_runtime,
441441
) -> None:
442-
searched = fresh_complete_runtime.core.capabilities.invoke(
442+
searched = attached_complete_runtime.core.capabilities.invoke(
443443
CapabilityRequest(
444444
capability_id="graph.search.atlas",
445445
input={
@@ -451,7 +451,7 @@ def test_graph_counterexample_invariant_batch_reproduces_path_five(
451451
)
452452
graph_uri = searched.output["candidates"][0]["graph_uri"]
453453

454-
result = fresh_complete_runtime.core.capabilities.invoke(
454+
result = attached_complete_runtime.core.capabilities.invoke(
455455
CapabilityRequest(
456456
capability_id="graph.compute.properties",
457457
input={
@@ -490,9 +490,9 @@ def test_graph_counterexample_invariant_batch_reproduces_path_five(
490490

491491

492492
def test_graph_invariant_batch_preserves_unsupported_and_not_applicable_results(
493-
fresh_complete_runtime,
493+
attached_complete_runtime,
494494
) -> None:
495-
searched = fresh_complete_runtime.core.capabilities.invoke(
495+
searched = attached_complete_runtime.core.capabilities.invoke(
496496
CapabilityRequest(
497497
capability_id="graph.search.atlas",
498498
input={
@@ -503,7 +503,7 @@ def test_graph_invariant_batch_preserves_unsupported_and_not_applicable_results(
503503
)
504504
)
505505

506-
result = fresh_complete_runtime.core.capabilities.invoke(
506+
result = attached_complete_runtime.core.capabilities.invoke(
507507
CapabilityRequest(
508508
capability_id="graph.compute.properties",
509509
input={
@@ -564,11 +564,11 @@ def test_graph_invariant_batch_preserves_unsupported_and_not_applicable_results(
564564

565565

566566
def test_graph_invariant_registry_is_fixed_and_discoverable(
567-
fresh_complete_runtime,
567+
attached_complete_runtime,
568568
) -> None:
569569
descriptor = next(
570570
item
571-
for item in fresh_complete_runtime.core.capabilities.catalog().capabilities
571+
for item in attached_complete_runtime.core.capabilities.catalog().capabilities
572572
if item.capability_id == "graph.compute.properties"
573573
)
574574

tests/composition/runtime/test_graph_installation_contract.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ def test_graph_installation_preserves_public_identity_and_adapter_order(
3434

3535

3636
def test_graph_installation_omits_unauthorized_checker_ids(
37-
fresh_complete_runtime,
37+
attached_complete_runtime,
3838
) -> None:
39-
installation = fresh_complete_runtime.portfolio.graph
39+
installation = attached_complete_runtime.portfolio.graph
4040
assert isinstance(installation, GraphInstallation)
4141
assert installation.degree_sequence_checker_id is None
4242
assert installation.neighborhood_checker_id is None
4343

44-
descriptors = fresh_complete_runtime.core.capabilities.catalog().capabilities
44+
descriptors = attached_complete_runtime.core.capabilities.catalog().capabilities
4545
for capability_id in (
4646
"graph.realize.degree_sequence",
4747
"graph.compute.neighborhood_independence",

0 commit comments

Comments
 (0)