Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## 0.71.0 — 2026-09-30

### sensor: 上流 CodeGraph の追従(49c11fc..7639c78、368コミット)

- 上流の抽出・解決・explore・MCPの改良を取り込んだ(fix 191、feat 56、perf 3)。主なもの:
名前解決の精度向上、Expo Routerの画面遷移(`navigates` 辺)、生成ファイルの内容判定、
索引の書き手ロック(二重writerの防止)、sub-projectの自動採用、explore の予算配分の改良、
定義ごとにまとめる `callers`/`callees`、存在しない記号を近い名前へ黙って置き換えない(候補を提示)。
- 索引は開いた時点で段階的に更新される。DBスキーマは15、抽出版(EXTRACTION_VERSION)は28へ上がる。
手動の再索引は要らない。
- Latticeの契約は保つ: 状態の置き場は `.lattice/sensor` に固定、install/uninstall/upgrade は拒否、
`callers`/`callees --exact-path` と各要素の `edgeKind`/`valueRef`/`valueWrite`、実行モードの申告(ADR 0049)。
決着の理由は `sensor/UPSTREAM.json` に記録した。

### 修正

- 索引の合成段階が、Latticeの辺の列(confidence・resolved_by)を持たない一時表を使い、
SQLの列数不一致で失敗していたのを直した。
- C/C++で、関数形マクロと同名の呼び出しを「値の読み取り」として数えていたのを直した(wasm・nativeとも)。
- 未解決参照の読み出し順が索引の選び方で変わり、手順表示の順が揺れていたのを、挿入順に固定した。
- Lattice本体が、sensorの「記号が無い」に候補の提示が付いた形も「無い」と読むようにした。
- sensorがgitの一覧経由で `.lattice/`(Latticeの状態置き場)の中のファイルを索引し、変更として数えていたのを直した。
runが置くscriptが「追加」と数えられ、実行中の再compileが索引を古いと判定して、findingの記録を拒んでいた。
- Windowsで、viewerのtrailの置き場のパスに `\` が混じり、保存が拒否されていたのを直した。

## 0.70.0 — 2026-09-30

### 追加
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@quolu/lattice",
"version": "0.70.0",
"version": "0.71.0",
"description": "Schedulability compiler for multi-agent development: observe real code boundaries, refactor the conflicting seam, recompile the plan for parallel execution",
"author": {
"name": "Quo / クオ at kitepon.dev",
Expand Down
68 changes: 68 additions & 0 deletions scripts/upstream-rename.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env node
//
// upstream追従のあとで、上流(CodeGraph)由来の新しい行へLatticeの命名を当てる。
//
// node scripts/upstream-rename.mjs <files...> # 変更件数と残りの上流名を数える
// node scripts/upstream-rename.mjs --write <files...> # 書き換える
// node scripts/upstream-rename.mjs --write --prose <md> # 文書: 単独の名前を「lattice sensor」へ
//
// 3-way mergeは上流の新しい行を上流名のまま持ち込む(Latticeの改名はbaseからの
// ローカル変更なので、上流が新しく書いた行には当たらない)。src/・__tests__/・
// scripts/・kernel・docs/に上流名を残さない契約(test/lattice-sensor-runtime.test.mjs)
// を保つため、衝突解決の前にこれを通すと、hunkの両側が同じ名前で並んで比べやすい。
//
// 規則は置換であって正解の保証ではない。改名は選択的で文脈に依るので(UPSTREAM.json
// notes)、当てたあとは build・test・文言の目視で直す。codegraph を含む行だけを触る。
import { readFileSync, writeFileSync } from 'node:fs';

const write = process.argv.includes('--write');
const prose = process.argv.includes('--prose');
const files = process.argv.slice(2).filter((a) => a !== '--write' && a !== '--prose');

// 例外(現行 Lattice が別名にしたもの)。長いものから当てる。
const EXACT = [
['isCodeGraphDataDir', 'isLatticeStateDir'],
['codeGraphDirName', 'latticeSensorRelativeDir'],
['codegraphDir', 'sensorDir'],
['.codegraph/codegraph.db', '.lattice/sensor/sensor.db'],
['codegraph.db', 'sensor.db'],
['codegraph.lock', 'sensor.lock'],
['mcp__codegraph__', 'mcp__lattice_sensor__'],
['codegraph-kernel', 'lattice-sensor-kernel'],
['colbymchenry/codegraph', 'kitepon/Lattice'],
['.mcpServers.codegraph', '.mcpServers.latticeSensor'],
['hello.codegraph', 'hello.sensor'],
['dist/bin/codegraph.js', 'dist/bin/lattice-sensor.js'],
['bin/codegraph', 'bin/lattice-sensor'],
['codegraph.json', 'lattice-sensor.json'],
];
const SUBCOMMANDS = 'init|uninit|sync|index|status|query|upgrade|list|stop|serve|install|uninstall|files|context|affected|callers|callees|impact|explore|node|search|unlock|daemon|telemetry|ui|mcp|watch|where|version|help|doctor';

function renameLine(line) {
if (!/codegraph/i.test(line)) return line;
let s = line;
for (const [a, b] of EXACT) s = s.split(a).join(b);
s = s.replace(/CODEGRAPH_/g, 'LATTICE_SENSOR_');
s = s.replace(/(?<![A-Za-z0-9])codegraph_(?=[a-z$])/g, 'lattice_sensor_');
s = s.split('\\ncodegraph ').join('\\nlattice sensor ');
s = s.replace(/(?<=[a-z])Codegraph|Codegraph(?=[A-Z])/g, 'LatticeSensor');
s = s.replace(/\[CodeGraph( MCP| daemon| watchdog)?\]/g, (_, x) => `[LatticeSensor${x ?? ''}]`);
s = s.replace(/CodeGraph/g, 'LatticeSensor');
s = s.replace(/(^|[^\w)\]])\.codegraph(?![\w])/g, '$1.lattice/sensor');
s = s.replace(new RegExp(`\\bcodegraph (${SUBCOMMANDS})\\b`, 'g'), 'lattice sensor $1');
s = s.replace(/(['"`])codegraph\1/g, '$1lattice-sensor$1');
s = s.replace(/\bcodegraph-/g, 'lattice-sensor-');
s = s.replace(/\bCodegraph\b/g, 'Lattice sensor');
const comment = prose || /^\s*(\/\/|\*|\/\*|#)/.test(s);
s = s.replace(/\bcodegraph\b/g, comment ? 'lattice sensor' : 'latticeSensor');
return s;
}

let changed = 0; let left = 0;
for (const f of files) {
const src = readFileSync(f, 'utf8');
const out = src.split('\n').map(renameLine).join('\n');
if (out !== src) { changed += 1; if (write) writeFileSync(f, out); }
left += (out.match(/codegraph/gi) ?? []).length;
}
console.log(JSON.stringify({ files: files.length, changed, remaining_mentions: left }));
8 changes: 8 additions & 0 deletions sensor/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ node_modules/
# Build output
dist/

# svelte-package's scratch dir (ui/ library build)
.svelte-kit/

.cmem

# IDE
Expand Down Expand Up @@ -79,3 +82,8 @@ target-linux/
.kommandr/kommandr.db
.kommandr/kommandr.db-wal
.kommandr/kommandr.db-shm

# Stray git bundles from the Windows VM transfer (a lost `:` in an scp target
# once committed three of these, 7.9 MB, into a feature branch).
*.bundle
*.gitbundle
Loading