Skip to content

fix(deps): upgrade Git and TOML dependencies - #1450

Merged
jeff-r2026 merged 5 commits into
Tencent:mainfrom
HengYangDS:fix/security-dependency-supply
Oct 30, 2026
Merged

jeff-r2026 merged 5 commits into
Tencent:mainfrom
HengYangDS:fix/security-dependency-supply

Conversation

@HengYangDS

@HengYangDS HengYangDS commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Upgrade simple-git to 4.0.2 and smol-toml to 1.9.1. Both Git factories preserve the caller's environment, including GIT_CONFIG_*, GIT_SSH_COMMAND, identity and no-prompt settings. Explicit .env() additions retain simple-git's guard.

Tool lookup checks PATH, then tries bounded bash and zsh login shells. Repository discovery uses the native Git executor; the provider guide and SSH fixture follow that behavior.

Rebased onto 6adcd68f42f5c6e25a475c2e03ca115ac92ade5a. The three bare-remote inspections added by current main now use createGit(remote), with their assertions unchanged.

Type of Change

  • Bug fix

Test Plan

Head: 2cba82fbda48d463c5eb06912e999dd7caba3be4. macOS ARM64, Node 26.13.0, npm 12.2.1.

  • Build, typecheck, lint and git diff --check passed.
  • codebase-deep-enrich: 19/19 tests passed. Before the three-call correction, the two new bare-remote tests failed under simple-git 4.
  • doctor-cli and init-ends-with-pull: 14/14 real-CLI E2E tests passed, including skill delivery with caller-supplied GIT_CONFIG_GLOBAL.
  • Full local unit run: 18,969 passed, 7 failed, 24 skipped. All seven failures are in the unchanged env-exec Bash-startup tests. Socket stdin in Vitest's fork pool skips BASH_ENV; the built CLI and direct Bash apply the member environment with closed stdin. The thread pool passes those seven cases, then fails an existing assertion about environment-name order. The local full suite is not green.

Current-head CI passed, including Node 20/22/24 on Ubuntu and macOS, Windows path/hook checks, fork-safe E2E shards and build. The GitHub-provider remote-fixture job was skipped. Code Erosion also passed on this head. GitHub reports 17 successful checks and one skipped check.

Notes for Reviewers

Upstream Windows core.longpaths=true is preserved in both Git factories. .npmrc is removed from this PR.

The simple-git bundle rewrite is removed. Its approximately 50 ms completion fallback remains; completion.onExit tuning belongs in a separate change. Provider-test deadlines allow native launcher startup under load, and the held-pipe test keeps its failure assertion.

The Zod/Vitest/esbuild migration remains in a separate branch. The current lockfile audit retains 10 findings outside this Git/TOML update, with none reported for simple-git or smol-toml.

@github-actions

Copy link
Copy Markdown

No findings. I found no concrete bugs in the specified diff.

The PR description satisfies the testing requirement: it records a passing compiled-CLI E2E run covering workspace initialization, remote preservation, skill pull, and update. It also clearly distinguishes passing checks from baseline failures and incomplete full-suite runs.

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

@SaulMoro
SaulMoro marked this pull request as ready for review October 27, 2026 07:38
@github-actions

Copy link
Copy Markdown

No findings. I found no concrete bugs in the specified diff. The earlier review raised no findings, so there are none to mark resolved.

The PR description satisfies the testing requirement: it records a passing compiled-CLI E2E run at the candidate commit covering initialization, remote preservation, skill pull, and update. It clearly distinguishes passing checks from baseline failures and incomplete full-suite runs.

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

@HengYangDS
HengYangDS force-pushed the fix/security-dependency-supply branch from 5f2c603 to 751b286 Compare October 27, 2026 09:22
@HengYangDS HengYangDS changed the title fix: upgrade Git and TOML dependencies with native discovery fix(deps): update Git, schema validation and test dependencies Oct 27, 2026
@github-actions

Copy link
Copy Markdown
  • [P2 non-blocking] Keep dependency changes within the stated scope — package.json:68, package.json:84, package.json:94: This diff also migrates Zod and Vitest to v4, with extensive schema/test changes and unrelated lockfile updates. The description explicitly defers Zod migration and claims only four lock entries change. Split these migrations out, consistent with the review rule requiring surgical changes.
  • [P2 non-blocking] Remove the unrelated registry policy — .npmrc:1: Repository-wide registry-host replacement is unrelated to upgrading Git/TOML dependencies or native discovery. Remove it from this PR or handle it as a separately justified change.

Testing: The description records a representative passing compiled-CLI E2E run, satisfying the required testing record. It names candidate 5f2c603, not reviewed head 751b286; the trusted rules explicitly treat an older tested commit as a note, not a blocking finding.

Earlier reviews raised no findings, so none require marking resolved. Review was read-only; I did not run, build, or install PR code.

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

Thanks for the careful testing. Two things block this one.

[P1 blocking] simple-git v4 drops the member's own GIT_* environment from every createGit child. v4 copies process.env and removes every GIT_* key (plus SSH_ASKPASS, EDITOR, PAGER, …) unless it is in allowEnvironment. src/utils/git.ts only allows GIT_TERMINAL_PROMPT and the author/committer variables.

Reproduced with the built CLI (main 92d0b28 vs this PR merged on it, at 5f2c603): a team repo reachable only through an env-supplied url.insteadOf:

export GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="url.file://$TEAM.insteadOf" GIT_CONFIG_VALUE_0=https://example.test/acme/team.git
teamai init https://example.test/acme/team.git --provider git --scope user --agent claude
# add a skill upstream, then
teamai pull
  • main: pull exits 0 and delivers the new skill.
  • this PR: ✖ [user] Pull failed: fatal: unable to access 'https://example.test/acme/team.git/': …, the skill is not delivered.

The same applies to GIT_SSH_COMMAND (members choosing a work key), GIT_ASKPASS (CI token helpers, and teamai's own non-interactive GIT_ASKPASS=echo from src/utils/git-env.ts), GIT_SSL_CAINFO, GIT_CONFIG_GLOBAL. The pull-submodule-skip-sync fixture change (copying to ~/.gitconfig) works around exactly this. Please pass these through (allowEnvironment, or an explicit env), and add a test that a GIT_CONFIG_*/GIT_SSH_COMMAND value reaches the git child.

[P2 non-blocking] The 50 ms exit fallback is still in v4. The completion plugin still waits onExit = 50 with a non-unref'd setTimeout, so removing the tsup patch brings back the exit delay the patch was there for. Re-target the patch at the v4 code instead of deleting it.

Scope (agreeing with the CI review): the current head also migrates Zod and Vitest to v4 (66 files) and adds a repo-wide .npmrc registry replacement pointing at an internal mirror. Please drop the .npmrc and split the Zod/Vitest migration into its own PR, so this one stays the simple-git / smol-toml bump.

@HengYangDS
HengYangDS force-pushed the fix/security-dependency-supply branch from 751b286 to e605981 Compare October 27, 2026 10:22
@github-actions

Copy link
Copy Markdown

No findings. I found no concrete bugs in the specified diff.

The earlier scope findings are resolved: the revised description explicitly includes the Zod/Vitest migrations and explains the registry-host mapping.

Testing: The description satisfies the requirement with a passing real-CLI external-driver scoring journey after a successful build. It records candidate 751b286, rather than reviewed head e605981; under the trusted rules, that is a note, not a blocking finding. Full-suite, Node 20, and additional-platform coverage are explicitly deferred to CI.

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

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

@HengYangDS Thanks. The lockfile checks out: every changed or added package resolves to registry.npmjs.org with an integrity that matches the registry, and no new package has an install script. npm audit --omit=dev goes from 4 findings to 0, and simple-git 3 has no patched release, so the major bump is the right route for that advisory. A home written by main and read by this head, and the reverse, gives identical output and config files.

We agree with the maintainer's review and add what we found with the built CLI at e605981 (a rebase of 751b286 with identical patches):

  • [P1 blocking] The member's own GIT_* variables no longer reach git. We reproduced the maintainer's case with GIT_CONFIG_GLOBAL holding an insteadOf, and with an ssh remote reached through GIT_SSH_COMMAND. On main both work. Here teamai pull prints ✖ Pull failed and delivers nothing, and init cannot push the member registration. allowEnvironment: Object.keys(process.env) brings back simple-git 3's behavior in our run. The e2e suite passes on both sides only because its harness never sets those variables, so a test for this needs to set them itself.

  • [P1 blocking] The unit suite fails: 18 tests in 7 files, all only on this head. main passes the same 570 tests in those files.

    • Four expect zod 3's error text.
    • Thirteen depend on vi.fn() mocks being reset, which Vitest 4 no longer does.
    • session-captures spawns node_modules/vite-node/vite-node.mjs, which the new lock removes, so it times out.

    All 18 come from the Zod and Vitest part, which supports the split the maintainer asked for.

  • [P2 non-blocking] The body's "retaining error behavior" does not hold. A config without username used to report username: Required and now reports username: Invalid input: expected string, received undefined. The same applies to every schema error a member sees. This belongs with the Zod PR.

  • [P2 non-blocking] What .npmrc does depends on the npm version. With npm 11, every lock entry on the mirror is fetched from registry.npmjs.org instead. With npm 10, which the Node 20 and 22 jobs use, it changes nothing for those entries. With either, a contributor who set their own registry now gets 79 tarballs from registry.npmjs.org past it. The mirror is reachable from outside, so main installs publicly without the file.

  • [P2 non-blocking] We measured the exit wait the maintainer mentions: 50 to 52 ms after the last git call, against about 0.5 ms with main's bundle.

  • [P3 nit] The brace-expansion@2 and @5 override bumps match nothing in the new lock.

CI review: its last comment says the scope findings are resolved because the body now describes them. We disagree, for the reasons above. It did not see the environment issue or the failing unit tests.

Verified at 751b286 and rechecked at e605981: build, tsc and lint pass; the full unit suite on both builds (18 failures here, none on main); the full e2e suite passes on both (1836 tests); the environment repro and the 7 failing files were rerun at e605981. CI has not run on this head. Not run here: Node 20, Windows and Linux.

@SaulMoro
SaulMoro requested a review from jeff-r2026 October 27, 2026 10:40
@HengYangDS
HengYangDS force-pushed the fix/security-dependency-supply branch from e605981 to 99e5a6e Compare October 27, 2026 10:49
@github-actions

Copy link
Copy Markdown

No findings. I found no concrete bugs in the specified diff.

The earlier scope findings are resolved: the description now includes the Zod/Vitest migrations and explains the registry-host mapping.

Testing: The description satisfies the requirement by recording a successful build and a passing representative real-CLI E2E journey. Validation names candidate 751b286, not reviewed head 99e5a6e; under the trusted rules, this is a note, not a blocking finding. Full-suite, Node 20, and additional-platform coverage are explicitly deferred to CI.

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

@HengYangDS
HengYangDS force-pushed the fix/security-dependency-supply branch from 99e5a6e to 63e5315 Compare October 27, 2026 14:58
@github-actions

Copy link
Copy Markdown

No findings. I found no concrete bugs in the specified diff.

The earlier scope findings are resolved: the description now includes the Zod/Vitest migrations and explains the registry-host mapping.

Testing: The description satisfies the requirement with a successful build and a passing representative real-CLI E2E journey. Validation names 751b286, not reviewed head 63e5315; the trusted rules treat this as a note, not a blocking finding. Full-suite, Node 20, and additional-platform coverage are explicitly deferred to CI.

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

@HengYangDS
HengYangDS force-pushed the fix/security-dependency-supply branch from 63e5315 to 8032e49 Compare October 27, 2026 15:11
@github-actions

Copy link
Copy Markdown

No findings. I found no concrete bugs in the specified diff. The earlier scope findings remain resolved.

Testing: The description satisfies the requirement with a successful build and passing representative real-CLI E2E runs (init-unattended and providers-cli-path). Validation names 63e5315, rather than reviewed head 8032e49; under the trusted rules, this is a note, not a blocking finding. Additional Node versions and platforms are explicitly deferred to CI.

Review was read-only and limited to the specified diff. I did not run, build, or install PR code.

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

@HengYangDS Thanks. 8032e49 fixes the unit-suite failures we reported: all 7 files that failed last time pass now. Two blocking items remain, one of them new.

  • [P1 blocking] The member's own GIT_* variables still don't reach git (src/utils/git.ts is unchanged since e605981). We reran both cases with the built CLI:

    • insteadOf in GIT_CONFIG_GLOBAL. A team repo reached this way: on main, pull delivers the new skill. Here it prints ✖ Pull failed: Could not resolve host and delivers nothing.
    • GIT_SSH_COMMAND. A team repo reached over ssh this way: on main, the stand-in ssh is called 6 times and the skill arrives. Here it is never called and nothing arrives.
  • [P1 blocking, new] Tool lookup lost the login-shell fallback. src/utils/cli-path.ts no longer tries bash -lc / zsh -lc, so it finds a tool only on the current PATH. That lookup also covers claude, codex, cnb and the judge tools, not only gh. We put gh on PATH only through ~/.zprofile and ran teamai doctor with PATH=/usr/bin:/bin:/usr/sbin:/sbin, which is what a Dock-launched app gives its hooks:

    • on main: ✔ gh CLI is installed, exit 0;
    • here: ✖ gh CLI is installed, exit 1.

    Checking the current PATH first and then falling back to the login shells keeps your goal and the old reach. Nothing in the dependency bump needs this change.

@jeff-r2026's requests are still open:

  • fix the environment pass-through, with a test;
  • re-target the exit-delay patch at simple-git 4;
  • drop .npmrc.

Splitting out the Zod and Vitest migrations is his call.

Non-blocking, still open:

  • [P2 non-blocking] A config without username now reports Invalid input: expected string, received undefined instead of Required.
  • [P2 non-blocking] What .npmrc does still depends on the npm version.
  • [P2 non-blocking] The exit delay after the last git call is still 50–54 ms.
  • [P3 nit] The brace-expansion @2/@5 overrides match nothing in the lock.

CI review: we disagree with "no findings", because of the two items above. CI has not run on this head; its runs wait for a maintainer's approval because the PR changes package.json.

Verified at 8032e49: npm ci, build, tsc and lint pass. The full e2e suite passes (1,839 tests), but its harness never sets these git variables or a narrow PATH, so it can't catch either item. The unit suite's only failures were timeouts under heavy load on our machine, and those tests pass on this head and on main once rerun. Not run here: Node 20/22, Linux and Windows.

@HengYangDS
HengYangDS force-pushed the fix/security-dependency-supply branch from 8032e49 to 08280b7 Compare October 27, 2026 17:43
@github-actions

Copy link
Copy Markdown

No findings. I found no concrete bugs in the specified diff. The earlier dependency-scope and registry-policy findings remain resolved.

Testing: The description satisfies the requirement with a successful build and passing representative real-CLI E2E runs (init-unattended and providers-cli-path). It identifies 8032e49 as the tested head, rather than reviewed head 08280b7; under the trusted rules, this is a note, not a blocking finding. Full-suite results are explicitly tied to an earlier revision, and additional Node/platform coverage is deferred.

Review was read-only and limited to the specified diff. I did not run, build, or install PR code.

@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-review at 08280b7. The rebase onto main kept the three earlier commits unchanged; the only new commit bumps esbuild to 0.28.2 (package.json and package-lock.json only). Both blocking findings from the last review still reproduce with the built CLI, and the maintainer's requests are not answered yet.

Still open

  • [P1 blocking] The member's own GIT_* variables do not reach git (src/utils/git.ts unchanged). With insteadOf in GIT_CONFIG_GLOBAL, teamai pull fails with Could not resolve host. With GIT_SSH_COMMAND, the member's ssh is never called. Nothing is delivered in either case, and pull still exits 0. On main both deliver the new skill.
  • [P1 blocking] Tool lookup has no login-shell fallback (src/cli-path.ts unchanged). With gh on PATH only through ~/.zprofile and PATH=/usr/bin:/bin:/usr/sbin:/sbin, teamai doctor reports ✖ gh CLI is installed and exits 1. Main reports ✔ and exits 0.
  • The maintainer's requests: the environment fix with a test, re-targeting the exit-delay patch at simple-git 4, and dropping .npmrc.
  • The earlier non-blocking items (schema error text, .npmrc, the 50-54 ms exit delay, the brace-expansion overrides, the stale provider doc) are unchanged.

New

  • [P3 nit] The esbuild override forces 0.28.2 onto tsup 8.5.1, which declares ^0.27.0 (tsup 9 declares ^0.28.2). The build and every esbuild consumer pass, so nothing user-visible. The advisory it fixes affects only esbuild's dev server on Windows, which teamai does not use.

Verification at 08280b7

  • npm ci, npm run build, npx tsc --noEmit, npm run lint exit 0; npm audit reports 0 vulnerabilities.
  • Full unit suite: 17,523 passed. 12 workflow timing tests failed under heavy machine load; all 296 tests in those four files pass on rerun, and the same files time out on main under the same load.
  • e2e providers-cli-path, init-unattended, openclaw-hook-launch, doctor-cli, pull-team-ref-1183, push-sync-followups-823 pass (pull-team-ref-1183 on rerun after a load timeout). The full e2e suite passed at the previous head; this commit changes only the bundler.
  • CI did not run tests at this head: the CI run is waiting for maintainer approval because the diff touches package.json.

Not run here: Node 20 and 22, npm 12, Linux and Windows.

@github-actions

Copy link
Copy Markdown

No findings. I found no concrete bugs in the specified diff. The earlier dependency-scope and registry-policy findings remain resolved.

Testing: The PR description satisfies the requirement: it records a successful build and three passing representative real-CLI E2E files on the exact reviewed head, 9831b6d. It distinguishes the final passing suite from earlier intermittent and incomplete runs, and explicitly defers additional Node/platform coverage.

Review was read-only and limited to the specified diff and trusted base review rules. I did not run, build, or install PR code.

@HengYangDS
HengYangDS force-pushed the fix/security-dependency-supply branch from 9831b6d to 6d0dd13 Compare October 28, 2026 06:22
@github-actions

Copy link
Copy Markdown

No findings. I found no concrete bugs in the specified diff. The earlier dependency-scope and registry-policy findings remain resolved.

Testing: The description satisfies the requirement: it records a successful build and three passing representative real-CLI E2E files on the exact reviewed tree. It distinguishes final passing results from earlier failures and timeouts, and defers additional hosted-matrix coverage.

Review was read-only and limited to the specified diff and trusted base review rules. I did not run, build, or install PR code.

@SaulMoro

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Re-review at 6d0dd13a. The rebase onto main resolves skill-driver.ts correctly and keeps main's --tools handling. The new commit moves to Zod 4's z.record(key, value) and gives both git factories the same environment allow-list (GIT_TERMINAL_PROMPT plus the author and committer variables), with a test. Caller identity now reaches git, which answers part of the maintainer's request.

Still open

  • [P1 blocking] The member's own GIT_* variables still don't reach git. simple-git 4 strips every ambient GIT_* name that isn't on the allow-list, and GIT_CONFIG_GLOBAL and GIT_SSH_COMMAND aren't on it. With the built CLI, on main teamai pull delivers the new skill in both cases. On this head:

    • With insteadOf in GIT_CONFIG_GLOBAL, pull fails with Could not resolve host.
    • With GIT_SSH_COMMAND, the member's ssh is called 0 times during pull, against 6 on main.
    • In both cases pull exits 0 with nothing delivered.

    score-drain.test.ts was changed from vi.stubEnv('GIT_SSH_COMMAND', ssh) to git config core.sshCommand, so it now works around the regression instead of catching it. Passing through the GIT_* variables the member already set, and keeping the guard for what teamai sets itself, would fix it, for example allowEnvironment: [...GIT_ENVIRONMENT, ...Object.keys(process.env).filter((k) => /^GIT_/i.test(k))]. Then the test can go back to GIT_SSH_COMMAND.

  • [P1 blocking] Tool lookup still has no login-shell fallback (src/utils/cli-path.ts unchanged). With gh on PATH only through ~/.zprofile, teamai doctor exits 1 with ✖ gh CLI is installed. Main exits 0.

  • The maintainer's other requests: re-target the exit-delay patch at simple-git 4, and drop .npmrc. The body says the environment guard is kept on purpose, but nothing replies to that on the PR.

  • The earlier non-blocking items are unchanged: Zod 4 error text, .npmrc, the ~50 ms exit wait, the brace-expansion overrides, the stale provider doc, and the esbuild/tsup range.

Verification at 6d0dd13a

  • npm ci, build, tsc, lint exit 0. npm audit reports 0 vulnerabilities.
  • Full unit suite: 18,611 passed, 0 failed, 22 skipped.
  • This PR's 5 e2e files: 43 passed, 1 skipped. They were run locally because the CI run is waiting for maintainer approval (package.json changed), so there is no hosted result at this head.

Not run here: Node 20 and 22, Linux and Windows.

@HengYangDS

HengYangDS commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased onto e91cd5f; the updated head is 5ca6eb1. The caller-environment and login-shell fixes remain, with upstream Windows long-path configuration preserved in both Git factories. Build, typecheck, lint and 14 compiled-CLI tests pass.

The full unit run passed 18,868 tests and failed five bare-remote inspection tests. Those inspections now use the remote's own Git context; all 29 tests in that file pass. The body records the full run and the corrected-file rerun separately.

I removed .npmrc and kept the Zod/Vitest/esbuild migration separate. The approximately 50 ms completion fallback remains: an exit-only replacement risks trailing output or inherited pipes, and the old bundle rewrite depends on library internals. A supported upstream completion option would be safer.

@github-actions

Copy link
Copy Markdown
  • [P2 non-blocking] Guard the real-zsh test when zsh is unavailable — src/__tests__/e2e/doctor-cli.test.ts:106: This test skips only Windows, forces bash to fail, and requires a system zsh. On Linux without zsh or system gh, discovery correctly returns null, but the assertion fails. Skip when zsh is unavailable in the fixture PATH, or explicitly provision it.

The earlier dependency-scope and registry-policy findings remain resolved; neither change appears in the current diff.

Testing: The description satisfies the requirement with a successful build and passing representative real-CLI E2E runs. It identifies candidate 6d0dd13, rather than reviewed head 44821be; under the trusted rules, that discrepancy is a note, not blocking.

Review was read-only and limited to the specified diff. I did not run, build, or install PR code.

@HengYangDS
HengYangDS force-pushed the fix/security-dependency-supply branch from 44821be to 5ca6eb1 Compare October 29, 2026 11:36
@github-actions

Copy link
Copy Markdown
  • [P2 non-blocking] Guard the real-zsh test when zsh is unavailable — src/__tests__/e2e/doctor-cli.test.ts:106: This test still skips only Windows and deliberately makes bash fail. On Linux without zsh or system gh in the fixture PATH, discovery correctly returns null, but the assertion fails. Skip when zsh is unavailable in that PATH, or explicitly provision it. The earlier finding remains unresolved.

The earlier dependency-scope and registry-policy findings remain resolved. I found no additional concrete bugs in the specified diff.

Testing: The description satisfies the requirement with a successful build and 14 passing compiled-CLI E2E tests across doctor-cli and init-ends-with-pull. Additional Node/platform coverage is explicitly deferred.

Review was read-only and limited to the specified diff and trusted base rules. I did not run, build, or install PR code.

@github-actions

Copy link
Copy Markdown

No findings. I found no concrete bugs in the specified diff.

The earlier zsh-test finding is resolved: the test now skips when zsh is unavailable in the fixture’s system PATH. The dependency-scope and registry-policy findings remain resolved.

Testing: The description satisfies the requirement with a successful build and 14 passing compiled-CLI E2E tests across doctor-cli and init-ends-with-pull. It clearly identifies the incomplete final full-unit rerun and defers additional Node/platform coverage to CI.

Review was read-only and limited to the specified diff and trusted base review rules. I did not run, build, or install PR code.

@HengYangDS

HengYangDS commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Fixed the zsh fixture in 1415ebdf: it checks for zsh on /usr/bin:/bin and skips when absent. The 6 doctor CLI tests, build, typecheck and lint pass on macOS ARM64. The complete unit run now passes 625 files and 18,873 tests, with 1 file and 24 tests skipped.

The Git environment and login-shell fixes remain here. .npmrc is removed, and the Zod/Vitest/esbuild migration stays separate. The CI run now passes on this head, including Node 20/22/24 on Ubuntu and macOS, Windows path/hook checks, the fork-safe E2E shards and build. The GitHub-provider remote-fixture job was skipped.

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

@HengYangDS @jeff-r2026 This re-reviews 1415ebdf against our comment at 6d0dd13a. Nothing blocking is left.

Resolved, checked with the built CLI against main:

  • GIT_* variables reach git again. A skill is delivered both through a GIT_CONFIG_GLOBAL insteadOf and through GIT_SSH_COMMAND.
  • The login-shell tool lookup works again: doctor exits 0 with a narrow PATH.
  • .npmrc is gone. The Zod, Vitest and esbuild bumps are split out, so the package and lock diffs touch only simple-git and smol-toml. The score-drain workaround and the env tests are cleaned up.
  • The zsh guard for Codex from the CI review is in.

npm ci, build, tsc and lint pass, and so do the 14 changed unit files (497 tests) and the doctor-cli and init-ends-with-pull e2e files. Four CI jobs were still running when we checked (macOS Lint & Test and one e2e shard), and none had failed.

Non-blocking:

  • [P2 non-blocking] The completion fallback stays declined, and that's fine. Two corrections to the stated reason: the earlier patch kept the same 50 ms window and only unref'd it, and simple-git 4.0.2 does expose completion.onExit. The cost is about 50 ms once at CLI exit, not per git call.
  • [P2 non-blocking] allowEnvironment: [...GIT_ENVIRONMENT, ...Object.keys(process.env)] (src/utils/git.ts:195, :230) lets ambient GIT_DIR, GIT_INDEX_FILE and GIT_CONFIG_PARAMETERS reach every git child. Main does the same, so this isn't a regression. Object.keys(withoutGitRepositoryEnv()) (src/utils/git-env.ts:76) would keep the variables we need and drop the repo-pinning ones.
  • [P2 non-blocking] Repository discovery now uses native exec for more than the one --git-dir call that simple-git 4 blocks.
  • [P3 nit] GIT_ENVIRONMENT is redundant: teamai never calls .env(), so the guard it works around never fires here.
  • [P3 nit] The timeouts in workflow-pr-providers.test.ts were widened, and the description doesn't say why.

@HengYangDS

HengYangDS commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Corrected the description: simple-git 4.0.2 exposes completion.onExit, and the provider-test timeout includes native launcher startup under load. Completion tuning stays deferred.

CI is now complete on 1415ebdf: 17 checks passed; the GitHub-provider remote-fixture job was skipped. The remaining environment/discovery suggestions can be reviewed separately so this PR stays focused on the dependency upgrade and its regressions.

Follow-up (16 November): I revisited the environment notes on current main 84561fb0. The Git-hook entry already calls clearGitHookRepositoryEnv() before dispatch; that filter is also in v0.30.0. The ordinary CLI still preserves caller-supplied Git configuration, including the insteadOf and SSH settings verified here. I have not reproduced a wrong-repository call outside the hook path, so I won’t treat the broader filtering suggestion as a confirmed defect or add a duplicate hook fix.

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

Thanks. The Git environment and login-shell fixes check out, but this can't land on current main yet.

  • [P1 blocking] Merged with current main (6adcd68f), two unit tests fail on every platform. #1560 merged after this branch's CI run and added team-repo cases to src/__tests__/codebase-deep-enrich.test.ts that read the bare remote with createGit(clone).raw(['--git-dir', remote, ...]) (lines 460, 467, 471). simple-git 4 rejects that: Use of --git-dir is not permitted without enabling allowUnsafeConfigPaths. publishes generated docs and leaves the clone clean and does not publish when previewing with --dry-run fail; on main with simple-git 3 they pass. Fix: rebase, and read the remote with createGit(remote).raw(['cat-file', ...]) / rev-parse main, the same way you moved the bare-remote inspections in the other tests.

What we ran on main + 1415ebdf (merge 799dfb1a, Linux, Node 20): npm ci, tsc, lint and build pass; npm run test:e2e -- doctor-cli init-ends-with-pull 14/14. With the built CLI, teamai init + teamai pull against a synthetic HTTPS URL that only a GIT_CONFIG_GLOBAL insteadOf resolves cloned the team repo and delivered the skill. The rest of the unit failures on this machine match main's environment failures there (it runs as root).

@HengYangDS
HengYangDS force-pushed the fix/security-dependency-supply branch from 1415ebd to 2cba82f Compare October 29, 2026 17:57
@github-actions

Copy link
Copy Markdown

No findings. I found no concrete bugs in the specified diff.

The earlier zsh-test finding is resolved: the test checks for zsh on the fixture’s system PATH and skips when unavailable. The dependency-scope and registry-policy findings remain resolved.

Testing: The description satisfies the requirement with a successful build and passing representative real-CLI E2E runs. It names 1415ebdf, rather than reviewed head 2cba82fb; under the trusted rules, this is a note, not blocking.

Review was read-only and limited to the specified diff and trusted base review rules. I did not run, build, or install PR code.

@HengYangDS

HengYangDS commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased onto 6adcd68f and changed those three inspections to createGit(remote) in 2cba82f. The affected file passes all 19 tests; build, typecheck, lint and the 14 doctor/init real-CLI tests also pass.

The full local run still has seven Bash-startup failures in the unchanged env-exec tests. The socket-stdin diagnosis and native CLI comparison are recorded in the description. The CI and Code Erosion runs later passed on this head, and the PR merged.

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

@HengYangDS Thanks. Checked again at 2cba82fb:

  • The rebase answers the review from 16:14. git range-diff shows the four earlier commits unchanged, and the only new commit is 2cba82fb, a 3-line test change that switches three inspections to createGit(remote). The two codebase-deep-enrich tests named in that review pass on this head (19/19) and on main.
  • Earlier blockers stay resolved. With the built CLI, a skill is delivered through GIT_CONFIG_GLOBAL and GIT_SSH_COMMAND, and teamai doctor finds gh through the login-shell fallback with a narrow PATH. .npmrc is gone, and the Zod/Vitest/esbuild bumps are out of this PR.
  • tsc and lint pass, and the PR's 14 unit files pass (514 tests). The PR's own e2e files also pass locally: doctor-cli 6/6 and init-ends-with-pull 8/8. CI had not run at this head because the fork runs were waiting for approval. I approved them, so it is running now.

Non-blocking, all the same as main's behavior:

  • [P2] allowEnvironment lets every ambient GIT_* variable reach git children (src/utils/git.ts:195, :230). Building it from withoutGitRepositoryEnv() would keep out GIT_DIR, GIT_INDEX_FILE and GIT_CONFIG_PARAMETERS.
  • [P2] The new native repository-discovery calls spawn a bare git without env: withoutGitRepositoryEnv(), which the sibling calls in git-exclude.ts and doctor-git-exclude.ts pass.
  • [P3] GIT_ENVIRONMENT is redundant next to Object.keys(process.env).

The ~50 ms completion fallback stays as you explained. That is fine with me.

@jeff-r2026 Nothing blocking from my side once CI is green at this head.

@HengYangDS

HengYangDS commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for rechecking and approving the runs. CI has now passed on 2cba82fb, including the Linux/macOS matrix, Windows checks and fork-safe E2E. I've updated the description with the results.

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

Thanks. The 16:14 blocker is fixed at 2cba82f. Verified merged onto main 5682cc6 together with #1567 and #1569: npm ci, tsc, lint and build pass; E2E doctor-cli + init-ends-with-pull 14/14; the full unit suite shows the same 33 failures as main on this root host, none new (codebase-deep-enrich passes). With the built CLI, init through a GIT_CONFIG_GLOBAL insteadOf URL, pull and env exec work. SaulMoro's P2 notes (allowEnvironment scope, env for native discovery) can follow separately. Approving.

@jeff-r2026
jeff-r2026 merged commit f5f25be 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
* fix: upgrade Git and TOML dependencies with native discovery

* fix: preserve caller Git environment and login tool discovery

* test: inspect fixture bare remotes through their own Git context

* test: skip zsh login discovery when the fixture shell is absent

* test: inspect deep-enrich bare remotes directly
@HengYangDS
HengYangDS deleted the fix/security-dependency-supply branch November 6, 2026 07:25
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