6.3 KiB
Existing Child / Incident semantic review slice
This slice wires the existing-record attachment adapters into the frozen-base batch review. Artifact-link lifecycle and creation of missing child/relationship records remain separate work. No core production changes were required.
Contract and implementation
attachments.rsowns explicit OA/SA identity pairs for Child, incident Source, and incident Target. Each exact facet address has an independent ordinary typed Draft; changing family, decisions, or active review row retains it.row.rsroutes final Parent/endpoint edits to that actual record and exposes only the selected field. Attachment decisions are excluded from the owner-record constructor composition.compose.rsreads each attachment proposal from the same frozen base and compares its actual(child, Header.Parent)or(relationship, Relation.Source/Target)slot against all ordinary and attachment decisions. It emits one complete candidate per actual record, never sequential Apply commands. Two endpoint drafts can merge; conflicting direct Keep blocks while drafts remain retained.- Taking source absence for an Incident requires an explicit final endpoint. A missing source identity retains a destination-only attachment; Child absence detaches only from the reviewed owner. Existing core checks remain authoritative for validity, induced impacts and history overlap.
attachments_view.rsprovides named pair pickers and scoped final-record controls with an 18px right gutter. The tab row already wraps; the new Attachments tab follows that behavior.recovery.rsadds default-empty attachment payloads to version 1 and version 2 and reconstructs typed drafts against the accepted base. It rejects duplicate addresses, changed identity/kind, wrong-layer IDs, or unrelated edited fields. Raw invalid selected fields survive. The separate source-5 upgrade adapter requires the externally verified legacy identity/fingerprint and clears prepared-impact approvals before normal restoration/replanning; ordinary restoration remains strict.
Verification status
The four direct core attachment oracle tests passed before this GUI wiring (semantic_attachments_gui_oracle.rs, root log .local/source6-core-recovery-tests.log). The preceding desktop baseline was 483/483, including 82 semantic tests; strict all-target Clippy and frozen native GUI/server build passed. These results do not establish the new wiring.
Nine new tests in attachments_tests.rs are wired and formatted but awaiting coordinated compilation/execution. They cover exact adapter/core parity for Parent and both endpoints in both directions, explicit Incident absence versus destination-only retention, retained picker families, malformed raw references and scope rejection, addressed GUI candidate parity, direct-record Keep conflicts, shared-relation endpoint composition plus excluded invalid recovery, exact App source/history Undo/Redo, and absent-payload/source-5 recovery bounds. Parameterized cases are not counted as separate Rust tests.
Independent review was requested from the behavior reviewer. Native attachment acceptance remains pending.
Native recheck flow
Use a fixture with an owner trace and mapped existing children/relationships. Open Review semantics from the owner trace, choose Attachments, then choose exact OA/SA child IDs and Use exact attachment pair. Set final value exposes the named destination child and its Parent only. Pick another compatible parent; the single combined preview must reflect the move without editing the source. Include the child trace and Keep its Parent to verify a conflict; exclude that row to retain its draft and restore the proposed move.
For an incident relationship, select Source or Target explicitly and pair the relationship IDs. Set final value edits only that endpoint. If the source relationship is no longer incident to the reviewed owner, Take must remain blocked until an explicit replacement is authored. Review both ends of one relationship and verify one final record, one Apply, and exact Undo/Redo. Enter a malformed raw reference where available, checkpoint/recover, and repair it; rejected input must remain exact.
Recheck tab wrapping, pair dropdowns, final field controls, history resets and all right-edge actions at 1100x700 and 1440x900. Verify saved project/history/source against direct core preparation, including unchanged comments and unrelated records. Functional-exchange port impact acceptance still needs a dedicated GUI/native falsifier in addition to these DataAssociation endpoint tests.
Coordinated test results and endpoint boundary
Root ran the wired semantic suite: 92/92 passed, log .local/source6-attachments-semantic-tests.log; this includes the preceding 82, nine attachment tests and the recovered trace-label regression. Source-5 recovery filter separately passed 13/13, .local/source5-recovery-tests2.log. Existing trace choices now resolve their stored alias/name on recovery; missing IDs still use the deleted-reference label.
An ignored standalone core probe established the precise FunctionalExchange rule: changing Incident Source alone keeps an output port owned by the old function and is rejected with functional_port; no automatic port impacts are prepared. Providing an existing matching output port through an explicit direct relationship SourcePort Candidate succeeds with zero impacts. The matching Source Candidate on that direct row agrees with the Incident actual slot and supplies the picker with its authored replacement owner.
A tenth attachment test, functional_incident_source_requires_explicit_matching_port_review_in_one_atomic_candidate, was added after the 92-test pass and is pending its own execution. It checks the initial refusal, actual scoped picker availability, explicit SourcePort resolution, one merged relationship candidate/two reviewed histories, exact direct-core result and unchanged accepted model. It does not invent a port or implicit impact.
The ignored native attachment fixture is validated under .local/native-fixtures/semantic-attachments.*, including exact before/after source and project JSON, request, IDs and hashes. semantic-attachments-native.md gives trace names and controls. Its two-candidate owner review has 12 elements, 2 relationships, 4 existing traces and no impacts. Native validation of the new attachment UI remains pending.