Repository navigation
OpenConceptLab/ocl_issues#3046 | Add References shows the version the collection is locked to, and what All Source Concepts & Mappings adds - #134
Conversation
… collection is locked to, and what All Source Concepts & Mappings adds A reference that names no version resolves to the version the collection's expansion is locked to, if it has a lock for that repository. The dialog showed the latest release. It now shows the locked version, with the lock icon and tooltip the expansion's own versions have. For a repository with no release and no lock it says HEAD, which is what the API uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
… when it opens, and only says what it knows A rebuild changes the locks after the page read them, so the dialog asks for the expansion each time it opens. An entry that names another repository, or a concept's own version, shows no 'Resolves to'. The text of All Source Concepts & Mappings is also true for an exclusion, and a version picked for one repository doesn't stay for the next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
…once it has read the collection's locks The dialog reads the expansion itself when it opens, shows '…' until then, and nothing if it can't be read. A late answer for a repository picked earlier is ignored. A mapping expression counts as the picked repository's too, whatever the Reference Type says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
…expansion when it opens, and waits while it's being built The default can change elsewhere, so the dialog asks the collection for it instead of taking the page's. While the expansion is processing its locks aren't settled, so an unpinned reference shows no 'Resolves to'. With 'Pin to a specific version' ticked, references by ID can't be added before a version is picked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
|
Codex review, pass 1 (codex-cli 0.171.0, commit 22fde7d) 4 findings: P1 2, P2 2.
findings.json{
"reviewer": "codex-cli 0.171.0",
"perspective": "defects",
"mode": "full",
"commit": "22fde7dbd",
"verdict": "findings",
"prior": [],
"findings": [
{
"id": "F1.1",
"severity": "P1",
"tag": null,
"file": "src/components/repos/RepoHome.jsx",
"line": 810,
"claim": "Add References keeps showing the old lock after the default expansion is rebuilt from the Versions tab.",
"scenario": "Open a collection whose HEAD expansion locks a source to v1 and whose source already has a v2 release. Rebuild the default expansion from Versions and wait for it to finish. Switch to References without reloading the page and add an unpinned reference to that source. The dialog says v1, but the API uses the rebuilt expansion's v2 lock. The rebuild refreshes the Versions tab's expansion data while RepoHome retains its original copy.",
"action": "Refresh RepoHome's default expansion when a rebuild completes, or fetch the current lock data when Add References opens.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.2",
"severity": "P1",
"tag": null,
"file": "src/components/collections/AddReferencesDialog.jsx",
"line": 235,
"claim": "The expression prefix check applies the repository lock hint to explicitly versioned concepts and mappings.",
"scenario": "Pick a source locked to v1, switch to Expression, and enter `/orgs/O/sources/S/concepts/c1/new/` for a concept revision held only by v2. The path still starts with the generated concepts prefix, so the dialog says v1. The API resolves the named concept revision against v2 and reports v2 on the saved reference.",
"action": "Parse the expression before showing the lock hint. Suppress the hint for resource-versioned expressions unless their repository version can be resolved.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.3",
"severity": "P2",
"tag": null,
"file": "src/components/common/CascadeSelector.jsx",
"line": 65,
"claim": "The cascade help promises additions even when the reference is an exclusion.",
"scenario": "In Add References, select Exclude and choose All Source Concepts & Mappings for a concept whose child and mappings are already in the expansion. The help says those resources are added, but the API uses the cascaded results to remove them from the expansion.",
"action": "Describe the scope of the cascade with wording that works for both actions, or use separate help text for Include and Exclude.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.4",
"severity": "P2",
"tag": null,
"file": "src/components/common/__tests__/cascadeRequest.test.js",
"line": 44,
"claim": "The test that says the cascade choice explains what it adds only checks that translation entries exist.",
"scenario": "Remove the helper text from CascadeSelector and leave the preset metadata and translations in place. The test still passes even though selecting All Source Concepts & Mappings shows no explanation.",
"action": "Add a component test that selects the preset and asserts that its explanation is rendered.",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Answer to pass 1, all in 4eafa30:
The same commit also fixes one I found myself: the version picked for one repository stayed for the next one that has no release. |
|
Codex review, pass 2 (codex-cli 0.171.0, commit 4eafa30) 3 findings: P1 3.
findings.json{
"reviewer": "codex-cli 0.171.0",
"perspective": "defects",
"mode": "verify",
"commit": "4eafa30b8",
"verdict": "findings",
"prior": [
{
"id": "F1.1",
"status": "unresolved"
},
{
"id": "F1.2",
"status": "resolved"
},
{
"id": "F1.3",
"status": "resolved"
},
{
"id": "F1.4",
"status": "resolved"
}
],
"findings": [
{
"id": "F2.1",
"severity": "P1",
"tag": null,
"file": "src/components/collections/AddReferencesDialog.jsx",
"line": 321,
"claim": "Add References still presents a stale lock as current while the expansion refresh is pending or after it fails.",
"scenario": "Rebuild the default expansion from v1 to v2, then open Add References without reloading the page. If the expansion detail request is slower than the source picker or fails, the dialog says “Resolves to v1.” and lets the user submit. The API resolves the reference to v2.",
"action": "Show an unpinned resolution version only after the current expansion refresh succeeds. Show a loading or unavailable state otherwise, and ignore responses from earlier dialog openings.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F2.2",
"severity": "P1",
"tag": null,
"file": "src/components/collections/AddReferencesDialog.jsx",
"line": 154,
"claim": "A late version-list response for the previous repository can clear the current repository’s pin.",
"scenario": "Pick a source with no releases, then switch to a second source before the first request returns. Pin the second source to v2 after its versions load. If the first request now returns an empty list, it clears v2 while leaving “Pin to a specific version” checked. The submitted expression omits v2 and can resolve to the collection’s v1 lock.",
"action": "Reset version state when the repository changes and apply version-list responses only to the repository selection that requested them.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F2.3",
"severity": "P1",
"tag": null,
"file": "src/components/collections/ReferenceVersionHint.jsx",
"line": 11,
"claim": "A valid expression for the selected repository loses its resolution hint when its resource type differs from the dropdown.",
"scenario": "Pick a source locked to v1, leave Reference Type set to Concepts, and paste `/orgs/O/sources/S/mappings/m1/` in Expression mode. The API accepts the mapping expression and resolves it to v1. The dialog hides the hint because it checks for a `/concepts/` prefix.",
"action": "Read the resource type from the expression and match the repository and version independently of the Reference Type dropdown. Keep suppressing hints for unpinned resource revisions.",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Answer to pass 2, all in 996e2bb:
In a browser: an expansion that answers four seconds late, one that fails, a late empty list of versions after another repository was picked and pinned, and a mapping expression with the type on Concepts. |
|
Codex review, pass 3 (codex-cli 0.171.0, commit 996e2bb) 5 findings: P1 3, P2 2.
findings.json{
"reviewer": "codex-cli 0.171.0",
"perspective": "defects",
"mode": "verify",
"commit": "996e2bbdb",
"verdict": "findings",
"prior": [
{
"id": "F1.1",
"status": "resolved"
},
{
"id": "F1.2",
"status": "resolved"
},
{
"id": "F1.3",
"status": "resolved"
},
{
"id": "F1.4",
"status": "resolved"
},
{
"id": "F2.1",
"status": "resolved"
},
{
"id": "F2.2",
"status": "resolved"
},
{
"id": "F2.3",
"status": "resolved"
}
],
"findings": [
{
"id": "F3.1",
"severity": "P1",
"tag": null,
"file": "src/components/repos/RepoHome.jsx",
"line": 810,
"claim": "The dialog refreshes the expansion at the page's cached URL even after that expansion stops being the default.",
"scenario": "Leave HEAD's References tab open while a second browser tab sets a different default expansion. The old expansion still exists and locks a source to v1. The new default locks it to v2. Open Add References in the first tab. It fetches the old expansion and says v1, but the API adds the unpinned reference against v2.",
"action": "Read HEAD's current default expansion URL when the dialog opens, then fetch the expansion at that URL.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F3.2",
"severity": "P1",
"tag": null,
"file": "src/components/collections/AddReferencesDialog.jsx",
"line": 129,
"claim": "The dialog treats an expansion that is still rebuilding as a settled lock.",
"scenario": "Start rebuilding a default expansion whose lock will move from v1 to v2. Dismiss the rebuild dialog and open Add References before the rebuild finishes. The expansion request can return v1 with is_processing set. Leave Add References open until the rebuild finishes. It still says v1, but submitting then resolves to v2.",
"action": "Wait for the expansion to finish processing and refresh its details before displaying an unpinned resolution version.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F3.3",
"severity": "P1",
"tag": null,
"file": "src/components/collections/AddReferencesDialog.jsx",
"line": 251,
"claim": "Add by IDs can submit an unversioned reference while the pin checkbox is checked.",
"scenario": "Pin source A to v2, enter a concept ID, and switch to source B, which has the same concept ID and a v2 release but is locked to v1. While B's versions are loading, the dialog keeps Pin to a specific version checked and clears the selected version. Clicking Add at that point submits a versionless expression that resolves to v1.",
"action": "For Add by IDs, disable submission while the pin checkbox is checked and the selected repository has no selected version.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F3.4",
"severity": "P2",
"tag": null,
"file": "src/components/collections/ReferenceVersionHint.jsx",
"line": 26,
"claim": "An unavailable toggle response makes the dialog report the latest release even when server-side locking is enabled.",
"scenario": "The startup toggles request returns 503 while the collection, expansion, and source version requests succeed. The expansion locks the source to v1 and v2 is the latest release. The dialog treats the missing toggle as disabled and says v2. The API still resolves the reference to v1.",
"action": "Keep the unpinned hint pending or unavailable when the toggle request has no successful result. Use the release fallback after confirming locking is disabled or the repository has no lock.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F3.5",
"severity": "P2",
"tag": null,
"file": "src/components/collections/AddReferencesDialog.jsx",
"line": 450,
"claim": "The new cascade help describes additions for mapping references that the API does not cascade.",
"scenario": "Select Mappings, enter a mapping ID, and choose All Source Concepts & Mappings. The dialog says the preset also covers mappings, answers, set members, and child concepts. The API discards the cascade for the mapping expression and adds only the selected mapping.",
"action": "Make the cascade selector and its help reflect whether the submitted expressions include concepts that the API can cascade.",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Answer to pass 3. The fixes are in 7e9b28b:
In a browser: another default set while the page is open, a running rebuild, a collection or an expansion that can't be read, no default expansion, and a pin carried over to a source whose versions come late. |
|
Simplification review (claude subagent, commit 7e9b28b) 2 suggestions.
findings.json{
"perspective": "simplify",
"mode": "full",
"reviewer": "claude subagent",
"commit": "7e9b28b69",
"verdict": "findings",
"findings": [
{
"id": "S1",
"tag": "shrink",
"file": "src/components/collections/ReferenceVersionHint.jsx",
"line": 28,
"claim": "getLatest is a closure with one caller, used once in the JSX. Inline it as a nested expression: `loading || !expansion ? '…' : releases ? releases[0] || 'HEAD' : t('reference.latest_released')`. All the cases the tests pin still hold. The gain is small, so leaving it is also fine.",
"action": "Replace the 4-line helper with one inline expression in the Resolves to line.",
"lines_delta": -3,
"confidence": 0.4,
"severity": null,
"scenario": null
},
{
"id": "S2",
"tag": "dup-test",
"file": "src/components/common/__tests__/CascadeSelector.test.js",
"line": 22,
"claim": "The `assert.equal(getDescription('none'), undefined)` line runs inside the 4-language loop, so it repeats the same check 4 times. Language doesn't change what it proves. Run it once, outside the loop. The `texts` Set and `size === 4` check only proves the four translations differ. If you want to keep that, keep it, but it is not behavior.",
"action": "Move the 'none' assertion out of the loop. Optionally drop the texts Set and its size assertion.",
"lines_delta": -3,
"confidence": 0.5,
"severity": null,
"scenario": null
}
]
} |
|
Answers to the simplification review:
|
|
Codex check of commits 996e2bb..7e9b28b (codex-cli 0.171.0) 2 findings: P1 1, P2 1.
findings.json{
"reviewer": "codex-cli 0.171.0",
"perspective": "defects",
"mode": "final",
"commit": "7e9b28b69",
"verdict": "findings",
"prior": [
{
"id": "F1.1",
"status": "resolved"
},
{
"id": "F1.2",
"status": "resolved"
},
{
"id": "F1.3",
"status": "resolved"
},
{
"id": "F1.4",
"status": "resolved"
},
{
"id": "F2.1",
"status": "resolved"
},
{
"id": "F2.2",
"status": "resolved"
},
{
"id": "F2.3",
"status": "resolved"
},
{
"id": "F3.1",
"status": "regressed"
},
{
"id": "F3.2",
"status": "regressed"
},
{
"id": "F3.3",
"status": "resolved"
},
{
"id": "F3.4",
"status": "unresolved"
},
{
"id": "F3.5",
"status": "unresolved"
}
],
"findings": [
{
"id": "FC.1",
"severity": "P1",
"tag": null,
"file": "src/components/collections/AddReferencesDialog.jsx",
"line": 132,
"claim": "Opening Add References during a rebuild keeps the unpinned version hint hidden after the rebuild finishes.",
"scenario": "Open Add References during a rebuild that leaves source S locked to v1. Keep the dialog open until the rebuild finishes, then select S. The API resolves an unpinned reference to v1, but the dialog still holds the processing response from when it opened and shows no version until it is reopened.",
"action": "When the expansion is processing, check again until it finishes and refresh the lock data. Add a dialog test that covers the transition from processing to ready.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "FC.2",
"severity": "P2",
"tag": null,
"file": "src/components/collections/AddReferencesDialog.jsx",
"line": 75,
"claim": "The new default-expansion lookup can strip the collection's owner from the request URL.",
"scenario": "Open Add References for collection C under an organization named HEAD and select an unpinned source locked to v1. The new lookup turns `/orgs/HEAD/collections/C/HEAD/` into `/orgs/collections/C/HEAD/`, so it cannot read C's default expansion and the version hint disappears. The previous revision read the expansion URL from the loaded collection and displayed v1.",
"action": "Use the existing `dropVersion` helper to remove the trailing version segment by position.",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Answer to the closing check. Both are accepted, so there's no further commit:
|
Closes OpenConceptLab/ocl_issues#3046
Add References on a collection's page says which version of the picked source or collection a reference resolves to. For a reference that names no version it always said the latest release, also when the collection is locked to another version. It now says the version the collection is locked to.
What changes
expansionRepoVersions.js), so the dialog and the collection's page say the same. The icon and the tooltip come from there too. The dialog asks the collection for its default expansion and reads that each time it opens, because a rebuild, another reference or another default changes the locks. It shows "…" until it has them. If they can't be read, or the expansion is being rebuilt, an unpinned reference shows no "Resolves to".How it was checked
With #94
The two don't conflict. That one changes the other dialog, Add to Collection. They share
CascadeSelector.jsx, in different lines.🤖 Generated with Claude Code
https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN