Repository navigation
refactor(loom-ui): move coded Group picker out of the reshape editor (#199) - #207
matthewpeterkort wants to merge 2 commits into
Conversation
ConstructionReshapeEditor coordinated both the selected-operation form and a distinct asynchronous picker workflow (direct-source coded Group selection) that owns inventory readiness polling, source pagination, saved-value reauthorization, search and paging. The picker had one callsite and no dependency on the parent's mutable request refs; its reasoning burden was paid by every reader of the 5,115-line multi-operation module. Move GroupCodedValuePicker, its private readiness/paging state types, the readiness poll waiter, the initial-choices constant, and the availability classifier into GroupCodedValuePicker.tsx with an explicit exported props type. Shared Group form construction and candidate-evaluation helpers (codedFamilyKey, codedCategoryKey, createOpaqueId, uniqueName, getUsedGroupNames, ensureGroupCodedPassthroughs) and the form/context types stay in the parent module and are now imported by the picker; no logic was rewritten. The parent drops its now-unowned useQuery, semanticConceptLabel, FrameSourceOption, SemanticInventoryBrowseResponse and SemanticInventoryItem imports and shrinks to 4,601 lines. Behavior is byte-exact: the moved bodies were checked-extracted verbatim (rerunnable tool asserts before/after slice equality), no expectations were touched, and no comments were added. Verification: - ConstructionReshapeEditor.unit.test.tsx: 103/103 passed, 0 skipped - constructionOperations directory: 18 files, 314/314 passed - ExplorerBuilder feature suite: 79 files, 1,076/1,076 passed - BuilderWorkspace operation-history/reconciliation/suggestions: 98/98 - operation-history formal journey replay (UI + Go phases): passed - typecheck (tsc -p tsconfig.test.json), check-boundaries, check_no_code_comments: clean; git diff --check clean - Builder browser acceptance: not run (no Chromium in this sandbox); recorded as incomplete evidence Closes #199 (source-map re-pin for reviewed-sources.json and the UI contract inventory citations is handed to the verifier/tooling owner with the verified line mapping).
…s for the picker extraction Moving functions means updating explicit source maps, not neutering checks (repo-simplify-199 follow-up, coordinator-authorized shared-fixture commit). - verification/builder-interactions/reviewed-sources.json: re-pin the ConstructionReshapeEditor.tsx entry to the digest recomputed from the actual blob at this head (067873e6...), verified with the same sha256 digest() the formal verifier uses; all 29 reviewed entries re-verified, 0 failures. - docs/ui-contract-inventory/relational.fragment.json: re-cite all 99 distinct ConstructionReshapeEditor.tsx line references for the picker extraction, applied by a rerunnable tool that byte-verifies every mapped slice or refuses: 88 in-parent shifts (byte-identical), 10 picker-region citations moved to GroupCodedValuePicker.tsx (byte-identical), and the single straddling reference 554-660 split into GroupCodedValuePicker.tsx: 78-95 (helpers) plus ConstructionReshapeEditor.tsx:496-583, whose first line carries only the deliberate `export ` prefix added to uniqueName. - docs/ui-contract-inventory/ui-supported-affordances.json: regenerated by the repo's own canonicalizer (scripts/normalize_ui_contract_inventory.py): relational fragment sha256, expandedSha256, and sourceCoverage.watchedFiles (ConstructionReshapeEditor hash re-pinned, GroupCodedValuePicker.tsx added at its actual-bytes digest). Pristine-base regeneration was confirmed byte-identical to the previously committed manifest before editing, and lane 259's PR 204 canonicalizer reproduces this exact manifest bytes over the same tree, so the pinned expandedSha256 does not churn under their simplification. Scope discipline: only ConstructionReshapeEditor/GroupCodedValuePicker entries were touched; no unrelated re-pins. No checks removed or weakened. Verification: - verify_ui_contract_inventory.py --source-only: PASS (CI gate mode) - verify_ui_contract_inventory.py --self-test: both mutation probes PASS, including the builder.reshape.group_coded omission probe proving the re-cited picker evidence still binds CODED_GROUP - verify_ui_contract_inventory.py full mode: issue set byte-identical to the pristine 80e8877 baseline (399 pre-existing pending-coverage rows, zero new issues) - scripts/tests/test_normalize_ui_contract_inventory.py: 5/5 OK - reviewed-sources digest loop (formal-tools digest()): 29/29 match - ConstructionReshapeEditor.unit.test.tsx: 103/103 passed, 0 skipped - git diff --check: clean
matthewpeterkort
left a comment
There was a problem hiding this comment.
Review: extraction is faithful — ready, no changes required
Moved-code correspondence (verified against the base diff). The moved slices are byte-identical: helpers/types/constants (waitForCodedInventoryReadinessPoll, availableGroupCodedEntry, GroupCodedSourceDiscovery/Readiness/Family/Checkpoint/View, INITIAL_VISIBLE_CODED_CHOICES, CODED_INVENTORY_READINESS_POLL_INTERVAL_MS) plus the full component (old ConstructionReshapeEditor.tsx:3728-4163 to GroupCodedValuePicker.tsx:105-534) match the deleted lines exactly, with the inline props type hoisted to the exported GroupCodedValuePickerProps and an explicit import header added. No behavior, error text, ordering, or cancellation semantics changed.
Parent side. The call site is untouched and matches the exported props contract (context, form, stage, disabled, onChange); ConstructionReshapeEditorProps was already exported (line 334), so the type-only picker import is sound. All five removed parent imports (useQuery, semanticConceptLabel, FrameSourceOption, SemanticInventoryBrowseResponse, SemanticInventoryItem) have zero remaining references in the parent, and no orphan references to the moved symbols remain. The six shared helpers and four shared types gained export markers only, with no logic edits, per the ticket.
Re-pins. Citation shifts are arithmetically consistent with the three deletion zones (-4 import lines, net -73 lines in the helper zone above old 497, net -437 picker lines from old 3728, cumulative -514 below it). All 14 picker citations are within the 534-line file and land on the expected code; citation lengths are preserved (byte-identical moves); the straddling 554-660 citation splits into picker 78-95 plus parent 496-583; no citations of unrelated files were touched. Both manifests pin the same parent digest 067873e6…, and ui-supported-affordances.json adds GroupCodedValuePicker.tsx at its own digest in sorted position with the fragment sha and expandedSha256 updated.
Verdict: approved — no changes requested. (Posting as COMMENT because GitHub rejects APPROVE from the PR author account.)
Optional, not blocking: (1) ConstructionReshapeEditor and GroupCodedValuePicker now import runtime values from each other; the cycle is safe today because every cross-module reference sits inside component bodies, but hoisting the six shared helpers into a third module in a follow-up would remove the fragility entirely if top-level evaluation ever needs them. (2) Digests could not be recomputed inside the review sandbox (no hash execution permitted); cross-manifest consistency plus the worker-recorded verifier and fixture-gate runs support them. (3) New module has no dedicated test file; existing picker coverage runs through the unchanged parent unit suite, which is acceptable for a pure extraction.
Review basis: same-model review (qwen3.8-flash-next); tsc/test/fixture-gate results are taken from the worker-reported evidence, not rerun here.
What
Extracts the direct-source coded Group
GroupCodedValuePicker(readiness polling, source pagination, saved-value reauthorization, search/paging, picker UI) out of the 5,115-lineConstructionReshapeEditor.tsxinto a focusedGroupCodedValuePicker.tsxmodule (534 lines) with an explicit exported props type. Part of the repo-simplification batch; implements #199.Reduced reasoning burden (not mere line count)
useStatecells, 3 request refs, checkpoint ref, twouseQueryworkflows with scope-key gating). Now that state machine is the entire file: every top-level declaration inGroupCodedValuePicker.tsxparticipates in one workflow, and the readiness/scope-key/truncation invariants can be checked without reading pivot, expand, or aggregate code.ConstructionReshapeEditorkeeps what the ticket defines as its job: form coordination and construction-intent conversion. Its import list lostuseQuery,semanticConceptLabel,FrameSourceOption,SemanticInventoryBrowseResponse,SemanticInventoryItem— evidence these concepts are no longer part of the editor's story.GroupCodedValuePickerProps: context, form, stage, disabled, onChange) plus six explicitly exported shared helpers. Shared Group form construction and candidate-evaluation logic (codedFamilyKey,codedCategoryKey,createOpaqueId,uniqueName,getUsedGroupNames,ensureGroupCodedPassthroughs) stays in the parent as the ticket prescribes; no logic was rewritten, no behavior, error text, ordering, or cancellation semantics moved location or changed.Extraction integrity (moved body correspondence)
Applied with a rerunnable checked-extraction tool: the moved slices (helpers 499-571, props fields 3729-3733, component 3735-4163) are asserted byte-identical between before/after, and 88/88 shift-only citations of
docs/ui-contract-inventory/relational.fragment.jsonwere verified byte-identical at their mapped offsets. The picker region's 10 citations map intoGroupCodedValuePicker.tsxatL-3629; one straddling citation splits. No handwritten code comments were added; the no-comments gate passes.Verification
git diff --checkConstructionReshapeEditor.unit.test.tsx(ticket check, unmodified)constructionOperations/directorysrc/features/ExplorerBuilderfeature suiteBuilderWorkspace.operationHistory.formal.test.tsx+ reconciliation + suggestions.retryverify-builder-formal-core.mjs --phase journey --feature operation-history)/tmp/opencode/journey-199)tsc -p tsconfig.test.json,check-boundaries,check_no_code_comments.py/usr/bin/chromiumin this sandbox; the journey's documented boundary already excludes browser evidenceShared source maps re-pinned in-PR (commit
3f94a4df, coordinator-authorized)Moving functions means updating explicit source maps, not neutering checks:
verification/builder-interactions/reviewed-sources.json: ConstructionReshapeEditor.tsx re-pinned to the digest recomputed from the actual blob at head (067873e6…), verified with the verifier's owndigest(); all 29 reviewed entries re-verified, 0 failures.docs/ui-contract-inventory/relational.fragment.json: all 99 distinctConstructionReshapeEditor.tsxcitations re-cited by a rerunnable tool that byte-verifies every mapped slice or refuses to write — 88 in-parent shifts (byte-identical), 10 picker citations moved toGroupCodedValuePicker.tsx(byte-identical atL-3629), and the one straddling reference554-660split intoGroupCodedValuePicker.tsx:78-95+ConstructionReshapeEditor.tsx:496-583(first line carries only the deliberateexportprefix onuniqueName).docs/ui-contract-inventory/ui-supported-affordances.json: regenerated by the repo's own canonicalizer — relational fragment sha256,expandedSha256, andsourceCoverage.watchedFiles(parent re-pinned;GroupCodedValuePicker.tsxadded at its actual-bytes digest). Pristine-base regeneration was confirmed byte-identical to the previously committed manifest before editing; lane 259's PR refactor(scripts): split UI contract canonicalizer into explicit phases #204 canonicalizer reproduces this exact manifest bytes over the same tree, so the pinnedexpandedSha256does not churn under their simplification.Fixture-gate evidence at this head:
verify_ui_contract_inventory.py --source-onlyPASS (CI gate mode);--self-testboth mutation probes PASS (including thebuilder.reshape.group_codedomission probe, proving the re-cited picker evidence still binds CODED_GROUP); full-mode issue set byte-identical to the pristine80e88771baseline (399 pre-existing pending-coverage rows, zero new issues);test_normalize_ui_contract_inventory5/5 OK. Only ConstructionReshapeEditor/GroupCodedValuePicker entries were touched — no drive-by re-pins, no checks removed or weakened.Closes #199