Skip to content

OpenConceptLab/ocl_online#892 | Expansion health: a release that references name on purpose isn't a problem - #1134

Open
paynejd wants to merge 8 commits into
ocl_issues-3003-health-namesfrom
ocl_online-892-named-release
Open

paynejd wants to merge 8 commits into
ocl_issues-3003-health-namesfrom
ocl_online-892-named-release

Conversation

@paynejd

@paynejd paynejd commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

For OpenConceptLab/ocl_online#892. It doesn't close it: the docs page is on OpenConceptLab/ocl-docs#83, and stored health is computed again in the release's steps.

Two reasons in an expansion's health made it unhealthy although a reference names its release on purpose, so its owner couldn't clear them. Now they're given only where OCL itself chose the versions.

What changes

The expansion Before Now
OCL chose two or more versions of a repository, for references that name none duplicate_repo_versions The same
OCL chose one version, and references name others duplicate_repo_versions The repository is in multiple_named_versions, which is information
References name all the versions In multiple_named_versions The same
A mapping changed between two releases, and references hold it through both. Those to the older release name it ambiguous_members The mapping counts as a member of the newer release
The same, but the expansion's system-version names the older release for a reference that names none, as a release made with a lock writes it ambiguous_members The mapping counts as a member of the newer release: a version that the expansion's system-version names counts as named
The same, but OCL chose the older release for a reference that names none, without system-version ambiguous_members The same: a rebuild can clear it
  • Why the mapping isn't a disagreement: an expansion keeps a mapping once, in its newest version, so a reference that names an older release can never hold that one. The same goes for two releases of a value set. If the named release has been deleted, the reason stays.
  • Concepts aren't changed. A concept that two named releases hold in different versions is still ambiguous_members where an expansion keeps only the newer one.
  • "Chose" and "name" are what the build recorded: evaluated_source_versions and evaluated_collection_versions against the explicit_ ones. Lists from before the two were told apart need rebuild_expansion_version_lists first, as backfill_expansion_health says.
  • A version that the expansion's system-version names counts as named, for the mapping rule and a reference with a system. A release made with a lock writes its locks into system-version, and every rebuild takes them again, so a rebuild can't move it. An entry without a version follows the latest release, so it doesn't count.
  • Rules version 5, so health stored under the earlier rules is computed again at the next backfill_expansion_health. It comes after OpenConceptLab/ocl_issues#3003 | Expansion health names the repositories and versions its reader can view #1125, which is version 4, so this pull request is based on that one's branch until it's merged.

How it was checked

🤖 Generated with Claude Code

https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN

paynejd and others added 2 commits December 4, 2026 07:30
…rences name on purpose isn't a problem

A repository is recorded twice only when OCL itself chose two or more of its versions. A mapping is a member once, in its newest version, so a reference that names an older release no longer disagrees about it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
…d mapping only while it's there, value sets' too

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
@paynejd
paynejd requested a review from snyaggarwal December 4, 2026 12:44
@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Codex review, pass 1 (codex-cli 0.171.0, commit 7f2546d)

3 findings: P1 2, P2 1.

  • F1.1 (P1) health.py:14: The nightly health run skips stored results computed under rule 4.
  • F1.2 (P1) health.py:393: The mapping exception hides a mismatch when an explicitly named release has been deleted.
  • F1.3 (P2) health.py:394: Two explicitly named value-set releases can still trigger ambiguous_members for a legitimately deduplicated mapping.
findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "full",
  "commit": "7f2546d8",
  "verdict": "findings",
  "prior": [],
  "findings": [
    {
      "id": "F1.1",
      "severity": "P1",
      "tag": null,
      "file": "core/collections/health.py",
      "line": 14,
      "claim": "The nightly health run skips stored results computed under rule 4.",
      "scenario": "A frozen collection has a current rule-4 result with a false duplicate_repo_versions mark and already-correct version lists. The nightly selector skips it because health_is_current is true, and the worker checks the same flag. The mark persists after the next scheduled health run.",
      "action": "Have the nightly selector and worker treat older rules versions as stale. Test a current rule-4 result that loses its mark on the next scheduled run.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F1.2",
      "severity": "P1",
      "tag": null,
      "file": "core/collections/health.py",
      "line": 393,
      "claim": "The mapping exception hides a mismatch when an explicitly named release has been deleted.",
      "scenario": "Two references name source releases v1 and v2, both of which hold the same mapping row. After v1 is deleted, its saved reference still points to that mapping and can no longer resolve its release. It yields MISMATCH while v2 yields RELEASE. The new rule discards the mismatch and reports the expansion healthy.",
      "action": "Suppress the mismatch only when the named release still resolves and holds the older mapping row contributed by that reference. Preserve a health reason for the deleted release.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F1.3",
      "severity": "P2",
      "tag": null,
      "file": "core/collections/health.py",
      "line": 394,
      "claim": "Two explicitly named value-set releases can still trigger ambiguous_members for a legitimately deduplicated mapping.",
      "scenario": "Two named value-set releases hold different rows of the same mapping, and the outer expansion keeps the newer row. A later source edit removes that row from source HEAD, and no source release holds it. The older value-set reference now yields INTERIM while the newer value-set reference yields RELEASE, so the expansion becomes unhealthy even though both named releases still hold the rows they contributed.",
      "action": "Use membership in the named value-set releases to recognize the deduplicated mapping. Add coverage where the retained row is held only by the newer value-set release.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Answer to pass 1:

  • F1.1 (P1, the nightly run): accepted, as it's how every rules version has gone out. The nightly job takes only health that's marked as out of date. Health stored under earlier rules is what backfill_expansion_health is for: it selects on the rules version, and it's the health run that the release's steps name.
  • F1.2 (P1, a named release that was deleted): fixed in 9db3cdb. A reference counts as naming another release only while what it names is there. A new test was seen failing first: the mark was the only one left.
  • F1.3 (P2, value set releases): fixed in 9db3cdb. What counts is that a release which other references name holds the mapping, whatever the older one's "not held" is called. A new test covers value sets, also when no release of the source holds the newer version.

@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Codex review, pass 2 (codex-cli 0.171.0, commit 9db3cdb)

2 findings: P1 1, P2 1.

  • F2.1 (P1) health.py:449: A named value-set release can stop supplying a mapping without health reporting the mismatch.
  • F2.2 (P2) health.py:421: A reference that names both a source release and a mapping version can still trigger ambiguous_members after valid deduplication.
findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "verify",
  "commit": "9db3cdbd",
  "verdict": "findings",
  "prior": [
    {
      "id": "F1.1",
      "status": "resolved"
    },
    {
      "id": "F1.2",
      "status": "resolved"
    },
    {
      "id": "F1.3",
      "status": "resolved"
    }
  ],
  "findings": [
    {
      "id": "F2.1",
      "severity": "P1",
      "tag": null,
      "file": "core/collections/health.py",
      "line": 449,
      "claim": "A named value-set release can stop supplying a mapping without health reporting the mismatch.",
      "scenario": "Two references name value-set releases that both supply the same mapping row. The owner changes the first release's default expansion to one that omits the mapping. The outer expansion still has the saved reference and mapping row. On recompute, the first release still resolves, so health discards its mismatch and reports the mapping as released.",
      "action": "Require the named release to still hold an older mapping row contributed by that reference before suppressing its judgement. Add a Django regression test for the default expansion change.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F2.2",
      "severity": "P2",
      "tag": null,
      "file": "core/collections/health.py",
      "line": 421,
      "claim": "A reference that names both a source release and a mapping version can still trigger `ambiguous_members` after valid deduplication.",
      "scenario": "One reference names a source release and pins the older mapping row it holds. A second reference names a value-set release that holds the newer row. The outer expansion keeps the newer row, which is no longer in source HEAD and was never in a source release. The pinned reference yields `INTERIM` and is absent from `_resolved`, so health keeps its judgement alongside `RELEASE` and reports `ambiguous_members`.",
      "action": "Apply the mapping deduplication exception to a pinned reference when its explicitly named source release still holds the older row it contributed. Add a Django test for this combination.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Answer to pass 2. No code changed, so there's no commit after the one this pass reviewed:

  • F2.1 (reported as P1, I take it as P3): accepted, not changed. I built the case: two references name value set releases that hold the same mapping, and the first one switches to a default expansion without it. A rebuild keeps the mapping, from the other release, and the expansion is healthy before and after. So the mapping is a right member, and a mark would be one that nothing needs doing about. It differs from F1.2, where the named release is gone.
  • F2.2 (P2): accepted, not changed. It needs a reference to one exact mapping version, and a newer version that's in a value set's release but was never in one of its source. The mark stays as it is today.

@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Simplification review (claude subagent, commit 9db3cdb)

No suggestions: nothing is worth cutting. The reasons are in the notes below.

findings.json
{
  "perspective": "simplify",
  "mode": "full",
  "reviewer": "claude subagent",
  "commit": "9db3cdbd",
  "verdict": "clean",
  "findings": [],
  "notes": "Nothing is worth cutting. get_member_class replaces the old if/elif chain in classify, so it adds one line net and takes a local off classify. names_versions was pulled out of get_inconsistent_repositories and now has two callers. names_found_versions has one caller, but F1.2 made it necessary and inlining it would push the judgements.add line past 120 characters. The chosen_ids set replaced the from_unversioned boolean and is used in both duplicates and multiple_named. Each new test pins a table row or a pass-1 fix (F1.2 for the deleted release, F1.3 for value sets). The test with a real build from references overlaps the hand-built ones, but it is the only one that runs the build and also checks multiple_named_versions. The value-set duplicate_repo_versions test is the closest to a repeat of the source one, because get_repository_versions is shared. It is the only test that covers the collection relations in that function, so I kept it."
}

…'t need a Celery broker

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
@paynejd

paynejd commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

Codex check of commits 9db3cdb..fb7f58d (codex-cli 0.171.0)

Clean: no findings.

findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "final",
  "commit": "fb7f58dc",
  "verdict": "clean",
  "prior": [],
  "findings": []
}

paynejd and others added 4 commits December 4, 2026 22:16
…ion gives a reference counts as named, so a changed mapping isn't a disagreement

A release made with a lock writes its locks into system-version, and every rebuild takes them again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
…s its version counts, and only for a reference with a system

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
… entry names its version as the build does

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
…ion as the resolver reads a reference's system

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
@paynejd

paynejd commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

Codex check of commits fb7f58d..f9f241d (codex-cli 0.171.0, commit f9f241d)

2 findings: P1 1, P2 1.

  • FC.1 (P1) health.py:454: A versionless system-version entry suppresses mapping disagreements as though it pinned a release.
  • FC.2 (P2) health.py:462: A collection URL in system-version can suppress a disagreement for a value-set reference even though the parameter does not control value-set resolution.
findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "final",
  "commit": "f9f241db",
  "verdict": "findings",
  "prior": [],
  "findings": [
    {
      "id": "FC.1",
      "severity": "P1",
      "tag": null,
      "file": "core/collections/health.py",
      "line": 454,
      "claim": "A versionless system-version entry suppresses mapping disagreements as though it pinned a release.",
      "scenario": "Set system-version to /orgs/O/sources/S/. An unversioned reference takes the old mapping from v1, the latest non-retired release, while a reference explicitly naming retired v2 supplies the newer mapping. Health drops ambiguous_members. Publishing v3 would make a rebuild evaluate the unversioned reference against v3.",
      "action": "Add a release to versions_given only when the original entry explicitly selects it. Cover a bare source URL alongside the pinned case.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "FC.2",
      "severity": "P2",
      "tag": null,
      "file": "core/collections/health.py",
      "line": 462,
      "claim": "A collection URL in system-version can suppress a disagreement for a value-set reference even though the parameter does not control value-set resolution.",
      "scenario": "An unversioned reference to collection C supplies an old mapping from v1, and a named source release supplies the newer mapping. With system-version set to /orgs/O/collections/C/|v1, the shared resolver returns C/v1. The build still evaluates the first reference through value-set resolution, but health drops ambiguous_members because the URL and version match.",
      "action": "Apply the system-version exception only to references evaluated against source versions.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

@paynejd

paynejd commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

Answers to the check of fb7f58d..f9f241d

  • FC.1: fixed in 8f6e5a4, and finished in 34772ca after the next checks. Only an entry that names its version (url|version, or an OCL path with a version) counts, so a bare source URL, which follows the latest release, doesn't. A test has your case: v2 retired, the bare entry gives v1, and the disagreement stays.
  • FC.2: fixed in 8f6e5a4. The exception applies only to a reference with a system, which is what system-version steers. A test has a value-set reference with a collection URL in system-version: the disagreement stays.

@paynejd

paynejd commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

Codex check of commits f9f241d..8f6e5a4 (codex-cli 0.171.0, commit 8f6e5a4)

1 finding: P2 1.

  • FC.3 (P2) health.py:456: Health and the build resolver disagree on which OCL paths pin a release.
findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "final",
  "commit": "8f6e5a44d6692da2698ffa1faf50306674709387",
  "verdict": "findings",
  "prior": [
    {
      "id": "FC.1",
      "status": "unresolved"
    },
    {
      "id": "FC.2",
      "status": "resolved"
    }
  ],
  "findings": [
    {
      "id": "FC.3",
      "severity": "P2",
      "tag": null,
      "file": "core/collections/health.py",
      "line": 456,
      "claim": "Health and the build resolver disagree on which OCL paths pin a release.",
      "scenario": "Set system-version to /orgs/O/sources/S/v1/?q=a. The build strips the query and pins v1. If that reference contributes the old mapping and a reference naming v2 contributes the newer mapping, health now incorrectly reports ambiguous_members. The same check leaves FC.1 open for /orgs/sources/sources/S/. The build follows the latest release, but health treats the bare source path as pinned and suppresses the disagreement.",
      "action": "Normalize relative URLs as the build resolver does and identify the version by its position in the repository path. Add regression cases for both URLs.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

@paynejd

paynejd commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

Answers to the check of f9f241d..8f6e5a4

  • FC.3: fixed in a8ce0b7, and FC.1 for paths with a version. FC.1 for an entry that resolves to HEAD is finished in 34772ca. Health now reads an entry as the build does in Expansion.get_recorded_system_version: it names its version when it has |version, or when its path, without the query, goes beyond its repository's URL. Only entries that resolved count. The tests now cover |v1, v1/ and v1/?q=a (each counts), and a bare entry for a source of an organization named sources (it doesn't count).

@paynejd

paynejd commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

Codex check of commits 8f6e5a4..a8ce0b7 (codex-cli 0.171.0, commit a8ce0b7)

1 finding: P2 1.

  • FC.4 (P2) health.py:456: Query normalization can make a versionless system-version entry look pinned when it resolves to HEAD.
findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "final",
  "commit": "a8ce0b7f08a36c1761d489fd502f7839a0419319",
  "verdict": "findings",
  "prior": [
    {
      "id": "FC.1",
      "status": "unresolved"
    },
    {
      "id": "FC.2",
      "status": "resolved"
    },
    {
      "id": "FC.3",
      "status": "resolved"
    }
  ],
  "findings": [
    {
      "id": "FC.4",
      "severity": "P2",
      "tag": null,
      "file": "core/collections/health.py",
      "line": 456,
      "claim": "Query normalization can make a versionless system-version entry look pinned when it resolves to HEAD.",
      "scenario": "Set system-version to `/orgs/sources/sources/S/?q=/test` with all releases of S retired. The resolver strips the query and selects HEAD. If an unversioned reference contributes the HEAD mapping row and an explicit reference to retired v2 contributes the versioned row that survives deduplication, health now suppresses `ambiguous_members`. The parser compares the bare path with HEAD's `versioned_object_url`, which incorrectly drops `S/` when the organization is named `sources`. The same misclassification still occurs without the query, leaving FC.1 open for HEAD fallback.",
      "action": "After stripping the query, use the resolver's positional check for a version segment. Add regression cases for a bare URL that resolves to HEAD, both with and without a query.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

@paynejd

paynejd commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

Answers to the check of 8f6e5a4..a8ce0b7

  • FC.1 and FC.4: fixed in 34772ca. Health now reads an entry as the resolver reads a reference's system (CollectionReference.names_repo_version): |version, or a relative URL whose fifth segment, query dropped, is a version other than HEAD. It no longer compares with versioned_object_url, which misreads a source of an organization named sources. A test has a bare entry that resolves to HEAD in such an organization, with and without a query: it names no version.

@paynejd

paynejd commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

Codex check of commits a8ce0b7..34772ca (codex-cli 0.171.0, commit 34772ca)

Clean: no findings.

findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "final",
  "commit": "34772ca8a69a98c38b10a37ffcfd7c11ea5988e4",
  "verdict": "clean",
  "prior": [
    {
      "id": "FC.1",
      "status": "resolved"
    },
    {
      "id": "FC.4",
      "status": "resolved"
    }
  ],
  "findings": []
}

…try in its loop, as pylint asks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant