DMC-RELKEY-C0-S3A-REVIEW-002 -- Relation-Key Identity Slice 3a: fresh independent review continuation
========================================================================================================

AUTHORITY
---------
The architecture authority remains the `relation_key_cycle0_assessment`
component (the corrected, independently accepted assessment) together with
`relation_key_cycle0_delta_rereview` (the closing delta re-review). The
accepted `relation_key_slice1_acceptance` and `relation_key_slice2_acceptance`
components are the accepted owners that Slice 3a must delegate to. The
`dmc_contract` component is the governing procedure. Do not treat this
task.txt as a substitute for reading those components in full before
reviewing.

BACKGROUND -- WHY THIS WORKITEM EXISTS
---------------------------------------
The first standalone-WFC Core consumer Run,
`RUN-c17b60217385468d88cd6472c7d5a8da` (WorkItem `DMC-RELKEY-C0-S3A`, state
root `/home/stefan/wfc-runs/dmc-relkey-c0-s3a-20260925-01`), implemented
Slice 3a in H001 (commit `ffdfa60f6dca6260a97353f5f3c23ec50ef8c482`,
"feat(DMC-RELKEY-C0-S3A): delegate Lookup relation identity H001") and
reviewed it in H002. H002 returned code 0 and all four trusted-evidence
providers it ran (`diff_hygiene`, `git_version`, `pytest_enrich_lookup`,
`pytest_derived_column_policy`) passed. H002 was nonetheless mechanically
preempted at trusted-commit time, with stop reason recorded in that Run's
`operator-summary.json`:

    mechanical_preemption:non-ignored untracked state;
    required durable artifact is missing, unrepresented, or uncommitted;
    post-evidence worktree is not clean with resolved submodules;
    trusted_commit:unexpected dirty path:
    docs/warm_storage/global_reviews/relation_key_identity_slice3a_lookup_delegation_implementation_review_2026-09-25.html

The reviewer had rendered its authored AsciiDoc review artifact to a sibling
HTML file inside the repository worktree and left that generated file
untracked, so the Coordinator correctly refused the trusted commit rather
than admit an impure worktree. This is an execution-hygiene failure, not a
semantic finding about Slice 3a: H002's own review content is not known-bad,
but its trusted evidence and returncode are not, by themselves, review
authority, and the Run never reached an authorized trusted review commit.

The failed H002 `.adoc`/`.html` outputs were removed from the Core worktree
and are retained operator-side only, with SHA256SUMS, at
`/home/stefan/wfc-ops/dmc-relkey-c0-s3a-20260925-01/failed-h002-artifacts/`.

That historical Run, its state root, and its commits are immutable evidence.
Do not resume, retry, reuse, or reopen it. Do not restore its files into the
repository, and do not treat its retained `.adoc` prose as accepted review
authority -- it is provenance/context only.

CONCERN
-------
Independently review the still-committed Slice 3a implementation -- Lookup
value-mode enrichment, duplicate-key detection, and mismatch verification
delegating relation-key identity to the accepted Slice-1 owner, with FK
(Slice 2) and Core untouched -- against the accepted Cycle-0 contract.

Review object:: implementation commit
`ffdfa60f6dca6260a97353f5f3c23ec50ef8c482`
("feat(DMC-RELKEY-C0-S3A): delegate Lookup relation identity H001"), compared
with preparation baseline `c386985e56f42883476492d668b72c680b2a854a` (its
direct parent, "docs(workflow): prepare RELKEY Slice 3a Lookup delegation").
Changed paths in the review object:

    docs/release_notes/release_notes.adoc
    src/spreadsheet_handling/domain/transformations/enrich_lookup/mismatch.py
    src/spreadsheet_handling/domain/transformations/enrich_lookup/operation.py
    src/spreadsheet_handling/domain/transformations/enrich_lookup/policy.py
    tests/unit/domain/transformations/test_derived_column_policy.py
    tests/unit/domain/transformations/test_enrich_lookup.py

You may read the retained failed H002 `.adoc` artifact and the Run01
`operator-summary.json` (both operator-side, outside this repository) as
provenance and orientation for why this WorkItem exists. Neither is
authoritative evidence of Slice 3a's correctness: inspect
`enrich_lookup/operation.py`, `enrich_lookup/policy.py`,
`enrich_lookup/mismatch.py`, and both test files directly, and form an
independent verdict. Do not carry forward H002's implicit "evidence passed"
status as a semantic verdict without re-deriving it from the code and tests.

Nothing outside the six review-object paths and the new review artifact may
change under this WorkItem's `review` phase. `correct` (only if a real defect
is found) may additionally mutate exactly those six paths -- see CORRECTION
AUTHORITY below.

REQUIRED SEMANTICS -- MINIMUM INSPECTION CHECKLIST
----------------------------------------------------
At minimum, independently falsify each of the following against the accepted
contract (see the assessment component's "Lookup and pandas boundary" and
"B-2 whole-frame Missing rewrite" sections, and the Slice-1/Slice-2
acceptance components, for the full contract text):

* Lookup value-mode enrichment delegates relation-key identity to the
  accepted Slice-1 owner rather than reinterpreting it through raw pandas
  merge/duplicate mechanics.
* exact String whitespace behavior -- no `.strip()`/trimming anywhere in
  relation-key identity; `" 1 "` != `"1"`.
* Number/String separation -- String `"1"` != Number `1`.
* Boolean/Number separation -- Boolean `true` != Number `1`, despite Python's
  `True == 1`.
* integral numeric carrier equivalence -- `1 == 1.0 == numpy.int64(1)` by
  exact represented mathematical value, never by weak-scalar promotion or a
  common-dtype cast.
* Missing relation-key ineligibility -- no recognized Missing carrier
  (`None`, `""`, NaN, `pandas.NA`, `NaT`, ...) is ever treated as a key; a
  Missing source component is rejected/routed before matching and Missing
  target rows are excluded.
* mixed pandas dtypes produce deterministic Domain behavior rather than a
  raw pandas dtype `ValueError` or other incidental failure.
* original source/target key carriers presented to the caller are preserved
  -- no silent recast of the caller-visible columns.
* any temporary internal relation-key join representation (e.g. an internal
  join key column or owner-keyed mapping) does not leak into output,
  provenance, or any other caller-visible state.
* duplicate-key detection (`_lookup_frame_has_duplicate_keys` or its
  replacement) uses the same owner identity as resolution.
* mismatch verification uses the same owner identity for lookup selection as
  enrichment and duplicate detection.
* helper-payload comparison (the historical `mismatch.py:_norm`'s "compare a
  materialized helper cell's displayed value against the target row's stored
  value" role) remains a separate, Lookup-owned local contract, split from
  relation-key identity rather than reusing the same normalization for both
  purposes.
* the B-2 whole-frame Missing rewrite
  (`where(pd.notnull(enriched), "")` applied to the whole values-mode output)
  is not widened, generalized, or "fixed" by this slice -- it remains a
  separate, already-characterized Lookup output/carrier-preservation
  follow-up; any temporary join columns must not make that rewrite more
  invasive.
* formula authoring remains outside Slice 3a.
* DCP (derived-column-policy) production remains outside Slice 3a --
  `derived_column_policy.py` delegates entirely to
  `evaluate_lookup_mismatches`; only its test fixtures may exercise the
  changed mismatch behavior indirectly.
* no FK, reference/graph, canonical-documentation, Project-Memory, WFC, or
  Runtime scope leaked into the implementation.
* release-note wording in `docs/release_notes/release_notes.adoc` is bounded
  and truthful -- it must not overstate the change beyond Lookup
  enrichment/duplicate/mismatch delegation.
* the committed tests in `test_enrich_lookup.py` and
  `test_derived_column_policy.py` prove the required semantics above (not
  merely pass incidentally) -- check that each required behavior has a test
  that would fail if that behavior regressed.

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

* migrate or modify the Slice-1 semantic owner
  (`domain/relation_keys.py`, `tests/unit/domain/test_relation_keys.py`);
* migrate or modify the accepted Slice-2 FK delegation files;
* migrate or modify reference or graph validation
  (`domain/validations/reference_validations.py`,
  `domain/validations/graph_validations.py`);
* implement Slice 3b or Slice 4, or any later Relation-Key slice;
* touch canonical Semantic Model, Technical Model, or any other canonical
  documentation surface beyond the release note;
* widen or "fix" the B-2 whole-frame Missing rewrite;
* implement a general scalar/DataFrame normalization framework, or any
  Number/DateTime normalization API beyond what Slice 3a's delegation
  requires;
* rewrite, amend, or otherwise mutate historical commit
  `ffdfa60f6dca6260a97353f5f3c23ec50ef8c482`, its parent
  `c386985e56f42883476492d668b72c680b2a854a`, or any Run01 commit or state;
* restore, commit, or otherwise reuse the retained failed H002 `.adoc`/`.html`
  artifacts -- this WorkItem's review artifact is a NEW file (see NEW REVIEW
  ARTIFACT below), authored fresh;
* treat Run01's mechanical preemption as a semantic Slice-3a Finding --
  it is not, and is not this WorkItem's concern beyond the hygiene rule
  below; and
* touch the Workflow Coordinator, the Runtime, Project Memory, the roadmap,
  or any other WorkItem's artifacts.

If correct review or correction mechanics genuinely require touching a file
not named in this WorkItem's scope, do not silently add it: stop and
escalate (report the need and rationale) rather than expanding scope.

NEW REVIEW ARTIFACT
--------------------
Use a NEW durable review artifact:

    docs/warm_storage/global_reviews/relation_key_identity_slice3a_lookup_delegation_implementation_review_2026-09-25_review_002.adoc

Do NOT reuse or overwrite
`relation_key_identity_slice3a_lookup_delegation_implementation_review_2026-09-25.adoc`
-- that filename belongs to the failed historical Run01 attempt and is not a
file this WorkItem may create, restore, or commit; it must remain
represented only in the retained operator-side evidence.

CRITICAL GENERATED-ARTIFACT RULE
----------------------------------
The Run01 failure exposed a real execution-hygiene requirement. It governs
every phase of this WorkItem:

The ONLY authorized durable repository artifact during the `review` phase is
the declared `*_review_002.adoc` file named above. `correct` may additionally
touch only the six review-object paths listed under CORRECTION AUTHORITY.

If AsciiDoc rendering or validation of the review artifact is useful, it MUST
NOT leave HTML, PDF, temporary files, caches, or any other generated artifact
anywhere in the repository worktree. A plain `asciidoctor <review-file>`
invocation that writes a sibling `.html` into the repository is prohibited --
this is exactly the Run01 failure mode.

This profile's `review` phase declares trusted evidence
`asciidoc_review_validate`, which runs

    asciidoctor -o /dev/null docs/warm_storage/global_reviews/relation_key_identity_slice3a_lookup_delegation_implementation_review_2026-09-25_review_002.adoc

If rendering is performed for any other reason (e.g. manual inspection), it
must likewise be directed explicitly outside the repository worktree (for
example under `/tmp`) and removed afterwards; do not rely on the trusted
evidence command as the only guard.

Before returning a route (`accept` or `correct`), the reviewer must inspect
repository status (`git status --porcelain`) and confirm that only the
authorized durable artifact is dirty -- no HTML, no cache, no other untracked
or modified path.

Do not solve this by adding `*.html` to authorized scope or to
`.gitignore`. The correct behavior is not to create unauthorized repository
output in the first place.

REVIEW / FINDING CHOREOGRAPHY
-----------------------------
This WorkItem starts at `review`, not `rereview`: it independently evaluates
the currently committed Slice 3a implementation from a fresh context. An
implementation that meets the accepted contract may be accepted without a
Finding:

    review -> accept

Do not manufacture a Finding merely to exercise `correct`. The fresh gate
reviewer writes the required new review artifact and may open a new blocking
Finding only for a REAL remaining Slice-3a semantic or scope defect against
the accepted Cycle-0 contract and the accepted Slice-1/Slice-2 owners. If a
real defect is found:

    review -> correct -> rereview -> accept

The corrector may cite or add evidence to a Finding opened by this WorkItem's
own `review` phase but must not resolve, residualize, supersede, reopen, or
otherwise dispose of it. After a completed correction, request `rereview`.

The fresh gate rereviewer (fresh context, observation-only: no authorized
edit/commit scope) 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` again; the three-Hop budget,
not an invented retry, controls whether another correction can run.

No later Relation-Key slice is authorized by this review, whichever route is
taken.

CORRECTION AUTHORITY
---------------------
If and only if the fresh review finds a REAL remaining Slice-3a semantic or
scope defect, `correct` may mutate only:

    src/spreadsheet_handling/domain/transformations/enrich_lookup/operation.py
    src/spreadsheet_handling/domain/transformations/enrich_lookup/policy.py
    src/spreadsheet_handling/domain/transformations/enrich_lookup/mismatch.py
    tests/unit/domain/transformations/test_enrich_lookup.py
    tests/unit/domain/transformations/test_derived_column_policy.py
    docs/release_notes/release_notes.adoc

No other production path. No amend/rewrite of any existing commit. No later
Relation-Key slices.

VALIDATION
----------
Before claiming review or correction outcomes, run at least:

    git diff --check
    git --version
    python -m pytest -q tests/unit/domain/transformations/test_enrich_lookup.py
    python -m pytest -q tests/unit/domain/transformations/test_derived_column_policy.py

and, in the `review` phase, the AsciiDoc validator named above. Report
results truthfully. The only trusted evidence providers selected by this
profile are `diff_hygiene`, `git_version`, `pytest_enrich_lookup`,
`pytest_derived_column_policy`, and (review phase only)
`asciidoc_review_validate`. Do not add a full-suite tax without concrete
reason.

AGENT GIT RULE
--------------
Core's general commit-identity guidance
(`docs/ai_info/git_and_workflow.adoc`, "DMC-family commit identity") is a
traceability *recommendation*, not a binding rule: family/cycle/WorkItem
identity may be projected into a commit either as a subject-line tag or as
trailers.

For any commit the Coordinator creates under this WorkItem, the only
requirement is a valid, single-line, Conventional-Commit-compatible subject
that contains both this WorkItem's ID and the current Hop ID as identity
tokens, e.g.:

    docs(DMC-RELKEY-C0-S3A-REVIEW-002): record review H001

and, only if needed:

    fix(DMC-RELKEY-C0-S3A-REVIEW-002): correct Slice 3a H002
    docs(DMC-RELKEY-C0-S3A-REVIEW-002): record rereview H003

This is exactly what Runtime `ec397b6`'s `commit_subject_error` mechanically
enforces (Conventional-Commit subject shape plus WorkItem/Hop token
presence); it requires no body and no trailers. No mandatory body/trailers.
No amend/rebase/history rewrite.
