Skip to content

fix(ci): the invisible-character gate never matched anything - #163

Open
hyperpolymath wants to merge 1 commit into
mainfrom
fix/empty-linter-pattern-never-matched
Open

fix(ci): the invisible-character gate never matched anything#163
hyperpolymath wants to merge 1 commit into
mainfrom
fix/empty-linter-pattern-never-matched

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Measured 2026-08-27: this gate caught 0 of 6 invisible-character test cases. It has never detected an NBSP, zero-width space, BOM, soft hyphen, bidi override or word joiner.

Root cause

The pattern used UTF-8 byte sequences (\xc2\xa0) while grep -P matches characters. Bytes c2 a0 are one character U+00A0; \xc2\xa0 asks for two, U+00C2 then U+00A0 — never present.

grep -P '\xc2\xa0'  ->  miss
grep -P '\x{a0}'    ->  MATCH

Only \x00 worked, being single-byte in both readings. The gate ran, passed, and could not see what it exists to see.

Fixed

  • codepoint escapes in place of byte sequences
  • C0 controls \x01-\x08,\x0B,\x0C,\x0E-\x1F added (TAB/LF/CR excluded)
  • grep -a — without it grep skips any NUL-bearing file as binary

The C0 range matters: a stray backspace byte made a workflow unparseable in developer-ecosystem, so it never ran — and this linter called it clean.

Canonical fix: hyperpolymath/empty-linter#70. 1 file(s) here.

Verified: YAML re-parsed, and the corrected pattern was confirmed to catch a real NBSP before the change was kept.

MEASURED 2026-08-27: this gate's pattern caught 0 OF 6 invisible-character test
cases. It has never detected an NBSP, zero-width space, BOM, soft hyphen, bidi
override or word joiner.

ROOT CAUSE: the pattern used UTF-8 BYTE sequences (\xc2\xa0) while grep -P
matches CHARACTERS. Bytes c2 a0 are ONE character U+00A0; \xc2\xa0 asks for TWO
characters, U+00C2 then U+00A0, which is never present.

  grep -P '\xc2\xa0'  ->  miss
  grep -P '\x{a0}'    ->  MATCH

Only \x00 worked, being single-byte in both readings.

FIXED: codepoint escapes; C0 control characters \x01-\x08,\x0B,\x0C,\x0E-\x1F
added (TAB/LF/CR excluded); and grep -a, without which grep skips any NUL-bearing
file as binary.

The C0 range matters: a stray BACKSPACE byte made a workflow unparseable in
developer-ecosystem, so it never ran, and this linter called it clean.

Canonical fix: hyperpolymath/empty-linter#70. 1 file(s) here.
VERIFIED: YAML re-parsed, and the corrected pattern was confirmed to catch a real
NBSP before the change was kept.
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 53ffae69-ca55-45ba-9a4d-e3bb42d38d71

📥 Commits

Reviewing files that changed from the base of the PR and between 29e6f7d and fc62b32.

📒 Files selected for processing (1)
  • .github/workflows/dogfood-gate.yml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: Codacy Static Code Analysis
⚠️ CI failures not shown inline (14)

GitHub Actions: Hypatia Security Scan / 0_Hypatia Neurosymbolic Analysis.txt: fix(ci): the invisible-character gate never matched anything

Conclusion: failure

View job details

##[group]Running mix local.rebar,--force
 [command]/home/runner/work/_temp/.setup-beam/elixir/bin/mix local.rebar --force
 ** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {~c"builds.hex.pm", 443}}, {:inet, [:inet], {:tls_alert, {:unsupported_certificate, ~c"TLS client: In state wait_cert_cr at ssl_handshake.erl:2199 generated CLIENT ALERT: Fatal - Unsupported Certificate\n {key_usage_mismatch,{{'Extension',{2,5,29,15},true,[keyCertSign,cRLSign]},\n                      {'Extension',{2,5,29,37},false,[{1,3,6,1,5,5,7,3,1}]}}}"}}}]}
 Could not install Rebar because Mix could not download metadata at https://builds.hex.pm/installs/rebar3-1.x.csv.
 Action mix rebar failed for mirror https://builds.hex.pm, with Error: The process '/home/runner/work/_temp/.setup-beam/elixir/bin/mix' failed with exit code 1
 ##[error]Could not mix rebar from any hex.pm mirror

GitHub Actions: Elixir CI / 0_Build and test.txt: fix(ci): the invisible-character gate never matched anything

Conclusion: failure

View job details

##[group]Running mix local.rebar,--force
 [command]/home/runner/work/_temp/.setup-beam/elixir/bin/mix local.rebar --force
 ** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {~c"builds.hex.pm", 443}}, {:inet, [:inet], {:tls_alert, {:unsupported_certificate, ~c"TLS client: In state wait_cert_cr at ssl_handshake.erl:2199 generated CLIENT ALERT: Fatal - Unsupported Certificate\n {key_usage_mismatch,{{'Extension',{2,5,29,15},true,[keyCertSign,cRLSign]},\n                      {'Extension',{2,5,29,37},false,[{1,3,6,1,5,5,7,3,1}]}}}"}}}]}
 Could not install Rebar because Mix could not download metadata at https://builds.hex.pm/installs/rebar3-1.x.csv.
 Action mix rebar failed for mirror https://builds.hex.pm, with Error: The process '/home/runner/work/_temp/.setup-beam/elixir/bin/mix' failed with exit code 1
 ##[error]Could not mix rebar from any hex.pm mirror

GitHub Actions: Hypatia Security Scan / Hypatia Neurosymbolic Analysis: fix(ci): the invisible-character gate never matched anything

Conclusion: failure

View job details

##[group]Running mix local.rebar,--force
 [command]/home/runner/work/_temp/.setup-beam/elixir/bin/mix local.rebar --force
 ** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {~c"builds.hex.pm", 443}}, {:inet, [:inet], {:tls_alert, {:unsupported_certificate, ~c"TLS client: In state wait_cert_cr at ssl_handshake.erl:2199 generated CLIENT ALERT: Fatal - Unsupported Certificate\n {key_usage_mismatch,{{'Extension',{2,5,29,15},true,[keyCertSign,cRLSign]},\n                      {'Extension',{2,5,29,37},false,[{1,3,6,1,5,5,7,3,1}]}}}"}}}]}
 Could not install Rebar because Mix could not download metadata at https://builds.hex.pm/installs/rebar3-1.x.csv.
 Action mix rebar failed for mirror https://builds.hex.pm, with Error: The process '/home/runner/work/_temp/.setup-beam/elixir/bin/mix' failed with exit code 1
 ##[error]Could not mix rebar from any hex.pm mirror

GitHub Actions: Elixir CI / Build and test: fix(ci): the invisible-character gate never matched anything

Conclusion: failure

View job details

##[group]Running mix local.rebar,--force
 [command]/home/runner/work/_temp/.setup-beam/elixir/bin/mix local.rebar --force
 ** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {~c"builds.hex.pm", 443}}, {:inet, [:inet], {:tls_alert, {:unsupported_certificate, ~c"TLS client: In state wait_cert_cr at ssl_handshake.erl:2199 generated CLIENT ALERT: Fatal - Unsupported Certificate\n {key_usage_mismatch,{{'Extension',{2,5,29,15},true,[keyCertSign,cRLSign]},\n                      {'Extension',{2,5,29,37},false,[{1,3,6,1,5,5,7,3,1}]}}}"}}}]}
 Could not install Rebar because Mix could not download metadata at https://builds.hex.pm/installs/rebar3-1.x.csv.
 Action mix rebar failed for mirror https://builds.hex.pm, with Error: The process '/home/runner/work/_temp/.setup-beam/elixir/bin/mix' failed with exit code 1
 ##[error]Could not mix rebar from any hex.pm mirror

GitHub Actions: Hypatia Security Scan / Hypatia Neurosymbolic Analysis: fix(ci): the invisible-character gate never matched anything

Conclusion: failure

View job details

##[group]Run github/codeql-action/upload-sarif@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd
 with:
   sarif_file: hypatia.sarif
   category: hypatia
   checkout_path: /home/runner/work/bofig/bofig
   ***REDACTED_SECRET_ASSIGNMENT***
   matrix: null
   wait-for-processing: true
 env:
   INSTALL_DIR_FOR_OTP: /home/runner/work/_temp/.setup-beam/otp
   INSTALL_DIR_FOR_ELIXIR: /home/runner/work/_temp/.setup-beam/elixir
 ##[endgroup]
 Job run UUID is 935b0be8-6349-485d-8f8a-58766fef6dc7.
 ##[error]Path does not exist: hypatia.sarif

GitHub Actions: Elixir CI / Build and test: fix(ci): the invisible-character gate never matched anything

Conclusion: failure

View job details

Print service container logs: 5b8a3af054a5477d9ad450afc21431f8_postgres16alpinesha25679950da386bda7fcc9d57aa9aa9be6c6d7407596a9b8f68014b09a778a9ab316_a91edc
 ##[command]/usr/bin/docker logs --details ***REDACTED_HIGH_ENTROPY_STRING***
  The files belonging to this database system will be owned by user "postgres".
  sh: locale: not found
  .289 UTC [36] WARNING:  no usable system locales were found
  initdb: warning: enabling "trust" authentication for local connections
  initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
  .095 UTC [1] LOG:  starting PostgreSQL 16.14 on x86_64-pc-linux-musl, compiled by gcc (Alpine 15.2.0) 15.2.0, 64-bit
  .095 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
  .095 UTC [1] LOG:  listening on IPv6 address "::", port 5432
  .096 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  .099 UTC [56] LOG:  database system was shut down at  UTC
  .104 UTC [1] LOG:  database system is ready to accept connections
  This user must also own the server process.
  The database cluster will be initialized with locale "en_US.utf8".
  The default database encoding has accordingly been set to "UTF8".
  The default text search configuration will be set to "english".
  Data page checksums are disabled.
  fixing permissions on existing directory /var/lib/postgresql/data ... ok
  creating subdirectories ... ok
  selecting dynamic shared memory implementation ... posix
  selecting default max_connections ... 100
  selecting default shared_buffers ... 128MB
  selecting default time zone ... UTC
  creating configuration files ... ok
  running bootstrap script ... ok
  performing post-bootstrap initialization ... ok
  syncing data to disk ... ok
  Success. You can now start the database server using:
      pg_ctl -D /var/lib/postgresql/data -l logfile start
  waiting for server to start.....871 UTC [42] LOG:  starting PostgreSQL...

GitHub Actions: Deno CI / 0_build.txt: fix(ci): the invisible-character gate never matched anything

Conclusion: failure

View job details

##[group]Run deno task lint
 �[36;1mdeno task lint�[0m
 shell: /usr/bin/bash -e {0}
 ##[endgroup]
 �[0m�[1m�[31merror�[0m: deno task couldn't find deno.json(c) or package.json. See https://docs.deno.com/go/config
 ##[error]Process completed with exit code 1.

GitHub Actions: Deno CI / build: fix(ci): the invisible-character gate never matched anything

Conclusion: failure

View job details

##[group]Run deno task lint
 �[36;1mdeno task lint�[0m
 shell: /usr/bin/bash -e {0}
 ##[endgroup]
 �[0m�[1m�[31merror�[0m: deno task couldn't find deno.json(c) or package.json. See https://docs.deno.com/go/config
 ##[error]Process completed with exit code 1.

GitHub Actions: Dogfood Gate / 1_Validate A2ML manifests.txt: fix(ci): the invisible-character gate never matched anything

Conclusion: failure

View job details

##[group]A2ML Manifest Validation
 Scanning . for .a2ml files...
 Found 22 .a2ml file(s)
   Validating: ./.machine_readable/6a2/AGENTIC.a2ml
   Validating: ./.machine_readable/6a2/ECOSYSTEM.a2ml
   Validating: ./.machine_readable/6a2/META.a2ml
   Validating: ./.machine_readable/6a2/NEUROSYM.a2ml
   Validating: ./.machine_readable/6a2/PLAYBOOK.a2ml
   Validating: ./.machine_readable/6a2/STATE.a2ml
   Validating: ./.machine_readable/CLADE.a2ml
   Validating: ./.machine_readable/agent_instructions/coverage.a2ml
   Validating: ./.machine_readable/agent_instructions/debt.a2ml
   Validating: ./.machine_readable/agent_instructions/methodology.a2ml
   Validating: ./.machine_readable/anchors/ANCHOR.a2ml
 ##[warning]Missing SPDX-License-Identifier in first 10 lines
   Validating: ./.machine_readable/contractiles/bust/Bustfile.a2ml
   Validating: ./.machine_readable/contractiles/dust/Dustfile.a2ml
   Validating: ./.machine_readable/contractiles/trust/Trustfile.a2ml
   Validating: ./.machine_readable/integrations/feedback-o-tron.a2ml
   Validating: ./.machine_readable/integrations/proven.a2ml
   Validating: ./.machine_readable/integrations/verisimdb.a2ml
   Validating: ./.machine_readable/integrations/vexometer.a2ml
   Validating: ./0-AI-MANIFEST.a2ml
   Validating: ./audits/assail-classifications.a2ml
 ##[warning]Missing SPDX-License-Identifier in first 10 lines
 ##[error]Missing required identity field (agent-id, name, or project)

GitHub Actions: Dogfood Gate / Validate A2ML manifests: fix(ci): the invisible-character gate never matched anything

Conclusion: failure

View job details

##[group]A2ML Manifest Validation
 Scanning . for .a2ml files...
 Found 22 .a2ml file(s)
   Validating: ./.machine_readable/6a2/AGENTIC.a2ml
   Validating: ./.machine_readable/6a2/ECOSYSTEM.a2ml
   Validating: ./.machine_readable/6a2/META.a2ml
   Validating: ./.machine_readable/6a2/NEUROSYM.a2ml
   Validating: ./.machine_readable/6a2/PLAYBOOK.a2ml
   Validating: ./.machine_readable/6a2/STATE.a2ml
   Validating: ./.machine_readable/CLADE.a2ml
   Validating: ./.machine_readable/agent_instructions/coverage.a2ml
   Validating: ./.machine_readable/agent_instructions/debt.a2ml
   Validating: ./.machine_readable/agent_instructions/methodology.a2ml
   Validating: ./.machine_readable/anchors/ANCHOR.a2ml
 ##[warning]Missing SPDX-License-Identifier in first 10 lines
   Validating: ./.machine_readable/contractiles/bust/Bustfile.a2ml
   Validating: ./.machine_readable/contractiles/dust/Dustfile.a2ml
   Validating: ./.machine_readable/contractiles/trust/Trustfile.a2ml
   Validating: ./.machine_readable/integrations/feedback-o-tron.a2ml
   Validating: ./.machine_readable/integrations/proven.a2ml
   Validating: ./.machine_readable/integrations/verisimdb.a2ml
   Validating: ./.machine_readable/integrations/vexometer.a2ml
   Validating: ./0-AI-MANIFEST.a2ml
   Validating: ./audits/assail-classifications.a2ml
 ##[warning]Missing SPDX-License-Identifier in first 10 lines
 ##[error]Missing required identity field (agent-id, name, or project)

GitHub Actions: Dogfood Gate / 4_Groove manifest check.txt: fix(ci): the invisible-character gate never matched anything

Conclusion: failure

View job details

##[group]Run # Check for static or dynamic Groove endpoints
 �[36;1m# Check for static or dynamic Groove endpoints�[0m
 �[36;1mHAS_MANIFEST="false"�[0m
 �[36;1mHAS_GROOVE_CODE="false"�[0m
 �[36;1m�[0m
 �[36;1mif [ -f ".well-known/groove/manifest.json" ]; then�[0m
 �[36;1m  HAS_MANIFEST="true"�[0m
 �[36;1m  # Validate the manifest JSON�[0m
 �[36;1m  if ! jq empty .well-known/groove/manifest.json 2>/dev/null; then�[0m
 �[36;1m    echo "::error file=.well-known/groove/manifest.json::Invalid JSON in Groove manifest"�[0m

GitHub Actions: Dogfood Gate / Groove manifest check: fix(ci): the invisible-character gate never matched anything

Conclusion: failure

View job details

##[group]Run # Check for static or dynamic Groove endpoints
 �[36;1m# Check for static or dynamic Groove endpoints�[0m
 �[36;1mHAS_MANIFEST="false"�[0m
 �[36;1mHAS_GROOVE_CODE="false"�[0m
 �[36;1m�[0m
 �[36;1mif [ -f ".well-known/groove/manifest.json" ]; then�[0m
 �[36;1m  HAS_MANIFEST="true"�[0m
 �[36;1m  # Validate the manifest JSON�[0m
 �[36;1m  if ! jq empty .well-known/groove/manifest.json 2>/dev/null; then�[0m
 �[36;1m    echo "::error file=.well-known/groove/manifest.json::Invalid JSON in Groove manifest"�[0m

GitHub Actions: Dogfood Gate / 5_Validate eclexiaiser manifest.txt: fix(ci): the invisible-character gate never matched anything

Conclusion: failure

View job details

##[group]Run if [ ! -f "eclexiaiser.toml" ]; then
 �[36;1mif [ ! -f "eclexiaiser.toml" ]; then�[0m
 �[36;1m  # Check if repo has a Containerfile — if so, recommend eclexiaiser�[0m
 �[36;1m  if [ -f "Containerfile" ]; then�[0m
 �[36;1m    echo "::warning::Containerfile present but no eclexiaiser.toml. Run \`eclexiaiser init\` to scaffold energy/carbon budgets."�[0m
 �[36;1m  fi�[0m
 �[36;1m  echo "has_manifest=false" >> "$GITHUB_OUTPUT"�[0m
 �[36;1m  exit 0�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mecho "has_manifest=true" >> "$GITHUB_OUTPUT"�[0m
 �[36;1m�[0m
 �[36;1m# Validate TOML structure using Python 3.11+ tomllib�[0m
 �[36;1mpython3 -c "�[0m
 �[36;1mimport tomllib, sys�[0m
 �[36;1mwith open('eclexiaiser.toml', 'rb') as f:�[0m
 �[36;1m    data = tomllib.load(f)�[0m
 �[36;1mproject = data.get('project', {})�[0m
 �[36;1mif not project.get('name', '').strip():�[0m
 �[36;1m    print('ERROR: project.name is required', file=sys.stderr)�[0m
 �[36;1m    sys.exit(1)�[0m
 �[36;1mfunctions = data.get('functions', [])�[0m
 �[36;1mif not functions:�[0m
 �[36;1m    print('ERROR: at least one [[functions]] entry is required', file=sys.stderr)�[0m
 �[36;1m    sys.exit(1)�[0m
 �[36;1mfor fn in functions:�[0m
 �[36;1m    if not fn.get('name', '').strip():�[0m
 �[36;1m        print('ERROR: function name cannot be empty', file=sys.stderr)�[0m
 �[36;1m        sys.exit(1)�[0m
 �[36;1m    if not fn.get('source', '').strip():�[0m
 �[36;1m        print(f'ERROR: function {fn[\"name\"]} has no source path', file=sys.stderr)�[0m
 �[36;1m        sys.exit(1)�[0m
 �[36;1mprint(f'Valid: {project[\"name\"]} ({len(functions)} function(s))')�[0m
 �[36;1m" || {�[0m
 �[36;1m  echo "::error file=eclexiaiser.toml::Invalid eclexiaiser.toml — see step output for details"�[0m

GitHub Actions: Dogfood Gate / Validate eclexiaiser manifest: fix(ci): the invisible-character gate never matched anything

Conclusion: failure

View job details

##[group]Run if [ ! -f "eclexiaiser.toml" ]; then
 �[36;1mif [ ! -f "eclexiaiser.toml" ]; then�[0m
 �[36;1m  # Check if repo has a Containerfile — if so, recommend eclexiaiser�[0m
 �[36;1m  if [ -f "Containerfile" ]; then�[0m
 �[36;1m    echo "::warning::Containerfile present but no eclexiaiser.toml. Run \`eclexiaiser init\` to scaffold energy/carbon budgets."�[0m
 �[36;1m  fi�[0m
 �[36;1m  echo "has_manifest=false" >> "$GITHUB_OUTPUT"�[0m
 �[36;1m  exit 0�[0m
 �[36;1mfi�[0m
 �[36;1m�[0m
 �[36;1mecho "has_manifest=true" >> "$GITHUB_OUTPUT"�[0m
 �[36;1m�[0m
 �[36;1m# Validate TOML structure using Python 3.11+ tomllib�[0m
 �[36;1mpython3 -c "�[0m
 �[36;1mimport tomllib, sys�[0m
 �[36;1mwith open('eclexiaiser.toml', 'rb') as f:�[0m
 �[36;1m    data = tomllib.load(f)�[0m
 �[36;1mproject = data.get('project', {})�[0m
 �[36;1mif not project.get('name', '').strip():�[0m
 �[36;1m    print('ERROR: project.name is required', file=sys.stderr)�[0m
 �[36;1m    sys.exit(1)�[0m
 �[36;1mfunctions = data.get('functions', [])�[0m
 �[36;1mif not functions:�[0m
 �[36;1m    print('ERROR: at least one [[functions]] entry is required', file=sys.stderr)�[0m
 �[36;1m    sys.exit(1)�[0m
 �[36;1mfor fn in functions:�[0m
 �[36;1m    if not fn.get('name', '').strip():�[0m
 �[36;1m        print('ERROR: function name cannot be empty', file=sys.stderr)�[0m
 �[36;1m        sys.exit(1)�[0m
 �[36;1m    if not fn.get('source', '').strip():�[0m
 �[36;1m        print(f'ERROR: function {fn[\"name\"]} has no source path', file=sys.stderr)�[0m
 �[36;1m        sys.exit(1)�[0m
 �[36;1mprint(f'Valid: {project[\"name\"]} ({len(functions)} function(s))')�[0m
 �[36;1m" || {�[0m
 �[36;1m  echo "::error file=eclexiaiser.toml::Invalid eclexiaiser.toml — see step output for details"�[0m
🔇 Additional comments (1)
.github/workflows/dogfood-gate.yml (1)

125-125: 🎯 Functional Correctness

Do not add a separate leading-BOM check.

grep does not strip a leading BOM. A valid byte or UTF-8 PCRE pattern matches BOM bytes at byte 0. The current \x{feff} expression has a separate compatibility issue on GNU grep 3.8.


📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Improved automated quality checks to detect a wider range of invisible and control characters.
    • Enhanced text scanning reliability, including for files that may otherwise be treated as binary.
    • This helps prevent hidden formatting issues from entering releases.

Walkthrough

The empty-lint job now matches invisible characters by Unicode code point. It includes additional control, bidi, and word-joiner characters. The grep scan treats binary files as text.

Changes

Invisible-character gate

Layer / File(s) Summary
Update invisible-character matching
.github/workflows/dogfood-gate.yml
The pattern uses Unicode code-point escapes and includes additional control, bidi, and word-joiner characters. grep uses -a so binary files are scanned as text.

Estimated code review effort: 2 (Simple) | ~5 minutes

Merge Risk: 🔵 Low · up to fc62b

The CI workflow now detects additional invisible characters, but its BOM pattern may not work with GNU grep 3.8, leaving one case undetected or causing the check to fail on affected runners. The PR is otherwise mergeable with explicit owner follow-up.

Poem

A rabbit checks each hidden mark,
In daylight code and files dark.
New code points join the careful sweep,
While binary files no longer sleep.
The gate now catches what should not creep.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The change fixes the pattern in one dogfood-gate.yml, but issue [#70] also requires a separate leading-BOM check, matching C0 detection in stdlib/ByteDetector.affine and config.ncl, automated co… Implement all remaining coding requirements from issue [#70]: add the separate leading-BOM check, update stdlib/ByteDetector.affine and config.ncl, add or update automated tests for detection and exclusions, and apply the corrected patt…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: fixing the CI invisible-character gate.
Description check ✅ Passed The description directly explains the detection failure, root cause, implemented fixes, and verification.
Out of Scope Changes check ✅ Passed The reported change is limited to the invisible-character detection pattern and grep invocation in dogfood-gate.yml. It is related to the linked issue and contains no apparent out-of-scope changes…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

The change fixes the pattern in one dogfood-gate.yml, but issue [#70] also requires a separate leading-BOM check, matching C0 detection in stdlib/ByteDetector.affine and config.ncl, automated coverage for required cases, and updates to the remaining estate-wide copies.

Resolution

Implement all remaining coding requirements from issue [#70]: add the separate leading-BOM check, update stdlib/ByteDetector.affine and config.ncl, add or update automated tests for detection and exclusions, and apply the corrected pattern to all remaining dogfood-gate.yml copies.

Full details: Out of Scope Changes check

Explanation

The reported change is limited to the invisible-character detection pattern and grep invocation in dogfood-gate.yml. It is related to the linked issue and contains no apparent out-of-scope changes.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@gitar-bot

gitar-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

You are using the Gitar free plan. Upgrade to unlock code review, CI analysis, auto-apply, custom automations, and more.

Gitar

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

While this PR correctly identifies the need to switch from byte sequences to Unicode escapes and adds the necessary -a flag for grep, it contains a critical logic flaw in the regex definition. The PCRE engine used by grep -P cannot process Unicode codepoints above 255 without being explicitly told to operate in UTF-8 mode.

As currently implemented, the PATTERNS variable will cause grep to error out. Due to the redirection of stderr to /dev/null in the execution step, this error will be hidden, and the gate will report zero findings, effectively remaining broken. Additionally, there are no automated tests or 'dirty' sample files included to verify that this gate actually catches the intended characters.

About this PR

  • The PR relies on manual verification but does not add automated test cases or sample 'dirty' files to the repository. Without these, it is difficult to ensure the linter remains functional and does not regress in the future.

Test suggestions

  • Missing: Verify detection of a Non-Breaking Space (U+00A0) in a source file
  • Missing: Verify detection of a Zero-Width Space (U+200B) in a source file
  • Missing: Verify detection of a C0 control character, such as Backspace (\x08)
  • Missing: Verify that files containing NUL bytes (\x00) are scanned rather than skipped as binary
  • Missing: Verify that valid whitespace (Tab, LF, CR) does not trigger the gate
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Missing: Verify detection of a Non-Breaking Space (U+00A0) in a source file
2. Missing: Verify detection of a Zero-Width Space (U+200B) in a source file
3. Missing: Verify detection of a C0 control character, such as Backspace (\x08)
4. Missing: Verify that files containing NUL bytes (\x00) are scanned rather than skipped as binary
5. Missing: Verify that valid whitespace (Tab, LF, CR) does not trigger the gate

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

# non-breaking spaces, null bytes, and other invisible Unicode in source files.
set +e
PATTERNS='\xc2\xa0|\xe2\x80\x8b|\xe2\x80\x8c|\xe2\x80\x8d|\xef\xbb\xbf|\xc2\xad|\xe2\x80\x8e|\xe2\x80\x8f|\xe2\x80\xaa|\xe2\x80\xab|\xe2\x80\xac|\xe2\x80\xad|\xe2\x80\xae|\x00'
PATTERNS='\x00|[\x01-\x08\x0B\x0C\x0E-\x1F]|\x{a0}|\x{ad}|\x{200b}|\x{200c}|\x{200d}|\x{200e}|\x{200f}|\x{202a}|\x{202b}|\x{202c}|\x{202d}|\x{202e}|\x{2060}|\x{feff}'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 HIGH RISK

To ensure that Unicode code points are correctly matched in UTF-8 source files, the PCRE engine must be told to operate in UTF-8 mode. Without the (*UTF) or (*UTF8) prefix, the regex will fail to compile for codepoints greater than 255 (e.g., \x{200b}), and since stderr is suppressed on line 136, the check will silently fail and report no issues.

Suggested change
PATTERNS='\x00|[\x01-\x08\x0B\x0C\x0E-\x1F]|\x{a0}|\x{ad}|\x{200b}|\x{200c}|\x{200d}|\x{200e}|\x{200f}|\x{202a}|\x{202b}|\x{202c}|\x{202d}|\x{202e}|\x{2060}|\x{feff}'
PATTERNS='(*UTF)\x00|[\x01-\x08\x0B\x0C\x0E-\x1F]|\x{a0}|\x{ad}|\x{200b}|\x{200c}|\x{200d}|\x{200e}|\x{200f}|\x{202a}|\x{202b}|\x{202c}|\x{202d}|\x{202e}|\x{2060}|\x{feff}'

-o -name '*.idr' -o -name '*.zig' -o -name '*.v' -o -name '*.jl' \
-o -name '*.gleam' -o -name '*.hs' -o -name '*.ml' -o -name '*.sh' \) \
-exec grep -Prl "$PATTERNS" {} \; > /tmp/empty-lint-results.txt 2>/dev/null
-exec grep -aPrl "$PATTERNS" {} \; > /tmp/empty-lint-results.txt 2>/dev/null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ LOW RISK

Nitpick: The -r flag is redundant when grep is executed by find on individual file paths.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant