mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-26 00:53:48 +00:00
* fix(core): clarify Git requirement for public extensions
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
* test(core): preserve secure Git version boundary
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
* fix(core): support public GitHub extensions with older Git
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
* fix(core): harden old-Git fallback archive validation against export-ignore
Detect Git LFS by pointer-file content instead of .gitattributes grammar: codeload archives honor export-ignore, so a repository can hide its attributes file from the extracted tree and slip raw LFS pointers past the guard (attribute macros and case-variant names bypass the grammar check too). Also restrict the .gitmodules check to the archive root, where git gives it submodule semantics. Add a debug log to the only silent ERROR return in the old-Git update check, unit tests for the fallback gate's fail-closed matrix, and coverage for the invalid-SHA update path.
* test(core): cover archive entry-count and expanded-size limits
Add crafted-header tar fixtures for both new rejection limits in assertTarArchiveHasNoLinks: boundary cases at exactly 100,000 entries and exactly 1 GiB declared expansion, plus just-over cases asserting the specific error messages.
* fix(core): address old-Git fallback review feedback
- Keep release installs ahead of the archive fallback for older Git;
the fallback now only replaces the clone step after a release miss.
- Restrict tar entry-count/expanded-size ceilings to the untrusted
network fallback instead of every .tar.gz extraction, and stop
reading the archive as soon as validation fails.
- Share one ref-to-SHA resolver between install and update checks, and
follow a limited number of GitHub API redirects (re-validated per
hop, token never leaves the original host).
- Use a random staging name for the downloaded source archive so it
cannot collide with a repository file of the same name.
- Collapse the duplicated pinned-Git version comparison into one check.
- Document fallback limitations (symlinks, submodules, LFS, ceilings).
* test(core): cover invalid commit SHA rejection in old-Git fallback
The install path's ref-to-SHA resolver validates the 40-hex SHA before
interpolating it into the codeload download URL; add a test asserting
that an invalid SHA rejects before any archive download is attempted,
matching the existing update-check coverage.
* fix(test): add missing createReadStream and pipeline mocks in npm test
archive-safety.ts now calls fs.createReadStream() and pipeline() directly
instead of tar.t({ file, ... }). The npm test mock for node:fs was missing
createReadStream, and node:stream/promises pipeline was not mocked.
* perf(core): memoize the local Git version probe
The fallback gate and the pinned-Git assert both spawn their own
`git version` subprocess even though the version cannot change within
a process lifetime. Fetch it once through a module-scope memoized
promise so each extension install/update check pays a single probe.
* test(core): cover early abort of the tar safety scan
Once a limit trips, the scan destroys the read stream instead of
consuming the rest of the archive. Add a regression test that trips
the link ceiling with a large trailing entry and asserts the scan
stops reading the archive at the failure point, guarding the teardown
path against deadlocks and scan-to-end regressions.
* fix(core): open the tar safety scan stream after the abort check
A pre-aborted signal entering assertTarArchiveHasNoLinks threw before
pipeline consumed the hoisted ReadStream, abandoning it (unhandled
ENOENT 'error' crash for a missing file, leaked fd otherwise). Move
createReadStream below the abort check to restore check-then-open
order, and add a regression test asserting no stream is opened.
* test(core): cover fetchJson redirects and fallback resource limits
Mirror the downloadFile redirect matrix for fetchJson via the release
metadata path: redirect loop cap, missing location header, non-https
redirect rejection, and both sides of the cross-host token-stripping
ternary. Also add a fallback integration test serving a crafted-header
archive just over the 1 GiB expanded ceiling so the enforceResourceLimits
option on the production call site is pinned end to end.
* fix(test): return a destroyable stream from the npm test fs mock
The bare createReadStream mock returned undefined, so failValidation's
stream.destroy() raised a TypeError absorbed by vitest spy bookkeeping
whenever a validation cap tripped. Return a destroyable object and
assert the cap-trip path completes cleanly.
* fix(test): make fallback anonymity assertions header-case-insensitive
* test(core): abort the old-Git fallback through an AbortSignal
* fix(test): pin the manager's fallback call arguments
* test(core): pin fallback symlink rejection, lookup passthrough, per-hop re-resolution
- Add an integration test that runs the real old-Git fallback against a
symlink-bearing archive mirroring issue #8993's repro repo
(obra/superpowers root AGENTS.md -> CLAUDE.md) and asserts the honest
fail-closed rejection naming the link entry; safe symlink support is
tracked in #9724.
- Assert the fallback's https.get options carry the pinned lookup and
agent:false on both the commits-API and codeload hops.
- Run the five GitHub API redirect tests under networkPolicy: 'public'
and pin per-hop re-validation: dns.lookup is called once per hop and
every hop's options carry the pinned lookup.
* test(core): import archive limit constants instead of redeclaring them
The boundary tests redeclared MAX_ARCHIVE_ENTRIES and
MAX_ARCHIVE_EXPANDED_BYTES locally, so changing a limit in
archive-safety.ts would leave the tests validating the stale values.
Import the constants from the implementation instead.
* fix(core): detect export-ignore-hidden submodules via the commit tree
The submodule guard checked for a root-level .gitmodules in the
extracted archive, but codeload archives honor .gitattributes
export-ignore, so a repository can strip its .gitmodules from the
archive and slip past the presence check while still carrying
submodule gitlinks. Query the commit's tree listing, which keeps every
path regardless of export-ignore, and reject on a root .gitmodules blob
or any gitlink entry before downloading; fail closed when GitHub
truncates the listing. The extracted-tree scan stays as defense in
depth.
---------
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
||
|---|---|---|
| .. | ||
| _meta.ts | ||
| agent-plugins.md | ||
| extension-releasing.md | ||
| getting-started-extensions.md | ||
| introduction.md | ||