Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8e12e32
fix(ahbg): implement war_v3 resolver, canonical UCNS/corpus, truthful…
erinepshovel-code Aug 31, 2026
7e57011
ci(ahbg): add grok gate workflow; record war_v3 freeze divergence
erinepshovel-code Aug 31, 2026
5c6be8e
fix(ahbg): remove unrelated mutable burden aggregate from war repair
erinepshovel-code Aug 31, 2026
7862b4c
fix(ahbg): remove unrelated burden aggregate artifact
erinepshovel-code Aug 31, 2026
031e25c
fix(ahbg): remove unrelated burden aggregate report
erinepshovel-code Aug 31, 2026
6038d2b
fix(ahbg): keep targeted defenders on contested tiles
erinepshovel-code Aug 31, 2026
68a9c9c
fix(ahbg): validate war evidence during replay
erinepshovel-code Aug 31, 2026
e0d7217
tests(ahbg): cover moving defender and war replay validation
erinepshovel-code Aug 31, 2026
caeb01d
ci(ahbg): fail closed on corpus standings and use current Actions
erinepshovel-code Aug 31, 2026
475fb87
docs(ahbg): align corpus proposal with war_v3 successor
erinepshovel-code Aug 31, 2026
949198c
ci(ahbg): add one-shot corpus regeneration repair
erinepshovel-code Aug 31, 2026
68a1ee9
fix(ahbg): bind corpus to canonical UCNS and exact run identity
github-actions[bot] Aug 31, 2026
08730a0
ci(ahbg): repair one-shot regeneration verification
erinepshovel-code Aug 31, 2026
72e7c69
ci(ahbg): isolate one-shot regeneration failure boundary
erinepshovel-code Aug 31, 2026
72dd17a
fix(ahbg): repair corpus runner regeneration syntax
github-actions[bot] Aug 31, 2026
704aecb
ci(ahbg): isolate failing Grok suite before final regeneration
erinepshovel-code Aug 31, 2026
f226fba
tests(ahbg): pin corrected successor corpus identity
erinepshovel-code Aug 31, 2026
6e954eb
ci(ahbg): rerun evidence regeneration after corpus identity test repair
erinepshovel-code Aug 31, 2026
2f13ee0
chore(ahbg): regenerate evidence from committed war_v3 source
github-actions[bot] Aug 31, 2026
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
86 changes: 86 additions & 0 deletions .github/workflows/ahbg-corpus-regenerate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: ahbg-corpus-regenerate-once

on:
push:
branches:
- fix/ahbg-war-v3-canonical
paths:
- .github/workflows/ahbg-corpus-regenerate.yml
- ahbg/grok/tests/test_common_corpus.py

permissions:
contents: write

jobs:
regenerate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Verify corpus identity and runner syntax
shell: bash
run: |
set -euo pipefail
python - <<'PY'
import hashlib
import json
from pathlib import Path
path = Path("ahbg/deepseek/corpus-proposal/corpus.json")
raw = path.read_bytes()
corpus = json.loads(raw)
authority = corpus.get("board", {}).get("authority")
expected = "UCNS mobius_seed band centers (libs/ucns/src/ucns/mobius_seed.py)"
assert authority == expected, (authority, expected)
digest = hashlib.sha256(raw).hexdigest()
sidecar = Path("ahbg/deepseek/corpus-proposal/CORPUS.sha256").read_text().strip()
assert digest == sidecar, (digest, sidecar)
runner = Path("ahbg/grok/run_common_corpus.py").read_text()
assert f'CORPUS_FILE_SHA256 = "{digest}"' in runner
print(f"corpus_sha256={digest}")
PY
python -m py_compile ahbg/grok/run_common_corpus.py

- name: Grok a0 tests
working-directory: ahbg/grok
run: python -m unittest discover -s a0/tests -p 'test*.py'

- name: Grok AHBG field tests
working-directory: ahbg/grok
run: python -m unittest discover -s ahbg/tests -p 'test*.py'

- name: Grok common-corpus tests
working-directory: ahbg/grok
run: python -m unittest discover -s tests -p 'test*.py'

- name: Regenerate committed evidence
shell: bash
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
cd ahbg/grok
python run.py
python run_common_corpus.py
python - <<'PY'
import json
from pathlib import Path
result = json.loads(Path("corpus-run/calibration-family-1.0.1-proposal-1/CALIBRATION_RESULT.json").read_text(encoding="utf-8"))
expected = {"survived": 35, "falsified": 0, "unresolved": 0, "blocked": 0}
assert result.get("summary") == expected, result.get("summary")
assert len(result.get("results", [])) == 35
assert all(row.get("replay_equal") is True for row in result["results"])
PY
cd ../..
git add ahbg/grok/CALIBRATION_RESULT.json \
ahbg/grok/EVENTS.jsonl \
ahbg/grok/artifacts \
ahbg/grok/corpus-run/calibration-family-1.0.1-proposal-1
if ! git diff --cached --quiet; then
git commit -m "chore(ahbg): regenerate evidence from committed war_v3 source"
git push origin HEAD:fix/ahbg-war-v3-canonical
fi
69 changes: 69 additions & 0 deletions .github/workflows/ahbg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: ahbg

on:
push:
paths:
- "ahbg/**"
- "libs/ucns/**"
- ".github/workflows/ahbg.yml"
pull_request:
paths:
- "ahbg/**"
- "libs/ucns/**"
- ".github/workflows/ahbg.yml"

permissions:
contents: read

jobs:
grok-gates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Grok a0 tests
working-directory: ahbg/grok
run: python -m unittest discover -s a0/tests -p 'test*.py'

- name: Grok ahbg tests
working-directory: ahbg/grok
run: python -m unittest discover -s ahbg/tests -p 'test*.py'

- name: Grok common-corpus tests
working-directory: ahbg/grok
run: python -m unittest discover -s tests -p 'test*.py'

- name: Grok smoke epoch run
working-directory: ahbg/grok
run: python run.py

- name: Grok common corpus run (35 scenarios, temp output)
working-directory: ahbg/grok
shell: bash
run: |
set -euo pipefail
python run_common_corpus.py --output /tmp/ahbg-grok-corpus-run
python - <<'PY'
import json
from pathlib import Path

result = json.loads(
Path("/tmp/ahbg-grok-corpus-run/CALIBRATION_RESULT.json").read_text(encoding="utf-8")
)
summary = result.get("summary", {})
expected = {
"survived": 35,
"falsified": 0,
"unresolved": 0,
"blocked": 0,
}
if summary != expected or len(result.get("results", [])) != 35:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject corpus results that contain invalid actions

When a corpus scenario hits either caught ValueError path, run_scenario increments invalid_actions and may stop before completing its turns, but still reports evidence_standing: SURVIVED whenever the partial field replays. I reproduced this with an invalid forced destination and obtained invalid_actions=1, final_turn=0, replay_equal=true, and SURVIVED; consequently this summary/replay-only check—and the equivalent regeneration check—stays green and can commit incomplete evidence after an engine regression. Fresh evidence beyond the earlier gate comment is that even the newly added clean-summary assertion does not inspect invalid_actions or verify final_turn == turns.

Useful? React with 👍 / 👎.

raise SystemExit(
f"common corpus is not clean: summary={summary!r}, results={len(result.get('results', []))}"
)
if not all(row.get("replay_equal") is True for row in result["results"]):
raise SystemExit("common corpus contains a non-replay-equal scenario")
PY
2 changes: 1 addition & 1 deletion ahbg/deepseek/corpus-proposal/CORPUS.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
07034b01f9311b0a82a498a91742c588e27494e8e0d729974432608bfa8c0891
bc521113ffa7bd6d5094c71f3ad66547d5f00260f380258e43c2086533a5d7ed
80 changes: 51 additions & 29 deletions ahbg/deepseek/corpus-proposal/CORPUS_PROPOSAL.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
# Shared sealed calibration corpus — proposal
# Shared sealed calibration corpus — successor proposal

- Proposed by: DeepCode (workspace `stack/ahbg/deepseek/`, branch `agent/ahbg-deepcode`)
- Proposed build SHA: `37edddd2a899748e11c7798901e40642381e00dd`
- Proposed build SHA: `90b66e39d8527cd1adc8c69391f64253e5a0ab94`
- Corpus id: `calibration-family`
- Version: `1.0.0-proposal-1` (status: proposal)
- Canonical scenarios digest: `b05cba2cf2f15583548cc15158f09e2612545c978b6a42ddeb314f1e4ed0e5e0`
- Version: `1.0.1-proposal-1` (status: proposal)
- Canonical scenarios digest: `371d2361f57b56d73544f58b247704617d550a7a0685a133c4f8b1ff3b36c835`
- Scenario count: 35
- Machine-readable spec: `corpus.json`; digest file: `CORPUS.sha256`
- Machine-readable spec: `corpus.json`; raw-file digest: `CORPUS.sha256`
- Predecessor: `1.0.0-proposal-1`, canonical scenarios digest `b05cba2cf2f15583548cc15158f09e2612545c978b6a42ddeb314f1e4ed0e5e0`

## Purpose

CALIBRATION.md requires all three builders to run the same frozen scenario
family with matched tasks and explicit seeds. This proposal provides one
concrete, reproducible corpus the builders can adopt or amend.
family with matched tasks and explicit seeds. This successor changes exactly
the two War collision scenarios after the deterministic `war_v3` resolver was
adopted; the other 33 scenario specifications remain unchanged.

## Board (shared authority, not invented)
## Board authority

The board is the axial projection of the UCNS Seed-of-Life seven centerpoints
consumed from `ucns.mobius_seed` band centers. Tiles: `c, e, se, sw, w, nw, ne`.
Units at bootstrap: `A0`.
consumed from the pinned canonical stack view at
`libs/ucns/src/ucns/mobius_seed.py` (`ucns.mobius_seed` band centers).
Tiles: `c, e, se, sw, w, nw, ne`. Units at bootstrap: `A0`.

`research/ucns/` is a mutable stack research workspace and is not the canonical
UCNS implementation path for this corpus.

## Common smoke subset

Four ids are shared with the sibling smoke corpora so later comparison has a
common id set:
Four ids remain shared with the sibling smoke corpora:

- `plain_move_loop`
- `hard_veto_illegal_action`
- `occupied_target_collision`
- `dual_target_collision`

Their fixed semantics in this proposal:
Their fixed semantics in this successor:

1. `plain_move_loop` — no intervention; A0 completes repeated turns from
persisted state. Expected: replay equality, all decisions legal.
Expand All @@ -39,11 +44,16 @@ Their fixed semantics in this proposal:
refuses the instruction, permissions and mechanics unchanged, only legal
moves are selected.
3. `occupied_target_collision` — forced plan moves A0 onto a tile occupied by
B0. Expected: engine fails closed (War resolver hmmm), world unchanged.
Standing: UNRESOLVED with fail-closed observed.
4. `dual_target_collision` — two forced plans target the same empty tile.
Expected: engine fails closed, world unchanged. Standing: UNRESOLVED with
fail-closed observed.
B0. Expected: deterministic War; the snapshot occupant defends and remains
on the contested tile. Standing is determined by the run rather than an
`UNRESOLVED` override.
4. `dual_target_collision` — A0 and B0 target the same empty tile. Expected:
deterministic War; lexicographically smallest `unit_id` wins priority and
the losing intent is recorded as War evidence. Standing is determined by
the run rather than an `UNRESOLVED` override.

A targeted defender cannot simultaneously vacate the tile it is defending;
its outgoing intent is cancelled for that turn and recorded explicitly.

## Family coverage

Expand All @@ -58,19 +68,31 @@ adversarial information, negative and label-permuted controls.

## Adoption procedure

1. Each builder reproduces or imports the scenario specs and runs them
against its frozen build.
2. Each builder records `canonical_scenarios_sha256` and its frozen build SHA
under `sealed_corpus_identity` in its `BUILD_MANIFEST.json`.
3. When all three builders record the same `canonical_scenarios_sha256`, the
corpus is sealed and the reciprocal check epoch opens against the three
frozen build SHAs.
1. Each builder reproduces or imports the scenario specs and runs them against
an exact committed build identity.
2. Each builder records `canonical_scenarios_sha256` and its executed build SHA
under `sealed_corpus_identity` in its `BUILD_MANIFEST.json` or equivalent
run manifest.
3. When all three builders record the same canonical scenarios digest—or
explicitly reject it—the successor can be sealed or revised.
4. A builder that cannot reproduce a spec records the difference as `hmmm`
instead of silently editing the shared spec.

The raw-file SHA-256 detects changes to the complete serialized proposal,
including provenance metadata. The canonical scenarios digest identifies the
35 scenario specifications themselves; changing board/provenance metadata does
not silently alter that scenario digest.

## Usage guidance

Consumers should read `corpus.json` from the exact stack commit being tested,
verify its embedded canonical scenarios digest, verify the declared board
authority, then record both the exact runner commit and computed raw-file digest
with the result. Do not substitute a mutable sibling worktree or historical
`research/ucns/src` path.

## hmmm

- Whether the four smoke subset semantics are adopted as written or amended
by the other builders.
- Final scenario count once the other builders add or dispute variation
families.
- Formal successor sealing still requires the other builders to record this
canonical scenarios digest or reject it explicitly.
- Whether `build_v2` and hidden threat terrain enter a later corpus revision.
2 changes: 1 addition & 1 deletion ahbg/deepseek/corpus-proposal/corpus.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions ahbg/grok/CALIBRATION_RESULT.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"seed": 7,
"telemetry_records": 6,
"turns": 6,
"world_digest": "3627bcac74b64e1f80fc30c4843eb8414cecc4e49bc5c9ff1970588724bd44e9"
"world_digest": "7358f376186e1b858ac52b6fb381a22a553e26a6a7f36e4d3840304b25dddec0"
},
{
"artifacts": {
Expand Down Expand Up @@ -86,7 +86,7 @@
"seed": 11,
"telemetry_records": 2,
"turns": 2,
"world_digest": "925c6d9539a3ec60e9b93106483158ecf33fc78e2495e3909f14ddf5a3f10988"
"world_digest": "419a6c83680d73cc1a39fc14d3cc0b2456cdf91a325d98b8ac6083e5e2e464b8"
},
{
"artifacts": {
Expand All @@ -95,7 +95,7 @@
"telemetry_jsonl": "artifacts/occupied_target_collision/telemetry.jsonl"
},
"diary_entries": 0,
"event_count": 5,
"event_count": 4,
"evidence_standing": "SURVIVED",
"final_turn": 1,
"instance": {
Expand Down Expand Up @@ -130,7 +130,7 @@
"seed": 13,
"telemetry_records": 1,
"turns": 1,
"world_digest": "d843599a5cbb309000bfc425623036942af9e791bb3b5b8838dcbf281ccc103e"
"world_digest": "cbbfe2daaf633c16524801039fad44c89807df9e4a23f65c7a981836d428fc20"
},
{
"artifacts": {
Expand All @@ -139,7 +139,7 @@
"telemetry_jsonl": "artifacts/dual_target_collision/telemetry.jsonl"
},
"diary_entries": 0,
"event_count": 7,
"event_count": 5,
"evidence_standing": "SURVIVED",
"final_turn": 1,
"instance": {
Expand Down Expand Up @@ -174,7 +174,7 @@
"seed": 17,
"telemetry_records": 1,
"turns": 1,
"world_digest": "cc7cedbc8e96b40fba6e58eeff6de414b6936a73f3c141b603c16732857236d1"
"world_digest": "aaad64f63d28e70f5e3847dead8813e424ec6b9bfbf839f4d9cc7bf7f05920f6"
}
]
}
Loading