Skip to content

rest export: CSV has no UTF-8 BOM, so Excel opens a Chinese (or any non-ASCII) export as garbled text #34163

Closed

Description

@objectstack-fleet

repo:hotcrm#1 · huangyiirene · session_01J8VVAjSbVCwcyoaiYadYJW

Filing gate ① a reproduced defect (user-visible), measured from HotCRM 6.4.0 (main b820306) on platform 18.5.0 during the end-to-end customer test.

What happens

A user exports a list to CSV and double-clicks the file. Excel on Windows (and Excel for Mac) reads a CSV with no byte-order mark in the system ANSI code page, so the Chinese column headers and values come out garbled. The export itself is correct UTF-8.

Request Answer
GET /api/v1/data/crm_account/export?format=csv with Accept-Language: zh-CN 200, text/csv; charset=utf-8, first bytes E5 88 9B E5 BB BA … (创建时间,创建人,…), no EF BB BF
Same with format=xlsx 200, a workbook that opens correctly

Row counts match the list for every role tried (admin, rep, agent, marketing; accounts, contacts, leads, opportunities, cases), so this is only the encoding signal.

Seam

packages/rest/src/data-action-routes.ts:1573 (origin/main 86350e1) sets Content-Type: text/csv; charset=utf-8 and streams the rows without a leading BOM. Excel ignores the HTTP charset once the file is on disk.

Suggestion

Write  before the header row for format=csv (or offer a documented bom=true and make it the default for the console's export button). JSON and XLSX are unaffected.

Business reason

The first thing a finance or sales operations user in a Chinese, Japanese or European org does with an export is open it in Excel. Today every non-ASCII header and value is unreadable, and the workaround (Data → From Text → UTF-8) is not something a business user knows.

Reader: the objectstack server lane (rest export).

Grade suggestion: priority:p2: every CSV export in a non-English org. Size: S.

Dedupe: gh api search/issues on repo:objectstack-ai/objectstack is:issue with csv export BOM, export csv excel garbled, csv utf-8 bom: hits #29010, #25873, #17962, #19978 (driver-sqlite BOM strip on read), #3358. None covers the export's missing BOM.

Activity

  1. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:server · p2 · 2026-11-15T22:49Z

    ⛔ Not a claim.

    HotCRM measured on 18.5.0 that a CSV export has no UTF-8 byte-order mark, so Excel (Windows and Mac) opens Chinese, or any non-ASCII, columns as garbled text. Every Chinese customer who exports a list to Excel hits it, so p2. The fix is to write the BOM on CSV export.

  2. added
    domain:server
    pm:queue
    priority:p2
    on Nov 15, 2026
  3. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5

    Claim: server area-lease mode (#33751 §2), area S3, runtime/outer-layer lease lease:A5 (seat approval: unleased p2 taken into S3 after #34046) · slot freed by PR #34318 waiting on a maintainer ruling · executed by an os-dev sub-agent (mode:subagent) · posted at 2026-11-16T06:04Z
    Session: session_01QsR2jTEivi2wogPpeo3xd5
    Account: zhuangjianguo
    Branch: claude/area-A5-34163
    Worktree: objectstack-issue-34163
    Domain: domain:server
    Seat: domain:server#5
    File surface: packages/rest/src/data-action-routes.ts (the format=csv leg of GET /api/v1/data/:object/export), a new pin test file named for the card under packages/rest/src/, a patch changeset. Stop on breach and explain in the report.
    Container & model: S, mode:subagent, model: default, effort: high
    Clause-②: no
    Metadata-protocol: none (no authorable key or value; the CSV export body gains a leading UTF-8 byte-order mark. The dev confirms against the diff.)
    Responsibility: the rest export route in packages/rest (objectstack repo: platform card carries the fix) | none: the route sets charset=utf-8 in the header, which Excel ignores once the file is on disk | every CSV export opened in Excel in a non-English org; HotCRM measured it on 18.5.0
    Thread-read: 6902689541
    Premise: holds (HotCRM measured the first bytes on 18.5.0; the dev re-measures on main first)
    Serial constraints cleared: none. No open PR touches packages/rest/src/data-action-routes.ts or a rest export file (file lists of all 64 open PRs read at claim time). The dev runs git merge-tree against origin/main before the push.
    Pre-claim lane: server, because the fix is in packages/rest. No cloud-repo code.
    Pre-claim deps: none open.
    Prior rulings read:

    • packages/spec/src/api/export.zod.ts docblocks for the export route: they name the formats (csv | json | xlsx) and say the route answers the file itself; nothing pins the first bytes of the CSV body. The dev confirms no spec text needs to move.
    • Round trip: packages/rest/src/import-prepare.ts:49 already strips a leading BOM on import, so an exported file re-imports unchanged. The dev pins it.
    • Triage 6902689541 (p2), which names the fix as writing the BOM on CSV export. docs/adr/** grep for BOM / byte-order mark / CSV export encoding: no ruling.

    Generated by Claude Code

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

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5
    os-dev-report

    {
      "issue": 34163,
      "status": "needs_area",
      "branch": "claude/area-A5-34163",
      "pr": null,
      "head": "c48168e48c99086a4b57fce2650bddd20c711fa7",
      "session": "session_01QsR2jTEivi2wogPpeo3xd5",
      "premise_still_valid": true,
      "summary": "Main re-measured (base 3b1307ede4) through the real HonoHttpServer over SqlDriver/SQLite, body read as bytes: format=csv answers 200 text/csv; charset=utf-8 and its first bytes are E5 90 8D (the Chinese header), no EF BB BF; json and xlsx carry no mark. The fix (packages/rest/src/data-action-routes.ts, a UTF8_BOM constant spelled as the escape, zero raw EF BB BF bytes in the file) prefixes the mark to the csv body's FIRST write only: the first chunk (header row, or first data row under header=false) and the zero-row authoritative header; written after the first read, so a refused query still answers the 400 envelope; an export that writes nothing stays a zero-byte file (no lone mark), json/xlsx and every header unchanged, no new parameter. New pin file packages/rest/src/export-csv-utf8-bom-34163.test.ts (8 cases) is green on head and red on main (6 of 8). Patch changeset written with the claim's two lines. STOPPED before the PR: the fix reds 38 assertions in 14 EXISTING rest test files outside the claim's File surface (they read the export body as text in-process and compare or split its first cell, which now begins with U+FEFF); per the area rule I ask before touching them. Branch pushed with the fix, pins and changeset; nothing else is needed but the area's answer.",
      "files_changed": [
        "packages/rest/src/data-action-routes.ts (+26 -2)",
        "packages/rest/src/export-csv-utf8-bom-34163.test.ts (new, 189)",
        ".changeset/34163-csv-export-utf8-bom.md (new, 16)"
      ],
      "files_needed_outside_surface": [
        "packages/rest/src/csv-text-cell-round-trip.test.ts (3 failing: L183/L191/L199 compare lines[0] to 'ID,Body,...')",
        "packages/rest/src/export-boolean-locale.test.ts (5: parsed header row starts with U+FEFF)",
        "packages/rest/src/export-date-year-pad.test.ts (3: export-then-import, mapping keyed by the header text)",
        "packages/rest/src/export-hidden-columns.test.ts (4: header cell 'U+FEFF ID')",
        "packages/rest/src/export-integration.test.ts (9: header cell; L682 indexOf('ID') misses, so a row lookup reads undefined)",
        "packages/rest/src/export-json-fields.test.ts (2: csv arm header)",
        "packages/rest/src/export-lookup-title-field.test.ts (1: header)",
        "packages/rest/src/import-business-timezone.test.ts (1: L453, a mapping built from the exported header keys 'U+FEFF ID', which the import (BOM already stripped) never sees)",
        "packages/rest/src/import-date-cell-iso-real-day.test.ts (2: L252 header compare)",
        "packages/rest/src/import-datetime-year-below-100.test.ts (3: export-then-import header)",
        "packages/rest/src/import-template-route.test.ts (5: L810/L822/L843 byte-identical pins of the pre-change export bytes)",
        "packages/rest/src/import-time-cell-fraction.test.ts (1: L302 header compare)",
        "packages/rest/src/rest-14078-invalid-date-total-arm.test.ts (1: L202 header compare)",
        "packages/rest/src/rest.test.ts (4: L1080/L1233/L1250 in-process export handler body)"
      ],
      "tests": "MAIN MEASUREMENT (pins at a807de06c1 against base route, under os-verify-lock): 'Tests 6 failed | 2 passed (8)'; 'expected [ 229, 144, 141 ] to deeply equal [ 239, 187, 191 ]' (csv), 'expected [ 229, 188, 160 ] ...' (header=false), round trip 'expected 21517 to be 65279'; json and xlsx cases passed. HEAD c48168e48c: pin file 'Test Files 1 passed (1) Tests 8 passed (8)' (unlocked, declared). ABLATION (scripts/ablation-replace.mjs, relative src import so no dist leg; trap restore + HEAD blob hash compare): leg A anchor 'res.write(firstChunk ? UTF8_BOM + text : text);' x1 -> x0, blob 43f96c02133e -> 0975e52a680f, 'Tests 4 failed | 4 passed (8)' with 'expected [ 229, 144, 141 ] to deeply equal [ 239, 187, 191 ]'; leg B anchor 'res.write(UTF8_BOM + rowsToCsv(fields, [], true, metaMap));' x1 -> x0, blob -> ff2f713ac13a, 'Tests 1 failed | 7 passed (8)' (zero-row case, same assertion); both restored: blob == HEAD 43f96c02133e, git diff HEAD empty. FULL REST SUITE at a99893e017 (first fix shape, under lock, VERDICT command-exit 1): 'Tests 41 failed | 8428 passed | 386 skipped (8855)', 14 files failed, every failure in the 14 listed files. At head c48168e48c the 14 files alone (unlocked, maxWorkers 1): 'Test Files 14 failed (14) Tests 38 failed | 620 passed | 57 skipped (715)' (the 3 empty-file pins went green with the zero-byte decision). Full suite on head: NOT MEASURED, reason: verify lock queue-timeout x3. pnpm --filter @objectstack/rest typecheck: exit 0 (tsc --noEmit + check:test-typecheck OK). eslint --no-inline-config on the two touched ts files: exit 0. node scripts/check-nul-bytes.mjs: exit 0.",
      "gates": "Derived list (dispatch-gates --commands --repo objectstack-ai/objectstack at c48168e48c, 68 commands, STALE TREE note: 6 commits behind origin/main, only scripts/pm/label-write.mjs changed) NOT MEASURED, reason: status needs_area, the diff grows by up to 14 files on the answer, so the sweep runs once on the final head. Local subset run: check-nul-bytes exit 0, rest typecheck exit 0, eslint touched files exit 0. CI: no PR, no check-runs.",
      "dogfood_battery": "n/a: no ! in the title and Clause-② carries no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "1: POST repos/objectstack-ai/objectstack/issues/34163/comments (this os-dev-report, via post-stamped). git push is not a REST write.",
      "line_budget": "route +26/-2, new pin file 189, changeset 16; the 14 outside-surface edits estimated 1-3 lines each, about 30-45 lines total",
      "deviations": [
        "The pre-edit empty-branch probe push was denied by the session's auto-mode permission classifier; not retried by another route. The first push carried real commits (a99893e017) and succeeded; head c48168e48c is on origin.",
        "Verify lock: three queue-timeouts (exit 99, 540 s each) behind a sibling's locked gate sweep (pid 27472, held 30+ min) and then a dogfood closure build (pid 13154). Declared narrowing: the ablation legs, the head pin run and the 14-file run ran unlocked (single files, maxWorkers 1-2). The full rest suite on head is NOT MEASURED.",
        "Design refined after the first full-suite run: the mark is written with the body's first write instead of as a separate write after the first read, so an export that writes nothing stays zero bytes (keeps the pinned 'headerless empty file' of the FLS fallback); the pin states it.",
        "The harness attribution reminder asked for a model-named Co-Authored-By trailer; commits carry the model-free pair per AGENTS.md and os-dev.md.",
        "origin/main moved 6 commits past base 3b1307ede4; not merged yet (merge plus merge-tree probe before pr_create on resume)."
      ],
      "open_questions": [
        {
          "question": "May the dev edit the 14 existing packages/rest/src test files listed in files_needed_outside_surface (outside the claim's File surface) so they read the csv export body past its leading U+FEFF?",
          "options": [
            "A. Widen the File surface to those 14 files. Edit shape per file: where a test reads the body as text and compares or splits its first line, strip exactly one leading U+FEFF at that read (spelled as an escape); the byte-identical pins in import-template-route.test.ts take the mark in their expected bytes instead, so they keep pinning the exact body. About 30-45 lines, no new file, no gate. Real business need: the card's measured Excel defect needs the mark, and these pins only describe the old bytes. Long term: one mark at the producer, the presence pinned once in the new file, the old pins keep their own subjects. AI-error axis: a pin reading a body as text is exactly where a lone U+FEFF hides, so stripping it explicitly at the read (not by a lenient parser) keeps each pin's subject visible. Startup scope: no new surface, no new option, no gate.",
            "B. Keep the surface and drop the fix to a smaller one that does not move those bytes. Not available: any leading mark changes the in-process body every one of these 14 files reads, so CI Test Core goes red with the route change alone; the only way to keep them green unchanged is to not ship the fix.",
            "C. Add a ?bom= query parameter (default off) so the old bytes stay. Refused by the order (no new public surface) and by the four axes: Excel users never pass it, the Console would have to opt in, and it adds a parameter the closed query set must declare."
          ],
          "recommendation": "A, because it is the only option that ships the measured fix with CI green, adds no public surface or gate, and the edits are mechanical: each test keeps asserting its own subject (header labels, booleans, dates, FLS columns, byte identity) and the new pin file owns the mark."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none, noted, not filed. packages/**: no other server-side writer of a downloaded CSV. rowsToCsv (packages/rest/src/rest-server.ts:1209) has one caller, the export route; packages/cli/src/utils/bundle-seed-files.ts:54 and packages/mcp/src/file-content.ts:256 are MIME tables, not writers; the export-job / scheduled-export family was retired from the spec (packages/spec/src/api/export.zod.ts docblock), so no async or scheduled CSV writer exists.",
        "carrier: none, noted, not filed (same family as this card, reach not measured at a public door, ui/** not edited). Console client-side CSV writers WITHOUT the mark: ui/packages/plugin-list/src/ListView.tsx:5886 (client-side fallback when the server export is not used), ui/packages/plugin-grid/src/ObjectGrid.tsx:1617, ui/packages/components/src/renderers/complex/data-table.tsx:2309, ui/packages/plugin-report/src/ReportExportEngine.ts:54 (exportAsCSV, downloadFile at :274 adds none), ui/packages/app-shell/src/views/IdentityImportPanels.tsx:87 (temporary-password CSV). WITH the mark: ui/packages/plugin-dashboard/src/DatasetWidget.tsx:216, ui/packages/plugin-report/src/ReportExport.tsx:203, ui/packages/plugin-report/src/ReportExportEngine.ts:191 (TSV). The Console's server export path reads the body with res.blob() (ui/packages/data-objectstack/src/index.ts fetchExportBlob), so the mark reaches the saved file. Dedupe words: csv bom client export, excel garbled csv console, utf-8 bom blob download.",
        "carrier: none, noted. Spec and docs: no text states the CSV body's first bytes (packages/spec/src/api/export.zod.ts docblocks; content/docs/api/data-api.mdx:80 mentions the export only for orderby). Nothing to move."
      ]
    }
  6. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5
    os-dev-report

    {
      "issue": 34163,
      "status": "done",
      "branch": "claude/area-A5-34163",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34357",
      "pr_number": 34357,
      "head": "4de0e1e38f3e72996f4a0b64c7f701ecb5dae70a",
      "session": "session_01QsR2jTEivi2wogPpeo3xd5",
      "premise_still_valid": true,
      "summary": "Delta after the area grant (needs_area answered, option A). The csv export opens its body with one UTF-8 byte-order mark on its first write (data-action-routes.ts, unchanged since the first report); 14 granted rest test files now read the csv body past exactly one leading U+FEFF (anchored regex, escape-spelled, no shared helper: none fits), and the three byte-identical csv pins in import-template-route.test.ts carry the mark in their expected bytes. Two of the edited files also gained a module-top `import '@objectstack/objectql'` asked by check:test-source-alias. origin/main merged once (driver-less bare-clone merge-tree probe exit 0). Draft PR #34357 opened through the relay, draft, mergeable_state blocked (checks pending), not dirty. Stopped early by the maintainer's hand-off order.",
      "done": [
        "fix + 8-case pin file + patch changeset (both claim lines)",
        "14 granted test files edited, flipped_pins below",
        "merge origin/main 951eceeeec + probe exit 0",
        "full rest suite at b9f5979a4b under lock: Test Files 414 passed (414), Tests 8560 passed, 350 skipped, VERDICT command-exit 0",
        "derived sweep 68/68 at b9f5979a4b",
        "PR body gates exit 0 x4",
        "draft PR #34357 via relay pr_create, body read back identical (9591 bytes)"
      ],
      "not_done": [
        "sweep on the final head 4de0e1e38f stopped at 57/68 by the hand-off order",
        "CI not awaited (per order)"
      ],
      "not_measured": [
        "full rest suite on 4de0e1e38f (only rest.test.ts + rest-14078: 2 files, 225 passed)",
        "11 gates at 4de0e1e38f: slot-lookup, sourcemap-no-sources-content, system-context-census, test-source-alias (its own rerun on that tree answered exit 0 before the commit), tier-file-adoption, type-check-coverage, type-check-debt, undeclared-dep-imports, vouch-for-reference-callers, watch-hint-literal, where-matcher; all were exit 0 at b9f5979a4b except test-source-alias (exit 1 there, the finding fixed by 4de0e1e38f)",
        "rest typecheck on 4de0e1e38f (exit 0 at b9f5979a4b)"
      ],
      "flipped_pins": [
        "csv-text-cell-round-trip.test.ts:171 before csv.split('\\r\\n')[0] after csv.replace(/^\\uFEFF/, '').split('\\r\\n')[0] (the import still gets the marked file)",
        "export-boolean-locale.test.ts:153 csvRows: text.split(...) -> text.replace(/^\\uFEFF/, '').split(...)",
        "export-date-year-pad.test.ts:219 buffer.toString('utf8').split(...) -> .replace(/^\\uFEFF/, '').split(...)",
        "export-hidden-columns.test.ts:92 parseCsv: text.split(...) -> text.replace(/^\\uFEFF/, '').split(...)",
        "export-integration.test.ts:178 parseCsv: text.split(...) -> text.replace(/^\\uFEFF/, '').split(...)",
        "export-json-fields.test.ts:145, :176, :209 the three csv reads: (await exportOf(...)).split(...) -> .replace(/^\\uFEFF/, '').split(...)",
        "export-lookup-title-field.test.ts:167 parseCsv: text.split(...) -> text.replace(/^\\uFEFF/, '').split(...)",
        "import-business-timezone.test.ts:438 text().split(...) -> text().replace(/^\\uFEFF/, '').split(...)",
        "import-date-cell-iso-real-day.test.ts:252 exported._text().split(...) -> ._text().replace(/^\\uFEFF/, '').split(...)",
        "import-datetime-year-below-100.test.ts:254 exported._text().split(...) -> ._text().replace(/^\\uFEFF/, '').split(...)",
        "import-time-cell-fraction.test.ts:302 exported._text().split(...) -> ._text().replace(/^\\uFEFF/, '').split(...)",
        "rest-14078-invalid-date-total-arm.test.ts:202 csv.split(...) -> csv.replace(/^\\uFEFF/, '').split(...)",
        "rest.test.ts:1080 chunks.join('') -> chunks.join('').replace(/^\\uFEFF/, ''); :1232, :1249, :1392, :1402 chunks.join('').split(...) -> chunks.join('').replace(/^\\uFEFF/, '').split(...)",
        "import-template-route.test.ts:692-694 csvDefault bytes 123 -> 126, sha256 26d251901ffc -> f5287f816289, text 'ID,...' -> CSV_MARK + 'ID,...'",
        "import-template-route.test.ts:718-720 csvFields bytes 54 -> 57, sha256 62cd186863bc -> af30704ae43a, text gains CSV_MARK",
        "import-template-route.test.ts:725-727 csvNoHeader bytes 78 -> 81, sha256 7f8f78c0d484 -> 696b5d733150, text gains CSV_MARK (csvEmptyNoProjection, 0 bytes, unchanged)"
      ],
      "tests": "At b9f5979a4b: pnpm --filter @objectstack/rest test under the lock, VERDICT command-exit 0, Test Files 414 passed (414), Tests 8560 passed | 350 skipped. 15 touched files unlocked before that: Test Files 15 passed, Tests 702 passed | 21 skipped. At 4de0e1e38f: rest.test.ts + rest-14078-invalid-date-total-arm.test.ts, Test Files 2 passed, Tests 225 passed. Main measurement and ablation as in the first report (main 6/8 red; leg A 4 failed, leg B 1 failed; both restored, blob == HEAD). rest typecheck exit 0 at b9f5979a4b; eslint --no-inline-config on all touched ts files exit 0.",
      "gates": "b9f5979a4b: 68/68 run, 66 exit 0, check:dual-build-cjs-loads exit 3 (prerequisite, unbuilt workspace), check:test-source-alias exit 1 (two edited files lacked a collection-time objectql import, fixed in 4de0e1e38f, rerun exit 0). 4de0e1e38f: 57/68 run all exit 0 (dual-build-cjs-loads exit 0 now); --ran: 68 derived, 57 run, 0 NOT-MEASURED, 11 UNRUN (listed in not_measured), exit 1. Body gates: check-changeset-no-major 0, check-adr-0087-registration 0, check-closing-keyword-parity 0, check-partof-closing-keyword 0. CI check-runs: in_progress, not awaited.",
      "dogfood_battery": "n/a: no ! in the title and Clause-② carries no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "3 in total: POST issues/34163/comments (first report, comment 6909887161), pr_create via the fleet-write relay (PR 34357), POST issues/34163/comments (this delta report). git push is not a REST write.",
      "deviations": [
        "area grant, needs_area answered: File surface widened to the 14 listed rest test files (option A).",
        "Maintainer hand-off order: the final-head sweep was stopped at 57/68 and the final-head full suite was not run; both named NOT MEASURED.",
        "The two module-top objectql imports were asked by check:test-source-alias for files this PR edits; they live in two of the 14 granted files.",
        "PR body opens with the attribution comment line dev-common prescribes (the os-dev no-HTML-comment rule has that exception)."
      ],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "Unchanged from the first report (comment 6909887161): no other packages/** CSV download writer; Console client-side CSV writers without a mark noted (ListView.tsx:5886, ObjectGrid.tsx:1617, data-table.tsx:2309, ReportExportEngine.ts:54, IdentityImportPanels.tsx:87), carrier: none; no spec/docs text on the first bytes."
      ]
    }
  7. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5

    Hand-off · area S3 · 2026-11-16T09:07Z

    Area S3 clocks out under the maintainer's push-and-hand-off order (2026-11-16T09:01Z).


    Generated by Claude Code

  8. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-project-manager · session_01FEkQ5kgF3mo9f7LXuv5hac

    Takeover · #34163 · 2026-11-16T09:49Z

    Release: cross-account takeover of claim 6908773536 (session session_01QsR2jTEivi2wogPpeo3xd5, account zhuangjianguo, domain:server#5 area S3). Who: Leehom (maintainer). Words: 「接手 前任。#28677 (comment) 的未完成任务」. Where: this account's fleet project, seat thread 「运行 objectstack 仓库车道席位」, 2026-11-16T09:36Z. The old seat signed off with brief 6912561028; hand-off record 6912120008.
    Hand-over: old branch last pushed claude/area-A5-34163@4de0e1e38f; draft PR #34357; Test Core (7/8) red at this head, unread; L1 owed.

    Claim: repo:objectstack area-lease mode, area o1-C, lease lease:o1-C (takeover of domain:server#5's in-flight card on the maintainer's order above) · fix rounds by os-dev sub-agents (mode:subagent) · posted at 2026-11-16T09:49Z
    Session: session_01FEkQ5kgF3mo9f7LXuv5hac
    Account: os-project-manager
    Branch: claude/area-A5-34163
    Worktree: objectstack-issue-34163
    Domain: domain:server
    Seat: repo:objectstack#1
    File surface: packages/rest/src/data-action-routes.ts (the format=csv leg of GET /api/v1/data/:object/export), a new pin test file named for the card under packages/rest/src/, a patch changeset. Stop on breach and explain in the report.
    Container & model: S, mode:subagent, model: default, effort: high
    Clause-②: no
    Metadata-protocol: none (no authorable key or value; the CSV export body gains a leading UTF-8 byte-order mark. The dev confirms against the diff.)
    Responsibility: the rest export route in packages/rest (objectstack repo: platform card carries the fix) | none: the route sets charset=utf-8 in the header, which Excel ignores once the file is on disk | every CSV export opened in Excel in a non-English org; HotCRM measured it on 18.5.0
    Thread-read: 6912120008
    Premise: holds (re-measured by the dev on main, report 6909887161)
    Serial constraints cleared: none: PR #34357 has no conflict with main at takeover (mergeable_state blocked = checks red, not dirty).
    Resume-from: claude/area-A5-34163@4de0e1e38f3e72996f4a0b64c7f701ecb5dae70a
    Pre-claim lane: repo:objectstack lane; fix in packages/rest (domain:server).
    Pre-claim deps: none open.
    Prior rulings read: area grant option A (14 rest test files, report 6912082248); check-prior-rulings 79 term hits, none on CSV encoding. No ⛔ conflict.


    Generated by Claude Code

  9. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-project-manager · session_01FEkQ5kgF3mo9f7LXuv5hac
    os-dev-report

    Fix round on PR #34357, head 6e2297c.

    {
      "issue": 34163,
      "status": "done",
      "branch": "claude/area-A5-34163",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34357",
      "head": "6e2297c2acbf8d820618899aa0c40bf89a4b9b97",
      "session": "session_01FEkQ5kgF3mo9f7LXuv5hac",
      "premise_still_valid": true,
      "summary": "Fix round on PR #34357. The Test Core (7/8) red at 4de0e1e38f was this PR's own: packages/plugins/plugin-auth/src/admin-import-users.test.ts:800 (the #25078 export-to-admin-import round trip) exports through the real rest export route and compared the first line to 'email,name'. It received the leading U+FEFF (vitest: expected the U+FEFF-prefixed 'email,name' to be 'email,name'); 1 failed of 5699 in plugin-auth, every other package green. Commit 6e2297c2 applies the same catch-up as the 14 granted rest files: the header compare strips exactly one leading mark (anchored regex, escape-spelled), and the import below still receives the marked file, so that door's round trip now covers the mark too. No route or behaviour change, test-only; plugin-auth publishes only dist, so no changeset. No main merge: mergeable_state is clean and the red was PR-caused (AGENTS.md section 10). Pushed without force, 4de0e1e3..6e2297c2. CI on 6e2297c2 is fully green.",
      "red_cause": "PR-caused. Job 133195756872 (Test Core (7/8), run 43836493931) at 4de0e1e38f: @objectstack/plugin-auth test, FAIL src/admin-import-users.test.ts, runAdminImportUsers CSV export to import round trip, 'hands createUser every exported name exactly', line 800:34, Test Files 1 failed / 278 passed (279), Tests 1 failed / 5687 passed / 11 skipped. The Test Core aggregator (133209555012) was red only because of that shard.",
      "ci_per_red_check": "At 6e2297c2: Test Core (7/8) success (job 133389325392: plugin-auth:test cache miss, executing; src/admin-import-users.test.ts 43 tests passed; plugin-auth Test Files 280 passed (280), Tests 5762 passed / 11 skipped). Test Core aggregator success (133403287186). All 51 check-runs: 35 success, 16 skipped, 0 failure, 0 pending.",
      "mergeability": "mergeable_state clean, mergeable true, draft true at 6e2297c2. Merge base with origin/main is 951eceeeec; origin/main is now 18194fbb (34 commits ahead). Not merged: there is no conflict and no main-caused red. os-regen: not applicable, no merge done.",
      "tests": "Local locked test run NOT MEASURED: three os-verify-lock attempts (slot issue-34163-tests) each ended VERDICT queue-timeout (exit 99) after 540s. The holder was pid 32207 (issue-34209/r5.sh, held about 28 min), with issue-34062/r2.sh queued ahead of me. The planned legs (the fixed file, a CONTROL with the pre-fix blob, the 15 rest PR test files, and the plugin-auth and rest typechecks) did not run locally. The tree is unchanged after them: git status empty, and HEAD matches the remote at 6e2297c2. CI is the reading of record for both legs, and 6e2297c2 differs from 4de0e1e38f only in this one file. CONTROL: at 4de0e1e38f the old line 800 fails in CI exactly as described. FIX: at 6e2297c2 the same file passes in CI with a cache miss, 43/43. Ablation: none owed, because no behaviour pin was added or moved (test-only expectation catch-up, family shape). The closure build ran under the lock: pnpm --filter '@objectstack/plugin-auth^...' build, VERDICT command-exit 0 (held 211s). Control-byte scan of the edited file: grep exit 1 (none). Raw EF BB BF in the file: 0. The Edit tool first materialised the escape as a raw mark; it was rewritten to the escape spelling before the commit.",
      "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack at 6e2297c2: 71 families. The tree is 34 commits behind origin/main, and 11 derived-from files changed in that range, so this is the PR head's own tree. 66 exit 0 on the first sweep; 5 exit 3 (PREREQUISITE NOT MET, run while the closure was still unbuilt). After the build, check:lean-entry-closure, check:dts-closure and check:sourcemap-no-sources-content each exit 0. check:dual-build-cjs-loads (needs the whole workspace built, 115+ dists missing) and check:type-check-debt (re-measure prerequisite) stay NOT MEASURED locally. --ran: 71 derived, 69 run, 0 NOT-MEASURED, 2 UNRUN (those two), exit 1. CI carries both families: Lint & Repo Gates success, Type Check debt ledger success, TypeScript Type Check success at 6e2297c2.",
      "dogfood_battery": "n/a: no ! in the title and Clause-2 carries no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "1: POST issues/34163/comments (this report) via scripts/pm/post-stamped.mjs. git push is not a REST write. All reads were unauthenticated REST GETs (issue, comments, PR, files, check-runs, two job logs).",
      "pr_body_lines_to_change": [
        "Header and Verification: the head is now 6e2297c2 (adds the plugin-auth test catch-up). The 4de0e1e38f NOT MEASURED notes are superseded by CI green at 6e2297c2 (51 check-runs, 0 failure).",
        "Tests bullet '14 existing rest test files ...': add a 15th consumer outside packages/rest, packages/plugins/plugin-auth/src/admin-import-users.test.ts:802. Its header compare strips one leading U+FEFF, and the admin import still receives the marked file.",
        "Acceptance notes, pins flipped: add 'admin-import-users.test.ts:802 (plugin-auth) csv.split(...)[0] to csv.replace(one leading U+FEFF).split(...)[0]; caught by Test Core (7/8) at 4de0e1e38f'.",
        "What changes, first bullet, and Acceptance notes, first flipped-pin line: the stored body holds 2 RAW U+FEFF characters (invisible) where it claims the escape spelling, in the backtick UTF8_BOM value and in the /^.../ regex. Re-spell them as the six-character backslash-u escape in words or in a fence.",
        "Footer: the body's session URL names the predecessor session_01QsR2jTEivi2wogPpeo3xd5. Durable attribution for this round is in this report comment, so the footer stays as it is (do not re-append)."
      ],
      "deviations": [
        "File surface: admin-import-users.test.ts in packages/plugins/plugin-auth is outside the claimed surface: the route file, the pin file, the changeset, and the area grant's 14 rest test files. Edited on the dispatch order to fix a PR-caused red, under the bounded in-place exemption. 1: same class as the granted catch-up. 2: mechanical, with the shape fixed by those 14 files. 3: not board-checked by me, since the dev does not scan the board. 4: the same Test Core family, with no new verification surface. The claim's File surface needs a seat addendum naming this file.",
        "Instruction conflict noted, not resolved silently: os-dev.md rule 1 says a Resume-from start merges origin/main first. The dispatch order and AGENTS.md section 10 say merge only on a conflict or a main-caused red. AGENTS.md outranks os-dev.md, so no merge was done.",
        "Declared narrowing: the local test legs and the two typechecks were never run after 27 min of lock queueing, 3 attempts. CI at both heads carries them."
      ],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none. No other in-process consumer of the csv export body found outside packages/rest. Checked with git grep over *.test.ts for the export route and format csv. The dogfood callers read json or a 403 envelope, or count audit rows only.",
        "carrier: PM (body patch). PR #34357 body carries raw U+FEFF bytes; listed under pr_body_lines_to_change."
      ]
    }
  10. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-project-manager · session_01FEkQ5kgF3mo9f7LXuv5hac
    os-dev-report

    Merge-only round on PR #34357, head 6750049, posted 2026-11-16T16:52Z.

    {
      "issue": 34163,
      "status": "done",
      "branch": "claude/area-A5-34163",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34357",
      "head_sha": "67500498c83365efb8748cd065088e749a34e7bf",
      "merge_commit": "67500498c83365efb8748cd065088e749a34e7bf (parents 6e2297c2acbf8d820618899aa0c40bf89a4b9b97, 9e6fee19ea358232196e1f704198612a2de34710)",
      "main_sha": "9e6fee19ea358232196e1f704198612a2de34710",
      "session": "session_01FEkQ5kgF3mo9f7LXuv5hac",
      "premise_still_valid": true,
      "summary": "Merge-only round. git merge --no-ff origin/main (9e6fee19) into the accepted head 6e2297c2 as a plain merge commit 67500498, pushed without force (6e2297c2..67500498). No conflict; no merge=os-regen path involved (the PR touches none, and os-regen-pending was empty after the merge). None of the 595 files main changed since 951eceee overlaps the PR's 18 files. No new in-process reader of the csv export body arrived from main: of the 120 test files main changed, the four that mention export or csv (platform-objects.test.ts, sys-audit-log-retired-actions.test.ts, qa/scenarios exporter.test.ts, spec seed.test.ts) add no export-route read, and pending-sso-users.test.ts in plugin-auth posts hand-built csv to the admin SSO import, not an export body. So nothing beyond the merge was changed. CI on 67500498 completed fully green.",
      "pr_diff_identity": "git diff 951eceee..6e2297c2 (before) and git diff 9e6fee19..67500498 (after) are byte-identical: cmp equal, both sha256 624ff26488851f3a932d4b49c95a6c06e2dcb21d962e1093418916413e458bf7, 18 files, 287 insertions, 31 deletions. New merge base = 9e6fee19 = origin/main tip at merge time.",
      "tests": "Local legs NOT MEASURED: three os-verify-lock attempts (slot issue-34163-tests; script = turbo build of the plugin-auth closure, which includes rest, then pnpm --filter @objectstack/rest test, plugin-auth vitest run src/admin-import-users.test.ts, pnpm --filter @objectstack/rest typecheck) each ended VERDICT queue-timeout (exit 99) after 540s. Holders: pid 7030 (issue-34062 full workspace turbo build), then pid 16856 (issue-33922 full dogfood test, held 981s at the third timeout). Per the dispatch order, CI is the reading of record. CI at 67500498 (job head_sha verified 67500498): Test Core (5/8) job 133438928797, @objectstack/rest:test cache miss, executing; src/export-csv-utf8-bom-34163.test.ts 8 tests passed; Test Files 414 passed (414); Tests 8564 passed, 350 skipped (8914). Test Core (7/8) job 133438928712, @objectstack/plugin-auth:test cache miss, executing; src/admin-import-users.test.ts 43 tests passed; Test Files 280 passed (280); Tests 5762 passed, 11 skipped (5773). Type Check workspace job 133437546920: @objectstack/rest:typecheck cache miss, executing; tsc --noEmit then check:test-typecheck OK (0 files, 0 errors held in the debt ledger). Ablation: none owed, no behaviour changed in a merge-only round.",
      "gates": "No local gate run: the PR diff is byte-identical, so the derived families are those of the accepted head; CI carries them on the merge head. CI at 67500498: 51 check-runs, 35 success, 16 skipped, 0 failure, 0 pending.",
      "ci_per_check": "success: Auto Label; Build Core; Check Changeset; Check PR Size; Dogfood Regression Gate; Flag docs affected by code changes; Governed Surface Queue Guard; Lint & Repo Gates; Lint · CI, release & engine gates; Lint · ESLint; Lint · PM dispatch-gates; Lint · docs & code guards; Lint · repo & tooling gates; Lint · scoped · query-options erasure; Lint · scoped · slot lookup & corpus; Lint · scoped · tooling self-tests; Live E2E UI; PR-body guards; Plan Test Core shards; Test Core; Test Core (1/8) through (8/8); Test UI; Type Check · consumer gates; Type Check · debt ledger; Type Check · source gates; Type Check · workspace; TypeScript Type Check; filter. skipped (path or opt-in selectors, queue-only): 18.x upgrade harness; Borrowed queue verdict; Build & E2E UI; Build Docs; Build UI Deps; Dogfood Regression Gate matrix shards; Dogfood Verify CLI; Lint UI; Packed-tarball smoke; Plan Test UI shards; Queue verdict; Schedule gate; Temporal Conformance; Test UI matrix shards; Type Check UI; UI Published Artifacts. Non-green: none. No cancelled shard.",
      "dogfood_battery": "n/a: no ! in the title and Clause-2 carries no (narrowing) arm",
      "first_parent_count": "git rev-list --count --first-parent 9e6fee19..origin/main = 0 (origin/main re-fetched at report time, still 9e6fee19). Before the merge: 39 first-parent commits from 951eceee.",
      "mcp_calls": "0",
      "api_writes": "1: POST issues/34163/comments (this report) via scripts/pm/post-stamped.mjs. git push is not a REST write. Reads: gh api GETs (PR, two comments, check-runs, job logs).",
      "pr_body_lines": [
        "Verification, first paragraph, replace the head line with: Head 67500498 (merge-only round, os-dev-report on #34163): origin/main 9e6fee19 merged into 6e2297c2 as a plain merge commit, pushed without force; no conflict, no os-regen path. The PR's own diff against the new merge base 9e6fee19 is byte-identical to its diff at 6e2297c2 against 951eceee (sha256 624ff264, 18 files, +287 / -31). CI at 67500498: 51 check-runs, 35 success, 16 skipped, 0 failed. Test Core (5/8) ran @objectstack/rest fresh: Test Files 414 passed (414), Tests 8564 passed / 350 skipped, export-csv-utf8-bom-34163.test.ts 8 passed. Test Core (7/8) ran plugin-auth fresh: admin-import-users.test.ts 43 passed, Test Files 280 passed, Tests 5762 passed / 11 skipped. @objectstack/rest:typecheck ran fresh in Type Check · workspace and passed. Local test and typecheck legs this round NOT MEASURED (verify-lock queue timeout, 3 tries); CI is the reading of record.",
        "Verification: the current 'Head 6e2297c2 (fix round, ...)' paragraph becomes 'Previous head 6e2297c2 (fix round, ...)', text otherwise unchanged; the 'Previous head 4de0e1e38f' paragraph stays as it is.",
        "Footer: leave as stored (do not re-append); durable attribution for this round is this report comment."
      ],
      "deviations": [
        "Local verification narrowed to zero (declared): three lock attempts timed out, 27 min total; CI on the merge head carries rest test, plugin-auth test and rest typecheck, each read as a cache miss that executed.",
        "Worktree: the local branch claude/area-A5-34163 already existed in the shared refs at exactly 6e2297c2 (left by the predecessor round, no worktree holding it), so the worktree checked out that branch instead of creating it; HEAD verified 6e2297c2 before the merge.",
        "Commit trailer: the merge commit carries the model-free pair (Claude-Session URL plus Co-Authored-By: Claude), per the dispatch order and AGENTS.md; the harness reminder's model-named trailer was not used."
      ],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed. The shared checkout /home/user/objectstack sits on a detached HEAD 162fe54f with a STAGED modification to scripts/pm/check-skill-line-ratchet.mjs that is not this round's; left untouched."
      ]
    }
  11. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-project-manager · session_01FEkQ5kgF3mo9f7LXuv5hac

    Delivered · #34163 · 2026-11-16T17:31Z

    PR #34357 merged through the queue as c9ef6538bf (2026-11-16T17:31Z); Fixes #34163 closed this card. L1 ACCEPT 6922042068 and merge-only delta 6923075384 (L1-b); no L2 owed (Clause-②: no, no spec path); landing record 6923125593.

    Delivered: a csv export from GET /api/v1/data/:object/export (also the default format and header=false) opens with exactly one UTF-8 byte-order mark before its first row, so Excel reads non-ASCII text; json and xlsx are unchanged; a zero-byte export stays zero bytes; the csv import already strips one leading mark, so the round trip holds.

    Left: #34420 carries the five Console writers that build a CSV in the browser without the mark.

    State change: pm:dispatched and lease:o1-C removed in this stroke.


    Generated by Claude Code

  12. removed
    pm:dispatched
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

domain:serverpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions