feat: isolate typed clean-slate vNext bindings - #46
Conversation
Co-Authored-By: Codex <noreply@openai.com>
🤖 Codex PR Review🚫 Merge blocked: 1 serious issue(s) found in high-risk files 🚫 Blocking IssuesThese issues must be fixed before this PR can be merged: 1. 🟠 [HIGH] Logic in
|
Co-Authored-By: Codex <noreply@openai.com>
|
Concentrated closure evidence (closure_count=1/max=1):
Validation: focused typed-binding 23 passed; full pytest 289 passed; targeted ruff passed; compileall passed; diff-check passed. Full ruff retains only 28 pre-existing violations in |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c82bda9c1b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| candidate: SelectedCandidate | ||
| binding: V3IdentityBinding | ||
| binding: V3IdentityBinding | VNextIdentityBinding |
There was a problem hiding this comment.
Bound vNext publication display order
When callers construct PublicationEntry/PublicationPlan directly with a VNextIdentityBinding rather than going through allocate_vnext_identity, this newly admitted binding type bypasses vNext's MAX_SAFE_JSON_INTEGER check: _validate_entry still only rejects negative display_order. A plan can therefore carry values like 9007199254740992 even though the vNext contract requires display_order to stay in 0..2**53-1 at every in-memory boundary, which can hand downstream JSON/Page consumers an unsafe ordering value.
Useful? React with 👍 / 👎.
| entry = None | ||
| plan = None | ||
| if context.mode is AllocationMode.CURRENT_MANDATORY: | ||
| entry = PublicationEntry(candidate, binding, PublicationRole.MANDATORY_CURRENT, display.display_primary, display.display_order) | ||
| plan = PublicationPlan((entry,)) |
There was a problem hiding this comment.
Return recovered entries for historical allocations
When callers use AllocationContext.historical_recovery() for an existing historical artifact, this path returns AllocationResult(..., publication_entry=None, publication_plan=None) because only CURRENT_MANDATORY builds an entry; the new-binding path below does the same. That means the vNext allocator cannot actually feed recovered-history artifacts into the PublicationPlan path unless every caller manually reconstructs a PublicationEntry, so historical recovery results are easy to drop even though the allocator has all of the candidate, binding, display, and RECOVERED_HISTORY role information needed to return the entry.
Useful? React with 👍 / 👎.
| return VNextIdentityIndex(VNEXT_INDEX_SCHEMA, ()) | ||
|
|
||
|
|
||
| def parse_vnext_index(payload: Mapping[str, Any]) -> VNextIdentityIndex: |
There was a problem hiding this comment.
Route vNext indexes by namespace
Adding only this vNext-specific parser leaves namespace dispatch to callers: the existing public identity_v3.parse_identity_index still branches on schema_version, so a valid payload like {'namespace':'qar_vnext','schema_version':1,'entries':[...]} is routed to legacy v1 and rejected as invalid_reports_index unless the caller already knows to call parse_vnext_index. Because vNext deliberately reuses schema version 1, generic index readers need a namespace-first entry point; otherwise this reintroduces the caller-side routing the contract says to avoid.
Useful? React with 👍 / 👎.
|
Permanent freeze/close-reslice: closure_count=1/max=1, absolute_final=true. Preserve all branch/worktree/commits/comments/unresolved review evidence. No further code action. |
QAR-N1 typed-binding clean-slate reslice
Fresh implementation from
origin/main@d13dad1cfd2680cfdf9c96bc4687fc3d32ffc015. PR #44/#45 are closed evidence only; no branch, commit, compatibility code, or legacy fallback is reused.Type-dispatch source of truth
VNextIdentityBindingis a distinct runtime type from legacyV3IdentityBinding. The vNext parser produces only the typed binding, the allocator consumes/returns only it, andPublicationEntrydispatches by actual binding type. There is no calleridentity_namespacerouting flag and no filename-based dispatch. vNext wire entries carry exactbinding_namespace=qar_vnextandbinding_version=1; legacy/unknown namespace/version are rejected.Contract matrix
namespace,schema_version,entries.contract_version_for_schema, algorithm versions, digests, class/canonical/status, all target grammar, and safe integer display order.0..2**53-1display boundaries, collision detection, permutation stability, deterministic round-trip.PublicationPlanentries dispatch independently.Scope boundary
Pure identity/index/PublicationPlan foundation only. No migration, compatibility, publisher, build, workflow, Pages, producer, filesystem, network or other production I/O.
Validation
scripts/gate_codex_app_review.py.