-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ci): the invisible-character gate never matched anything #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
be6e8f4
cce5532
edbdf22
6c3c2a4
8481710
63fba59
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,7 +119,7 @@ jobs: | |
| # Checks for: zero-width spaces, zero-width joiners, BOM, soft hyphens, | ||
| # 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='(*UTF)[\x00-\x08\x0B\x0C\x0E-\x1F\x{a0}\x{ad}\x{200b}-\x{200f}\x{202a}-\x{202f}\x{2060}\x{2066}-\x{2069}\x{feff}]' | ||
| find "$GITHUB_WORKSPACE" \ | ||
| -not -path '*/.git/*' -not -path '*/node_modules/*' \ | ||
| -not -path '*/.deno/*' -not -path '*/target/*' \ | ||
|
|
@@ -130,7 +130,7 @@ jobs: | |
| -o -name '*.yml' -o -name '*.yaml' -o -name '*.md' -o -name '*.adoc' \ | ||
| -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 -aPl "$PATTERNS" {} + > /tmp/empty-lint-results.txt | ||
| EL_EXIT=$? | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 MEDIUM RISK The captured exit_code is currently unused in the summary step. If the scanner fails to run (e.g., due to a regex syntax error), the job will report success because the results file will be empty. Update the 'Write summary' step to check if the exit_code is non-zero and report a scanner failure if so. |
||
| set -e | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| K9! | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/sh
set -eu
tmp="$(mktemp)"
trap 'rm -f "$tmp"' EXIT
printf 'K9!\n{ value = 1 }\n' > "$tmp"
nickel --version
if nickel typecheck "$tmp"; then
echo "This Nickel toolchain accepts the K9 header."
else
echo "This Nickel toolchain rejects the K9 header."
fiRepository: hyperpolymath/typedqliser Length of output: 207 🏁 Script executed: #!/bin/sh
set -eu
printf '%s\n' '--- container/deploy.k9.ncl ---'
cat -n container/deploy.k9.ncl
printf '%s\n' '--- relevant repository files ---'
git ls-files | grep -E '(^|/)(README|.*k9.*|.*nickel.*|.*deploy.*|package\.json|Cargo\.toml|flake\.nix|Makefile|\.github/.*)' | head -200Repository: hyperpolymath/typedqliser Length of output: 10168 🏁 Script executed: #!/bin/sh
set -eu
printf '%s\n' '--- K9 validation hook ---'
cat -n .githooks/validate-k9.sh
printf '%s\n' '--- K9 configuration ---'
cat -n k9iser.toml
printf '%s\n' '--- K9 template headers and validation references ---'
for f in .machine_readable/svc/k9/template-hunt.k9.ncl \
.machine_readable/svc/k9/template-kennel.k9.ncl \
.machine_readable/svc/k9/template-yard.k9.ncl \
container/README.adoc \
.machine_readable/svc/k9/README.adoc; do
if [ -f "$f" ]; then
printf '\n--- %s ---\n' "$f"
grep -n -E '^(K9!|#|.*nickel|.*validate|.*header|.*magic)' "$f" | head -120
fi
doneRepository: hyperpolymath/typedqliser Length of output: 20601 🌐 Web query:
💡 Result: The K9! magic header is not part of the standard Nickel language specification, but rather a mandatory requirement for K9, a separate project that utilizes Nickel as a configuration and validation format [1][2]. K9 is a system for self-validating components that uses Nickel for its logic and contract enforcement [1][3]. In the K9 ecosystem, source files (which use the.k9 or.k9.ncl extensions) are required to begin with the magic bytes K9! on the first line [1][4][2]. This header identifies the file as a K9 component, allowing specialized tools to distinguish them from standard Nickel files [1][5]. In summary: - K9! is not a feature of Nickel itself, but of the K9 Self-Validating Components project [1][6]. - The header is used for file identification and security tier detection (Kennel, Yard, or Hunt) [1][7]. - Standard Nickel files do not require or use this magic header [8]. Citations:
Do not pass the raw
🧰 Tools🪛 GitHub Check: Validate K9 contracts[warning] 1-1: [warning] 1-1: [failure] 1-1: 🤖 Prompt for AI Agents |
||
| # SPDX-License-Identifier: MPL-2.0 | ||
| # deploy.k9.ncl — {{PROJECT_NAME}} deployment component (Hunt level) | ||
| # | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 MEDIUM RISK
The (*UTF) prefix forces strict UTF-8 validation. If a file contains invalid UTF-8 sequences, grep will error out and skip that file. Because stderr is redirected to /dev/null on line 133, these failures are silent, meaning invisible characters in malformed files will go undetected. Consider removing the stderr redirection or adding a mechanism to alert when files fail validation.