网络测出了什么
下面每一行都是测量结果,不是观点。每一条都链接到一个已发布的样本,其 contract 在断网的固定容器中执行,你可以自己重跑并反驳结论。
操作系统和运行时来自所链接样本记录的环境;缺少该维度的条目会在筛选时排除。
597 条发现,覆盖 8 个生态。
- cargo
- composer
- gem
- golang
- hex
- npm
- pub
- pypi
样本自述,其契约实测
正在显示已发布样本测得的第 426–450 条(共 568 条)。
-
npm样本契约node · linux/x64commander@15.0.0
普遍认为Spawning git-style executable subcommands with Commander cleans up all process-level event listeners once the subcommand process exits.
实测Spawning executable subcommands in commander registers signal event listeners on the global process object that are never unregistered upon process termination, accumulating memory leaks on subsequent command invocations.
-
npm样本契约node · linux/x64commander@10.0.1
普遍认为Passing a string option name to Option.implies() sets that option to true when the triggering option is parsed.
实测Option.implies('quiet') on an option implicitly sets the boolean quiet option to true when the parent flag is present in Commander 10.0.1 instead of decomposing the string into numeric character properties as in 10.0.0
-
npm样本契约node · linux/x64bun@1.2.17
普遍认为The bun npm package package.json maps the bunx binary entry to bin/bun.exe rather than a dedicated bin/bunx.exe target.
实测assert bun package.json bin field maps bunx to bin/bunx.exe rather than bin/bun.exe in version 1.2.17
-
gem样本契约ruby · linux/x64rack-test@2.2.0
普遍认为Passing an HTTP header dictionary as the third argument to Rack::Test request methods translates header names into Rack environment keys for that single request.
实测assert passing raw HTTP header names in the third argument leaves them un-prefixed in env rather than transforming to HTTP_ CGI keys
-
gem样本契约ruby · linux/x64rack-protection@4.2.1
普遍认为Rack::Protection::CookieTossing evaluates each request independently so that a subsequent valid request with no duplicate cookies succeeds after an earlier attack request was rejected.
实测Calling Rack::Protection::CookieTossing with a subsequent valid request returns HTTP status 403 Forbidden rather than 200 OK because detected malicious cookie names are retained on the middleware instance in @bad_cookies across requests.
-
gem样本契约ruby · linux/x64rack-protection@4.2.1
普遍认为Parameter values with non-string leaf types should survive a round trip through `EscapedParams` unchanged.
实测When a pre-seeded `rack.request.query_hash` with mixed values passes through `Rack::Protection::EscapedParams`, integer and symbol leaves become `nil` before the request body reaches the app, while string leaves are HTML-escaped.
-
composer样本契约php · linux/x64symfony/console@8.1.1
普遍认为A developer expects the default ChoiceQuestion label to be escaped, so `<comment>...` appears in the prompt brackets.
实测In 8.1.1, running a ChoiceQuestion with default `<comment>Add new tag</comment>` must print the prompt with `Select a tag [Add new tag]:` and must not print `[<comment>Add new tag</comment>]`.
-
gem样本契约ruby · linux/x64json@2.9.1
普遍认为JSON.parse with symbolize_names: true and create_additions: true deserializes custom domain objects while symbolizing remaining hash keys, and JSON.generate serializes objects that implement as_json.
实测assert JSON.parse raises ArgumentError when :symbolize_names and :create_additions are combined, making addition deserialization mutually exclusive with key symbolization
-
gem样本契约ruby · linux/x64json@2.9.1
普遍认为Passing nil to JSON.parse should raise JSON::ParserError because it is invalid JSON text.
实测JSON.load(nil) returns nil, so the two APIs are not behaviorally equivalent on nil input.
-
gem样本契约ruby · linux/x64faraday-net_http@3.4.4
普遍认为All Ruby Net::HTTP timeout exceptions inherit from Timeout::Error and are expected to be caught under Faraday::TimeoutError.
实测Net::OpenTimeout is mapped to Faraday::ConnectionFailed rather than Faraday::TimeoutError because faraday-net_http routes socket open failures through its connection failure handler.
-
npm样本契约node · linux/x64@babel/preset-env@7.29.7
普遍认为Modifying .browserslistrc on disk causes @babel/preset-env to automatically pick up the updated target environment on subsequent transformSync calls in a long-running process.
实测When .browserslistrc is modified on disk during a process lifetime, @babel/preset-env continues to emit transpiled code matching the stale cached targets until browserslist.clearCaches() is explicitly invoked.
-
npm样本契约node · linux/x64@babel/preset-env@8.0.2
普遍认为Setting targets to an empty array [] behaves identically to an empty object {} by defaulting to the standard baseline and leaving modern syntax untranspiled.
实测Passing targets: [] resolves to an empty environment matching zero engines and forces full ES5 transpilation of modern arrow functions and const declarations, whereas targets: {} defaults to the modern baseline.
-
gem样本契约ruby · linux/x64faraday-net_http@3.4.4
普遍认为all Net::HTTP timeout conditions including connection open timeouts raise Faraday::TimeoutError
实测assert Net::OpenTimeout raises Faraday::ConnectionFailed rather than Faraday::TimeoutError
-
gem样本契约ruby · linux/x64faraday@2.14.3
普遍认为Passing a nil parameter value in a Faraday query hash omits the key from the serialized URL or encodes it with an empty string equals sign, while parsing a valueless query flag always returns nil across all encoders.
实测Faraday::NestedParamsEncoder and Faraday::FlatParamsEncoder serialize a nil value as a valueless query key without an equals sign rather than omitting it or appending an equals sign, while FlatParamsEncoder decodes valueless query keys as the boolean true rather than nil.
-
npm样本契约node · linux/x64@babel/preset-env@8.0.2
普遍认为Transpiling object rest destructuring and object spread with @babel/preset-env preserves accessor descriptors like getters and copies inherited prototype properties onto the resulting object.
实测Transpiling object rest destructuring and object spread with @babel/preset-env evaluates getters into plain data properties, drops inherited prototype properties and non-enumerable properties, but preserves own enumerable Symbol keys.
-
gem样本契约ruby · linux/x64zeitwerk@2.8.3
普遍认为Zeitwerk autovivifies a namespace module for every subdirectory in a managed root directory, treating empty folders and non-Ruby asset directories as constant namespaces.
实测assert empty directories and directories containing only non-Ruby assets or hidden dotfiles do not autovivify namespace modules and raise NameError on constant access rather than resolving to Module instances
-
gem样本契约ruby · linux/x64faraday@2.14.3
普遍认为Faraday::NestedParamsEncoder.decode raises Faraday::ParsingError when query parameters conflict, and client timeouts inherit from Faraday::ClientError rather than Faraday::ServerError.
实测Faraday::NestedParamsEncoder.decode raises Ruby core TypeError instead of Faraday::ParsingError when a scalar parameter precedes a nested key, but silently overwrites and returns the scalar when the nested key comes first.
-
gem样本契约ruby · linux/x64zeitwerk@2.8.3
普遍认为Defining a non-module object in an explicit namespace file raises Ruby's standard TypeError on nested constant access or Zeitwerk::NameError during autoloading.
实测assert assigning a non-module object in an explicit namespace file immediately raises Zeitwerk::Error from const_added during autoload, escaping rescue NameError and rescue TypeError
-
npm样本契约node · linux/x64@babel/core@8.0.1
普遍认为Dynamic import expressions are parsed as CallExpression AST nodes with an Import callee property.
实测parseSync parses dynamic import('./mod') as an ImportExpression node with a source property rather than a CallExpression with callee Import
-
gem样本契约ruby · linux/x64sorbet-runtime@0.6.13426
普遍认为A `checked(:never)` method in a class with duplicate `method_added` hooks still incurs wrapper allocations on every call.
实测A method annotated with `sig { returns(Integer).checked(:never) }` after a duplicated `method_added` chain runs with 1 allocation on first call and 0 on second call.
-
gem样本契约ruby · linux/x64sorbet-runtime@0.6.13427
普遍认为A sig block failing on first invocation can be retried once its dependencies resolve, sig binds to the next lexically defined method across threads, and re-entering a method during sig evaluation executes the underlying method body.
实测Retrying a method whose lazy sig block previously raised an exception fails with RuntimeError: 'A previous invocation... raised, and the current one succeeded' rather than recovering when the sig block now succeeds.
-
gem样本契约ruby · linux/x64sorbet-runtime@0.6.13427
普遍认为Initializing a T::Struct with an undeclared attribute is silently ignored at runtime
实测Initializing a T::Struct with an unknown attribute raises ArgumentError
-
gem样本契约ruby · linux/x64sorbet-runtime@0.6.13427
普遍认为T::Struct.from_hash rejects unknown payload keys by default with an error, matching T::Struct.new constructor validation.
实测assert from_hash! and from_hash with strict: true raise RuntimeError when unknown keys are provided
-
gem样本契约ruby · linux/x64sorbet-runtime@0.6.13427
普遍认为A method signed with T::Array[Integer] raises TypeError at the call site when the caller passes an array whose elements are not Integers, because the annotation explicitly names the element type.
实测Calling a sig-annotated method with T::Array[Integer] and an array of strings does not raise TypeError; the runtime erases the Integer type parameter and accepts any Array without inspecting its elements.
-
gem样本契约ruby · linux/x64sorbet-runtime@0.6.13427
普遍认为Setting T::Configuration.default_checked_level = :never anywhere before application code runs disables runtime type checking globally, even if class definitions have already been loaded.
实测Calling T::Configuration.default_checked_level= after any sig-annotated method has been invoked raises RuntimeError with 'Set the default checked level earlier', because sorbet-runtime evaluates sig blocks lazily on first call — meaning class loading alone does not trigger evaluation, but one call does.
如何核对这里的任何一行
打开样本,读它的 contract,然后运行。contract 就是该样本自己的测试:它在断网的固定容器中运行,那次运行的签名回执才是网络所存储的东西。这里没有一条依赖我们对某个库的理解,只依赖这个库实际做了什么。
有些已发布的样例不在这个页面上。它们的契约通过了,样例也是活的 —— 但契约里没有一行能当句子读。像 expect(x).toBe(1) 这样的断言,放在它所检验的那个认知旁边,对读者什么也没说。与其登出没人能读的证据,不如空着。