You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 433148b
Browse filesBrowse the repository at this point in the historyBrowse files
#89: add normalize-tests service and lineage handling (#90)
* feat: add normalize-tests service and lineage handling
- Implemented the `normalize-tests` command to validate, build, and write UI test catalogs.
- Introduced a lineage table to map input scenarios to user stories and functionalities.
- Created unit tests for the new service, ensuring proper functionality and lineage coverage.
- Added shared fixtures for testing and established expected output for the UI test catalog.
- Updated requirements to include the new normalize_tests package.
* fix: refine logic for qualified scenario IDs and enhance unit tests for fallback behavior
* feat: implement centralized error handling for CLI commands and update documentation
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,8 +21,8 @@ Tooling and quality gates → Common pitfalls → Learned rules.
21
21
(`living-doc`) and one composite GitHub Action. It sits between the upstream `living-doc-*`
22
22
collector actions and the downstream generator actions: it reads collector output as
23
23
`living-doc-utilities` contract artifacts, validates a command's inputs together, and
24
-
transforms them into the contracts the generators read. `normalize-docs`runs;
25
-
`normalize-tests` and `coverage-matrix`each land in a later change.
24
+
transforms them into the contracts the generators read. `normalize-docs`and `normalize-tests` run;
25
+
`coverage-matrix`lands in a later change.
26
26
27
27
- Must treat the `living-doc` CLI running as a step in a GitHub Actions workflow as the supported path; running `living-doc <command>` locally is a development and debugging affordance only.
28
28
- Must keep the whole collect → normalize → generate pipeline AI-free — deterministic Python only, no LLM call and no network call anywhere in that path.
@@ -31,20 +31,21 @@ transforms them into the contracts the generators read. `normalize-docs` runs;
31
31
32
32
## Repo specifics
33
33
34
-
Module map — three packages under `packages/` and `apps/`, each with its own `pyproject.toml`,
34
+
Module map — four packages under `packages/` and `apps/`, each with its own `pyproject.toml`,
35
35
`src/` layout, and `tests/` directory:
36
36
37
37
| Path | Package (`pip` name) | Responsibility |
38
38
|---|---|---|
39
-
|`packages/core`|`living-doc-core`|`logging_config.py` (`setup_logging`), `readers.py` (the reader table, `read_documentation`, `read_tests`), `input_validation.py` (`validate_inputs`, the shared input validation), `views.py` (`select_records`, the view filter), `run_context.py` (`run_context`, the CI run for `metadata.run`). Depends on `living-doc-utilities==0.8.0`. |
39
+
|`packages/core`|`living-doc-core`|`logging_config.py` (`setup_logging`), `envelope.py` (`PRODUCER_NAME`, `TOOLKIT_VERSION`, `forwarded`, the producer identity and warning forwarding every transform shares), `readers.py` (the reader table, `read_documentation`, `read_tests`), `input_validation.py` (`validate_inputs`, the shared input validation), `views.py` (`select_records`, the view filter), `run_context.py` (`run_context`, the CI run for `metadata.run`). Depends on `living-doc-utilities==0.8.0`. |
40
40
|`packages/services/normalize_docs`|`living-doc-service-normalize-docs`|`builder.py` (`build_generator_ready`), `lineage.py` (`LINEAGE_TABLE`), `service.py` (`normalize_docs`, the command, and `check_no_field_loss`). |
41
-
|`apps/cli`|`living-doc-cli`| CLI entry point — `main.py` (`cli()` click group), one module per command under `commands/`. Registers `normalize-docs`. |
41
+
|`packages/services/normalize_tests`|`living-doc-service-normalize-tests`|`builder.py` (`build_ui_test_catalog`), `lineage.py` (`LINEAGE_TABLE`), `service.py` (`normalize_tests`, the command, and the runtime field-loss check). |
42
+
|`apps/cli`|`living-doc-cli`| CLI entry point — `main.py` (`cli()` click group), one module per command under `commands/`. Registers `normalize-docs` and `normalize-tests`. |
42
43
43
44
- Must treat the repository root as the action — `action.yml`, its entry point `main.py` (input checks, `COMMAND_INPUTS`, `NOT_AVAILABLE_YET`), and the root `tests/`.
44
45
- Must treat `apps/cli/src/living_doc_cli/main.py``cli()` as the CLI entry point — each command is registered there as it lands.
45
46
- Must read every contract artifact through `living_doc_core.readers`, which calls `living-doc-utilities`' `read_artifact`, and must write one only through `write_artifact` (R12 check 2).
46
47
- Must run `living_doc_core.input_validation.validate_inputs` over a command's inputs before it transforms them.
47
-
- Must select a view's records only through `living_doc_core.views.select_records`, and Must keep each command's lineage table in its own service package, checked by `assert_complete` in its tests and never at run time.
48
+
- Must select view records only through `living_doc_core.views.select_records`, and Must keep each command's lineage table in its own service package, checked by `assert_complete` in its tests and never at run time; `normalize-tests` has no view input and always writes `document.view` as `inner`.
48
49
- Must declare the toolkit's one version in every package, and Must read `metadata.producer.version` from the installed `living-doc-core`, never from a literal.
49
50
50
51
Inputs — the action's inputs (full reference in [`README.md`](../README.md#inputs)):
@@ -65,7 +66,7 @@ Contract-sensitive outputs:
65
66
QA commands — the per-package `Makefile` targets (`.github/workflows/test.yml` runs the same targets):
66
67
67
68
- Full gate, every package: `make qa` (runs `format-check` → `lint` → `types` → `deptry` → `test` per package, then the root checks, then `no-vendored-schemas`, failing on the first).
68
-
- Per package: `make qa-<alias>` where `<alias>` is one of `core`, `normalize-docs`, `cli`.
69
+
- Per package: `make qa-<alias>` where `<alias>` is one of `core`, `normalize-docs`, `normalize-tests`, `cli`.
-`lint-<alias>` runs ruff (`E` / `F` / `I` / `B`, `tests` excluded per each package's `[tool.ruff]`) then Pylint; `format-<alias>` runs `ruff check --fix` then Black.
71
72
- Must not use repo-root `pylint $(git ls-files '*.py')` / `pytest tests/` as the QA command — CI gates changes per package from inside each package directory.
0 commit comments