@ihyeon/flow-qa 0.10.6 → 0.10.8
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/README.ko.md +2 -0
- package/README.md +2 -0
- package/dist/src/cli.js +90 -11
- package/dist/src/report.js +2 -1
- package/dist/src/ui/server.js +18 -14
- package/dist/src/workspace.js +86 -0
- package/docs/releases.md +5 -1
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -78,6 +78,8 @@ CLI에서는 `flow-qa run cases/task-flow.json --target demo --case TC-001 --cas
|
|
|
78
78
|
|
|
79
79
|
원본 보고서의 **이 실행의 재실행 찾기**를 누르면 저장된 전체 기록에서 직접 연결된 재실행을 찾습니다. 오래된 결과는 **더 불러오기**로 열고, **전체 실행 보기**로 연결 조건을 해제할 수 있습니다.
|
|
80
80
|
|
|
81
|
+
CLI에서는 `flow-qa reruns .flowqa/runs/<원본-실행-ID> --workspace my-qa --lang ko`로 원본에서 직접 시작한 재실행의 상태와 저장 폴더를 찾습니다. 목록에 나온 폴더는 같은 `--workspace`의 `flow-qa report`에 넘기거나 원본 폴더와 함께 `flow-qa compare`에 넘길 수 있습니다. 불완전한 기록은 목록에서 제외합니다.
|
|
82
|
+
|
|
81
83
|
`0.8.0`부터 **상세 보고서**에서 케이스·오류 내용을 검색하고 상태별로 좁히거나 **실패·오류만** 볼 수 있습니다. **시도 2회 이상만 보기**(0.8.7)를 켜면 여러 번 시도한 케이스만 표시합니다. 표시 건수와 보고서 전체 케이스 수를 구분하며, Markdown·JSON 다운로드와 실패·오류 재실행 준비는 보고서 전체 범위를 유지합니다. 필터에 맞는 ID만 화면 순서대로 저장하려면 **표시된 케이스 ID 다운로드**(0.8.6)를 선택하세요. 자세한 동작은 [보고서 케이스 탐색](docs/ui.md#explore-cases-in-a-report)을 참고하세요.
|
|
82
84
|
|
|
83
85
|
## 실행 결과 비교
|
package/README.md
CHANGED
|
@@ -78,6 +78,8 @@ When the saved suite, target, and selected cases still match that preparation, t
|
|
|
78
78
|
|
|
79
79
|
From an original report, **Find reruns of this run** shows directly linked runs across the full saved history. Use **Load more** for older matches or **Show all runs** to clear the relation.
|
|
80
80
|
|
|
81
|
+
In the CLI, `flow-qa reruns .flowqa/runs/<original-run-id> --workspace my-qa` lists direct reruns with their status and saved directory. Pass a listed directory to `flow-qa report` or compare it with the original using `flow-qa compare` and the same `--workspace`. The command checks the saved reports and skips incomplete entries.
|
|
82
|
+
|
|
81
83
|
From `0.8.0`, **Detailed report** supports case/error-text search, status filters, and **Failed/error only**. Use **At least 2 attempts** (0.8.7) to see only cases with multiple recorded attempts. Counts distinguish displayed matches from all recorded cases. Markdown/JSON downloads and failed/error preparation retain the full report scope. To save just the filtered IDs in the displayed order, choose **Download visible case IDs** (0.8.6). See [report case exploration](docs/ui.md#explore-cases-in-a-report).
|
|
82
84
|
|
|
83
85
|
## Compare recorded runs
|
package/dist/src/cli.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { constants } from 'node:fs';
|
|
2
2
|
import { spawn } from 'node:child_process';
|
|
3
|
-
import { readFile, writeFile, mkdir, access, stat } from 'node:fs/promises';
|
|
4
|
-
import { resolve, dirname, basename } from 'node:path';
|
|
3
|
+
import { readFile, writeFile, mkdir, access, stat, lstat, readdir, realpath, open } from 'node:fs/promises';
|
|
4
|
+
import { resolve, dirname, basename, join } from 'node:path';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
import { parseArgs } from 'node:util';
|
|
7
7
|
import { localeFromEnv, localized, localizeProductMessage } from "./i18n.js";
|
|
8
8
|
import { configSchema, idSchema, modelSchema, targetSchema } from "./schema.js";
|
|
9
|
-
import { initWorkspace, readConfig, readSuite, sha256, verifySuiteSource, writeConfig, writeJSON } from "./workspace.js";
|
|
9
|
+
import { initWorkspace, readConfig, readSuite, sha256, verifySuiteSource, withConfigLock, writeConfig, writeJSON } from "./workspace.js";
|
|
10
10
|
import { buildPlanningPrompt, planFlow } from "./planner.js";
|
|
11
11
|
import { compileSuite } from "./compiler.js";
|
|
12
12
|
import { CaseSelectionError, isReportSelectionValid, selectCases } from "./case-selection.js";
|
|
13
13
|
import { runSuite } from "./engine.js";
|
|
14
|
-
import { renderSavedMarkdown } from "./report.js";
|
|
14
|
+
import { MAX_SAVED_REPORT_BYTES, RUN_ID, parseArchivedReportEnvelope, renderSavedMarkdown } from "./report.js";
|
|
15
15
|
import { registrationTarget, sameReportTarget, targetLabel } from "./targets.js";
|
|
16
16
|
import { compareCaseSteps } from "./step-comparison.js";
|
|
17
17
|
import { createAgentHandoff, reviewAgentHandoff } from "./agent-handoff.js";
|
|
@@ -38,6 +38,7 @@ Usage: flow-qa <command> [arguments] [options]
|
|
|
38
38
|
agent-review <handoff-dir> <result.json>
|
|
39
39
|
Check agent-supplied findings and evidence references
|
|
40
40
|
report <run-directory> View a saved QA report
|
|
41
|
+
reruns <run-directory> List runs prepared from a saved report
|
|
41
42
|
compare <run-a> <run-b> Compare case results and authored steps
|
|
42
43
|
ui [--demo] [--port 4310] Start the local QA UI
|
|
43
44
|
browser install [--with-deps] Install this package's Playwright Chromium
|
|
@@ -69,6 +70,7 @@ Local example: flow-qa ui --demo
|
|
|
69
70
|
agent-review <handoff-dir> <result.json>
|
|
70
71
|
에이전트 관찰 결과와 증거 파일 참조 검사
|
|
71
72
|
report <run-directory> 저장된 QA 리포트 보기
|
|
73
|
+
reruns <run-directory> 저장된 리포트에서 시작한 재실행 찾기
|
|
72
74
|
compare <run-a> <run-b> 케이스 결과와 원본 단계 비교
|
|
73
75
|
ui [--demo] [--port 4310] 로컬 QA 화면 실행
|
|
74
76
|
browser install [--with-deps] 패키지의 Playwright Chromium 설치
|
|
@@ -190,7 +192,6 @@ export async function main(args) {
|
|
|
190
192
|
return;
|
|
191
193
|
}
|
|
192
194
|
if (command === 'connect') {
|
|
193
|
-
const config = await readConfig(workspace);
|
|
194
195
|
const name = idSchema.parse(required(arg, localized(locale, 'Target name', '대상 이름'), locale));
|
|
195
196
|
const platform = values.platform ?? 'web';
|
|
196
197
|
if (!['web', 'ios', 'android'].includes(platform))
|
|
@@ -201,18 +202,25 @@ export async function main(args) {
|
|
|
201
202
|
const target = targetSchema.parse(platform === 'web'
|
|
202
203
|
? { url: required(values.url, '--url', locale) }
|
|
203
204
|
: { kind: 'mobile', platform, bundleId: required(values['bundle-id'], '--bundle-id', locale), device: required(values.device, '--device', locale) });
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
205
|
+
const saved = await withConfigLock(workspace, async () => {
|
|
206
|
+
const config = await readConfig(workspace);
|
|
207
|
+
config.targets[name] = registrationTarget(target, config.targets[name]);
|
|
208
|
+
await writeConfig(workspace, config);
|
|
209
|
+
return config.targets[name];
|
|
210
|
+
});
|
|
211
|
+
console.log(localized(locale, `Target ${name} saved: ${targetLabel(saved)}. No app has been launched.`, `대상 ${name} 저장: ${targetLabel(saved)}. 앱은 실행하지 않았습니다.`));
|
|
207
212
|
return;
|
|
208
213
|
}
|
|
209
214
|
if (command === 'model') {
|
|
210
215
|
if (arg !== 'planner' && arg !== 'agent')
|
|
211
216
|
throw new Error(localized(locale, 'Model role must be planner or agent.', '모델 종류는 planner 또는 agent여야 합니다.'));
|
|
212
|
-
const config = await readConfig(workspace);
|
|
213
217
|
const base = { baseURL: required(values.url, '--url', locale), model: required(values.model, '--model', locale), ...(values['key-env'] ? { apiKeyEnv: values['key-env'] } : {}) };
|
|
214
|
-
|
|
215
|
-
await
|
|
218
|
+
const connection = modelSchema.parse(base);
|
|
219
|
+
await withConfigLock(workspace, async () => {
|
|
220
|
+
const config = await readConfig(workspace);
|
|
221
|
+
config[arg] = connection;
|
|
222
|
+
await writeConfig(workspace, config);
|
|
223
|
+
});
|
|
216
224
|
console.log(localized(locale, `${arg} model connection saved. No model call has been made. API key values are not saved in the configuration file.`, `${arg} 모델 연결 설정 저장. 실제 호출 전입니다. API 키 값은 설정 파일에 저장하지 않습니다.`));
|
|
217
225
|
return;
|
|
218
226
|
}
|
|
@@ -335,6 +343,77 @@ export async function main(args) {
|
|
|
335
343
|
console.log(content.replace(/\u001b/g, ''));
|
|
336
344
|
return;
|
|
337
345
|
}
|
|
346
|
+
if (command === 'reruns') {
|
|
347
|
+
if (second)
|
|
348
|
+
throw new Error(localized(locale, 'reruns accepts one run directory.', 'reruns에는 실행 폴더 하나만 지정하세요.'));
|
|
349
|
+
const canonicalWorkspace = await realpath(workspace);
|
|
350
|
+
let root = canonicalWorkspace;
|
|
351
|
+
for (const part of ['.flowqa', 'runs']) {
|
|
352
|
+
root = join(root, part);
|
|
353
|
+
const info = await lstat(root);
|
|
354
|
+
if (!info.isDirectory() || info.isSymbolicLink() || await realpath(root) !== root) {
|
|
355
|
+
throw new Error(localized(locale, 'Invalid workspace run path.', '작업 공간의 실행 경로가 유효하지 않습니다.'));
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
const selectedDir = resolve(workspace, required(arg, localized(locale, 'Run directory', '실행 폴더'), locale));
|
|
359
|
+
const originalId = basename(selectedDir);
|
|
360
|
+
const selectedInfo = await lstat(selectedDir);
|
|
361
|
+
if (!RUN_ID.test(originalId) || selectedInfo.isSymbolicLink() ||
|
|
362
|
+
await realpath(selectedDir) !== join(root, originalId)) {
|
|
363
|
+
throw new Error(localized(locale, 'Choose a saved run in this workspace.', '이 작업 공간에 저장된 실행을 선택하세요.'));
|
|
364
|
+
}
|
|
365
|
+
const readReport = async (id) => {
|
|
366
|
+
const dir = join(root, id);
|
|
367
|
+
const dirInfo = await lstat(dir);
|
|
368
|
+
if (!dirInfo.isDirectory() || dirInfo.isSymbolicLink() || await realpath(dir) !== dir)
|
|
369
|
+
return undefined;
|
|
370
|
+
const file = join(dir, 'qa-report.json');
|
|
371
|
+
const fileInfo = await lstat(file);
|
|
372
|
+
if (!fileInfo.isFile() || fileInfo.isSymbolicLink() || fileInfo.size > MAX_SAVED_REPORT_BYTES ||
|
|
373
|
+
await realpath(file) !== file)
|
|
374
|
+
return undefined;
|
|
375
|
+
const handle = await open(file, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
376
|
+
let contents;
|
|
377
|
+
try {
|
|
378
|
+
const opened = await handle.stat();
|
|
379
|
+
if (!opened.isFile() || opened.size > MAX_SAVED_REPORT_BYTES)
|
|
380
|
+
return undefined;
|
|
381
|
+
contents = await handle.readFile('utf8');
|
|
382
|
+
}
|
|
383
|
+
finally {
|
|
384
|
+
await handle.close();
|
|
385
|
+
}
|
|
386
|
+
const report = parseArchivedReportEnvelope(JSON.parse(contents));
|
|
387
|
+
return report?.runId === id ? report : undefined;
|
|
388
|
+
};
|
|
389
|
+
let original;
|
|
390
|
+
try {
|
|
391
|
+
original = await readReport(originalId);
|
|
392
|
+
}
|
|
393
|
+
catch { /* Invalid saved run. */ }
|
|
394
|
+
if (!original)
|
|
395
|
+
throw new Error(localized(locale, 'This is not a valid saved run.', '유효한 저장 실행이 아닙니다.'));
|
|
396
|
+
const matches = [];
|
|
397
|
+
for (const id of await readdir(root)) {
|
|
398
|
+
if (!RUN_ID.test(id) || id === originalId)
|
|
399
|
+
continue;
|
|
400
|
+
try {
|
|
401
|
+
const report = await readReport(id);
|
|
402
|
+
if (report?.parentRunId !== originalId)
|
|
403
|
+
continue;
|
|
404
|
+
matches.push({ id, status: report.status, mtime: (await lstat(join(root, id))).mtimeMs });
|
|
405
|
+
}
|
|
406
|
+
catch { /* Incomplete or unsafe saved run. */ }
|
|
407
|
+
}
|
|
408
|
+
matches.sort((a, b) => b.mtime - a.mtime || a.id.localeCompare(b.id));
|
|
409
|
+
if (!matches.length) {
|
|
410
|
+
console.log(localized(locale, 'No runs were prepared from this report.', '이 리포트에서 시작한 재실행이 없습니다.'));
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
for (const item of matches)
|
|
414
|
+
console.log(`${item.status}\t.flowqa/runs/${item.id}`);
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
338
417
|
if (command === 'compare') {
|
|
339
418
|
const load = async (dir) => {
|
|
340
419
|
const data = JSON.parse(await readFile(resolve(workspace, required(dir, localized(locale, 'Run directory', '실행 폴더'), locale), 'qa-report.json'), 'utf8'));
|
package/dist/src/report.js
CHANGED
|
@@ -6,7 +6,8 @@ import { isReportSelectionValid } from "./case-selection.js";
|
|
|
6
6
|
import { localized, localizeProductMessage } from "./i18n.js";
|
|
7
7
|
import { idSchema } from "./schema.js";
|
|
8
8
|
import { targetLabel } from "./targets.js";
|
|
9
|
-
const RUN_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
9
|
+
export const RUN_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
10
|
+
export const MAX_SAVED_REPORT_BYTES = 2 * 1024 * 1024;
|
|
10
11
|
const archiveEnvelopeSchema = z.object({
|
|
11
12
|
schemaVersion: z.literal('flow-qa/report-1'), runId: z.string().regex(RUN_ID), suiteId: idSchema,
|
|
12
13
|
parentRunId: z.string().regex(RUN_ID).optional(),
|
package/dist/src/ui/server.js
CHANGED
|
@@ -20,21 +20,20 @@ import { runSuite } from "../engine.js";
|
|
|
20
20
|
import { localeFromAcceptLanguage, localizeProductMessage } from "../i18n.js";
|
|
21
21
|
import { EvidenceError, readEvidence } from "./evidence.js";
|
|
22
22
|
import { buildPlanningPrompt, planFlow, PlannerError } from "../planner.js";
|
|
23
|
-
import { parseArchivedReportEnvelope, renderSavedMarkdown } from "../report.js";
|
|
23
|
+
import { MAX_SAVED_REPORT_BYTES, RUN_ID, parseArchivedReportEnvelope, renderSavedMarkdown } from "../report.js";
|
|
24
24
|
import { compareReports, ComparisonError, renderComparisonMarkdown } from "../run-comparison.js";
|
|
25
25
|
import { configSchema, idSchema, modelSchema, suiteSchema, targetSchema } from "../schema.js";
|
|
26
26
|
import { registrationTarget, targetFingerprint } from "../targets.js";
|
|
27
|
-
import { CONFIG_FILE, sha256 } from "../workspace.js";
|
|
27
|
+
import { CONFIG_FILE, sha256, withConfigLock } from "../workspace.js";
|
|
28
28
|
const MAX_BODY = 256 * 1024;
|
|
29
29
|
const MAX_FLOW = 128 * 1024;
|
|
30
30
|
const MAX_CONFIG = 256 * 1024;
|
|
31
31
|
const MAX_SUITE = 512 * 1024;
|
|
32
|
-
const MAX_REPORT =
|
|
32
|
+
const MAX_REPORT = MAX_SAVED_REPORT_BYTES;
|
|
33
33
|
const MAX_STATIC = 4 * 1024 * 1024;
|
|
34
34
|
const PLAN_TIMEOUT_MS = 65_000;
|
|
35
35
|
const CLOSE_WAIT_MS = 10_000;
|
|
36
36
|
const BROWSER_INSTALL_COMMAND = 'flow-qa browser install';
|
|
37
|
-
const RUN_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
38
37
|
const RUN_STATUSES = new Set(['passed', 'failed', 'blocked', 'error', 'interrupted']);
|
|
39
38
|
const RUN_HISTORY_LIMIT = 50;
|
|
40
39
|
const RUN_CURSOR_MAX_LENGTH = 512;
|
|
@@ -852,9 +851,11 @@ export async function startUIServer(options) {
|
|
|
852
851
|
z.object({ name: idSchema, kind: z.literal('web').optional(), url: z.string(), description: z.string().optional() }).strict(),
|
|
853
852
|
]), body);
|
|
854
853
|
const target = parse(targetSchema, input);
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
854
|
+
await withConfigLock(workspace, async () => {
|
|
855
|
+
const settings = await config();
|
|
856
|
+
settings.targets[name] = registrationTarget(target, settings.targets[name]);
|
|
857
|
+
await updateConfig(settings);
|
|
858
|
+
}, false);
|
|
858
859
|
});
|
|
859
860
|
sendJSON(response, 200, { ok: true });
|
|
860
861
|
return;
|
|
@@ -865,13 +866,16 @@ export async function startUIServer(options) {
|
|
|
865
866
|
z.object({ role: z.enum(['planner', 'agent']), clear: z.literal(true) }).strict(),
|
|
866
867
|
z.object({ role: z.enum(['planner', 'agent']), baseURL: z.string(), model: z.string(), apiKeyEnv: z.string().optional() }).strict(),
|
|
867
868
|
]), body);
|
|
868
|
-
const
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
869
|
+
const connection = 'clear' in change ? undefined : parse(modelSchema, { baseURL: change.baseURL, model: change.model,
|
|
870
|
+
...(change.apiKeyEnv === undefined ? {} : { apiKeyEnv: change.apiKeyEnv }) });
|
|
871
|
+
await withConfigLock(workspace, async () => {
|
|
872
|
+
const settings = await config();
|
|
873
|
+
if (connection)
|
|
874
|
+
settings[change.role] = connection;
|
|
875
|
+
else
|
|
876
|
+
delete settings[change.role];
|
|
877
|
+
await updateConfig(settings);
|
|
878
|
+
}, false);
|
|
875
879
|
});
|
|
876
880
|
sendJSON(response, 200, { ok: true });
|
|
877
881
|
return;
|
package/dist/src/workspace.js
CHANGED
|
@@ -1,8 +1,94 @@
|
|
|
1
|
+
import { constants } from 'node:fs';
|
|
1
2
|
import { lstat, mkdir, open, readFile, realpath, rename, unlink, writeFile } from 'node:fs/promises';
|
|
2
3
|
import { resolve, dirname } from 'node:path';
|
|
3
4
|
import { createHash, randomUUID } from 'node:crypto';
|
|
5
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
4
6
|
import { configSchema, suiteSchema } from "./schema.js";
|
|
5
7
|
export const CONFIG_FILE = 'flowqa.config.json';
|
|
8
|
+
const localConfigWriters = new Map();
|
|
9
|
+
/** Serialize read-modify-write changes from CLI processes and the local UI. */
|
|
10
|
+
export async function withConfigLock(workspace, change, allowSymlink = true) {
|
|
11
|
+
const alias = resolve(workspace, CONFIG_FILE);
|
|
12
|
+
if (!allowSymlink && (await lstat(alias)).isSymbolicLink())
|
|
13
|
+
throw new Error('Invalid configuration file path.');
|
|
14
|
+
let file;
|
|
15
|
+
try {
|
|
16
|
+
file = await realpath(alias);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (error.code === 'ENOENT')
|
|
20
|
+
throw new Error('flowqa.config.json is missing. Run flow-qa init first.');
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
const lockDirectory = resolve(dirname(file), '.flowqa');
|
|
24
|
+
await mkdir(lockDirectory, { recursive: true, mode: 0o700 });
|
|
25
|
+
const directoryInfo = await lstat(lockDirectory);
|
|
26
|
+
if (!directoryInfo.isDirectory() || directoryInfo.isSymbolicLink() || await realpath(lockDirectory) !== lockDirectory) {
|
|
27
|
+
throw new Error('Invalid configuration lock path.');
|
|
28
|
+
}
|
|
29
|
+
const lockFile = resolve(lockDirectory, `config-lock-${sha256(file)}.sqlite`);
|
|
30
|
+
const previous = localConfigWriters.get(lockFile);
|
|
31
|
+
let releaseLocal;
|
|
32
|
+
const localTurn = new Promise(resolveTurn => { releaseLocal = resolveTurn; });
|
|
33
|
+
localConfigWriters.set(lockFile, localTurn);
|
|
34
|
+
if (previous)
|
|
35
|
+
await previous;
|
|
36
|
+
try {
|
|
37
|
+
const noFollow = process.platform === 'win32' ? 0 : constants.O_NOFOLLOW;
|
|
38
|
+
let handle;
|
|
39
|
+
try {
|
|
40
|
+
handle = await open(lockFile, constants.O_CREAT | constants.O_EXCL | constants.O_RDWR | noFollow, 0o600);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (error.code !== 'EEXIST')
|
|
44
|
+
throw error;
|
|
45
|
+
handle = await open(lockFile, constants.O_RDWR | noFollow);
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
const opened = await handle.stat();
|
|
49
|
+
const pathInfo = await lstat(lockFile);
|
|
50
|
+
if (!opened.isFile() || !pathInfo.isFile() || pathInfo.isSymbolicLink() || pathInfo.nlink !== 1 ||
|
|
51
|
+
opened.dev !== pathInfo.dev || opened.ino !== pathInfo.ino ||
|
|
52
|
+
process.platform !== 'win32' && (opened.mode & 0o077) !== 0) {
|
|
53
|
+
throw new Error('Invalid configuration lock file.');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
finally {
|
|
57
|
+
await handle.close();
|
|
58
|
+
}
|
|
59
|
+
const { DatabaseSync } = await import('node:sqlite');
|
|
60
|
+
const database = new DatabaseSync(lockFile);
|
|
61
|
+
const deadline = Date.now() + 20_000;
|
|
62
|
+
let acquired = false;
|
|
63
|
+
try {
|
|
64
|
+
database.exec('PRAGMA busy_timeout = 0');
|
|
65
|
+
while (!acquired) {
|
|
66
|
+
try {
|
|
67
|
+
database.exec('BEGIN IMMEDIATE');
|
|
68
|
+
acquired = true;
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
if (error.errcode !== 5)
|
|
72
|
+
throw error;
|
|
73
|
+
if (Date.now() >= deadline)
|
|
74
|
+
throw new Error('Could not update configuration while another process is saving it. Retry the command.');
|
|
75
|
+
await delay(40);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return await change();
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
if (acquired)
|
|
82
|
+
database.exec('ROLLBACK');
|
|
83
|
+
database.close();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
finally {
|
|
87
|
+
releaseLocal();
|
|
88
|
+
if (localConfigWriters.get(lockFile) === localTurn)
|
|
89
|
+
localConfigWriters.delete(lockFile);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
6
92
|
export async function readConfig(workspace) {
|
|
7
93
|
try {
|
|
8
94
|
return configSchema.parse(JSON.parse(await readFile(resolve(workspace, CONFIG_FILE), 'utf8')));
|
package/docs/releases.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Releases and verification
|
|
2
2
|
|
|
3
|
+
## 0.10.8 — Concurrent configuration updates
|
|
4
|
+
|
|
5
|
+
CLI `connect` and `model` commands and the local UI's target and model settings now lock the same canonical configuration file before reading and saving it. Concurrent commands that update different targets or model roles retain every successful change. The lock is stored in the private `.flowqa` directory beside the actual configuration file, including when a CLI workspace uses a symlink to that file. A terminated writer releases its SQLite lock automatically, so another command can retry. Each save still replaces the complete JSON file after it is written.
|
|
6
|
+
|
|
3
7
|
## 0.10.1 — Hyeonse Design System 0.5.0
|
|
4
8
|
|
|
5
9
|
The local UI packages the CSS, preference module, and MIT license from the public Hyeonse Design System 0.5.0 archive. The installed Flow QA package serves byte-identical copies of these files.
|
|
@@ -347,7 +351,7 @@ The npm trusted publisher is configured for GitHub repository `hyeonse-swing/flo
|
|
|
347
351
|
## 0.1.3
|
|
348
352
|
|
|
349
353
|
- `doctor` reports whether each configured planner or agent key environment variable is present, missing, or not configured. English and Korean diagnostics show no credential values and make no model requests. The command remains informational.
|
|
350
|
-
- CLI target and model configuration updates
|
|
354
|
+
- At this release, CLI target and model configuration updates wrote a private temporary file, synchronized it, and replaced the configuration only after the new JSON was complete. Existing initialization and exclusive case-file creation behavior were preserved. This protected against partially written configuration during process interruption. Concurrent CLI updates were not serialized at this release, and rename durability after power loss was not guaranteed.
|
|
351
355
|
- CI runs the existing test, browser, UI, and package-install checks on Ubuntu and macOS before publishing. Successful npm publication and its consumer smoke check now also create the corresponding GitHub release.
|
|
352
356
|
|
|
353
357
|
- Package: [`@ihyeon/flow-qa@0.1.3`](https://www.npmjs.com/package/@ihyeon/flow-qa/v/0.1.3)
|