Skip to content

Commit bc5c52e

Browse files
authored
chore: remove the merge report feature (#44)
1 parent 0737f73 commit bc5c52e

15 files changed

Lines changed: 18 additions & 366 deletions

File tree

‎CLAUDE.md‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,33 @@ Render a report to self-contained HTML:
2727
scripts/run-qa-report.sh reports/data/qa-report-functional.json # type from filename
2828
scripts/run-qa-report.sh reports/data/qa-report-aeo.json --aeo # aeo comes from the flag or mode: "aeo"
2929
node scripts/generate-report.js reports/data/qa-report-aeo.json # renderer only: validates, skips the stamp and the archive
30-
scripts/merge-qa-reports.sh # or /kosh:merge
3130
node --test "tests/*.test.js" # script, snippet, JSON-file, schema-drift and validation tests
3231
```
3332

3433
`.github/workflows/ci.yml` runs `npm ci` and that same `node --test` line on every PR and on pushes to `trunk` — no API calls. The promptfoo evals stay manual because they cost money.
3534

36-
`generate-report.js` validates the report against its schema (`scripts/validate-report.js`, ajv) before rendering, so the check runs on every render path: `run-qa-report.sh`, the merge, and a direct call. A report that doesn't match is refused — nothing is rendered or archived, and ajv's errors name each field, so the skill that wrote the JSON can fix it and re-run. `run-qa-report.sh` stamps provenance first, so a refused report comes back stamped with its own fields untouched. The types checked are the flagged ones plus any the content shows — `mode: "aeo"` or a `shop` block — so leaving a flag out or passing the wrong one doesn't skip the check. Only a schema file that declares `$schema` is validated — shop and aeo today; functional, performance and accessibility, and so the merged report, are still example documents and pass through with a note. Schemas must compile in ajv strict mode. `node scripts/generate-report.js <json> --skip-validation` renders without the check, which is how to re-render an archived report in an older shape; it's a renderer flag, not a `run-qa-report.sh` one, since the wrapper would also re-stamp and re-archive.
35+
`generate-report.js` validates the report against its schema (`scripts/validate-report.js`, ajv) before rendering, so the check runs on every render path: `run-qa-report.sh` and a direct call. A report that doesn't match is refused — nothing is rendered or archived, and ajv's errors name each field, so the skill that wrote the JSON can fix it and re-run. `run-qa-report.sh` stamps provenance first, so a refused report comes back stamped with its own fields untouched. The types checked are the flagged ones plus any the content shows — `mode: "aeo"` or a `shop` block — so leaving a flag out or passing the wrong one doesn't skip the check. Only a schema file that declares `$schema` is validated — shop and aeo today; functional, performance and accessibility are still example documents and pass through with a note. Schemas must compile in ajv strict mode. `node scripts/generate-report.js <json> --skip-validation` renders without the check, which is how to re-render an archived report in an older shape; it's a renderer flag, not a `run-qa-report.sh` one, since the wrapper would also re-stamp and re-archive.
3736

38-
`run-qa-report.sh` stamps a `provenance` block into the source JSON before rendering: the skill writes `provenance.model` (self-reported), and `scripts/stamp-provenance.js` adds `pluginVersion`, a SHA-256 of each skill directory (references included), and a `seal` over those plus the report's `timestamp`. A valid seal means the block is never restamped, so re-rendering an archived run keeps the provenance of the run that produced it; a model-invented or copied-forward block fails the seal and is restamped. The seal is an unkeyed hash, so it guards against accidents, not deliberate tampering — anything with a shell can recompute it. A report with no `provenance` block at all is left untouched with a warning — it predates the feature, or the skill skipped `provenance.model`. The renderer prints the block as one footer line, and nothing for reports that predate it. The merged report carries no provenance — its JSON is a temp file that is deleted after rendering.
37+
`run-qa-report.sh` stamps a `provenance` block into the source JSON before rendering: the skill writes `provenance.model` (self-reported), and `scripts/stamp-provenance.js` adds `pluginVersion`, a SHA-256 of each skill directory (references included), and a `seal` over those plus the report's `timestamp`. A valid seal means the block is never restamped, so re-rendering an archived run keeps the provenance of the run that produced it; a model-invented or copied-forward block fails the seal and is restamped. The seal is an unkeyed hash, so it guards against accidents, not deliberate tampering — anything with a shell can recompute it. A report with no `provenance` block at all is left untouched with a warning — it predates the feature, or the skill skipped `provenance.model`. The renderer prints the block as one footer line, and nothing for reports that predate it.
3938

4039
`run-qa-report.sh` also copies the source JSON to `reports/data/archive/` under the same basename as the HTML it generated, since `reports/data/qa-report-<type>.json` is overwritten by every run. A same-day rerun with different content moves the previous run's copy aside with its timestamp appended, so the un-suffixed JSON is always the source of the current HTML.
4140

4241
The renderer inlines each finding's screenshots as base64, because every run shares `reports/screenshots/` and a later run can overwrite a file an older report points at. Only image files inside `reports/` are read, and an inlined image expands in place through a CSS-only `<details>` toggle because a `data:` URI can't be a link target. A missing file keeps its external `src` with a warning; a remote, absolute, scheme-carrying or `../` path is dropped with a warning, so only paths inside `reports/` ever reach the HTML. The generator prints the inlined count and the HTML's size. The archived JSON still holds the shared-folder paths, so re-rendering an old run embeds whatever is at those paths now.
4342

44-
`reports/` lives next to `scripts/`, and every script resolves it from its own location, never from the cwd; `tests/reports-dir.test.js` runs the shell scripts from a foreign cwd to keep it that way. Skills and `commands/merge.md` are the exception: they write `reports/…` and call `scripts/*.sh` cwd-relative, which is why the documented launch is `cd kosh && claude --plugin-dir .`. `KOSH_REPORTS_DIR` redirects the scripts only — the tests use it to stay out of the real directory — and does not move where the skills write, so setting it for a real run leaves the renderer looking for screenshots the skill saved somewhere else. The SessionStart hook pre-creates the folders as a nicety; nothing depends on it.
45-
46-
Merging requires all three of functional, performance, and accessibility; shop and AEO reports are standalone. Prefer `/kosh:merge` over calling the script — it reports which JSON files are missing up front, where the script exits on the first one it can't find.
43+
`reports/` lives next to `scripts/`, and every script resolves it from its own location, never from the cwd; `tests/reports-dir.test.js` runs `run-qa-report.sh` from a foreign cwd to keep it that way. Skills are the exception: they write `reports/…` and call `scripts/*.sh` cwd-relative, which is why the documented launch is `cd kosh && claude --plugin-dir .`. `KOSH_REPORTS_DIR` redirects the scripts only — the tests use it to stay out of the real directory — and does not move where the skills write, so setting it for a real run leaves the renderer looking for screenshots the skill saved somewhere else. The SessionStart hook pre-creates the folders as a nicety; nothing depends on it.
4744

4845
With no flag, `run-qa-report.sh` takes the test type from the filename, and for AEO from `mode: "aeo"` in the JSON, so validation, the stamp and the renderer all get `--aeo` even when the skill forgets to pass it. A report with neither is rendered with a "not validated" note. An AEO-shaped report missing `mode` is a hard error in the renderer, not a fallback.
4946

5047
## How it works
5148

5249
Each test is a **skill** (`skills/`), invoked directly as `/kosh:<name>`. The skill parses the URL and environment type from user input, then carries the full testing procedure — what to check, how to check it, and how to report findings. Results follow the structure defined in a **schema** (`schemas/`) and are saved as JSON reports, which are then rendered to self-contained HTML reports via scripts in `scripts/`.
5350

54-
Skills and commands share one `/kosh:` namespace, so a command named after a skill makes that entry appear twice in the slash menu. Tests are skills only; `commands/` holds `merge.md` alone.
51+
Skills and commands share one `/kosh:` namespace, so a command named after a skill makes that entry appear twice in the slash menu.
5552

5653
```
57-
commands/ → merge only — a skill of the same name would double the menu entry
5854
skills/ → detailed testing procedures (the actual prompts)
5955
schemas/ → JSON schemas that define report structure
60-
scripts/ → report generation and merge scripts
56+
scripts/ → report generation, validation and provenance scripts
6157
hooks/ → session hooks (e.g., create reports/data/ on startup)
6258
evals/ → promptfoo regression checks for skill decision rules (evals/README.md)
6359
tests/ → `node --test` checks for the scripts, skill-embedded snippets, tracked JSON files, skill ↔ schema drift and report validation
@@ -82,8 +78,6 @@ Each test type has a matching set of files:
8278

8379
If you add a new test type, you need both: a skill and a schema. Do not add a matching command — the name would collide.
8480

85-
`commands/merge.md` is the exception — it has no skill or schema, and runs `scripts/merge-qa-reports.sh` after a pre-flight check for the three input reports.
86-
8781
## Contributing
8882

8983
### Adding or editing a skill

‎README.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Kosh tests a site across five dimensions:
1414
- **Shop (WooCommerce):** The guest purchase path — catalog, product pages, add to cart, cart quantity and removal operations, cart math, and the checkout form. Stops at the payment step and never places an order.
1515
- **AEO (Answer Engine Optimization):** How AI tools like ChatGPT, Perplexity, Claude, and Google AI Overviews discover, parse, understand, and cite the site. 49 signals across 8 criteria, status-based evaluation (pass / partial / fail / N/A), site-type-aware and content-driven.
1616

17-
Each test visits 4–6+ pages, simulates real user behavior, and outputs a structured JSON report. A render script converts the JSON into a self-contained HTML report with color-coded severity, collapsible sections, and inline screenshots. The functional, performance, and accessibility test types can also be merged into one comprehensive report; shop and AEO reports are standalone.
17+
Each test visits 4–6+ pages, simulates real user behavior, and outputs a structured JSON report. A render script converts the JSON into a self-contained HTML report with color-coded severity, collapsible sections, and inline screenshots.
1818

1919
## Quick start
2020

@@ -44,10 +44,9 @@ For detailed setup instructions (including troubleshooting), see the [Getting St
4444
## Project structure
4545

4646
```text
47-
commands/ Slash command for /kosh:merge
4847
skills/ Full testing procedures, invoked as /kosh:a11y, /kosh:aeo, /kosh:functional-design, /kosh:performance, /kosh:shop
4948
schemas/ JSON schemas for report validation
50-
scripts/ Report generation and merge scripts
49+
scripts/ Report generation, validation and provenance scripts
5150
hooks/ Session hook that creates reports/data/ on startup
5251
evals/ Promptfoo regression checks for skill decision rules
5352
tests/ node --test checks for the scripts, skill snippets, JSON files and skill ↔ schema drift — run by .github/workflows/ci.yml on every PR

‎commands/merge.md‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎docs/getting-started.md‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,6 @@ Can you visit https://example.com/blog and check whether the post images all hav
140140
I want to know if the navigation is keyboard accessible on mobile — can you check that?
141141
```
142142

143-
## Combining reports
144-
145-
After running the functional, performance, and accessibility tests against the same site, you can merge them into one comprehensive report:
146-
147-
```
148-
/kosh:merge
149-
```
150-
151-
This creates a single HTML document covering functional, performance, and accessibility findings. The shop and AEO tests aren't part of the merge — they render as standalone reports.
152-
153143
## Specifying the environment
154144

155145
If you're testing a local or development site (not the live production site), you can tell kosh so it doesn't flag expected dev-environment things as bugs:

‎scripts/generate-report.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
/**
44
* kosh report generator (HTML output)
55
*
6-
* Reads a kosh JSON report (functional, performance, accessibility, shop, AEO,
7-
* or merged) and emits a self-contained HTML file with inline CSS, color-coded
6+
* Reads a kosh JSON report (functional, performance, accessibility, shop or AEO)
7+
* and emits a self-contained HTML file with inline CSS, color-coded
88
* severity, collapsible sections, and inline screenshots when findings reference them.
99
*
1010
* Usage:

‎scripts/merge-qa-reports.js‎

Lines changed: 0 additions & 125 deletions
This file was deleted.

0 commit comments

Comments
 (0)