Repository navigation
ci: analyze Zi sources with zsh-lint in observe mode - #662
Merged
Merged
Conversation
Add zsh-lint.json for Zi's production Zsh sources and an observe-mode caller of the organization zsh-lint workflow, pinned to zsh-lint v1.6.0. The check is advisory and not part of the Promotion gate. Closes #661
ss-o
commented
Oct 19, 2026
ss-o
left a comment
Member
Author
There was a problem hiding this comment.
Fallback review under ADR-0026: Copilot request not registered on 7599f21
Findings
No actionable findings.
Scope: the complete diff of 7599f21: the new zsh-lint.json and .github/workflows/zsh-lint.yml, against #661. No Zi source changes.
Note
This fallback review is not an approval to merge.
Validation
- Passed: every check on this head, including the Promotion gate and Configured Zsh Lint in observe mode: 17 files, 0 parser errors, 0 errors, 0 warnings, 192 info, 4 hint. Its
diagnostics.jsonis byte-identical to the judged local run atmain926ba50. - Passed, rerun independently: the organization runner in observe mode on this head (same counts),
zsh -f tests/ci-registration.zsh,zsh -f tests/stable-qualification.zsh, Trunk on both files, the two analyzer reproductions (z-shell/zsh-lint#746, z-shell/zsh-lint#747) and the native probe behind thezi.zsh:655claim. - Unavailable: a Copilot review; the request did not register on this head.
Checklist verdicts and supporting evidence
- Configuration: correct. Schema version 2. Kind
toolkeeps the plugin lifecycle rules off manager internals.minimum_zsh5.8.1 is the lowest version in thezsh-n.ymlmatrix. Each profile matches how the file is used:zi.zshandlib/zsh/*.zshare sourced;git-process-output.zsh,rpm2cpio.zshandsingle-line.zshrun as commands (lib/zsh/autoload.zsh:719and:3210,lib/zsh/install.zsh:530,:727,:745,:2076and:2077);lib/_ziis#compdef zi;lib/templates/example-scriptis autoloaded by generated plugins (lib/zsh/autoload.zsh:2927). All 17 production Zsh files are covered; tests, fixtures and benchmarks are excluded. - Workflow: correct. The organization reusable workflow is referenced at
@mainunder ADR-0042, and the analyzer is pinned by full SHA. The 11 literal paths resolve to configuration roots; the Zsh files inscripts/are listed one by one because that directory also holds Python. Permissions arecontents: read, the caller owns concurrency, and the path filters cover every analyzed path. The workflow is not a Promotion gate constituent and does not affect the test-registration or stable-qualification contracts. - Description: accurate. The per-rule counts match the runner output. The true-positive, false-positive and wrong-advice rows and a further sample of intentional rows were checked against the source.
- Compatibility and lifecycle: no impact. No change to commands, ices, hooks, loading or the public contract manifest.
Limits and follow-up
The true positives in existing sources (zi.zsh:655, lib/zsh/additional.zsh:86, lib/zsh/install.zsh:2366, the four [ ] and test conditions) and the >1 $tmpfile redirection at lib/zsh/install.zsh:252 are outside this pull request and are recorded for separate follow-up. A new scripts/*.zsh file needs its own line in the workflow's paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Enroll Zi in the organization's shared zsh-lint workflow in observe mode.
zsh-lint.json(configuration schema version 2): kindtool, minimum Zsh5.8.1(the lowest version CI tests), identifierzi.zi.zshandlib/zshare sourced libraries;lib/zsh/git-process-output.zsh,lib/zsh/rpm2cpio.zsh,lib/zsh/single-line.zsh,lib/zcompileandscripts/*.zshare standalone executables;lib/_ziis an autoloaded completion function;lib/templates/example-scriptis an autoload function..github/workflows/zsh-lint.yml, an observe-mode caller of the organizationzsh-lint.ymlworkflow atmain, with the analyzer pinned to v1.6.0 (f6341241c398fd2a784452e75895dafb06186bbc) and 11 literal paths.scripts/also holds Python, so its Zsh files are listed one by one; a newscripts/*.zshfile needs a line here.Observe mode reports findings without failing the job; parser errors, invalid configuration, incomplete reports and tool failures still fail it. The check is not part of the Promotion gate, and the native syntax, compilation and focused tests are unchanged.
Findings at
main926ba5017 files, 0 parser errors, 0 errors, 0 warnings, 192 info, 4 hint. The analysis takes about 5 s locally: 733 parses, 618 of them for
zi.zsh, with a maximum adapter depth of 55. Every finding was checked against the source, and the runtime-dependent true positives were confirmed withzsh -fon Zsh 5.9.2.quoting/unquoted-varsecurity/evalstyle/prefer-double-bracketsJudged sample:
builtin cd -q ${ZI[PLUGINS_DIR]}atlib/zsh/side.zsh:232(defaulted atzi.zsh:171),return $retval, and$urlbuilt from a literalhttps://github.comprefix atlib/zsh/install.zsh:500.$opt_move $opt_move2 $opt_normpassed toziextractatlib/zsh/install.zsh:1805,${${progress:--q}:#1}at:732, and$3atlib/zsh/autoload.zsh:2641, where snippet callers pass an empty$3so hooks receive the snippet argument layout.atinit,atload,atclone,atpull,resetand other ice values Zi evaluates by design (for examplezi.zsh:1839). Generated code: the(q)-quoted stubs atzi.zsh:555,:567and:575.quoting/unquoted-var,zi.zsh:655: after a barebindkeycall,${(Q)string}is empty and is dropped, sobuiltin bindkeylists every binding andprevrecords the last word of that listing. The other two,$origin_urlatlib/zsh/autoload.zsh:803and$attached_volatlib/zsh/install.zsh:2062, are empty only when the command fails anyway.security/eval:lib/zsh/additional.zsh:86interpolateswrapice names and the plugin identifiers intoevalwithout(q), andlib/zsh/install.zsh:2366letsevalsplit unquotedZI[PLUGINS_DIR]path parts.style/prefer-double-brackets:lib/_zi:290,:292and:293, andtest -datlib/zsh/autoload.zsh:3206.lib/zsh/install.zsh:2369andzi.zsh:2176use${x:-word}whose default word contains literal text, so they can never be empty ([bug]: quoting/unquoted-var reports ${x:-word} whose default word has literal text zsh-lint#746).$___opt_map[$cmd]atzi.zsh:3040is a single element, but the finding suggests"${___opt_map[@]}"([bug]: quoting/unquoted-var gives array advice for a single subscripted element zsh-lint#747).Unrelated to any finding,
lib/zsh/install.zsh:252passes>1 $tmpfile, so the fallback download writes standard output to a file named1. This pull request does not change Zi sources; these items are recorded for separate follow-up.Related issues
Closes #661
Type of change
fix: bug fix (non-breaking)feat: new feature (non-breaking)feat!/fix!: breaking changeperf: performance improvementrefactor: code change with no functional impactdocs: documentation onlytest: test addition or correctionbuild: build system or dependency changeci: CI/workflow changestyle: formatting with no behavior changechore: maintenance / dependency bumprevert: revert of an earlier changeChecklist
mainand targets protectedmainVerification:
automation/ci/zsh_lint_ci.pyfrom z-shell/.githubmain) in observe mode, with this configuration, on this branch:passed, with the counts above. Its diagnostics are byte-identical to the judged run atmain926ba50.zsh-lint --config zsh-lint.jsonrun resolves every input to a configured source root.zsh-lint-survey -judgeagrees withzsh -f -non 16 of 17 files. Onlib/zsh/rpm2cpio.zsh,zsh -f -nprintsredirection with no commandbecause the no-exec pass skips an array assignment, but it exits 0 andzcompileaccepts the file, so this is not a parser gap.zsh -f tests/ci-registration.zshandzsh -f tests/stable-qualification.zshpass on Zsh 5.9.2. No Zsh source changes, so the rest of the suite is left to CI.trunk check --no-fix --ci zsh-lint.json .github/workflows/zsh-lint.yml: no issues.Zsh Lintcheck and the Promotion gate on this head are the remaining acceptance evidence.