throughline 0.10.16 → 0.10.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,15 @@ shipped to npm but were not individually tagged on GitHub.
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.10.17] — 2026-09-12
14
+
15
+ ### 修正
16
+
17
+ - npm 12が単一要素配列で返す公開版情報を自己更新で受け入れるようにした。
18
+ 正常にpackageを更新しても`version_verification_failed`で停止する問題を修正した。
19
+ 旧文字列形式を維持し、複数版・空配列・不正な値は後続の設定・移行処理の前に拒否する。
20
+ - 公開前の梱包文書検査も、npm 12がpackage名をキーにして返す梱包情報に対応した。
21
+
13
22
  ## [0.10.16] — 2026-09-07
14
23
 
15
24
  ### 修正
@@ -1457,7 +1466,8 @@ two attempts, instrument first instead of patching again.
1457
1466
 
1458
1467
  ---
1459
1468
 
1460
- [Unreleased]: https://github.com/kitepon/Throughline/compare/v0.10.16...HEAD
1469
+ [Unreleased]: https://github.com/kitepon/Throughline/compare/v0.10.17...HEAD
1470
+ [0.10.17]: https://github.com/kitepon/Throughline/compare/v0.10.16...v0.10.17
1461
1471
  [0.10.16]: https://github.com/kitepon/Throughline/compare/v0.10.15...v0.10.16
1462
1472
  [0.10.15]: https://github.com/kitepon/Throughline/compare/v0.10.14...v0.10.15
1463
1473
  [0.10.14]: https://github.com/kitepon/Throughline/compare/v0.10.13...v0.10.14
File without changes
@@ -44,6 +44,9 @@ Windows PowerShell 5.1へ切り替えない。更新前CLIを再利用せず、
44
44
  新CLI、公開PATHから起動したCLI、そのversion、`throughline.self_update.v1`成功結果がすべて
45
45
  一致した場合だけ完了とする。複数npm prefixが混在して公開PATHが旧実体を指す場合は失敗する。
46
46
 
47
+ 公開版の照合は、npmの旧文字列形式と[npm 12の単一結果配列](https://docs.npmjs.com/cli/v12/commands/npm-view/#output)を受け入れる。
48
+ 複数版・空配列・不正な版情報から一つを推測して選ばず、後続の設定・移行処理の前に失敗を返す。
49
+
47
50
  ## 明示的失敗の契約
48
51
 
49
52
  想定外の状態、外部入力違反、I/O失敗、依存不足を成功扱いにしない。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "throughline",
3
- "version": "0.10.16",
3
+ "version": "0.10.17",
4
4
  "type": "module",
5
5
  "description": "Persistent memory hooks for Claude Code, Codex, Grok, and Cursor (/clear-safe context compression)",
6
6
  "keywords": [
@@ -77,7 +77,8 @@ function succeeded(result) {
77
77
  function parseRegistryVersion(result) {
78
78
  if (!succeeded(result)) return null;
79
79
  try {
80
- const value = JSON.parse(result.stdout);
80
+ let value = JSON.parse(result.stdout);
81
+ if (Array.isArray(value) && value.length === 1) [value] = value;
81
82
  return typeof value === 'string' && VERSION_PATTERN.test(value) ? value : null;
82
83
  } catch {
83
84
  return null;
@@ -181,6 +181,52 @@ test('new CLI completes install, migration, and diagnostics in order', () => {
181
181
  });
182
182
  });
183
183
 
184
+ test('自己更新はnpmの単一版を文字列と単一要素配列から読み取る', () => {
185
+ for (const platform of ['darwin', 'linux', 'win32']) {
186
+ for (const registryVersion of ['0.10.16', ['0.10.16']]) {
187
+ const stdout = sink();
188
+ const calls = [];
189
+ const runner = (command, args) => {
190
+ calls.push([command, ...args]);
191
+ if (command === 'npm' || command === 'pwsh.exe') return ok(JSON.stringify(registryVersion));
192
+ if (args.at(-1) === 'install') return ok();
193
+ if (args.at(-2) === 'migrate') return ok(JSON.stringify(migration()));
194
+ if (args.at(-2) === 'factory-diagnostics') return ok(JSON.stringify(readyDiagnostics('0.10.16')));
195
+ throw new Error('想定外の更新工程');
196
+ };
197
+ assert.equal(run(['--json'], {
198
+ stdout, stderr: sink(), runner, platform, packageVersion: '0.10.16',
199
+ nodePath: '/node', cliPath: '/throughline.mjs',
200
+ env: {
201
+ THROUGHLINE_SELF_UPDATE_PHASE: 'post-install',
202
+ THROUGHLINE_SELF_UPDATE_BEFORE_VERSION: '0.10.15',
203
+ THROUGHLINE_SELF_UPDATE_EXPECTED_VERSION: '0.10.16',
204
+ },
205
+ }), 0, `${platform}: ${JSON.stringify(registryVersion)}`);
206
+ assert.equal(calls.length, 4);
207
+ assert.deepEqual(JSON.parse(stdout.values.join('')), updateSuccess('0.10.15', '0.10.16'));
208
+ }
209
+ }
210
+ });
211
+
212
+ test('自己更新は複数版・空配列・不正な版情報で後続工程を始めない', () => {
213
+ for (const value of [[], ['0.10.16', '0.10.17'], [['0.10.16']], [null], [{ version: '0.10.16' }], ['invalid']]) {
214
+ const stdout = sink();
215
+ let calls = 0;
216
+ assert.equal(run(['--json'], {
217
+ stdout, stderr: sink(), packageVersion: '0.10.16', platform: 'darwin',
218
+ runner: () => { calls += 1; return ok(JSON.stringify(value)); },
219
+ env: {
220
+ THROUGHLINE_SELF_UPDATE_PHASE: 'post-install',
221
+ THROUGHLINE_SELF_UPDATE_BEFORE_VERSION: '0.10.15',
222
+ THROUGHLINE_SELF_UPDATE_EXPECTED_VERSION: '0.10.16',
223
+ },
224
+ }), 1);
225
+ assert.equal(calls, 1);
226
+ assert.equal(JSON.parse(stdout.values.join('')).stage, 'version_verification_failed');
227
+ }
228
+ });
229
+
184
230
  test('self-update fails closed without reflecting command output', () => {
185
231
  const stdout = sink();
186
232
  const stderr = sink();
@@ -6,9 +6,20 @@ import { fileURLToPath } from 'node:url';
6
6
  import {
7
7
  extractMarkdownTargets,
8
8
  findMissingPackedTargets,
9
+ packedFileSet,
9
10
  } from '../scripts/verify-pack-markdown-links.mjs';
10
11
  import { spawnPortableSync } from './os/portable-spawn-sync.mjs';
11
12
 
13
+ test('梱包文書検査はnpmの旧配列形式とpackage名をキーにする形式を読む', () => {
14
+ const packed = { name: 'throughline', files: [{ path: 'README.md' }, { path: 'docs/00_overview.md' }] };
15
+ for (const report of [[packed], { throughline: packed }]) {
16
+ assert.deepEqual([...packedFileSet(report)], ['README.md', 'docs/00_overview.md']);
17
+ }
18
+ for (const report of [null, {}, [], [packed, packed], { throughline: { files: null } }]) {
19
+ assert.throws(() => packedFileSet(report), /npm pack dry-run JSON shape invalid/);
20
+ }
21
+ });
22
+
12
23
  test('Markdown-only CI runs the product-owned documentation contract', () => {
13
24
  const packageJson = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
14
25
  assert.equal(