Skip to content

OpenConceptLab/ocl_online#654 | Map projects go by their owner's limits and permissions, and the Owner field says which organizations can own one - #147

Draft
paynejd wants to merge 8 commits into
ocl_online-714-automatch-inputsfrom
OpenConceptLab/ocl_online#654-owner-capabilities
Draft

paynejd wants to merge 8 commits into
ocl_online-714-automatch-inputsfrom
OpenConceptLab/ocl_online#654-owner-capabilities

Conversation

@paynejd

@paynejd paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member

On an organization's map project, the Mapper uses what the API says its members can use there, instead of the signed-in person's own limits and permissions. When someone creates a map project, the Owner field shows which of their organizations can own it.

What changes

  • The open project's owner decides. On an organization's project the Mapper asks the API GET /capabilities/orgs/<org>/ and goes by its capabilities and permissions: the rows per project, the custom algorithms, the AI output language, the usage chip and the AutoMatch dialog. The AutoMatch checkpoints (autoMatchCheck.js) get that same user.
  • The Owner field asks GET /capabilities/mapper.projects/owners/. An organization that can't own the project is listed, with a lock, and can't be chosen. Its tooltip is the reason and link the API sends. Someone who can't create another project of their own starts with an organization that can own one.
  • The rows chip says "2,000 rows per project", without "Preview", in every language.

With an API that doesn't have these routes, the open one included, nothing changes: the person's own limits and permissions apply everywhere, and every organization in the Owner field can be chosen. oclapi2 still decides on every save, so the Mapper only shows what it will answer.

Components: the Owner field is the existing NamespaceDropdown. The lock is the existing LockMark, and the tooltip is MUI's Tooltip, as elsewhere in the Mapper.

Order: stacked on #145. It can go live before or after the API routes.

Checked: ESLint as CI runs it and 837 tests. In a local Mapper at 1440 and 390 pixels wide: the Owner field by mouse, touch and keyboard, an organization's project beside a personal one, the AutoMatch dialog, and an API without the routes.

Refs OpenConceptLab/ocl_online#654 and OpenConceptLab/ocl_online#716, which stay open.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AaZ4qTEw8c6qZh5C69F1V4

paynejd and others added 3 commits December 3, 2026 02:18
…ts and permissions, and the Owner field says which organizations can own one

OpenConceptLab/ocl_online#716

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qTEw8c6qZh5C69F1V4
…oject may have, with no "Preview"

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qTEw8c6qZh5C69F1V4
…s count as the person's own; the reason shows by keyboard too, and the usage chip's title says only what it lists

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

paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Codex review, pass 1 (codex-cli 0.171.0, commit 6f38d70): 8 findings (P1 ×8).

  • F1.1: while a new project's organization is being asked about, the person's own row limit applies.
  • F1.2: AutoMatch can run a custom algorithm that the organization doesn't permit.
  • F1.3: an organization chosen before the availability answer can stay chosen after it says no.
  • F1.4: the arrow keys reach a locked organization without showing its reason.
  • F1.5: an existing organization's project is held to the permission to create one.
  • F1.6: the AI usage request checks the person's own permission.
  • F1.7: the project list keeps an old availability answer after a delete.
  • F1.8: the usage chip's tooltip calls an organization's limits "your one-time allowance".

Replies (d878017)

  • F1.1: fixed. The file can't be chosen until the answer is in, so the notice and the rows go by the right limit.
  • F1.2: accepted. The API's answer includes the person's own permissions, so an organization can't take one away. An unsaved custom algorithm calls its own server from the person's browser, as before this change, and the API refuses to save it.
  • F1.3: no change. Once the answer is in, the form goes by the chosen organization's permissions, so Save is off and the form says why. The API has the last word on a request sent before that.
  • F1.4: fixed. The reason shows when the arrow keys reach the option, and Enter doesn't choose it. The link stays a pointer's, since the focus stays in the field.
  • F1.5: fixed. Only a new project needs the permission.
  • F1.6: no change. The organization's answer never adds the permission to use the OCL AI Assistant: that stays the person's own.
  • F1.7: no change. The answer says which organizations may own a project, not which have room, so a delete doesn't change it.
  • F1.8: fixed. The title is "Mapper usage", in every language.

One more fix from the review of the private package: until a project is saved, no request can name it, so its matching counts as the person's own. The chip and the AutoMatch dialog now show that.

838 tests pass, ESLint is clean, and I checked the keyboard in a browser.

findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "full",
  "commit": "6f38d70",
  "verdict": "findings",
  "prior": [],
  "findings": [
    {
      "id": "F1.1",
      "severity": "P1",
      "tag": null,
      "file": "src/components/map-projects/MapProject.jsx",
      "line": 6633,
      "claim": "New organization projects apply personal row limits while the organization lookup is pending.",
      "scenario": "A user with a 50-row personal cap selects an organization with a 500-row cap and uploads a 200-row CSV before the capabilities response arrives. The loader only covers saved projects, so the grid and AutoMatch initially use 50 rows. The file reader also captures that personal cap and can show the wrong import notice even if the organization response arrives before parsing finishes.",
      "action": "Gate import and row actions on the selected owner's lookup, and resolve the cap when the parsed rows are applied.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F1.2",
      "severity": "P1",
      "tag": null,
      "file": "src/components/map-projects/MapProject.jsx",
      "line": 812,
      "claim": "AutoMatch can run a custom algorithm that the organization does not permit.",
      "scenario": "A user adds an externally hosted custom algorithm under their personal owner, then switches the draft to an organization whose response omits the custom-algorithm permission. The configuration form flags the algorithm, but AutoMatch still lists it as runnable and can send the spreadsheet rows to its external endpoint.",
      "action": "Apply the effective custom-algorithm permission when determining which algorithms can retrieve candidates in bulk and for individual rows.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F1.3",
      "severity": "P1",
      "tag": null,
      "file": "src/components/common/NamespaceDropdown.jsx",
      "line": 100,
      "claim": "An organization selected before the availability response can stay selected after the API marks it unavailable.",
      "scenario": "A member with organization-project permission selects an organization while the owners request is pending. The response then marks it unavailable because its project quota is full. The field still shows that organization as the selected owner, and Save can submit a request the API rejects.",
      "action": "Revalidate the selected owner when availability arrives and prevent creation under a known-unavailable owner through every save entry point.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F1.4",
      "severity": "P1",
      "tag": null,
      "file": "src/components/common/NamespaceDropdown.jsx",
      "line": 49,
      "claim": "Arrow-key navigation reaches an unavailable organization without exposing its tooltip or link.",
      "scenario": "A keyboard user arrows to an unavailable organization. MUI highlights the option through aria-activedescendant and keeps focus on the input. The Tooltip never opens, leaving the reason visually hidden and the link unavailable to the keyboard.",
      "action": "Expose the API's reason when the option is highlighted by keyboard and provide a keyboard-accessible way to follow its link while keeping the option unselectable.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F1.5",
      "severity": "P1",
      "tag": null,
      "file": "src/components/map-projects/MapProject.jsx",
      "line": 6556,
      "claim": "The organization-project creation permission can disable Save and close on an existing project.",
      "scenario": "A member can edit an existing organization project and has `mapper_org_projects` in their personal permissions, but the organization response omits that creation permission. The form now disables Save and close for an ordinary configuration edit even though the API allows the update.",
      "action": "Scope the organization creation check to new projects and use the existing edit authorization for saved projects.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F1.6",
      "severity": "P1",
      "tag": null,
      "file": "src/common/utils.js",
      "line": 298,
      "claim": "The AI usage request still checks the personal permission.",
      "scenario": "A member has AI Assistant permission on an organization project but lacks it personally. On opening the project with no cached report, the refresh skips the usage request. The usage chip and AutoMatch checkpoints receive no usage report even though the project grants AI access.",
      "action": "Use the effective project user to authorize project-specific usage refreshes, including when the organization lookup first grants access.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F1.7",
      "severity": "P1",
      "tag": null,
      "file": "src/components/map-projects/MapProjects.jsx",
      "line": 76,
      "claim": "The project list keeps using an outdated organization availability response after a project is deleted.",
      "scenario": "A member is at their personal project limit, and their only organization is initially full. They delete an organization project from the list, freeing a slot. The delete refresh updates personal capabilities only, so New Project still blocks on the old organization response without asking the API again.",
      "action": "Refresh owner availability after a successful deletion and avoid blocking creation on the previous response while that refresh is pending.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F1.8",
      "severity": "P1",
      "tag": null,
      "file": "src/components/map-projects/MapperQuotaChip.jsx",
      "line": 66,
      "claim": "The usage chip describes finite organization limits as the user's one-time preview allowance.",
      "scenario": "The API returns a finite row cap and recurring match allowance for an organization project. Hovering over the chip labels those values “Your Mapper preview (one-time allowance),” although the API supplied no such description.",
      "action": "Use neutral metric labels and display allowance or plan wording only when supplied by the API.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

🤖 Generated with Claude Code

…, goes by which organizations can own a project, and its notices name no preview

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

paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Codex review, pass 2 (codex-cli 0.171.0, commit d878017): 5 findings (P1 ×5).

  • F2.1: while a newly chosen owner's answer is pending, a draft's rows go by the person's own row limit, and the keyboard can still open the file picker.
  • F2.2: a draft can keep an organization that the owners list marks as unavailable.
  • F2.3: if asking about an organization again fails, its earlier answer stays.
  • F2.4: Create Similar refuses someone at their own project limit while the owners list is pending.
  • F2.5: the upload notice calls every project with a row limit a "Preview" project.

Replies (b4d72ab)

  • F2.1: fixed. Until the answer is in, no row is left out, the loader covers a draft that has rows, and the file input is off for the keyboard too.
  • F2.2: fixed. When the list knows the chosen organization, the form goes by it: Save is off for one that can't own a project. It also works the other way: if asking about the organization itself fails, the list still says it can.
  • F2.3: no change, on purpose. The answer belongs to that organization and is from the same visit, and the API checks each request. Dropping it would change the limits under someone's work each time a request fails.
  • F2.4: fixed. The new project's page decides, as from the project list.
  • F2.5: fixed in every language, with the three other notices on this form that said "preview".

838 tests pass, ESLint is clean, and I checked a slow answer and a failed one in a browser.

findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "verify",
  "commit": "d878017",
  "verdict": "findings",
  "prior": [
    {"id": "F1.1", "status": "unresolved"},
    {"id": "F1.2", "status": "resolved"},
    {"id": "F1.3", "status": "unresolved"},
    {"id": "F1.4", "status": "resolved"},
    {"id": "F1.5", "status": "resolved"},
    {"id": "F1.6", "status": "resolved"},
    {"id": "F1.7", "status": "resolved"},
    {"id": "F1.8", "status": "resolved"}
  ],
  "findings": [
    {
      "id": "F2.1",
      "severity": "P1",
      "tag": null,
      "file": "src/components/map-projects/MapProject.jsx",
      "line": 6636,
      "claim": "Draft rows remain interactive under the personal row cap while the selected organization's answer is pending.",
      "scenario": "A user whose personal cap is 25 selects row 100 on a draft owned by an organization with a 200-row cap, then changes to another organization with the same cap. While the new request is pending, the grid applies the 25-row cap and drops row 100 from the selection. The upload control also leaves the native file input enabled, so a keyboard user can still open the file picker during the wait.",
      "action": "Disable the native file input and pause draft row eligibility, selection pruning, and AutoMatch until the selected owner's request resolves or falls back. Cover both owner changes after upload and keyboard upload in integration tests.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F2.2",
      "severity": "P1",
      "tag": null,
      "file": "src/components/common/NamespaceDropdown.jsx",
      "line": 94,
      "claim": "A draft can keep an organization selected after the owners endpoint marks it unavailable.",
      "scenario": "A user with the general organization-project permission selects an organization while the owners request is slow. The reply marks that organization unavailable. The option becomes disabled, but it remains the selected owner, and the form checks the general permission instead of that organization's availability. The user can finish the draft and submit it to an owner the API will reject.",
      "action": "Distinguish a pending owners request from a failed request. Prevent selection while eligibility is pending, and apply the returned availability to the current draft owner and both Save controls. Preserve the existing choices when the request fails.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F2.3",
      "severity": "P1",
      "tag": null,
      "file": "src/components/common/useOwnerAccess.js",
      "line": 20,
      "claim": "A failed request can leave an earlier organization answer active indefinitely.",
      "scenario": "A draft receives a 200-row cap for an organization. The user switches to their personal owner and then back. The old organization answer is used immediately. If the fresh request times out, the draft keeps the 200-row cap instead of falling back to the user's personal cap.",
      "action": "Invalidate the previous answer when the owner changes, including when switching to a personal owner. Clear a same-owner answer on request failure so the fallback takes effect.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F2.4",
      "severity": "P1",
      "tag": null,
      "file": "src/components/map-projects/MapProject.jsx",
      "line": 6591,
      "claim": "Create Similar can deny a user who has an eligible organization while the owners request is pending.",
      "scenario": "A user at their personal project limit opens a saved project and chooses Create Similar before the owners request finishes. The action shows the personal limit dialog and never opens the draft, even though the pending response identifies an organization that can own it.",
      "action": "Use the project list's pending-request behavior for Create Similar so the new-project page can resolve owner eligibility.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F2.5",
      "severity": "P1",
      "tag": null,
      "file": "src/components/map-projects/MapProject.jsx",
      "line": 1694,
      "claim": "The upload notice labels organization projects as Preview based solely on the row cap.",
      "scenario": "An organization returns a 200-row cap and the user uploads 250 rows. The Mapper says “Preview projects hold 200 rows” even though the API supplied only a row limit.",
      "action": "Use plan-neutral upload copy in each locale and display plan wording only when the API supplies it.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

🤖 Generated with Claude Code

… joined since signing in; a row the new owner's limit leaves out is closed

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

paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Codex review, pass 3 (codex-cli 0.171.0, commit b4d72ab): 2 findings (P1 ×2). Of the earlier ones, F1.2, F1.3 and F2.3 stay as answered.

  • F3.1: a row that's open stays open, and can be changed, after the owner changes to one whose limit leaves it out.
  • F3.2: the Owner field leaves out an organization the person joined after signing in, though the API says it can own a project.

Replies (89b7cd7)

  • F3.1: fixed. The row closes once the new owner's answer is in.
  • F3.2: fixed, with a test. The field lists the organizations known at sign-in and any the API's answer adds.

839 tests pass, ESLint is clean, and I checked both in a browser.

findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "verify",
  "commit": "b4d72ab",
  "verdict": "findings",
  "prior": [
    {
      "id": "F1.1",
      "status": "resolved"
    },
    {
      "id": "F1.2",
      "status": "unresolved"
    },
    {
      "id": "F1.3",
      "status": "unresolved"
    },
    {
      "id": "F1.4",
      "status": "resolved"
    },
    {
      "id": "F1.5",
      "status": "resolved"
    },
    {
      "id": "F1.6",
      "status": "resolved"
    },
    {
      "id": "F1.7",
      "status": "resolved"
    },
    {
      "id": "F1.8",
      "status": "resolved"
    },
    {
      "id": "F2.1",
      "status": "resolved"
    },
    {
      "id": "F2.2",
      "status": "resolved"
    },
    {
      "id": "F2.3",
      "status": "unresolved"
    },
    {
      "id": "F2.4",
      "status": "resolved"
    },
    {
      "id": "F2.5",
      "status": "resolved"
    }
  ],
  "findings": [
    {
      "id": "F3.1",
      "severity": "P1",
      "tag": null,
      "file": "src/components/map-projects/MapProject.jsx",
      "line": 4035,
      "claim": "An open row remains editable after an owner change makes it ineligible.",
      "scenario": "Open row 50 in a draft owned by an organization with a 100-row cap. Open Settings, switch to a personal owner with a 25-row cap, and close Settings. The grid disables row 50, but its decision pane reopens and still lets the user change its note and mapping decision.",
      "action": "Close the decision pane when the resolved owner's cap excludes the open row, and apply the same eligibility check to per-row actions.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F3.2",
      "severity": "P1",
      "tag": null,
      "file": "src/components/common/NamespaceDropdown.jsx",
      "line": 92,
      "claim": "The Owner field omits organizations returned by the API when they are missing from the cached user profile.",
      "scenario": "A user is added to an organization after signing in. The owners endpoint lists it as available, but the dropdown still builds its options from cached memberships. If the user has reached their personal project cap, the form can automatically select that organization, display a blank Owner field, and save the project under the undisplayed owner.",
      "action": "Build organization options from the successful owners response. Use cached organization details for labels and icons where available, and use the organization ID when those details are missing.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

paynejd and others added 2 commits December 3, 2026 03:31
…ined with the person's own

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qTEw8c6qZh5C69F1V4
…limit leaves it out is closed too

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

paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Simplification review (a fresh Claude subagent, commit 89b7cd7; answered in f591c3b)

6 items, 2 applied: one test of "which organizations are asked about" instead of two, and one helper instead of two in withOwnerAccess. Not applied:

  • One check of "the answer isn't in yet" in getNewProjectBlockReason: there, no answer means an API that doesn't send one, and the two must stay apart.
  • Fold canUseOrgProjects into the Owner field: the form's Save goes by it too.
  • toLocaleString() in the rows chip stays: a limit of 2,000 reads as "2,000".
  • A one-line comment stays.

Codex check of commits b4d72ab..f591c3b (codex-cli 0.171.0): 1 finding (P2).

  • FC.1: a row clicked just before the new owner's answer comes in can open again after it was closed. Fixed in the next commit: the check also runs when the open row changes.

839 tests pass, and ESLint is clean.

findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "final",
  "commit": "f591c3b",
  "verdict": "findings",
  "prior": [],
  "findings": [
    {
      "id": "FC.1",
      "severity": "P2",
      "tag": null,
      "file": "src/components/map-projects/MapProject.jsx",
      "line": 5880,
      "claim": "A queued grid click can reopen a row after the new owner's limit closes it.",
      "scenario": "With row 2 open, switch to an owner limited to one row and click row 2 while the access request is pending. If the response arrives during the click's 200 ms delay, the effect closes row 2, then the queued click reopens it using the earlier eligibility check. The effect does not rerun when only the open row changes, so the mapping controls remain usable for the excluded row.",
      "action": "Check the latest eligibility when a delayed selection fires. Add a regression test where the owner response arrives between the click and the selection.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

…as before

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

paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

One more small commit, c431565: the rows a run includes are worked out from the latest counts when it starts. The branch used the ones from the last render, so a second tab's run could be missed. main reads them at that moment too.

Codex check of commit 6a8337f..c431565 (codex-cli 0.171.0)

  • FC.1 (P1) If the counts change while the dialog is open, the run can include fewer rows than the dialog said, without asking again. Not changed: main does the same, and this commit only puts that back. Asking again would be a change of its own.

839 tests pass and ESLint is clean.

findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "final",
  "commit": "c431565",
  "verdict": "findings",
  "prior": [],
  "findings": [
    {
      "id": "FC.1",
      "severity": "P1",
      "tag": null,
      "file": "src/components/map-projects/MapProject.jsx",
      "line": 3398,
      "claim": "The submit-time quota refresh changes which rows AutoMatch will process without updating the dialog or asking the user to confirm the new scope.",
      "scenario": "The dialog shows that all 20 rows are covered. Another tab uses enough match operations to leave only 5 before the user clicks Submit. AutoMatch runs the first 5 without the confirmation normally required for a partial run. If quota renews after the user confirms a 5-row run, the same path can rematch all 20 and clear statuses beyond the confirmed scope.",
      "action": "Keep the submit-time quota read. If it changes the runnable row count, refresh the open dialog and require a new submission before modifying any rows.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

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