Skip to content

analytics: the native dataset face answers 200 with wrong counts for = / $in / $ne on a single-value image or file field (stored as JSON) where the data door refuses 400 #36190

Description

@objectstack-fleet

repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv

Filing gate ① · Source: fleet · found by the seat's contract review of PR #36184 (#36168), record on that PR; outside #36168's multiple population.

What happens

The data door refuses the JSON-incompatible comparison operators on a second JSON-column class, single-value-media: a single-value image / file field stored as JSON (packages/drivers/driver-sql/src/sql-driver-filter-helpers.ts:434-437). PR #36184's dataset refusal reads only the multiple population (packages/services/service-analytics/src/json-column-comparison-refusal.ts:92-93, isJsonStoredShape in contains-membership-sql.ts:59-62), so the native dataset face still answers. Measured on a fresh SQLite deployment, 4 rows, pic: image, one row holding file_1:

Filter Data door ObjectQL face Native face Draft preview
{pic: 'file_1'}, {pic: {$in: ['file_1']}} 400 400 200, count 0 200, count 1
{pic: {$ne: 'file_1'}} 400 400 200, count 4 200, count 3

Pre-existing on main. The analytics host has no hook today for the column's storage state, which is why #36184 did not take it.

Done when

The native dataset face (and the draft preview) refuse the same operators, with the same code and sentence, on a single-value media field stored as JSON, through #36184's module; pins on image and file with a scalar control. Narrows what the door answers ⇒ Clause-②: no (narrowing).

reach: dataset / dashboard filter on an image or file field, measured on SQLite by the reviewer; other dialects to be measured by the claimant.
Business reason: a dashboard filtering on an attachment field shows wrong counts with no error.
Reader: area:reports / domain:server (service-analytics).
Dedupe: single-value-media dataset → 0 hits.
Grade: p2 — same class as #36168, rarer field use (filtering by an attachment value).

Activity

  1. added
    bug
    priority:p2
    pm:queue
    area:reports
    domain:server
    on Nov 21, 2026
  2. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:server (service-analytics native face) · pm:queue; rationale: area:reports · Bug · on a single-value image or file field stored as JSON, = / $in / $ne answer 200 with wrong counts on the native dataset face (and a different count in the draft preview) where the data door refuses 400; found by the contract review of PR #36184 → p2 as filed (silently wrong counts, but filters on file or image fields are rare; #36168 covers the common multi-value case at p1) · size S.

  3. added and removed
    area:reports
    on Nov 22, 2026
  4. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH

    Claim: PM loop round 1
    Session: session_011y7As5bdhV5T4N9vpjmZzH
    Account: os-alice
    Branch: claude/issue-36190-analytics-single-media-json-refusal
    Worktree: objectstack-issue-36190
    Domain: domain:server
    Seat: repo:objectstack#7
    File surface: packages/services/service-analytics/src/** and its tests (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default (dispatch-gates --tier: "no path-derived mandate"), effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack (packages/services/service-analytics native dataset face and draft preview) | the #36184 refusal module, which reads only the multiple population | any dashboard or dataset filter on a single-value image or file field
    Thread-read: 7069730609
    Premise: holds
    Serial constraints cleared: none (os-verify-lock depth 1 · go; no open claim on this file surface found in the area:data / area:build board read at 2026-11-23T09:29Z)

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 23, 2026
  6. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH

    Progress · 2026-11-23T14:12Z · still claimed and in flight under repo:objectstack#7; no PR yet. The account hit its 5-hour usage wall at about 2026-11-23T11:59Z and work resumed after the reset (2026-11-23T14:10Z). Next step: the dev pushes a draft PR (Fixes #36190). ETA: within the next 4-hour patrol round.

  7. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH

    Progress · 2026-11-23T19:13Z · still claimed and in flight under repo:objectstack#7. The account hit its 5-hour usage wall at about 2026-11-23T15:06Z; work resumed after the reset (2026-11-23T19:10Z). The dev is finishing the gate union at its new head; next step is the push and L1 review.

  8. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH
    os-dev-report

    {
     "issue": 36190,
     "status": "done",
     "branch": "claude/issue-36190-analytics-single-media-json-refusal",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/36771",
     "session": "session_011y7As5bdhV5T4N9vpjmZzH",
     "premise_still_valid": true,
     "summary": "The native dataset face and the draft preview now refuse scalar comparisons (=, implicit equality, $in, $ne and the rest of JSON_COLUMN_INCOMPATIBLE_OPERATORS) on a single-value media field the storing driver keeps as JSON. They answer 400 INVALID_FILTER with @objectstack/core's single-value-media refusal text, the same text the data door gives. Before this, the native face answered 200 with count 0 for = / $in and count 4 for $ne on the card's fixture, and the preview answered its own counts. The producer of the storage fact is driver-sql: SqlDriver.jsonColumnFieldClass changes from protected to public with no body change. AnalyticsServicePlugin reads it through getDriverForObject into a new optional DatasetScopedStrategyContext / AnalyticsServiceConfig hook. #36168's module gains comparisonColumnClass: the declared JSON shape gives multi-value-or-json as before, otherwise the driver's single-value-media, otherwise the column is not judged. The native unknown-dialect decline reads the same function. driver-turso's REMOTE_FACE_ANSWERS ledger gains an 'inherited' row for the member that is now public. For the sibling #36675: lowerPreviewRowFilters keeps its 5th parameter declaredShape unchanged in name and type, and the driver class comes in as a 6th optional parameter storedJsonClass. After #36675 landed I merged origin/main cleanly, so no call site had to adapt. Data door and ObjectQL face: already compliant. Native face and preview: changed. Surface outside service-analytics: driver-sql/src/sql-driver.ts (visibility, plus a 2-line pointer kept at the facade's 10071-line ceiling) and driver-turso/src/turso-driver.ts (ledger row).",
     "tests": "At head d07e6802 (merged with origin/main after #36675 landed), under os-verify-lock, VERDICT command-exit 0, all parts joined with &&: dogfood closure build; pnpm --filter @objectstack/service-analytics test -> Test Files 226 passed (226), Tests 5774 passed | 345 skipped (6119); service-analytics, driver-sql and driver-turso typecheck exit 0; driver-turso vitest turso-remote-inherited-members + turso-local-remote-single-value-media-refusal-parity -> 2/2 files, 118/118 tests; dogfood -> see dogfood_battery. New file src/__tests__/dataset-single-value-media-refusal-36190.test.ts, 14 tests on a real AnalyticsServicePlugin + ObjectQL + SqlDriver(SQLite) across the native, ObjectQL and preview faces. It pins image and file fields for $eq, implicit equality, $in, $ne and the dataset's own filter, asserting code INVALID_FILTER and status 400, the field named, and the single-value-media diagnostic rather than the multi-value one. Controls: scalar text, $null presence, and the driver's class reading. Ablation at 34268214 through scripts/ablation-replace.mjs: removed the single-value-media arm of comparisonColumnClass (anchor 1->0, blob 0e02e7239009->40f4ddee27aa); 10/14 tests went red and the 4 controls stayed green. The tool restored the file and confirmed the blob equals HEAD and git diff HEAD is empty. No dist preflight was needed because the mutated file is loaded from service-analytics src by relative import.",
     "gates": "node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at d07e6802 derived 79 families. Each ran with its exit code captured before any pipe: 78 exit 0, and pnpm check:type-check-debt exit 3 (PREREQUISITE NOT MET: its closure build did not get a turn on the shared verify lock; two later retries got exit 99 queue-timeout behind another seat's dogfood run). --ran: 79 accounted, 78 run, 1 NOT-MEASURED. That family is covered in CI: 'Type Check · debt ledger' completed success at d07e6802. Also at d07e6802: node scripts/check-platform-checklist.mjs --changed-from origin/main exit 0 (7 anchors judged, 0 lost); node scripts/pm/overlap-check.mjs exit 0 against origin/main 0d727b70; eslint on the 8 touched source files exit 0. Earlier (cd10b19e): overlap-check --pr=36675 exit 0. PR #36771 check-runs at d07e6802 when I read them: Lint & Repo Gates success, Governed Surface Queue Guard success, Dogfood Regression Gate success, Check Changeset success, Live E2E UI success, Test UI success, Type Check · debt ledger success, Type Check · source gates success, Lint · ESLint success, PR-body guards success. Build Core, Test Core (1-10/10), Type Check · workspace and Type Check · consumer gates were in_progress. Type Check UI, Lint UI and Build & E2E UI were skipped (path-scheduled).",
     "dogfood_battery": "d07e6802 · os-verify-lock: VERDICT command-exit 0 (held 3133s) · Test Files 487 passed | 3 skipped (490) · Tests 4125 passed | 68 skipped (4193) · no failures",
     "mcp_calls": "0",
     "api_writes": "3 relay/REST writes plus git pushes: (1) fleet-write relay pr_create -> POST /repos/objectstack-ai/objectstack/pulls (draft) + POST /issues/36771/assignees (os-alice), run 45248414035, success, body read back byte-identical; (2) this os-dev-report comment via scripts/pm/post-stamped.mjs -> POST /repos/objectstack-ai/objectstack/issues/36190/comments. Git pushes to the branch (not REST): the empty-branch probe plus 7 commit pushes.",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed: on a single-value media column inside the ADR-0104 window, $contains is answered as text-match on the native face (a substring of the stored JSON string) while the data door answers it by JSON membership, which finds no rows on a single JSON string. The two faces disagree about an operator the refusal set deliberately leaves out. Not measured end to end, so it is a read-only inference outside the three filing classes. It is not in the PR body: the body is written once at pr_create, before I wrote this note, and its 'No other finding' line predates it. Left for the seat to carry into the acceptance notes. Dedupe words: single-value media $contains, analytics contains media JSON, media column text-match"
     ],
     "deviations": "1) check:type-check-debt NOT MEASURED locally (exit 3, then exit 99 twice); covered by CI's Type Check · debt ledger success. 2) My first full dogfood and gate runs were at cd10b19e. After the #36675 rename and import fixes and the origin/main merge, I re-ran everything at d07e6802; the readings above are all from d07e6802 except the ablation, at 34268214 on unchanged code. 3) origin/main moved 17 commits after d07e6802. None touches the changed files (overlap-check clean), so I did not merge again before opening; per AGENTS.md §10 a later merge is owed only on conflict, a main-caused red or a queue removal.",
     "files_changed": [
      ".changeset/36190-analytics-single-media-json-refusal.md",
      "packages/drivers/driver-sql/src/sql-driver.ts",
      "packages/drivers/driver-turso/src/turso-driver.ts",
      "packages/services/service-analytics/src/__tests__/dataset-single-value-media-refusal-36190.test.ts",
      "packages/services/service-analytics/src/analytics-service.ts",
      "packages/services/service-analytics/src/json-column-comparison-refusal.ts",
      "packages/services/service-analytics/src/plugin.ts",
      "packages/services/service-analytics/src/preview-evaluator.ts",
      "packages/services/service-analytics/src/strategies/native-sql-strategy.ts",
      "packages/services/service-analytics/src/strategies/types.ts"
     ]
    }
  9. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#7 · os-alice · session_011y7As5bdhV5T4N9vpjmZzH
    os-dev-report

    {
     "issue": 36190,
     "status": "done",
     "branch": "claude/issue-36190-analytics-single-media-json-refusal",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/36771",
     "session": "session_011y7As5bdhV5T4N9vpjmZzH",
     "premise_still_valid": true,
     "summary": "Rework round 1 for L1-a REWORK 7112567969 and the nits in L2 PASS 7112462731. New head fe18f109 (from d07e6802). (1) The changeset and PR body now read `Clause-②: yes (narrowing) — widened: …; narrowed: …`, after .changeset/35525. Widened: SqlDriver.jsonColumnFieldClass is now public, also on TursoDriver and SqliteWasmDriver, and the exported AnalyticsServiceConfig gains the optional jsonColumnFieldClass. The 'only becomes public' sentence left the ADR-0087 comment and moved to a visible 'Widened, alongside' paragraph, which also says a subclass redeclaring the member as protected must widen it (N1). The level stays patch, the marker is the same no-migration-prescription, and the title `!` and BREAKING banner are kept. check-adr-0087-registration reads it as [BREAKING+bang+clause-②-narrowing] not-required (no-migration-prescription), exit 0. (2) Added '@objectstack/driver-turso': patch. (3) N3: module prose now covers both classes, the repeated isJsonStoredShape check in whereComparisonColumnClass is dropped, and the split import in preview-evaluator.ts is joined. N2: a moved-deployment control suite (fileColumnsMoved: true) pins that the driver reads neither media column as JSON and that =, $eq and $in answer count 1 on the native, ObjectQL and preview faces for image and file. (4) The $contains reach reading was measured and nothing was changed; it is in out_of_scope_findings and in the PR body's Acceptance notes. The PR body was patched through the relay issue_patch with a signed trailer and read back byte-identical.",
     "tests": "At fe18f109, under os-verify-lock, VERDICT command-exit 0: pnpm --filter @objectstack/service-analytics test -> Test Files 226 passed (226), Tests 5777 passed | 345 skipped (6122). The +3 are the moved-deployment pins. pnpm --filter @objectstack/service-analytics typecheck exit 0. Before that, a run of dataset-single-value-media-refusal-36190.test.ts with the throwaway probe file: 2/2 files, 18/18 tests (17 committed + 1 probe). eslint on the three touched files exit 0. The probe file was deleted before the commit (git status showed only the test file). No ablation: no tested behaviour changed (N3 is prose, an import, and a guard that comparisonColumnClass already applies; N2 only adds a test).",
     "gates": "dispatch-gates --commands at fe18f109: the same 79 families as at d07e6802. Recorded with exit codes: 77 exit 0, and 2 exit 3 PREREQUISITE NOT MET: pnpm check:dual-build-cjs-loads (the fresh worktree has no full-repo dist) and pnpm check:type-check-debt (its closure build did not get a lock turn behind another seat's dogfood run). --ran: 79 accounted, 77 run, 2 NOT-MEASURED. The changeset gates at b1c5d141: check-adr-0087-registration exit 0, check-changeset-no-major exit 0, check-empty-changeset exit 0. PR #36771 check-runs at fe18f109 all completed success, none failed or pending: Lint & Repo Gates (covers dual-build-cjs-loads), TypeScript Type Check, Type Check · debt ledger / source gates / consumer gates / workspace, Build Core, Test Core 1-10/10 and roll-up, Dogfood Regression Gate, Check Changeset, Governed Surface Queue Guard, PR-body guards, Test UI, Live E2E UI, and the seven Lint families. The rest are path-scheduled skipped.",
     "dogfood_battery": "not re-run in this round, as the seat ordered (changeset, prose and test only; no runtime behaviour moved). Last full battery: d07e6802 · VERDICT command-exit 0 · Test Files 487 passed | 3 skipped (490) · Tests 4125 passed | 68 skipped (4193). CI Dogfood Regression Gate success at fe18f109.",
     "mcp_calls": "0",
     "api_writes": "2 relay writes this round: (1) issue_patch on PR #36771's body, PATCH /repos/objectstack-ai/objectstack/issues/36771, relay run 45297732055, success, 12897 bytes read back identical; (2) this os-dev-report comment via post-stamped.mjs, POST /repos/objectstack-ai/objectstack/issues/36190/comments. Git pushes (not REST): 3 (b1c5d141 + 30eb5bf3 together, then fe18f109).",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "class: a · reach: measured at fe18f109 through the production composition each HTTP door calls, not through HTTP itself: the data door's engine find (behind POST /api/v1/data/:object/query) and the dataset door's queryDataset (behind POST /api/v1/analytics/dataset/query) on the #36190 fixture. Stored pic values are the JSON strings \"file_1\" and \"file_2\"; two rows are null. Results for pic {$contains: 'file_1'}: data door 0 rows; dataset native face 200 count 1; dataset ObjectQL face 200 count 0; draft preview 200 count 1. For {$contains: 'file'}: 0 rows / count 2 / count 0 / count 2. For {$contains: '\"file_1\"'}: 0 rows / count 1 / count 0 / count 0. Evidence: the native face falls to text-match over the stored JSON text because whereContainsMembershipSql (contains-membership-sql.ts) asks only the declared shape; the preview text-matches the bare drafted id; the data door and the ObjectQL face run driver-sql's JSON membership, which finds no member in a single JSON string. Three answers for one filter, every one 200. Seam: spec:FILTER_OPERATORS.$contains → runtime:NativeSQLStrategy.buildFilterClause / whereContainsMembershipSql | preview-evaluator matchesWhere. Dedupe words: single-value media $contains, dataset contains media JSON, contains text-match media column, analytics contains three faces"
     ],
     "deviations": "1) check:dual-build-cjs-loads and check:type-check-debt NOT MEASURED locally (exit 3); CI is success at fe18f109 for both (Lint & Repo Gates; Type Check · debt ledger). 2) The worktree was re-created from the remote branch for this round (the earlier one was removed after the first report) and pnpm install ran again. 3) The $contains reading went through the service and engine calls the two HTTP routes make, not through a booted server; the PR body says so. 4) Worktree removed again after this report (node_modules first, no --force); the remote branch head equals local fe18f109.",
     "files_changed": [
      ".changeset/36190-analytics-single-media-json-refusal.md",
      "packages/services/service-analytics/src/json-column-comparison-refusal.ts",
      "packages/services/service-analytics/src/preview-evaluator.ts",
      "packages/services/service-analytics/src/__tests__/dataset-single-value-media-refusal-36190.test.ts"
     ]
    }
  10. removed
    pm:dispatched
    on Nov 26, 2026
  11. github-actions commented on Nov 26, 2026

    @github-actions
    Contributor

    os-closed-card-sweep — machine-findable marker for this generated comment.

    Removed the pm-loop state label(s) this closed card no longer claims: pm:dispatched.

    A state label claims work is in flight. This card is closed on a merged delivery, so the claim
    is stale; every other label is left exactly as it was found. Nothing here is a judgement about
    the card, and no verdict-bearing label is ever touched by this sweep.

    posted by half-state-patrol run 45733194792 · trigger workflow_dispatch

    Generated by Claude Code

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

Metadata

Metadata

Assignees

Labels

area:databugdomain:serverpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions