GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — atlas-core: topics/projects filters are unescaped SQL LIKE patterns — % and _ act as wildcards, a quote crosses JSON element boundaries · Issue #5375 · developing-today/code

atlas-core: topics/projects filters are unescaped SQL LIKE patterns — % and _ act as wildcards, a quote crosses JSON element boundaries #5375

New issue
Copy link
New issue
Copy link
Closed
#8996
Closed
atlas-core: topics/projects filters are unescaped SQL LIKE patterns — % and _ act as wildcards, a quote crosses JSON element boundaries#5375
#8996
Copy link
Assignees
dezren39
Labels
app/atlas-searchpkgs/atlas-search (Atlas search service + atlas-embed)effort/sSmall: expected under 2 hours of workepic/atlas-programReprioritization program epic (2026-11-12)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
Milestone
Atlas program

Description

@dezren39
dezren39
opened on Nov 4, 2026
Issue body actions

Bug: atlas-core topics/projects filters are unescaped SQL LIKE patterns — %/_ in a filter value act as wildcards and a " crosses JSON element boundaries

pkgs/atlas-search/crates/atlas-core/src/filters.rs builds the topics/projects
filter (the values stored in l.topics / l.projects are JSON list text such as
["nixos","backup"]) as a raw LIKE pattern with the user-supplied value
interpolated verbatim:

  • Filters::where_clause (filters.rs:177-182):
    clauses.push(format!("{col} LIKE ?")) with param format!("%\"{v}\"%")
    for l.topics and l.projects.
  • Filters::session_clauses (filters.rs:213-218): the identical construction
    for the Turso vector branch's session subquery.

There is no escaping and no ESCAPE clause anywhere in atlas-core. SQL LIKE
treats % as "any run of characters" and _ as "any single character", so a
filter value is a pattern, not a literal topic/project name:

Verified (laptop, origin/main a65000a)

  1. Rust probe through atlas-core itself (temporary test in a scan worktree at
    a65000a, cargo test -p atlas-core --test probe_like): Filters::new
    with topics ["my_topic", "100%", "a\",\"b"] and projects ["%"] emits
    l.topics LIKE ? / l.projects LIKE ? clauses whose params are the raw
    interpolations %"my_topic"%, %"100%"%, %"a","b"%, %"%"% in both
    where_clause and session_clauses.
  2. SQLite probe of exactly that pattern against JSON-list rows:
    • filter my_topic matches ["my-topic","other"] and ["myXtopic"]
      (the _ wildcard) — neither row has a topic named my_topic;
    • filter % matches every non-empty topics list
      (["my-topic","other"], ["myXtopic"], ["a","b"], ["100 days"]) —
      the filter silently becomes a no-op;
    • filter a","b matches ["a","b"] — the embedded " crosses the JSON
      element boundary, so two distinct topics satisfy a filter for one
      (nonexistent) topic;
    • filter 100% matches ["100 days"];
    • control filter my-topic matches only ["my-topic","other"], as intended.

Why it matters

Filter-before-rank with exact classification filters is a headline contract of
atlas-core (filters.rs module doc; step-2 PR #5352). A topic or project whose
name legitimately contains _ (common: my_topic, pm_stack) over-matches
unrelated sessions, and a % value disables the filter entirely — wrong
results are returned as if the filter had been applied, with no error or note.
Because both branch constructions share the flaw, FTS and vector results are
affected identically, so fusion cannot mask it. The step-3 CLI (#5353) will
surface these filters directly to users.

Note on parity: the construction is inherited from the production Python's
Filters (the port mirrors its SQL byte-for-byte and the parity fixtures pin
it). This is a deliberate-deviation candidate: the fix changes the recorded
SQL/params for values containing %, _, \, or ", so the parity fixtures
should gain these cases as documented deviations rather than silently
diverging — the Python side carries the same bug and should get the same fix
or an explicit waiver.

Acceptance criteria

  • A topics/projects filter value matches only a JSON element exactly equal
    to it: %, _, and \ in the value are treated as literal characters
    (e.g. escaped with an explicit ESCAPE clause), and a value containing
    " cannot match across element boundaries.
  • Both construction sites are fixed consistently: where_clause
    (filters.rs, FTS/local) and session_clauses (filters.rs, Turso vector
    branch subquery).
  • New tests pin at least: filter my_topic does not match my-topic or
    myXtopic rows but does match a my_topic row; filter % matches only
    a literal % element (not every list); filter a","b does not match
    ["a","b"]; ordinary values (nixos) behave exactly as before.
  • The parity fixtures / step-6 Gate B (Atlas step 6: golden-parity gate (Gate B) + cutover #5356) record the changed params
    for wildcard-bearing values as an intentional deviation from the Python,
    or the Python construction is fixed in step with a note on this issue.
  • Existing atlas-core unit + parity tests pass (cargo test -p atlas-core),
    excepting fixture expectations updated per the previous criterion.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    status/needs-triageNot yet triaged; needs a first look
    priority/lowNice to have; do when convenient
    app/atlas-searchpkgs/atlas-search (Atlas search service + atlas-embed)
    on Nov 4, 2026
  2. dezren39 commented on Nov 4, 2026

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator (lane A, new-issue-creator-code-a)
    • Session / ID: new-issue-creator-code-a cron run 2026-11-04 03:35 CST
    • Found via: filed this run
    • Task: Filed this verified bug: atlas-core topics/projects filters build unescaped SQL LIKE patterns in both where_clause and session_clauses (filters.rs), so %/_ act as wildcards and a quote crosses JSON element boundaries. Verified by a Rust probe through atlas-core itself plus a SQLite probe of the exact pattern at origin/main a65000a.
    • Expectation: effort s — escape LIKE metacharacters (explicit ESCAPE) at both construction sites, pin the wildcard/quote cases with tests, and record the changed params as an intentional parity deviation for Gate B (Atlas step 6: golden-parity gate (Gate B) + cutover #5356).
    • Links: evidence body in this issue; queue packet packet-5375-fix.json (repo-health-code-pilot)
  3. github-actions
    assigned
    dezren39
    on Nov 4, 2026
  4. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 4, 2026
  5. dezren39 commented on Nov 4, 2026

    @dezren39
    dezren39
    on Nov 4, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-h
    • Session / ID: task 9358
    • Found via: queue claim
    • Task: triage of issue atlas-core: topics/projects filters are unescaped SQL LIKE patterns — % and _ act as wildcards, a quote crosses JSON element boundaries #5375 (atlas-core topics/projects filters use unescaped SQL LIKE patterns) — claimed by lane code-h and assigned to the opencode execution lane
    • Expectation: the opencode-claimant launches a bound opencode session for task 9358, which drives the triage to its terminal state
    • Links: n/a yet
  6. 57 remaining items

  7. dezren39
    added
    status/parkedDeliberately paused with a recorded resume condition
    on Nov 12, 2026
  8. dezren39 commented on Nov 12, 2026

    @dezren39
    dezren39
    on Nov 12, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: repo-worker-code, OpenChamber scheduled lane any-n
    • Task: 9838 — atlas-core: topics/projects filters are unescaped SQL LIKE patterns — % and _ act as wildcards, a quote crosses JSON element boundaries #5375 / PR fix(atlas-core): escape topic and project LIKE filters #8996.
    • Fresh state: issue OPEN; PR fix(atlas-core): escape topic and project LIKE filters #8996 OPEN at 4f3670576437911847ccb0159f780aa3d088f311. Current checks still fail for parity fleet-search: pyjson/render verbatim copies of atlas-search have no drift guard — the byte-parity contract (#5433) is unenforced #5920, mcpx unit and e2e shards 0/3/4/5; Atlas Rust checks pass. Existing clean-main comparison in the diagnosis comment establishes these failures are baseline and unrelated to this PR. No edits made.
    • Next: task 9838 parked for 20 minutes; resume after baseline parity/mcpx failures are resolved and re-fetch checks.
  9. dezren39 commented on Nov 12, 2026

    @dezren39
    dezren39
    on Nov 12, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up → parked

    • Agent: queue worker (repo-worker-code), OpenChamber scheduled lane code-g
    • Session / ID: queue task 9838
    • Found via: one-queue claim (repo = code)
    • Fresh state: atlas-core: topics/projects filters are unescaped SQL LIKE patterns — % and _ act as wildcards, a quote crosses JSON element boundaries #5375 OPEN; canonical PR fix(atlas-core): escape topic and project LIKE filters #8996 OPEN at 4f3670576437911847ccb0159f780aa3d088f311. Current checks: fleet-search parity fleet-search: pyjson/render verbatim copies of atlas-search have no drift guard — the byte-parity contract (#5433) is unenforced #5920, mcpx unit, and e2e shards 0/3/4/5 failed; atlas-search Rust checks and e2e shards 1/2 passed. The same parity and mcpx failures were reproduced on clean main in atlas-core: topics/projects filters are unescaped SQL LIKE patterns — % and _ act as wildcards, a quote crosses JSON element boundaries #5375 (comment).
    • Action: no edits or PR interaction. Task parked 20 minutes; resume only after those mainline failures are resolved, then re-fetch all checks. Worktree: /home/user/git/fleet/9838, branch queue/9838-5375-atlas-like-escape.
  10. dezren39 commented on Nov 12, 2026

    @dezren39
    dezren39
    on Nov 12, 2026
    MemberAuthor
    More actions

    Conductor hand-back (2026-11-12T21:27Z): queue task 9838 was claimed for eligibility check, then re-parked as awaiting-baseline-ci. Fresh checks on canonical PR #8996 at 4f36705 still fail fleet-search parity #5920, mcpx-test unit, and e2e shards 0/3/4/5; atlas-search Rust checks pass. The packet says resume only after the baseline parity and mcpx failures resolve, then re-fetch all checks. No worker session launched and no code changed.

  11. dezren39 commented on Nov 12, 2026

    @dezren39
    dezren39
    on Nov 12, 2026
    MemberAuthor
    More actions

    agent-note:v1
    {"kind":"pickup","task":9838,"worker":"repo-worker-code","lane":"code-g","state":"in-progress","note":"Claimed task 9838. Resuming existing worktree /home/user/git/fleet/9838 and PR #8996 from ci-diagnosis; first I will revalidate issue/PR/checks and compare failures with the recorded clean-main baseline. No duplicate branch or implementation."}

  12. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    on Nov 12, 2026
  13. dezren39 commented on Nov 12, 2026

    @dezren39
    dezren39
    on Nov 12, 2026
    MemberAuthor
    More actions

    agent-note:v1
    {"kind":"parked","task":9838,"worker":"repo-worker-code","lane":"code-g","state":"parked","note":"PR #8996 remains OPEN at 4f36705. Fresh checks reproduce the prior pattern: atlas-search Rust passes; fleet-search parity #5920, mcpx unit, and e2e shards 0/3/4/5 fail, while the clean-main baseline evidence is documented in comment 6834816317 (same parity failure on clean main; mcpx failure names match clean-main run; PR has no mcpx changes). No source edits made. Task parked 1200s; resume when baseline parity and mcpx failures are resolved, then refresh checks."}

  14. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 12, 2026
  15. developing-today
    closed this as completedin #8996on Nov 12, 2026
  16. dezren39 commented on Nov 12, 2026

    @dezren39
    dezren39
    on Nov 12, 2026
    MemberAuthor
    More actions

    Agent note — task 9838 done, PR #8996 merged (lane any-b)

    • state: done (fixed_merged)
    • PR fix(atlas-core): escape topic and project LIKE filters #8996 merged 2026-11-12T22:11:52Z, merge commit 35d4167d1ef4b1aa8685424a945b18c039aebd25; issue atlas-core: topics/projects filters are unescaped SQL LIKE patterns — % and _ act as wildcards, a quote crosses JSON element boundaries #5375 closed by the merge.
    • Verification: PR was MERGEABLE at head 4f3670576437911847ccb0159f780aa3d088f311; diff is only pkgs/atlas-search/crates/atlas-core/src/filters.rs, its parity tests, and the fixtures README — the LIKE-metacharacter escaping fix for topics/projects filters. basic: atlas-search Rust checks PASS. No Codex findings on the PR.
    • Remaining red checks were exactly the proven clean-main baseline set — fleet-search parity (fleet-search: pyjson/render verbatim copies of atlas-search have no drift guard — the byte-parity contract (#5433) is unenforced #5920) and mcpx-test unit + e2e shards 0/3/4/5 + ci-ok (fleet-stalling: main mcpx test failures block clean PR checks (run 43191539255) #8900; identical set verified failing on clean main and on unrelated PRs) — in areas this PR does not touch. Merged under the standing merge authority (verified done; PRs do not wait on baseline-red CI).
  17. developing-today
    removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/atlas-searchpkgs/atlas-search (Atlas search service + atlas-embed)effort/sSmall: expected under 2 hours of workepic/atlas-programReprioritization program epic (2026-11-12)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    • Atlas programNo due date

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.