@allurereport/plugin-agent 3.21.0 → 3.22.0
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/dist/guidance.d.ts +0 -1
- package/dist/guidance.js +0 -26
- package/dist/plugin.js +4 -1
- package/package.json +12 -10
package/dist/guidance.d.ts
CHANGED
|
@@ -13,5 +13,4 @@ export declare const AGENT_ANTI_DUMMY_POLICY: readonly ["Do not add empty wrappe
|
|
|
13
13
|
export declare const AGENT_ACCEPTANCE_CHECKLIST: readonly ["The rerun matches the intended scope and does not trigger forbidden or unexpected-test findings.", "Each touched test shows enough evidence to explain what happened and what was verified.", "Retries include per-attempt diagnostics when the same test reruns."];
|
|
14
14
|
export declare const AGENT_REVIEW_COMPLETENESS_CHECKLIST: readonly ["The relevant scope was run with agent mode unless that was impossible.", "Scoped reviews created expectations before the final rerun, unless the task was an intentionally broad package-health audit.", "The final conclusion was based on `manifest/run.json`, `manifest/test-events.jsonl`, `index.md`, `manifest/tests.jsonl`, and `manifest/findings.jsonl` rather than console output alone.", "Any missing or partial runtime modeling was called out explicitly before the review was considered complete."];
|
|
15
15
|
export declare const AGENT_PARTIAL_RUNTIME_REVIEW_RULES: readonly ["Suite-load, import, or setup failures may appear only in command-named stderr under `artifacts/global/` or global errors instead of `manifest/tests.jsonl`.", "If runner-visible failures are not represented as logical tests, inspect global stderr and treat the run as a partial runtime review, not a clean result set.", "Console-only conclusions stay provisional when agent output is missing, incomplete, or partially modeled."];
|
|
16
|
-
export declare const AGENT_INSTRUCTIONS_TEMPLATE = "## Allure Agent Mode Instructions\n\n- If a command executes tests and its result will be used for smoke checking, reasoning, review, coverage analysis, debugging, or any user-facing conclusion, run it through `allure agent`. It preserves the original console logs and adds agent-mode artifacts without inheriting the normal report or export plugins from the project config.\n- Use `allure agent` for smoke checks too, even when the change is small or mechanical.\n- Only skip agent mode when it is impossible or when you are debugging agent mode itself.\n- After each agent-mode test run, print the `index.md` path from that run's output directory so users can open the run overview quickly.\n- Use `allure agent latest` to print the newest output directory and `index.md` path when `--output` was omitted.\n- When a user asks for the human-readable report from the last run, use `allure agent latest` first if the output directory is unknown, then check `manifest/human-report.json`; when its status is `generated`, use the path recorded there, usually `awesome/index.html`.\n- Use `allure agent capabilities --json` when you need structured supported-command, expectation, output, rerun, and unsupported-feature data without scraping help text.\n- Use `allure agent state-dir` to inspect the shared state directory that stores per-project run registries.\n- Use `allure agent latest`, `state-dir`, `query`, `select`, and `--rerun-*` according to their loop/task/problem mapping instead of treating them as interchangeable helper commands.\n- Use `allure agent inspect <allure-results-dir-or-glob>` or `allure agent inspect --dump <archive-or-glob>` when you need agent-readable markdown and manifests from existing Allure results without rerunning tests locally; repeat `--dump` for multiple CI jobs or environments.\n- Use `--report auto|off|awesome|config` to control human report output. The default `auto` mode writes `awesome/index.html` for 1000 or fewer stored visible logical results and records generated, skipped, disabled, or failed status in `manifest/human-report.json`.\n- Use `allure agent query --latest summary|tests|findings|test` or `allure agent query --from <output-dir> ...` to inspect prior output as focused JSON before manually opening raw manifests.\n- Use `allure agent select --latest` or `allure agent select --from <output-dir>` to inspect the review-targeted test plan before rerunning; add `--output <file>` when you want the CLI to write the plan and print a short selection summary.\n- Use `allure agent --rerun-latest -- <command>` or `allure agent --rerun-from <output-dir> -- <command>` to rerun only the selected tests.\n- When rerunning previous failures, use `allure agent --rerun-latest --rerun-preset failed -- <command>` or `allure agent --rerun-from <output-dir> --rerun-preset failed -- <command>` instead of manually rebuilding runner-specific test names.\n- Use `--rerun-preset review|failed|unsuccessful|all`, repeated `--rerun-environment <id>`, and repeated `--rerun-label name=value` when you need a narrower rerun selection from the previous output.\n- Use `ALLURE_AGENT_STATE_DIR` when you need to override the shared agent state directory for `latest`, `state-dir`, or `--rerun-latest`.\n- Prefer inline `allure agent` expectation flags such as `--goal`, `--expect-tests`, `--expect-test`, `--expect-label`, and `--expect-step-containing`; use `--expectations <file>` only when flags become awkward.\n- Run tests with `allure agent` and review `manifest/run.json`, `manifest/test-events.jsonl`, `index.md`, `manifest/tests.jsonl`, and `manifest/findings.jsonl`.\n- Enrich only the intended tests. Add real steps for real setup, actions, and assertions.\n- Attach only real runtime evidence such as payloads, responses, screenshots, DOM snapshots, diffs, logs, or traces.\n- Keep metadata minimal. Add labels or severity only when scope review, debugging, or quality policy uses them.\n- Instrument stable helpers when several call sites need the same evidence. For example, teach `runCommand` to emit a step instead of wrapping every caller.\n- Reject the rerun if scope drifts or evidence stays weak.";
|
|
17
16
|
export declare const renderAgentsGuide: () => string;
|
package/dist/guidance.js
CHANGED
|
@@ -294,32 +294,6 @@ export const AGENT_PARTIAL_RUNTIME_REVIEW_RULES = [
|
|
|
294
294
|
"If runner-visible failures are not represented as logical tests, inspect global stderr and treat the run as a partial runtime review, not a clean result set.",
|
|
295
295
|
"Console-only conclusions stay provisional when agent output is missing, incomplete, or partially modeled.",
|
|
296
296
|
];
|
|
297
|
-
export const AGENT_INSTRUCTIONS_TEMPLATE = `## Allure Agent Mode Instructions
|
|
298
|
-
|
|
299
|
-
- If a command executes tests and its result will be used for smoke checking, reasoning, review, coverage analysis, debugging, or any user-facing conclusion, run it through \`allure agent\`. It preserves the original console logs and adds agent-mode artifacts without inheriting the normal report or export plugins from the project config.
|
|
300
|
-
- Use \`allure agent\` for smoke checks too, even when the change is small or mechanical.
|
|
301
|
-
- Only skip agent mode when it is impossible or when you are debugging agent mode itself.
|
|
302
|
-
- After each agent-mode test run, print the \`index.md\` path from that run's output directory so users can open the run overview quickly.
|
|
303
|
-
- Use \`allure agent latest\` to print the newest output directory and \`index.md\` path when \`--output\` was omitted.
|
|
304
|
-
- When a user asks for the human-readable report from the last run, use \`allure agent latest\` first if the output directory is unknown, then check \`manifest/human-report.json\`; when its status is \`generated\`, use the path recorded there, usually \`awesome/index.html\`.
|
|
305
|
-
- Use \`allure agent capabilities --json\` when you need structured supported-command, expectation, output, rerun, and unsupported-feature data without scraping help text.
|
|
306
|
-
- Use \`allure agent state-dir\` to inspect the shared state directory that stores per-project run registries.
|
|
307
|
-
- Use \`allure agent latest\`, \`state-dir\`, \`query\`, \`select\`, and \`--rerun-*\` according to their loop/task/problem mapping instead of treating them as interchangeable helper commands.
|
|
308
|
-
- Use \`allure agent inspect <allure-results-dir-or-glob>\` or \`allure agent inspect --dump <archive-or-glob>\` when you need agent-readable markdown and manifests from existing Allure results without rerunning tests locally; repeat \`--dump\` for multiple CI jobs or environments.
|
|
309
|
-
- Use \`--report auto|off|awesome|config\` to control human report output. The default \`auto\` mode writes \`awesome/index.html\` for 1000 or fewer stored visible logical results and records generated, skipped, disabled, or failed status in \`manifest/human-report.json\`.
|
|
310
|
-
- Use \`allure agent query --latest summary|tests|findings|test\` or \`allure agent query --from <output-dir> ...\` to inspect prior output as focused JSON before manually opening raw manifests.
|
|
311
|
-
- Use \`allure agent select --latest\` or \`allure agent select --from <output-dir>\` to inspect the review-targeted test plan before rerunning; add \`--output <file>\` when you want the CLI to write the plan and print a short selection summary.
|
|
312
|
-
- Use \`allure agent --rerun-latest -- <command>\` or \`allure agent --rerun-from <output-dir> -- <command>\` to rerun only the selected tests.
|
|
313
|
-
- When rerunning previous failures, use \`allure agent --rerun-latest --rerun-preset failed -- <command>\` or \`allure agent --rerun-from <output-dir> --rerun-preset failed -- <command>\` instead of manually rebuilding runner-specific test names.
|
|
314
|
-
- Use \`--rerun-preset review|failed|unsuccessful|all\`, repeated \`--rerun-environment <id>\`, and repeated \`--rerun-label name=value\` when you need a narrower rerun selection from the previous output.
|
|
315
|
-
- Use \`ALLURE_AGENT_STATE_DIR\` when you need to override the shared agent state directory for \`latest\`, \`state-dir\`, or \`--rerun-latest\`.
|
|
316
|
-
- Prefer inline \`allure agent\` expectation flags such as \`--goal\`, \`--expect-tests\`, \`--expect-test\`, \`--expect-label\`, and \`--expect-step-containing\`; use \`--expectations <file>\` only when flags become awkward.
|
|
317
|
-
- Run tests with \`allure agent\` and review \`manifest/run.json\`, \`manifest/test-events.jsonl\`, \`index.md\`, \`manifest/tests.jsonl\`, and \`manifest/findings.jsonl\`.
|
|
318
|
-
- Enrich only the intended tests. Add real steps for real setup, actions, and assertions.
|
|
319
|
-
- Attach only real runtime evidence such as payloads, responses, screenshots, DOM snapshots, diffs, logs, or traces.
|
|
320
|
-
- Keep metadata minimal. Add labels or severity only when scope review, debugging, or quality policy uses them.
|
|
321
|
-
- Instrument stable helpers when several call sites need the same evidence. For example, teach \`runCommand\` to emit a step instead of wrapping every caller.
|
|
322
|
-
- Reject the rerun if scope drifts or evidence stays weak.`;
|
|
323
297
|
const renderBullets = (items) => items.map((item) => `- ${item}`).join("\n");
|
|
324
298
|
const renderRemediationGuide = () => Object.entries(ENRICHMENT_ACTIONS_BY_CHECK_NAME)
|
|
325
299
|
.map(([checkName, action]) => `- \`${checkName}\`: ${action.title}. ${action.guidance}`)
|
package/dist/plugin.js
CHANGED
|
@@ -13,7 +13,7 @@ var _AgentPlugin_runtime;
|
|
|
13
13
|
import { appendFile, mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
14
14
|
import { basename, dirname, extname, join, relative, resolve } from "node:path";
|
|
15
15
|
import process from "node:process";
|
|
16
|
-
import { formatDuration, isAttachment, isStep, } from "@allurereport/core-api";
|
|
16
|
+
import { formatDuration, getMutedResolutionState, isAttachment, isStep, } from "@allurereport/core-api";
|
|
17
17
|
import { renderAgentsGuide } from "./guidance.js";
|
|
18
18
|
import { parseAgentExpectations } from "./model.js";
|
|
19
19
|
import { isProcessLogAttachmentName } from "./paths.js";
|
|
@@ -1247,6 +1247,7 @@ const renderRerunGuidance = (findings) => {
|
|
|
1247
1247
|
const renderTestFile = (params) => {
|
|
1248
1248
|
const { entry, outputDir } = params;
|
|
1249
1249
|
const { tr, environmentId, attempts, allArtifacts } = entry;
|
|
1250
|
+
const resolutionState = getMutedResolutionState(tr);
|
|
1250
1251
|
const lines = [
|
|
1251
1252
|
"# Test Result",
|
|
1252
1253
|
"",
|
|
@@ -1261,6 +1262,8 @@ const renderTestFile = (params) => {
|
|
|
1261
1262
|
`- Stopped: ${formatTimestamp(tr.stop)}`,
|
|
1262
1263
|
`- Flaky: ${String(tr.flaky)}`,
|
|
1263
1264
|
`- Resolution: ${tr.resolution ?? "none"}`,
|
|
1265
|
+
`- Resolution Expires At: ${tr.resolutionExpiresAt ?? "none"}`,
|
|
1266
|
+
`- Resolution State: ${resolutionState ?? "n/a"}`,
|
|
1264
1267
|
`- Muted: ${String(tr.muted)}`,
|
|
1265
1268
|
`- Retries in This Run: ${Math.max(attempts.length - 1, 0)}`,
|
|
1266
1269
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/plugin-agent",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.22.0",
|
|
4
4
|
"description": "Allure Agent Plugin – AI-friendly markdown report generator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -26,26 +26,28 @@
|
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "run clean && tsc --project ./tsconfig.json",
|
|
28
28
|
"clean": "rimraf ./dist",
|
|
29
|
-
"test": "rimraf
|
|
29
|
+
"test": "rimraf out && vp test run",
|
|
30
30
|
"test:unit": "yarn test",
|
|
31
|
-
"lint": "
|
|
32
|
-
"lint:fix": "
|
|
31
|
+
"lint": "vp lint --import-plugin src test features stories",
|
|
32
|
+
"lint:fix": "vp lint --import-plugin --fix src test features stories"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@allurereport/core-api": "3.
|
|
36
|
-
"@allurereport/plugin-api": "3.
|
|
35
|
+
"@allurereport/core-api": "3.22.0",
|
|
36
|
+
"@allurereport/plugin-api": "3.22.0",
|
|
37
37
|
"yaml": "^2.9.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@allurereport/
|
|
41
|
-
"@allurereport/
|
|
40
|
+
"@allurereport/common-config": "3.22.0",
|
|
41
|
+
"@allurereport/reader-api": "3.22.0",
|
|
42
42
|
"@types/node": "^20",
|
|
43
|
-
"@vitest/coverage-istanbul": "
|
|
43
|
+
"@vitest/coverage-istanbul": "5.0.4",
|
|
44
44
|
"@vitest/runner": "^2",
|
|
45
45
|
"allure-js-commons": "^3",
|
|
46
46
|
"allure-vitest": "^3",
|
|
47
47
|
"rimraf": "^6",
|
|
48
48
|
"typescript": "^5",
|
|
49
|
-
"
|
|
49
|
+
"vite": "@voidzero-dev/vite-plus-core@1.2.0",
|
|
50
|
+
"vite-plus": "1.2.0",
|
|
51
|
+
"vitest": "5.0.4"
|
|
50
52
|
}
|
|
51
53
|
}
|