throughline 0.10.11 → 0.10.12

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,13 @@ shipped to npm but were not individually tagged on GitHub.
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.10.12] — 2026-09-01
14
+
15
+ ### Changed
16
+
17
+ - 変更した実装の依存関係から必要なテストと工場環境を選び、依存を確定できない変更だけ全件へ広げ、選択jobのskip・cancel・failureを最終gateで拒否する製品所有CIへ更新した。
18
+ - 文書だけの変更はLinuxの文書検査だけを実行し、共通・未分類の製品変更は従来どおり3環境で検証する。
19
+
13
20
  ## [0.10.11] — 2026-09-01
14
21
 
15
22
  ### Fixed
@@ -1414,7 +1421,8 @@ two attempts, instrument first instead of patching again.
1414
1421
 
1415
1422
  ---
1416
1423
 
1417
- [Unreleased]: https://github.com/kitepon/Throughline/compare/v0.10.11...HEAD
1424
+ [Unreleased]: https://github.com/kitepon/Throughline/compare/v0.10.12...HEAD
1425
+ [0.10.12]: https://github.com/kitepon/Throughline/compare/v0.10.11...v0.10.12
1418
1426
  [0.10.11]: https://github.com/kitepon/Throughline/compare/v0.10.10...v0.10.11
1419
1427
  [0.10.10]: https://github.com/kitepon/Throughline/compare/v0.10.9...v0.10.10
1420
1428
  [0.10.9]: https://github.com/kitepon/Throughline/compare/v0.10.8...v0.10.9
package/README.md CHANGED
@@ -817,7 +817,7 @@ entry to the `tasks` array yourself:
817
817
 
818
818
  ## Commands
819
819
 
820
- **The current release is v0.10.11.** Throughline supports Claude Code, Codex,
820
+ **The current release is v0.10.12.** Throughline supports Claude Code, Codex,
821
821
  Grok, and Cursor as documented host adapters. The versioned, read-only
822
822
  `handoff-context` boundary opens only an existing database and leaves baton
823
823
  state, session ownership, and memory rows unchanged. Factory diagnostics,
@@ -6,7 +6,7 @@
6
6
 
7
7
  ## 現行状態
8
8
 
9
- - release candidateのpackage版は `0.10.11`。tagとnpmの公開確認はpublish後に行う。
9
+ - release candidateのpackage版は `0.10.12`。tagとnpmの公開確認はpublish後に行う。
10
10
  - Claude Code、Codex、Grok、Cursorをfirst-class hostとして扱う。
11
11
  - 現行DB schemaはv9。schemaの正本は [src/db.mjs](../src/db.mjs) の
12
12
  `CURRENT_VERSION`、二相handoffの判断は
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "throughline",
3
- "version": "0.10.11",
3
+ "version": "0.10.12",
4
4
  "type": "module",
5
5
  "description": "Persistent memory hooks for Claude Code, Codex, Grok, and Cursor (/clear-safe context compression)",
6
6
  "keywords": [
@@ -24,16 +24,19 @@ test('Markdown-only CI runs the product-owned documentation contract', () => {
24
24
  );
25
25
  assert.match(
26
26
  workflow,
27
- /documentation-command:\s+npm install --ignore-scripts --no-package-lock --no-audit --no-fund && npm run verify:docs/,
27
+ /documentation-command:\s+npm run verify:docs/,
28
28
  );
29
29
  assert.doesNotMatch(workflow, /documentation-command:\s*(?:["']{2})?\s*$/m);
30
30
 
31
31
  const reusable = readFileSync(new URL('../.github/workflows/product-full-ci.yml', import.meta.url), 'utf8');
32
- assert.match(reusable, /setup documentation Node[\s\S]*actions\/setup-node@[0-9a-f]{40}[\s\S]*node-version:\s*22/);
32
+ const runner = readFileSync(new URL('../scripts/run-product-ci-tests.mjs', import.meta.url), 'utf8');
33
+ assert.match(reusable, /name: documentation dependency install/);
34
+ assert.match(reusable, /scripts\/product-ci-plan\.mjs verify/);
33
35
  assert.ok(
34
- reusable.indexOf('setup documentation Node') < reusable.indexOf('- name: documentation check'),
35
- 'documentation Node must be configured before dependency installation and verification',
36
+ reusable.indexOf('documentation dependency install') < reusable.indexOf('- name: documentation check'),
37
+ 'documentation dependencies must be installed before verification',
36
38
  );
39
+ assert.doesNotMatch(runner, /npm\.cmd|cmd\.exe/);
37
40
 
38
41
  const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
39
42
  const result = spawnPortableSync(npmCommand, ['run', 'verify:docs', '--silent'], {
@@ -0,0 +1,150 @@
1
+ import assert from 'node:assert/strict';
2
+ import { spawnSync } from 'node:child_process';
3
+ import { mkdtemp, mkdir, readFile, rm, writeFile } from 'node:fs/promises';
4
+ import { tmpdir } from 'node:os';
5
+ import { join, resolve } from 'node:path';
6
+ import test from 'node:test';
7
+
8
+ import {
9
+ ALL_ENVIRONMENTS,
10
+ classifyPaths,
11
+ selectTestFiles,
12
+ verifyResults,
13
+ } from '../scripts/product-ci-plan.mjs';
14
+
15
+ const SCRIPT = resolve(import.meta.dirname, '..', 'scripts', 'product-ci-plan.mjs');
16
+
17
+ function git(root, ...args) {
18
+ const result = spawnSync('git', args, { cwd: root, encoding: 'utf8' });
19
+ assert.equal(result.status, 0, result.stderr);
20
+ return result.stdout.trim();
21
+ }
22
+
23
+ async function repository(t) {
24
+ const root = await mkdtemp(join(tmpdir(), 'throughline-ci-plan-'));
25
+ t.after(() => rm(root, { recursive: true, force: true }));
26
+ git(root, 'init');
27
+ git(root, 'config', 'user.name', 'CI test');
28
+ git(root, 'config', 'user.email', 'ci@example.invalid');
29
+ await writeFile(join(root, 'README.md'), '# fixture\n', 'utf8');
30
+ git(root, 'add', 'README.md');
31
+ git(root, 'commit', '-m', 'initial');
32
+ const base = git(root, 'rev-parse', 'HEAD');
33
+ await mkdir(join(root, 'src', 'os'), { recursive: true });
34
+ await writeFile(join(root, 'src', 'os', 'windows-acl.mjs'), '// fixture\n', 'utf8');
35
+ git(root, 'add', 'src/os/windows-acl.mjs');
36
+ git(root, 'commit', '-m', 'windows');
37
+ return { root, base, head: git(root, 'rev-parse', 'HEAD') };
38
+ }
39
+
40
+ test('文書だけの変更はLinuxの文書検査へ分類する', () => {
41
+ const plan = classifyPaths(['README.md', 'docs/04_public_release_plan.md']);
42
+ assert.equal(plan.productChange, false);
43
+ assert.deepEqual(plan.environments, ['linux-workstation']);
44
+ });
45
+
46
+ test('macOS固有変更はmacOSとLinuxへ分類する', () => {
47
+ const plan = classifyPaths(['src/os/macos-terminal.mjs']);
48
+ assert.equal(plan.productChange, true);
49
+ assert.deepEqual(plan.environments, ['macos-native', 'linux-workstation']);
50
+ });
51
+
52
+ test('Windows固有変更はLinuxとWindowsへ分類する', () => {
53
+ const plan = classifyPaths(['src/os/windows-acl.mjs']);
54
+ assert.equal(plan.productChange, true);
55
+ assert.deepEqual(plan.environments, ['linux-workstation', 'windows-native']);
56
+ });
57
+
58
+ test('共通変更と未分類変更は全環境へ広げる', () => {
59
+ for (const paths of [['src/db.mjs'], ['new-product/file.txt'], ['.github/workflows/test.yml'], []]) {
60
+ const plan = classifyPaths(paths);
61
+ assert.equal(plan.productChange, true);
62
+ assert.deepEqual(plan.environments, ALL_ENVIRONMENTS);
63
+ }
64
+ });
65
+
66
+ test('実装変更は依存するテストだけを選ぶ', () => {
67
+ const plan = selectTestFiles(['src/terminal-size.mjs'], resolve(import.meta.dirname, '..'));
68
+ assert.equal(plan.testScope, 'selected');
69
+ assert.ok(plan.testFiles.includes('src/terminal-size.test.mjs'));
70
+ assert.ok(plan.testFiles.length < 82);
71
+ });
72
+
73
+ test('依存を確定できない変更は全テストへ広げる', () => {
74
+ assert.deepEqual(selectTestFiles(['package.json'], resolve(import.meta.dirname, '..')), {
75
+ testScope: 'all',
76
+ testFiles: [],
77
+ });
78
+ });
79
+
80
+ test('結果判定は選択されたfullの成功と文書時の明示skipだけを受け入れる', () => {
81
+ assert.doesNotThrow(() => verifyResults({
82
+ classifyResult: 'success',
83
+ fullResult: 'success',
84
+ productChange: 'true',
85
+ }));
86
+ assert.doesNotThrow(() => verifyResults({
87
+ classifyResult: 'success',
88
+ fullResult: 'skipped',
89
+ productChange: 'false',
90
+ }));
91
+ });
92
+
93
+ test('結果判定は分類失敗と理由不明skipを拒否する', () => {
94
+ assert.throws(() => verifyResults({
95
+ classifyResult: 'failure',
96
+ fullResult: 'skipped',
97
+ productChange: '',
98
+ }), /変更分類jobが成功していません/u);
99
+ assert.throws(() => verifyResults({
100
+ classifyResult: 'success',
101
+ fullResult: 'skipped',
102
+ productChange: 'true',
103
+ }), /選択計画と実行結果が一致しません/u);
104
+ });
105
+
106
+ test('plan入口はGit履歴から変更を分類してGitHub outputへ書く', async (t) => {
107
+ const repo = await repository(t);
108
+ const output = join(repo.root, 'github-output.txt');
109
+ const result = spawnSync(process.execPath, [SCRIPT, 'plan'], {
110
+ cwd: repo.root,
111
+ encoding: 'utf8',
112
+ env: {
113
+ ...process.env,
114
+ EVENT_NAME: 'push',
115
+ BEFORE_SHA: repo.base,
116
+ BASE_SHA: '',
117
+ DISPATCH_BASE: '',
118
+ GITHUB_REF: 'refs/heads/main',
119
+ GITHUB_SHA: repo.head,
120
+ GITHUB_OUTPUT: output,
121
+ REQUESTED_ENVIRONMENT: 'all',
122
+ },
123
+ });
124
+ assert.equal(result.status, 0, result.stderr);
125
+ const outputs = Object.fromEntries((await readFile(output, 'utf8')).trim().split('\n')
126
+ .map((line) => line.split(/=(.*)/su).slice(0, 2)));
127
+ assert.equal(outputs.product_change, 'true');
128
+ assert.deepEqual(JSON.parse(outputs.environments), ['linux-workstation', 'windows-native']);
129
+ assert.equal(outputs.test_scope, 'all');
130
+ assert.equal(outputs.comparison_base, repo.base);
131
+ });
132
+
133
+ test('plan入口はzero SHAを明示失敗にする', async (t) => {
134
+ const repo = await repository(t);
135
+ const result = spawnSync(process.execPath, [SCRIPT, 'plan'], {
136
+ cwd: repo.root,
137
+ encoding: 'utf8',
138
+ env: {
139
+ ...process.env,
140
+ EVENT_NAME: 'push',
141
+ BEFORE_SHA: '0'.repeat(40),
142
+ GITHUB_REF: 'refs/heads/main',
143
+ GITHUB_SHA: repo.head,
144
+ GITHUB_OUTPUT: join(repo.root, 'github-output.txt'),
145
+ REQUESTED_ENVIRONMENT: 'all',
146
+ },
147
+ });
148
+ assert.equal(result.status, 2);
149
+ assert.match(result.stderr, /CI comparison baseが必要です/u);
150
+ });