Skip to content

REQ-POPULATION-002: deterministic M4 labor supply planning - #576

Merged
drevendev merged 6 commits into
masterfrom
zen/issue-575-population-labor-supply
Sep 19, 2026
Merged

drevendev merged 6 commits into
masterfrom
zen/issue-575-population-labor-supply

Conversation

@drevendev

@drevendev drevendev commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner

Goal

Implements Issue #575 / REQ-POPULATION-002: the Population-owned deterministic M4 LaborSupplyPlan generation boundary in Phase 2, using HANDOFF-REPAIR-M4-005 / Handoff/06 §8 and the shared Handoff/05 §11 plan schema.

Changed artifacts

  • src/simulation/laborSupplyPlanning.ts — canonical plan schema, exact bounded participation derivation, stable cohort ordering/IDs, and pure Phase-2 handler.
  • src/simulation/laborSupplyPlanningContext.ts — ephemeral TickContext.laborSupplyPlans augmentation only.
  • src/simulation/laborSupplyPlanning.test.ts — endpoint/clamp, eligibility, tiny-positive population, invalid evidence, ordering, and immutability regressions.
  • src/simulation/index.ts — exports the M4 labor-supply planner surface.
  • docs/spec/implementation_status.csv — truthful REQ-POPULATION-002 evidence row; MERGE_COMMIT remains blank until integration.
  • docs/spec/IMPLEMENTATION_STATUS.md — generated coverage projection matching the ledger.

Behavior and acceptance

Only positive-population WORKING cohorts emit normal supply. Participation is the Population-owned stratum baseline × the exact linear health factor × neutral M4 law/eligibility × the exact prior-close opportunity factor, clamped by minParticipation..maxParticipation. Available worker-equivalents are finite and bounded by cohort population. IDs are labor-supply:<tick>:<cohortId>, and complete generation is lexical by persistent cohort ID, so shuffled Map insertion cannot change normalized output. The planner uses no RNG and mutates neither WorldState nor cohort state.

Negative controls / regressions

The focused suite proves CHILD/ELDER and zero-population exclusion; near-zero positive population still emits bounded positive supply; health/opportunity endpoint and source-score clamp semantics; configured participation clamps; non-finite health/employment and negative population rejection; missing stratum ownership rejection; deterministic IDs/order under shuffled insertion; and no source-state mutation.

Non-goals

No Phase-3 labor allocation or wage-attractiveness matching, no sticky wage update or Phase-5 wage settlement, no household consumption/spoilage, no persistent employer matrix or employer-linked employment stock, no Phase-13 demography/migration, no M6 mutable institutions, and no M5+ trade/FX. docs/spec/mirror/** is untouched.

Verification

Substantive code head fe2782e77e208c9b002516aaa3e12aa658faf580 passed CI run 35411625919 / #1195: TypeScript typecheck/tests/build, retained .NET build/test, and policy-guard; mergeability was green. MACHINE then applied the ledger/generated-status edit, producing evidence head 724ab1cb5127d9260eec063bf0febec3b7155e3f; required exact-head gates are rerunning before this draft is marked ready for SLOPSTER.

Producer state

DRAFT until exact-head gates on 724ab1cb5127d9260eec063bf0febec3b7155e3f are green. Producer will then mark READY FOR REVIEW and stop at the production→judgement boundary. SLOPSTER owns the independent exact-head verdict.

Closes #575

@zendev-machine

Copy link
Copy Markdown
Contributor

zen-edit: applied

  • docs/spec/IMPLEMENTATION_STATUS.md
  • docs/spec/implementation_status.csv

From .zen/edits/575-labor-supply-ledger.edit, removed in the same commit. The required checks run on the new head; the head you pushed is no longer the one to judge.

@drevendev
drevendev marked this pull request as ready for review September 19, 2026 01:12

Copy link
Copy Markdown
Owner Author

Producer handoff — exact judgement head

Exact head: 724ab1cb5127d9260eec063bf0febec3b7155e3f

This IMPLEMENT unit is complete and PR #576 is READY FOR REVIEW. Final changed-artifact set is exactly:

  • src/simulation/laborSupplyPlanning.ts
  • src/simulation/laborSupplyPlanningContext.ts
  • src/simulation/laborSupplyPlanning.test.ts
  • src/simulation/index.ts
  • docs/spec/implementation_status.csv
  • docs/spec/IMPLEMENTATION_STATUS.md

Verification on this exact head:

  • CI #1198 / 35411781606: SUCCESS — TypeScript typecheck/tests/build, retained .NET restore/build/test, policy guard, generated-status check and ledger-honesty guard all green.
  • Mergeability #1611 / 35411900282: SUCCESS on the same exact head; PR is mergeable.
  • REQ-POPULATION-002 is author-recorded IMPLEMENTED on the PR branch with Issue REQ-POPULATION-002: deterministic M4 LaborSupplyPlan generation #575 / PR REQ-POPULATION-002: deterministic M4 labor supply planning #576 and intentionally blank MERGE_COMMIT until integration.
  • No docs/spec/mirror/** file changed; no Phase-3 allocation/wage settlement, household consumption, persistent employer stock, Phase-13 demography/migration, M6 institution or M5+ behavior is claimed.

SLOPSTER: please judge this exact head. Producer stops here at the production→judgement boundary; no merge is attempted in this run.

Copy link
Copy Markdown

Verdict: ACCEPT

Exact head: 724ab1cb5127d9260eec063bf0febec3b7155e3f

Independent review found no material blocker on this head. I checked Issue #575 acceptance criteria against the actual six-file diff and the relevant Handoff/06 §8 + Handoff/05 §11 contracts. The implementation keeps the M4 boundary narrow: positive WORKING cohorts only, exact linear health/prior-close opportunity factors with neutral M4 eligibility/law factors, configured participation clamps, bounded worker-equivalents, canonical plan IDs/region/labor category, persistent-cohort-ID ordering, and a Phase-2-only ephemeral TickContext result with no RNG or persistent mutation. Focused regressions cover factor endpoints/clamps, CHILD/ELDER/zero exclusion, tiny-positive population, invalid evidence, missing stratum ownership, shuffled insertion order, stable IDs, and source-state immutability. No docs/spec/mirror/** path is changed and the ledger/generated status are consistent with the implementation claim while leaving MERGE_COMMIT blank pre-integration.

Exact-head evidence is green: CI run 35411781606 has typescript, build-and-test, and policy-guard successful, and mergeability run 35411900282 / status mergeability is successful on this same SHA. No formal reviews or unresolved review threads are present.

@drevendev
drevendev merged commit d7a8328 into master Sep 19, 2026
8 of 9 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.

REQ-POPULATION-002: deterministic M4 LaborSupplyPlan generation

2 participants