CodeSampleX

サンプル

lodash.merge 4.6.2

検証済みサンプル — npm lodash.merge 4.6.2. node 22 · linux alpine/x64 · docker で contract を実行し、成功しました: assert merge recursively merges own and inherited enumerable…

sha256:23f8cc0934ac745c5e8ecb62c3bf8caf0a6f06b3033d6e4b9703b89b360b7d03

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。 MIT-0

実行証拠

宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。

証拠の基準
署名済みコントラクト合格
検証レシート
1
ビルドした署名鍵
1
宣言された環境 node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10

検証実行環境

環境 コントラクト ステージ 実行日
node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5…
2026-08-28

ケース

HOW
ゴール
verify pkg:npm/lodash.merge@4.6.2
パッケージ
環境
node 22.23.2
作成日
2026-08-28T05:01:19Z

コントラクト

  1. assert merge recursively merges own and inherited enumerable string keyed properties into destination object
  2. assert merge recursively merges nested plain objects and arrays
  3. assert merge preserves destination value when corresponding source property is undefined
  4. assert merge applies multiple source objects in left-to-right precedence
  5. assert merge mutates and returns the destination object directly

ファイル

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • test/contract.mjs

ソースアーティファクトをダウンロード (tar.gz)

ソース

PROMPT.md
Clean-room public code sample — generation instructions

Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.

A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.

Goal: verify pkg:npm/lodash.merge@4.6.2
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/lodash.merge@4.6.2
Constraints:
  - executionContext: node
Required runtime conditions:
  - ecosystem: npm
  - language: javascript
  - moduleSystem: cjs
  - packageManager: npm@10.9.8
  - runtime: node@22.23.2

Rules:
  - One focused purpose; the smallest project that proves the goal.
  - Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
  - Pin every dependency with a lockfile so resolution is reproducible.
  - No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
  - No personal names, emails, company names, or project identifiers of any kind.
  - No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
  - Keep it under 200 files and 256KB packed.
csx.json
{"case":{"caseId":"case:sha256:97448c223a9f4d967c0dec8c05229e9fc235f5014e15fc2d72f4121f3743329f","constraints":{"executionContext":"node"},"contract":["assert merge recursively merges own and inherited enumerable string keyed properties into destination object","assert merge recursively merges nested plain objects and arrays","assert merge preserves destination value when corresponding source property is undefined","assert merge applies multiple source objects in left-to-right precedence","assert merge mutates and returns the destination object directly"],"goal":"verify pkg:npm/lodash.merge@4.6.2","kind":"HOW","packages":["pkg:npm/lodash.merge@4.6.2"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","moduleSystem":"cjs","os":"linux","osVersionBucket":"24","packageManager":"npm","packageManagerVersion":"10.9.8","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/lodash.merge@4.6.2"],"schemaVersion":1,"subject":"pkg:npm/lodash.merge@4.6.2","verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-lodash-merge",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-lodash-merge",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "lodash.merge": "4.6.2"
      }
    },
    "node_modules/lodash.merge": {
      "version": "4.6.2",
      "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
      "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
      "license": "MIT"
    }
  }
}
package.json
{
  "name": "sample-lodash-merge",
  "version": "1.0.0",
  "type": "module",
  "license": "MIT-0",
  "dependencies": {
    "lodash.merge": "4.6.2"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/lodash.merge@4.6.2",
  "kind": "HOW",
  "packages": [
    "pkg:npm/lodash.merge@4.6.2"
  ],
  "constraints": {
    "executionContext": "node"
  },
  "runtimeConditions": {
    "ecosystem": "npm",
    "language": "javascript",
    "moduleSystem": "cjs",
    "packageManager": "npm@10.9.8",
    "runtime": "node@22.23.2"
  }
}
test/contract.mjs
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';

const require = createRequire(import.meta.url);
const merge = require('lodash.merge');

// 1. Recursively merges properties into destination object
const target1 = { a: 1, b: { x: 10 } };
const src1 = { b: { y: 20 }, c: 3 };
const res1 = merge(target1, src1);
assert.deepEqual(res1, { a: 1, b: { x: 10, y: 20 }, c: 3 });

// 2. Recursively merges nested plain objects and arrays
const target2 = { a: [{ b: 2 }, { d: 4 }] };
const src2 = { a: [{ c: 3 }, { e: 5 }] };
const res2 = merge(target2, src2);
assert.deepEqual(res2, { a: [{ b: 2, c: 3 }, { d: 4, e: 5 }] });

// 3. Preserves destination value when source property is undefined
const target3 = { a: 1, b: 2 };
const src3 = { a: undefined, b: 3, c: undefined };
const res3 = merge(target3, src3);
assert.equal(res3.a, 1);
assert.equal(res3.b, 3);
assert.equal(res3.c, undefined);

// 4. Applies multiple source objects in left-to-right precedence
const target4 = { a: 1 };
const src4_1 = { b: 2, c: 3 };
const src4_2 = { c: 4, d: 5 };
const res4 = merge(target4, src4_1, src4_2);
assert.deepEqual(res4, { a: 1, b: 2, c: 4, d: 5 });

// 5. Mutates and returns the destination object directly
const target5 = { a: 1 };
const res5 = merge(target5, { b: 2 });
assert.equal(res5, target5);
assert.equal(target5.b, 2);

オリジンシーダー

匿名