@virtocommerce/test-automation-framework 0.1.0-alpha.1 → 0.2.0-alpha.20261127111327
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/.claude/agents/vc-qa-automation-expert.md +122 -0
- package/.claude/agents/{qa-coverage.md → vc-qa-coverage.md} +10 -7
- package/.claude/agents/{qa-explorer.md → vc-qa-explorer.md} +20 -15
- package/.claude/agents/{qa-healer.md → vc-qa-healer.md} +15 -13
- package/.claude/agents/{qa-judge.md → vc-qa-judge.md} +35 -35
- package/.claude/agents/{qa-planner.md → vc-qa-planner.md} +29 -16
- package/.claude/agents/{qa-reviewer.md → vc-qa-reviewer.md} +18 -11
- package/.claude/checks/browser-secrets.mts +45 -2
- package/.claude/checks/contract.mts +258 -33
- package/.claude/checks/facts-consistency.mts +335 -0
- package/.claude/checks/introspect.mts +157 -0
- package/.claude/checks/judge-verdict.mts +44 -3
- package/.claude/checks/probe.mts +91 -0
- package/.claude/checks/project-facts.mts +85 -6
- package/.claude/checks/prove-fails.mts +254 -59
- package/.claude/checks/prune.mts +584 -0
- package/.claude/checks/rank-gaps.mts +24 -5
- package/.claude/checks/readonly-shell.mts +137 -58
- package/.claude/checks/reconcile-run.mts +64 -7
- package/.claude/checks/run-record.mts +338 -0
- package/.claude/checks/stand-request.mts +76 -0
- package/.claude/checks/test-shape.mts +78 -14
- package/.claude/commands/vc-qa-coverage.md +20 -0
- package/.claude/commands/{qa-explore.md → vc-qa-explore.md} +4 -4
- package/.claude/commands/{qa-heal.md → vc-qa-heal.md} +6 -6
- package/.claude/commands/{qa-implement.md → vc-qa-implement.md} +7 -7
- package/.claude/commands/vc-qa-plan.md +64 -0
- package/.claude/commands/{qa-review.md → vc-qa-review.md} +12 -12
- package/.claude/commands/{qa.md → vc-qa.md} +31 -22
- package/.claude/hooks/readonly-shell.mts +1 -1
- package/.claude/skills/{coverage-analysis → vc-coverage-analysis}/SKILL.md +24 -15
- package/.claude/skills/{create-graphql-layer → vc-create-graphql-layer}/SKILL.md +5 -3
- package/.claude/skills/{create-ui-layer → vc-create-ui-layer}/SKILL.md +5 -3
- package/.claude/skills/vc-explore-api/SKILL.md +93 -0
- package/.claude/skills/{explore-frontend → vc-explore-frontend}/SKILL.md +15 -9
- package/.claude/skills/{framework-rules → vc-framework-rules}/SKILL.md +34 -11
- package/.claude/skills/{heal-tests → vc-heal-tests}/SKILL.md +21 -21
- package/.claude/skills/{heal-tests → vc-heal-tests}/guard-recipe.md +3 -3
- package/.claude/skills/{judge-criteria → vc-judge-criteria}/SKILL.md +5 -3
- package/.claude/skills/{judge-criteria → vc-judge-criteria}/expert.md +10 -5
- package/.claude/skills/{plan-implementation → vc-plan-implementation}/SKILL.md +23 -11
- package/.claude/skills/vc-plan-implementation/contract-template.md +86 -0
- package/.claude/skills/{plan-test-strategy → vc-plan-test-strategy}/SKILL.md +24 -14
- package/.claude/skills/{project-facts → vc-project-facts}/SKILL.md +58 -23
- package/.claude/skills/{read-change → vc-read-change}/SKILL.md +4 -4
- package/.claude/skills/{read-ticket → vc-read-ticket}/SKILL.md +3 -3
- package/.claude/skills/{review-pr → vc-review-pr}/SKILL.md +4 -4
- package/.claude/skills/{review-test-code → vc-review-test-code}/SKILL.md +29 -15
- package/.claude/skills/{write-e2e-test → vc-write-e2e-test}/SKILL.md +11 -7
- package/.claude/skills/{write-graphql-test → vc-write-graphql-test}/SKILL.md +11 -7
- package/.claude/skills/{write-rest-api-test → vc-write-rest-api-test}/SKILL.md +16 -11
- package/.claude/skills/{write-security-test → vc-write-security-test}/SKILL.md +15 -11
- package/CHANGELOG.md +121 -0
- package/README.md +17 -0
- package/bin/vc-qa-agents.mjs +595 -0
- package/dist/auth/browser-sessions.d.ts +88 -0
- package/dist/auth/browser-sessions.js +126 -0
- package/dist/auth/browser-sessions.js.map +1 -0
- package/dist/auth/index.d.ts +5 -5
- package/dist/auth/index.js +2 -2
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/sign-in-strategies.d.ts +67 -0
- package/dist/auth/sign-in-strategies.js +121 -0
- package/dist/auth/sign-in-strategies.js.map +1 -0
- package/dist/auth/token-client.d.ts +9 -1
- package/dist/auth/token-client.js +9 -4
- package/dist/auth/token-client.js.map +1 -1
- package/dist/core/default-reporters.d.ts +9 -6
- package/dist/core/default-reporters.js +16 -16
- package/dist/core/default-reporters.js.map +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/secret-masking-reporter.d.ts +48 -0
- package/dist/core/secret-masking-reporter.js +78 -0
- package/dist/core/secret-masking-reporter.js.map +1 -0
- package/dist/fixtures/default-fixtures.d.ts +12 -9
- package/dist/fixtures/default-fixtures.js +12 -8
- package/dist/fixtures/default-fixtures.js.map +1 -1
- package/docs/README.md +3 -3
- package/docs/concepts/auth.md +68 -16
- package/docs/concepts/config.md +14 -6
- package/docs/concepts/dataset.md +5 -4
- package/docs/concepts/environment.md +17 -12
- package/docs/concepts/fixtures.md +23 -16
- package/docs/concepts/modules.md +2 -1
- package/docs/contributing/architecture.md +22 -15
- package/docs/contributing/documentation.md +10 -21
- package/docs/contributing/releasing.md +35 -21
- package/docs/examples/sign-in-strategies.ts +22 -0
- package/docs/getting-started.md +62 -1
- package/docs/guides/generating-types.md +5 -4
- package/docs/guides/qa-agents.md +193 -35
- package/package.json +4 -4
- package/templates/suite/.mcp.json +16 -0
- package/templates/suite/.qa/project.json +70 -0
- package/templates/suite/CLAUDE.template.md +62 -0
- package/templates/suite/allurerc.mjs +13 -0
- package/templates/suite/arrange/context.ts +15 -0
- package/templates/suite/arrange/index.ts +69 -0
- package/templates/suite/arrange/security.ts +78 -0
- package/templates/suite/biome.template.json +12 -0
- package/templates/suite/builders/security.ts +46 -0
- package/templates/suite/codegen.ts +27 -0
- package/templates/suite/env.example +10 -0
- package/templates/suite/env.ts +25 -0
- package/templates/suite/fixtures/index.ts +96 -0
- package/templates/suite/gitignore +13 -0
- package/templates/suite/pages/README.md +10 -0
- package/templates/suite/playwright.config.ts +48 -0
- package/templates/suite/scripts/generate-rest-types.ts +16 -0
- package/templates/suite/support/require-fields.ts +53 -0
- package/templates/suite/support/shopper.ts +51 -0
- package/templates/suite/support/store.ts +33 -0
- package/templates/suite/support/unique-id.ts +11 -0
- package/templates/suite/support/users.ts +6 -0
- package/templates/suite/tests/restapi/security/sign-in.spec.ts +23 -0
- package/templates/suite/tsconfig.json +33 -0
- package/.claude/agents/qa-automation-expert.md +0 -119
- package/.claude/commands/qa-coverage.md +0 -13
- package/.claude/commands/qa-plan.md +0 -55
- package/.claude/skills/explore-api/SKILL.md +0 -74
- package/.claude/skills/plan-implementation/contract-template.md +0 -72
- package/bin/install-qa-agents.mjs +0 -94
- package/dist/auth/frontend-browser-sessions.d.ts +0 -71
- package/dist/auth/frontend-browser-sessions.js +0 -130
- package/dist/auth/frontend-browser-sessions.js.map +0 -1
- package/dist/auth/platform-browser-sessions.d.ts +0 -47
- package/dist/auth/platform-browser-sessions.js +0 -92
- package/dist/auth/platform-browser-sessions.js.map +0 -1
- /package/.claude/skills/{judge-criteria → vc-judge-criteria}/coverage.md +0 -0
- /package/.claude/skills/{judge-criteria → vc-judge-criteria}/explorer.md +0 -0
- /package/.claude/skills/{judge-criteria → vc-judge-criteria}/healer.md +0 -0
- /package/.claude/skills/{judge-criteria → vc-judge-criteria}/planner.md +0 -0
- /package/.claude/skills/{read-ticket → vc-read-ticket}/providers.md +0 -0
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
**Stage 2 of 3** in the QA workflow: Plan → Implement → Review
|
|
4
4
|
|
|
5
|
-
You are orchestrating the implementation stage. Spawn the `qa-automation-expert` agent to implement one approved
|
|
5
|
+
You are orchestrating the implementation stage. Spawn the `vc-qa-automation-expert` agent to implement one approved
|
|
6
6
|
contract. The agent receives the contract path and nothing else.
|
|
7
7
|
|
|
8
8
|
## Input
|
|
9
9
|
|
|
10
|
-
`$ARGUMENTS` is the path of a contract: `.qa/contracts/<ticket-key-or-slug>.md`, written by `/qa-plan`.
|
|
10
|
+
`$ARGUMENTS` is the path of a contract: `.qa/contracts/<ticket-key-or-slug>.md`, written by `/vc-qa-plan`.
|
|
11
11
|
|
|
12
|
-
- No path: ask the person for it, or tell them to run `/qa-plan` first. Do not look for a plan in the conversation
|
|
12
|
+
- No path: ask the person for it, or tell them to run `/vc-qa-plan` first. Do not look for a plan in the conversation
|
|
13
13
|
and do not take a task description in place of a contract.
|
|
14
14
|
- A path that is not a file: say so and stop.
|
|
15
15
|
|
|
@@ -29,10 +29,10 @@ Confirm with the person that this contract is the approved one. Never approve it
|
|
|
29
29
|
|
|
30
30
|
First move an earlier run's judge verdict out of the way, so it cannot steer this run:
|
|
31
31
|
`mv -f .qa/judge/<contract-name>/judge-expert.json .qa/judge/<contract-name>/judge-expert.previous.json` when the
|
|
32
|
-
first file exists (`<contract-name>` and the other hand-off paths: the skill `project-facts`, "Hand-off Paths").
|
|
32
|
+
first file exists (`<contract-name>` and the other hand-off paths: the skill `vc-project-facts`, "Hand-off Paths").
|
|
33
33
|
|
|
34
|
-
Spawn the `qa-automation-expert` agent with the contract path only: no plan, no summary of the conversation, no
|
|
35
|
-
extra instructions. It reads `framework-rules` and `project-facts`, implements the cases, runs the definition of done
|
|
34
|
+
Spawn the `vc-qa-automation-expert` agent with the contract path only: no plan, no summary of the conversation, no
|
|
35
|
+
extra instructions. It reads `vc-framework-rules` and `vc-project-facts`, implements the cases, runs the definition of done
|
|
36
36
|
and leaves its run record under `.qa/runs/<contract-name>/` (`report.<project>.json` and `list.<project>.json` for
|
|
37
37
|
each project).
|
|
38
38
|
|
|
@@ -56,5 +56,5 @@ When an amendment awaits approval, end by naming it and say that implementation
|
|
|
56
56
|
done, end by saying so. Only when nothing awaits approval and the run was done, end with the contract's own path in
|
|
57
57
|
place of `<contract path>`:
|
|
58
58
|
```
|
|
59
|
-
Implementation complete. Run /qa-review <contract path> to review the code.
|
|
59
|
+
Implementation complete. Run /vc-qa-review <contract path> to review the code.
|
|
60
60
|
```
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# QA Plan
|
|
2
|
+
|
|
3
|
+
**Stage 1 of 3** in the QA workflow: Plan → Implement → Review
|
|
4
|
+
|
|
5
|
+
You are orchestrating the planning stage. Spawn the `vc-qa-planner` agent to turn the request into a contract.
|
|
6
|
+
|
|
7
|
+
## Input
|
|
8
|
+
|
|
9
|
+
`$ARGUMENTS` is one of:
|
|
10
|
+
- a ticket key (checked against `tracker.keyPattern` in the project facts)
|
|
11
|
+
- a specification or documentation link
|
|
12
|
+
- an area of existing functionality ("cover the cart") or a gap id from the coverage report
|
|
13
|
+
- a plain-text requirement
|
|
14
|
+
|
|
15
|
+
An area needs the explorer's report first, and a gap needs the coverage report that holds it; when the one it needs
|
|
16
|
+
does not exist, say so and offer `/vc-qa-explore` or `/vc-qa-coverage` before planning. The other report is read when there
|
|
17
|
+
is one and does not block planning: without a coverage report the planner finds existing coverage in the specs.
|
|
18
|
+
|
|
19
|
+
## Steps
|
|
20
|
+
|
|
21
|
+
### 0. Clean Up
|
|
22
|
+
|
|
23
|
+
Run `node .claude/checks/prune.mts --fetch --yes`, which removes only finished work under `.qa/` (a contract whose
|
|
24
|
+
cases are all in test titles on the default branch, with its run record, verdict and observed report), and keep its
|
|
25
|
+
last line (`prune: …`) for the end. Show its `ask` lines to the person as one list; only on their yes run
|
|
26
|
+
`node .claude/checks/prune.mts --yes --include-stale`. Planning does not wait for that answer, and a `not reached` line
|
|
27
|
+
or a failed check never stops it.
|
|
28
|
+
|
|
29
|
+
### 1. Plan
|
|
30
|
+
|
|
31
|
+
Spawn the `vc-qa-planner` agent with the request. It reads `vc-framework-rules` and `vc-project-facts`, reads the source (a
|
|
32
|
+
ticket through `vc-read-ticket`), designs the case matrix with `/vc-plan-test-strategy`, asks the scope questions the
|
|
33
|
+
matrix leaves open, and writes `.qa/contracts/<ticket-key-or-slug>.md` with `/vc-plan-implementation`.
|
|
34
|
+
|
|
35
|
+
Relay its scope questions to the person and pass the answers back.
|
|
36
|
+
|
|
37
|
+
### 2. Check
|
|
38
|
+
|
|
39
|
+
First, when the planner replies `needs observation`, spawn `vc-qa-explorer` (read-only) with `observe <contract path>`,
|
|
40
|
+
then the planner with `observed <contract path> <report path>`. Cases the report lists as `not reached` (the
|
|
41
|
+
explorer observes as the session the browser holds, or anonymously through the probe for an API area with no page) go
|
|
42
|
+
to the person at once as a scope question: (a) observe at the expert's first run (it pins the value it sees and asks
|
|
43
|
+
for it in an amendment the person approves); (b) name another oracle source; (c) drop the case. Pass the answers to
|
|
44
|
+
the planner with `observed <contract path> <report path>`.
|
|
45
|
+
|
|
46
|
+
Otherwise run `node .claude/checks/contract.mts check .qa/contracts/<file>.md`. On a problem, send the line back to
|
|
47
|
+
the planner; do not edit the contract yourself. Lines `at first run awaits the person's approval` do not stop the
|
|
48
|
+
approval question; they clear once the approval line is written.
|
|
49
|
+
|
|
50
|
+
### 3. Approval
|
|
51
|
+
|
|
52
|
+
Show the contract's cases, each `observed:` oracle with its recorded value and report, its `## Observed only`
|
|
53
|
+
section, and every case or `observed:` part moved out as not reached, with the reason; ask one question: approve
|
|
54
|
+
this contract. A person's
|
|
55
|
+
approval is the only thing that lets `/vc-qa-implement` start; never approve for them. Record it: unless the person
|
|
56
|
+
wrote it, add `## Approval` with the one line `Approved: <who>, <date> (relayed: "<their reply, word for word>")`
|
|
57
|
+
(several lines joined with " / "), the only edit you make to the contract, then run the check again.
|
|
58
|
+
|
|
59
|
+
End with:
|
|
60
|
+
```
|
|
61
|
+
<the prune: line of step 0>
|
|
62
|
+
Contract: .qa/contracts/<file>.md
|
|
63
|
+
Approved? Run /vc-qa-implement .qa/contracts/<file>.md to build it.
|
|
64
|
+
```
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
**Stage 3 of 3** in the QA workflow: Plan → Implement → Review
|
|
4
4
|
|
|
5
|
-
You are orchestrating the review stage. Spawn the `qa-reviewer` agent to review the code produced in the previous
|
|
6
|
-
`/qa-implement` stage, or review any specified files or PR.
|
|
5
|
+
You are orchestrating the review stage. Spawn the `vc-qa-reviewer` agent to review the code produced in the previous
|
|
6
|
+
`/vc-qa-implement` stage, or review any specified files or PR.
|
|
7
7
|
|
|
8
8
|
Dispatch the reviewer fresh with the diff (or the git range) and the contract path when there is one, never the
|
|
9
9
|
author's summary. When there is none, say "no contract" in the dispatch: the reviewer then reviews against the
|
|
@@ -14,20 +14,20 @@ characters); otherwise stop and say so.
|
|
|
14
14
|
The reviewer spares only the hunks of `git diff <baseline tree id> <new tree id>` under the healer paths from its
|
|
15
15
|
scope rule.
|
|
16
16
|
The reviewer's shell is read-only (a hook enforces it): it cannot run typecheck, lint or `gh`. Run
|
|
17
|
-
`commands.typecheck` and `commands.lint` from `node .claude/checks/project-facts.mts` yourself and report the result
|
|
17
|
+
`commands.typecheck` and `commands.lint` (when the facts have one) from `node .claude/checks/project-facts.mts` yourself and report the result
|
|
18
18
|
with the review; for a PR, fetch the diff and metadata with `gh` and pass them in. A failing typecheck or lint means
|
|
19
19
|
the work is not done, whatever the reviewer's verdict: do not end with "ready to commit" until both are clean.
|
|
20
20
|
|
|
21
21
|
## Input
|
|
22
22
|
|
|
23
23
|
One of:
|
|
24
|
-
- A contract path (`.qa/contracts/<contract-name>.md`, as `/qa-implement` names it) — review the implementation of
|
|
24
|
+
- A contract path (`.qa/contracts/<contract-name>.md`, as `/vc-qa-implement` names it) — review the implementation of
|
|
25
25
|
that contract
|
|
26
26
|
- No arguments — review the files changed on the current branch
|
|
27
27
|
- A file path or glob pattern — review specific files
|
|
28
28
|
- A PR number or URL — review a pull request
|
|
29
29
|
|
|
30
|
-
Optionally followed by `healer: <baseline tree id> <new tree id>`, which `/qa-heal` names after a clean guard.
|
|
30
|
+
Optionally followed by `healer: <baseline tree id> <new tree id>`, which `/vc-qa-heal` names after a clean guard.
|
|
31
31
|
|
|
32
32
|
`$ARGUMENTS` specifies the target, then the optional `healer:` part; take that part off before reading the target.
|
|
33
33
|
If the target is empty, detect it from git.
|
|
@@ -40,26 +40,26 @@ If `$ARGUMENTS` is a contract path (a `.md` file under `.qa/contracts/`):
|
|
|
40
40
|
- Run `node .claude/checks/contract.mts check --approved --implemented <contract path>`; when it does not print `ok`,
|
|
41
41
|
show its lines and stop
|
|
42
42
|
- Collect the changed files as for no arguments, new untracked files included (`git status --porcelain`)
|
|
43
|
-
- Spawn the `qa-reviewer` agent with `/review-test-code` on those files and the contract path. It runs the
|
|
44
|
-
definition of done on the run record `.qa/runs/<contract-name>/` (the skill `project-facts`, "Hand-off Paths"),
|
|
43
|
+
- Spawn the `vc-qa-reviewer` agent with `/vc-review-test-code` on those files and the contract path. It runs the
|
|
44
|
+
definition of done on the run record `.qa/runs/<contract-name>/` (the skill `vc-project-facts`, "Hand-off Paths"),
|
|
45
45
|
the scope check and the shape and duration gates
|
|
46
46
|
|
|
47
47
|
If `$ARGUMENTS` is a PR number or URL:
|
|
48
|
-
- Spawn the `qa-reviewer` agent with the `/review-pr` skill, and "no contract"
|
|
48
|
+
- Spawn the `vc-qa-reviewer` agent with the `/vc-review-pr` skill, and "no contract"
|
|
49
49
|
|
|
50
50
|
If `$ARGUMENTS` is any other file path or pattern:
|
|
51
|
-
- Spawn the `qa-reviewer` agent with the `/review-test-code` skill, and "no contract"
|
|
51
|
+
- Spawn the `vc-qa-reviewer` agent with the `/vc-review-test-code` skill, and "no contract"
|
|
52
52
|
|
|
53
53
|
If no arguments (then also "no contract"):
|
|
54
54
|
- Collect changed files: `git diff --name-only dev...HEAD` plus uncommitted changes (`git status --short`)
|
|
55
55
|
- Keep the TypeScript and GraphQL files of the suite (`virtocommerce/`, skipping `virtocommerce/graphql/generated/`
|
|
56
56
|
and `virtocommerce/rest/generated/`) and of the framework (`src/`, `tests/unit/`), plus the JSON records under
|
|
57
57
|
`virtocommerce/dataset/data/`
|
|
58
|
-
- Spawn the `qa-reviewer` agent with `/review-test-code` on those files
|
|
58
|
+
- Spawn the `vc-qa-reviewer` agent with `/vc-review-test-code` on those files
|
|
59
59
|
|
|
60
60
|
### 2. Review
|
|
61
61
|
|
|
62
|
-
The agent reviews against the skill `framework-rules` and the repository's own style:
|
|
62
|
+
The agent reviews against the skill `vc-framework-rules` and the repository's own style:
|
|
63
63
|
- Framework rules (`arrange:`/`act:`/`assert:` steps, no conditionals/casts/helpers/raw selectors, layer rules,
|
|
64
64
|
waits, platform defects left failing with their `issue` annotation)
|
|
65
65
|
- Style (the repository's `CLAUDE.md`, linter configuration and neighbouring files)
|
|
@@ -81,7 +81,7 @@ Present the review results:
|
|
|
81
81
|
|
|
82
82
|
If issues are found, end with:
|
|
83
83
|
```
|
|
84
|
-
Review complete. Fix the issues above, then run /qa-review again.
|
|
84
|
+
Review complete. Fix the issues above, then run /vc-qa-review again.
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
If approved, end with:
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# QA
|
|
2
2
|
|
|
3
|
-
One entry for the whole QA workflow: `/qa <task>` picks a flow and runs it from this session. You are the
|
|
3
|
+
One entry for the whole QA workflow: `/vc-qa <task>` picks a flow and runs it from this session. You are the
|
|
4
4
|
orchestrator. You dispatch each role as a fresh subagent with file paths only, never a summary of the conversation,
|
|
5
5
|
and you never do a role's work yourself.
|
|
6
6
|
|
|
7
7
|
`$ARGUMENTS` is the task in plain words: a ticket key, a specification or documentation link, an area ("cover the
|
|
8
8
|
cart"), a failing test, "review this branch", "what is not covered". Empty: ask what to do.
|
|
9
9
|
|
|
10
|
+
## Step 0: Clean Up
|
|
11
|
+
|
|
12
|
+
Run `node .claude/checks/prune.mts --fetch --yes`. It removes only finished work under `.qa/`: a contract whose cases
|
|
13
|
+
are all in test titles on the default branch, with its run record, verdict and observed report. Keep its last line
|
|
14
|
+
(`prune: …`) for the Output. Show its `ask` lines (older files it keeps unless told) to the person as one list and, only
|
|
15
|
+
on their yes, run `node .claude/checks/prune.mts --yes --include-stale`. The flow does not wait for that answer, and a
|
|
16
|
+
`not reached` line or a failed check never stops it.
|
|
17
|
+
|
|
10
18
|
## Pick the Flow
|
|
11
19
|
|
|
12
20
|
| Request | Flow |
|
|
@@ -24,8 +32,8 @@ flow, a contract with a pending `observed:` oracle is observed before its approv
|
|
|
24
32
|
|
|
25
33
|
## Dispatch Rules
|
|
26
34
|
|
|
27
|
-
- Each role is a fresh subagent: `qa-planner`, `qa-explorer`, `qa-coverage`, `qa-automation-expert`, `qa-judge`,
|
|
28
|
-
`qa-healer`, `qa-reviewer`. Give it the request and the paths it needs (the contract, a report, a diff range,
|
|
35
|
+
- Each role is a fresh subagent: `vc-qa-planner`, `vc-qa-explorer`, `vc-qa-coverage`, `vc-qa-automation-expert`, `vc-qa-judge`,
|
|
36
|
+
`vc-qa-healer`, `vc-qa-reviewer`. Give it the request and the paths it needs (the contract, a report, a diff range,
|
|
29
37
|
spec files). Never paste the previous agent's reasoning or summary.
|
|
30
38
|
- Send an agent only paths, the person's own words and the fixed words this command names (`judge re-dispatch`,
|
|
31
39
|
"no contract", `healer: <baseline tree id> <new tree id>`, `observe <contract path>`, `observed <contract path>
|
|
@@ -38,21 +46,19 @@ flow, a contract with a pending `observed:` oracle is observed before its approv
|
|
|
38
46
|
|
|
39
47
|
### Explore and coverage
|
|
40
48
|
|
|
41
|
-
Dispatch `qa-explorer` with the area. Dispatch `qa-coverage` for what is already tested. Both leave a report under
|
|
49
|
+
Dispatch `vc-qa-explorer` with the area. Dispatch `vc-qa-coverage` for what is already tested. Both leave a report under
|
|
42
50
|
`.qa/reports/`; keep the paths and pass them to the planner. In an explore-only flow, show the report and stop.
|
|
43
51
|
|
|
44
52
|
### Plan
|
|
45
53
|
|
|
46
|
-
Dispatch `qa-planner` with the request (and the report paths for an area or a gap). It writes
|
|
54
|
+
Dispatch `vc-qa-planner` with the request (and the report paths for an area or a gap). It writes
|
|
47
55
|
`.qa/contracts/<ticket-key-or-slug>.md`. Relay its scope questions.
|
|
48
56
|
|
|
49
57
|
First, when the planner replies `needs observation` (its only check lines are `no recorded value`), observe before
|
|
50
|
-
the approval: dispatch `qa-explorer` with `observe <contract path>`. It is read-only and records every `observed:`
|
|
58
|
+
the approval: dispatch `vc-qa-explorer` with `observe <contract path>`. It is read-only and records every `observed:`
|
|
51
59
|
case in `.qa/reports/explore-<slug>-observed.md`. Then dispatch the planner with `observed <contract path> <report
|
|
52
|
-
path>` to copy the values in. Cases the report lists as `not reached
|
|
53
|
-
|
|
54
|
-
area cannot be observed, because the observe probe does not exist yet), go to the person at once as a scope
|
|
55
|
-
question: (a) observe at the expert's first run (it pins the value it sees and asks for it in an amendment the
|
|
60
|
+
path>` to copy the values in. Cases the report lists as `not reached` (the explorer observes as the session the browser holds, or
|
|
61
|
+
anonymously through the probe for an API area with no page) go to the person at once as a scope question: (a) observe at the expert's first run (it pins the value it sees and asks for it in an amendment the
|
|
56
62
|
person approves); (b) name another oracle source; (c) drop the case. Pass the answers to the planner with
|
|
57
63
|
`observed <contract path> <report path>`.
|
|
58
64
|
|
|
@@ -73,12 +79,12 @@ contract check again.
|
|
|
73
79
|
### Implement
|
|
74
80
|
|
|
75
81
|
The hand-off paths (`<contract-name>`, the run record, the verdict) and the stable-series commands are in the skill
|
|
76
|
-
`project-facts`, "Hand-off Paths".
|
|
82
|
+
`vc-project-facts`, "Hand-off Paths".
|
|
77
83
|
|
|
78
84
|
Before the first expert dispatch of a run, move an earlier run's verdict out of the way, so it cannot steer this run:
|
|
79
85
|
`mv -f .qa/judge/<contract-name>/judge-expert.json .qa/judge/<contract-name>/judge-expert.previous.json` when the
|
|
80
86
|
first file exists. Run `node .claude/checks/contract.mts check --approved <contract path>`; when it does not print
|
|
81
|
-
`ok`, the contract is not approved: stop. Dispatch `qa-automation-expert` with the contract path only. It leaves
|
|
87
|
+
`ok`, the contract is not approved: stop. Dispatch `vc-qa-automation-expert` with the contract path only. It leaves
|
|
82
88
|
its run record under `.qa/runs/<contract-name>/`: `report.<project>.json` and `list.<project>.json` for each
|
|
83
89
|
project, named with the project even when there is one. When it stops with an amendment request, show it to the
|
|
84
90
|
person; after the amendment's `Approved:` line is written (by the person, or by you quoting them as in Approval), run
|
|
@@ -87,7 +93,10 @@ the contract check again and dispatch the expert again with the same path (not a
|
|
|
87
93
|
In the end-to-end flow, tell an unreachable stand apart from a red run first. When the expert reported the stand as
|
|
88
94
|
not reachable, or a project of the contract's case rows has no `report.<project>.json`, the run is "not done, stand
|
|
89
95
|
unreachable": stop, tell the person, and go to neither Heal nor Judge. Otherwise reconcile each project's record with
|
|
90
|
-
the third command of "Hand-off Paths"
|
|
96
|
+
the third command of "Hand-off Paths", with its `--contract` argument. A series the expert ran differently from the
|
|
97
|
+
contract's Verification needs a `deviation: <what and why>` line per difference in `.qa/runs/<contract-name>/deviation.txt`: write them
|
|
98
|
+
when you ran the series yourself, and read the expert's. A `stale` list, or more `differences` than `deviation:` lines, is not a run to heal: the series is stale or not the one the
|
|
99
|
+
contract asked for, so dispatch the expert again with the same path. Exit 1 with a verdict whose `failures` list only tests of cases under the
|
|
91
100
|
contract's `## Platform defects`, each failed in every repetition: the run is done with known platform defects, so
|
|
92
101
|
go to Judge and name them in the Output. Exit 1 with a verdict whose `failures` list any other test (failed, flaky,
|
|
93
102
|
skipped without a reason, missing from the report): the run is red, so go to Heal with the run record path, then to
|
|
@@ -96,7 +105,7 @@ All exit 0: go to Judge.
|
|
|
96
105
|
|
|
97
106
|
### Heal
|
|
98
107
|
|
|
99
|
-
Before dispatching `qa-healer`, record a baseline and a fingerprint:
|
|
108
|
+
Before dispatching `vc-qa-healer`, record a baseline and a fingerprint:
|
|
100
109
|
`node .claude/checks/expectation-guard.mts --snapshot` prints a git tree id of the working tree, untracked files
|
|
101
110
|
included; `node .claude/checks/expectation-guard.mts --repo-fingerprint` prints one sha of `.git/config`,
|
|
102
111
|
`.git/info/`, `.git/hooks/`, the directory `core.hooksPath` names and `.qa/project.json` (it only reads; it is
|
|
@@ -104,13 +113,13 @@ yours, the healer may not run it). When `--repo-fingerprint` exits non-zero or p
|
|
|
104
113
|
hexadecimal characters (a configuration file under a healer path, for one), show the person "fingerprint could not
|
|
105
114
|
be computed:" followed by its stderr line, and do not dispatch the healer. Then store the guard recipe as the baseline
|
|
106
115
|
holds it:
|
|
107
|
-
`GIT_NO_LAZY_FETCH=1 git --no-replace-objects -c core.fsmonitor=false cat-file blob <baseline tree id>:.claude/skills/heal-tests/guard-recipe.md`
|
|
116
|
+
`GIT_NO_LAZY_FETCH=1 git --no-replace-objects -c core.fsmonitor=false cat-file blob <baseline tree id>:.claude/skills/vc-heal-tests/guard-recipe.md`
|
|
108
117
|
prints it; keep that text, and when it prints nothing, do not dispatch the healer. Dispatch the healer with the
|
|
109
118
|
failing spec files or the run record path and that baseline id. A run whose only failures are platform-defect
|
|
110
119
|
tests is not healed.
|
|
111
120
|
When it is done, run the recipe you stored word for word: its shell block with that baseline id and fingerprint,
|
|
112
121
|
what each outcome means, and its "After a Clean Guard" re-run. Never read
|
|
113
|
-
`.claude/skills/heal-tests/guard-recipe.md` from the working tree after the heal: the healer runs test code, which
|
|
122
|
+
`.claude/skills/vc-heal-tests/guard-recipe.md` from the working tree after the heal: the healer runs test code, which
|
|
114
123
|
can rewrite any file, the recipe included. A guard that is not clean, or a re-run that exits 1 on a project, stops
|
|
115
124
|
the flow before the judge and the reviewer. A product defect the healer reports is shown to the person, not
|
|
116
125
|
patched: its test stays failing until the platform is fixed, and the person files the ticket.
|
|
@@ -119,7 +128,7 @@ In the end-to-end flow this stage runs only when the expert's run is red, and be
|
|
|
119
128
|
|
|
120
129
|
### Judge
|
|
121
130
|
|
|
122
|
-
After the expert (and, in the end-to-end flow, after a clean heal), once per contract, dispatch `qa-judge` with the
|
|
131
|
+
After the expert (and, in the end-to-end flow, after a clean heal), once per contract, dispatch `vc-qa-judge` with the
|
|
123
132
|
role `expert`, the contract path and the expert's spec files: it judges only the expert's tests, never the healer's
|
|
124
133
|
page-object or data changes, which the guard checks. The verdict is `.qa/judge/<contract-name>/judge-expert.json`.
|
|
125
134
|
Check it:
|
|
@@ -129,7 +138,7 @@ Check it:
|
|
|
129
138
|
- Not `ok`: send the judge the lines and have it fix its file once; never edit the verdict yourself. A second
|
|
130
139
|
malformed verdict stops the flow: show the check's output to the person and wait.
|
|
131
140
|
- `pass`: go on to the reviewer.
|
|
132
|
-
- `fail`: dispatch `qa-automation-expert` again, once, with the contract path and the words `judge re-dispatch`; it
|
|
141
|
+
- `fail`: dispatch `vc-qa-automation-expert` again, once, with the contract path and the words `judge re-dispatch`; it
|
|
133
142
|
reads the failing verdict at that fixed path itself and fixes only what it names. Then judge again. A second
|
|
134
143
|
`fail` stops the flow: show both verdicts to the person and wait. Never loop further.
|
|
135
144
|
|
|
@@ -137,20 +146,20 @@ No other role is judged in a flow.
|
|
|
137
146
|
|
|
138
147
|
### Review
|
|
139
148
|
|
|
140
|
-
Dispatch `qa-reviewer` with the diff (or the git range) and the contract path when there is one, never the author's
|
|
149
|
+
Dispatch `vc-qa-reviewer` with the diff (or the git range) and the contract path when there is one, never the author's
|
|
141
150
|
summary. For "review this branch" with no contract, say so in the dispatch: the reviewer then reviews against the
|
|
142
151
|
framework rules and style only. After a heal whose guard ran clean, add the line
|
|
143
152
|
`healer: <baseline tree id> <new tree id>` (the `healed tree` the guard recipe printed). The reviewer spares only the
|
|
144
153
|
hunks of `git diff <baseline tree id> <new tree id>` under the healer paths from the scope rule, so an expert's own
|
|
145
154
|
change in a healed file stays in scope. Without a clean guard, send no such line. Its shell is read-only, so run
|
|
146
|
-
`commands.typecheck` and `commands.lint` from `node .claude/checks/project-facts.mts` yourself and report the result
|
|
155
|
+
`commands.typecheck` and `commands.lint` (when the facts have one) from `node .claude/checks/project-facts.mts` yourself and report the result
|
|
147
156
|
with the review. A failing typecheck or lint means the work is not done, whatever the verdict.
|
|
148
157
|
For a pull request, fetch the diff and metadata with `gh` and pass them as files.
|
|
149
158
|
|
|
150
159
|
## Output
|
|
151
160
|
|
|
152
|
-
End with what ran and what is left: the flow, the contract path, the run record counts per project with every
|
|
161
|
+
End with what ran and what is left: the `prune:` line of Step 0, the flow, the contract path, the run record counts per project with every
|
|
153
162
|
skip's reason and every platform-defect failure with its case, the judge verdict, the review verdict, and anything
|
|
154
163
|
awaiting a person (an approval, an amendment, a second judge failure, a guard finding). Say "not done" for any stage
|
|
155
164
|
that did not run. Say "ready to commit" only when the contract is approved, the run was done, the judge passed, the
|
|
156
|
-
review approved and typecheck and lint are clean.
|
|
165
|
+
review approved and typecheck and lint (when the facts have one) are clean.
|
|
@@ -7,7 +7,7 @@ type HookBlockReason = typeof hookBlockReason;
|
|
|
7
7
|
|
|
8
8
|
const CLI_FILE_NAME = "readonly-shell.mts";
|
|
9
9
|
const MODULE = "../checks/readonly-shell.mts";
|
|
10
|
-
const GUARDED_AGENTS = ["qa-reviewer", "qa-explorer", "qa-coverage", "qa-judge", "qa-healer"];
|
|
10
|
+
const GUARDED_AGENTS = ["vc-qa-reviewer", "vc-qa-explorer", "vc-qa-coverage", "vc-qa-judge", "vc-qa-healer"];
|
|
11
11
|
const STDIN = 0;
|
|
12
12
|
const BLOCK_EXIT_CODE = 2;
|
|
13
13
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: coverage-analysis
|
|
2
|
+
name: vc-coverage-analysis
|
|
3
3
|
description: "Analyse the coverage of a stand: what it offers (installed modules, API operations, frontend pages), what the tests cover and skip, the gaps ranked by script, and the test-count metrics. Read-only; writes only the report under .qa/reports/"
|
|
4
4
|
argument-hint: "[module | page | api-area]"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Coverage Analysis
|
|
8
8
|
|
|
9
|
-
Used by `qa-coverage`. The result is `.qa/reports/coverage-<yyyy-mm-dd>[-<slug>].md` with four sections. It writes no
|
|
10
|
-
test, no page object and no seeder; a gap is text for `qa-planner`. Read first: the skill `framework-rules`, then
|
|
11
|
-
`project-facts` (`node .claude/checks/project-facts.mts`). The argument limits every step to one module, page or API
|
|
12
|
-
area.
|
|
9
|
+
Used by `vc-qa-coverage`. The result is `.qa/reports/coverage-<yyyy-mm-dd>[-<slug>].md` with four sections. It writes no
|
|
10
|
+
test, no page object and no seeder; a gap is text for `vc-qa-planner`. Read first: the skill `vc-framework-rules`, then
|
|
11
|
+
`vc-project-facts` (`node .claude/checks/project-facts.mts`). The argument limits every step to one module, page or API
|
|
12
|
+
area. Before the first step run `git status --short` and keep its output: Done compares with it.
|
|
13
13
|
|
|
14
14
|
## Step 1: Inventory (What the Stand Offers)
|
|
15
15
|
|
|
@@ -31,10 +31,10 @@ Each list is a short table; count and group by area when it is long.
|
|
|
31
31
|
## Step 2: Coverage (What the Tests Cover)
|
|
32
32
|
|
|
33
33
|
- Per Playwright project (Grep `name:` in the suite's config, `<suiteDir>/playwright.config.ts`) and area, run one
|
|
34
|
-
command at a time, with `<path>` repository-relative
|
|
34
|
+
command at a time, with `<path>` repository-relative and `<playwright>` the facts' `playwright`:
|
|
35
35
|
|
|
36
36
|
```shell
|
|
37
|
-
|
|
37
|
+
<playwright> --list --reporter=list --project=<project> <path>
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
Its `Total: N tests in M files` line is the count. Use `--reporter=json` only for one project and one path, when
|
|
@@ -71,8 +71,10 @@ higher); `cost` from the building blocks the planner would still have to create
|
|
|
71
71
|
Run `node .claude/checks/rank-gaps.mts <gaps file>`. It marks a gap critical when its name or area matches a critical
|
|
72
72
|
flow, scores each gap by the project's weights, and prints them in a strict order: gaps enabled on the stand first, then
|
|
73
73
|
critical flows before the others (a critical gap outranks a non-critical one whatever the scores), then by score,
|
|
74
|
-
highest first, then by name. A gap not enabled on the stand ranks below every enabled one, critical or not.
|
|
75
|
-
|
|
74
|
+
highest first, then by name. A gap not enabled on the stand ranks below every enabled one, critical or not. A gap with
|
|
75
|
+
`"tied": true` has the same enabled-on-stand, critical and score values as a neighbour, so only its name put it
|
|
76
|
+
before or after that neighbour: mark such rows `tied` in the report, say in one line under the table that the order
|
|
77
|
+
inside a tied run is alphabetical and not a priority, and never reorder them by taste. Give the gaps ids `G1`, `G2`, ... in the printed order. In the report each is one row: id, area, surface, name, score, and one
|
|
76
78
|
sentence a planner can take as a task ("Cover `<name>`: the behaviour no test checks; roles `<roles>`"), plus why it is
|
|
77
79
|
not enabled when it is not.
|
|
78
80
|
|
|
@@ -80,8 +82,8 @@ not enabled when it is not.
|
|
|
80
82
|
|
|
81
83
|
Counts from Step 2, not from memory:
|
|
82
84
|
|
|
83
|
-
| Project | Spec files | Tests | Platform defects | Skipped | Active rate |
|
|
84
|
-
|
|
85
|
+
| Project | Spec files | Tests | Platform defects | Skipped | Skipped by modules | Active rate |
|
|
86
|
+
|---|---|---|---|---|---|---|
|
|
85
87
|
|
|
86
88
|
- Spec files: count the `*.spec.ts` files under each project's test directory (Glob). Unit tests are on their own
|
|
87
89
|
lines, counted by file (Glob of `*.test.ts`): the framework's under `tests/unit/` and the suite's under
|
|
@@ -92,8 +94,12 @@ Counts from Step 2, not from memory:
|
|
|
92
94
|
- **Platform-defect tests:** a test with an `issue` annotation runs and fails until the platform is fixed. A table
|
|
93
95
|
row may carry the annotation as a field, so count rows, not only call sites. List each: project, file, test,
|
|
94
96
|
issue link.
|
|
95
|
-
- Skipped:
|
|
96
|
-
|
|
97
|
+
- Skipped: every test that is skipped by declaration, `test.skip`, `test.fixme` or a skip annotation, whatever the
|
|
98
|
+
reason. Count them from the JSON listing of Step 2 (`--reporter=json`, one project and one area at a time): a test
|
|
99
|
+
whose `expectedStatus` is `skipped` is one. They are also findings in Step 2; here they are counted, not left out.
|
|
100
|
+
- Skipped by modules: tests the `modules` option skips on this stand. They skip at run time, so no listing shows them:
|
|
101
|
+
count them only when a run's report does; otherwise 0, and say so.
|
|
102
|
+
- Active tests = total tests minus skipped minus skipped by modules; active rate = active / total x 100.
|
|
97
103
|
- Distribution: each project's share of the total, with one line on the balance between API and UI tests.
|
|
98
104
|
- Compared with the newest earlier report `.qa/reports/coverage-*.md`, excluding `*-gaps.md`, when one exists: change
|
|
99
105
|
and percent change per project; none: say so.
|
|
@@ -103,5 +109,8 @@ compare against.
|
|
|
103
109
|
|
|
104
110
|
## Done
|
|
105
111
|
|
|
106
|
-
All four sections are in the report, each with its rows
|
|
107
|
-
order; every row says where it was
|
|
112
|
+
All four sections are in the report, each with its rows, `none observed` (looked, found nothing) or `not reached: <why>`
|
|
113
|
+
(could not look: no schema, no role, no stand); the Gaps section keeps the script's order; every row says where it was
|
|
114
|
+
seen. Nothing outside `.qa/reports/` changed: `git status --short` now shows what the one you took before your first write
|
|
115
|
+
showed (the repository may already hold untracked or changed files, or not be under git: then say that it could not be
|
|
116
|
+
compared).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: create-graphql-layer
|
|
2
|
+
name: vc-create-graphql-layer
|
|
3
3
|
description: "Add xAPI GraphQL operations and fragments as .graphql documents, regenerate the typed documents with GraphQL Code Generator, and add arrange methods around them when several specs need the same setup"
|
|
4
4
|
argument-hint: "<area> <operation>"
|
|
5
5
|
---
|
|
@@ -10,7 +10,7 @@ There are no hand-written operation classes or model types. An operation is a `.
|
|
|
10
10
|
Generator turns it into a typed `…Document` constant plus result and variable types, and the framework's
|
|
11
11
|
`GraphqlClient` (`shopper.graphql`, the `graphql` fixture) executes it.
|
|
12
12
|
|
|
13
|
-
Read first: skill `framework-rules`, then `project-facts` (`node .claude/checks/project-facts.mts`).
|
|
13
|
+
Read first: skill `vc-framework-rules`, then `vc-project-facts` (`node .claude/checks/project-facts.mts`).
|
|
14
14
|
|
|
15
15
|
## File Locations
|
|
16
16
|
|
|
@@ -126,7 +126,7 @@ async function cart(shopper: Shopper, items: readonly CartItem[]): Promise<Arran
|
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
The platform assigns GraphQL ids, so removal is registered right after the create, or before it when the removal
|
|
129
|
-
finds the record itself (`removeDefaultCartLater` reads the default cart). Data created as the
|
|
129
|
+
finds the record itself (`removeDefaultCartLater` reads the default cart). Data created as the administrator (the role `roleFor.admin` names, if the facts have one)
|
|
130
130
|
uses `await admin()` from the context. Export new result types from `virtocommerce/arrange/index.ts`. A read that one
|
|
131
131
|
spec uses stays in that spec, as a table row lambda or a `function` declaration at its end.
|
|
132
132
|
|
|
@@ -150,6 +150,8 @@ Some setup or checks have no xAPI operation. There are no REST clients: call the
|
|
|
150
150
|
|
|
151
151
|
## Example from this repository
|
|
152
152
|
|
|
153
|
+
The framework's own suite, as an example and not a rule; another repository's values come from its facts and files.
|
|
154
|
+
|
|
153
155
|
- Reference documents: `virtocommerce/graphql/operations/cart/add-item.graphql`,
|
|
154
156
|
`virtocommerce/graphql/operations/cart/get-cart.graphql`; codegen config `virtocommerce/codegen.ts`.
|
|
155
157
|
- Operation areas: cart, category, contact, marketing, order, page-context, pickup-location, product, quote,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: create-ui-layer
|
|
2
|
+
name: vc-create-ui-layer
|
|
3
3
|
description: "Create frontend page objects (MainLayout pages, components, ui-kit wrappers, the Frontend factory) and admin UI objects (vc-shell Blade, DataGrid and other controls, page builder and page designer) with readonly Playwright locators, data-test-id selectors and actions that hide frontend settings from specs"
|
|
4
4
|
argument-hint: "<page-or-component>"
|
|
5
5
|
---
|
|
@@ -10,7 +10,7 @@ Page objects hold locators and user actions: no API calls, no test data, no test
|
|
|
10
10
|
so every locator a test needs lives here. In this suite they live in `virtocommerce/pages/` and import only
|
|
11
11
|
`@playwright/test` and each other, by relative paths; specs and fixtures import them through `@pages/*`.
|
|
12
12
|
|
|
13
|
-
Read first: skill `framework-rules`, then `project-facts` (`node .claude/checks/project-facts.mts`), then
|
|
13
|
+
Read first: skill `vc-framework-rules`, then `vc-project-facts` (`node .claude/checks/project-facts.mts`), then
|
|
14
14
|
`virtocommerce/pages/README.md`, which holds the naming and placement rules.
|
|
15
15
|
|
|
16
16
|
## Where Things Live
|
|
@@ -168,11 +168,13 @@ locator.filter({ hasText: exactText(name) });
|
|
|
168
168
|
|
|
169
169
|
## Verify
|
|
170
170
|
|
|
171
|
-
Run `commands.typecheck`, `commands.lint` and `commands.test["<browser project>"]` from the project facts on a spec
|
|
171
|
+
Run `commands.typecheck`, `commands.lint` (when the facts have one) and `commands.test["<browser project>"]` from the project facts on a spec
|
|
172
172
|
that uses the page object. Run the spec with each relevant setting value when the page object branches on it.
|
|
173
173
|
|
|
174
174
|
## Example from this repository
|
|
175
175
|
|
|
176
|
+
The framework's own suite, as an example and not a rule; another repository's values come from its facts and files.
|
|
177
|
+
|
|
176
178
|
- Rules for the directory: `virtocommerce/pages/README.md`; Biome's one-class-per-file and kebab-case rules for it are
|
|
177
179
|
in `.biome/layers.json`.
|
|
178
180
|
- Frontend factory: `virtocommerce/pages/frontend/frontend.ts` (`Frontend`, `FrontendSettings`).
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vc-explore-api
|
|
3
|
+
description: "Map an area of an API on the stand: the operations the schema declares, and what the page's own traffic shows the live service answering, with every difference; with no page, the schema and anonymous reads. Read-only; sends no request of its own but the two sanctioned checks; writes only the report under .qa/reports/ and probe files under .qa/probes/"
|
|
4
|
+
argument-hint: "<api-area>"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Explore API
|
|
8
|
+
|
|
9
|
+
Used by `vc-qa-explorer`. The result is the two API sections of `.qa/reports/explore-<slug>.md`. It writes no
|
|
10
|
+
request code, no query and no test. Read first: the skill `vc-framework-rules`, then `vc-project-facts`
|
|
11
|
+
(`node .claude/checks/project-facts.mts`). Before the first step run `git status --short` and keep its output: Done
|
|
12
|
+
compares with it.
|
|
13
|
+
|
|
14
|
+
## Step 1: The Schema
|
|
15
|
+
|
|
16
|
+
- Find the schema the repository holds for the area: a generated schema file, an OpenAPI document, or the operations the
|
|
17
|
+
existing specs and `arrange` methods call (Grep, Glob). Read the knowledge snapshot (`knowledgeDir`) too.
|
|
18
|
+
- No schema in the repository and none in `knowledgeDir` (`schema-graphql.graphql`, `schema-rest.txt`): run
|
|
19
|
+
`node .claude/checks/introspect.mts graphql`, and `rest` for a REST area. It asks the stand's backend for its schema
|
|
20
|
+
without a credential, saves it in `knowledgeDir` with the capture date (`schema-rest.txt` holds one operation per
|
|
21
|
+
line, to search with Grep) and prints only counts. An answer other than 200 is `not reached: the backend describes
|
|
22
|
+
its schema only to a signed-in user`, not a stop.
|
|
23
|
+
- Still none: the live service is the only source, and the report says so.
|
|
24
|
+
|
|
25
|
+
## Step 2: Operations
|
|
26
|
+
|
|
27
|
+
For each operation of the area, one row:
|
|
28
|
+
|
|
29
|
+
| Operation | Kind | Arguments | Returns | Used by |
|
|
30
|
+
|---|---|---|---|---|
|
|
31
|
+
|
|
32
|
+
`Kind` is query, mutation, GET, POST and so on; `Used by` is the existing spec or `arrange` method that calls it, or
|
|
33
|
+
`none`.
|
|
34
|
+
List a mutation and any state-changing request here, but never call one.
|
|
35
|
+
|
|
36
|
+
## Step 3: Schema vs Live
|
|
37
|
+
|
|
38
|
+
Your only live source is what the page itself sends. With no browser (no `playwright` tools, or no page of the area),
|
|
39
|
+
write `not reached: no browser session of the stand` here, keep Step 2 from the schema and go on; never stop for it.
|
|
40
|
+
Otherwise open the pages of the area with the browser (the stand's origins:
|
|
41
|
+
`node .claude/checks/stand.mts`) and read the requests and answers with `browser_network_requests`; read one answer's
|
|
42
|
+
body with `browser_network_request`, passing only its `index` and `part: "response-body"` (the hook refuses any other
|
|
43
|
+
form). Never open the body of a sign-in, token or refresh request (`/connect/token`, an `auth` or `login` path): it
|
|
44
|
+
holds credentials. Never copy personal data from a body into a report. You send no request of your own: no `fetch`, no
|
|
45
|
+
script, no call from the shell.
|
|
46
|
+
|
|
47
|
+
- Take the operation, its arguments and the answer's shape from the requests the page made. Use the session the
|
|
48
|
+
browser already has. Do not type or look up credentials. A request that answered 401 or 403 is recorded as
|
|
49
|
+
`not reached: needs <role>`; it is not a difference.
|
|
50
|
+
- Keep no response body in the report beyond the field names and types, except, when observing for a contract, the
|
|
51
|
+
values its cases assert; never copy personal data or a secret.
|
|
52
|
+
|
|
53
|
+
Compare each observed answer with the schema and list every difference, one row each: the operation, the field or
|
|
54
|
+
status, what the schema says, what the page's traffic showed. Differences to look for: a field the schema declares but
|
|
55
|
+
the answer does not return; a field the answer returns that the schema lacks; a nullable field that is never null, or
|
|
56
|
+
the other way; a type, enum value or error shape that does not match; an operation the page sends that the schema
|
|
57
|
+
does not declare.
|
|
58
|
+
|
|
59
|
+
An operation the page did not send is listed as `not seen: <why>` (the page never uses it, it changes state, it
|
|
60
|
+
needs a role). Never trigger one to see it.
|
|
61
|
+
|
|
62
|
+
## Observing for a Contract
|
|
63
|
+
|
|
64
|
+
The explorer's `observe` mode records the value one case asserts, in `.qa/reports/explore-<slug>-observed.md`. First
|
|
65
|
+
confirm who is signed in, from the page (the account menu) or from the page's own answer that names the current user:
|
|
66
|
+
it must be `roles[<the case's data role>]`, or no account for `none`. Any other account, or none you can confirm:
|
|
67
|
+
write `not reached: needs <role>`. Then take the value from the answer of the request the page sent for that case
|
|
68
|
+
(`browser_network_request`, `part: "response-body"`) and write it raw, never quoted or escaped: a JSON string value
|
|
69
|
+
without its JSON quotes.
|
|
70
|
+
|
|
71
|
+
No page sends it: only for data role `none`, read it with the probe. Write `.qa/probes/<slug>.graphql` (one
|
|
72
|
+
`query`, never a mutation) or `.qa/probes/<slug>.get` (one line, the path and query to GET), and run
|
|
73
|
+
`node .claude/checks/probe.mts <that file>`. It sends the request anonymously, read-only, and prints the status and the
|
|
74
|
+
answer (a credential-shaped answer is not shown). Take the value from that answer, `(<where seen>)` being the probe
|
|
75
|
+
file. A 401 or 403 is `not reached: needs <role>`; no probe can sign in. A value nothing can show is
|
|
76
|
+
`not reached: no page sends it`.
|
|
77
|
+
|
|
78
|
+
## Done
|
|
79
|
+
|
|
80
|
+
The two sections are in the report, each with its rows, `none observed` (looked, found nothing) or `not reached: <why>`
|
|
81
|
+
(could not look: a role, a request the page never sends), and every row says where it was seen:
|
|
82
|
+
schema file, existing spec or `arrange` method, or the page's traffic. Nothing outside `.qa/reports/` changed: `git status --short` now shows what the one you took before your first write
|
|
83
|
+
showed (the repository may already hold untracked or changed files, or not be under git: then say that it could not be
|
|
84
|
+
compared), and you sent no request of your own but the sanctioned `introspect` and `probe` checks.
|
|
85
|
+
|
|
86
|
+
## Example from this repository
|
|
87
|
+
|
|
88
|
+
The framework's own suite, as an example and not a rule; another repository's values come from its facts and files.
|
|
89
|
+
|
|
90
|
+
- GraphQL: schema `virtocommerce/graphql/generated/schema.graphql`, operations in `virtocommerce/graphql/operations/`,
|
|
91
|
+
endpoint `/graphql` on the backend host.
|
|
92
|
+
- REST: types generated from the platform's API in `virtocommerce/rest/generated/platform.ts`; specs and
|
|
93
|
+
`virtocommerce/arrange/` call the endpoints directly by path.
|