gz-laya-pilot 0.1.1 → 0.1.2
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/NOTICE.md +14 -0
- package/README.md +25 -3
- package/dist/agent/bridge.js +1 -1
- package/dist/agent/bridge.js.map +1 -1
- package/dist/agent/report.d.ts +3 -0
- package/dist/agent/report.js +11 -2
- package/dist/agent/report.js.map +1 -1
- package/dist/agent/schema.d.ts +10 -0
- package/dist/agent/schema.js.map +1 -1
- package/package.json +1 -1
- package/src/agent/bridge.ts +1 -1
- package/src/agent/report.ts +15 -2
- package/src/agent/schema.ts +5 -0
- package/vendor/.gitattributes +1 -0
- package/vendor/UPSTREAM.json +94 -5
- package/vendor/laya-pilot/lib/browser-provider.mjs +18 -6
- package/vendor/laya-pilot/lib/discovery.mjs +182 -31
- package/vendor/laya-pilot/lib/dom.mjs +65 -2
- package/vendor/laya-pilot/lib/form.mjs +3 -3
- package/vendor/laya-pilot/lib/page-capabilities.mjs +356 -0
- package/vendor/laya-pilot/lib/page-exploration.mjs +372 -0
- package/vendor/laya-pilot/lib/page-session.mjs +69 -0
- package/vendor/laya-pilot/lib/related-records.mjs +328 -0
- package/vendor/laya-pilot/lib/run-state.mjs +15 -1
- package/vendor/laya-pilot/lib/test-data.mjs +15 -2
- package/vendor/laya-pilot/lib/workflow-policy.mjs +8 -1
- package/vendor/laya-pilot/lib/workflow.mjs +536 -121
- package/vendor/laya-pilot/lib/workflow_excel.py +33 -2
- package/vendor/laya-pilot/tests/retries.test.mjs +14 -1
- package/vendor/laya-pilot/tests/selected-pr1.test.mjs +21 -3
- package/vendor/patches/0001-native-field-recipes.patch +2966 -14
package/NOTICE.md
CHANGED
|
@@ -12,4 +12,18 @@ The new TypeScript functions add npm exports, a child-process boundary, UTF-8 Wi
|
|
|
12
12
|
|
|
13
13
|
The abandoned replacement planner and ExcelJS workbook grammar are not part of this package. Model weights and the Python environment are not distributed. The new APIs require 0.1.1 or later.
|
|
14
14
|
|
|
15
|
+
Version 0.1.2 extension (2026-10-07): the same cumulative patch now adds bounded semantic tree navigation, exact tree-record ownership, region-bound filters, standalone editor activation, Ant Design 6 selected-value observation, input replacement checks and additional trace-flush time. `lib/page-capabilities.mjs` contains functional helpers called by the existing workflow, not a separate planner. Two upstream test doubles are updated for the editor/record contract; their retry and write-safety assertions remain intact. `UPSTREAM.json` separately records original-file modifications and the added helper. Old upstream workbooks remain readable; workbooks containing the new `expand-tree` step require this extended engine.
|
|
16
|
+
|
|
15
17
|
Playwright and dom-accessibility-api retain their own licenses. Python libraries and Laya model weights retain their own licenses. This package is not an official npm release of upstream `laya-pilot`.
|
|
18
|
+
|
|
19
|
+
Version 0.1.2 also reuses upstream discovery for default read-only filter testing. Workflow and replay policy allow only validated filter recipes in that mode; form and CRUD restrictions remain. Startup phase messages are persisted to the existing checkpoint for UI polling. This is recorded in the same cumulative patch and modification hashes.
|
|
20
|
+
|
|
21
|
+
Visible-mode readiness is provided by the shared session helper after interactions and filter assertions, without slowing headless verification. Default generation combines required-field validation with creation in the same editor; explicit validation-only runs are retained. Unsupported interval checks do not reopen a known form.
|
|
22
|
+
|
|
23
|
+
The 0.1.2 cumulative patch also adds functional `page-exploration.mjs`: owned inline detail navigation, result-set query assertions, semantic tab/panel traversal, bounded disclosure checks, and observed coverage gaps. It reuses upstream `matchReplayTarget` for dynamic record labels and retains model confidence/refusal handling. `workflow_excel.py` preserves the new grammar and exports an additional coverage sheet; the main 17-column contract is unchanged. These are executor extensions, not capabilities claimed to be in the original upstream snapshot.
|
|
24
|
+
|
|
25
|
+
The 0.1.2 tree extension additionally persists semantic ownership for create actions, resolves nested hover triggers within the owning node, excludes global navigation trees, and rejects ambiguous collections, paths and regions. These are bounded structural capabilities, not application-name or route-based adapters. Reordered-tree replay and ambiguity regressions are retained with the package tests.
|
|
26
|
+
|
|
27
|
+
The same 0.1.2 patch replaces generated document reloads with immediate visible-page assertions and separate headless persistence checks. `page-session.mjs` adds functional session/identity helpers; the browser provider accepts an in-memory pre-write authentication snapshot. Discovery restores only observed form/filter controls and stops on uncertain restoration. New persistence assertions are preserved in Excel. Microfrontend hosts can expose active app/instance markers; legacy Excel reloads are rejected there before executing cases. This continuity guard is not complete application/frame/portal isolation.
|
|
28
|
+
|
|
29
|
+
`related-records.mjs` extends the existing workflow with bounded relation-picker transactions on run-owned parents, using observed semantic controls and the upstream model matcher. It independently verifies addition and removal, preserves data identity through Excel and refuses to retry a failed compound transaction. A shared headless browser creates fresh verification contexts; it is started before the visible window to avoid repeated Chrome process activation during the run. These 0.1.2 extensions contain no securities-specific labels or endpoints.
|
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Node 22+ package based on LayaPilot. Functional TypeScript host API, ESM and declarations; Playwright execution stays in Node.
|
|
4
4
|
|
|
5
|
-
## Autonomous exploration (0.1.
|
|
5
|
+
## Autonomous exploration (0.1.2)
|
|
6
6
|
|
|
7
|
-
Version 0.1.1
|
|
7
|
+
Version 0.1.1 introduced the full upstream generation and replay workflow, pinned at `9f1bb801e0ca5eb4ded82413ab112ab0da0716d8`. Version 0.1.2 extends that workflow with semantic record trees, continuous microfrontend execution, query/detail assertions and related-record transactions. Version 0.1.0 only contains the recorded JSON adapter. Original and modified source hashes are in `vendor/UPSTREAM.json`; the complete diff is under `vendor/patches/`.
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
10
|
import { runAgent } from 'gz-laya-pilot';
|
|
@@ -28,7 +28,11 @@ Install Python dependencies from the vendored `requirements-local.txt` (or the r
|
|
|
28
28
|
|
|
29
29
|
See the [integration and acceptance guide](https://github.com/chenhui996/gz-zd-web/blob/codex/research-assistant/docs/研发小蜜自主探索.md) for pinned setup, support boundaries and real-model verification. Browser consumers use `gz-laya-pilot/agent-schema` without importing Node/Excel/Playwright.
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Version 0.1.2 describes observed numeric input constraints in the model's candidates, resolving the `Credit limit` refusal seen in the independent English fixture with 0.1.1. Model refusal and confidence thresholds remain enforced; these results do not guarantee support for arbitrary backends.
|
|
32
|
+
|
|
33
|
+
Real-model acceptance on 2026-10-07 generated and replayed 12 cases on the securities fixture and 11 on an independent English tree/relationship fixture in fresh sessions. These cover supported CRUD, search, detail and related-record flows, not every feature on either page. A backend that ignores edits fails persistence verification and blocks later deletion. Windows checkpoint replacement retries transient locks; replaced inputs/actions are re-observed; Ant Design 6 selected values are retained. Test data and these acceptance reports are not bundled in the npm package.
|
|
34
|
+
|
|
35
|
+
Tree support requires unambiguous named ARIA trees/items and expansion state (maximum 24 expansions, path depth 8); it is not a whole-site crawler or a business-rule planner. New `expand-tree` steps extend the existing workbook contract: old upstream workbooks still load, but the unmodified upstream engine cannot replay the new step. React and SDK both use this same Node engine.
|
|
32
36
|
|
|
33
37
|
## Recorded JSON replay
|
|
34
38
|
|
|
@@ -74,3 +78,21 @@ Browser consumers import `gz-laya-pilot/schema` or `gz-laya-pilot/browser`; neit
|
|
|
74
78
|
`createApiDecision({base, model, key})` returns a Laya-protocol decision function. `chooseStep(instruction, observedCandidates, decide)` selects a structured step or returns null for uncertainty. It does not execute the candidate or invent locators. The host must observe candidates and review the draft; `runCase` evaluates assertions against real DOM, not model opinions. Recorded JSON replay does not require Python; autonomous Excel generation/replay uses the vendored upstream engine described above. The older `tools/laya-pilot` snapshot is retained for compatibility, not used as the new agent engine.
|
|
75
79
|
|
|
76
80
|
See NOTICE.md and LICENSE for upstream provenance and the scope of the port.
|
|
81
|
+
|
|
82
|
+
## 0.1.2: continuous microfrontend exploration
|
|
83
|
+
|
|
84
|
+
Relation pickers support a `related-records` transaction: an empty collection on a newly created parent, an add/remove pair, and a dialog with selectable existing records and disabled confirmation until selection. The executor adds one uniquely identified sample, verifies the visible collection and fresh-session persistence, removes only that relation and independently verifies the empty collection again. HTML tables and ARIA grids (including split pinned rows) use the same observer; names and codes come from the page. Failed writes or persistence checks retain the test parent and stop later writes. This does not infer arbitrary nested business rules or grant access to existing parents.
|
|
85
|
+
|
|
86
|
+
Persistence checks reuse one headless Chrome process prepared before the visible test window. Each read still creates a new browser context using pre-write authentication only. This removes repeated background Chrome startup/shutdown during a visible run without weakening session isolation.
|
|
87
|
+
|
|
88
|
+
Visible execution waits for a non-loading, stable control layout for at least 650ms after key interactions. A fixed sleep alone did not prevent advancing during asynchronous panel replacement. Headless verification retains its normal speed. Default CRUD generation validates the empty form and creates the record in one editor visit; explicit validation-only runs still have their own case. Existing visible-page and persistence assertions remain required.
|
|
89
|
+
|
|
90
|
+
The same workflow now opens an owned tree record's inline detail, verifies identity outside the list, then explores its semantic tab group and re-observes after each transition. `aria-controls` must identify a visible panel; a selected tab label alone cannot pass. Bounded disclosure checks can inspect newly revealed controls and restore their state. Model refusals remain coverage gaps. Replay grounds dynamic record labels through the upstream `matchReplayTarget` helper without reducing confidence thresholds. Positive search must reduce the visible collection to the uniquely named test record; edit/delete do not redundantly re-filter it. The functional extension lives in `lib/page-exploration.mjs`, with no application routes or business labels.
|
|
91
|
+
|
|
92
|
+
The workbook's “探索范围” sheet and run-result metadata list observed but unverified entry states. Passing cases are not a whole-page coverage guarantee: file import/export, nested business transactions, permission scenarios and business-specific oracles still require supported recipes and test data. New detail/disclosure/query assertion steps require version 0.1.2 or later; earlier engines cannot replay these new workbooks.
|
|
93
|
+
|
|
94
|
+
The default `allowWrite: false` mode now also runs the existing model-selected filter discovery on semantic tables and record trees. It expands bounded tree paths, verifies an unmatched query and restores the list without refreshing. These recipes are saved under the existing `filters` operation; read-only validation permits only `filter-empty` / `filter-reset`, never form or CRUD actions. Startup checkpoints distinguish opening/authenticating the page from waiting for local model warmup. Run `npm test -w gz-laya-pilot` from the repository root for package and vendored-engine regression tests; real-model acceptance additionally requires the Python/model setup and a supported test target.
|
|
95
|
+
|
|
96
|
+
Generated workflows check the visible page after each CRUD write, then query the same module in a separate headless browser/context for persistence. They no longer reload the visible host to reset a child app. Discovery clears only its observed business filter and cancels its observed editor; failed restoration stops the workflow. Background checks use a pre-write authentication snapshot and produce their own screenshot/trace. New `assert-persisted-row` and `assert-persisted-absent` Excel steps require version 0.1.2 or later.
|
|
97
|
+
|
|
98
|
+
Hosts may expose `data-laya-host` on the viewport, and `data-laya-app`, `data-laya-instance`, and `data-laya-active="true"` on their application containers. Continuity checks bind the current app/instance and exact URL; fresh verification sessions bind the logical app and URL. An inactive child cache does not prevent testing the host view. Old workbooks containing `reload` must be regenerated for such hosts; they are rejected before any case runs. This is not yet a complete DOM/frame/portal access boundary. Persistence assertions retain their observed semantic query steps for replay. React and SDK bridges use the same workflow.
|
package/dist/agent/bridge.js
CHANGED
|
@@ -49,7 +49,7 @@ export function createAgentBridge(options) {
|
|
|
49
49
|
if (req.method === 'GET' && url.pathname === '/artifact') {
|
|
50
50
|
const id = url.searchParams.get('id') ?? '', file = url.searchParams.get('file') ?? '';
|
|
51
51
|
if (!/^[\da-f-]{36}$/.test(id) ||
|
|
52
|
-
!/^(cases\.xlsx|results\.xlsx|results\.json|decisions\.ndjson|checkpoint\.json|trace\.zip|evidence\/[a-zA-Z0-9_-]{1,150}\.png)$/.test(file))
|
|
52
|
+
!/^(cases\.xlsx|results\.xlsx|results\.json|decisions\.ndjson|checkpoint\.json|trace\.zip|persistence-[a-zA-Z0-9_-]{1,85}\.zip|evidence\/[a-zA-Z0-9_-]{1,150}\.png)$/.test(file))
|
|
53
53
|
return send(400, { message: '无效的报告文件' });
|
|
54
54
|
const filename = path.join(root, id, file === 'results.xlsx' ? '执行结果.xlsx' : file);
|
|
55
55
|
if (!existsSync(filename))
|
package/dist/agent/bridge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../src/agent/bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,E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,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;AAChE,CAAC"}
|
package/dist/agent/report.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface UpstreamStep {
|
|
|
13
13
|
export interface UpstreamCase {
|
|
14
14
|
id: string;
|
|
15
15
|
title: string;
|
|
16
|
+
operation?: string;
|
|
16
17
|
status: string;
|
|
17
18
|
reason: string;
|
|
18
19
|
steps: UpstreamStep[];
|
|
@@ -37,6 +38,7 @@ export interface UpstreamReport {
|
|
|
37
38
|
activeCase?: {
|
|
38
39
|
title?: string;
|
|
39
40
|
};
|
|
41
|
+
activity?: string;
|
|
40
42
|
caseFile?: string;
|
|
41
43
|
retainedRecord?: string;
|
|
42
44
|
pendingWrite?: unknown;
|
|
@@ -46,6 +48,7 @@ export interface UpstreamReport {
|
|
|
46
48
|
runtime?: {
|
|
47
49
|
currentName?: string;
|
|
48
50
|
};
|
|
51
|
+
coverage?: AgentStatus['coverage'];
|
|
49
52
|
}
|
|
50
53
|
/** Preserve upstream truth: recorded assertion steps are appended after successful execution. */
|
|
51
54
|
export declare function projectReport(report: UpstreamReport, mode: AgentStatus['mode'], final: boolean): AgentStatus;
|
package/dist/agent/report.js
CHANGED
|
@@ -18,7 +18,14 @@ function assertionTitle(step) {
|
|
|
18
18
|
'assert-input-invalid': `输入校验阻止无效数据:${target}`,
|
|
19
19
|
'assert-row': `列表存在唯一记录:${value}`,
|
|
20
20
|
'assert-absent': `列表中记录已消失:${value}`,
|
|
21
|
+
'assert-persisted-row': `独立会话重新打开后存在唯一记录:${value}`,
|
|
22
|
+
'assert-persisted-absent': `独立会话重新打开后记录不存在:${value}`,
|
|
21
23
|
'assert-text': `页面显示文本:${value}`,
|
|
24
|
+
'assert-record-detail': `列表之外的详情显示本轮记录:${value}`,
|
|
25
|
+
'assert-tab-panel': `页签已选中且关联内容面板可见:${target}`,
|
|
26
|
+
'assert-query-result': `唯一关键词查询仅返回本轮记录:${value}`,
|
|
27
|
+
'assert-disclosure': `展开 ${target} 后出现新控件,并已恢复原状态`,
|
|
28
|
+
'assert-related-records': '关联添加后显示唯一记录,独立会话确认持久化;移除后列表恢复为空,并再次独立核对',
|
|
22
29
|
};
|
|
23
30
|
return titles[step.kind] ?? `${step.kind} ${target}`;
|
|
24
31
|
}
|
|
@@ -27,6 +34,7 @@ export function projectReport(report, mode, final) {
|
|
|
27
34
|
const cases = (report.results ?? []).map((c) => ({
|
|
28
35
|
id: c.id,
|
|
29
36
|
title: c.title,
|
|
37
|
+
...(c.operation ? { operation: c.operation } : {}),
|
|
30
38
|
state: ['通过', '已验证'].includes(c.status)
|
|
31
39
|
? 'passed'
|
|
32
40
|
: ['不适用', '未选择'].includes(c.status)
|
|
@@ -81,10 +89,11 @@ export function projectReport(report, mode, final) {
|
|
|
81
89
|
state,
|
|
82
90
|
cases,
|
|
83
91
|
decisions: report.metrics?.modelCalls ?? 0,
|
|
92
|
+
...(report.coverage ? { coverage: report.coverage } : {}),
|
|
84
93
|
message: !final
|
|
85
|
-
?
|
|
94
|
+
? report.activity || report.activeCase?.title || '正在识别页面控件并生成可验证用例'
|
|
86
95
|
: (report.error ??
|
|
87
|
-
`${mode === 'explore' ? '探索' : '回放'}结束:${passed} 条通过,${cases.filter((c) => c.state === 'failed').length} 条失败,${cases.filter((c) => c.state === 'skipped').length}
|
|
96
|
+
`${mode === 'explore' ? '探索' : '回放'}结束:${passed} 条通过,${cases.filter((c) => c.state === 'failed').length} 条失败,${cases.filter((c) => c.state === 'skipped').length} 条不适用/未选择${report.coverage?.gaps.length ? `;另有 ${report.coverage.gaps.length} 项入口尚未验证` : ''}`),
|
|
88
97
|
...(final && mode === 'explore' && report.caseFile ? { workbook: 'cases.xlsx' } : {}),
|
|
89
98
|
};
|
|
90
99
|
}
|
package/dist/agent/report.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/agent/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+2,7 @@
|
|
|
2
2
|
export interface CaseEvidence {
|
|
3
3
|
id: string;
|
|
4
4
|
title: string;
|
|
5
|
+
operation?: string;
|
|
5
6
|
state: 'passed' | 'failed' | 'skipped';
|
|
6
7
|
reason: string;
|
|
7
8
|
assertions: {
|
|
@@ -23,6 +24,15 @@ export interface AgentStatus {
|
|
|
23
24
|
decisions: number;
|
|
24
25
|
workbook?: string;
|
|
25
26
|
trace?: string;
|
|
27
|
+
coverage?: {
|
|
28
|
+
states: string[];
|
|
29
|
+
gaps: {
|
|
30
|
+
state: string;
|
|
31
|
+
role: string;
|
|
32
|
+
name: string;
|
|
33
|
+
reason: string;
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
26
36
|
}
|
|
27
37
|
export interface AgentCapabilities {
|
|
28
38
|
configured: boolean;
|
package/dist/agent/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/agent/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/agent/schema.ts"],"names":[],"mappings":"AA+BA,MAAM,UAAU,OAAO,CAAC,KAAc;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,IAAI;QAAE,MAAM,KAAK,CAAC,UAAU,CAAC,CAAC;IAC9E,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3B,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ;QAC7E,MAAM,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACzC,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
package/src/agent/bridge.ts
CHANGED
|
@@ -70,7 +70,7 @@ export function createAgentBridge(options: AgentBridgeOptions) {
|
|
|
70
70
|
file = url.searchParams.get('file') ?? '';
|
|
71
71
|
if (
|
|
72
72
|
!/^[\da-f-]{36}$/.test(id) ||
|
|
73
|
-
!/^(cases\.xlsx|results\.xlsx|results\.json|decisions\.ndjson|checkpoint\.json|trace\.zip|evidence\/[a-zA-Z0-9_-]{1,150}\.png)$/.test(
|
|
73
|
+
!/^(cases\.xlsx|results\.xlsx|results\.json|decisions\.ndjson|checkpoint\.json|trace\.zip|persistence-[a-zA-Z0-9_-]{1,85}\.zip|evidence\/[a-zA-Z0-9_-]{1,150}\.png)$/.test(
|
|
74
74
|
file,
|
|
75
75
|
)
|
|
76
76
|
)
|
package/src/agent/report.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface UpstreamStep {
|
|
|
9
9
|
export interface UpstreamCase {
|
|
10
10
|
id: string;
|
|
11
11
|
title: string;
|
|
12
|
+
operation?: string;
|
|
12
13
|
status: string;
|
|
13
14
|
reason: string;
|
|
14
15
|
steps: UpstreamStep[];
|
|
@@ -23,11 +24,13 @@ export interface UpstreamReport {
|
|
|
23
24
|
exitCode?: number;
|
|
24
25
|
results: UpstreamCase[];
|
|
25
26
|
activeCase?: { title?: string };
|
|
27
|
+
activity?: string;
|
|
26
28
|
caseFile?: string;
|
|
27
29
|
retainedRecord?: string;
|
|
28
30
|
pendingWrite?: unknown;
|
|
29
31
|
metrics?: { modelCalls?: number };
|
|
30
32
|
runtime?: { currentName?: string };
|
|
33
|
+
coverage?: AgentStatus['coverage'];
|
|
31
34
|
}
|
|
32
35
|
function assertionTitle(step: UpstreamStep): string {
|
|
33
36
|
if (step.spec?.title) return step.spec.title;
|
|
@@ -48,7 +51,15 @@ function assertionTitle(step: UpstreamStep): string {
|
|
|
48
51
|
'assert-input-invalid': `输入校验阻止无效数据:${target}`,
|
|
49
52
|
'assert-row': `列表存在唯一记录:${value}`,
|
|
50
53
|
'assert-absent': `列表中记录已消失:${value}`,
|
|
54
|
+
'assert-persisted-row': `独立会话重新打开后存在唯一记录:${value}`,
|
|
55
|
+
'assert-persisted-absent': `独立会话重新打开后记录不存在:${value}`,
|
|
51
56
|
'assert-text': `页面显示文本:${value}`,
|
|
57
|
+
'assert-record-detail': `列表之外的详情显示本轮记录:${value}`,
|
|
58
|
+
'assert-tab-panel': `页签已选中且关联内容面板可见:${target}`,
|
|
59
|
+
'assert-query-result': `唯一关键词查询仅返回本轮记录:${value}`,
|
|
60
|
+
'assert-disclosure': `展开 ${target} 后出现新控件,并已恢复原状态`,
|
|
61
|
+
'assert-related-records':
|
|
62
|
+
'关联添加后显示唯一记录,独立会话确认持久化;移除后列表恢复为空,并再次独立核对',
|
|
52
63
|
};
|
|
53
64
|
return titles[step.kind] ?? `${step.kind} ${target}`;
|
|
54
65
|
}
|
|
@@ -61,6 +72,7 @@ export function projectReport(
|
|
|
61
72
|
const cases: CaseEvidence[] = (report.results ?? []).map((c) => ({
|
|
62
73
|
id: c.id,
|
|
63
74
|
title: c.title,
|
|
75
|
+
...(c.operation ? { operation: c.operation } : {}),
|
|
64
76
|
state: ['通过', '已验证'].includes(c.status)
|
|
65
77
|
? 'passed'
|
|
66
78
|
: ['不适用', '未选择'].includes(c.status)
|
|
@@ -117,10 +129,11 @@ export function projectReport(
|
|
|
117
129
|
state,
|
|
118
130
|
cases,
|
|
119
131
|
decisions: report.metrics?.modelCalls ?? 0,
|
|
132
|
+
...(report.coverage ? { coverage: report.coverage } : {}),
|
|
120
133
|
message: !final
|
|
121
|
-
?
|
|
134
|
+
? report.activity || report.activeCase?.title || '正在识别页面控件并生成可验证用例'
|
|
122
135
|
: (report.error ??
|
|
123
|
-
`${mode === 'explore' ? '探索' : '回放'}结束:${passed} 条通过,${cases.filter((c) => c.state === 'failed').length} 条失败,${cases.filter((c) => c.state === 'skipped').length}
|
|
136
|
+
`${mode === 'explore' ? '探索' : '回放'}结束:${passed} 条通过,${cases.filter((c) => c.state === 'failed').length} 条失败,${cases.filter((c) => c.state === 'skipped').length} 条不适用/未选择${report.coverage?.gaps.length ? `;另有 ${report.coverage.gaps.length} 项入口尚未验证` : ''}`),
|
|
124
137
|
...(final && mode === 'explore' && report.caseFile ? { workbook: 'cases.xlsx' } : {}),
|
|
125
138
|
};
|
|
126
139
|
}
|
package/src/agent/schema.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export interface CaseEvidence {
|
|
3
3
|
id: string;
|
|
4
4
|
title: string;
|
|
5
|
+
operation?: string;
|
|
5
6
|
state: 'passed' | 'failed' | 'skipped';
|
|
6
7
|
reason: string;
|
|
7
8
|
assertions: { step: number; expected: string; actual: string; passed: boolean }[];
|
|
@@ -18,6 +19,10 @@ export interface AgentStatus {
|
|
|
18
19
|
decisions: number;
|
|
19
20
|
workbook?: string;
|
|
20
21
|
trace?: string;
|
|
22
|
+
coverage?: {
|
|
23
|
+
states: string[];
|
|
24
|
+
gaps: { state: string; role: string; name: string; reason: string }[];
|
|
25
|
+
};
|
|
21
26
|
}
|
|
22
27
|
export interface AgentCapabilities {
|
|
23
28
|
configured: boolean;
|
package/vendor/.gitattributes
CHANGED
package/vendor/UPSTREAM.json
CHANGED
|
@@ -2,18 +2,81 @@
|
|
|
2
2
|
"repository": "https://github.com/anthonyli/laya-pilot",
|
|
3
3
|
"commit": "9f1bb801e0ca5eb4ded82413ab112ab0da0716d8",
|
|
4
4
|
"modifications": [
|
|
5
|
+
{
|
|
6
|
+
"path": "lib/workflow-policy.mjs",
|
|
7
|
+
"originalSha256": "65053ef4ef9a5dd94000f8386a0fd6ae6015b59a4f4e4858a8447a42087f8dc0",
|
|
8
|
+
"sha256": "08617071f8e033b170b9417d669f30a54604bacb78607b3b65145ee64b2a2cc1",
|
|
9
|
+
"reason": "Allow only validated filter discovery recipes in read-only replay; retain all form and write restrictions.",
|
|
10
|
+
"patch": "patches/0001-native-field-recipes.patch"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"path": "lib/browser-provider.mjs",
|
|
14
|
+
"originalSha256": "2f0e9945d094330ef17d64bc6f1210ce432d3324fad3192fee9d2de54cf5f246",
|
|
15
|
+
"sha256": "db92685794ffe621215b6acddbe408cb2e2e533003f81ad8ddd776764f9ce2da",
|
|
16
|
+
"reason": "Reuse one headless verification browser started before the visible browser, creating and closing a fresh context for every persistence read; keep pre-write authentication isolated and avoid repeated Chrome process activation on Windows.",
|
|
17
|
+
"patch": "patches/0001-native-field-recipes.patch"
|
|
18
|
+
},
|
|
5
19
|
{
|
|
6
20
|
"path": "lib/test-data.mjs",
|
|
7
21
|
"originalSha256": "095844509822929af0ce08145bdbf4adc1d8c5931bda8339d5ad67713c63a792",
|
|
8
|
-
"sha256": "
|
|
9
|
-
"reason": "
|
|
22
|
+
"sha256": "d3b911057dd78ae0cb6d712e6a315f0ebf8d3c1ecd32dc442dc371722fa5ce35",
|
|
23
|
+
"reason": "Use observed native constraints for numeric/email recipes; classify record identity by its label while retaining length hints as evidence. Preserve all model refusals and confidence thresholds.",
|
|
10
24
|
"patch": "patches/0001-native-field-recipes.patch"
|
|
11
25
|
},
|
|
12
26
|
{
|
|
13
27
|
"path": "lib/workflow.mjs",
|
|
14
28
|
"originalSha256": "f217c11514ae4e6b32fa326c5fb1fbfc7c03a6322997e84f710c76d17ec7a4c2",
|
|
15
|
-
"sha256": "
|
|
16
|
-
"reason": "
|
|
29
|
+
"sha256": "8136dc3ff138816c9ea32ecae02f8866de51d27d26d354272638cd1c8697dc10",
|
|
30
|
+
"reason": "Extend the existing workflow with bounded semantic tree expansion, standalone editors, continuous CRUD and inline detail exploration. Reuse required validation within creation, verify filtered results, traverse linked detail tabs, retain isolated persistence reads and reject legacy host reloads. Replay the same bounded steps with original write guards and confidence thresholds.",
|
|
31
|
+
"patch": "patches/0001-native-field-recipes.patch"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"path": "lib/run-state.mjs",
|
|
35
|
+
"originalSha256": "797e66729f58cda47c7f5465d391df68878716a8e7c695bd8077aa346d83beb5",
|
|
36
|
+
"sha256": "356622fc6e099087df9da3047755adb7fddf51512ef762a989f767bf51c37dc1",
|
|
37
|
+
"reason": "Bounded retry for transient Windows atomic-rename locks; retain the last complete checkpoint and surface persistent or unrelated storage errors.",
|
|
38
|
+
"patch": "patches/0001-native-field-recipes.patch"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"path": "lib/dom.mjs",
|
|
42
|
+
"originalSha256": "3a167f1b4aec92e511f4b56e16e76dac98279b498e86f735192ace61ba5a46f7",
|
|
43
|
+
"sha256": "ddecd75e9c9f0a82509f651750f3c30fa70d075abc819f289836ad900a992f96",
|
|
44
|
+
"reason": "Observe semantic regions, expansion state and tree record context; scope activated standalone editors and exclude controls fully clipped by overflow-hidden ancestors while retaining scrollable content.",
|
|
45
|
+
"patch": "patches/0001-native-field-recipes.patch"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"path": "lib/form.mjs",
|
|
49
|
+
"originalSha256": "a7185ef21214555fba22eb481301924eeae3a4aad371b60f5793adf777543a27",
|
|
50
|
+
"sha256": "e96d11de7dc723bafbbc0480b06d81f28c5c0029361ac0e2097cd101bcc03fe7",
|
|
51
|
+
"reason": "Reuse form inspection for an explicitly activated standalone editor and recognize Ant Design 6 selected values without treating search text as selection.",
|
|
52
|
+
"patch": "patches/0001-native-field-recipes.patch"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"path": "lib/discovery.mjs",
|
|
56
|
+
"originalSha256": "3706e326918286b73de9ea56c6cc23e7c6a1df788977207a39ea111e8a438a30",
|
|
57
|
+
"sha256": "4a20962504b93a63fa50b112af261cbfced3b05ef5d301ad09fb1f68bac83adf",
|
|
58
|
+
"reason": "Bind filters to the same business region, support semantic record trees and standalone editors; normalize and restore observed form/filter state in place in both generation and replay, stopping on uncertain restoration instead of reloading the host.",
|
|
59
|
+
"patch": "patches/0001-native-field-recipes.patch"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"path": "lib/workflow_excel.py",
|
|
63
|
+
"originalSha256": "118ce4c93689d677febbbfafafc3a587e6de40702c1b2b7d4fa4351ead9c3988",
|
|
64
|
+
"sha256": "39ce16199c3309262fadb70e520166f504821e7a5e89812d244d307e6d1c5b29",
|
|
65
|
+
"reason": "Keep the existing 17-column case workbook, describe query/detail/tab/disclosure and persistence assertions, and round-trip exploration states and unverified entries through an additional coverage sheet and metadata.",
|
|
66
|
+
"patch": "patches/0001-native-field-recipes.patch"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"path": "tests/retries.test.mjs",
|
|
70
|
+
"originalSha256": "93d27d572c2376bf7e6d6b43a61f4835b5ab1a4f7d408836b91025e7014732f2",
|
|
71
|
+
"sha256": "a1206233356a22360b07954cf047f045ec818a6033e3f6e3f1c290a0069c727f",
|
|
72
|
+
"reason": "Adapt page/model doubles to the extended editor and record lookup contract; retain write verification and bounded retry assertions.",
|
|
73
|
+
"patch": "patches/0001-native-field-recipes.patch"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"path": "tests/selected-pr1.test.mjs",
|
|
77
|
+
"originalSha256": "78c7c180e59f284bbcffcb737ef100b4a028c83a36a0b0f1c7b97fe51c5564de",
|
|
78
|
+
"sha256": "923ed120cf86dbe70f68f4f45ba1196728312b4b05a75afdb531564825956fe6",
|
|
79
|
+
"reason": "Adapt the creation test double to the editor contract and model selector; continue asserting fresh references and second-entry recovery.",
|
|
17
80
|
"patch": "patches/0001-native-field-recipes.patch"
|
|
18
81
|
}
|
|
19
82
|
],
|
|
@@ -75,5 +138,31 @@
|
|
|
75
138
|
"docs/local-runtime.md": "b73412bd35521992299424c3f838afb9bf4b7a4b8543dc669faaf9b2e063728c",
|
|
76
139
|
"docs/pr1-selection.md": "6dcd5a38c723baea3436055fe2aaae0e597215d3ab1dabf8e46eae4016e883b1",
|
|
77
140
|
"docs/retry-policy.md": "0361bc960a585dd14dac2a0902f90195e9724bae8ff0a7f6bb0635025bab7c5d"
|
|
78
|
-
}
|
|
141
|
+
},
|
|
142
|
+
"additions": [
|
|
143
|
+
{
|
|
144
|
+
"path": "lib/page-capabilities.mjs",
|
|
145
|
+
"sha256": "661f5da6956bd2dc42c5ea76940d660092007e3a7ddf7d46e82364ec2562c227",
|
|
146
|
+
"reason": "Functional, bounded standard-semantic page helpers called only by the upstream workflow; no business selectors or second planner.",
|
|
147
|
+
"patch": "patches/0001-native-field-recipes.patch"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"path": "lib/page-session.mjs",
|
|
151
|
+
"sha256": "2a283084cded55e3e1ebe7b0ce92c9f30b43fe37fb595a50c7d28351505f8cee",
|
|
152
|
+
"reason": "Functional, bounded standard-semantic page helpers called only by the upstream workflow; no business selectors or second planner.",
|
|
153
|
+
"patch": "patches/0001-native-field-recipes.patch"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"path": "lib/page-exploration.mjs",
|
|
157
|
+
"sha256": "382807d5007d8e1620f0153e18fcf8afad3d222642ecc1cf8f25bdef03e567ef",
|
|
158
|
+
"reason": "Functional, bounded standard-semantic page helpers called only by the upstream workflow; no business selectors or second planner.",
|
|
159
|
+
"patch": "patches/0001-native-field-recipes.patch"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"path": "lib/related-records.mjs",
|
|
163
|
+
"sha256": "19bde995ef68cad3d938a9bed7be57882e78bf4bc741c02120cf77821aa4a46e",
|
|
164
|
+
"reason": "Functional, bounded standard-semantic page helpers called only by the upstream workflow; no business selectors or second planner.",
|
|
165
|
+
"patch": "patches/0001-native-field-recipes.patch"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
79
168
|
}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { loadAuthState, restoreSessionStorage } from './auth-state.mjs';
|
|
2
2
|
// Keep the browser boundary in one place. A future driver must provide the
|
|
3
3
|
// page/context methods used by the engines before it can be selected here.
|
|
4
|
-
export async function
|
|
4
|
+
export async function launchBrowser(config) {
|
|
5
5
|
if (config.browserProvider !== 'playwright') {
|
|
6
6
|
throw new Error(
|
|
7
7
|
`Unsupported browser provider: ${config.browserProvider}. Currently supported: playwright`,
|
|
8
8
|
);
|
|
9
9
|
}
|
|
10
|
-
const auth = await loadAuthState(config);
|
|
11
10
|
const { chromium } = await import('playwright');
|
|
12
11
|
const options = { headless: config.headless };
|
|
13
12
|
if (config.browserChannel) options.channel = config.browserChannel;
|
|
14
|
-
|
|
13
|
+
return chromium.launch(options);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export async function openBrowser(config, { authState, browser: sharedBrowser } = {}) {
|
|
17
|
+
const auth = authState ?? (await loadAuthState(config));
|
|
18
|
+
const browser = sharedBrowser ?? (await launchBrowser(config));
|
|
19
|
+
let context;
|
|
15
20
|
try {
|
|
16
|
-
|
|
21
|
+
context = await browser.newContext({
|
|
17
22
|
...(auth ? { storageState: auth.storageState } : {}),
|
|
18
23
|
viewport: { width: 1500, height: 980 },
|
|
19
24
|
locale: 'zh-CN',
|
|
@@ -23,9 +28,16 @@ export async function openBrowser(config) {
|
|
|
23
28
|
const page = await context.newPage();
|
|
24
29
|
page.setDefaultTimeout(9000);
|
|
25
30
|
page.setDefaultNavigationTimeout(config.pageTimeout || 18000);
|
|
26
|
-
return {
|
|
31
|
+
return {
|
|
32
|
+
browser,
|
|
33
|
+
context,
|
|
34
|
+
page,
|
|
35
|
+
authRestored: !!auth,
|
|
36
|
+
close: () => (sharedBrowser ? context.close() : browser.close()),
|
|
37
|
+
};
|
|
27
38
|
} catch (error) {
|
|
28
|
-
await
|
|
39
|
+
if (sharedBrowser) await context?.close();
|
|
40
|
+
else await browser.close();
|
|
29
41
|
throw error;
|
|
30
42
|
}
|
|
31
43
|
}
|