Add selected candidate handoff preflight#140
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f96e5a45ad
ℹ️ 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".
| field="deferredCandidates", | ||
| ) | ||
| ) | ||
| overlap = sorted(set(selected_ids) & set(deferred_ids)) |
There was a problem hiding this comment.
Filter missing IDs before overlap checks
When a malformed handoff has both a selected and a deferred candidate without id/packageId, candidate_id() returns None, so this intersection includes None; the later ', '.join(overlap) then raises TypeError (and mixed None/string overlaps can also fail in sorted). That makes preflight-selected-candidate-handoff crash instead of returning the already-collected missing-ID validation errors.
Useful? React with 👍 / 👎.
Motivation
SpecHarvester P32-T5 now emits refreshed selected candidate handoff evidence for the limited popular-library corpus. SpecPM needs a consumer-side gate before maintainers use that producer evidence for intake review.
Goals
Changes
specpm producer-bundle preflight-selected-candidate-handoff.SpecPMSelectedCandidateHandoffPreflightReport.cupertino.coredeferral.Validation
python3 -m py_compile src/specpm/producer_bundle.py src/specpm/cli.pyPYTHONPATH=src pytest tests/test_core.py -q -k 'selected_candidate_handoff_preflight'PYTHONPATH=src pytest -qPYTHONPATH=src ruff check .PYTHONPATH=src ruff format --check src testsgit diff --checkPYTHONPATH=src python3 -m specpm.cli validate . --jsonmake docs-buildmake pages-smokemake public-index-generate PUBLIC_INDEX_OUTPUT=/tmp/specpm-selected-handoff-preflight-public-indexPYTHONPATH=src python3 -m specpm.cli producer-bundle preflight-selected-candidate-handoff --body /Users/egor/Development/GitHub/0AL/SpecHarvester/tests/fixtures/refreshed_candidate_layer_selected_handoff/p32-t5-refreshed-candidate-layer-selected-handoff.example.json --root /Users/egor/Development/GitHub/0AL/SpecHarvester --jsonReal P32-T5 handoff result:
passed,8selected candidates,1deferred candidate,3source digests verified.Docker note:
make dev-reload && make dev-smokewas attempted earlier in the task, but Docker build stalled while loading metadata fordocker.io/library/python:3.12-slim; no localspecpm:devimage was available. Public index generation and Pages smoke passed.Boundaries and Non-Goals
preview_only.Notes