Skip to content

PL-0500: peer review V02 record and fixes (number checks, coverage-aware ERP mapping) - #115

Merged
Sekiph82 merged 3 commits into
mainfrom
feat/pl-0500-v02-fixes
Dec 3, 2026
Merged

Sekiph82 merged 3 commits into
mainfrom
feat/pl-0500-v02-fixes

Conversation

@Sekiph82

@Sekiph82 Sekiph82 commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Scope: TASKS.md PL-0500 only. TASKS.md not edited; PL-0500 stays [ ].

  • Commit 1: coordination/sessions/M21-C001/CLAUDE_PEER_REVIEW_PL0500_SUSTAINABILITY_V02.md (review record, PASS_WITH_FIXES).
  • Commit 2 (core/src/packlab_core/pack_sustainability.py, tests/core/test_pack_sustainability.py):
    • V02-1/2: mass_g, recycled_content_pct, product_net_mass_g reject bool and non-int/float with PackSustainabilityError (same style as erp_contract material mass).
    • V02-3: negative pct (plus string/bool/None cases) added to the refusal parametrize.
    • V02-4: component ids stripped for the duplicate check.
    • Integration: erp_sustainability(figures) maps to the spec_content(sustainability=...) dict: mass_per_pack_g always; recycled_content_percent only when every component declares recycled content (exact check, not the rounded coverage figure); ESTIMATE figures refused. Schema keys are optional, so omitting the key is valid.
  • V02-5 NIT (optional text field types) not changed.

Wiring: no server/app code builds spec_content; erp_spec comes into store.release already built in the client payload, and nothing in the release path holds declared component masses. So the mapping isn't wired to a caller yet. What's missing is a producer of the erp_spec payload (Studio release UI or server builder) that holds PackComponent declarations.

Tests: test_pack_sustainability + test_erp_contract: 82 passed. ruff format/check clean, mypy clean (352 files), ci_data_safety PASS.

🤖 Generated with Claude Code

Sekiph82 and others added 3 commits December 4, 2026 01:49
…re ERP mapping

Reject bool and non-number mass/percentage/product mass with PackSustainabilityError; strip component ids for the duplicate check; add erp_sustainability() mapping figures to the erp_contract.spec_content sustainability dict, passing recycled_content_percent only when every component declares it and refusing ESTIMATE figures. No release-path caller wired: erp_spec arrives prebuilt in the client payload.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Sekiph82
Sekiph82 merged commit 1e0bc4d into main Dec 3, 2026
2 checks passed
@Sekiph82
Sekiph82 deleted the feat/pl-0500-v02-fixes branch December 3, 2026 23:32
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