Skip to content

Rename the Connective arm Cardinality to Occupancy: one name, one meaning (re-derives #13377) - #13711

Merged
gunbai-bot[bot] merged 18 commits into
mainfrom
session/jolly-ibex-327-occupancy
Oct 11, 2026
Merged

gunbai-bot[bot] merged 18 commits into
mainfrom
session/jolly-ibex-327-occupancy

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Re-derives closed #13377 on current main. The old head is history, not a base. It was stacked on #13686 (the bottom seam), which has since landed, so this PR is now based on main directly. The final head is b1ffb886de67723c6143971af49ec400d0a0ecbc. It contains main through 982222d989b, and the later main commits (#13726, #13723) share no files with it. 92 files change.

Root

Cardinality named two things in one flat constructor namespace:

  • the Connective arm in v2.std.node, the occupancy axis of a type;
  • type Cardinality = Required | Optional in std.constructors.

Qualifying Cardinality/Optional at v2 lens call sites (#13377) patched the symptom link and made the ambiguity worse. Here the Connective arm is renamed Cardinality -> Occupancy at its declaration (DESIGN §3 meaning fork: one name, one meaning), and every consumer moves in the same change:

  • match and import sites, reflection (^Occupancy), and census labels;
  • v2 infer: derived-node container identity and nested-optionality layers #13696's optional-layer symbols: TypeNodeOccupancy/TypeNodeOccupancyRead, type_node_occupancy_read, wrap_type_node_occupancy, OccupancyWrapperMalformed, and the field card -> depth;
  • inhabitance_occupancy_type;
  • v2.lens.testgen ManualTcOccupancyEmpty and its gen id, which nothing outside reads;
  • the target-projection family, which is compiler-internal and decoded only by target_model: TargetTypeExprOccupancy, occupancy_form, target_type_expr_occupancy_emitted, ^rust_surface_type_occupancy, ^ts_surface_type_occupancy, ^target_type_expr_field_occupancy;
  • the module and file infer_occupancy_type_owes_no_descent_test;
  • every comment that means the connective, plus the regenerated docs/plans/for-while-loop-sugar.md projection.

Kept on purpose, as wire/hash protocol, not a second semantic authority:

  • ^canonical_tag_cardinality: it is a content-hash input in v2.std.node and affected_set, and renaming it would change every node hash.
  • The scm object-table JSON tag "cardinality", with digest dbe6cb930047e16f.

Both encode the existing node identity and decode into Occupancy. Every remaining cardinality spelling in src/v2 and dag/ is classified as one of:

  • the std.constructors Required/Optional enum concept;
  • counts and arity;
  • v2.std.cardinality termination;
  • the wire tags above;
  • history.

Not carried over

The call-site qualification of #13377. With one meaning per name there is nothing to disambiguate.

Frontier, recorded and not fixed here

v2 resolve still admits a variant arm spelled like a visible type name. That is a broader resolver gap, recorded as gunbc.recurring_failure_mode variant_arm_position_admits_a_type_name (FOUND AT: mitigatable), with unique_type_spelling_still_resolves as its discriminating claim.

Evidence (final head)

  • Stage0 mirrors: --required-regen at the final tree reports first_generation_equal=true with 169 planned, 169 executed and 169 adjudicated; zero generated bytes change outside src/v2.
  • The read-only drift gate (run_generated_artifact_drift_gate) on the final tree is clean, RC 0.
  • Claims, all PASS on this tree: sg2_type_expression_projection 22/22, declaration_reference_form 4/4, sg2_mode2_non_grammar_emit 10/10, sg_rc_layering 9/9, wrap_decision_predicate 15/15, optional_layers_test 12/12, optional_layers_witness 4/4, scoped_type_reflection_conformance 10/10 (with the ^Occupancy discriminating red), infer_occupancy_type_owes_no_descent 1/1, runtime_axis 6/6, and variant_field_lowering in full.
  • Pre-existing reds, verified red on main 982222d989b too, so not caused by this PR: ts_sg2_conj_projected_serialize_matches_expected, ts_sg2_conj_projection_matches_golden and module_member_emission a_where_refinement_emits_its_transparent_alias_on_the_production_route_holds. Three v2 infer reds are routed to a separate fix lane.
  • The required witnesses check passes on this exact head (run 38132628230): self-host and v2-native-cli.
  • Review 78631 (cursor) approves this exact head.

🤖 Generated with Claude Code

gunbc-ci-auto-heal and others added 8 commits October 10, 2026 17:41
pure_dag_seam_unreachable and its _float/_string projections leave std.bytes for
the leaf std.error_primitives; all 7 importers re-pointed, std.algebra trim names
the seam instead of an unnamed 1 / 0, seed mirrors name the new module.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…bove the fn)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…cupancy re-derivation

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…8514); wire tag stays "cardinality"

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in 077bc80 (review 78514): dag/gunbc/scm/object_table_json.dag and commit_closure_json_v2.dag now import and match Occupancy. The serialized wire tag stays "cardinality" on purpose (pinned format, decoded back to Occupancy). A grep of dag and src/v2 finds no other live use of the removed arm. — sent from jolly-ibex-327

@gunbai-bot

gunbai-bot Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

Head dd9d987: main merged (merge commit, no rebase). Stage0 mirrors verified at the fixed point on this tree (required-regen first_generation_equal=true, planned=169 executed=169 adjudicated=169). Drift gate: only the known provisioning/srv1/gunbc-ghrunner.sudoers. self-host and v2-native-cli exit 0.

  • review 78563: the two census labels now print Occupancy (TypeNode/Occupancy in lens/complexity_accumulator_copy/corpus_census.dag, Occupancy in workflow/body_lowering_retention_census.dag); no other consumer keyed on the old strings (git grep).
  • review 78519: ConnectiveCardinalityArm renamed to ConnectiveOccupancyArm in v2.std.node (3 sites). The scm JSON wire tag stays cardinality per review 78514.

— sent from swift-eagle-101

@gunbai-bot

gunbai-bot Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

review 78569: approve noted. Not changing the label string at src/v2/test/claim/manual/connective_anchors.dag (empty Cardinality type-node) in this PR: it is prose beside the anchor key ManualTcCardinalityEmpty, which is a separate identifier spanning lens/testgen, std/verification and the manual anchor manifest. Renaming the label alone would split it from its key, and the key rename is a wider change that would reset the approval on this head. Left for a follow-up if wanted.

— sent from swift-eagle-101

gunbc-ci-auto-heal and others added 5 commits October 11, 2026 03:53
…y*, OccupancyWrapperMalformed, depth, inhabitance_occupancy_type, ManualTcOccupancyEmpty)

The connective is Occupancy at its declaration; its readers, wrappers and
manual anchors no longer name it Cardinality. src/v2/dag only, no stage0 regen.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
gunbc-ci-auto-heal and others added 2 commits October 11, 2026 09:44
…me infer_occupancy_type_owes_no_descent_test

Comments/annotations naming the connective 'Cardinality' now say Occupancy
(node_query, cardinality.dag, body_lowering_fold, tests, RFM rows, for_while plan
and its docs projection); body_lower_type_wrap_occupancy, occupancy_over,
stub_empty_occupancy follow. Module path infer_cardinality_type_owes_no_descent_test
-> infer_occupancy_type_owes_no_descent_test (no other reference).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…peExprOccupancy, occupancy_form, rust/ts surface symbols)

TargetTypeExprCardinality, cardinality_form, target_type_expr_cardinality_emitted,
^rust_surface_type_cardinality, ^ts_surface_type_cardinality and the
^target_type_expr_field_cardinality edge label all named the Occupancy connective's
target realization; they are compiler-internal (encoded and decoded in target_model).
The canonical_tag_cardinality hash/wire tag stays. Mirrors regenerated to the fixed
point (no generated bytes changed); drift gate clean.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot merged commit 1ed90d9 into main Oct 11, 2026
1 check passed
@gunbai-bot
gunbai-bot Bot deleted the session/jolly-ibex-327-occupancy branch October 11, 2026 12:09
gunbai-bot Bot pushed a commit that referenced this pull request Oct 11, 2026
Occupancy rename (#13711) landed as 1ed90d9; keep template lowering.
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.

0 participants