feat: clean-slate vNext identity schema v1 foundation - #47
Conversation
Co-Authored-By: Codex <noreply@openai.com>
🤖 Codex PR Review🚫 Merge blocked: 1 serious issue(s) found in high-risk files ⚖️ Codex Review Arbitration🚫 block: 🚫 Blocking IssuesThese issues must be fixed before this PR can be merged: 1. 🟠 [HIGH] Logic in
|
Co-Authored-By: Codex <noreply@openai.com>
|
Closure evidence (closure_count=1/max=1, absolute_final=true):
Validation on final head: focused |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7909f94dac
ℹ️ 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".
| previous = artifact_digests.get(binding.artifact_integrity_digest) | ||
| current = (binding.period_key, binding.as_of, binding.cadence) | ||
| if previous is not None and previous != current: | ||
| raise _error("artifact_digest_conflict") |
There was a problem hiding this comment.
Reject repeated artifact digests within a period
When a second binding has the same artifact_integrity_digest and the same period/as_of/cadence, this condition treats it as valid. That lets a forged or merged vNext index contain the exact same report as both canonical and variant, or contain two variants that share the JSON/HTML targets and differ only by optional md/manifest; allocate_identity would have reused the existing binding instead, so downstream publication can see multiple identities/targets for one artifact. The duplicate should be rejected unless it is the exact same binding, which is already caught by identity_duplicate.
Useful? React with 👍 / 👎.
| if not isinstance(self.candidate, SelectedCandidate) or not isinstance(self.binding, VNextIdentityBinding): | ||
| raise _error("publication_entry_invalid") | ||
| if type(self.role) is not PublicationRole: | ||
| raise _error("publication_role_invalid") | ||
| _display(self.display_primary, self.display_order) | ||
| _validate_candidate_binding(self.candidate, self.binding) |
There was a problem hiding this comment.
Validate candidates against their snapshots
When callers instantiate the exported SelectedCandidate dataclass directly, these checks trust the stored digest/metadata fields and never recompute them from report_snapshot or re-sanitize source_identity. A PublicationEntry can therefore be accepted with snapshot A but binding/digest B, so downstream publication code that writes candidate.report_snapshot under binding targets would publish bytes that do not match the identity evidence. Rebuild the candidate from its snapshot here, as the legacy plan validation does, before accepting the entry.
Useful? React with 👍 / 👎.
| binding = _new_binding( | ||
| candidate, | ||
| identity_class, | ||
| context.requested_artifacts, | ||
| DisplayPlacement(False, next_order), | ||
| ) |
There was a problem hiding this comment.
Honor requested display placement when allocating
When a new current or historical binding is allocated, this hard-codes the binding to display_primary=False and an internally chosen order instead of using context.display. For example, a current allocation requested as DisplayPlacement(True, 0) is persisted as non-primary, so a later exact reuse with the same requested placement is rejected as identity_reuse_mismatch, and any consumer that relies on the index display fields will not mark the mandatory current report as primary.
Useful? React with 👍 / 👎.
|
Permanent freeze/close-reslice: closure_count=1/max=1, absolute_final=true; fingerprint=b573ba2b11fff768d515. Preserve branch/worktree/commits/comments/unresolved review evidence/tests. No further code action. |
Scope
Clean-slate QAR-N1 pure identity/index/allocation/PublicationPlan foundation from fresh
origin/main@d13dad1cfd2680cfdf9c96bc4687fc3d32ffc015.Type/wire dispatch is the source of truth.
VNextIdentityBindingandqar_vnext_binding.v1are independent from legacy types. The vNext parser/allocator/PublicationPlan accept only the exact clean-slate schema-v1 namespace; no caller routing flag, filename routing, legacy fallback, dual-read, migration, or compatibility path.Contract matrix covered
contract_version_for_schema();Explicit non-scope
No legacy compatibility/migration, old index reads, publisher/build/archive/RSS/workflow/Pages integration, filesystem/network I/O, producer changes, or N2.
Validation
python3 -m pytest -q tests/test_vnext_schema_v1.py— 24 passedpython3 -m pytest -q— 289 passedpython3 -m ruff check src tests— passedpython3 -m compileall -q src tests— passedgit diff --check— passed