cli-usereq 0.75.0__tar.gz → 0.75.2__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 (70) hide show
  1. {cli_usereq-0.75.0/src/cli_usereq.egg-info → cli_usereq-0.75.2}/PKG-INFO +11 -7
  2. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/README.md +10 -6
  3. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/pyproject.toml +1 -1
  4. {cli_usereq-0.75.0 → cli_usereq-0.75.2/src/cli_usereq.egg-info}/PKG-INFO +11 -7
  5. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/__init__.py +1 -1
  6. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/cli.py +150 -79
  7. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_cli.py +116 -5
  8. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_update_check.py +132 -10
  9. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/LICENSE +0 -0
  10. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/setup.cfg +0 -0
  11. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/cli_usereq.egg-info/SOURCES.txt +0 -0
  12. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/cli_usereq.egg-info/dependency_links.txt +0 -0
  13. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/cli_usereq.egg-info/entry_points.txt +0 -0
  14. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/cli_usereq.egg-info/requires.txt +0 -0
  15. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/cli_usereq.egg-info/top_level.txt +0 -0
  16. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/__main__.py +0 -0
  17. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/compress.py +0 -0
  18. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/compress_files.py +0 -0
  19. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/doxygen_parser.py +0 -0
  20. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/find_constructs.py +0 -0
  21. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/generate_markdown.py +0 -0
  22. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/guidelines/Google_C++_Style_Guide.md +0 -0
  23. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/guidelines/Google_Python_Style_Guide.md +0 -0
  24. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/guidelines/Google_TypeScript_Style_Guide.md +0 -0
  25. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/guidelines/RFC2119.md +0 -0
  26. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/analyze.md +0 -0
  27. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/change.md +0 -0
  28. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/check.md +0 -0
  29. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/cover.md +0 -0
  30. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/create.md +0 -0
  31. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/fix.md +0 -0
  32. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/flowchart.md +0 -0
  33. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/implement.md +0 -0
  34. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/new.md +0 -0
  35. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/orchestrate.md +0 -0
  36. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/readme.md +0 -0
  37. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/recreate.md +0 -0
  38. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/refactor.md +0 -0
  39. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/references.md +0 -0
  40. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/renumber.md +0 -0
  41. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/workflow.md +0 -0
  42. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts/write.md +0 -0
  43. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/prompts-version.txt +0 -0
  44. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/templates/Agentic_Text_Authoring_Guidance.md +0 -0
  45. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/templates/Document_Source_Code_in_Doxygen_Style.md +0 -0
  46. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/templates/HDT_Test_Authoring_Guide.md +0 -0
  47. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/resources/templates/Requirements_Template.md +0 -0
  48. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/source_analyzer.py +0 -0
  49. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/static_check.py +0 -0
  50. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/src/usereq/token_counter.py +0 -0
  51. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_analyzer_cli.py +0 -0
  52. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_analyzer_comments.py +0 -0
  53. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_analyzer_core.py +0 -0
  54. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_analyzer_errors.py +0 -0
  55. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_analyzer_format.py +0 -0
  56. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_analyzer_helpers.py +0 -0
  57. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_compress.py +0 -0
  58. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_dependency_manifests.py +0 -0
  59. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_doxygen_parser.py +0 -0
  60. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_files_commands.py +0 -0
  61. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_find_constructs.py +0 -0
  62. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_find_constructs_comprehensive.py +0 -0
  63. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_generate_markdown.py +0 -0
  64. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_helpers.py +0 -0
  65. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_import_isolation.py +0 -0
  66. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_pre_release_check.py +0 -0
  67. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_release_workflow.py +0 -0
  68. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_source_analyzer.py +0 -0
  69. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_static_check.py +0 -0
  70. {cli_usereq-0.75.0 → cli_usereq-0.75.2}/tests/test_token_counter.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cli-usereq
3
- Version: 0.75.0
3
+ Version: 0.75.2
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.75.0)
712
+ # useReq / req (0.75.2)
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+">
@@ -762,7 +762,7 @@ Get running in three steps: install the tool, configure one provider, and instal
762
762
  uv tool install cli-usereq
763
763
 
764
764
  # or persistent install tracking the git repository
765
- uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git
765
+ uv tool install cli-usereq --force --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git
766
766
 
767
767
  # or run instantly without installing (PyPI release)
768
768
  uvx --from cli-usereq req --help
@@ -813,9 +813,12 @@ This exposes the CLI as `req` (also callable as `usereq` or `python -m usereq`).
813
813
 
814
814
  ```bash
815
815
  req --upgrade
816
+
817
+ # force full package download and complete reinstallation
818
+ req --upgrade --force
816
819
  ```
817
820
 
818
- On Linux this executes `uv tool install cli-usereq --force` from the PyPI index; on other platforms the manual command is printed and `uv` is not executed. Use `req --upgrade --develop` (or the equivalent `req --upgrade --dev`) to install the latest tagged GitHub release instead of PyPI. When the upgrade succeeds and `auto-install` is enabled (the default), the persisted providers are automatically re-provisioned — equivalent to running `install`. Provide `--prj-base` in the same invocation to enable this; without it, a warning is printed and the provider update is skipped. Disable the behavior persistently with `--disable-auto-install` and re-enable it with `--enable-auto-install`.
821
+ On Linux this executes the standard `uv tool install cli-usereq` command from the PyPI index without any forcing option; on other platforms the manual command is printed and `uv` is not executed. Adding `--force` forces full package download and complete reinstallation: `req --upgrade --force` executes `uv tool install cli-usereq --force --reinstall --refresh`. Use `req --upgrade --develop` (or the equivalent `req --upgrade --dev`) to install the latest tagged GitHub release instead of PyPI. When the upgrade succeeds and `auto-install` is enabled (the default), the persisted providers are automatically re-provisioned — equivalent to running `install`. Provide `--prj-base` in the same invocation to enable this; without it, a warning is printed and the provider update is skipped. Disable the behavior persistently with `--disable-auto-install` and re-enable it with `--enable-auto-install`.
819
822
 
820
823
  ### Install from GitHub (alternative channel)
821
824
 
@@ -823,7 +826,7 @@ Intermediate and test releases are published on GitHub at [`Ogekuri/CLI-useReq`]
823
826
 
824
827
  ```bash
825
828
  # persistent install tracking the git repository
826
- uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git
829
+ uv tool install cli-usereq --force --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git
827
830
 
828
831
  # or run instantly without installing
829
832
  uvx --from git+https://github.com/Ogekuri/CLI-useReq.git req --help
@@ -832,7 +835,7 @@ uvx --from git+https://github.com/Ogekuri/CLI-useReq.git req --help
832
835
  req --upgrade --develop
833
836
  ```
834
837
 
835
- On Linux `req --upgrade --develop` (or `req --upgrade --dev`) executes `uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>`, where `<TAG>` is the latest tagged release resolved through the GitHub releases API regardless of the branch holding it; on other platforms the manual command is printed and `uv` is not executed.
838
+ On Linux `req --upgrade --develop` (or `req --upgrade --dev`) executes the standard `uv tool install cli-usereq --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>` command, where `<TAG>` is the latest tagged release resolved through the GitHub releases API regardless of the branch holding it; on other platforms the manual command is printed and `uv` is not executed. Adding `--force` (`req --upgrade --develop --force`) executes `uv tool install cli-usereq --force --reinstall --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>` instead.
836
839
 
837
840
  ### Tool removal
838
841
 
@@ -990,8 +993,9 @@ Notes:
990
993
  ### Other flags
991
994
 
992
995
  - `--verbose` / `--debug` — detailed and diagnostic output.
993
- - `--ver` / `--version` — print the installed package version, query PyPI and GitHub, and print `PyPI latest: <version>` and `GitHub latest: <version>` lines (`unknown` when a repository cannot be reached).
996
+ - `--ver` / `--version` — print the installed package version and query PyPI and GitHub, printing three aligned lines: `Current Installed : <version>`, `Latest @ PyPI : <version>`, and `Latest @ GitHub : <version>` (`unknown` when a repository cannot be reached).
994
997
  - `--develop` / `--dev` — with `--upgrade`: install the latest tagged GitHub release from `git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>`, with `<TAG>` resolved through the GitHub releases API regardless of branch, instead of PyPI; `--dev` is an equivalent alias of `--develop`.
998
+ - `--force` — with `--upgrade`: force full package download and complete reinstallation (`uv tool install ... --force --reinstall --refresh`); without `--force` the standard install/update process runs without any forcing option.
995
999
  - `-h` / `--help` — print command help and exit.
996
1000
 
997
1001
  A startup release check queries the latest PyPI release (idle-gated to at most once per hour; once per day on API failures) and prints a bright-green stderr notice when a newer version is available.
@@ -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.75.0)
13
+ # useReq / req (0.75.2)
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+">
@@ -63,7 +63,7 @@ Get running in three steps: install the tool, configure one provider, and instal
63
63
  uv tool install cli-usereq
64
64
 
65
65
  # or persistent install tracking the git repository
66
- uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git
66
+ uv tool install cli-usereq --force --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git
67
67
 
68
68
  # or run instantly without installing (PyPI release)
69
69
  uvx --from cli-usereq req --help
@@ -114,9 +114,12 @@ This exposes the CLI as `req` (also callable as `usereq` or `python -m usereq`).
114
114
 
115
115
  ```bash
116
116
  req --upgrade
117
+
118
+ # force full package download and complete reinstallation
119
+ req --upgrade --force
117
120
  ```
118
121
 
119
- On Linux this executes `uv tool install cli-usereq --force` from the PyPI index; on other platforms the manual command is printed and `uv` is not executed. Use `req --upgrade --develop` (or the equivalent `req --upgrade --dev`) to install the latest tagged GitHub release instead of PyPI. When the upgrade succeeds and `auto-install` is enabled (the default), the persisted providers are automatically re-provisioned — equivalent to running `install`. Provide `--prj-base` in the same invocation to enable this; without it, a warning is printed and the provider update is skipped. Disable the behavior persistently with `--disable-auto-install` and re-enable it with `--enable-auto-install`.
122
+ On Linux this executes the standard `uv tool install cli-usereq` command from the PyPI index without any forcing option; on other platforms the manual command is printed and `uv` is not executed. Adding `--force` forces full package download and complete reinstallation: `req --upgrade --force` executes `uv tool install cli-usereq --force --reinstall --refresh`. Use `req --upgrade --develop` (or the equivalent `req --upgrade --dev`) to install the latest tagged GitHub release instead of PyPI. When the upgrade succeeds and `auto-install` is enabled (the default), the persisted providers are automatically re-provisioned — equivalent to running `install`. Provide `--prj-base` in the same invocation to enable this; without it, a warning is printed and the provider update is skipped. Disable the behavior persistently with `--disable-auto-install` and re-enable it with `--enable-auto-install`.
120
123
 
121
124
  ### Install from GitHub (alternative channel)
122
125
 
@@ -124,7 +127,7 @@ Intermediate and test releases are published on GitHub at [`Ogekuri/CLI-useReq`]
124
127
 
125
128
  ```bash
126
129
  # persistent install tracking the git repository
127
- uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git
130
+ uv tool install cli-usereq --force --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git
128
131
 
129
132
  # or run instantly without installing
130
133
  uvx --from git+https://github.com/Ogekuri/CLI-useReq.git req --help
@@ -133,7 +136,7 @@ uvx --from git+https://github.com/Ogekuri/CLI-useReq.git req --help
133
136
  req --upgrade --develop
134
137
  ```
135
138
 
136
- On Linux `req --upgrade --develop` (or `req --upgrade --dev`) executes `uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>`, where `<TAG>` is the latest tagged release resolved through the GitHub releases API regardless of the branch holding it; on other platforms the manual command is printed and `uv` is not executed.
139
+ On Linux `req --upgrade --develop` (or `req --upgrade --dev`) executes the standard `uv tool install cli-usereq --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>` command, where `<TAG>` is the latest tagged release resolved through the GitHub releases API regardless of the branch holding it; on other platforms the manual command is printed and `uv` is not executed. Adding `--force` (`req --upgrade --develop --force`) executes `uv tool install cli-usereq --force --reinstall --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>` instead.
137
140
 
138
141
  ### Tool removal
139
142
 
@@ -291,8 +294,9 @@ Notes:
291
294
  ### Other flags
292
295
 
293
296
  - `--verbose` / `--debug` — detailed and diagnostic output.
294
- - `--ver` / `--version` — print the installed package version, query PyPI and GitHub, and print `PyPI latest: <version>` and `GitHub latest: <version>` lines (`unknown` when a repository cannot be reached).
297
+ - `--ver` / `--version` — print the installed package version and query PyPI and GitHub, printing three aligned lines: `Current Installed : <version>`, `Latest @ PyPI : <version>`, and `Latest @ GitHub : <version>` (`unknown` when a repository cannot be reached).
295
298
  - `--develop` / `--dev` — with `--upgrade`: install the latest tagged GitHub release from `git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>`, with `<TAG>` resolved through the GitHub releases API regardless of branch, instead of PyPI; `--dev` is an equivalent alias of `--develop`.
299
+ - `--force` — with `--upgrade`: force full package download and complete reinstallation (`uv tool install ... --force --reinstall --refresh`); without `--force` the standard install/update process runs without any forcing option.
296
300
  - `-h` / `--help` — print command help and exit.
297
301
 
298
302
  A startup release check queries the latest PyPI release (idle-gated to at most once per hour; once per day on API failures) and prints a bright-green stderr notice when a newer version is available.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cli-usereq"
7
- version = "0.75.0"
7
+ version = "0.75.2"
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"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cli-usereq
3
- Version: 0.75.0
3
+ Version: 0.75.2
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.75.0)
712
+ # useReq / req (0.75.2)
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+">
@@ -762,7 +762,7 @@ Get running in three steps: install the tool, configure one provider, and instal
762
762
  uv tool install cli-usereq
763
763
 
764
764
  # or persistent install tracking the git repository
765
- uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git
765
+ uv tool install cli-usereq --force --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git
766
766
 
767
767
  # or run instantly without installing (PyPI release)
768
768
  uvx --from cli-usereq req --help
@@ -813,9 +813,12 @@ This exposes the CLI as `req` (also callable as `usereq` or `python -m usereq`).
813
813
 
814
814
  ```bash
815
815
  req --upgrade
816
+
817
+ # force full package download and complete reinstallation
818
+ req --upgrade --force
816
819
  ```
817
820
 
818
- On Linux this executes `uv tool install cli-usereq --force` from the PyPI index; on other platforms the manual command is printed and `uv` is not executed. Use `req --upgrade --develop` (or the equivalent `req --upgrade --dev`) to install the latest tagged GitHub release instead of PyPI. When the upgrade succeeds and `auto-install` is enabled (the default), the persisted providers are automatically re-provisioned — equivalent to running `install`. Provide `--prj-base` in the same invocation to enable this; without it, a warning is printed and the provider update is skipped. Disable the behavior persistently with `--disable-auto-install` and re-enable it with `--enable-auto-install`.
821
+ On Linux this executes the standard `uv tool install cli-usereq` command from the PyPI index without any forcing option; on other platforms the manual command is printed and `uv` is not executed. Adding `--force` forces full package download and complete reinstallation: `req --upgrade --force` executes `uv tool install cli-usereq --force --reinstall --refresh`. Use `req --upgrade --develop` (or the equivalent `req --upgrade --dev`) to install the latest tagged GitHub release instead of PyPI. When the upgrade succeeds and `auto-install` is enabled (the default), the persisted providers are automatically re-provisioned — equivalent to running `install`. Provide `--prj-base` in the same invocation to enable this; without it, a warning is printed and the provider update is skipped. Disable the behavior persistently with `--disable-auto-install` and re-enable it with `--enable-auto-install`.
819
822
 
820
823
  ### Install from GitHub (alternative channel)
821
824
 
@@ -823,7 +826,7 @@ Intermediate and test releases are published on GitHub at [`Ogekuri/CLI-useReq`]
823
826
 
824
827
  ```bash
825
828
  # persistent install tracking the git repository
826
- uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git
829
+ uv tool install cli-usereq --force --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git
827
830
 
828
831
  # or run instantly without installing
829
832
  uvx --from git+https://github.com/Ogekuri/CLI-useReq.git req --help
@@ -832,7 +835,7 @@ uvx --from git+https://github.com/Ogekuri/CLI-useReq.git req --help
832
835
  req --upgrade --develop
833
836
  ```
834
837
 
835
- On Linux `req --upgrade --develop` (or `req --upgrade --dev`) executes `uv tool install cli-usereq --force --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>`, where `<TAG>` is the latest tagged release resolved through the GitHub releases API regardless of the branch holding it; on other platforms the manual command is printed and `uv` is not executed.
838
+ On Linux `req --upgrade --develop` (or `req --upgrade --dev`) executes the standard `uv tool install cli-usereq --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>` command, where `<TAG>` is the latest tagged release resolved through the GitHub releases API regardless of the branch holding it; on other platforms the manual command is printed and `uv` is not executed. Adding `--force` (`req --upgrade --develop --force`) executes `uv tool install cli-usereq --force --reinstall --refresh --from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>` instead.
836
839
 
837
840
  ### Tool removal
838
841
 
@@ -990,8 +993,9 @@ Notes:
990
993
  ### Other flags
991
994
 
992
995
  - `--verbose` / `--debug` — detailed and diagnostic output.
993
- - `--ver` / `--version` — print the installed package version, query PyPI and GitHub, and print `PyPI latest: <version>` and `GitHub latest: <version>` lines (`unknown` when a repository cannot be reached).
996
+ - `--ver` / `--version` — print the installed package version and query PyPI and GitHub, printing three aligned lines: `Current Installed : <version>`, `Latest @ PyPI : <version>`, and `Latest @ GitHub : <version>` (`unknown` when a repository cannot be reached).
994
997
  - `--develop` / `--dev` — with `--upgrade`: install the latest tagged GitHub release from `git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>`, with `<TAG>` resolved through the GitHub releases API regardless of branch, instead of PyPI; `--dev` is an equivalent alias of `--develop`.
998
+ - `--force` — with `--upgrade`: force full package download and complete reinstallation (`uv tool install ... --force --reinstall --refresh`); without `--force` the standard install/update process runs without any forcing option.
995
999
  - `-h` / `--help` — print command help and exit.
996
1000
 
997
1001
  A startup release check queries the latest PyPI release (idle-gated to at most once per hour; once per day on API failures) and prints a bright-green stderr notice when a newer version is available.
@@ -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.75.0"
21
+ __version__ = "0.75.2"
22
22
  """! @brief Semantic version string of the package."""
23
23
 
24
24
 
@@ -31,8 +31,8 @@ from typing import Any, Mapping, Optional
31
31
  REPO_ROOT = Path(__file__).resolve().parents[2]
32
32
  """! @brief The absolute path to the repository root."""
33
33
 
34
- RESOURCE_ROOT = Path(__file__).resolve().parent / "resources"
35
- """! @brief The absolute path to the resources directory."""
34
+ RESOURCE_ROOT = Path(os.path.abspath(__file__)).parent / "resources"
35
+ """! @brief The absolute lexical path of the packaged resources directory; never resolves symbolic links (SRS-505)."""
36
36
 
37
37
  VERBOSE = False
38
38
  """! @brief Whether verbose output is enabled."""
@@ -149,9 +149,10 @@ def guidelines_dir() -> Path:
149
149
  @brief Resolve the packaged guidelines directory of the running installation.
150
150
  @details Composes the packaged resources root of the running installation with the
151
151
  non-configurable ``guidelines`` suffix so installed skills reference the resources
152
- shipped with this installation instead of any external copy (SRS-360, SRS-497).
152
+ shipped with this installation instead of any external copy (SRS-360, SRS-497);
153
+ composition is lexical and never resolves symbolic links (SRS-505).
153
154
  @return {Path} Absolute path of the packaged guidelines directory.
154
- @satisfies SRS-360, SRS-497
155
+ @satisfies SRS-360, SRS-497, SRS-505
155
156
  """
156
157
  return RESOURCE_ROOT / "guidelines"
157
158
 
@@ -161,9 +162,10 @@ def templates_dir() -> Path:
161
162
  @brief Resolve the packaged document-template directory of the running installation.
162
163
  @details Composes the packaged resources root of the running installation with the
163
164
  non-configurable ``templates`` suffix feeding the ``%%TEMPLATE_PATH%%`` substitution
164
- so installed skills reference the templates shipped with this installation (SRS-498).
165
+ so installed skills reference the templates shipped with this installation (SRS-498);
166
+ composition is lexical and never resolves symbolic links (SRS-505).
165
167
  @return {Path} Absolute path of the packaged templates directory.
166
- @satisfies SRS-495, SRS-498
168
+ @satisfies SRS-495, SRS-498, SRS-505
167
169
  """
168
170
  return RESOURCE_ROOT / "templates"
169
171
 
@@ -357,6 +359,9 @@ endpoint; PyPI is the sole source for version verification and default self-upgr
357
359
  UNKNOWN_VERSION_LABEL = "unknown"
358
360
  """! @brief Label printed by `--ver`/`--version` when a remote latest version cannot be fetched (SRS-442)."""
359
361
 
362
+ VERSION_REPORT_LABEL_WIDTH = 18
363
+ """! @brief Left-justified label-field width aligning the `: <version>` column of every `--ver`/`--version` line (SRS-518)."""
364
+
360
365
  FORCE_ONLINE_RELEASE_CHECK = False
361
366
  """! @brief Startup-scoped override that bypasses release-check idle-state gating when enabled."""
362
367
 
@@ -422,10 +427,12 @@ def build_parser() -> argparse.ArgumentParser:
422
427
  global base arguments ``--prj-base`` and ``--git-base`` both before and after the subcommand
423
428
  token; ``--prj-base`` is mandatory only for the SRS-396 project-scan subcommands (enforced by
424
429
  ``_require_prj_base``) and ``--git-base`` is never mandatory for any SRS-408 subcommand
425
- (SRS-392, SRS-393, SRS-396, SRS-397, SRS-410).
430
+ (SRS-392, SRS-393, SRS-396, SRS-397, SRS-410). The ``--force`` auxiliary argument is
431
+ accepted by ``--upgrade`` (with or without ``--develop``/``--dev``) and forces full
432
+ package download and complete reinstallation (SRS-508, SRS-511).
426
433
  """
427
434
  usage = (
428
- "req [-h] [--upgrade] [--develop] [--dev] [--uninstall] [--prj-base PRJ_BASE] [--git-base GIT_BASE] "
435
+ "req [-h] [--upgrade] [--develop] [--dev] [--force] [--uninstall] [--prj-base PRJ_BASE] [--git-base GIT_BASE] "
429
436
  "[--set-docs-dir DOCS_DIR] [--set-src-dir SRC_DIR] [--set-tests-dir TESTS_DIR] [--verbose] [--debug] "
430
437
  "[--enable PROVIDER] [--disable PROVIDER] [--enable-auto-install] [--disable-auto-install] "
431
438
  "[--enable-line-numbers] "
@@ -507,6 +514,17 @@ def build_parser() -> argparse.ArgumentParser:
507
514
  "--dev is an equivalent alias of --develop."
508
515
  ),
509
516
  )
517
+ parser.add_argument(
518
+ "--force",
519
+ action="store_true",
520
+ dest="force",
521
+ help=(
522
+ "With --upgrade: force full package download and complete "
523
+ "reinstallation (uv tool install ... --force --reinstall "
524
+ "--refresh). Without --force the standard install/update "
525
+ "process runs without any forcing option."
526
+ ),
527
+ )
510
528
  parser.add_argument(
511
529
  "--uninstall", action="store_true", help="Uninstall the tool with uv."
512
530
  )
@@ -856,19 +874,21 @@ def load_package_version() -> str:
856
874
 
857
875
  def maybe_print_version(argv: list[str], pypi_latest: Optional[str] = None) -> bool:
858
876
  """!
859
- @brief Handles --ver/--version by printing installed, PyPI latest, and GitHub latest versions.
877
+ @brief Handles --ver/--version by printing installed, PyPI latest, and GitHub latest versions in aligned columns.
860
878
  @param argv Command line arguments to check.
861
879
  @param pypi_latest {Optional[str]} PyPI latest version already fetched by the startup
862
880
  release-check; when None, a direct PyPI JSON API fetch is attempted (SRS-441, SRS-442).
863
- @details When `--ver`/`--version` is present, prints the installed package version as the
864
- first stdout line, then queries (or reuses) the PyPI JSON API `info.version` and the GitHub
865
- latest-release `tag_name`, printing `PyPI latest: <version>` and `GitHub latest: <version>`
866
- lines; fetch failures degrade to the `unknown` label without raising (SRS-441, SRS-442).
881
+ @details When `--ver`/`--version` is present, prints exactly three stdout lines in order:
882
+ installed version, PyPI latest version, GitHub latest version. Each line renders
883
+ `<LABEL>` left-justified in :data:`VERSION_REPORT_LABEL_WIDTH` characters followed by
884
+ `: <version>` so the version numbers align in one column (SRS-441, SRS-518); the labels
885
+ are `Current Installed`, `Latest @ PyPI`, and `Latest @ GitHub`; fetch failures degrade
886
+ to the `unknown` label without raising (SRS-442).
867
887
  @return {bool} True if version output was printed, False otherwise.
868
- @satisfies SRS-441, SRS-442
888
+ @satisfies SRS-441, SRS-442, SRS-518
869
889
  """
870
890
  if "--ver" in argv or "--version" in argv:
871
- print(load_package_version())
891
+ installed_version = load_package_version()
872
892
  if pypi_latest is None:
873
893
  try:
874
894
  pypi_latest = fetch_pypi_latest_version(RELEASE_CHECK_TIMEOUT_SECONDS)
@@ -892,10 +912,11 @@ def maybe_print_version(argv: list[str], pypi_latest: Optional[str] = None) -> b
892
912
  ValueError,
893
913
  ):
894
914
  github_latest = None
895
- print(f"PyPI latest: {pypi_latest if pypi_latest else UNKNOWN_VERSION_LABEL}")
896
- print(
897
- f"GitHub latest: {github_latest if github_latest else UNKNOWN_VERSION_LABEL}"
898
- )
915
+ pypi_value = pypi_latest if pypi_latest else UNKNOWN_VERSION_LABEL
916
+ github_value = github_latest if github_latest else UNKNOWN_VERSION_LABEL
917
+ print(f"{'Current Installed':<{VERSION_REPORT_LABEL_WIDTH}}: {installed_version}")
918
+ print(f"{'Latest @ PyPI':<{VERSION_REPORT_LABEL_WIDTH}}: {pypi_value}")
919
+ print(f"{'Latest @ GitHub':<{VERSION_REPORT_LABEL_WIDTH}}: {github_value}")
899
920
  return True
900
921
  return False
901
922
 
@@ -931,33 +952,40 @@ def _resolve_github_upgrade_tag() -> str:
931
952
  return resolved_tag
932
953
 
933
954
 
934
- def run_upgrade(use_github: bool = False) -> None:
955
+ def run_upgrade(use_github: bool = False, force: bool = False) -> None:
935
956
  """!
936
957
  @brief Executes the upgrade using uv from the PyPI index or the latest GitHub release tag.
937
958
  @param use_github {bool} When True, install the latest tagged GitHub release instead of
938
959
  the PyPI index (`--upgrade --develop` or equivalent alias `--dev`, SRS-440, SRS-445).
939
- @details Builds `uv tool install cli-usereq --force` against the PyPI index by default
940
- (SRS-343). When `use_github` is True, resolves the latest GitHub release tag through
941
- `_resolve_github_upgrade_tag()` (SRS-451) and appends
942
- `--from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>` regardless of the branch
943
- holding that tag (SRS-440, SRS-452). Executes the command only on Linux; on non-Linux
944
- platforms prints the manual command and skips uv execution.
960
+ @param force {bool} When True, append `--force --reinstall --refresh` so uv re-downloads
961
+ the package and fully reinstalls it (`--upgrade --force`, SRS-508, SRS-509, SRS-510).
962
+ @details Builds the standard `uv tool install cli-usereq` command against the PyPI index
963
+ by default (SRS-343); without `force` no forcing option is passed so the standard
964
+ install/update process runs unchanged. When `force` is True the command becomes
965
+ `uv tool install cli-usereq --force --reinstall --refresh` (SRS-509). When `use_github`
966
+ is True, resolves the latest GitHub release tag through `_resolve_github_upgrade_tag()`
967
+ (SRS-451) and appends `--from git+https://github.com/Ogekuri/CLI-useReq.git@<TAG>`
968
+ regardless of the branch holding that tag (SRS-440, SRS-452, SRS-510). Executes the
969
+ command only on Linux; on non-Linux platforms prints the manual command and skips uv
970
+ execution.
945
971
  @throws {ReqError} When the SRS-451 GitHub tag resolution fails (exit code 1, SRS-453) or
946
972
  when the uv process fails.
947
973
  @return {None} Function return value.
948
974
  @note Tag resolution precedes the platform gate so the non-Linux manual command embeds the
949
975
  resolved tag (SRS-452).
950
- @note The `--develop`/`--dev` argv alias mapping to `use_github=True` is resolved by
951
- `main(...)` before calling this function.
952
- @satisfies SRS-343, SRS-440, SRS-445, SRS-451, SRS-452, SRS-453
976
+ @note The `--develop`/`--dev` argv alias mapping to `use_github=True` and the `--force`
977
+ argv token mapping to `force=True` are resolved by `main(...)` before calling this
978
+ function.
979
+ @satisfies SRS-343, SRS-440, SRS-445, SRS-451, SRS-452, SRS-453, SRS-508, SRS-509, SRS-510
953
980
  """
954
981
  command = [
955
982
  "uv",
956
983
  "tool",
957
984
  "install",
958
985
  TOOL_PROGRAM_NAME,
959
- "--force",
960
986
  ]
987
+ if force:
988
+ command += ["--force", "--reinstall", "--refresh"]
961
989
  if use_github:
962
990
  resolved_tag = _resolve_github_upgrade_tag()
963
991
  command += ["--from", f"{GITHUB_UPGRADE_SOURCE}@{resolved_tag}"]
@@ -2405,52 +2433,101 @@ def run_config_commands(args: Namespace) -> None:
2405
2433
  apply_auto_install_config(False)
2406
2434
 
2407
2435
 
2436
+ def _non_symlink_regular_files(directory: Path) -> list[Path]:
2437
+ """!
2438
+ @brief List non-hidden regular files in one directory without following symbolic links.
2439
+ @details Scans ``directory`` with ``os.scandir`` and ``follow_symlinks=False`` so
2440
+ symbolic-link entries are never followed or resolved: symlinked files, symlinked
2441
+ subdirectories, and broken links are excluded, and only entries whose own inode is
2442
+ a regular file are kept (SRS-504). Hidden names starting with ``.`` are excluded.
2443
+ When ``directory`` is itself a symbolic link or is absent, returns an empty list so
2444
+ callers apply their absent-directory fallback instead of reading through the link.
2445
+ @param directory {Path} Absolute directory to enumerate.
2446
+ @return {list[Path]} Sorted paths of non-symlink regular files.
2447
+ @satisfies SRS-504
2448
+ """
2449
+ if directory.is_symlink() or not directory.is_dir():
2450
+ return []
2451
+ entries = [
2452
+ Path(entry.path)
2453
+ for entry in os.scandir(directory)
2454
+ if entry.is_file(follow_symlinks=False)
2455
+ and not entry.name.startswith(".")
2456
+ ]
2457
+ return sorted(entries)
2458
+
2459
+
2408
2460
  def generate_guidelines_file_list() -> str:
2409
2461
  """!
2410
2462
  @brief Build the `%%GUIDELINES_FILES%%` substitution payload from GUIDELINES_DIR.
2411
- @details Enumerates non-hidden regular files in :func:`guidelines_dir` (packaged
2412
- `resources/guidelines` of the running installation, SRS-360) in deterministic sorted
2413
- order and renders each as a backticked home-relative path (SRS-402). When the directory
2414
- is absent or empty, renders the home-relative directory itself with a trailing slash.
2463
+ @details Enumerates non-hidden non-symlink regular files in :func:`guidelines_dir`
2464
+ (packaged `resources/guidelines` of the running installation, SRS-360) in deterministic
2465
+ sorted order without following symbolic links (SRS-504) and renders each as a backticked
2466
+ home-relative path (SRS-402). When the directory is absent, symlinked, or empty, renders
2467
+ the home-relative directory itself with a trailing slash.
2415
2468
  @return {str} Comma-separated backticked home-relative paths, or the directory fallback.
2416
- @satisfies SRS-403
2469
+ @satisfies SRS-403, SRS-504
2417
2470
  """
2418
2471
  source_dir = guidelines_dir()
2419
- if not source_dir.is_dir():
2420
- return f"`{format_home_relative_path(source_dir)}/`"
2421
-
2422
2472
  files = [
2423
2473
  f"`{format_home_relative_path(file_path)}`"
2424
- for file_path in sorted(source_dir.iterdir())
2425
- if file_path.is_file() and not file_path.name.startswith(".")
2474
+ for file_path in _non_symlink_regular_files(source_dir)
2426
2475
  ]
2427
2476
  if not files:
2428
2477
  return f"`{format_home_relative_path(source_dir)}/`"
2429
2478
  return ", ".join(files)
2430
2479
 
2431
2480
 
2432
- def generate_guidelines_file_items() -> list[str]:
2481
+ def generate_guidelines_file_names() -> list[str]:
2433
2482
  """!
2434
- @brief List the home-relative guideline entries reported after installation.
2435
- @details Returns one home-relative path per non-hidden regular file in
2436
- :func:`guidelines_dir` (packaged `resources/guidelines` of the running installation);
2437
- when the directory is absent or empty, returns the home-relative directory itself with
2438
- a trailing slash.
2439
- @return {list[str]} Ordered home-relative guideline paths.
2440
- @satisfies SRS-360, SRS-403
2483
+ @brief List the bare guideline file names reported after installation.
2484
+ @details Returns one bare file name per non-hidden non-symlink regular file in
2485
+ :func:`guidelines_dir` (packaged `resources/guidelines` of the running installation)
2486
+ without following symbolic links (SRS-504, SRS-516); names carry no directory
2487
+ components, and an absent, symlinked, or empty directory yields an empty list.
2488
+ @return {list[str]} Bare guideline file names in deterministic sorted order.
2489
+ @satisfies SRS-360, SRS-513, SRS-516
2441
2490
  """
2442
- source_dir = guidelines_dir()
2443
- if not source_dir.is_dir():
2444
- return [f"{format_home_relative_path(source_dir)}/"]
2491
+ return [
2492
+ file_path.name for file_path in _non_symlink_regular_files(guidelines_dir())
2493
+ ]
2445
2494
 
2446
- items = [
2447
- format_home_relative_path(file_path)
2448
- for file_path in sorted(source_dir.iterdir())
2449
- if file_path.is_file() and not file_path.name.startswith(".")
2495
+
2496
+ def generate_templates_file_names() -> list[str]:
2497
+ """!
2498
+ @brief List the bare template file names reported after installation.
2499
+ @details Returns one bare file name per non-hidden non-symlink regular file in
2500
+ :func:`templates_dir` (packaged `resources/templates` of the running installation)
2501
+ without following symbolic links (SRS-516); names carry no directory components,
2502
+ and an absent, symlinked, or empty directory yields an empty list.
2503
+ @return {list[str]} Bare template file names in deterministic sorted order.
2504
+ @satisfies SRS-498, SRS-514, SRS-516
2505
+ """
2506
+ return [
2507
+ file_path.name for file_path in _non_symlink_regular_files(templates_dir())
2450
2508
  ]
2451
- if not items:
2452
- return [f"{format_home_relative_path(source_dir)}/"]
2453
- return items
2509
+
2510
+
2511
+ def _print_resource_report() -> None:
2512
+ """!
2513
+ @brief Print the compact post-installation packaged-resource report.
2514
+ @details Prints the home-relative lexical guidelines directory path ending with
2515
+ `/`, then one comma-separated line of bare guideline file names (SRS-513), then
2516
+ the home-relative lexical templates directory path ending with `/`, then one
2517
+ comma-separated line of bare template file names (SRS-514). Every printed path
2518
+ is composed lexically without resolving symbolic links (SRS-515); an empty
2519
+ enumeration emits no file-name line (SRS-516).
2520
+ @return {None} Function return value.
2521
+ @satisfies SRS-513, SRS-514, SRS-515, SRS-516
2522
+ """
2523
+ print(f"Guidelines: {format_home_relative_path(guidelines_dir())}/")
2524
+ guideline_names = generate_guidelines_file_names()
2525
+ if guideline_names:
2526
+ print(", ".join(guideline_names))
2527
+ print(f"Templates: {format_home_relative_path(templates_dir())}/")
2528
+ template_names = generate_templates_file_names()
2529
+ if template_names:
2530
+ print(", ".join(template_names))
2454
2531
 
2455
2532
 
2456
2533
  def ensure_relative(value: str, name: str, code: int) -> None:
@@ -3046,14 +3123,15 @@ def run(args: Namespace) -> None:
3046
3123
  roots (SRS-381..SRS-386, SRS-464, SRS-486) with home-relative packaged-resource token
3047
3124
  substitution for `%%GUIDELINES_FILES%%`, `%%GUIDELINES_PATH%%`, `%%TEMPLATE_PATH%%`,
3048
3125
  `%%DOC_PATH%%`, `%%SRC_PATHS%%`, and `%%TEST_PATH%%` (SRS-360, SRS-402, SRS-403,
3049
- SRS-498, SRS-500, SRS-501, SRS-502), and never rewrites the user-global configuration
3050
- file (SRS-448). Install does not consume `--prj-base` (SRS-447); project scaffolding,
3051
- containment validation, and directory persistence are removed legacy behaviors
3052
- (SRS-363, SRS-407, SRS-449).
3126
+ SRS-498, SRS-500, SRS-501, SRS-502), never following or resolving symbolic links in
3127
+ substitution sources (SRS-504, SRS-505, SRS-506), and never rewrites the user-global
3128
+ configuration file (SRS-448). Install does not consume `--prj-base` (SRS-447); project
3129
+ scaffolding, containment validation, and directory persistence are removed legacy
3130
+ behaviors (SRS-363, SRS-407, SRS-449).
3053
3131
  @param args Parsed CLI namespace.
3054
3132
  @return {None} Function return value.
3055
3133
  @throws ReqError If no provider is enabled.
3056
- @satisfies SRS-035, SRS-064, SRS-279, SRS-359, SRS-360, SRS-361, SRS-362, SRS-381, SRS-387, SRS-388, SRS-402, SRS-403, SRS-418, SRS-447, SRS-448, SRS-498, SRS-500, SRS-501, SRS-502
3134
+ @satisfies SRS-035, SRS-064, SRS-279, SRS-359, SRS-360, SRS-361, SRS-362, SRS-381, SRS-387, SRS-388, SRS-402, SRS-403, SRS-418, SRS-447, SRS-448, SRS-498, SRS-500, SRS-501, SRS-502, SRS-504, SRS-505, SRS-506
3057
3135
  """
3058
3136
  global VERBOSE, DEBUG
3059
3137
  VERBOSE = getattr(args, "verbose", False)
@@ -3168,21 +3246,11 @@ def run(args: Namespace) -> None:
3168
3246
 
3169
3247
  # Final success notification: printed only when the command completed all
3170
3248
  # intended filesystem modifications without raising an exception.
3171
- try:
3172
- resolved_home = str(home_dir().resolve())
3173
- except Exception:
3174
- resolved_home = str(home_dir())
3175
- print(f"Installation completed successfully in {resolved_home}")
3176
-
3177
- # Print the discovered directories used for token substitutions
3178
- # as required by REQ-078: one item per line prefixed with '- '.
3179
- guidelines_items = generate_guidelines_file_items()
3180
-
3181
- if guidelines_items:
3182
- for entry in guidelines_items:
3183
- print(f"- {entry}")
3184
- else:
3185
- print("The folder %%GUIDELINES_FILES%% does not contain any files")
3249
+ # SRS-513..SRS-516: compact packaged-resource report; SRS-515 keeps every
3250
+ # reported path lexical, so symbolic links are never resolved here.
3251
+ home_value = format_home_relative_path(home_dir())
3252
+ print(f"Installation completed successfully in {home_value}")
3253
+ _print_resource_report()
3186
3254
 
3187
3255
 
3188
3256
  # Build and print installation report table with per-provider skills details.
@@ -4260,7 +4328,10 @@ def main(argv: Optional[list[str]] = None) -> int:
4260
4328
  run_uninstall()
4261
4329
  return 0
4262
4330
  if "--upgrade" in argv_list:
4263
- run_upgrade(use_github=("--develop" in argv_list or "--dev" in argv_list))
4331
+ run_upgrade(
4332
+ use_github=("--develop" in argv_list or "--dev" in argv_list),
4333
+ force=("--force" in argv_list),
4334
+ )
4264
4335
  _maybe_auto_install_after_upgrade(argv_list)
4265
4336
  return 0
4266
4337
  if maybe_print_version(argv_list, pypi_latest=pypi_latest_from_check):
@@ -17,7 +17,8 @@ SRS-364..366 (provider grammar), SRS-368 (SKILL.md front matter),
17
17
  SRS-371/374 (flowchart artifacts), SRS-381..390 (user-level install,
18
18
  global config, model removal), SRS-391 (runtime git resolution),
19
19
  SRS-462..SRS-494 (show providers table, installation status, alphabetical
20
- order, skills path), SRS-495 (packaged templates directory).
20
+ order, skills path), SRS-495 (packaged templates directory), SRS-513..SRS-517
21
+ (compact post-installation resource report).
21
22
  """
22
23
 
23
24
  import json
@@ -571,8 +572,8 @@ class TestGuidelinesDirectory(HomeIsolatedTestCase):
571
572
  "`~/resources/guidelines/RFC2119.md`",
572
573
  )
573
574
  self.assertEqual(
574
- cli.generate_guidelines_file_items(),
575
- ["~/resources/guidelines/RFC2119.md"],
575
+ cli.generate_guidelines_file_names(),
576
+ ["RFC2119.md"],
576
577
  )
577
578
 
578
579
  def test_guidelines_file_list_falls_back_to_directory(self) -> None:
@@ -587,6 +588,100 @@ class TestGuidelinesDirectory(HomeIsolatedTestCase):
587
588
  self.assertEqual(cli.templates_dir(), self.templates)
588
589
  self.assertEqual(cli.templates_dir(), self.resource_root / "templates")
589
590
 
591
+ def test_guidelines_enumeration_excludes_symlinks(self) -> None:
592
+ """SRS-504/SRS-507: %%GUIDELINES_FILES%% never follows symbolic links."""
593
+ # Arrange
594
+ self.guidelines.mkdir(parents=True, exist_ok=True)
595
+ (self.guidelines / "RFC2119.md").write_text("rfc\n", encoding="utf-8")
596
+ (self.guidelines / "Linked.md").symlink_to(self.guidelines / "RFC2119.md")
597
+ (self.guidelines / "LinkedDir").symlink_to(self.resource_root)
598
+ # Act
599
+ file_list = cli.generate_guidelines_file_list()
600
+ names = cli.generate_guidelines_file_names()
601
+ # Assert
602
+ self.assertEqual(file_list, "`~/resources/guidelines/RFC2119.md`")
603
+ self.assertEqual(names, ["RFC2119.md"])
604
+
605
+ def test_symlinked_guidelines_directory_falls_back_to_directory(self) -> None:
606
+ """SRS-504/SRS-507: a symlinked guidelines directory is not followed."""
607
+ # Arrange
608
+ real_dir = self.HOME / "real-guidelines"
609
+ real_dir.mkdir(parents=True)
610
+ (real_dir / "RFC2119.md").write_text("rfc\n", encoding="utf-8")
611
+ self.guidelines.symlink_to(real_dir)
612
+ # Act
613
+ file_list = cli.generate_guidelines_file_list()
614
+ # Assert
615
+ self.assertEqual(file_list, "`~/resources/guidelines/`")
616
+
617
+ def test_packaged_paths_render_lexically_without_symlink_resolution(self) -> None:
618
+ """SRS-505/SRS-507: packaged directory tokens never resolve symbolic links."""
619
+ # Arrange
620
+ shutil.rmtree(self.resource_root)
621
+ real_root = self.HOME / "real-resources"
622
+ (real_root / "guidelines").mkdir(parents=True)
623
+ (real_root / "templates").mkdir(parents=True)
624
+ self.resource_root.symlink_to(real_root)
625
+ # Act
626
+ rendered_guidelines = cli.format_home_relative_path(cli.guidelines_dir())
627
+ rendered_templates = cli.format_home_relative_path(cli.templates_dir())
628
+ # Assert
629
+ self.assertEqual(rendered_guidelines, "~/resources/guidelines")
630
+ self.assertEqual(rendered_templates, "~/resources/templates")
631
+
632
+ def test_install_reports_guidelines_and_templates_compactly(self) -> None:
633
+ """SRS-513/SRS-514/SRS-516/SRS-517: compact bare file-name resource report."""
634
+ # Arrange
635
+ self.guidelines.mkdir(parents=True, exist_ok=True)
636
+ (self.guidelines / "RFC2119.md").write_text("rfc\n", encoding="utf-8")
637
+ (self.guidelines / "Linked.md").symlink_to(self.guidelines / "RFC2119.md")
638
+ self.templates.mkdir(parents=True, exist_ok=True)
639
+ (self.templates / "Requirements_Template.md").write_text(
640
+ "tpl\n", encoding="utf-8"
641
+ )
642
+ expected_output = [
643
+ "Installation completed successfully in ~",
644
+ "Guidelines: ~/resources/guidelines/",
645
+ "RFC2119.md",
646
+ "Templates: ~/resources/templates/",
647
+ "Requirements_Template.md",
648
+ ]
649
+ # Act
650
+ with patch("sys.stdout", new_callable=io.StringIO) as mock_stdout:
651
+ rc = self.run_cli(["--enable", "codex", "install"])
652
+ lines = mock_stdout.getvalue().splitlines()
653
+ # Assert
654
+ self.assertEqual(rc, 0)
655
+ for expected_line in expected_output:
656
+ self.assertIn(expected_line, lines)
657
+ self.assertNotIn("Linked.md", mock_stdout.getvalue())
658
+ self.assertNotIn(
659
+ "~/resources/guidelines/RFC2119.md", mock_stdout.getvalue()
660
+ )
661
+
662
+ def test_install_report_keeps_symlinked_resource_root_lexical(self) -> None:
663
+ """SRS-515/SRS-517: printed resource paths never resolve symbolic links."""
664
+ # Arrange
665
+ real_root = self.HOME / "real-resources"
666
+ (real_root / "guidelines").mkdir(parents=True)
667
+ (real_root / "templates").mkdir(parents=True)
668
+ (real_root / "prompts").mkdir(parents=True)
669
+ shutil.rmtree(self.resource_root)
670
+ self.resource_root.symlink_to(real_root)
671
+ expected_output = [
672
+ "Guidelines: ~/resources/guidelines/",
673
+ "Templates: ~/resources/templates/",
674
+ ]
675
+ # Act
676
+ with patch("sys.stdout", new_callable=io.StringIO) as mock_stdout:
677
+ rc = self.run_cli(["--enable", "codex", "install"])
678
+ lines = mock_stdout.getvalue().splitlines()
679
+ # Assert
680
+ self.assertEqual(rc, 0)
681
+ for expected_line in expected_output:
682
+ self.assertIn(expected_line, lines)
683
+ self.assertNotIn(str(real_root), mock_stdout.getvalue())
684
+
590
685
  def test_install_does_not_copy_guidelines_into_project(self) -> None:
591
686
  """SRS-404: installation never writes guideline files into the project."""
592
687
  project = Path(tempfile.mkdtemp(prefix="usereq-guidelines-"))
@@ -620,6 +715,20 @@ class TestDirectoryTokenSubstitution(HomeIsolatedTestCase):
620
715
  self.assertIn("usereq/docs/REQUIREMENTS.md", content)
621
716
  self.assertIn("`src/`", content)
622
717
 
718
+ def test_directory_tokens_render_configured_lexical_values(self) -> None:
719
+ """SRS-506/SRS-507: configured directory values render without resolution."""
720
+ # Arrange
721
+ (self.HOME / "real-docs").mkdir()
722
+ (self.HOME / "docs").symlink_to(self.HOME / "real-docs")
723
+ cli.update_directory_config("docs", "tests", ["src"])
724
+ # Act
725
+ self.run_cli(["--enable", "claude", "install"])
726
+ skill = self.HOME / ".claude" / "skills" / "req-analyze" / "SKILL.md"
727
+ content = skill.read_text(encoding="utf-8")
728
+ # Assert
729
+ self.assertIn("docs/REQUIREMENTS.md", content)
730
+ self.assertNotIn("real-docs", content)
731
+
623
732
 
624
733
  class TestPackagedTemplatesDirectory(unittest.TestCase):
625
734
  """SRS-495: packaged document templates resolve under resources/templates."""
@@ -1538,7 +1647,10 @@ class TestUpgradeUninstall(unittest.TestCase):
1538
1647
  cli.run_upgrade()
1539
1648
  mock_run.assert_called_once()
1540
1649
  command = mock_run.call_args[0][0]
1541
- self.assertEqual(command, ["uv", "tool", "install", "cli-usereq", "--force"])
1650
+ self.assertEqual(
1651
+ command,
1652
+ ["uv", "tool", "install", "cli-usereq"],
1653
+ )
1542
1654
 
1543
1655
  def test_upgrade_with_github_on_linux_executes_uv_install_from_git(self) -> None:
1544
1656
  """SRS-440/SRS-452: GitHub upgrade pins the latest release tag on the git source."""
@@ -1558,7 +1670,6 @@ class TestUpgradeUninstall(unittest.TestCase):
1558
1670
  "tool",
1559
1671
  "install",
1560
1672
  "cli-usereq",
1561
- "--force",
1562
1673
  "--from",
1563
1674
  "git+https://github.com/Ogekuri/CLI-useReq.git@v9.9.9",
1564
1675
  ],
@@ -534,12 +534,51 @@ class TestOnlineUpdateCheck(unittest.TestCase):
534
534
  )
535
535
 
536
536
  def test_upgrade_command_installs_from_pypi_by_default(self) -> None:
537
- """Default upgrade command must install from the PyPI index without --from."""
537
+ """Default upgrade command must run the standard install without forcing (SRS-343)."""
538
538
  result_mock = MagicMock(returncode=0)
539
539
 
540
540
  with patch("usereq.cli.subprocess.run", return_value=result_mock) as run_mock:
541
541
  cli.run_upgrade()
542
542
 
543
+ run_mock.assert_called_once_with(
544
+ [
545
+ "uv",
546
+ "tool",
547
+ "install",
548
+ cli.TOOL_PROGRAM_NAME,
549
+ ],
550
+ check=False,
551
+ )
552
+
553
+ def test_upgrade_command_without_force_has_no_forcing_options(self) -> None:
554
+ """Standard --upgrade must run the plain install/update process (SRS-343, SRS-508).
555
+
556
+ Without --force no uv forcing option (--force, --reinstall, --refresh)
557
+ may appear in the executed command.
558
+ """
559
+ # Arrange
560
+ result_mock = MagicMock(returncode=0)
561
+
562
+ # Act
563
+ with patch("usereq.cli.subprocess.run", return_value=result_mock) as run_mock:
564
+ cli.run_upgrade()
565
+
566
+ # Assert
567
+ command = run_mock.call_args.args[0]
568
+ self.assertNotIn("--force", command)
569
+ self.assertNotIn("--reinstall", command)
570
+ self.assertNotIn("--refresh", command)
571
+
572
+ def test_upgrade_command_with_force_reinstalls_completely(self) -> None:
573
+ """--upgrade --force must force download and full reinstallation (SRS-509)."""
574
+ # Arrange
575
+ result_mock = MagicMock(returncode=0)
576
+
577
+ # Act
578
+ with patch("usereq.cli.subprocess.run", return_value=result_mock) as run_mock:
579
+ cli.run_upgrade(force=True)
580
+
581
+ # Assert
543
582
  run_mock.assert_called_once_with(
544
583
  [
545
584
  "uv",
@@ -547,6 +586,8 @@ class TestOnlineUpdateCheck(unittest.TestCase):
547
586
  "install",
548
587
  cli.TOOL_PROGRAM_NAME,
549
588
  "--force",
589
+ "--reinstall",
590
+ "--refresh",
550
591
  ],
551
592
  check=False,
552
593
  )
@@ -584,6 +625,31 @@ class TestOnlineUpdateCheck(unittest.TestCase):
584
625
 
585
626
  # Assert
586
627
  fetch_mock.assert_called_once_with(raw_tag=True)
628
+ run_mock.assert_called_once_with(
629
+ [
630
+ "uv",
631
+ "tool",
632
+ "install",
633
+ cli.TOOL_PROGRAM_NAME,
634
+ "--from",
635
+ "git+https://github.com/Ogekuri/CLI-useReq.git@v9.9.9",
636
+ ],
637
+ check=False,
638
+ )
639
+
640
+ def test_upgrade_command_with_github_and_force_reinstalls_completely(self) -> None:
641
+ """--upgrade --develop --force must force reinstall of the GitHub tag (SRS-510)."""
642
+ # Arrange
643
+ result_mock = MagicMock(returncode=0)
644
+
645
+ # Act
646
+ with (
647
+ patch("usereq.cli.fetch_github_latest_version", return_value="v9.9.9"),
648
+ patch("usereq.cli.subprocess.run", return_value=result_mock) as run_mock,
649
+ ):
650
+ cli.run_upgrade(use_github=True, force=True)
651
+
652
+ # Assert
587
653
  run_mock.assert_called_once_with(
588
654
  [
589
655
  "uv",
@@ -591,12 +657,68 @@ class TestOnlineUpdateCheck(unittest.TestCase):
591
657
  "install",
592
658
  cli.TOOL_PROGRAM_NAME,
593
659
  "--force",
660
+ "--reinstall",
661
+ "--refresh",
594
662
  "--from",
595
663
  "git+https://github.com/Ogekuri/CLI-useReq.git@v9.9.9",
596
664
  ],
597
665
  check=False,
598
666
  )
599
667
 
668
+ def test_upgrade_accepts_force_argument(self) -> None:
669
+ """--upgrade must accept the auxiliary --force argument (SRS-508)."""
670
+ # Arrange / Act
671
+ args = cli.parse_args(["--upgrade", "--force"])
672
+
673
+ # Assert
674
+ self.assertTrue(args.upgrade)
675
+ self.assertTrue(args.force)
676
+
677
+ def test_upgrade_help_documents_force_argument(self) -> None:
678
+ """Inline help must document --force as an auxiliary --upgrade argument (SRS-511)."""
679
+ # Arrange
680
+ parser = cli.build_parser()
681
+
682
+ # Act
683
+ with patch("sys.stdout", new_callable=io.StringIO) as mock_stdout:
684
+ with self.assertRaises(SystemExit):
685
+ parser.parse_args(["--help"])
686
+
687
+ # Assert
688
+ help_text = mock_stdout.getvalue()
689
+ self.assertIn("--force", help_text)
690
+ self.assertIn("--reinstall", help_text)
691
+
692
+ def test_main_upgrade_force_dispatches_forced_upgrade(self) -> None:
693
+ """main must dispatch --upgrade --force with force=True (SRS-508, SRS-509)."""
694
+ # Arrange / Act
695
+ with (
696
+ patch("usereq.cli.maybe_notify_newer_version", autospec=True),
697
+ patch("usereq.cli.run_upgrade") as upgrade_mock,
698
+ patch("usereq.cli._maybe_auto_install_after_upgrade", autospec=True),
699
+ patch("sys.stdout"),
700
+ ):
701
+ exit_code = cli.main(["--upgrade", "--force"])
702
+
703
+ # Assert
704
+ self.assertEqual(exit_code, 0)
705
+ upgrade_mock.assert_called_once_with(use_github=False, force=True)
706
+
707
+ def test_main_upgrade_develop_force_dispatches_forced_github_upgrade(self) -> None:
708
+ """main must dispatch --upgrade --develop --force with both flags (SRS-510)."""
709
+ # Arrange / Act
710
+ with (
711
+ patch("usereq.cli.maybe_notify_newer_version", autospec=True),
712
+ patch("usereq.cli.run_upgrade") as upgrade_mock,
713
+ patch("usereq.cli._maybe_auto_install_after_upgrade", autospec=True),
714
+ patch("sys.stdout"),
715
+ ):
716
+ exit_code = cli.main(["--upgrade", "--develop", "--force"])
717
+
718
+ # Assert
719
+ self.assertEqual(exit_code, 0)
720
+ upgrade_mock.assert_called_once_with(use_github=True, force=True)
721
+
600
722
  def test_upgrade_command_with_github_fails_when_tag_unfetchable(self) -> None:
601
723
  """GitHub tag-resolution failure must raise ReqError code 1 without executing uv (SRS-453)."""
602
724
  # Arrange
@@ -695,9 +817,9 @@ class TestVersionOutput(unittest.TestCase):
695
817
  self.assertEqual(
696
818
  output_lines,
697
819
  [
698
- "1.2.3",
699
- "PyPI latest: 2.3.4",
700
- "GitHub latest: 3.4.5",
820
+ "Current Installed : 1.2.3",
821
+ "Latest @ PyPI : 2.3.4",
822
+ "Latest @ GitHub : 3.4.5",
701
823
  ],
702
824
  )
703
825
 
@@ -717,9 +839,9 @@ class TestVersionOutput(unittest.TestCase):
717
839
  self.assertEqual(
718
840
  output_lines,
719
841
  [
720
- "1.2.3",
721
- "PyPI latest: unknown",
722
- "GitHub latest: unknown",
842
+ "Current Installed : 1.2.3",
843
+ "Latest @ PyPI : unknown",
844
+ "Latest @ GitHub : unknown",
723
845
  ],
724
846
  )
725
847
 
@@ -741,9 +863,9 @@ class TestVersionOutput(unittest.TestCase):
741
863
  self.assertEqual(
742
864
  output_lines,
743
865
  [
744
- "1.2.3",
745
- "PyPI latest: 2.3.4",
746
- "GitHub latest: 3.4.5",
866
+ "Current Installed : 1.2.3",
867
+ "Latest @ PyPI : 2.3.4",
868
+ "Latest @ GitHub : 3.4.5",
747
869
  ],
748
870
  )
749
871
  urlopen_mock.assert_called_once()
File without changes
File without changes