Set 7 Source Engines Bundle
Set 7 Source Engines Bundle imports source engine bodies and exercises trace, graph, scheduling, source-index, patch, numeric, rank, and regression-selection invariants.
The write-up
Eight copied engines under one public fixture
batch7_macro_engines_capsule takes eight unrelated engines that were copied out of the wider system as source and checks that each one still behaves the way its own tests and invariants say it should. batch7_macro_engines_capsule takes eight unrelated engines that were copied out of the wider system as source and checks that each one still behaves the way its own tests and invariants say it should. The engines have nothing in common at runtime: a trace parser written in JavaScript, a dependency-graph scheduler, an AST source index, a patch applier, a network-isolation guard, a robust numeric scorer, a personalized PageRank ranker, and a regression-test selector.
The component runs each engine through one small deterministic exercise with a known answer, then records a metadata-only result row for it. The component runs each engine through one small deterministic exercise with a known answer, then records a metadata-only result row for it. A pass means every engine produced its expected output and every paired negative case kept failing.
It writes batch7_macro_engines_capsule_result.json, a board, a validation result record, and a bundle result under the output directory the caller names. It writes batch7_macro_engines_capsule_result.json, a board, a validation result record, and a bundle result under the output directory the caller names. Those records carry status, counts, digests, and engine ids. They never carry the copied source or captured command output: every row sets body_in_receipt to false.
Purpose
Copied code is easy to trust and easy to be wrong about. A source body can be copied faithfully, pass a digest check, and still be broken or subtly different from the engine it was copied from. Copied code is easy to trust and easy to be wrong about. A source body can be copied faithfully, pass a digest check, and still be broken or subtly different from the engine it was copied from. A digest match proves the bytes arrived. It says nothing about whether the code runs.
This component refuses to treat a digest match as behavior. Each engine has to execute and return the right value before its row is allowed to pass, and each engine's failure mode has to stay a failure. This component refuses to treat a digest match as behavior. Each engine has to execute and return the right value before its row is allowed to pass, and each engine's failure mode has to stay a failure. The point is not that any single engine is interesting on its own. It is that eight engines with quite different runtimes, an external Node process, in-process Python calls, and static AST reads, can be exercised together under one fixture and one scope limit.
How it works
_evaluate selects one of two paths from the input directory name. When the directory is exported_batch7_macro_engines_capsule_bundle, it calls _source_open_bundle_exercises, which gates all eight engine rows on two manifest fields, all_expected_digests_matched and all_required_anchors_present. _evaluate selects one of two paths from the input directory name. When the directory is exported_batch7_macro_engines_capsule_bundle, it calls _source_open_bundle_exercises, which gates all eight engine rows on two manifest fields, all_expected_digests_matched and all_required_anchors_present. If either is false, every row is blocked. Otherwise _evaluate runs the eight live exercises in order. It records a finding for any row that did not pass and for any engine in EXPECTED_ENGINES that is missing from the result.
Each live exercise is a single function. Each returns a status plus the concrete facts it checked. Each live exercise is a single function. Each returns a status plus the concrete facts it checked.
| Function | Engine | What it checks |
|---|---|---|
_agent_trace_exercise | agent_trace_ir_compiler | Runs node --test parser.test.mjs against the copied parser.mjs. The suite includes a commit claim with no diff evidence, which the parser rejects. |
_dag_exercise | constitutional_dag_kernel | Calls compute_waves on a six-node graph and checks the schedule is [["a","f"], ["b","c"], ["d"], ["e"]]. A two-node cycle must raise ValueError; audit_config_purity must flag an impure config. |
_release_root_exercise | release_root_compiler | Parses the copied release_root_compiler.py with ast.parse and checks build_std_python_report and build_release_root_compiler are defined and the source reports missing_ref_count. |
_source_surgeon_exercise | source_surgeon_patch | Uses SourceSurgeon._apply_unified_diff_hunks. A one-line diff must yield a = 'B'; a mismatched-context diff must raise ApplyError; malformed Python must raise SyntaxError. |
_clean_clone_exercise | hermetic_clean_clone | Swaps socket.create_connection and socket.socket for a raiser, confirms an outbound connection raises NetworkDisabled, then restores both. |
_calculator_exercise | calculator_standard_actor | Feeds [1, 2, 3, 4, 5, 100] to StandardActor._compute_center_scale. The robust center stays at 3.5 while the naive mean rises above 19. |
_pagerank_exercise | personalized_pagerank_ranker | Calls personalized_pagerank on a four-node graph. Scores must sum to 1.0; an unknown source node must return {}. |
_regression_selection_exercise | regression_test_selection | Runs select_impacted_tests.py --json, or reads the copied selector statically in the exported-bundle path, and checks the fallback test set is never empty. |
Three helpers hold the orchestration together. _safe_engine wraps each runner and converts any exception into a blocked row rather than crashing the run. Three helpers hold the orchestration together. _safe_engine wraps each runner and converts any exception into a blocked row rather than crashing the run. _semantic_runtime_exercises assembles the eight rows keyed by engine id and caches the result for a given input. evaluate_negative_case and _observed_negative_case confirm a declared negative case was actually seen before it counts, so a passing engine plus a witnessed rejection is what marks a case as covered.
Shared crown-jewel entrypoint wiring
run and run_batch7_bundle forward SPEC to run_crown_jewel_organ with _evaluate and evaluate_negative_case. result_card projects the result into a compact card that carries engine_count and copied_macro_source_module_count and nothing else from the run. run and run_batch7_bundle forward SPEC to run_crown_jewel_organ with _evaluate and evaluate_negative_case. result_card projects the result into a compact card that carries engine_count and copied_macro_source_module_count and nothing else from the run.
Diagram source & refs
flowchart TD input["Input directory"] bundle["Exported bundle: gate 8 rows on manifest digests and anchors"] live["Live fixture: run 8 engine exercises"] neg["Negative cases: must keep failing"] result["metadata-only result: status, counts, digests"] input --> bundle input --> live live --> neg bundle --> result neg --> resultNegative cases
Each engine has a paired case that must be rejected, listed in EXPECTED_NEGATIVE_CASES with its stable error code: Each engine has a paired case that must be rejected, listed in EXPECTED_NEGATIVE_CASES with its stable error code:
trace_commit_without_diffgivesBATCH7_TRACE_COMMIT_WITHOUT_DIFF_REJECTED.dag_cyclegivesBATCH7_DAG_CYCLE_REJECTED.release_root_bad_refgivesBATCH7_RELEASE_ROOT_BAD_REF_REPORTED.source_surgeon_context_mismatchgivesBATCH7_SOURCE_SURGEON_CONTEXT_MISMATCH.clean_clone_network_callgivesBATCH7_CLEAN_CLONE_NETWORK_DISABLED.calculator_outliergivesBATCH7_CALCULATOR_OUTLIER_RESISTANT.pagerank_missing_sourcegivesBATCH7_PAGERANK_MISSING_SOURCE_REFUSED.regression_selection_emptygivesBATCH7_RTS_NEVER_EMPTY_FALLBACK.
A case only counts once _observed_negative_case sees the matching engine pass and the specific rejection field set, so a case cannot be marked covered by an engine that did not run. A case only counts once _observed_negative_case sees the matching engine pass and the specific rejection field set, so a case cannot be marked covered by an engine that did not run.
Prior Art Grounding
The engines sit on standard practice in trace instrumentation and graph analysis: parse execution traces into structured units of work, preserve graph-rank invariants, schedule a dependency graph into waves, and choose focused tests without claiming they are sufficient. The engines sit on standard practice in trace instrumentation and graph analysis: parse execution traces into structured units of work, preserve graph-rank invariants, schedule a dependency graph into waves, and choose focused tests without claiming they are sufficient. Two anchors are directly relevant. OpenTelemetry documents traces and spans as a vendor-neutral model for units of work and their relationships, which is the shape the trace parser produces. NetworkX PageRank documents the PageRank family this component's ranker follows. The regression selector follows ordinary test-impact-analysis practice with a never-empty fallback.
Validation Result record Path
Run from the microcosm-substrate/ public root:
The fixture command runs the eight live exercises and writes the result and sign-off JSON. The bundle command validates the copied source witnesses against the manifest without emitting any source body. The fixture command runs the eight live exercises and writes the result and sign-off JSON. The bundle command validates the copied source witnesses against the manifest without emitting any source body. The focused test covers the runtime path, the exported-bundle path, the negative cases, and the card's body omission. A pass across all of these means the fixture-bound run held; it does not extend past that.
Scope boundary
Scope limit
The strongest claim this component supports is bounded and fixture-scoped: eight copied engines were exercised through public fixtures, each produced its expected output, and each paired negative case kept failing. The strongest claim this component supports is bounded and fixture-scoped: eight copied engines were exercised through public fixtures, each produced its expected output, and each paired negative case kept failing. That is validator evidence under the AUTHORITY_CEILING constant, which sets release_authorized, provider_dispatch, source_mutation_authorized, investment_advice, semantic_truth_authority, and test_completeness_proof all to false.
The proof boundary stops at the copied source and the deterministic exercises. A pass is not launch-scope decision, hosted-public authority, whole-system equivalence, a complete sandbox, or proof that the selected tests are sufficient. The proof boundary stops at the copied source and the deterministic exercises. A pass is not launch-scope decision, hosted-public authority, whole-system equivalence, a complete sandbox, or proof that the selected tests are sufficient. The calculator is a numeric primitive, not market data or investment-related actions. The ranker checks a rank invariant, not meaning. The clean-clone check proves one hermetic baseline, not full isolation. The scope limit excludes raw operator transcripts, model-output data, account secrets, and live fetches, and none of those appear in any result record.
Context & evidence
In short Set 7 Source Engines Bundle binds the accepted batch7_macro_engines_capsule component to its public source-open bundle. It checks copied trace parser, codemap layout, DAG scheduling, launch-root, source-surgeon, clean-clone, calculator, PageRank, and regression-selection witnesses, negative cases, digest boundaries, and scope limits while excluding launch-scope decision, whole-system equivalence, semantic truth, investment-related actions, sandbox completeness, and selected-test sufficiency proof.
Scope limit Fixture-bound public source-body import and deterministic exercise evidence only; no launch-scope decision, whole-system equivalence, semantic truth, investment-related actions, complete sandbox proof, selected-test sufficiency proof, external model access, or source-file changes.
Covers Trace, Code-Map & Scheduling Engines Bundle
Source
Source Source module: src/microcosm_core/organs/batch7_macro_engines_capsule.py · Design note · Source registry