Skip to content

feat(core-beta): allow granting the asset output scanning switches - #1594

Closed
synap5e wants to merge 3 commits into
mainfrom
synap5e/feat/grant-output-scanning-args
Closed

synap5e wants to merge 3 commits into
mainfrom
synap5e/feat/grant-output-scanning-args

Conversation

@synap5e

@synap5e synap5e commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR

Reviewer attention: Low priority, small. Two allowlist entries and a test.

PR Justification: Core is adding a switch pair for asset output scanning (Comfy-Org/ComfyUI#16566). A Core beta grant can only set args on Desktop's allowlist, so the allowlist has to ship first.

Stakes: Low. Grants can only add args, a user's own arg or its opposite still wins, and a core without the flag drops it as dropped_unsupported.

Changes: Adds --enable-assets-output-scanning and --disable-assets-output-scanning to CORE_BETA_GRANTABLE_ARGS.

Why

Output scanning keeps the asset library in sync with the output folder. It picks up files added outside ComfyUI and marks deleted ones as missing. Core#16566 makes it switchable, so a rollout can compare both settings on real installs before any default changes. Desktop ignores grants for args it doesn't know. Until this ships, a payload that grants either switch is skipped for that entry, and the rest of the payload still applies.

Notes

  • The --enable-/--disable- pairing is derived from the prefixes, so the two new args get the existing conflict rule without any new code: a payload that names both grants nothing. That refusal now logs the conflicting pair ([core-beta] payload refused: ...), so it can't be mistaken for an empty payload.
  • As with --disable-assets, the allowlist lands ahead of Core. Granting either arg to a core without the flag is safe; the launch reports it as dropped_unsupported.

Change breakdown

Merge base 3cb5001c, head c7e71abf. 56 changed lines (53 added + 3 deleted).

Category Files Added Deleted Share
Product 1: src/main/lib/coreBetaGrants.ts 8 2 17.9%
Tests 1: src/main/lib/coreBetaGrants.test.ts 45 1 82.1%

How tested

  • New test: each switch parses as a grant alongside --enable-assets, and naming both in one payload grants nothing.
  • The allowlist snapshot test was updated.
  • The both-directions case also asserts the refusal log line.
  • coreBetaGrants.test.ts passes 116/116 at c7e71abf, and node typecheck and eslint are clean.
  • coreBetaGrants, betaActivationNotice and telemetry tests pass (321 tests).

…ning

Lets a PostHog grant turn Core's asset output scanning on or off for a cohort.
Both land ahead of Core: an older core drops the arg as dropped_unsupported.
@synap5e synap5e added the cursor-review Trigger multi-model Cursor code review label Sep 28, 2026
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 2bbb392b-84cf-4561-94e0-047012fedfa1

📥 Commits

Reviewing files that changed from the base of the PR and between 98e8187 and c7e71ab.

📒 Files selected for processing (2)
  • src/main/lib/coreBetaGrants.test.ts
  • src/main/lib/coreBetaGrants.ts

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour. Your free on-demand review promotion remains active until October 9, 2026 at 6:00 PM UTC.


📝 Walkthrough

Walkthrough

The grantable-argument allowlist adds --enable-assets-output-scanning and --disable-assets-output-scanning. The parser logs both conflicting tokens before it rejects a payload that grants both directions. Tests cover these cases.

Changes

Core beta grants

Layer / File(s) Summary
Allowlist and parser expectations
src/main/lib/coreBetaGrants.ts, src/main/lib/coreBetaGrants.test.ts
The allowlist adds both asset output-scanning options. When a payload grants both directions, the parser logs the conflicting tokens and returns no grants. Tests check results for each direction alongside --enable-assets and for a payload that names both directions.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to c7e71

No concrete current-head failure is established: conflicting scanning directions are intentionally rejected, and the broader assets-disable interaction has no demonstrated failure. No actionable merge blocker is supported.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
✨ Simplify code
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@synap5e
synap5e marked this pull request as ready for review September 28, 2026 23:53
@synap5e
synap5e requested review from a team as code owners September 28, 2026 23:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T23:54:46.902475Z c9c7574 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Cursor Review — Consolidated panel

Triggered by @synap5e.

Found 6 finding(s).

Severity Count
🟠 High 1
🟡 Medium 1
🟢 Low 3
⚪ Nit 1

Panel: 8/8 reviewers contributed findings.

{ arg: '--disable-assets-output-scanning', commit_ranges: range }
]
})
).toEqual([])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High — This test asserts parseCoreBetaGrants returns [] when a payload names both --enable-assets-output-scanning and --disable-assets-output-scanning, but the only production change in this diff is the two new entries in CORE_BETA_GRANTABLE_ARGS — no whole-payload conflict rejection is added here. Either the conflict logic already exists elsewhere in parseCoreBetaGrants (in which case the test is fine but the diff should say so), or the implementation half of this change is missing and the test will fail. Raised by 1 of 8 reviewers (gemini-3.1-pro edge-case).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change needed. The rule already exists in parseCoreBetaGrants: after collecting entries, it returns [] if any granted arg's --enable-/--disable- opposite (oppositeArg) is also granted. Adding the two tokens to the allowlist is all it takes for them to be covered, and the test passes. Since c7e71ab the refusal is also logged.

'--enable-agent'
'--enable-agent',
'--enable-assets-output-scanning',
'--disable-assets-output-scanning'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium — Allowlisting both directions of the same stem makes the whole-payload void reachable from a legitimate staged rollout: the conflict check compares only arg, so an --enable-assets-output-scanning scoped to one commit lineage plus a --disable-assets-output-scanning scoped to a disjoint lineage counts as a contradiction and discards every other grant in the payload (including --enable-assets) for all clients. selectCoreBetaGrantArgs already resolves per-arg conflicts first-wins with a withheld reason and would grant at most one of two disjoint ranges on any install, so consider scoping the rejection to the conflicting pair rather than the entire payload. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping the whole-payload refusal. It predates this PR, applies the same way to --enable-assets/--disable-assets, and since c7e71ab it logs the conflicting pair, so the void is visible. Resolving each pair on its own would change the grant contract for every pair, which is out of scope for adding two allowlist entries.

'--disable-assets',
'--enable-agent'
'--enable-agent',
'--enable-assets-output-scanning',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Low — oppositeArg pairs only exact stems, so --enable-assets-output-scanning (stem assets-output-scanning) is unrelated to the --enable-assets/--disable-assets pair. A single payload can therefore put --disable-assets --enable-assets-output-scanning on one command line — the contradictory-flag situation the module's contract says must not occur — and a user who explicitly passed --disable-assets still receives the sub-flag grant, with Core's precedence for a sub-flag of a disabled subsystem unspecified. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change. Core's output-scanning switches only take effect with assets enabled (the flag help says 'Only applies with --enable-assets'), so --disable-assets --enable-assets-output-scanning leaves assets off and the sub-flag does nothing. The two don't contradict each other. If both scanning switches ever reach Core, disable wins.

'--enable-agent'
'--enable-agent',
'--enable-assets-output-scanning',
'--disable-assets-output-scanning'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Low — The whole-payload void is silent: nothing logs the conflicting pair, and the withheld reporting lives in selectCoreBetaGrantArgs, which receives the already-empty list. An operator typo is indistinguishable from "no grants configured" apart from cached= [] in the init log, and because the raw payload persists, the void survives restarts until someone notices. Log the conflicting arg pair at parse time. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken (c7e71ab). A payload that names both directions now logs [core-beta] payload refused: it grants both <arg> and <opposite>. Both tokens are allowlisted, so the log line carries nothing else from the payload.

'--enable-agent'
'--enable-agent',
'--enable-assets-output-scanning',
'--disable-assets-output-scanning'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Low — --disable-assets-output-scanning makes a scanning control remotely switchable off by PostHog payload, and a --disable-* grant with no payload description is deliberately silent (betaActivationNotice.ts skips unnamed force-offs), so the only trace is a [core-beta] launch-log line that persists across restarts via ops-flags.json. Confirm output scanning is an indexing convenience rather than a safety or integrity check before exposing it to remote, notice-free disabling. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max adversarial).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed: output scanning is about catalogue completeness, not safety or integrity. With it off, outputs are still registered as nodes produce them, and output rows already in the database are kept and served. The scanner just doesn't catalogue files no node declared, or notice out-of-band changes and deletions. Remote disabling without a notice works the same way as --disable-assets, which is already grantable.

'--enable-agent'
'--enable-agent',
'--enable-assets-output-scanning',
'--disable-assets-output-scanning'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ Nit — The allowlist assertion mirrors the source constant verbatim, so a misspelled token (e.g. singular --enable-asset-output-scanning) would pass both tests while shipping a grant Core can never parse — it would be silently reported as dropped_unsupported forever. The new case also only exercises the --disable- direction end to end; add a case granting --enable-assets-output-scanning on its own. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max adversarial).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken (98e8187): the enable switch is now granted on its own, end to end. Both spellings match Core's comfy/cli_args.py on the output-scanning branch (--enable-assets-output-scanning, --disable-assets-output-scanning).

The test named both directions but only parsed the disable switch alone;
the enable switch appeared only in the rejected both-directions payload.
@synap5e-bot

synap5e-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown

Follow-up from review: added a test that the enable switch is also granted when it's the only scanning entry in the payload (not just alongside the disable switch).

The whole-payload refusal was silent: nothing distinguished it from an
empty payload, and the persisted payload kept it that way across
restarts. Log the conflicting pair; both tokens are allowlisted.
@alexisrolland

Copy link
Copy Markdown
Member

Closing this for clean-up, might want to reopen when the new version of Desktop lands.

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

Labels

cursor-review Trigger multi-model Cursor code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants