cli-usereq 0.71.0__tar.gz → 0.72.0__tar.gz

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.
Files changed (66) hide show
  1. {cli_usereq-0.71.0/src/cli_usereq.egg-info → cli_usereq-0.72.0}/PKG-INFO +2 -2
  2. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/README.md +1 -1
  3. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/pyproject.toml +2 -2
  4. {cli_usereq-0.71.0 → cli_usereq-0.72.0/src/cli_usereq.egg-info}/PKG-INFO +2 -2
  5. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/cli_usereq.egg-info/SOURCES.txt +4 -3
  6. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/__init__.py +1 -1
  7. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/cli.py +10 -8
  8. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/analyze.md +2 -2
  9. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/change.md +15 -15
  10. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/check.md +2 -2
  11. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/cover.md +15 -15
  12. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/create.md +1 -1
  13. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/fix.md +15 -15
  14. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/flowchart.md +11 -11
  15. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/implement.md +13 -13
  16. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/new.md +14 -14
  17. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/readme.md +11 -11
  18. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/recreate.md +11 -11
  19. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/refactor.md +15 -15
  20. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/references.md +10 -10
  21. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/renumber.md +10 -10
  22. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/workflow.md +11 -11
  23. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/resources/prompts/write.md +1 -1
  24. cli_usereq-0.72.0/src/usereq/resources/prompts-version.txt +1 -0
  25. cli_usereq-0.72.0/src/usereq/resources/templates/Agentic_Text_Authoring_Guidance.md +214 -0
  26. {cli_usereq-0.71.0/src/usereq/resources/docs → cli_usereq-0.72.0/src/usereq/resources/templates}/Document_Source_Code_in_Doxygen_Style.md +19 -0
  27. {cli_usereq-0.71.0/src/usereq/resources/docs → cli_usereq-0.72.0/src/usereq/resources/templates}/Requirements_Template.md +2 -22
  28. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_cli.py +36 -1
  29. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_dependency_manifests.py +1 -1
  30. cli_usereq-0.71.0/src/usereq/resources/prompts-version.txt +0 -1
  31. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/LICENSE +0 -0
  32. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/setup.cfg +0 -0
  33. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/cli_usereq.egg-info/dependency_links.txt +0 -0
  34. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/cli_usereq.egg-info/entry_points.txt +0 -0
  35. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/cli_usereq.egg-info/requires.txt +0 -0
  36. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/cli_usereq.egg-info/top_level.txt +0 -0
  37. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/__main__.py +0 -0
  38. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/compress.py +0 -0
  39. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/compress_files.py +0 -0
  40. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/doxygen_parser.py +0 -0
  41. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/find_constructs.py +0 -0
  42. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/generate_markdown.py +0 -0
  43. {cli_usereq-0.71.0/src/usereq/resources/docs → cli_usereq-0.72.0/src/usereq/resources/templates}/HDT_Test_Authoring_Guide.md +0 -0
  44. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/source_analyzer.py +0 -0
  45. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/static_check.py +0 -0
  46. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/src/usereq/token_counter.py +0 -0
  47. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_analyzer_cli.py +0 -0
  48. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_analyzer_comments.py +0 -0
  49. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_analyzer_core.py +0 -0
  50. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_analyzer_errors.py +0 -0
  51. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_analyzer_format.py +0 -0
  52. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_analyzer_helpers.py +0 -0
  53. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_compress.py +0 -0
  54. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_doxygen_parser.py +0 -0
  55. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_files_commands.py +0 -0
  56. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_find_constructs.py +0 -0
  57. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_find_constructs_comprehensive.py +0 -0
  58. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_generate_markdown.py +0 -0
  59. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_helpers.py +0 -0
  60. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_import_isolation.py +0 -0
  61. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_pre_release_check.py +0 -0
  62. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_release_workflow.py +0 -0
  63. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_source_analyzer.py +0 -0
  64. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_static_check.py +0 -0
  65. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_token_counter.py +0 -0
  66. {cli_usereq-0.71.0 → cli_usereq-0.72.0}/tests/test_update_check.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cli-usereq
3
- Version: 0.71.0
3
+ Version: 0.72.0
4
4
  Summary: Initialize a project with prompts, agents, and templates from the useReq repository.
5
5
  Author: Ogekuri
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -709,7 +709,7 @@ Dynamic: license-file
709
709
  > * **No Support or Feature Requests:** Please **do not** open issues, bug reports, or feature requests. They will not be addressed or accepted at this stage of development.
710
710
  > * **No Warranty:** This software is provided **"AS IS"**, without warranty of any kind, express or implied. You may use it strictly for **testing and evaluation purposes** at your own sole risk.
711
711
 
712
- # useReq / req (0.71.0)
712
+ # useReq / req (0.72.0)
713
713
 
714
714
  <p align="center">
715
715
  <img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+">
@@ -10,7 +10,7 @@
10
10
  > * **No Support or Feature Requests:** Please **do not** open issues, bug reports, or feature requests. They will not be addressed or accepted at this stage of development.
11
11
  > * **No Warranty:** This software is provided **"AS IS"**, without warranty of any kind, express or implied. You may use it strictly for **testing and evaluation purposes** at your own sole risk.
12
12
 
13
- # useReq / req (0.71.0)
13
+ # useReq / req (0.72.0)
14
14
 
15
15
  <p align="center">
16
16
  <img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+">
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cli-usereq"
7
- version = "0.71.0"
7
+ version = "0.72.0"
8
8
  description = "Initialize a project with prompts, agents, and templates from the useReq repository."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -45,7 +45,7 @@ include-package-data = true
45
45
  [tool.setuptools.package-data]
46
46
  usereq = [
47
47
  "resources/prompts/*.md",
48
- "resources/docs/*.md",
48
+ "resources/templates/*.md",
49
49
  "resources/prompts-version.txt",
50
50
  ]
51
51
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cli-usereq
3
- Version: 0.71.0
3
+ Version: 0.72.0
4
4
  Summary: Initialize a project with prompts, agents, and templates from the useReq repository.
5
5
  Author: Ogekuri
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -709,7 +709,7 @@ Dynamic: license-file
709
709
  > * **No Support or Feature Requests:** Please **do not** open issues, bug reports, or feature requests. They will not be addressed or accepted at this stage of development.
710
710
  > * **No Warranty:** This software is provided **"AS IS"**, without warranty of any kind, express or implied. You may use it strictly for **testing and evaluation purposes** at your own sole risk.
711
711
 
712
- # useReq / req (0.71.0)
712
+ # useReq / req (0.72.0)
713
713
 
714
714
  <p align="center">
715
715
  <img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python 3.11+">
@@ -19,9 +19,6 @@ src/usereq/source_analyzer.py
19
19
  src/usereq/static_check.py
20
20
  src/usereq/token_counter.py
21
21
  src/usereq/resources/prompts-version.txt
22
- src/usereq/resources/docs/Document_Source_Code_in_Doxygen_Style.md
23
- src/usereq/resources/docs/HDT_Test_Authoring_Guide.md
24
- src/usereq/resources/docs/Requirements_Template.md
25
22
  src/usereq/resources/prompts/analyze.md
26
23
  src/usereq/resources/prompts/change.md
27
24
  src/usereq/resources/prompts/check.md
@@ -38,6 +35,10 @@ src/usereq/resources/prompts/references.md
38
35
  src/usereq/resources/prompts/renumber.md
39
36
  src/usereq/resources/prompts/workflow.md
40
37
  src/usereq/resources/prompts/write.md
38
+ src/usereq/resources/templates/Agentic_Text_Authoring_Guidance.md
39
+ src/usereq/resources/templates/Document_Source_Code_in_Doxygen_Style.md
40
+ src/usereq/resources/templates/HDT_Test_Authoring_Guide.md
41
+ src/usereq/resources/templates/Requirements_Template.md
41
42
  tests/test_analyzer_cli.py
42
43
  tests/test_analyzer_comments.py
43
44
  tests/test_analyzer_core.py
@@ -18,7 +18,7 @@ from . import source_analyzer # usereq.source_analyzer submodule
18
18
  from . import token_counter # usereq.token_counter submodule
19
19
  from typing import Any
20
20
 
21
- __version__ = "0.71.0"
21
+ __version__ = "0.72.0"
22
22
  """! @brief Semantic version string of the package."""
23
23
 
24
24
 
@@ -2606,37 +2606,39 @@ def yaml_double_quote_escape(value: str) -> str:
2606
2606
 
2607
2607
  def list_docs_templates() -> list[Path]:
2608
2608
  """!
2609
- @brief Returns non-hidden files available in resources/docs.
2610
- @return Sorted list of file paths under resources/docs.
2611
- @throws ReqError If resources/docs does not exist or has no non-hidden files.
2609
+ @brief Returns non-hidden files available in resources/templates.
2610
+ @return Sorted list of file paths under resources/templates.
2611
+ @throws ReqError If resources/templates does not exist or has no non-hidden files.
2612
2612
  @details Implements the list_docs_templates function behavior with deterministic control flow.
2613
+ @satisfies SRS-495
2613
2614
  """
2614
- candidate = RESOURCE_ROOT / "docs"
2615
+ candidate = RESOURCE_ROOT / "templates"
2615
2616
  if not candidate.is_dir():
2616
- raise ReqError("Error: no docs templates directory found in resources", 9)
2617
+ raise ReqError("Error: no templates directory found in resources", 9)
2617
2618
  templates = sorted(
2618
2619
  path
2619
2620
  for path in candidate.iterdir()
2620
2621
  if path.is_file() and not path.name.startswith(".")
2621
2622
  )
2622
2623
  if not templates:
2623
- raise ReqError("Error: no docs templates found in resources/docs", 9)
2624
+ raise ReqError("Error: no templates found in resources/templates", 9)
2624
2625
  return templates
2625
2626
 
2626
2627
 
2627
2628
  def find_requirements_template(docs_templates: list[Path]) -> Path:
2628
2629
  """!
2629
2630
  @brief Returns the packaged Requirements template file.
2630
- @param docs_templates Runtime docs template file list from resources/docs.
2631
+ @param docs_templates Runtime template file list from resources/templates.
2631
2632
  @return Path to `Requirements_Template.md`.
2632
2633
  @throws ReqError If `Requirements_Template.md` is not present.
2633
2634
  @details Implements the find_requirements_template function behavior with deterministic control flow.
2635
+ @satisfies SRS-495
2634
2636
  """
2635
2637
  for template_path in docs_templates:
2636
2638
  if template_path.name == REQUIREMENTS_TEMPLATE_NAME:
2637
2639
  return template_path
2638
2640
  raise ReqError(
2639
- f"Error: no {REQUIREMENTS_TEMPLATE_NAME} template found in docs",
2641
+ f"Error: no {REQUIREMENTS_TEMPLATE_NAME} template found in templates",
2640
2642
  9,
2641
2643
  )
2642
2644
 
@@ -125,7 +125,7 @@ Add --enable-line-numbers (code lines prefixed as `<n>:`):
125
125
  - `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --enable-line-numbers files-find "<TAG_FILTER>" "<NAME_REGEX>" <FILE...>`
126
126
  #### TAGs and filters
127
127
  - TAG_FILTER: pipe-separated, case-insensitive (e.g., `CLASS|FUNCTION|IMPORT`).
128
- - Tags are language-dependent; unsupported tags are ignored. Run `req -h` for supported TAGs per language.
128
+ - Tags are language-dependent; the per-language tag catalog is printed on invalid TAG or non-matching filter errors. Run `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --help` for the full usage surface.
129
129
  - Broad cross-language TAG_FILTER: `CLASS|STRUCT|ENUM|INTERFACE|TRAIT|IMPL|FUNCTION|METHOD|MODULE|NAMESPACE|TYPE_ALIAS|TYPEDEF|IMPORT|CONSTANT|VARIABLE|MACRO|DECORATOR|COMPONENT|PROPERTY|PROTOCOL|EXTENSION|UNION`
130
130
  #### Regex rules (NAME_REGEX)
131
131
  - Regex matching follows `re.search()` semantics against construct names (tool behavior, independent of repository language).
@@ -185,7 +185,7 @@ After successful pre-flight resolution, create internally a *check-list* for the
185
185
  - Generating this request text is a read-only output action; do not apply any fix, patch, or repository modification.
186
186
  - Include the generated request text verbatim under `## Next Workflow` in the Step 4 report.
187
187
  4. Present the analysis report
188
- - PRINT, in the response, the final analysis report for a human reader using clear, easily understandable sentences and readable Markdown formatting that highlight key findings, file paths, and concise evidence. Use the fixed report schema: ## **Outcome**, ## **Requirement Delta**, ## **Design Delta**, ## **Implementation Delta**, ## **Verification Delta**, ## **Evidence**, ## **Assumptions**, ## **Next Workflow**. Final line MUST be exactly: STATUS: OK or STATUS: ERROR.
188
+ - PRINT, in the response, the final analysis report for a human reader using clear, easily understandable sentences and readable Markdown formatting that highlight key findings, file paths, and concise evidence. PRINT first a ## **Summary** section containing a synthetic summary (at most 1024 UTF-8 characters) of the entire final output, then the verbose report using the fixed report schema: ## **Outcome**, ## **Requirement Delta**, ## **Design Delta**, ## **Implementation Delta**, ## **Verification Delta**, ## **Evidence**, ## **Assumptions**, ## **Next Workflow**. Final line MUST be exactly: STATUS: OK or STATUS: ERROR.
189
189
 
190
190
  <h2 id="users-request">User's Request</h2>
191
191
  %%ARGS%%
@@ -54,13 +54,13 @@ In scope: patch-style edits to `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md`, an i
54
54
 
55
55
  ## Pre-requisite: Execution Context
56
56
  - **CRITICAL**: All information declared in this `Pre-requisite: Execution Context` section MUST remain continuously available in the active execution context for the entire workflow and MUST NEVER be dropped, forgotten, or overwritten.
57
- - Generate <WORKTREE_NAME> with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-name`, retain the literal result for later steps, and use simple sequential execution with only linear shell commands compatible with restrictive filtering systems for all worktree operations in this workflow.
57
+ - Generate {{WORKTREE_NAME}} with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-name`, retain the literal result for later steps, and use simple sequential execution with only linear shell commands compatible with restrictive filtering systems for all worktree operations in this workflow.
58
58
 
59
59
 
60
60
  ## Absolute Rules, Non-Negotiable
61
61
  - **CRITICAL**: When instructions generate shell commands, they MUST generate only linear shell commands compatible with restrictive filtering systems, MUST verify and apply correct quoting, escaping, or option termination for literal arguments that could be parsed as options or flags, MUST use explicit option termination for `rg` and `git grep` patterns beginning with `-` or `--`, MUST NOT rely on quoting or backslash escaping alone for those patterns, and MUST NOT use command substitution (`$()` or backticks), complex variable expansion, nested substitution, shell-derived helper composition, nested shell logic, or nested pipelines.
62
62
  - **CRITICAL**: Every `req` invocation MUST carry the mandatory parameters `--prj-base={{PRJ_BASE}}` and `--git-base={{GIT_BASE}}` with the resolved values; the removed `--base` parameter MUST NOT be used.
63
- - **CRITICAL**: NEVER write, modify, edit, or delete files outside of the active git worktree directory, except under `/tmp`, and except for worktree operations executed through `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-create <WORKTREE_NAME>` and `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`.
63
+ - **CRITICAL**: NEVER write, modify, edit, or delete files outside of the active git worktree directory, except under `/tmp`, and except for worktree operations executed through `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-create {{WORKTREE_NAME}}` and `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`.
64
64
  - You can read, write, or edit `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md`.
65
65
  - Treat static analysis as safe. Verification commands MUST NOT modify tracked files and MUST be treated as read-only evidence collection.
66
66
  - **CRITICAL**: GIT operations and GIT rules:
@@ -139,7 +139,7 @@ Add --enable-line-numbers (code lines prefixed as `<n>:`):
139
139
  - `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --enable-line-numbers files-find "<TAG_FILTER>" "<NAME_REGEX>" <FILE...>`
140
140
  #### TAGs and filters
141
141
  - TAG_FILTER: pipe-separated, case-insensitive (e.g., `CLASS|FUNCTION|IMPORT`).
142
- - Tags are language-dependent; unsupported tags are ignored. Run `req -h` for supported TAGs per language.
142
+ - Tags are language-dependent; the per-language tag catalog is printed on invalid TAG or non-matching filter errors. Run `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --help` for the full usage surface.
143
143
  - Broad cross-language TAG_FILTER: `CLASS|STRUCT|ENUM|INTERFACE|TRAIT|IMPL|FUNCTION|METHOD|MODULE|NAMESPACE|TYPE_ALIAS|TYPEDEF|IMPORT|CONSTANT|VARIABLE|MACRO|DECORATOR|COMPONENT|PROPERTY|PROTOCOL|EXTENSION|UNION`
144
144
  #### Regex rules (NAME_REGEX)
145
145
  - Regex matching follows `re.search()` semantics against construct names (tool behavior, independent of repository language).
@@ -188,10 +188,10 @@ After successful pre-flight resolution, create internally a *check-list* for the
188
188
  2. **CRITICAL**: Check `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md`, `{{PRJ_BASE}}/%%DOC_PATH%%/WORKFLOW.md` and `{{PRJ_BASE}}/%%DOC_PATH%%/REFERENCES.md` file presence
189
189
  - Check required docs presence with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --docs-check`. If the command returns an error code or prints any text containing "ERROR", OUTPUT exactly "ERROR: Required docs check failed!", and then terminate the execution.
190
190
  3. **CRITICAL**: Worktree Generation & Isolation
191
- - Bind <BASE_PATH> to the resolved `{{PRJ_BASE}}` and <GIT_PATH> to the resolved `{{GIT_BASE}}`, and generate <WORKTREE_NAME> with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-name` using literal `req` commands executed sequentially without shell composition.
192
- - Create the dedicated isolated worktree with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-create <WORKTREE_NAME>`, then execute `cd <GIT_PATH>/../<WORKTREE_NAME>` before proceeding to the next step.
191
+ - Generate {{WORKTREE_NAME}} with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-name` using literal `req` commands executed sequentially without shell composition.
192
+ - Create the dedicated isolated worktree with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-create {{WORKTREE_NAME}}`, then execute `cd {{GIT_BASE}}/../{{WORKTREE_NAME}}` before proceeding to the next step.
193
193
  - If the command returns an error code or prints any text containing "ERROR", OUTPUT exactly "ERROR: Worktree generation failed!", and then terminate the execution.
194
- - After successful worktree creation and directory change, apply the pre-flight context-transition rules before the next project operation. If rebinding fails, OUTPUT exactly "ERROR: Unable to resolve context keywords!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution. Apply this same failure cleanup to later context-resolution failures before merge-phase cleanup.
194
+ - After successful worktree creation and directory change, apply the pre-flight context-transition rules before the next project operation. If rebinding fails, OUTPUT exactly "ERROR: Unable to resolve context keywords!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution. Apply this same failure cleanup to later context-resolution failures before merge-phase cleanup.
195
195
 
196
196
  4. Generate and apply the **Requirement Delta** to change requirements
197
197
  - Using [User Request](#users-request) as a semantic guide, extract only directly related information from `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md` (prioritize precision over recall) to determine the minimal requirements changes, then integrate any new requirements from [User Request](#users-request), then GENERATE a detailed **Requirement Delta** documenting only the exact modifications needed. Provide patch-style ‘Before → After’ blocks for each change, quoting only the changed text (no full-document rewrites):
@@ -210,7 +210,7 @@ After successful pre-flight resolution, create internally a *check-list* for the
210
210
  - Locate existing unit tests in {{PRJ_BASE}}/%%TEST_PATH%% that map to touched modules and requirement IDs; define in the **Implementation Delta** which suites will run during verification using language-specific test-suite priority policy, and treat verification tests as N/A when no relevant unit tests exist.
211
211
  - **CRITICAL**: All tests MUST implement these instructions: `.req/docs/HDT_Test_Authoring_Guide.md`.
212
212
  - Read %%GUIDELINES_FILES%% files and apply those **guidelines**; ensure the proposed code changes conform to those **guidelines**, and adjust the **Implementation Delta** if needed. Do not apply unrelated **guidelines**.
213
- - If a migration/compatibility need is discovered but not specified in requirements, propose a requirements update describing it, then OUTPUT exactly "ERROR: Change request failed due to incompatible requirements!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution.
213
+ - If a migration/compatibility need is discovered but not specified in requirements, propose a requirements update describing it, then OUTPUT exactly "ERROR: Change request failed due to incompatible requirements!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution.
214
214
  - IMPLEMENT the **Implementation Delta** in the source code (creating new files/directories if necessary). You may make minimal mechanical adjustments needed to fit the actual codebase (file paths, symbol names), but you MUST NOT add new features or scope beyond the **Implementation Delta**.
215
215
  6. Generate **Verification Delta** by verifying static-analysis results and implementing needed bug fixes
216
216
  - Read `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md` and cross-reference with the source code from {{PRJ_BASE}}/%%SRC_PATHS%%, {{PRJ_BASE}}/%%TEST_PATH%% to check ALL requirements, but use progressive disclosure: provide full evidence only for `FAIL` items and a compact pointer-only index for `OK` items. For each requirement, use tools (e.g., `git grep`, `find`, `ls`) to locate the relevant source code files used as evidence, read only the identified files to verify compliance and do not assume compliance without locating the specific code implementation.
@@ -226,9 +226,9 @@ After successful pre-flight resolution, create internally a *check-list* for the
226
226
  - If static analysis reports issues or executed unit tests fail, analyze whether they are caused by source defects or requirement-implementation mismatch. Do NOT modify tests in this repository. When static analysis reports an issue, verify whether it aligns with updated requirements.
227
227
  - IF YES: adjust the source implementation to satisfy updated requirement intent.
228
228
  - IF NO: treat it as a regression and fix the source code.
229
- - Fix the source code to resolve valid verification findings autonomously without asking for user intervention. Execute a strict fix loop: 1) analyze static-check output and unit-test failures (when tests ran), 2) determine root cause from evidence, 3) fix code, 4) re-run `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} static-check` and re-run the selected unit-test suites when applicable. Repeat up to 2 times. If static analysis still reports issues after the second attempt, report the failure, OUTPUT exactly "ERROR: Change request failed due to inability to complete static analysis!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution.
230
- - Unit-test completion gate: if any executed unit test still fails after the second fix-loop attempt, report the residual failing tests in the Verification Delta report section, OUTPUT exactly "ERROR: Change request failed due to persistent unit-test failures!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution without committing or merging.
231
- - Limitations: Do not introduce new features or change the architecture logic during this fix phase. If a fix requires substantial refactoring or requirements changes, report the failure, then OUTPUT exactly "ERROR: Change request failed due to requirements incompatible with static-analysis constraints!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution.
229
+ - Fix the source code to resolve valid verification findings autonomously without asking for user intervention. Execute a strict fix loop: 1) analyze static-check output and unit-test failures (when tests ran), 2) determine root cause from evidence, 3) fix code, 4) re-run `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} static-check` and re-run the selected unit-test suites when applicable. Repeat up to 2 times. If static analysis still reports issues after the second attempt, report the failure, OUTPUT exactly "ERROR: Change request failed due to inability to complete static analysis!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution.
230
+ - Unit-test completion gate: if any executed unit test still fails after the second fix-loop attempt, report the residual failing tests in the Verification Delta report section, OUTPUT exactly "ERROR: Change request failed due to persistent unit-test failures!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution without committing or merging.
231
+ - Limitations: Do not introduce new features or change the architecture logic during this fix phase. If a fix requires substantial refactoring or requirements changes, report the failure, then OUTPUT exactly "ERROR: Change request failed due to requirements incompatible with static-analysis constraints!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution.
232
232
  - Do NOT create or modify tests in this repository.
233
233
  7. Update `{{PRJ_BASE}}/%%DOC_PATH%%/WORKFLOW.md` via targeted edits using the canonical WORKFLOW.md contract (same terminology, same schema, same call-trace rules) and declaration file paths only, excluding line numbers, line ranges, and internal file-reference pointers.
234
234
  - Update `{{PRJ_BASE}}/%%DOC_PATH%%/WORKFLOW.md` as an LLM-first runtime model (English only) using a TARGETED EDIT policy.
@@ -260,7 +260,7 @@ After successful pre-flight resolution, create internally a *check-list* for the
260
260
  9. **CRITICAL**: Stage & commit
261
261
  - Show a summary of changes with `git diff` and `git diff --stat`.
262
262
  - Stage changes explicitly (prefer targeted add; avoid `git add -A` if it may include unintended files): `git add <file...>` (ensure to include all modified source code & test, `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md` and WORKFLOW.md only if it was modified/created).
263
- - Ensure there is something to commit with: `git diff --cached --quiet && echo "Nothing to commit. Aborting."`. If command output contains "Aborting", OUTPUT exactly "No changes to commit.", and then delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution.
263
+ - Ensure there is something to commit with: `git diff --cached --quiet && echo "Nothing to commit. Aborting."`. If command output contains "Aborting", OUTPUT exactly "No changes to commit.", and then delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution.
264
264
  - Commit a structured commit message with: `git commit -m "change(<COMPONENT>)<BREAKING>: <DESCRIPTION> [useReq]"`
265
265
  - Set `<COMPONENT>` to the most specific component, module, or function affected. If multiple areas are touched, choose the primary one. If you cannot identify a unique component, use `core`.
266
266
  - Set `<DESCRIPTION>` to a short, clear summary in **English language** of what changed, including (when applicable) updates to: requirements/specs, source code, tests. Use present tense, avoid vague wording, and keep it under ~80 characters if possible.
@@ -270,12 +270,12 @@ After successful pre-flight resolution, create internally a *check-list* for the
270
270
  - Confirm the repo is clean with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-check`. If the command returns an error code or prints any text containing "ERROR", override the final line with EXACTLY "WARNING: Change request completed with unclean git repository!".
271
271
  10. **CRITICAL**: Merge Conflict Management
272
272
  - Return to the original repository directory (the sibling directory of the worktree).
273
- - Ensure you are on the original branch used before worktree creation by executing `cd <BASE_PATH>` with the retained pre-worktree base if needed.
274
- - Merge the isolated branch into the original branch: `git merge <WORKTREE_NAME>`
275
- - If the merge completes successfully, delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`; if the command returns an error code or prints any text containing "ERROR", OUTPUT exactly "ERROR: Worktree cleanup verification failed!", and then terminate the execution.
273
+ - Ensure you are on the original branch used before worktree creation by executing `cd {{PRJ_BASE}}` with the retained pre-worktree base if needed.
274
+ - Merge the isolated branch into the original branch: `git merge {{WORKTREE_NAME}}`
275
+ - If the merge completes successfully, delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`; if the command returns an error code or prints any text containing "ERROR", OUTPUT exactly "ERROR: Worktree cleanup verification failed!", and then terminate the execution.
276
276
  - If the merge fails or results in conflicts, do NOT remove the worktree directory and override the final line with EXACTLY "WARNING: Change request completed with merge conflicting!".
277
277
  11. Present results
278
- - PRINT, in the response, the results for a human reader using clear, easily understandable sentences and readable Markdown formatting that highlight key findings, file paths, and concise evidence. Use the fixed report schema: ## **Outcome**, ## **Requirement Delta**, ## **Design Delta**, ## **Implementation Delta**, ## **Verification Delta**, ## **Evidence**, ## **Assumptions**, ## **Next Workflow**. Final line MUST be exactly: STATUS: OK or STATUS: ERROR.
278
+ - PRINT, in the response, the results for a human reader using clear, easily understandable sentences and readable Markdown formatting that highlight key findings, file paths, and concise evidence. PRINT first a ## **Summary** section containing a synthetic summary (at most 1024 UTF-8 characters) of the entire final output, then the verbose report using the fixed report schema: ## **Outcome**, ## **Requirement Delta**, ## **Design Delta**, ## **Implementation Delta**, ## **Verification Delta**, ## **Evidence**, ## **Assumptions**, ## **Next Workflow**. Final line MUST be exactly: STATUS: OK or STATUS: ERROR.
279
279
 
280
280
  <h2 id="users-request">User's Request</h2>
281
281
  %%ARGS%%
@@ -124,7 +124,7 @@ Add --enable-line-numbers (code lines prefixed as `<n>:`):
124
124
  - `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --enable-line-numbers files-find "<TAG_FILTER>" "<NAME_REGEX>" <FILE...>`
125
125
  #### TAGs and filters
126
126
  - TAG_FILTER: pipe-separated, case-insensitive (e.g., `CLASS|FUNCTION|IMPORT`).
127
- - Tags are language-dependent; unsupported tags are ignored. Run `req -h` for supported TAGs per language.
127
+ - Tags are language-dependent; the per-language tag catalog is printed on invalid TAG or non-matching filter errors. Run `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --help` for the full usage surface.
128
128
  - Broad cross-language TAG_FILTER: `CLASS|STRUCT|ENUM|INTERFACE|TRAIT|IMPL|FUNCTION|METHOD|MODULE|NAMESPACE|TYPE_ALIAS|TYPEDEF|IMPORT|CONSTANT|VARIABLE|MACRO|DECORATOR|COMPONENT|PROPERTY|PROTOCOL|EXTENSION|UNION`
129
129
  #### Regex rules (NAME_REGEX)
130
130
  - Regex matching follows `re.search()` semantics against construct names (tool behavior, independent of repository language).
@@ -184,7 +184,7 @@ After successful pre-flight resolution, create internally a *check-list* for the
184
184
  - **CRITICAL**: If you propose new tests, they MUST implement these instructions: `.req/docs/HDT_Test_Authoring_Guide.md`.
185
185
  - Read %%GUIDELINES_FILES%% files and apply those **guidelines**; ensure the proposed code changes conform to those **guidelines**, and adjust the **Implementation Delta** if needed. Do not apply unrelated **guidelines**.
186
186
  3. Present results and **Implementation Delta**
187
- - PRINT, in the response, the results of the requirements check and the **Implementation Delta** for a human reader using clear, easily understandable sentences and readable Markdown formatting that highlight key findings, file paths, and concise evidence. Use the fixed report schema: ## **Outcome**, ## **Requirement Delta**, ## **Design Delta**, ## **Implementation Delta**, ## **Verification Delta**, ## **Evidence**, ## **Assumptions**, ## **Next Workflow**. Final line MUST be exactly: STATUS: OK or STATUS: ERROR.
187
+ - PRINT, in the response, the results of the requirements check and the **Implementation Delta** for a human reader using clear, easily understandable sentences and readable Markdown formatting that highlight key findings, file paths, and concise evidence. PRINT first a ## **Summary** section containing a synthetic summary (at most 1024 UTF-8 characters) of the entire final output, then the verbose report using the fixed report schema: ## **Outcome**, ## **Requirement Delta**, ## **Design Delta**, ## **Implementation Delta**, ## **Verification Delta**, ## **Evidence**, ## **Assumptions**, ## **Next Workflow**. Final line MUST be exactly: STATUS: OK or STATUS: ERROR.
188
188
 
189
189
  <h2 id="users-request">User's Request</h2>
190
190
  %%ARGS%%
@@ -55,13 +55,13 @@ In scope: identify uncovered requirement IDs, implement minimal code changes und
55
55
 
56
56
  ## Pre-requisite: Execution Context
57
57
  - **CRITICAL**: All information declared in this `Pre-requisite: Execution Context` section MUST remain continuously available in the active execution context for the entire workflow and MUST NEVER be dropped, forgotten, or overwritten.
58
- - Generate <WORKTREE_NAME> with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-name`, retain the literal result for later steps, and use simple sequential execution with only linear shell commands compatible with restrictive filtering systems for all worktree operations in this workflow.
58
+ - Generate {{WORKTREE_NAME}} with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-name`, retain the literal result for later steps, and use simple sequential execution with only linear shell commands compatible with restrictive filtering systems for all worktree operations in this workflow.
59
59
 
60
60
 
61
61
  ## Absolute Rules, Non-Negotiable
62
62
  - **CRITICAL**: When instructions generate shell commands, they MUST generate only linear shell commands compatible with restrictive filtering systems, MUST verify and apply correct quoting, escaping, or option termination for literal arguments that could be parsed as options or flags, MUST use explicit option termination for `rg` and `git grep` patterns beginning with `-` or `--`, MUST NOT rely on quoting or backslash escaping alone for those patterns, and MUST NOT use command substitution (`$()` or backticks), complex variable expansion, nested substitution, shell-derived helper composition, nested shell logic, or nested pipelines.
63
63
  - **CRITICAL**: Every `req` invocation MUST carry the mandatory parameters `--prj-base={{PRJ_BASE}}` and `--git-base={{GIT_BASE}}` with the resolved values; the removed `--base` parameter MUST NOT be used.
64
- - **CRITICAL**: NEVER write, modify, edit, or delete files outside of the active git worktree directory, except under `/tmp`, and except for worktree operations executed through `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-create <WORKTREE_NAME>` and `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`.
64
+ - **CRITICAL**: NEVER write, modify, edit, or delete files outside of the active git worktree directory, except under `/tmp`, and except for worktree operations executed through `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-create {{WORKTREE_NAME}}` and `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`.
65
65
  - You MUST read `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md`, but you MUST NOT modify it in this workflow.
66
66
  - Treat static analysis as safe. Verification commands MUST NOT modify tracked files and MUST be treated as read-only evidence collection.
67
67
  - **CRITICAL**: GIT operations and GIT rules:
@@ -139,7 +139,7 @@ Add --enable-line-numbers (code lines prefixed as `<n>:`):
139
139
  - `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --enable-line-numbers files-find "<TAG_FILTER>" "<NAME_REGEX>" <FILE...>`
140
140
  #### TAGs and filters
141
141
  - TAG_FILTER: pipe-separated, case-insensitive (e.g., `CLASS|FUNCTION|IMPORT`).
142
- - Tags are language-dependent; unsupported tags are ignored. Run `req -h` for supported TAGs per language.
142
+ - Tags are language-dependent; the per-language tag catalog is printed on invalid TAG or non-matching filter errors. Run `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --help` for the full usage surface.
143
143
  - Broad cross-language TAG_FILTER: `CLASS|STRUCT|ENUM|INTERFACE|TRAIT|IMPL|FUNCTION|METHOD|MODULE|NAMESPACE|TYPE_ALIAS|TYPEDEF|IMPORT|CONSTANT|VARIABLE|MACRO|DECORATOR|COMPONENT|PROPERTY|PROTOCOL|EXTENSION|UNION`
144
144
  #### Regex rules (NAME_REGEX)
145
145
  - Regex matching follows `re.search()` semantics against construct names (tool behavior, independent of repository language).
@@ -188,17 +188,17 @@ After successful pre-flight resolution, create internally a *check-list* for the
188
188
  2. **CRITICAL**: Check `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md`, `{{PRJ_BASE}}/%%DOC_PATH%%/WORKFLOW.md` and `{{PRJ_BASE}}/%%DOC_PATH%%/REFERENCES.md` file presence
189
189
  - Check required docs presence with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --docs-check`. If the command returns an error code or prints any text containing "ERROR", OUTPUT exactly "ERROR: Required docs check failed!", and then terminate the execution.
190
190
  3. **CRITICAL**: Worktree Generation & Isolation
191
- - Bind <BASE_PATH> to the resolved `{{PRJ_BASE}}` and <GIT_PATH> to the resolved `{{GIT_BASE}}`, and generate <WORKTREE_NAME> with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-name` using literal `req` commands executed sequentially without shell composition.
192
- - Create the dedicated isolated worktree with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-create <WORKTREE_NAME>`, then execute `cd <GIT_PATH>/../<WORKTREE_NAME>` before proceeding to the next step.
191
+ - Generate {{WORKTREE_NAME}} with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-name` using literal `req` commands executed sequentially without shell composition.
192
+ - Create the dedicated isolated worktree with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-create {{WORKTREE_NAME}}`, then execute `cd {{GIT_BASE}}/../{{WORKTREE_NAME}}` before proceeding to the next step.
193
193
  - If the command returns an error code or prints any text containing "ERROR", OUTPUT exactly "ERROR: Worktree generation failed!", and then terminate the execution.
194
- - After successful worktree creation and directory change, apply the pre-flight context-transition rules before the next project operation. If rebinding fails, OUTPUT exactly "ERROR: Unable to resolve context keywords!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution. Apply this same failure cleanup to later context-resolution failures before merge-phase cleanup.
194
+ - After successful worktree creation and directory change, apply the pre-flight context-transition rules before the next project operation. If rebinding fails, OUTPUT exactly "ERROR: Unable to resolve context keywords!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution. Apply this same failure cleanup to later context-resolution failures before merge-phase cleanup.
195
195
 
196
196
  4. Check requirements coverage, generate **Design Delta** and implement the **Implementation Delta** to cover uncovered requirements
197
197
  - Read `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md` and cross-reference with the source code from {{PRJ_BASE}}/%%SRC_PATHS%%, {{PRJ_BASE}}/%%TEST_PATH%% to check ALL requirements, but use progressive disclosure: provide full evidence only for `FAIL` items and a compact pointer-only index for `OK` items. For each requirement, use tools (e.g., `git grep`, `find`, `ls`) to locate the relevant source code files used as evidence, read only the identified files to verify compliance and do not assume compliance without locating the specific code implementation.
198
198
  - For each requirement, report `OK` if satisfied or `FAIL` if not.
199
199
  - Do not mark a requirement as `OK` without code evidence; for `OK` items provide only a compact pointer (file path + symbol + line range). For each requirement, provide a concise evidence pointer (file path + symbol + line range) excerpts only for `FAIL` requirements or when requirement is architectural, structural, or negative (e.g., "MUST NOT ..."). For such high-level requirements, cite the specific file paths or directory structures that prove compliance. Line ranges MUST be obtained from tooling output (e.g., `nl -ba` / `sed -n`) and MUST NOT be estimated. If evidence is missing, you MUST report `FAIL`. Do not assume implicit behavior.
200
200
  - For every `FAIL`, provide evidence with a short explanation. Provide file path(s) and line numbers where possible.
201
- - **CRITICAL**: If all requirements report `OK`, OUTPUT exactly "All requirements are already covered. No changes needed.", and then delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution.
201
+ - **CRITICAL**: If all requirements report `OK`, OUTPUT exactly "All requirements are already covered. No changes needed.", and then delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution.
202
202
  - If there are uncovered requirements, using uncovered requirements from `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md` and [User Request](#users-request) as a semantic guide, extract all information from `{{PRJ_BASE}}/%%DOC_PATH%%/WORKFLOW.md` that is directly or even tangentially related, prioritizing high recall to capture every relevant nuance and borderline connection, to identify the most likely related files and functions based on explicit evidence, and treat any uncertain links as candidates without claiming completeness, then analyze the involved source code from {{PRJ_BASE}}/%%SRC_PATHS%% and GENERATE a detailed **Implementation Delta** documenting the exact modifications to the source code that will cover all `FAIL` requirements. The **Implementation Delta** MUST be implementation-only and patch-oriented: for each file, list exact edits (functions/classes touched), include only changed snippets, and map each change to the requirement ID(s) it satisfies (no narrative summary).
203
203
  - **ENFORCEMENT**: The definition of "valid code" strictly includes its documentation. You are mandatorily required to apply the Doxygen-LLM Standard defined in `.req/docs/Document_Source_Code_in_Doxygen_Style.md` to every single code component. Any code block generated without this specific documentation format is considered a compilation error and must be rejected/regenerated.
204
204
  - Read %%GUIDELINES_FILES%% files and apply those **guidelines**; ensure the proposed code changes conform to those **guidelines**, and adjust the **Implementation Delta** if needed. Do not apply unrelated **guidelines**.
@@ -218,9 +218,9 @@ After successful pre-flight resolution, create internally a *check-list* for the
218
218
  - Record each executed suite outcome in the Verification Delta report section: suite command, pass or fail result, and failing test identifiers with failure evidence; record N/A only when no relevant unit tests exist.
219
219
  - Verify that the implemented changes satisfy requirements evidence, static-analysis output, and unit-test outputs when tests are executed.
220
220
  - If static analysis reports issues or executed unit tests fail, determine whether they are caused by source defects or requirement-implementation mismatch. Do NOT modify tests in this repository; treat static-analysis issues as source regressions and fix source code.
221
- - Fix the source code to resolve valid verification findings autonomously without asking for user intervention. Execute a strict fix loop: 1) analyze static-check output and unit-test failures (when tests ran), 2) determine root cause from evidence, 3) fix code, 4) re-run `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} static-check` and re-run the selected unit-test suites when applicable. Repeat up to 2 times. If static analysis still reports issues after the second attempt, report the failure, OUTPUT exactly "ERROR: Requirements coverage failed due to inability to complete static analysis!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution.
222
- - Unit-test completion gate: if any executed unit test still fails after the second fix-loop attempt, report the residual failing tests in the Verification Delta report section, OUTPUT exactly "ERROR: Requirements coverage failed due to persistent unit-test failures!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution without committing or merging.
223
- - Limitations: Do not introduce new features or change the architecture logic during this fix phase; if a fix requires substantial refactoring or requirements changes, report the failure, then OUTPUT exactly "ERROR: Requirements coverage failed due to requirements incompatible with static-analysis constraints!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution.
221
+ - Fix the source code to resolve valid verification findings autonomously without asking for user intervention. Execute a strict fix loop: 1) analyze static-check output and unit-test failures (when tests ran), 2) determine root cause from evidence, 3) fix code, 4) re-run `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} static-check` and re-run the selected unit-test suites when applicable. Repeat up to 2 times. If static analysis still reports issues after the second attempt, report the failure, OUTPUT exactly "ERROR: Requirements coverage failed due to inability to complete static analysis!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution.
222
+ - Unit-test completion gate: if any executed unit test still fails after the second fix-loop attempt, report the residual failing tests in the Verification Delta report section, OUTPUT exactly "ERROR: Requirements coverage failed due to persistent unit-test failures!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution without committing or merging.
223
+ - Limitations: Do not introduce new features or change the architecture logic during this fix phase; if a fix requires substantial refactoring or requirements changes, report the failure, then OUTPUT exactly "ERROR: Requirements coverage failed due to requirements incompatible with static-analysis constraints!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution.
224
224
  - Do NOT create or modify tests in this repository.
225
225
  6. Update `{{PRJ_BASE}}/%%DOC_PATH%%/WORKFLOW.md` via targeted edits using the canonical WORKFLOW.md contract (same terminology, same schema, same call-trace rules) and declaration file paths only, excluding line numbers, line ranges, and internal file-reference pointers.
226
226
  - Update `{{PRJ_BASE}}/%%DOC_PATH%%/WORKFLOW.md` as an LLM-first runtime model (English only) using a TARGETED EDIT policy.
@@ -252,7 +252,7 @@ After successful pre-flight resolution, create internally a *check-list* for the
252
252
  8. **CRITICAL**: Stage & commit
253
253
  - Show a summary of changes with `git diff` and `git diff --stat`.
254
254
  - Stage changes explicitly (prefer targeted add; avoid `git add -A` if it may include unintended files): `git add <file...>` (ensure to include all modified source code & test and WORKFLOW.md only if it was modified/created).
255
- - Ensure there is something to commit with: `git diff --cached --quiet && echo "Nothing to commit. Aborting."`. If command output contains "Aborting", OUTPUT exactly "No changes to commit.", and then delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution.
255
+ - Ensure there is something to commit with: `git diff --cached --quiet && echo "Nothing to commit. Aborting."`. If command output contains "Aborting", OUTPUT exactly "No changes to commit.", and then delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution.
256
256
  - Commit a structured commit message with: `git commit -m "cover(<COMPONENT>)<BREAKING>: <DESCRIPTION> [useReq]"`
257
257
  - Set `<COMPONENT>` to the most specific component, module, or function affected. If multiple areas are touched, choose the primary one. If you cannot identify a unique component, use `core`.
258
258
  - Set `<DESCRIPTION>` to a short, clear summary in **English language** of what changed, including (when applicable) updates to: requirements/specs, source code, tests. Use present tense, avoid vague wording, and keep it under ~80 characters if possible.
@@ -262,12 +262,12 @@ After successful pre-flight resolution, create internally a *check-list* for the
262
262
  - Confirm the repo is clean with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-check`. If the command returns an error code or prints any text containing "ERROR", override the final line with EXACTLY "WARNING: Requirements coverage completed with unclean git repository!".
263
263
  9. **CRITICAL**: Merge Conflict Management
264
264
  - Return to the original repository directory (the sibling directory of the worktree).
265
- - Ensure you are on the original branch used before worktree creation by executing `cd <BASE_PATH>` with the retained pre-worktree base if needed.
266
- - Merge the isolated branch into the original branch: `git merge <WORKTREE_NAME>`
267
- - If the merge completes successfully, delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`; if the command returns an error code or prints any text containing "ERROR", OUTPUT exactly "ERROR: Worktree cleanup verification failed!", and then terminate the execution.
265
+ - Ensure you are on the original branch used before worktree creation by executing `cd {{PRJ_BASE}}` with the retained pre-worktree base if needed.
266
+ - Merge the isolated branch into the original branch: `git merge {{WORKTREE_NAME}}`
267
+ - If the merge completes successfully, delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`; if the command returns an error code or prints any text containing "ERROR", OUTPUT exactly "ERROR: Worktree cleanup verification failed!", and then terminate the execution.
268
268
  - If the merge fails or results in conflicts, do NOT remove the worktree directory and override the final line with EXACTLY "WARNING: Requirements coverage completed with merge conflicting!".
269
269
  10. Present results
270
- - PRINT, in the response, the results for a human reader using clear, easily understandable sentences and readable Markdown formatting that highlight key findings, file paths, and concise evidence. Use the fixed report schema: ## **Outcome**, ## **Requirement Delta**, ## **Design Delta**, ## **Implementation Delta**, ## **Verification Delta**, ## **Evidence**, ## **Assumptions**, ## **Next Workflow**. Final line MUST be exactly: STATUS: OK or STATUS: ERROR.
270
+ - PRINT, in the response, the results for a human reader using clear, easily understandable sentences and readable Markdown formatting that highlight key findings, file paths, and concise evidence. PRINT first a ## **Summary** section containing a synthetic summary (at most 1024 UTF-8 characters) of the entire final output, then the verbose report using the fixed report schema: ## **Outcome**, ## **Requirement Delta**, ## **Design Delta**, ## **Implementation Delta**, ## **Verification Delta**, ## **Evidence**, ## **Assumptions**, ## **Next Workflow**. Final line MUST be exactly: STATUS: OK or STATUS: ERROR.
271
271
 
272
272
  <h2 id="users-request">User's Request</h2>
273
273
  %%ARGS%%
@@ -131,4 +131,4 @@ After successful pre-flight resolution, create internally a *check-list* for the
131
131
  - If the code contains obvious bugs or partial implementations, ensure the requirement draft explicitly notes these limitations.
132
132
  - Report `OK` if the draft accurately describes the code (even if the code is buggy). Report `FAIL` only if the draft makes assertions that are not present or contradicted by the source code.
133
133
  3. Present results
134
- - PRINT, in the response, the results for a human reader using clear, easily understandable sentences and readable Markdown formatting that highlight key findings, file paths, and concise evidence. Use the fixed report schema: ## **Outcome**, ## **Requirement Delta**, ## **Design Delta**, ## **Implementation Delta**, ## **Verification Delta**, ## **Evidence**, ## **Assumptions**, ## **Next Workflow**. Final line MUST be exactly: STATUS: OK or STATUS: ERROR.
134
+ - PRINT, in the response, the results for a human reader using clear, easily understandable sentences and readable Markdown formatting that highlight key findings, file paths, and concise evidence. PRINT first a ## **Summary** section containing a synthetic summary (at most 1024 UTF-8 characters) of the entire final output, then the verbose report using the fixed report schema: ## **Outcome**, ## **Requirement Delta**, ## **Design Delta**, ## **Implementation Delta**, ## **Verification Delta**, ## **Evidence**, ## **Assumptions**, ## **Next Workflow**. Final line MUST be exactly: STATUS: OK or STATUS: ERROR.
@@ -54,13 +54,13 @@ In scope: reproduce/triage the defect with concrete evidence and prefer an evide
54
54
 
55
55
  ## Pre-requisite: Execution Context
56
56
  - **CRITICAL**: All information declared in this `Pre-requisite: Execution Context` section MUST remain continuously available in the active execution context for the entire workflow and MUST NEVER be dropped, forgotten, or overwritten.
57
- - Generate <WORKTREE_NAME> with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-name`, retain the literal result for later steps, and use simple sequential execution with only linear shell commands compatible with restrictive filtering systems for all worktree operations in this workflow.
57
+ - Generate {{WORKTREE_NAME}} with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-name`, retain the literal result for later steps, and use simple sequential execution with only linear shell commands compatible with restrictive filtering systems for all worktree operations in this workflow.
58
58
 
59
59
 
60
60
  ## Absolute Rules, Non-Negotiable
61
61
  - **CRITICAL**: When instructions generate shell commands, they MUST generate only linear shell commands compatible with restrictive filtering systems, MUST verify and apply correct quoting, escaping, or option termination for literal arguments that could be parsed as options or flags, MUST use explicit option termination for `rg` and `git grep` patterns beginning with `-` or `--`, MUST NOT rely on quoting or backslash escaping alone for those patterns, and MUST NOT use command substitution (`$()` or backticks), complex variable expansion, nested substitution, shell-derived helper composition, nested shell logic, or nested pipelines.
62
62
  - **CRITICAL**: Every `req` invocation MUST carry the mandatory parameters `--prj-base={{PRJ_BASE}}` and `--git-base={{GIT_BASE}}` with the resolved values; the removed `--base` parameter MUST NOT be used.
63
- - **CRITICAL**: NEVER write, modify, edit, or delete files outside of the active git worktree directory, except under `/tmp`, and except for worktree operations executed through `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-create <WORKTREE_NAME>` and `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`.
63
+ - **CRITICAL**: NEVER write, modify, edit, or delete files outside of the active git worktree directory, except under `/tmp`, and except for worktree operations executed through `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-create {{WORKTREE_NAME}}` and `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`.
64
64
  - You MUST read `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md`, but you MUST NOT modify it in this workflow.
65
65
  - Treat static analysis as safe. Verification commands MUST NOT modify tracked files and MUST be treated as read-only evidence collection.
66
66
  - **CRITICAL**: GIT operations and GIT rules:
@@ -142,7 +142,7 @@ Add --enable-line-numbers (code lines prefixed as `<n>:`):
142
142
  - `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --enable-line-numbers files-find "<TAG_FILTER>" "<NAME_REGEX>" <FILE...>`
143
143
  #### TAGs and filters
144
144
  - TAG_FILTER: pipe-separated, case-insensitive (e.g., `CLASS|FUNCTION|IMPORT`).
145
- - Tags are language-dependent; unsupported tags are ignored. Run `req -h` for supported TAGs per language.
145
+ - Tags are language-dependent; the per-language tag catalog is printed on invalid TAG or non-matching filter errors. Run `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --help` for the full usage surface.
146
146
  - Broad cross-language TAG_FILTER: `CLASS|STRUCT|ENUM|INTERFACE|TRAIT|IMPL|FUNCTION|METHOD|MODULE|NAMESPACE|TYPE_ALIAS|TYPEDEF|IMPORT|CONSTANT|VARIABLE|MACRO|DECORATOR|COMPONENT|PROPERTY|PROTOCOL|EXTENSION|UNION`
147
147
  #### Regex rules (NAME_REGEX)
148
148
  - Regex matching follows `re.search()` semantics against construct names (tool behavior, independent of repository language).
@@ -191,10 +191,10 @@ After successful pre-flight resolution, create internally a *check-list* for the
191
191
  2. **CRITICAL**: Check `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md`, `{{PRJ_BASE}}/%%DOC_PATH%%/WORKFLOW.md` and `{{PRJ_BASE}}/%%DOC_PATH%%/REFERENCES.md` file presence
192
192
  - Check required docs presence with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --docs-check`. If the command returns an error code or prints any text containing "ERROR", OUTPUT exactly "ERROR: Required docs check failed!", and then terminate the execution.
193
193
  3. **CRITICAL**: Worktree Generation & Isolation
194
- - Bind <BASE_PATH> to the resolved `{{PRJ_BASE}}` and <GIT_PATH> to the resolved `{{GIT_BASE}}`, and generate <WORKTREE_NAME> with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-name` using literal `req` commands executed sequentially without shell composition.
195
- - Create the dedicated isolated worktree with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-create <WORKTREE_NAME>`, then execute `cd <GIT_PATH>/../<WORKTREE_NAME>` before proceeding to the next step.
194
+ - Generate {{WORKTREE_NAME}} with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-name` using literal `req` commands executed sequentially without shell composition.
195
+ - Create the dedicated isolated worktree with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-create {{WORKTREE_NAME}}`, then execute `cd {{GIT_BASE}}/../{{WORKTREE_NAME}}` before proceeding to the next step.
196
196
  - If the command returns an error code or prints any text containing "ERROR", OUTPUT exactly "ERROR: Worktree generation failed!", and then terminate the execution.
197
- - After successful worktree creation and directory change, apply the pre-flight context-transition rules before the next project operation. If rebinding fails, OUTPUT exactly "ERROR: Unable to resolve context keywords!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution. Apply this same failure cleanup to later context-resolution failures before merge-phase cleanup.
197
+ - After successful worktree creation and directory change, apply the pre-flight context-transition rules before the next project operation. If rebinding fails, OUTPUT exactly "ERROR: Unable to resolve context keywords!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution. Apply this same failure cleanup to later context-resolution failures before merge-phase cleanup.
198
198
 
199
199
  4. Read requirements, generate **Design Delta** and implement the **Implementation Delta** to fix the defect
200
200
  - Using [User Request](#users-request) as a unified semantic framework, extract all directly and tangentially related information from `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md`, `{{PRJ_BASE}}/%%DOC_PATH%%/WORKFLOW.md` and `{{PRJ_BASE}}/%%DOC_PATH%%/REFERENCES.md`, prioritizing high recall to capture every borderline connection across both sources, to identify the most likely related files and functions based on explicit evidence, and treat any uncertain links as candidates without claiming completeness, then analyze the involved source code from {{PRJ_BASE}}/%%SRC_PATHS%% and GENERATE a detailed **Implementation Delta** documenting the exact modifications to the source code that fix the bug/defect described by the [User Request](#users-request). The **Implementation Delta** MUST be implementation-only and patch-oriented: for each file, list exact edits (functions/classes touched), include only changed snippets, and map each change to the requirement ID(s) it satisfies (no narrative summary)
@@ -203,7 +203,7 @@ After successful pre-flight resolution, create internally a *check-list* for the
203
203
  - Locate existing unit tests in {{PRJ_BASE}}/%%TEST_PATH%% that map to touched modules and requirement IDs; when relevant suites exist, add one targeted failing reproducer unit test for the defect before implementing source fixes. Define in the **Implementation Delta** which suites will run during verification using language-specific test-suite priority policy, and treat verification tests as N/A when no relevant unit tests exist.
204
204
  - **CRITICAL**: All tests MUST implement these instructions: `.req/docs/HDT_Test_Authoring_Guide.md`.
205
205
  - Read %%GUIDELINES_FILES%% files and apply those **guidelines**; ensure the proposed code changes conform to those **guidelines**, and adjust the **Implementation Delta** if needed. Do not apply unrelated **guidelines**.
206
- - A change is allowed ONLY if it corrects behavior that is: (a) explicitly required by `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md` (cite requirement ID/section) OR (b) a defect with concrete evidence (crash, security flaw, data corruption, failure evidence, or incorrect output that contradicts a specific documented behavior). If the request implies new requirements or changing documented behavior, recommend `/req-new` or `/req-change`; before terminating, OUTPUT a Markdown table with exactly three columns in this order: `Requirement ID`, `Conflicting Excerpt`, `Conflict Reason + Interrupted Implementation Intent`; each row MUST map one conflicting requirement to the implementation-contrast rationale and intended interrupted modification; then OUTPUT exactly "ERROR: Defect fix failed due to incompatible requirements!", and then delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution.
206
+ - A change is allowed ONLY if it corrects behavior that is: (a) explicitly required by `{{PRJ_BASE}}/%%DOC_PATH%%/REQUIREMENTS.md` (cite requirement ID/section) OR (b) a defect with concrete evidence (crash, security flaw, data corruption, failure evidence, or incorrect output that contradicts a specific documented behavior). If the request implies new requirements or changing documented behavior, recommend `/req-new` or `/req-change`; before terminating, OUTPUT a Markdown table with exactly three columns in this order: `Requirement ID`, `Conflicting Excerpt`, `Conflict Reason + Interrupted Implementation Intent`; each row MUST map one conflicting requirement to the implementation-contrast rationale and intended interrupted modification; then OUTPUT exactly "ERROR: Defect fix failed due to incompatible requirements!", and then delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution.
207
207
  - Preferred execution order for Step 4 when relevant suites exist: analyze and identify defect -> create one failing reproducer unit test -> design and implement source fix -> verify reproducer and full selected suites.
208
208
  - IMPLEMENT the **Implementation Delta** in the source code (creating new files/directories if necessary). You may make minimal mechanical adjustments needed to fit the actual codebase (file paths, symbol names), but you MUST NOT add new features or scope beyond the **Implementation Delta**.
209
209
  5. Generate **Verification Delta** by verifying static-analysis results and implementing needed bug fixes
@@ -220,9 +220,9 @@ After successful pre-flight resolution, create internally a *check-list* for the
220
220
  - For Step 4, include before/after evidence that links the observed defect to the applied source fix.
221
221
  - Provide explicit concrete verification evidence that the defect is resolved, using requirement evidence and static-analysis output.
222
222
  - If static analysis reports issues or executed unit tests fail, analyze whether they are caused by source defects or requirement-implementation mismatch. Assume requirement evidence is authoritative; when static analysis reports issues, fix source code unless requirements explicitly justify alternative handling.
223
- - Fix the source code to resolve valid verification findings autonomously without asking for user intervention. Execute a strict fix loop: 1) analyze static-check output and unit-test failures (when tests ran), 2) determine root cause from evidence, 3) fix code, 4) re-run `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} static-check` and re-run the selected unit-test suites when applicable. Repeat up to 2 times. If static analysis still reports issues after the second attempt, report the failure, OUTPUT exactly "ERROR: Defect fix failed due to inability to complete static analysis!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution.
224
- - Unit-test completion gate: if any executed unit test still fails after the second fix-loop attempt, report the residual failing tests in the Verification Delta report section, OUTPUT exactly "ERROR: Defect fix failed due to persistent unit-test failures!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution without committing or merging.
225
- - Limitations: Do not introduce new features or change the architecture logic during this fix phase; if a fix requires substantial refactoring or requirements changes, report the failure, then OUTPUT exactly "ERROR: Defect fix failed due to requirements incompatible with static-analysis constraints!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution.
223
+ - Fix the source code to resolve valid verification findings autonomously without asking for user intervention. Execute a strict fix loop: 1) analyze static-check output and unit-test failures (when tests ran), 2) determine root cause from evidence, 3) fix code, 4) re-run `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} static-check` and re-run the selected unit-test suites when applicable. Repeat up to 2 times. If static analysis still reports issues after the second attempt, report the failure, OUTPUT exactly "ERROR: Defect fix failed due to inability to complete static analysis!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution.
224
+ - Unit-test completion gate: if any executed unit test still fails after the second fix-loop attempt, report the residual failing tests in the Verification Delta report section, OUTPUT exactly "ERROR: Defect fix failed due to persistent unit-test failures!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution without committing or merging.
225
+ - Limitations: Do not introduce new features or change the architecture logic during this fix phase; if a fix requires substantial refactoring or requirements changes, report the failure, then OUTPUT exactly "ERROR: Defect fix failed due to requirements incompatible with static-analysis constraints!", delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution.
226
226
  - Do NOT create or modify tests outside the defect-focused scope; only the targeted reproducer test and strictly related assertions/fixtures may be changed when required by updated behavior.
227
227
  6. Update `{{PRJ_BASE}}/%%DOC_PATH%%/WORKFLOW.md` via targeted edits using the canonical WORKFLOW.md contract (same terminology, same schema, same call-trace rules) and declaration file paths only, excluding line numbers, line ranges, and internal file-reference pointers.
228
228
  - Update `{{PRJ_BASE}}/%%DOC_PATH%%/WORKFLOW.md` as an LLM-first runtime model (English only) using a TARGETED EDIT policy.
@@ -254,7 +254,7 @@ After successful pre-flight resolution, create internally a *check-list* for the
254
254
  8. **CRITICAL**: Stage & commit
255
255
  - Show a summary of changes with `git diff` and `git diff --stat`.
256
256
  - Stage changes explicitly (prefer targeted add; avoid `git add -A` if it may include unintended files): `git add <file...>` (ensure to include all modified source code & test and WORKFLOW.md only if it was modified/created).
257
- - Ensure there is something to commit with: `git diff --cached --quiet && echo "Nothing to commit. Aborting."`. If command output contains "Aborting", OUTPUT exactly "No changes to commit.", and then delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`, and then terminate the execution.
257
+ - Ensure there is something to commit with: `git diff --cached --quiet && echo "Nothing to commit. Aborting."`. If command output contains "Aborting", OUTPUT exactly "No changes to commit.", and then delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`, and then terminate the execution.
258
258
  - Commit a structured commit message with: `git commit -m "fix(<COMPONENT>)<BREAKING>: <DESCRIPTION> [useReq]"`
259
259
  - Set `<COMPONENT>` to the most specific component, module, or function affected. If multiple areas are touched, choose the primary one. If you cannot identify a unique component, use `core`.
260
260
  - Set `<DESCRIPTION>` to a short, clear summary in **English language** of what changed, including (when applicable) updates to: requirements/specs, source code, tests. Use present tense, avoid vague wording, and keep it under ~80 characters if possible.
@@ -264,12 +264,12 @@ After successful pre-flight resolution, create internally a *check-list* for the
264
264
  - Confirm the repo is clean with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-check`. If the command returns an error code or prints any text containing "ERROR", override the final line with EXACTLY "WARNING: Defect fix completed with unclean git repository!".
265
265
  9. **CRITICAL**: Merge Conflict Management
266
266
  - Return to the original repository directory (the sibling directory of the worktree).
267
- - Ensure you are on the original branch used before worktree creation by executing `cd <BASE_PATH>` with the retained pre-worktree base if needed.
268
- - Merge the isolated branch into the original branch: `git merge <WORKTREE_NAME>`
269
- - If the merge completes successfully, delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete <WORKTREE_NAME>`; if the command returns an error code or prints any text containing "ERROR", OUTPUT exactly "ERROR: Worktree cleanup verification failed!", and then terminate the execution.
267
+ - Ensure you are on the original branch used before worktree creation by executing `cd {{PRJ_BASE}}` with the retained pre-worktree base if needed.
268
+ - Merge the isolated branch into the original branch: `git merge {{WORKTREE_NAME}}`
269
+ - If the merge completes successfully, delete the isolated worktree and branch with `req --prj-base={{PRJ_BASE}} --git-base={{GIT_BASE}} --git-wt-delete {{WORKTREE_NAME}}`; if the command returns an error code or prints any text containing "ERROR", OUTPUT exactly "ERROR: Worktree cleanup verification failed!", and then terminate the execution.
270
270
  - If the merge fails or results in conflicts, do NOT remove the worktree directory and override the final line with EXACTLY "WARNING: Defect fix completed with merge conflicting!".
271
271
  10. Present results
272
- - PRINT, in the response, the results for a human reader using clear, easily understandable sentences and readable Markdown formatting that highlight key findings, file paths, and concise evidence. Use the fixed report schema: ## **Outcome**, ## **Requirement Delta**, ## **Design Delta**, ## **Implementation Delta**, ## **Verification Delta**, ## **Evidence**, ## **Assumptions**, ## **Next Workflow**. Final line MUST be exactly: STATUS: OK or STATUS: ERROR.
272
+ - PRINT, in the response, the results for a human reader using clear, easily understandable sentences and readable Markdown formatting that highlight key findings, file paths, and concise evidence. PRINT first a ## **Summary** section containing a synthetic summary (at most 1024 UTF-8 characters) of the entire final output, then the verbose report using the fixed report schema: ## **Outcome**, ## **Requirement Delta**, ## **Design Delta**, ## **Implementation Delta**, ## **Verification Delta**, ## **Evidence**, ## **Assumptions**, ## **Next Workflow**. Final line MUST be exactly: STATUS: OK or STATUS: ERROR.
273
273
 
274
274
  <h2 id="users-request">User's Request</h2>
275
275
  %%ARGS%%