Completes the GenerateSkeleton dispatch that T-1022 wired (it carried only founding_orientation). build_skeleton_work_item now also threads the remaining Layer-3 character into Layer 4.
political_archetype: real value from CityPlacement (was the Commission stub).
morphology_zone: looked up from the covering DistrictProfile via new scale::heightmap_pixel_to_district (exported HEIGHTMAP_CELLS_PER_DISTRICT; cascade.rs drops its local literal for the shared const). Was the AlluvialPlain stub.
arrangement_pattern: re-derived at L4 via the single pure fn attractor_matching::arrangement_pattern(&archetype, &economic_role) (both inputs already at L4) — no CityGenerationContext field, no stored derived state (DB-as-cache). A pure total fn, so re-derivation is provably identical to L3. Parity test asserts L4 re-derivation == the L3-stored value (drift tripwire).
T-1043 — road_entry_directions
Derived from T-1038's BodyWorldState.road_graph: octant = bearing of each incident road edge, deduped per octant, ordered by MaintenanceAuthority rank (the AdminFacing prestige-edge consumer). Feeds derive_access_points → AccessKind::QuarterEdge; the BlockJunction fallback now fires only for genuinely isolated settlements.
Completes the GenerateSkeleton dispatch that T-1022 wired (it carried only `founding_orientation`). `build_skeleton_work_item` now also threads the remaining Layer-3 character into Layer 4.
## T-1039 — political_archetype + morphology_zone + arrangement_pattern
- **political_archetype**: real value from `CityPlacement` (was the `Commission` stub).
- **morphology_zone**: looked up from the covering `DistrictProfile` via new `scale::heightmap_pixel_to_district` (exported `HEIGHTMAP_CELLS_PER_DISTRICT`; `cascade.rs` drops its local literal for the shared const). Was the `AlluvialPlain` stub.
- **arrangement_pattern**: **re-derived at L4** via the single pure fn `attractor_matching::arrangement_pattern(&archetype, &economic_role)` (both inputs already at L4) — no `CityGenerationContext` field, no stored derived state (DB-as-cache). A pure total fn, so re-derivation is provably identical to L3. **Parity test** asserts L4 re-derivation == the L3-stored value (drift tripwire).
## T-1043 — road_entry_directions
- Derived from T-1038's `BodyWorldState.road_graph`: octant = bearing of each incident road edge, deduped per octant, ordered by `MaintenanceAuthority` rank (the AdminFacing prestige-edge consumer). Feeds `derive_access_points` → `AccessKind::QuarterEdge`; the `BlockJunction` fallback now fires only for genuinely isolated settlements.
## Acceptance
- Corporate + Fjord placement → Ribbon topology + CompanyTown layout (not mesh + Commission).
- Settlement with a road connection → QuarterEdge on the correct octant; isolated → BlockJunction.
## Verification
- `cargo test` (full): 1559 lib + 37 harness + all integration — 0 failures. 11 new tests (incl. the arrangement_pattern parity tripwire + both acceptance tests). clippy `--all-targets -D warnings` clean; fmt clean. Coordinate convention (row/col → DistrictPos) verified against `derive_all_districts`.
## Notes for review
- The `.config/hooks/post-checkout` commit (`d2cbdc243`) is **already on main** (cherry-picked as `34ffcda86`) and will no-op at merge — not part of this review.
- `.pql/changelog` is board meta (T-1039/T-1043 activation + T-960→backlog, T-1038→done).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Completes the GenerateSkeleton dispatch T-1022 wired (which only carried
founding_orientation). build_skeleton_work_item now also threads:
T-1039:
- political_archetype — real value from CityPlacement, replacing the Commission stub.
- morphology_zone — looked up from the covering DistrictProfile via new
scale::heightmap_pixel_to_district (exported HEIGHTMAP_CELLS_PER_DISTRICT;
cascade.rs drops its local CELLS_PER_REGION literal for the shared const).
- arrangement_pattern — RE-DERIVED at L4 (option b) via the single pure fn
attractor_matching::arrangement_pattern(&archetype, &economic_role); both
inputs already at L4. No CityGenerationContext field, no stored derived state
(DB-as-cache). Parity test asserts L4 re-derivation == L3-stored value.
T-1043:
- road_entry_directions — derived from T-1038's BodyWorldState.road_graph:
octant = bearing of each incident road edge, deduped per octant, ordered by
MaintenanceAuthority rank (the AdminFacing prestige-edge consumer). Feeds
derive_access_points -> AccessKind::QuarterEdge; BlockJunction fallback now
fires only for genuinely isolated settlements.
Acceptance covered: Corporate+Fjord -> Ribbon topology (not mesh+Commission);
settlement with a road -> QuarterEdge on the correct octant. 11 new tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The post-checkout hook ran 'pql plan rebuild' (drop + replay changelog) on every
branch checkout, including 'git checkout -b'. That silently dropped any pql.db
ticket mutation not yet in the committed changelog — e.g. an in_progress status set
right before cutting a feature branch (hit this session: T-1039/T-1043 reverted to
backlog at branch creation).
Git has no pre-checkout/pre-worktree hook, so capture the changelog at post-checkout
instead: when prev-HEAD == new-HEAD (a branch *creation* — content unchanged, pql.db
already correct), run 'pql plan export --stage' (the same flush the pre-commit hook
does) instead of the destructive rebuild. Real branch *switches* (prev != new) still
rebuild to match the branch's changelog.
Verified: simulating a same-HEAD checkout with an uncommitted in_progress mutation now
preserves it (previously reverted).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR #168 Review — l3-l4-dispatch-threading → main (code)
Reviewers: Hoshe (code quality) + Tyre (architecture), both on the branch via git show. Reviewed server/src/atlas/{plugin.rs, scale.rs, cascade.rs} (the hook commit is already on main; .pql/changelog is meta).
Verdict: CHANGES REQUESTED.
Tyre (Architecture) — APPROVE
Decision-consistent and determinism-clean. Verified: D-234a topology now gated by the real morphology_zone (fjord → Ribbon, not the AlluvialPlain mesh — the corporate_fjord_… acceptance test exercises it); political_archetype per D-214; arrangement_pattern re-derivation is sound (pure total fn over (archetype, economic_role), both from the same read-only DB row → can only diverge on a forbidden runtime write; parity test enforces it); scale.rs is the correct home for heightmap_pixel_to_district (avoids a district_profile circular-dep); RoadGraph dependency degrades gracefully to an empty graph (→ BlockJunction, same as isolated); D-010 maintained (BTreeMap, integer math, total sort order). Non-blocking: the arrangement_pattern doc comment in build_skeleton_work_item says "re-derived at L4" but the re-derivation happens inside generate_quarter_skeleton, not there — a one-line clarification would close the gap.
The AlluvialPlain fallback fires silently when districts.get(&district_pos) misses. This happens (a) in production when a body's district layer was never built (params-missing) — every city on that body silently gets wrong street topology — or (b) from a coordinate bug. No log either way, inconsistent with the surrounding tracing::warn! on the read_set path. Add tracing::debug! when the grid is empty (expected: layer absent) and tracing::warn! when the grid is non-empty but the key misses (indicates a pixel→district convention bug).
The parity tripwire covers transit_hub only with Commission + Corporate. The transit_hub override fires before the archetype match (currently archetype-independent) — but that's exactly what the tripwire guards. Add transit_hub rows for Pioneer / Industrial / Military / Academic so an accidental archetype-conditionalization is caught.
Hoshe confirmed clean: the row/col→DistrictPos convention matches derive_all_districts, bearing_octant integer math (axis + diagonal boundaries handled, no atan2), deterministic dedup/ordering (BTreeMap + total tie-break), no panic paths, D-010 throughout.
Disposition: both H1/H2 + Tyre's doc note will be addressed (small additive changes).
## PR #168 Review — `l3-l4-dispatch-threading` → main (code)
Reviewers: **Hoshe** (code quality) + **Tyre** (architecture), both on the branch via `git show`. Reviewed `server/src/atlas/{plugin.rs, scale.rs, cascade.rs}` (the hook commit is already on main; `.pql/changelog` is meta).
**Verdict: CHANGES REQUESTED.**
### Tyre (Architecture) — APPROVE
Decision-consistent and determinism-clean. Verified: D-234a topology now gated by the real `morphology_zone` (fjord → Ribbon, not the AlluvialPlain mesh — the `corporate_fjord_…` acceptance test exercises it); political_archetype per D-214; arrangement_pattern re-derivation is sound (pure total fn over `(archetype, economic_role)`, both from the same read-only DB row → can only diverge on a forbidden runtime write; parity test enforces it); `scale.rs` is the correct home for `heightmap_pixel_to_district` (avoids a district_profile circular-dep); RoadGraph dependency degrades gracefully to an empty graph (→ BlockJunction, same as isolated); D-010 maintained (BTreeMap, integer math, total sort order). **Non-blocking:** the `arrangement_pattern` doc comment in `build_skeleton_work_item` says "re-derived at L4" but the re-derivation happens inside `generate_quarter_skeleton`, not there — a one-line clarification would close the gap.
### Hoshe (Code Quality) — REQUEST_CHANGES
| # | File / location | Issue |
|---|-----------------|-------|
| H1 | `plugin.rs` — `build_skeleton_work_item`, morphology fallback (~238-241) | The `AlluvialPlain` fallback fires silently when `districts.get(&district_pos)` misses. This happens (a) in production when a body's district layer was never built (params-missing) — *every* city on that body silently gets wrong street topology — or (b) from a coordinate bug. No log either way, inconsistent with the surrounding `tracing::warn!` on the read_set path. Add `tracing::debug!` when the grid is empty (expected: layer absent) and `tracing::warn!` when the grid is non-empty but the key misses (indicates a pixel→district convention bug). |
| H2 | `plugin.rs` — `arrangement_pattern_l4_rederivation_matches_l3_stored_value` (~456-537) | The parity tripwire covers `transit_hub` only with Commission + Corporate. The `transit_hub` override fires before the archetype `match` (currently archetype-independent) — but that's exactly what the tripwire guards. Add `transit_hub` rows for Pioneer / Industrial / Military / Academic so an accidental archetype-conditionalization is caught. |
Hoshe confirmed clean: the row/col→DistrictPos convention matches `derive_all_districts`, `bearing_octant` integer math (axis + diagonal boundaries handled, no atan2), deterministic dedup/ordering (BTreeMap + total tie-break), no panic paths, D-010 throughout.
Disposition: both H1/H2 + Tyre's doc note will be addressed (small additive changes).
Hoshe H1: the morphology_zone AlluvialPlain fallback fired silently. Now logs
tracing::debug! when the district grid is empty (expected: params-missing body /
early cascade) and tracing::warn! when a populated grid misses the key (indicates a
pixel->district convention bug) — no more silently-wrong topology.
Hoshe H2: the arrangement_pattern parity tripwire only covered transit_hub with
Commission + Corporate. Added Pioneer/Industrial/Military/Academic rows so an
accidental archetype-conditionalization of the cross-archetype override is caught.
Tyre (non-blocking): clarified the build_skeleton_work_item doc — the
arrangement_pattern re-derivation call lives in generate_quarter_skeleton (the
consumer), not in this function.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reconciles the branch's earlier export --stage hook (d2cbdc243) with main's
superseding do-nothing fix (b24a3596b) so the two merge cleanly instead of
conflicting on this file. (The hook fix is already live on main; this just keeps
the branch copy identical.)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Now tracing::debug! when the district grid is empty (expected: params-missing body / early cascade) and tracing::warn! when a populated grid misses the key (signals a pixel→district convention bug). No more silently-wrong topology.
H2
Parity tripwire covered transit_hub only for Commission + Corporate
Added Pioneer / Industrial / Military / Academic transit_hub rows — an accidental archetype-conditionalization of the cross-archetype override is now caught for every archetype.
Tyre (non-blocking)
arrangement_pattern doc said "re-derived at L4" without saying where
Clarified: the re-derivation call lives in the consumer (generate_quarter_skeleton), not in build_skeleton_work_item (which only threads inputs).
Also reconciled the branch's earlier export --stage post-checkout hook with main's superseding do-nothing version (b24a3596b) so the two merge cleanly. (Per pql-clide's review of the upstream feature request: do-nothing on same-HEAD is the minimal fix — no git-index side effects, no cross-branch leak.)
## Review findings addressed — `2d85f8ca3`
All findings resolved. Gate re-run green: `cargo test` 1559+ lib + integration (0 failures), clippy `--all-targets -D warnings` clean, fmt clean.
| # | Finding | Resolution |
|---|---------|------------|
| H1 | Silent `AlluvialPlain` morphology fallback | Now `tracing::debug!` when the district grid is empty (expected: params-missing body / early cascade) and `tracing::warn!` when a populated grid misses the key (signals a pixel→district convention bug). No more silently-wrong topology. |
| H2 | Parity tripwire covered `transit_hub` only for Commission + Corporate | Added Pioneer / Industrial / Military / Academic `transit_hub` rows — an accidental archetype-conditionalization of the cross-archetype override is now caught for every archetype. |
| Tyre (non-blocking) | `arrangement_pattern` doc said "re-derived at L4" without saying where | Clarified: the re-derivation call lives in the consumer (`generate_quarter_skeleton`), not in `build_skeleton_work_item` (which only threads inputs). |
Also reconciled the branch's earlier `export --stage` post-checkout hook with main's superseding do-nothing version (`b24a3596b`) so the two merge cleanly. (Per pql-clide's review of the upstream feature request: do-nothing on same-HEAD is the minimal fix — no git-index side effects, no cross-branch leak.)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Completes the GenerateSkeleton dispatch that T-1022 wired (it carried only
founding_orientation).build_skeleton_work_itemnow also threads the remaining Layer-3 character into Layer 4.T-1039 — political_archetype + morphology_zone + arrangement_pattern
CityPlacement(was theCommissionstub).DistrictProfilevia newscale::heightmap_pixel_to_district(exportedHEIGHTMAP_CELLS_PER_DISTRICT;cascade.rsdrops its local literal for the shared const). Was theAlluvialPlainstub.attractor_matching::arrangement_pattern(&archetype, &economic_role)(both inputs already at L4) — noCityGenerationContextfield, no stored derived state (DB-as-cache). A pure total fn, so re-derivation is provably identical to L3. Parity test asserts L4 re-derivation == the L3-stored value (drift tripwire).T-1043 — road_entry_directions
BodyWorldState.road_graph: octant = bearing of each incident road edge, deduped per octant, ordered byMaintenanceAuthorityrank (the AdminFacing prestige-edge consumer). Feedsderive_access_points→AccessKind::QuarterEdge; theBlockJunctionfallback now fires only for genuinely isolated settlements.Acceptance
Verification
cargo test(full): 1559 lib + 37 harness + all integration — 0 failures. 11 new tests (incl. the arrangement_pattern parity tripwire + both acceptance tests). clippy--all-targets -D warningsclean; fmt clean. Coordinate convention (row/col → DistrictPos) verified againstderive_all_districts.Notes for review
.config/hooks/post-checkoutcommit (d2cbdc243) is already on main (cherry-picked as34ffcda86) and will no-op at merge — not part of this review..pql/changelogis board meta (T-1039/T-1043 activation + T-960→backlog, T-1038→done).🤖 Generated with Claude Code
PR #168 Review —
l3-l4-dispatch-threading→ main (code)Reviewers: Hoshe (code quality) + Tyre (architecture), both on the branch via
git show. Reviewedserver/src/atlas/{plugin.rs, scale.rs, cascade.rs}(the hook commit is already on main;.pql/changelogis meta).Verdict: CHANGES REQUESTED.
Tyre (Architecture) — APPROVE
Decision-consistent and determinism-clean. Verified: D-234a topology now gated by the real
morphology_zone(fjord → Ribbon, not the AlluvialPlain mesh — thecorporate_fjord_…acceptance test exercises it); political_archetype per D-214; arrangement_pattern re-derivation is sound (pure total fn over(archetype, economic_role), both from the same read-only DB row → can only diverge on a forbidden runtime write; parity test enforces it);scale.rsis the correct home forheightmap_pixel_to_district(avoids a district_profile circular-dep); RoadGraph dependency degrades gracefully to an empty graph (→ BlockJunction, same as isolated); D-010 maintained (BTreeMap, integer math, total sort order). Non-blocking: thearrangement_patterndoc comment inbuild_skeleton_work_itemsays "re-derived at L4" but the re-derivation happens insidegenerate_quarter_skeleton, not there — a one-line clarification would close the gap.Hoshe (Code Quality) — REQUEST_CHANGES
plugin.rs—build_skeleton_work_item, morphology fallback (~238-241)AlluvialPlainfallback fires silently whendistricts.get(&district_pos)misses. This happens (a) in production when a body's district layer was never built (params-missing) — every city on that body silently gets wrong street topology — or (b) from a coordinate bug. No log either way, inconsistent with the surroundingtracing::warn!on the read_set path. Addtracing::debug!when the grid is empty (expected: layer absent) andtracing::warn!when the grid is non-empty but the key misses (indicates a pixel→district convention bug).plugin.rs—arrangement_pattern_l4_rederivation_matches_l3_stored_value(~456-537)transit_hubonly with Commission + Corporate. Thetransit_huboverride fires before the archetypematch(currently archetype-independent) — but that's exactly what the tripwire guards. Addtransit_hubrows for Pioneer / Industrial / Military / Academic so an accidental archetype-conditionalization is caught.Hoshe confirmed clean: the row/col→DistrictPos convention matches
derive_all_districts,bearing_octantinteger math (axis + diagonal boundaries handled, no atan2), deterministic dedup/ordering (BTreeMap + total tie-break), no panic paths, D-010 throughout.Disposition: both H1/H2 + Tyre's doc note will be addressed (small additive changes).
Review findings addressed —
2d85f8ca3All findings resolved. Gate re-run green:
cargo test1559+ lib + integration (0 failures), clippy--all-targets -D warningsclean, fmt clean.AlluvialPlainmorphology fallbacktracing::debug!when the district grid is empty (expected: params-missing body / early cascade) andtracing::warn!when a populated grid misses the key (signals a pixel→district convention bug). No more silently-wrong topology.transit_hubonly for Commission + Corporatetransit_hubrows — an accidental archetype-conditionalization of the cross-archetype override is now caught for every archetype.arrangement_patterndoc said "re-derived at L4" without saying wheregenerate_quarter_skeleton), not inbuild_skeleton_work_item(which only threads inputs).Also reconciled the branch's earlier
export --stagepost-checkout hook with main's superseding do-nothing version (b24a3596b) so the two merge cleanly. (Per pql-clide's review of the upstream feature request: do-nothing on same-HEAD is the minimal fix — no git-index side effects, no cross-branch leak.)Pull request closed