DMC-RELKEY-C0-S1 -- Relation-Key Identity Slice 1: semantic owner and contract tests
=====================================================================================

AUTHORITY
---------
Implement ONLY the accepted Slice 1 of the Relation-Key Identity Cycle-0
design. The architecture authority is the `relation_key_cycle0_assessment`
component (the corrected, independently accepted assessment) together with
`relation_key_cycle0_delta_rereview` (the closing delta re-review; read its
F1/F2 dispositions and W2 in particular). The `dmc_contract` component is the
governing procedure. Do not treat this task.txt as a substitute for reading
those components in full before editing.

CONCERN
-------
Introduce the PRIVATE shared Domain owner for relation-key eligibility,
equality, and hashable identity, with NO consumer migration. Nothing outside
the owner module and its tests may change.

Likely files (verify against current source before editing; do not add a
file not named here without escalating per NON-SCOPE below):

  src/spreadsheet_handling/domain/relation_keys.py
  tests/unit/domain/test_relation_keys.py

Before writing any code, independently inspect current
`src/spreadsheet_handling/core/scalar_values.py` (the six-category admission
authority this owner must consume, not extend) and confirm neither target
file currently exists.

REQUIRED SEMANTICS (see the assessment component for the full contract)
-------------------------------------------------------------------------
* Eligibility: an already-admitted scalar is a key exactly when it is not in
  the Missing category. Composite keys are eligible only if every component
  is eligible. No Missing carrier (`None`, `""`, NaN, `pandas.NA`, `NaT`, ...)
  is ever a key.
* Equality is a NEW bounded relation, not reuse of native `==`. It must be
  reflexive, symmetric, transitive, and agree with the owner's own hashable
  identity -- dicts/sets/counters/merge-style consumers must never disagree
  with pairwise comparison.
* Category is part of identity: String `"1"` != Number `1`; Boolean `true` !=
  Number `1`, despite Python's `True == 1`.
* Strings compare exactly. No `.strip()`, no trimming, anywhere in relation-key
  identity. `" 1 "` != `"1"`.
* Numbers compare by exact represented mathematical value, never by NumPy
  weak-scalar promotion and never via a common-dtype cast. `1 == 1.0 ==
  numpy.int64(1)`; `numpy.float32(0.1) != 0.1`; `numpy.int64(2**53+1) !=
  numpy.float64(2**53)`.
* Date and DateTime remain distinct categories. DateTime uses the explicit
  relation-key-only basis in the assessment (naive: exact wall-clock
  coordinate; aware: exact UTC instant; aware never equals naive; full
  precision retained, no rounding). Implement DateTime only to the extent
  this Slice 1 contract requires -- do not build a general timezone or
  precision framework.
* No fallback to `str`/`repr`/parsing/pandas dtype coercion anywhere in
  eligibility, equality, or hashing.
* Composite keys: componentwise identity: equal arity, each component
  eligible and equal (order matters).
* `Decimal` is covered only by existing scalar-admission rejection; no
  relation-key coercion test for it.

Implement the owner test matrix from the assessment's "Semantic owner unit
tests" table in full, including the equality/hash-agreement case and the
non-transitive-native-triple DateTime case. Also apply W2 from the delta
re-review: derive exact Number identity from the carrier's exact value (do
not round-trip through `float()` for `numpy.longdouble`; handle infinities
separately), and derive DateTime coordinates with exact integer/rational
arithmetic rather than NumPy unit promotion (a raw `numpy.datetime64`
cross-unit comparison can itself raise `OverflowError`).

EXPLICIT NON-SCOPE
------------------
Do not, under this WorkItem:

* migrate or modify FK materialization or FK validation
  (`core/fk.py`, `domain/validations/fk_helpers.py`,
  `domain/transformations/fk_helpers/**`);
* migrate or modify Lookup enrichment (`domain/transformations/enrich_lookup/**`);
* migrate or modify reference or graph validation
  (`domain/validations/reference_validations.py`,
  `domain/validations/graph_validations.py`);
* implement C3-S2 (the `check_duplicate_ids` `"nan"` guard) -- it is absorbed
  by the future Slice 2, not this Slice 1;
* touch `docs/release_notes/release_notes.adoc` -- Slice 1 changes no runtime
  behavior and owns no release note;
* touch canonical Semantic Model, Technical Model, or any other canonical
  documentation surface;
* widen or rename any public/helper surface, or register a pipeline step;
* implement a general scalar normalizer, general tuple-uniqueness identity,
  or any Number/DateTime normalization API beyond this owner's private
  relation-key identity material;
* touch Slices 2, 3a, 3b, or 4 in any form; and
* touch the Workflow Coordinator, the Runtime, Project Memory, the roadmap, or
  any other WorkItem's artifacts.

If correct Slice-1 implementation mechanics genuinely require touching a file
not named above, do not silently add it: stop and escalate (report the need
and rationale) rather than expanding scope.

REVIEW / FINDING CHOREOGRAPHY
-----------------------------
An implementation that meets the accepted contract may be accepted without a
Finding:

    implement -> review -> accept

The fresh gate reviewer writes the required review artifact and may open a new
blocking Finding only for a real remaining defect against the accepted
Cycle-0 contract; do not manufacture one. In that case return
`outcome: changes_required` and request `correct`.

The corrector may cite or add evidence to an existing Finding but must not
resolve, residualize, supersede, reopen, or otherwise dispose of it. After a
completed correction, request `rereview`.

The fresh gate rereviewer may resolve an open blocking Finding only when the
correction establishes closure, then request `accept`. If a blocker remains,
return `changes_required` and request `correct`; the four-Hop budget, not an
invented retry, controls whether another correction can run.

VALIDATION
----------
Before claiming implementation or correction success, run at least:

    python -m pytest -q tests/unit/domain/test_relation_keys.py
    git diff --check

Report results truthfully. The only trusted evidence providers selected by
this profile are `diff_hygiene`, `git_version`, and `pytest_relation_keys`.

AGENT GIT RULE
--------------
Keep implementation/correction commit intents distinct from the
review-artifact commit intent. Project this WorkItem's identity into every
commit per `docs/ai_info/git_and_workflow.adoc` "DMC-family commit identity":
use Conventional Commits with trailers

    DMC-Work-Item: DMC-RELKEY-C0-S1
    DMC-Phase: <phase>

Do not invent a new commit-identity mechanism or validator; this is a
trailer convention, not enforced tooling.
