Skip to content

ci(lint): guard duplicate launch environment names - #1607

Closed
huong8373tt-beep wants to merge 2 commits into
Tencent:mainfrom
huong8373tt-beep:teamai-cli-1590-launch-env
Closed

huong8373tt-beep wants to merge 2 commits into
Tencent:mainfrom
huong8373tt-beep:teamai-cli-1590-launch-env

Conversation

@huong8373tt-beep

Copy link
Copy Markdown
Contributor

Summary

Add the next independent #1590 static-check slice: teamai/launch-env.

  • keeps TEAMAI_MODE, TEAMAI_LAUNCHED_BY, and TEAMAI_WORKFLOW_ATTEMPT string names owned by src/launch-context.ts;
  • rejects production literals and non-computed member access that duplicate those names;
  • leaves the owner module and tests free to define the contract;
  • enables the rule repository-wide through .oxlintrc.json.

Validation

  • npx vitest run oxlint-plugin-teamai/rules/launch-env.test.ts --maxWorkers=2 — 5 passed
  • npm run typecheck — passed
  • npm run lint — 0 warnings, 0 errors
  • npm run build — passed
  • node dist/index.js --version — 0.22.0
  • node dist/index.js list --help — exit 0
  • git diff --check — passed

Related

Part of #1590.

Disclosure

Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.

@huong8373tt-beep
huong8373tt-beep marked this pull request as ready for review October 31, 2026 02:09
@github-actions

Copy link
Copy Markdown

No findings in the scoped diff.

The PR description documents sufficient testing: focused rule tests, typecheck, lint, build, and real-CLI runs (--version and list --help). No missing-testing blocker.

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

@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.

The rule itself looks right: it reports the three launch names as string literals, bare templates and process.env.<NAME> outside src/launch-context.ts and the tests, and lint is clean with it.

[P1 blocking] The branch conflicts with main. Since it was opened, #1601, #1602 and #1604 have each registered a rule in oxlint-plugin-teamai/index.js and turned one on in .oxlintrc.json, so both files conflict. Please rebase and keep every existing entry next to launch-env.

The Windows job timed out in hooks-windows-bash.test.ts ("uses and executes a PowerShell project gate when Git Bash is unavailable"), which this change doesn't touch. A rerun after the rebase should clear it.

@jeff-r2026 Your call once rebased.

@huong8373tt-beep
huong8373tt-beep force-pushed the teamai-cli-1590-launch-env branch from 808c689 to 8442d5e Compare October 31, 2026 02:53
@huong8373tt-beep

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and force-pushed 8442d5e3.

The existing home-env and learnings-root registrations are preserved alongside launch-env in both the plugin and lint config. Local verification after the rebase: launch-env focused tests 5 passed, typecheck passed, lint 0 warnings/errors, and git diff --check passed. The prior Windows timeout was unrelated to this change; CI has been restarted by the push.

Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.

@github-actions

Copy link
Copy Markdown

No findings in the scoped diff.

The PR description documents sufficient testing: focused rule tests, typecheck, lint, build, and real-CLI runs (--version and list --help). No missing-testing blocker.

The earlier review raised no findings, so none require resolution.

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

@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.

Re-checked at 8442d5e3. The rebase resolves the conflict cleanly: launch-env is registered next to home-env, remove-delivered and learnings-root in index.js and .oxlintrc.json, and nothing else changed. The rule was fine in the earlier round, so the conflict was the only blocker.

@jeff-r2026 Your call: ready from my side once CI is green.

@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.

[P1 blocking] #1590 moves each static check into lint and deletes the Vitest test it replaces, so CI gets shorter. This PR adds teamai/launch-env but keeps the the launch variables have one spelling (#1384) block in src/__tests__/launch-context.test.ts (the sourceFiles walk over src/), which checks the same thing. Delete that describe block in this PR.

@jeff-r2026 Your call once the old scan is gone.

@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.

Requesting changes for the [P1 blocking] point above (#1607 (review)): this slice must delete the Vitest scan it replaces, per #1590.

@huong8373tt-beep

Copy link
Copy Markdown
Contributor Author

Pushed 1d17dc7d to remove the launch-name Vitest source scan replaced by teamai/launch-env; the remaining launch-context tests cover runtime behavior. This addresses the P1 change request. git diff --check passes.\n\nSlai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.

@huong8373tt-beep

Copy link
Copy Markdown
Contributor Author

Follow-up verification after 1d17dc7d: launch-env focused tests passed (34 tests across runtime and rule coverage), npm run typecheck passed, npm run lint passed with 0 warnings/errors, and git diff --check passed. The replaced launch-name Vitest scan is removed as requested.\n\nSlai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.

@SaulMoro

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Thank you for this. #1630 has just merged and moved all of #1590 into npm run lint in one change, including teamai/launch-env, which is now enabled on main along with the deletion of the Vitest scan it replaces. This branch is based on an older main, so merging it now would conflict with that work and drop rules main already enables. Closing it as superseded by #1630. One check from here did not make it into #1630: reads such as process.env.TEAMAI_MODE (#1630 flags the quoted names only). Nothing in src/ reads them that way today, but if you want the guard, a small PR on top of main adding it to teamai/launch-env would be welcome.

@SaulMoro SaulMoro closed this Oct 31, 2026
SaulMoro pushed a commit that referenced this pull request Oct 31, 2026
teamai/launch-env also rejects dotted process.env reads of TEAMAI_MODE, TEAMAI_LAUNCHED_BY and TEAMAI_WORKFLOW_ATTEMPT outside src/launch-context.ts.

Closes #1607
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
teamai/launch-env also rejects dotted process.env reads of TEAMAI_MODE, TEAMAI_LAUNCHED_BY and TEAMAI_WORKFLOW_ATTEMPT outside src/launch-context.ts.

Closes Tencent#1607
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