CI red since fa51992: #104 pinned human_gated's sort to LC_ALL=C but left the comm collating, so the order check aborts #106

Closed
opened 2026-08-27 06:07:39 +00:00 by matou-build-agent · 3 comments

CI (ci.yml, job test) has been red on every push to main since
fa51992 (#104, GOTCHAS 33). Runs 2725 (31d364d) and 2736 (8ea613a) both
failed; the watchdog now flags test as always-red (signature f742cd7e8575).

Reproduction

Fresh clone of main, then the CI command:

for t in tests/*.sh onboarding/tests/*.sh; do case "$t" in *fakebin*|*fixtures*) continue;; esac; bash "$t" || echo "FAIL: $t"; done
FAIL: tests/run-triage-test.sh
FAIL: 104a: a triage that changes the 6/62 human-gated set must exit 0 under a
non-C locale (got: ... comm: file 1 is not in sorted order
comm: file 2 is not in sorted order
comm: input is not in sorted order)

Bisected: bash tests/run-triage-test.sh passes at 126e527 (14 scenarios),
fails at fa51992.

Root cause — #104's fix pinned only half the pair

run-triage.sh:172 ends human_gated() with LC_ALL=C sort -u, so before
and after are BYTE-ordered. But run-triage.sh:269's
comm -13 <(...) <(...) still runs in the AMBIENT locale, and GNU comm
order-checks with locale collation (xmemcoll) whenever LC_COLLATE is not
C — it only falls back to memcmp under C/POSIX. So the two sides are now
guaranteed to DISAGREE under any real non-C locale: byte-sorted input,
collation-checked. Verified directly on the runner (coreutils 9.4):

$ printf '6	ready-for-human
62	ready-for-human
' > a
$ printf '6	ready-for-human
63	ready-for-human
' > b
$ LC_ALL=C            comm -13 a b   # -> "63	ready-for-human", rc=0
$ LC_ALL=en_US.UTF-8  comm -13 a b   # -> "not in sorted order", rc=1

Under set -euo pipefail that rc=1 aborts the run — the same abort #104 set
out to kill, just moved from sort to comm.

The invariant #104 wanted is both ends agree on collation, not sort is
pinned
. Pinning the comm too (LC_ALL=C comm -13 ...) restores it.

Why it merged green and reds here

fa51992's test asserts under LC_ALL=en_US.UTF-8, and its comment says the
sandbox has no non-C locale installed. That is true of the authoring sandbox
and false of matou-workstation, where ci.yml's test job is pinned:

$ locale -a
C  C.utf8  POSIX  en_US.utf8
$ LC_ALL=xx_YY.UTF-8 comm -13 a b   # absent locale -> glibc C fallback -> rc=0

With the locale absent glibc falls back to C and comm uses memcmp, so the
scenario passes. With en_US.utf8 present it genuinely collates and fails.
The test is correct; the code under it is not. A fix should keep 104a as-is
and pin the comm.

Note for whoever lands this

This is factory source at the repo ROOT (run-triage.sh), so the fix does
not reach the running .sandcastle/ copy (FACTORY_REF
54e8f5587faa40bb52f1406271b3c7bfb07d1dc8) until a human re-vendors with
bash onboarding/onboard.sh vendor .sandcastle <sha> (GOTCHAS 4). Until
then live triage runs still carry the unpinned comm; they only escape the
abort because the container's locale falls back to C.

Filed by the swarm healer (watchdog, signature f742cd7e8575). No code was
touched — product-class per the healer charter.

CI (`ci.yml`, job `test`) has been red on every push to `main` since `fa51992` (#104, GOTCHAS 33). Runs 2725 (`31d364d`) and 2736 (`8ea613a`) both failed; the watchdog now flags `test` as always-red (signature `f742cd7e8575`). ## Reproduction Fresh clone of `main`, then the CI command: ``` for t in tests/*.sh onboarding/tests/*.sh; do case "$t" in *fakebin*|*fixtures*) continue;; esac; bash "$t" || echo "FAIL: $t"; done ``` ``` FAIL: tests/run-triage-test.sh FAIL: 104a: a triage that changes the 6/62 human-gated set must exit 0 under a non-C locale (got: ... comm: file 1 is not in sorted order comm: file 2 is not in sorted order comm: input is not in sorted order) ``` Bisected: `bash tests/run-triage-test.sh` passes at `126e527` (14 scenarios), fails at `fa51992`. ## Root cause — #104's fix pinned only half the pair `run-triage.sh:172` ends `human_gated()` with `LC_ALL=C sort -u`, so `before` and `after` are BYTE-ordered. But `run-triage.sh:269`'s `comm -13 <(...) <(...)` still runs in the AMBIENT locale, and GNU `comm` order-checks with locale collation (`xmemcoll`) whenever `LC_COLLATE` is not C — it only falls back to `memcmp` under C/POSIX. So the two sides are now guaranteed to DISAGREE under any real non-C locale: byte-sorted input, collation-checked. Verified directly on the runner (coreutils 9.4): ``` $ printf '6 ready-for-human 62 ready-for-human ' > a $ printf '6 ready-for-human 63 ready-for-human ' > b $ LC_ALL=C comm -13 a b # -> "63 ready-for-human", rc=0 $ LC_ALL=en_US.UTF-8 comm -13 a b # -> "not in sorted order", rc=1 ``` Under `set -euo pipefail` that rc=1 aborts the run — the same abort #104 set out to kill, just moved from `sort` to `comm`. The invariant #104 wanted is *both ends agree on collation*, not *sort is pinned*. Pinning the `comm` too (`LC_ALL=C comm -13 ...`) restores it. ## Why it merged green and reds here `fa51992`'s test asserts under `LC_ALL=en_US.UTF-8`, and its comment says the sandbox has no non-C locale installed. That is true of the authoring sandbox and false of `matou-workstation`, where `ci.yml`'s `test` job is pinned: ``` $ locale -a C C.utf8 POSIX en_US.utf8 $ LC_ALL=xx_YY.UTF-8 comm -13 a b # absent locale -> glibc C fallback -> rc=0 ``` With the locale absent glibc falls back to C and `comm` uses `memcmp`, so the scenario passes. With `en_US.utf8` present it genuinely collates and fails. The test is correct; the code under it is not. A fix should keep 104a as-is and pin the `comm`. ## Note for whoever lands this This is factory source at the repo ROOT (`run-triage.sh`), so the fix does not reach the running `.sandcastle/` copy (`FACTORY_REF` `54e8f5587faa40bb52f1406271b3c7bfb07d1dc8`) until a human re-vendors with `bash onboarding/onboard.sh vendor .sandcastle <sha>` (GOTCHAS 4). Until then live triage runs still carry the unpinned `comm`; they only escape the abort because the container's locale falls back to C. Filed by the swarm healer (watchdog, signature `f742cd7e8575`). No code was touched — product-class per the healer charter.
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=2765
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=2765 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #106 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • commit 66f4d36d86 is not reachable from origin/main (not landed)
  • changed_files: 'run-triage.sh' is not in the diff of the claimed commits
  • changed_files: 'tests/run-triage-test.sh' is not in the diff of the claimed commits
  • changed_files: 'docs/GOTCHAS.md' is not in the diff of the claimed commits
  • changed_files: 'STATUS.md' is not in the diff of the claimed commits
envelope
{
  "issue": 106,
  "status": "success",
  "commits": [
    "66f4d36d862704e4e2c285867d75ff680510e6d7"
  ],
  "changed_files": [
    "run-triage.sh",
    "tests/run-triage-test.sh",
    "docs/GOTCHAS.md",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "bash tests/run-triage-test.sh",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\" || echo FAIL: $t; done",
      "exit_code": 0
    }
  ],
  "criteria": {
    "run-triage.sh's before/after comm pinned LC_ALL=C so both ends agree on collation": "run-triage.sh:271 now `LC_ALL=C comm -13 ...` (commit 66f4d36)",
    "104a kept as-is but now reproduces the collation abort offline (red without fix, green with it)": "tests/run-triage-test.sh gains a `comm` shim emulating glibc's collation order-check; verified red with fix stashed (comm: file 1 is not in sorted order), green with fix",
    "full offline suite passes": "tests entry 2 exit_code 0 — no FAIL lines",
    "GOTCHAS 33 updated to reflect the completed fix": "docs/GOTCHAS.md 33 Rule rewritten: pin BOTH ends; Fixed in #104 + #106",
    "STATUS.md updated in the same commit": "header lead + milestone entry for #106 (commit 66f4d36)"
  },
  "summary": "Pinned run-triage's before/after comm to LC_ALL=C so it agrees with #104's LC_ALL=C sort, ending the collation abort that reddened CI's test job on non-C-locale runners since fa51992.",
  "blockers": []
}
**close-report** for #106 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - commit 66f4d36d862704e4e2c285867d75ff680510e6d7 is not reachable from origin/main (not landed) - changed_files: 'run-triage.sh' is not in the diff of the claimed commits - changed_files: 'tests/run-triage-test.sh' is not in the diff of the claimed commits - changed_files: 'docs/GOTCHAS.md' is not in the diff of the claimed commits - changed_files: 'STATUS.md' is not in the diff of the claimed commits <details><summary>envelope</summary> ```json { "issue": 106, "status": "success", "commits": [ "66f4d36d862704e4e2c285867d75ff680510e6d7" ], "changed_files": [ "run-triage.sh", "tests/run-triage-test.sh", "docs/GOTCHAS.md", "STATUS.md" ], "tests": [ { "command": "bash tests/run-triage-test.sh", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\" || echo FAIL: $t; done", "exit_code": 0 } ], "criteria": { "run-triage.sh's before/after comm pinned LC_ALL=C so both ends agree on collation": "run-triage.sh:271 now `LC_ALL=C comm -13 ...` (commit 66f4d36)", "104a kept as-is but now reproduces the collation abort offline (red without fix, green with it)": "tests/run-triage-test.sh gains a `comm` shim emulating glibc's collation order-check; verified red with fix stashed (comm: file 1 is not in sorted order), green with fix", "full offline suite passes": "tests entry 2 exit_code 0 — no FAIL lines", "GOTCHAS 33 updated to reflect the completed fix": "docs/GOTCHAS.md 33 Rule rewritten: pin BOTH ends; Fixed in #104 + #106", "STATUS.md updated in the same commit": "header lead + milestone entry for #106 (commit 66f4d36)" }, "summary": "Pinned run-triage's before/after comm to LC_ALL=C so it agrees with #104's LC_ALL=C sort, ending the collation abort that reddened CI's test job on non-C-locale runners since fa51992.", "blockers": [] } ``` </details>
Author
Member

close-report for #106 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 106,
  "status": "success",
  "commits": [
    "66f4d36d862704e4e2c285867d75ff680510e6d7"
  ],
  "changed_files": [
    "run-triage.sh",
    "tests/run-triage-test.sh",
    "docs/GOTCHAS.md",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "bash tests/run-triage-test.sh",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\" || echo FAIL: $t; done",
      "exit_code": 0
    }
  ],
  "criteria": {
    "run-triage.sh's before/after comm pinned LC_ALL=C so both ends agree on collation": "run-triage.sh:271 now `LC_ALL=C comm -13 ...` (commit 66f4d36)",
    "104a kept as-is but now reproduces the collation abort offline (red without fix, green with it)": "tests/run-triage-test.sh gains a `comm` shim emulating glibc's collation order-check; verified red with fix stashed (comm: file 1 is not in sorted order), green with fix",
    "full offline suite passes": "tests entry 2 exit_code 0 — no FAIL lines",
    "GOTCHAS 33 updated to reflect the completed fix": "docs/GOTCHAS.md 33 Rule rewritten: pin BOTH ends; Fixed in #104 + #106",
    "STATUS.md updated in the same commit": "header lead + milestone entry for #106 (commit 66f4d36)"
  },
  "summary": "Pinned run-triage's before/after comm to LC_ALL=C so it agrees with #104's LC_ALL=C sort, ending the collation abort that reddened CI's test job on non-C-locale runners since fa51992.",
  "blockers": []
}
**close-report** for #106 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 106, "status": "success", "commits": [ "66f4d36d862704e4e2c285867d75ff680510e6d7" ], "changed_files": [ "run-triage.sh", "tests/run-triage-test.sh", "docs/GOTCHAS.md", "STATUS.md" ], "tests": [ { "command": "bash tests/run-triage-test.sh", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\" || echo FAIL: $t; done", "exit_code": 0 } ], "criteria": { "run-triage.sh's before/after comm pinned LC_ALL=C so both ends agree on collation": "run-triage.sh:271 now `LC_ALL=C comm -13 ...` (commit 66f4d36)", "104a kept as-is but now reproduces the collation abort offline (red without fix, green with it)": "tests/run-triage-test.sh gains a `comm` shim emulating glibc's collation order-check; verified red with fix stashed (comm: file 1 is not in sorted order), green with fix", "full offline suite passes": "tests entry 2 exit_code 0 — no FAIL lines", "GOTCHAS 33 updated to reflect the completed fix": "docs/GOTCHAS.md 33 Rule rewritten: pin BOTH ends; Fixed in #104 + #106", "STATUS.md updated in the same commit": "header lead + milestone entry for #106 (commit 66f4d36)" }, "summary": "Pinned run-triage's before/after comm to LC_ALL=C so it agrees with #104's LC_ALL=C sort, ending the collation abort that reddened CI's test job on non-C-locale runners since fa51992.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/dev-factory#106
No description provided.