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 — grist(update-choice-options): a non-list choices value is silently shredded or crashes the tool — a string choice becomes one-character choices and the read-back verification passes the corruption · Issue #6588 · developing-today/code

grist(update-choice-options): a non-list choices value is silently shredded or crashes the tool — a string choice becomes one-character choices and the read-back verification passes the corruption #6588

New issue
Copy link
New issue
Copy link
Closed
#6719
Closed
grist(update-choice-options): a non-list choices value is silently shredded or crashes the tool — a string choice becomes one-character choices and the read-back verification passes the corruption#6588
#6719
Copy link
Labels
app/gristpm-stack/gristkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus/triagedTriaged and routed (see agent note)status:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

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

grist(update-choice-options): a non-list choices value is silently shredded or crashes the tool — a string choice becomes one-character choices and the read-back verification passes the corruption

Evidence (verified this run, laptop @ 9123103 == origin/main)

pm-stack/grist/update-choice-options.py extends a Grist Choice column's options. It reads the column's widgetOptions JSON, merges additions, PATCHes the result back, and verifies by read-back. Nothing checks the shape of what came back:

  • merge_choices (:45) does choices = list(merged.get("choices") or []) at :53. If the stored choices is a string, list() shreds it into characters. If it is a list containing non-strings, they pass through unchecked.
  • get_widget_options (:90) returns json.loads(raw) at :95 verbatim — if the stored widgetOptions JSON parses to a non-object (a string, a list, a number), that value flows straight into merge_choices, where dict(widget_options) raises a raw ValueError. run() (:165) catches only TimeoutError, so the tool dies with a traceback instead of its documented clean exit codes (0 ok / 1 API-or-verification failure / 2 usage).
  • The read-back verification in main (:147) compares read-back choices against the merged value — so a corrupted merge verifies as good. It never compares against the original choices' shape.

Probe (laptop, ~/git/fleet/probe-grist-choices/probe.py, real module imported from the primary tree):

  • Control: merge_choices({"choices": ["code", "infra"]}, ["id"]) → ["code", "infra", "id"] ✔
  • merge_choices({"choices": "code"}, ["id"]) → ['c', 'o', 'd', 'e', 'id'] — the existing choice code is destroyed and replaced with four one-character choices; main would PATCH this and the read-back check at :147 would pass it.
  • merge_choices(json.loads('"justastring"'), ["x"]) → uncaught ValueError: dictionary update sequence element #0 has length 1; 2 is required (traceback out of run(), which catches only TimeoutError).
  • merge_choices({"choices": [1, None, True]}, ["id"]) → [1, None, True, "id"] — non-string choices pass through and would be written back as JSON 1 / null / true choices.

Why it matters

This tool is the supported path for extending Choice columns (#1287): it writes to a live Grist doc and its only safety net is the read-back verification — which compares against the possibly-corrupted merge, not the original data. A widgetOptions value whose choices was written by anything else (a Grist UI change, a manual edit, an older/newer Grist version's serialization, a ChoiceList vs Choice confusion) in a non-list shape is silently destroyed on the next routine --add, with the tool reporting success. The non-object case separately breaks the tool's exit-code contract with a raw traceback.

Acceptance criteria

  • merge_choices (or its caller) refuses a widgetOptions that is not a JSON object, and a choices value that is not a list of strings, with a clear named error — never a shredded/coerced write and never a raw traceback.
  • The refusal happens before any PATCH is sent; the stored column is untouched on a shape failure.
  • The CLI surfaces shape failures through its documented exit-code contract (a clean message on stderr and a non-zero exit, like the timeout path in run()).
  • Tests in pm-stack/grist/test_update_choice_options.py pin: string choices, dict choices, non-object widgetOptions, and a list containing non-string entries — plus the existing controls (normal append, idempotence, empty options, duplicate additions, input not mutated) unchanged.
  • python3 -m unittest test_update_choice_options green in pm-stack/grist (laptop or CI).

Activity

Next
  1. developing-today commented on Nov 6, 2026

    @developing-today
    developing-todayBot
    on Nov 6, 2026 – with developing.today
    Contributor
    More actions

    CODE-2006

  2. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    status/needs-triageNot yet triaged; needs a first look
    priority/normalOrdinary priority (the default)
    app/gristpm-stack/grist
    queue/queuedHas a queued queue task
    on Nov 6, 2026
  3. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator (Lane B), agent slug new-issue-creator-code-b
    • Session / ID: cron job new-issue-creator-code-b, run 2026-11-06 11:50 CST
    • Found via: filed this run
    • Task: Triage the non-list choices shape defect in pm-stack/grist/update-choice-options.py — a string choices value is shredded by list() and PATCHed back with read-back verification passing, and a non-object widgetOptions crashes with a raw ValueError traceback
    • Expectation: effort/s — done when shape validation refuses non-object widgetOptions and non-list-of-strings choices before any PATCH, with tests pinning the probe cases
    • Links: probe ~/git/fleet/probe-grist-choices on the laptop (real module @ 9123103)
  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 6, 2026
  5. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · triage: CONFIRMED

    • Agent: repo queue worker, lane code-t (repo-worker-code)
    • Session / ID: cron repo-queue-worker-shift-t run 2026-11-06; task 11318
    • Found via: claimed task 11318 this shift (triage of issue grist(update-choice-options): a non-list choices value is silently shredded or crashes the tool — a string choice becomes one-character choices and the read-back verification passes the corruption #6588); execution-lane assignment returned direct, so this lane verified it.
    • Fresh verification (laptop primary ~/git/code @ 0819afd0fc5a987b1602ab880f204908a2183f08, real module imported):
      • Control: merge_choices({"choices": ["code", "infra"]}, ["id"]) → ["code", "infra", "id"] ✔
      • String choices: merge_choices({"choices": "code"}, ["id"]) → ['c', 'o', 'd', 'e', 'id'] — shredding reproduced exactly as filed.
      • Non-object widgetOptions: merge_choices(json.loads('"justastring"'), ["x"]) → uncaught ValueError: dictionary update sequence element #0 has length 1; 2 is required (run() catches only TimeoutError).
      • Non-string entries: merge_choices({"choices": [1, None, True]}, ["id"]) → [1, None, True, "id"] — pass through unchecked.
      • New datapoint (not in the original filing): dict choices merge_choices({"choices": {"a": 1}}, ["id"]) → ['a', 'id'] — a dict is silently replaced by its keys. Same defect class; the routed fix's tests already pin the dict case.
      • Source confirms the mechanism on current main: list(merged.get("choices") or []) at pm-stack/grist/update-choice-options.py:53; get_widget_options returns json.loads(raw) verbatim; read-back in main compares against the merged value.
    • Verdict: CONFIRMED, live on current main, no hard-stop labels. Routed as a single small_fix follow-up task (dedupe repo-health:v1:fix:developing-today/code:issue:6588) carrying issue grist(update-choice-options): a non-list choices value is silently shredded or crashes the tool — a string choice becomes one-character choices and the read-back verification passes the corruption #6588's acceptance criteria verbatim. Task 11318 completes as triaged.
    • Links: task 11318 · issue grist(update-choice-options): a non-list choices value is silently shredded or crashes the tool — a string choice becomes one-character choices and the read-back verification passes the corruption #6588
  6. 23 remaining items

  7. dezren39
    added
    work/assignedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    on Nov 7, 2026
  8. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-i
    • Session / ID: repo-queue-worker-shift-i, 2026-11-06 20:28 CST — FALLBACK MODE (queue backend down: fleet queue health HTTP 503 PGRST002, exit 4; outage tracked as issue infra: repo-queue PostgREST timeout: global failures lane-visible again — recurrence after #6450 closed (2026-11-06 21:15-21:31Z) #6619). Fallback claim on issue grist(update-choice-options): a non-list choices value is silently shredded or crashes the tool — a string choice becomes one-character choices and the read-back verification passes the corruption #6588; lane code-p released it free earlier and this lane claimed it fresh after that release.
    • Found via: fallback scan (claimable, released/free)
    • Task: Add shape validation to pm-stack/grist/update-choice-options.py: refuse a non-object widgetOptions and a non-list-of-strings choices with a named error before any PATCH, surfaced through the documented exit-code contract (clean stderr, exit 1 via run()), with tests pinning the probe cases from this issue.
    • Expectation: effort s — script fix + tests in pm-stack/grist/test_update_choice_options.py, branch + PR, merge under the standing criteria if verified.
    • Links: branch queue/fallback-6588-grist-choices-shape, laptop worktree ~/git/fleet/fb-6588
  9. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    Progress from repo-worker-code-i: picked up: script and existing tests read on current main; fix = WidgetOptionsError shape validation in merge_choices + get_widget_options, run() maps it to exit 1 before any PATCH; next: laptop worktree + implementation

  10. developing-today
    added
    status:in-review
    on Nov 7, 2026
  11. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    Progress from repo-worker-code-i: pr_opened: PR for issue #6588 opened (branch queue/fallback-6588-grist-choices-shape, commit fc49b8d); unittest 15/15 green on laptop, pre-fix suite fails (1 failure + 8 errors); next: PR checks + Codex, then merge under standing criteria

  12. dezren39
    added a commit that references this issue on Nov 7, 2026

    Merge pull request #6719 from developing-today/queue/fallback-6588-gr…

    ae31c5d
  13. dezren39
    closed this as completedin #6719on Nov 7, 2026
  14. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 7, 2026
  15. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane code-i
    • Session / ID: repo-queue-worker-shift-i, 2026-11-06 20:28 CST — FALLBACK MODE (queue backend down, issue infra: repo-queue PostgREST timeout: global failures lane-visible again — recurrence after #6450 closed (2026-11-06 21:15-21:31Z) #6619); fallback claim on issue grist(update-choice-options): a non-list choices value is silently shredded or crashes the tool — a string choice becomes one-character choices and the read-back verification passes the corruption #6588
    • Found via: fallback scan (claimable; released free by lane code-p, claimed fresh after)
    • Task: Add shape validation to pm-stack/grist/update-choice-options.py so a malformed stored widgetOptions/choices is refused by name before any PATCH.
    • Outcome: fixed_merged — PR grist(update-choice-options): refuse widgetOptions/choices shape failures by name (#6588) #6719 merged (merge commit ae31c5d); this issue auto-closed by the merge.
      • New check_widget_options + WidgetOptionsError: stored widgetOptions must be a JSON object and choices (when present, non-null) a list of strings; merge_choices and get_widget_options both validate (invalid JSON included), so refusal happens before any PATCH is built and the stored column is untouched on a shape failure.
      • run() maps the error to a clean stderr message + exit 1, matching the documented exit-code contract (the timeout path's shape). Null/absent choices keep their existing no-choices meaning.
      • Tests: python3 -m unittest test_update_choice_options — 15/15 green on the laptop, including new merge-level cases (string/dict choices, non-object widgetOptions, non-string entries) and CLI-level cases pinning exit 1 with zero PATCHes sent. Against the pre-fix script the suite fails (1 failure + 8 errors) and prints the shredding it prevents (code -> ['c', 'o', 'd', 'e', 'id']).
      • Codex review on PR grist(update-choice-options): refuse widgetOptions/choices shape failures by name (#6588) #6719: zero findings. PR checks (scripts-test) still QUEUED at merge (runner backlog) — merged under the standing criteria on the laptop verification above.
    • Links: PR grist(update-choice-options): refuse widgetOptions/choices shape failures by name (#6588) #6719 grist(update-choice-options): refuse widgetOptions/choices shape failures by name (#6588) #6719 · branch queue/fallback-6588-grist-choices-shape
  16. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    on Nov 7, 2026
  17. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    Released by repo-worker-code-i (outcome: done). Outcome: fixed_merged. PR #6719 merged (merge commit ae31c5d); issue #6588 auto-closed. update-choice-options.py now validates stored widgetOptions/choices shape via check_widget_options/WidgetOptionsError before any PATCH (string choices refused, not shredded; non-object and invalid-JSON refused by name), surfaced as clean stderr + exit 1 via run(). Tests 15/15 green on laptop; pre-fix suite fails (1 failure + 8 errors). Codex zero findings on PR #6719.

  18. dezren39
    removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/gristpm-stack/gristkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus/triagedTriaged and routed (see agent note)status:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      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.