register_contracts
Extract per-method contract blocks from test files and register them in the UTF registry, enabling contract detail cards in generate_report outputs.
Instructions
Parse test files and register per-method 8-section contract records.
This is the UTF registration bridge — it reads LLM-written test files, extracts the per-method 8-section comment blocks, and upserts status=generated rows into the UTF registry. Without this step, generate_report has no Per-Test Contract Detail cards.
IMPORTANT — Phase 1, Step ③ of the UTF 3-phase workflow: ① generate_tests (scaffold) ② Write real test methods with per-method TC-{PRJ}-{MODULE}-{NNN} blocks ③ register_contracts ← this tool ④ generate_report (verify contract detail cards) ⑤ pytest --junit-xml=... ⑥ import_test_results ⑦ generate_report (now shows both contract cards AND execution results)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| language | No | One of python|typescript|java|go|... Default: python | python |
| framework | No | One of pytest|jest|junit5|... Default: pytest | pytest |
| test_type | No | One of unit|integration|api|e2e|... Default: e2e | e2e |
| project_id | No | Registry project label. Defaults to project_dir basename. | |
| test_files | Yes | List of test file paths (absolute or relative to project_dir). | |
| project_dir | No | Absolute path to project root (.utf/utf.db lives here). Defaults to UTF_PROJECT_DIR env var or cwd. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||