Skip to content

fix(user-interface): enforce the routing-as-data 2.0.0 team-row limits - #11525

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-8788-41194411606-1
Oct 31, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-8788-41194411606-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #8788

Summary

Opened by the work-resolve-issue lane. The run's own summary:

detect.mjs now checks each merged team routing row against the three 2.0.0 team-row rules before applying it. A row is dropped, and named in routing_notes with the rule it broke, when its id matches no bundled row and no installed plugin or skill (or the installed list is unreadable), when it adds a kind: tool row, or when it reuses a bundled id but changes kind, detect or account. The issue body named two rules; the recorded decision (2026-10-31) adds the third, because the contract requires all three before the Adopters deviation can go. The rules and rule names copy user-experience's team-policy.mjs, inlined into detect.mjs because the scope fence lists only that file. Presence comes from each row's own kind and detect through a once-cached installed() call, as user-experience's detect.mjs does, so the plugin and MCP lists are still read at most once.

Not verified

  • plugins/user-interface/tests/detect.test.mjs was not run: this lane cannot run node. Left to the PR's CI; the subagent review traced every new test by hand.
  • Tidy skipped: the change spans two areas (plugins/user-interface and docs/contracts), over the cutoff of 1.
  • docs/contracts/routing-as-data/CHANGELOG.md's 2.0.0 entry still says user-interface records a deviation tracked in #8788. routing-as-data is not in fragment mode, so its record would be a new CHANGELOG heading, which is outside the issue's scope fence (Adopters row only). Not added.
  • plugins/user-interface/README.md:76 ('a new row adds a route') and skills/design/SKILL.md:31-32 (the list of routing_notes causes) don't mention the team-row limits. Both are outside the scope fence and still accurate as general statements. Not changed.
  • Review nit not acted on: routing notes print the team row's concern and id raw, not JSON-quoted. That was already the case before this change, and the existing tests match the raw form.
  • review-venue.txt was absent, so the review ran locally in one fresh-context subagent.
  • Untracked files .bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile and .zshrc are in the checkout root. This run did not create them, and they are not part of this change.
  • No commit made: the runner's instructions say to leave every change uncommitted for the patch job.

Fix

  • plugins/user-interface/scripts/detect.mjs: added teamRowRejections (id-matches-bundled-or-installed, no-new-tool-rows, bundled-id-keeps-kind-detect-account). applyRouting now validates rows first, then checks the survivors against the rules using their presence. The plugin and MCP list readers are w
  • plugins/user-interface/tests/detect.test.mjs: replaced the 'a team row naming no bundled row adds a route' test with tests for an uninstalled id (dropped, note), an installed plugin id (applied), an unreadable installed list (dropped, note says so), a new kind: tool row (dropped, note), a bundled-id
  • plugins/user-interface/reference/team.schema.json: the routing.rows description now states the three rules and that a breaking row is dropped and named.
  • docs/contracts/routing-as-data/README.md: the user-interface Adopters row says it adopts the 2.0.0 team-row limits and no longer records the deviation.
  • .changes/user-interface/fix-8788-team-row-limit-9d41c2a7.md: new patch fragment (Fixed).

Verification

The runner ran each check from the base copy against 56b7211:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: All 14 changelog fragment(s) under .changes/ are valid (after removing a routing-as-data fragment the check rejected as not in fragment mode).
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 11 passed, 7 skipped over 5 changed files.
  • Fresh-context subagent review of the whole diff: no bugs. It traced each new and changed test by hand and found that all should pass with no existing test broken. It reported four nits, listed in not_done.
  • Grep for line citations into detect.mjs, detect.test.mjs or team.schema.json across the repo: none, so no citation goes stale.
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41194411606

Left out: the items under Not verified.

Related

#8788

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 56b7211545dff5ecf6ad9e89f50f5c3fc127d5b9: 0 finding(s), 0 as inline comments.

Security review: PR #11525 (0 findings, no CRITICAL)

I read the whole diff and the PR context. None of the 5 changed files matches a TRUSTED PATHS: glob: they are plugins/user-interface/**, docs/contracts/routing-as-data/README.md and a .changes/ fragment. The change touches a security-relevant surface, the team-file routing rows in detect.mjs, so I did not use the skip gate.

What the change does. plugins/user-interface/scripts/detect.mjs previously merged any valid team routing.rows entry. Now teamRowRejections checks each merged entry first and drops it if it breaks any of three rules, which are the 2.0.0 team-row limits:

  • Id rule: its id matches no bundled row and no installed plugin or skill. When the installed list can't be read, any id that matches no bundled row is dropped.
  • No new tool rows: it adds a kind: tool row.
  • Bundled id keeps its fields: it reuses a bundled id but changes kind, detect or account.

This narrows what a team file can do. The base accepted every team-added row. The new code only drops more rows, and the checks run after the existing schema and DETECT_NAME path-traversal validation, which still apply.

I found no bypass in the new checks:

  • Unreadable installed list: present === null fails closed for any id that matches no bundled row.
  • Own-name check: an added row must have kind plugin or skill, its id's name must equal nameOf(row.detect), and that plugin or skill must be installed. A different kind, or an id that names some other plugin than its detect, is dropped.
  • Bundled id in another concern: this also needs kind, detect and account unchanged, because same = base ?? sameId[0].
  • Presence probe: presence() gives each row a unique \u0000<index> id suffix, and presence is decided by the row's own detect, not its id. A crafted id gains nothing from this.
  • Single list read: the once() wrapper means the plugin and MCP list readers run at most once. It adds no new input.
  • Dropped-row notes: the new reasons embed team values only through JSON.stringify, plus fixed changed field names. The notes still print the row's concern and id raw. That was already the case before this PR and is not a regression.

Other changes. The tests, the schema description, the contract README Adopters row and the changelog fragment carry no security surface. The README edit removes a recorded deviation, and the code now enforces the rules it describes. The PR text contains no embedded instructions directed at the reviewer.

Manifest fields: no plugin.json or marketplace.json change. No spend beyond normal CI.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 56b7211545dff5ecf6ad9e89f50f5c3fc127d5b9: 0 finding(s), 0 as inline comments.

No blocking findings. I read the full diff, the PR context, plugins/user-interface/scripts/lib/installed.mjs and the test helpers. I did not run node or the tests, so I have not confirmed the new tests pass. That is left to the PR's CI.

Checked against issue #8788 and its decision comment

  • teamRowRejections in plugins/user-interface/scripts/detect.mjs implements all three rules: id-matches-bundled-or-installed, no-new-tool-rows and bundled-id-keeps-kind-detect-account.
  • A re-rank of a bundled row is merged with its base row, so kind, detect and account are unchanged and it passes. A bundled kind: tool row can still be re-ranked, because the check uses the base row's kind.
  • An unreadable installed list makes installed() return installed: null. That gives each candidate a presence of null, and so the "could not be read" note.
  • The suffixed-id presence trick agrees with installed.mjs: it keys on row.kind and row.detect, and the skill-shape test reads only the id prefix, so the suffix changes nothing. The once wrapper keeps the plugin and MCP lists to one read each.
  • Each "Done when" test case is present, and the deny test now uses withBrand, which it needs now that an uninstalled added row is dropped:
    • an uninstalled id is dropped, with a note;
    • an installed plugin id is applied;
    • an unreadable list drops the row, and the note says so;
    • a new kind: tool row is dropped, with a note;
    • changing kind, detect or account on a bundled id is dropped (three cases);
    • a re-rank of a bundled row still applies.
  • The team.schema.json description states all three rules, the Adopters row no longer records the deviation, and the changelog fragment is a patch-level Fixed entry.
  • Every criterion except the CI-run one has a test that fails if it breaks. The CI-run criterion depends on CI running detect.test.mjs.

Left for the author (not findings)

  • The routing-as-data CHANGELOG.md 2.0.0 entry still mentions the user-interface deviation. The author says this is outside the scope fence.
  • Routing notes print the row's concern and id raw, not JSON-quoted. That was already the case before this change.

No cost or critical-security hold applies.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 56b7211545dff5ecf6ad9e89f50f5c3fc127d5b9.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 3d6fe7f Oct 31, 2026
44 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-8788-41194411606-1 branch October 31, 2026 11:51
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.

fix(user-interface): enforce the routing-as-data 2.0.0 id limit on team-added rows

0 participants