Skip to content

fix(discover): keep HTTPS installers from vendor sites and add clear selection - #377

Merged
linroid merged 3 commits into
mainfrom
fix/discover-installer-filter
Oct 4, 2026
Merged

linroid merged 3 commits into
mainfrom
fix/discover-installer-filter

Conversation

@linroid

@linroid linroid commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

What

  • Safety filter (DeviceSafetyFilter): installers (.exe, .msi, .dmg, .pkg, .apk) from hosts off the built-in trusted list are no longer hard-blocked. Over HTTPS they are kept with a 0.2 score penalty, so they rank below the same file from a listed host. Without HTTPS they are still blocked.
  • New hard blocks for every file type: hosts that imitate a trusted domain from outside its site (fake-github.com, github.com.example.net) and http(s) URLs carrying user info (github.com@evil.example). Other hosts of a trusted domain's own site, such as archive-downloads.apache.org, are not treated as fakes.
  • Discover add bar: an × button before "N selected" clears the whole selection, including results picked in earlier messages (AiDiscoverController.clearSelection()). It reuses the existing discover_clear_selection string.

Why

The agent accepted three official PureWriter installers hosted on kuromi.drakeet.cn, but the filter dropped all three because that host isn't on the list. Most vendors host installers on their own domain, so the old rule hid nearly every official installer outside GitHub/SourceForge.

The selection bar could say "1 from earlier" with no quick way to drop a pick that was far up the chat.

Notes for reviewers

  • A switch to turn the filter off, and a note when it hides results, follow in a separate PR stacked on this one.

Tests

  • DeviceSafetyFilterTest: unlisted HTTPS installer kept and scored below a trusted one, unlisted HTTP installer blocked, look-alike hosts and user info blocked, sibling hosts of a trusted site kept.
  • AiDiscoverControllerTest: clearSelection() deselects results across turns.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 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-10-04T09:05:06.568458Z 3a88272 PR opened
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a882723ba

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ai/discover/src/main/kotlin/com/linroid/ketch/ai/agent/DeviceSafetyFilter.kt Outdated
@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

 1 351 files  ±0   1 378 suites  ±0   10m 27s ⏱️ +24s
 8 918 tests +5   8 701 ✅ +5  217 💤 ±0  0 ❌ ±0 
10 257 runs  +5  10 040 ✅ +5  217 💤 ±0  0 ❌ ±0 

Results for commit 9338af7. ± Comparison against base commit bb41819.

This pull request removes 1 and adds 6 tests. Note that renamed tests count towards both.
com.linroid.ketch.ai.agent.DeviceSafetyFilterTest ‑ evaluate_highRiskExtFromUntrusted_blocked
com.linroid.ketch.ai.agent.DeviceSafetyFilterTest ‑ evaluate_highRiskExtFromUnlistedHttp_blocked
com.linroid.ketch.ai.agent.DeviceSafetyFilterTest ‑ evaluate_highRiskExtFromUnlistedHttps_penalized
com.linroid.ketch.ai.agent.DeviceSafetyFilterTest ‑ evaluate_siblingHostOfATrustedSite_allowed
com.linroid.ketch.ai.agent.DeviceSafetyFilterTest ‑ evaluate_trustedDomainLookalike_blocked
com.linroid.ketch.app.state.AiDiscoverControllerTest ‑ clearSelection_resultsOfSeveralTurns_deselectsThemAll[jvm]
iosSimulatorArm64Test.com.linroid.ketch.app.state.AiDiscoverControllerTest ‑ clearSelection_resultsOfSeveralTurns_deselectsThemAll[iosSimulatorArm64]

♻️ This comment has been updated with latest results.

@linroid linroid changed the title fix(discover): keep HTTPS installers from vendor sites and add clear selection fix(discover): keep vendor installers, add clear selection and a content filter switch Oct 4, 2026
@linroid
linroid force-pushed the fix/discover-installer-filter branch from 45e4625 to 4567ff0 Compare October 4, 2026 09:27
@linroid linroid changed the title fix(discover): keep vendor installers, add clear selection and a content filter switch fix(discover): keep HTTPS installers from vendor sites and add clear selection Oct 4, 2026
@linroid
linroid added this pull request to stack #381 October 4, 2026 09:29
…selection

DeviceSafetyFilter dropped every .exe/.msi/.dmg/.pkg/.apk whose host was not
on a short built-in list, so official installers hosted on a vendor's own
site vanished after the agent accepted them. Such installers are now scored
down over HTTPS and blocked only without HTTPS; hosts that imitate a listed
domain, and http(s) URLs with user info, are blocked for every file type.

The Discover add bar gets a button that clears the whole selection,
including results selected in earlier messages.
…ike block

A host that contains a trusted domain but sits under the same site, such as
archive-downloads.apache.org beside downloads.apache.org, belongs to the
vendor, so it is no longer blocked as an impersonation.
@linroid
linroid force-pushed the fix/discover-installer-filter branch from 4567ff0 to 9338af7 Compare October 4, 2026 09:29
…github.com/linroid/Ketch into HEAD

# Conflicts:
#	app/shared/src/commonTest/kotlin/com/linroid/ketch/app/state/AiDiscoverControllerTest.kt
@linroid
linroid merged commit 64905f9 into main Oct 4, 2026
10 checks passed
@linroid
linroid deleted the fix/discover-installer-filter branch October 4, 2026 09:43
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