core/HANDOFF-gpt55-2026-06-20.md

179 lines
8.7 KiB
Markdown

# HANDOFF — GPT-5.5 — 2026-06-20
## Agent and Session
- **Agent:** gpt55
- **Date:** 2026-06-20
- **Reasoning effort used:** high
- **Grok Build mode used:** Headless
- **Session entry point:** implement the first PR from the semantic-substrate problem-solving master plan: close proportional-decrease contracts and make readiness obligation-sound without touching serving or derivation organs
---
## Smoke Suite + Bootstrap Status
```text
Read before editing:
- GPT55.md
- AGENTS.md
- docs/runtime_contracts.md
- HANDOFF-gpt55-2026-06-20.md (prior planning handoff, now superseded by this file)
- ADR-0223 audit/session pack and targeted ProblemFrame files/tests
core test --suite smoke -q
zsh: command not found: core
uv run python -m core.cli test --suite smoke -q
108 passed in 121.54s (0:02:01)
```
`core-bootstrap` skill was not available in this session; bootstrap was completed manually.
---
## Modules Touched
| File | Change type | Summary |
|---|---|---|
| `generate/problem_frame.py` | modified | extended `BoundQuestionTarget` with typed operator/state/direction validation so delta-decrease targets are structurally representable |
| `generate/problem_frame_builder.py` | modified | added narrow `decrease_to_fraction` binding, copular half-partition strengthening, canonical entity grounding, and richer bound target detection |
| `generate/problem_frame_contracts.py` | modified | added `assess_fraction_decrease`; tightened `percent_partition` to require forward aggregate topology, original whole provenance, and explicit blocker codes |
| `scripts/gsm8k_problem_frame_adequacy.py` | modified | surfaced blocker sets and blocker-combination aggregates by organ |
| `scripts/gsm8k_substrate_morphology.py` | modified | surfaced per-organ blockers and kept non-runnable decrease cases on a substrate contract-gap recommendation instead of a serving-organ recommendation |
| `tests/test_problem_frame_builder.py` | modified | added proportional-decrease binding/span tests |
| `tests/test_problem_frame_contracts.py` | replaced | added positive/negative obligation tests for fraction decrease and percent partition |
| `tests/test_problem_frame_skeleton.py` | modified | added `BoundQuestionTarget` validation coverage |
| `tests/test_gsm8k_problem_frame_adequacy.py` | modified | added blocker-by-organ/blocker-combination adequacy coverage |
| `tests/test_gsm8k_morphology_missing_kernel_labels.py` | modified | added morphology contract-gap recommendation coverage |
---
## Invariants Verified (Versor Coherence Guardian + Core)
| Invariant | Check performed | Result | Notes |
|---|---|---|---|
| `||F * reverse(F) - 1||_F < 1e-6` (core closure) | Scope review + smoke suite rerun | Preserved | No algebra/field/runtime field-op code touched |
| versor_apply / cga_inner exactness | Manual sweep of touched files/imports | Preserved | No recall/ranking/operator-path changes |
| Normalization boundaries respected | Pre-edit sweep + patch review | Preserved | No normalization added outside approved construction/IR boundary |
| No approximate recall (ANN/HNSW/cosine) | Import/call-site sweep on touched path | Preserved | Diagnostic path remains exact/deterministic |
| Claim status transitions via review gates only | Scope review | Preserved | Teaching/review/proposal paths untouched |
| Safety/identity pack immutability | Scope review | Preserved | No pack, manifest, policy, identity, or recall edits |
| INV-21 / INV-24 / INV-29 (Vault & epistemic) | Scope review + serving parity | Preserved | No memory mutation or serving-path widening |
| Wrong-zero serving | Direct runner `build_report()` checks | Preserved | Train `30/20/0`, holdout `5/495/0`, `wrong_ids == []` |
| Readiness truthfulness | Targeted adequacy reruns | Improved | Train runnable `1 -> 2`; holdout runnable `1 -> 0`; `0393` now blocked |
---
## Subagent / Arena Reconciliation (if applicable)
- Number of subagents spawned: 0
- Each subagent independently verified versor closure? (Yes/No): N/A
- How were results reconciled before merge? N/A
---
## Tests Run
```bash
# exit 0
uv run python -m pytest -q \
tests/test_problem_frame_builder.py \
tests/test_problem_frame_contracts.py \
tests/test_gsm8k_problem_frame_adequacy.py \
tests/test_gsm8k_morphology_missing_kernel_labels.py \
tests/test_kernel_no_new_legacy_derivation_surfaces.py
# exit 0
uv run python -m pytest -q \
tests/test_problem_frame_builder.py \
tests/test_problem_frame_contracts.py \
tests/test_problem_frame_skeleton.py \
tests/test_gsm8k_problem_frame_adequacy.py \
tests/test_gsm8k_morphology_missing_kernel_labels.py \
tests/test_kernel_no_new_legacy_derivation_surfaces.py
# exit 0
uv run python -m core.cli test --suite smoke -q
# exit 0
uv run python -m scripts.gsm8k_problem_frame_adequacy \
--cases evals/gsm8k_math/train_sample/v1/cases.jsonl
# exit 0
uv run python -m scripts.gsm8k_problem_frame_adequacy \
--cases evals/gsm8k_math/holdout_dev/v1/cases.jsonl
# exit 0
uv run python - <<'PY'
from evals.gsm8k_math.train_sample.v1.runner import _CASES_PATH, _load_cases, build_report
r = build_report(_load_cases(_CASES_PATH))
print(r["counts"])
print([x["case_id"] for x in r["per_case"] if x["verdict"] == "wrong"])
PY
# exit 0
uv run python - <<'PY'
from evals.gsm8k_math.holdout_dev.v1.runner import build_report
r = build_report()
print(r["counts"])
print([x["case_id"] for x in r["per_case"] if x["verdict"] == "wrong"])
PY
# exit 0
git diff --check
git status --short
git diff --name-only origin/main...
```
Key outcomes:
- train adequacy `contract_runnable_count == 2`
- runnable train cases are `gsm8k-train-sample-v1-0005` and `gsm8k-train-sample-v1-0046`
- holdout adequacy `contract_runnable_count == 0`
- `gsm8k-holdout-dev-v1-0393` now blocks with inverse/original-whole topology reasons
- serving unchanged: train `{'correct': 30, 'wrong': 0, 'refused': 20}`, holdout `{'correct': 5, 'wrong': 0, 'refused': 495}`
---
## Open Tasks / Next Session Entry Point
1. Inspect whether any non-0046 percent-partition candidates are now worth a narrower contract split instead of accumulating blocker lists on one forward organ.
2. Decide whether the next substrate PR should introduce explicit typed gap records (`PF-*` codes as first-class data) or keep using stable blocker strings until the construction catalog lands.
3. If a future PR starts typed adapter work, consume `fraction_decrease` only from `ProblemFrame` facts and do not reparse raw text inside any adapter or derivation organ.
---
## Known Hazards / Do Not Touch
- Do not edit `generate/derivation/*` or `generate/math_candidate_graph.py` to “finish” this slice. This PR is diagnostic-only and already proved serving parity.
- The new builder logic is intentionally narrow. Do not generalize `decrease_to_fraction` into `decrease by`, percent change, or affine fraction comparison without a separate contract/confuser pack.
- `percent_partition` is now deliberately stricter. A runnable-count drop elsewhere is acceptable if it removes false readiness; do not loosen obligations to make the number larger.
- `HANDOFF-gpt55-2026-06-20.md` was replaced; do not rely on the earlier planning-only contents.
---
## Architectural Decisions Made This Session
- `BoundQuestionTarget` now carries typed operator/state/direction, with validation that blocks illegal delta/final combinations at construction time.
- `decrease_to_fraction` is represented as a span-grounded `BoundRelation` in `ProblemFrame`, not as a derivation-organ shortcut.
- Readiness is keyed to exact grounded IDs from the frame. Repeated entity mentions are canonicalized at relation construction so contracts can match by identity rather than lowercase text equality.
- `percent_partition` requires a forward aggregate target and an original whole bound before subgroup events. Final-state/inverse prompts are blocked rather than treated as forward partition.
- Adequacy and morphology reports now expose blocker combinations by organ, making false readiness auditable without touching serving.
---
## What Must Not Be Forgotten
The substantive result of this session is not just “0005 runnable.” It is that `runnable` now means obligation-closed from `ProblemFrame` evidence alone: `0005` closes through `decrease_to_fraction`, `0046` closes only under explicit complementary-subgroup topology, and `0393` is blocked because its target is inverse/original-whole rather than a forward aggregate.
**Prompt Library Reference**: See `docs/core-rd-base-prompts.md` (especially sections #7 Standing Loop Axiom Check, #8 PR Merge-Readiness Audit, and #9 Grok Build Implementation Session). Use them as standing prefixes.
---
## Skills Used This Session
- core-bootstrap: not available
- versor-coherence-guardian: not available
- pre-edit-sweep: manual import/call-site sweep completed
- claim-proposal-guardian: not needed
- Other: none