Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/storyworld-hypergames-hgw05.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Hypergames HGW-05 causal family development
on:
push:
paths:
- 'codex-skills/hyperworld-builder/**'
- '.github/workflows/storyworld-hypergames-hgw05.yml'
pull_request:
paths:
- 'codex-skills/hyperworld-builder/**'
- '.github/workflows/storyworld-hypergames-hgw05.yml'
workflow_dispatch:

jobs:
source-locked-cpu:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Source, posterior, causal twins, and grader-isolation tests
run: python -m unittest discover -s codex-skills/hyperworld-builder/tests -p 'test_hgw05*.py' -q
- name: Recompute independent development roots and model-facing tasks
run: |
python codex-skills/hyperworld-builder/scripts/hgw05_causal_families.py \
--roots 64 --cases-per-root 8 \
--out "$RUNNER_TEMP/hgw05_report.json" \
--public-tasks "$RUNNER_TEMP/hgw05_public.jsonl"
cmp "$RUNNER_TEMP/hgw05_report.json" \
codex-skills/hyperworld-builder/fixtures/hgw05_development_receipt_64x8.json
python -c 'import json,os,pathlib; p=pathlib.Path(os.environ["RUNNER_TEMP"]); z=json.loads((p/"hgw05_report.json").read_text()); assert z["total_independent_development_roots"]==192 and z["total_case_rows"]==2048 and z["generator_roster"]["confirmation_roots_generated"]==0; lines=(p/"hgw05_public.jsonl").read_text().splitlines(keepends=True); assert len(lines)==2048; (p/"hgw05_sample.jsonl").write_text("".join(lines[i] for family in range(4) for i in range(family*512,family*512+4)))'
cmp "$RUNNER_TEMP/hgw05_sample.jsonl" \
codex-skills/hyperworld-builder/fixtures/hgw05_public_sample.jsonl
- name: Checkout pinned EvalMath inference and power gate
uses: actions/checkout@v4
with:
repository: MoralityLabAI/EvalMath
ref: 9708f1edaf1cb25904b88b07c3f23c1899df7cac
path: evalmath
- name: Evaluate five preflight manifests, assert development-only status
run: |
python -c 'import json,os,pathlib; p=pathlib.Path(os.environ["RUNNER_TEMP"]); z=json.loads((p/"hgw05_report.json").read_text()); [(p/(name+".json")).write_text(json.dumps(z["families"][name]["evalmath_pilot"])) for name in ("direct","confounded","p2_parity","provenance")]; (p/"causal_twin.json").write_text(json.dumps(z["primary_causal_twin_evalmath_pilot"]))'
for family in direct confounded p2_parity provenance causal_twin; do
if python evalmath/skills/evalmath-mechinterp-power/scripts/preflight.py \
--pilot "$RUNNER_TEMP/$family.json" --out "$RUNNER_TEMP/$family.preflight.json" --strict; then
echo "A development-only pilot incorrectly passed confirmation: $family" >&2
exit 1
else
status=$?
test "$status" -eq 2
fi
done
python -c 'import json,os,pathlib; p=pathlib.Path(os.environ["RUNNER_TEMP"]); names=("direct","confounded","p2_parity","provenance","causal_twin"); r=[json.loads((p/(f+".preflight.json")).read_text()) for f in names]; assert all(x["decision"]=="REDESIGN_OR_PILOT_ONLY" and "heldout_unsealed" in x["reasons"] for x in r); assert all(x["upper_sham_quantile"]==0 for x in r), r; print([(n,x["approx_worlds_for_80pct_power"],x["reasons"]) for n,x in zip(names,r)])'
29 changes: 29 additions & 0 deletions .github/workflows/storyworld-hyperworld-cairo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,35 @@ jobs:
python-version: '3.11'
- name: Exact posterior, perception and source-isolation tests
run: python -m unittest discover -s codex-skills/hyperworld-builder/tests -p 'test_*.py' -q
- name: HGW-04 EvalMath interoperability (pinned external source)
uses: actions/checkout@v4
with:
repository: MoralityLabAI/EvalMath
ref: 9708f1edaf1cb25904b88b07c3f23c1899df7cac
path: evalmath
- name: HGW-04 exact causal receipts and unsealed pilot gate
run: |
python codex-skills/hyperworld-builder/scripts/causal_inclinations.py \
--spec codex-skills/hyperworld-builder/fixtures/hgw04_development_pilot.json \
--out "$RUNNER_TEMP/hgw04-audit.json" \
--evalmath-pilot "$RUNNER_TEMP/hgw04-pilot.json"
python codex-skills/hyperworld-builder/scripts/benchmark_receipts.py \
--input codex-skills/hyperworld-builder/fixtures/hgw04_policy_development.json \
--out "$RUNNER_TEMP/hgw04-policy-audit.json" \
--fsi-manifest "$RUNNER_TEMP/hgw04-fsi.json"
if python evalmath/skills/evalmath-mechinterp-power/scripts/preflight.py \
--pilot "$RUNNER_TEMP/hgw04-pilot.json" --strict \
--out "$RUNNER_TEMP/hgw04-preflight.json"; then
echo "Unsealed 8-root pilot incorrectly passed EvalMath confirmation gate" >&2
exit 1
else
status=$?
test "$status" -eq 2
fi
PYTHONPATH=evalmath/src python -m spiral_ln.evaluation_finite_sample \
--manifest "$RUNNER_TEMP/hgw04-fsi.json" \
--output "$RUNNER_TEMP/hgw04-fsi-result.json"
python -c 'import json,os; d=json.load(open(os.environ["RUNNER_TEMP"]+"/hgw04-preflight.json")); assert d["decision"]=="REDESIGN_OR_PILOT_ONLY"; assert "heldout_unsealed" in d["reasons"]; assert "sham_quantile_uncalibrated" in d["reasons"]'
- name: Original StoryworldBuilder validation contract
run: python codex-skills/storyworld-building/scripts/sweepweave_validator.py validate storyworlds/cairo_directorate_hyperworld/storyworld.json
- name: Rebuild authored export from the frozen generator
Expand Down
17 changes: 17 additions & 0 deletions codex-skills/hyperworld-builder/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,20 @@ Every ordinary reaction should affect a declared salient trait of each involved
The Python runtime retains authority for posterior Bayes updates, source provenance, dynamic graph gates and final human votes. An authored SweepWeave end-page inclination can never certify a constitutional verdict. Mark that page as requiring native adjudication. Freeze the HGW-02 public seed receipts and original branch before changing default replay semantics. Run the validator, generated-fixture byte check, full 32+ tests and registered CPU rehearsal, with a new development report for opt-in behavior.

For Three Voices in the Fog, allocate separate budgets for each AI's own 20 actual traits, public segments' 12 traits, selected world axes, and directed first/second-order beliefs. Include pair interaction terms only for named characters on active edges. Treat p2 as a correlated observer model. Sealed RSI grades and opponent resources must remain outside the score's visible inputs.


## HGW-04: causal inclination and EvalMath-grade builder audit

Before a new Hypergames benchmark climb, load `references/HGW04_CAUSAL_INCLINATION.md`. Model hidden generator variables, publicly observable posterior/pValue/p2Value projections, causal intervention paths, sham interventions and reaction inclination formulas as separate objects. Use the new pure-stdlib `scripts/causal_inclinations.py` on independent development world roots, then export its pilot to the pinned EvalMath `evalmath-mechinterp-power` preflight. Root reuse, adaptive formula searches, and any change to the generator after the preflight must be logged. The optional audit does not modify the frozen HGW-02/HGW-03 runtime or fixtures.

Treat character preferences as bounded authored scores, not calibrated probabilities. Require causal lineage for inferred variables and test matched do/sham interventions with the same exogenous root. Use a fresh, sealed and properly powered confirmation family before claims about neural agent policies. Preserve the invariant that legal human votes and recall are judged independently of belief-graph consensus.


### Model-facing policy outcomes

Use `scripts/benchmark_receipts.py` to convert matched policy rollouts into an EvalMath FSI-01 manifest with `cluster_id = independent world root`. It gates `task_success` by legal and critical-action fields, reports Brier calibration as an equal-root macro mean, carries preflight/generator/model/judge source locks and requires author attestations for sealing. The demo `fixtures/hgw04_policy_development.json` is intentionally unsealed; it supplies no learned-model success claim. See the worked invocation in `references/HGW04_CAUSAL_INCLINATION.md`.


## HGW-05: independent causal families and benchmark climbing

Read `references/HGW05_CAUSAL_BENCHMARK.md` before building a new Hypergames gym or running an adaptive climb. `scripts/hgw05_causal_families.py` offers exact matched observational direct/confounded laws, randomized interventions, correlation-only second-order parity reports and repeated-source provenance challenges. It generates 10-bit posterior tasks, public model prompts and frozen development-only EvalMath pilot receipts. Scripts use the current synthetic programmatic controls as *algorithmic ceilings*. The 64-root development roster is grouped by generator root; the direct/confounded observational twins share a root. Keep the source/score locks and the held-out seal state with every result. For learned agents, record matched shams and paired root-level outcomes in `scripts/benchmark_receipts.py`, run EvalMath strict preflight, then freeze models and source before opening fresh confirmation worlds.
155 changes: 155 additions & 0 deletions codex-skills/hyperworld-builder/fixtures/hgw04_development_pilot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
{
"schema_version": "hgw04/causal-inclinations/v1",
"model": {
"exogenous": [
"z",
"audit",
"noise",
"sham"
],
"nodes": [
{
"name": "evidence",
"linear": {
"z": "1/4",
"audit": "1/2"
}
},
{
"name": "belief_about_belief",
"linear": {
"evidence": "1/2",
"noise": "1/4"
},
"products": [
{
"left": "evidence",
"right": "noise",
"weight": "1/4"
}
]
},
{
"name": "irrelevant",
"linear": {
"sham": "1/2"
}
}
],
"visible": [
"evidence",
"belief_about_belief",
"irrelevant"
]
},
"formula": {
"offset": "1/2",
"linear": {
"evidence": "1/5",
"belief_about_belief": "1/10"
},
"products": [
{
"left": "evidence",
"right": "belief_about_belief",
"weight": "1/25"
}
]
},
"development_worlds": [
{
"unit_id": "hgw04-dev-001",
"exogenous": {
"z": "-1",
"audit": "-1",
"noise": "-1",
"sham": "-1"
}
},
{
"unit_id": "hgw04-dev-002",
"exogenous": {
"z": "1",
"audit": "-1",
"noise": "-1",
"sham": "1"
}
},
{
"unit_id": "hgw04-dev-003",
"exogenous": {
"z": "-1",
"audit": "-1",
"noise": "1",
"sham": "-1"
}
},
{
"unit_id": "hgw04-dev-004",
"exogenous": {
"z": "1",
"audit": "-1",
"noise": "1",
"sham": "1"
}
},
{
"unit_id": "hgw04-dev-005",
"exogenous": {
"z": "-1",
"audit": "1",
"noise": "-1",
"sham": "-1"
}
},
{
"unit_id": "hgw04-dev-006",
"exogenous": {
"z": "1",
"audit": "1",
"noise": "-1",
"sham": "1"
}
},
{
"unit_id": "hgw04-dev-007",
"exogenous": {
"z": "-1",
"audit": "1",
"noise": "1",
"sham": "-1"
}
},
{
"unit_id": "hgw04-dev-008",
"exogenous": {
"z": "1",
"audit": "1",
"noise": "1",
"sham": "1"
}
}
],
"intervention": {
"audit": "1"
},
"matched_shams": [
{
"sham": "1"
}
],
"evalmath_registration": {
"experiment_id": "HGW-04-DEVELOPMENT-ONLY",
"alpha": "0.05",
"scientific_min_effect": "0.10",
"target_effect": "0.20",
"measurement_resolution": "0.01",
"sham_quantile": "0.95",
"sham_confidence": "0.95",
"planned_comparisons": 3,
"confirm_units_planned": 64,
"pilot_from_development_only": true,
"heldout_sealed": false,
"units_independent": false
}
}
Loading
Loading