Skip to content

ci(lint): enable boolean literal comparison rule - #1567

Merged
jeff-r2026 merged 2 commits into
Tencent:mainfrom
huong8373tt-beep:contrib/836-lint-followup
Oct 30, 2026
Merged

jeff-r2026 merged 2 commits into
Tencent:mainfrom
huong8373tt-beep:contrib/836-lint-followup

Conversation

@huong8373tt-beep

@huong8373tt-beep huong8373tt-beep commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • enable typescript/no-unnecessary-boolean-literal-compare as an oxlint warning
  • remove the 27 redundant boolean-literal comparisons it reports across production code and tests
  • preserve default-true and explicit-undefined behavior where those distinctions matter

Part of #836.

Validation

  • npm run typecheck
  • npm run lint
  • npm run build
  • npm exec -- oxlint --config .oxlintrc.json on all changed files (0 warnings/errors)
  • npx vitest run src/__tests__/coauthor-reconcile.test.ts src/__tests__/push-namespaces.test.ts src/__tests__/trae.test.ts (57 passed)
  • npx vitest run src/__tests__/hooks-security.test.ts (20 passed)
  • focused workflow-local-driver cases (3 passed)

Real-CLI verification

After npm run build, used the built dist/index.js in an isolated temporary HOME with a local bare team repository whose env/env.yaml contains TEAMAI_PR1567_FLAG=verified-default-env:

teamai init <local-team-url> --provider git --agent claude --scope project --force  # exit 0
teamai pull                                                               # exit 0
teamai env exec -- node -e "process.stdout.write(process.env.TEAMAI_PR1567_FLAG)"
# verified-default-env

The run exercises the changed default-true environment-delivery path through the compiled CLI. The broader local workflow/session suite hit known Windows-specific test-environment issues unrelated to this diff (POSIX shell/file-mode assertions, plus the existing Claude malformed-session assertion); CI covers those targets on its native runners.

@github-actions

Copy link
Copy Markdown
  • [P1 blocking] Missing real-CLI verification record — The diff changes production code, including src/resources/env.ts:473, but the PR description lists only static checks, a build, and focused tests—not an end-to-end / real-CLI run. The Code Review Rules explicitly require that record for runtime changes. Document one representative real-CLI verification after building; no full provider × agent matrix is required.

No other confident findings in the specified diff.

@huong8373tt-beep

Copy link
Copy Markdown
Contributor Author

Addressed the P1 verification-record request in the PR description.

After npm run build, I ran the built dist/index.js against an isolated temporary HOME and local bare team repo. The fixture declares TEAMAI_PR1567_FLAG=verified-default-env in env/env.yaml; init and pull both exited 0, and teamai env exec -- node -e ... printed verified-default-env.

That is a compiled-CLI exercise of the changed default environment-delivery path.

@SaulMoro SaulMoro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This was generated by AI during triage.

@huong8373tt-beep Thanks. Checked at aafaf19a:

  • npm run lint passes. It runs with --deny-warnings, so the new warn rule is a hard CI gate, as intended. tsc and the build pass.
  • The four changed test files pass, 77/77 here and on main.
  • With the built CLI, init, pull and env exec give the same output on main and this head.
  • The verification record you added to the body covers the CI review's missing-record point.

Non-blocking:

  • [P2 non-blocking] Two edits the rule does not ask for. With the rule turned on at main, oxlint reports 25 comparisons, not 27. The two extra edits are the inheritUserScope === true → (inheritUserScope ?? false) changes in src/resources/env.ts (around lines 474 and 551). They are equivalent, but they are outside the rule. Please drop them or say why they belong, and correct the count in the body.
  • [P2 non-blocking] Values read from untyped JSON. Six sites read a boolean from JSON that is only typed by declaration. For a stored value that is not a real boolean, the rewrite changes behavior. Example: src/local-agent.ts:764 now reads fileConfig.disabled as truthy, so a hand-edited "disabled": "false" disables the source, where === true did not. Declaring such fields as boolean | undefined keeps the strict comparison, and the rule does not flag nullable types.
  • [P3 nit] The recorded expression in src/coauthor-reconcile.ts:466 is harder to read after the rewrite. A few ?? true fallbacks sit on fields a zod default already fills. Some test assertions now accept undefined.

The GITHUB_OPENSOURCE_SCAN_PIPELINE@PULL_REQUEST check fails at this head. It passes on other open PRs, and its details are not public.

@jeff-r2026 Your call. Nothing here blocks from my side apart from that failing scan check.

@SaulMoro
SaulMoro requested a review from jeff-r2026 October 29, 2026 21:34
@github-actions

Copy link
Copy Markdown

No confident findings in the specified diff.

The earlier [P1 blocking] Missing real-CLI verification record is resolved: the updated description records a post-build run using dist/index.js, successful init and pull, and env exec returning the expected value. This satisfies the required representative real-CLI verification; no full provider × agent matrix is required.

Review was read-only; I did not run, build, or install PR code.

@huong8373tt-beep

Copy link
Copy Markdown
Contributor Author

Addressed the semantic-safety and scope feedback in 655b7f6a.

  • Dropped the two unrelated inheritUserScope edits.
  • Restored strict checks for booleans originating from JSON/config data, including disabled, recall-log flags, marketplace strict, and model availability state. Their types now allow undefined, so the boolean-literal rule correctly leaves the strict comparisons alone.
  • Removed the readability regression in the coauthor path by reverting it to the existing implementation.
  • Corrected the PR count to 25 rule findings; the prior 27 count incorrectly included the two unrelated edits.

Validation passed:

npm run typecheck
npm run lint  # 0 warnings / 0 errors
npm run build
git diff --check

This keeps the intended typescript/no-unnecessary-boolean-literal-compare gate while retaining the previous behavior for hand-edited non-boolean JSON values.

@SaulMoro SaulMoro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This was generated by AI during triage.

@huong8373tt-beep Thanks, the points that mattered are fixed at 655b7f6a. The two inheritUserScope edits are gone. The six reads of JSON-sourced values are back to main's strict form: a stored "disabled": "false" now behaves the same as on main. With the built CLI, env delivery and that case give the same output on main and this head. With only this rule enabled, oxlint reports 25 comparisons on main and 0 on this head. The CodeCC scan now passes.

Still open, non-blocking:

  • The body still says 27 comparisons; it is 25.
  • The recorded rewrite in src/coauthor-reconcile.ts:466 is still there. Your reply says it was reverted, but this commit does not touch that file.
  • [P3 nit] The ?? true fallbacks on zod-defaulted fields, and the test assertions that accept undefined.

Three macOS Lint & Test jobs were still running when I checked. None had failed.

@jeff-r2026 Nothing blocking from my side once those jobs are green.

@jeff-r2026 jeff-r2026 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verified on main 5682cc6 together with #1569 and #1450: tsc, lint and build pass; the full unit suite shows the same failures as main on this root host (33, none in the changed files); with the built CLI, init, pull and env exec deliver the team env as on main. Approving.

@jeff-r2026
jeff-r2026 merged commit 85dc5af into Tencent:main Oct 30, 2026
18 checks passed
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
* ci(lint): enable boolean literal comparison rule

* ci(lint): preserve strict boolean semantics
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.

3 participants