@ihyeon/flow-qa 0.9.3 → 0.9.4

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.
@@ -2,7 +2,7 @@ import { randomUUID } from 'node:crypto';
2
2
  import { lstat, mkdir, readFile, realpath, rm, writeFile } from 'node:fs/promises';
3
3
  import path from 'node:path';
4
4
  import { z } from 'zod';
5
- import { selectCases } from "./case-selection.js";
5
+ import { isReportSelectionValid, selectCases } from "./case-selection.js";
6
6
  import { idSchema, suiteSchema, targetSchema } from "./schema.js";
7
7
  import { targetFingerprint } from "./targets.js";
8
8
  import { sha256 } from "./workspace.js";
@@ -226,9 +226,10 @@ export async function reviewAgentHandoff(directoryPath, resultPath) {
226
226
  handoffTarget(request.target.name, parsedTarget);
227
227
  if (request.suite.platform === 'mobile' || request.suite.cases.some((item) => item.steps.some((step) => ['launchApp', 'back', 'swipe'].includes(step.type))))
228
228
  throw new Error('Handoff contains unsupported mobile cases.');
229
- if (request.selection && (request.selection.caseIds.length !== request.suite.cases.length ||
230
- request.selection.caseIds.some((id, index) => id !== request.suite.cases[index]?.id)))
229
+ if (!isReportSelectionValid(request.suite.cases, request.selection) ||
230
+ request.selection?.caseIds.some((id, index) => id !== request.suite.cases[index]?.id)) {
231
231
  throw new Error('Handoff selection does not match its cases.');
232
+ }
232
233
  const result = agentResultSchema.parse(await readBoundedJSON(resultPath));
233
234
  if (result.requestSha256 !== sha256(requestContent))
234
235
  throw new Error('Agent result does not match this handoff request.');
@@ -250,6 +251,7 @@ export async function reviewAgentHandoff(directoryPath, resultPath) {
250
251
  const lines = ['# External agent QA observations', '',
251
252
  'These findings were supplied by an external agent. File references and structure were checked; execution and authenticity were not verified by Flow QA.', '',
252
253
  `Suite: ${safeLine(request.suite.id)} · target: ${safeLine(request.target.name)} · ${result.cases.length} selected case(s)`,
254
+ ...(request.selection ? [`Selected from original suite: ${result.cases.length} of ${request.selection.totalCases} cases. Cases outside this handoff (not evaluated here): ${request.selection.totalCases - result.cases.length}.`] : []),
253
255
  `Observed passed: ${counts['observed-passed']} · observed failed: ${counts['observed-failed']} · blocked: ${counts.blocked} · unverified: ${counts.unverified}`, '',
254
256
  ...result.cases.flatMap((item, index) => {
255
257
  const testCase = request.suite.cases[index];
@@ -53,6 +53,8 @@ The review requires the same request hash and case IDs in the same order. `obser
53
53
 
54
54
  The review summary shows each reported assertion's expected condition and locator from the reviewed case beside the agent's observed detail and evidence path. A failed case therefore identifies the first mismatched expectation without a manual lookup in `request.json`. The summary prints case content and observations, so inspect it before sharing.
55
55
 
56
+ For a handoff made with `--case`, the summary shows the selected count against the original suite count and says how many cases were outside this handoff. Those other cases were not evaluated by this result, even when every selected case is `observed-passed`.
57
+
56
58
  Only the registered target identity is exported. Model connections and their key environment variables are omitted. A target URL with credentials, a query, a fragment, or a token-like path is refused rather than silently redacted. Case content is not masked because that would change the reviewed suite: inspect the URL, case text, and evidence before sharing the folder. The handoff accepts at most 1 MB of case/request JSON, supports web targets only, and does not prepare logins, accounts, or test data.
57
59
 
58
60
  ## 한국어
@@ -73,3 +75,5 @@ flow-qa agent-review my-qa/.flowqa/handoffs/<폴더> my-qa/.flowqa/handoffs/<폴
73
75
  검토 명령은 요청 해시·케이스 범위·관찰 상태·증거 파일의 존재와 경로를 확인합니다. 에이전트가 실제로 페이지를 방문했는지, 증거가 진짜인지까지 증명하지 않습니다. 이 결과는 에이전트의 관찰 기록으로만 표시하며 기존 `qa-report.json` 실행 기록에 합치지 않습니다. 모델 설정과 키 환경 변수는 묶음에 넣지 않습니다. 쿼리·인증정보·토큰처럼 보이는 경로가 있는 대상 URL은 거부하고, 케이스 본문은 몰래 마스킹하지 않습니다. 외부 공유 전에 케이스·대상·증거의 민감한 내용을 직접 확인하세요.
74
76
 
75
77
  검토 요약은 각 assertion의 검토된 기대 조건·locator와 에이전트의 관찰 내용·증거 파일 경로를 함께 보여줍니다. 실패한 케이스는 첫 불일치 기대값을 `request.json`에서 따로 찾지 않아도 확인할 수 있습니다. 요약에도 케이스 본문과 관찰 내용이 들어가므로 공유 전에 내용을 확인하세요.
78
+
79
+ `--case`로 일부만 전달했다면 검토 요약에 원본 케이스 수 대비 선택한 수와 전달 범위 밖의 수가 표시됩니다. 선택된 케이스가 모두 `observed-passed`여도 범위 밖 케이스는 이 결과에서 평가되지 않았습니다.
package/docs/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases and verification
2
2
 
3
+ ## 0.9.4 — show partial external review scope
4
+
5
+ When a handoff selects a subset with `--case`, `agent-review` now prints the selected count against the original suite count and explicitly labels cases outside the handoff as unevaluated. A selected case's `observed-passed` result remains an observation about that case only. The reviewer also rejects inconsistent selection totals in a handoff request. Existing request and result JSON shapes are unchanged. A three-case local suite reproduced the previous ambiguous summary with one selected case before this fix. The same saved request and result now show the two unevaluated cases. Local Node.js 24.22.1 checks passed 125 tests, type checking, UI checks, the package audit, and a fresh installed-package smoke that covers both full and selected handoffs.
6
+
3
7
  ## 0.9.3 — show reviewed expectations in external observations
4
8
 
5
9
  The `agent-review` summary now pairs each reported assertion with the case's reviewed expectation and locator, the external agent's observed detail, and its evidence path. The case title appears above its observations. This makes a failed observation identifiable from the summary without finding the matching step in `request.json`. Untrusted text is rendered as Markdown code spans with enough backticks to preserve literal values, including pipes, angle brackets, and backticks; line breaks and control characters are displayed as escapes. The handoff and result JSON contracts and their validation rules are unchanged.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ihyeon/flow-qa",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "license": "MIT",
5
5
  "author": "Hyeonse Im",
6
6
  "repository": {
@@ -49,4 +49,6 @@ flow-qa agent-review <handoff-directory> <handoff-directory>/agent-result.json
49
49
 
50
50
  This review checks request binding, case scope and order, observation structure, and evidence file references. It does not verify visits or evidence authenticity and does not create an engine QA report. Handoff omits model connection settings but does not mask case content; check material before sharing. See `AGENT_PROMPT.md` and `agent-result.schema.json` inside each generated bundle for that bundle's exact contract.
51
51
 
52
+ When `--case` selects only part of a suite, the review summary displays the original case count and the number outside this handoff. An `observed-passed` result covers only the selected cases.
53
+
52
54
  For each observed assertion, the review summary pairs the reviewed expectation and locator with the agent's observation and evidence path. Inspect both sides of a mismatch before changing the application or its case.