Skip to content

Fix PHP recovery leaf error parity - #970

Merged
odvcencio merged 2 commits into
mainfrom
codex/php-454-recovery-leaf-parity
Aug 24, 2026
Merged

Fix PHP recovery leaf error parity#970
odvcencio merged 2 commits into
mainfrom
codex/php-454-recovery-leaf-parity

Conversation

@odvcencio

Copy link
Copy Markdown
Owner

Summary

Refs #454

Correctness evidence

  • Raw, production, compact fallback, and locked C share digest 1516308c38163089778464ad171875308c559af11af7c8c03ee17ae4eacd23c6.
  • The compact route records routed=0 and fallback=1.
  • Focused unit and race tests pass.
  • The locked-C PHP parity guard passes twice.
  • No run had an out-of-memory kill or timeout.

Controls

  • The exact-main Cobol comparison preserves the same 14-line known-red signature.
  • The WGSL and Cooklang controls pass.
  • The Cobol trailing-trivia control passes.

Open work

- Track direct lexer acceptance using a new token flag.
- Require a source-bearing parsed prefix to clear ordinary leaf errors.
- Reject pending, missing, error, dirty, and invalid payloads for clearance.
- Block clearance for generated, external, no-lookahead, and error-mode tokens.
- Update PHP issue #454 parity tests to validate raw, production, and locked-C digests.
- Document that PHP compact admission remains open due to persistent fallback routing.

Refs #454

Buckley-Change-Hash: sha256:12248e721d4385f28f84b58df6a9d4e67437e9475901714469f96bacf43c9938
Buckley-Change-Stats: files=7 insertions=400 deletions=62 binaries=0
- Pack the recovery-leaf policy into the high bit of `groupOrder`. Drop the standalone boolean field to reduce memory layout complexity.
- Add packing and accessor helpers to enforce masking, saturation, and nil safety.
- Update the state clone method to copy the packed value directly.
- Switch strategy-1 member sorting to use the unpacked value. The policy bit must not alter path ordering.
- Saturate out-of-range orders to the mask limit and clear the policy flag. Invalid input fails safely.
- Add unit tests for clone retention, sort stability, collision handling, and struct size budget.

Buckley-Change-Hash: sha256:a7757c3d1f6835c584bfbf4c51a2a098b98b8a0db1dd5ea97ade4d315fd7ee2d
Buckley-Change-Stats: files=2 insertions=92 deletions=23 binaries=0
@odvcencio
odvcencio merged commit 877d6b3 into main Aug 24, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant