Repository navigation
Add AS entitlement bridges, take-up gaps and scenario bands (NZ graph G7) - #1181
Conversation
Register counterfactual and fixed vector-bisection kernels against one prepared engine map. Compose spec-declared entitlement scenarios, independent calibration variants, held-out comparisons and labelled bands into the final receipt. Keep calibration independent of AS and hold-out inputs, bind scenario knobs separately, and preserve every skeleton predecessor set except explicit final receipt artifact edges. Cover AS bounds, exclusions, monotonicity, weighted totals, exact gaps, deterministic labelled bands and cache locality with engine-free properties and differentials. Leave real activation and receipts to the hub; include a local golden-08/sample differential driver. Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1180 had not landed when the round-1 fix lane ran, so G7 merges its branch directly; once #1180 merges to main, later merges of main are trivial. The one conflict, packages/microcosm-build/src/microcosm/build/ transport/compose.py, is resolved with the fix lane's tested version: it keeps #1180's preflight (shared resource-selection resolver, malformed names, receipt-contract validator, references, age, pins, null knobs) and adds G7's entitlement/scenario selections and the terminal-package exception. That resolution also carries the lane's finding-5 change (activation reads only rows the entitlement factory instantiates), since both edit the same function. The rest of the lane's fixes follow in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Validate differential call identities, output ownership, comparisons and canonical oracle pointers before registry preparation. Verify returned row-independent bisection answers with a fixed final engine evaluation. Resolve G6/G7 activation intent using the entitlement factory's selected rows and shared resource preflight. Correct the golden-08 and deferred-law claims. Preserve origin/main and transport/g6-review-nits changes in the prepared tree. Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
|
Merged by the NZ hub (session local_e407a527) at 809d138 with --merge. Gates: |
G7 of the Microcosm NZ graph plan (Max's d962): the Accommodation Supplement chain, built on G6's skeleton (#1161, merged) through its extension point. Under the hub's G6/G7 split amendment, G7 owns the scenario- and gap-dependent properties.
What it adds
simulate.counterfactual@1andsimulate.solve_zero@1inpackages/microcosm-frame/src/microcosm/frame/rules_kernels.py. Both take an{engine_ref: RulesEngine}mapping, so the base rate can read more than one module (R15), and both use only theRulesEngineprotocol.solve_zerois vectorised per-row bisection with a fixed iteration count and a declared tolerance, so it is deterministic. It requires independent, non-increasing row residuals; coupled systems are explicitly not supported. It evaluates the returned answers and refuses any residual that is positive beyond the tolerance, and it reports its fixed evaluation count (iterations + 3). Implementation identity binds the code and adapter classes; selected spec values and their resource digests go in node params.takeup.gap@1andtakeup.bands@1inbuild/transport/takeup_kernels.py. The gap compiles declared references, then computes E, the annualised weighted selected measure (dollars for expenditure references, counts for count references), the published comparator A, and E − A exactly. Bands keep min, central and max per table, and each bound names the scenario that set it.build/transport/entitlement.py: the AS chain as a spec-declaredTransportExtension. It covers the bridges, the AS rules node, scenarios S0–S5, variants V1–V3, grouped and count gaps, bands and a WFF tripwire. An optionalentitlement_graphspec resource installs it, and its resource shape is documented indocs/transport-entitlement.md.One change to G6's extension guard, which reviewers should check. An extension may now add typed artifact edges (
TransportExtension.package_inputs) to the skeleton's terminaltransport.package@1node, so the final receipt can carry gaps and bands. Each condition is enforced incompose.py:Every other skeleton node's predecessor set stays fixed. Plan §2.3 has bands feeding
nz.package, and the amendment expectsnz.packageto miss when S1 changes.tools/transport_bridge_differential.py: a hub-run driver for small-case and sampled-unit differentials against the axiom-oracles Treasury IncomeExplorer cases. Before preparing anything it refuses ambiguous cases: empty or duplicate call IDs, two calls writing one output, and comparisons naming a missing or ambiguous call. It also refuses missing or invalid oracle values and tolerances. Oracle pointers follow RFC 6901, with canonical non-negative array indices and bounds checks. Without the engine it writes a skipped receipt. Assembling golden-08 itself is unresolved, pending the approved case. The committed bridge declaration (build/nz/as_rate_bridge.json) recovers the threshold and slope from three evaluations rather than a zero solve, and the driver cannot yet express that composition. No real-engine result is claimed in this PR.Invariants (Hypothesis property tests on an engine-free toy graph with invented engines)
nz.scn.S1.*,nz.as.bandsandnz.package.Not in this PR (activation, G8 and D1)
Tests
Run by the hub at b2c8e38, one file at a time:
test_transport_bridge_differential.py37,test_counterfactual_kernels.py27,test_transport_graph.py15,test_transport_takeup_kernels.py22,test_transport_entitlement_graph.py23,test_transport_composed_graph.py137,test_transport_column_kernels.py29. All passed. The fix lane also rantest_transport_registry.py(31), the spec-only test (8) andtest_ci_integration_job.py(9), for 338 in total. Every one of its 84 new or changed cases fails on 8ac9b1f or under a named mutant.tools/ci_test_plan.py verify, ruff check and format, andgit diff --checkpass.Review
solve_zerocould return a positive residual when rows are coupled. Non-blocking findings covered the golden-08 recipe contradictingas_rate_bridge.json, lax oracle-pointer parsing, and activation checking unused templates.compose.pyconflict keeps Validate transport activation before preparation; drop the wall-clock assertion (G6 review nits) #1180's preflight and adds G7's selections. The lane's sandbox could not write git metadata, so the hub recorded both merges and verified that the final tree equals the tree the lane tested.Part of Microcosm NZ v0 (d962), package G7. Built on a GPT-6.1 Sol Subfleet lane; verified, committed and opened by the NZ hub.
🤖 Generated with Claude Code