cli-usereq 0.75.23__tar.gz → 0.75.24__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 (48) hide show
  1. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/PKG-INFO +2 -2
  2. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/README.md +1 -1
  3. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/pyproject.toml +1 -1
  4. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/__init__.py +1 -1
  5. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/cli.py +9 -4
  6. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/config_schema.py +1 -1
  7. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/static_check.py +154 -76
  8. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/table_style.py +46 -0
  9. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/uv.lock +1 -1
  10. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/LICENSE +0 -0
  11. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/MANIFEST.in +0 -0
  12. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/setup.cfg +0 -0
  13. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/setup.py +0 -0
  14. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/__main__.py +0 -0
  15. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/compress.py +0 -0
  16. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/compress_files.py +0 -0
  17. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/config_cli.py +0 -0
  18. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/doxygen_parser.py +0 -0
  19. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/find_constructs.py +0 -0
  20. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/generate_markdown.py +0 -0
  21. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/guidelines/Google_C++_Style_Guide.md +0 -0
  22. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/guidelines/Google_Python_Style_Guide.md +0 -0
  23. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/guidelines/Google_TypeScript_Style_Guide.md +0 -0
  24. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/guidelines/RFC2119.md +0 -0
  25. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/analyze.md +0 -0
  26. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/change.md +0 -0
  27. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/check.md +0 -0
  28. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/cover.md +0 -0
  29. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/create.md +0 -0
  30. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/fix.md +0 -0
  31. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/flowchart.md +0 -0
  32. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/implement.md +0 -0
  33. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/new.md +0 -0
  34. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/orchestrate.md +0 -0
  35. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/readme.md +0 -0
  36. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/recreate.md +0 -0
  37. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/refactor.md +0 -0
  38. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/references.md +0 -0
  39. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/renumber.md +0 -0
  40. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/workflow.md +0 -0
  41. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts/write.md +0 -0
  42. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/prompts-version.txt +0 -0
  43. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/templates/Agentic_Text_Authoring_Guidance.md +0 -0
  44. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/templates/Document_Source_Code_in_Doxygen_Style.md +0 -0
  45. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/templates/HDT_Test_Authoring_Guide.md +0 -0
  46. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/resources/templates/Requirements_Template.md +0 -0
  47. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/source_analyzer.py +0 -0
  48. {cli_usereq-0.75.23 → cli_usereq-0.75.24}/src/usereq/token_counter.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cli-usereq
3
- Version: 0.75.23
3
+ Version: 0.75.24
4
4
  Summary: Initialize a project with prompts, agents, and templates from the useReq repository.
5
5
  Author: Ogekuri
6
6
  License-Expression: GPL-3.0-only
@@ -35,7 +35,7 @@ Dynamic: license-file
35
35
  > * **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.
36
36
  > * **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.
37
37
 
38
- # useReq / req (0.75.23)
38
+ # useReq / req (0.75.24)
39
39
 
40
40
  <p align="center">
41
41
  <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.75.23)
13
+ # useReq / req (0.75.24)
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.75.23"
7
+ version = "0.75.24"
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"
@@ -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.23"
21
+ __version__ = "0.75.24"
22
22
  """! @brief Semantic version string of the package."""
23
23
 
24
24
 
@@ -3117,15 +3117,16 @@ def run_audit(args: Namespace) -> None:
3117
3117
  when provided and never requires it (SRS-621, SRS-622); loads the static-check entries
3118
3118
  from `~/.config/usereq/config.json`, resolving the SRS-424 default configuration when
3119
3119
  the `"static-check"` key is absent (SRS-623); audits only `Command` entries through
3120
- `shutil.which(cmd)` (SRS-624) and prints exactly one audit table with `Language`,
3120
+ `shutil.which(cmd)` with the SRS-643 `<prj-base>/node_modules/.bin/<cmd>` fallback
3121
+ (SRS-624) and prints exactly one audit table with `Language`,
3121
3122
  `Static-Check`, and `Installed` columns whose `Static-Check` cells render the complete
3122
3123
  checker command (`cmd` followed by every `params` element in stored order, SRS-627)
3123
- and whose `Installed` cells render `yes`/`no` per `PATH` resolution (SRS-640)
3124
+ and whose `Installed` cells render `yes`/`no` per SRS-643 resolution (SRS-640)
3124
3125
  (SRS-625, SRS-626). No checker subprocess executes, so individual unavailable binaries
3125
3126
  never change the exit code (SRS-628). Complexity: O(E) over E configured entries.
3126
3127
  Side effects: one stdout audit-table emission.
3127
3128
  @throws ReqError If a provided `--prj-base` is absent or does not exist (SRS-395).
3128
- @satisfies SRS-621, SRS-622, SRS-623, SRS-624, SRS-625, SRS-626, SRS-627, SRS-628, SRS-640
3129
+ @satisfies SRS-621, SRS-622, SRS-623, SRS-624, SRS-625, SRS-626, SRS-627, SRS-628, SRS-640, SRS-643
3129
3130
  """
3130
3131
  from .static_check import audit_static_check_installation
3131
3132
 
@@ -3133,7 +3134,7 @@ def run_audit(args: Namespace) -> None:
3133
3134
  if prj_base is not None:
3134
3135
  _require_prj_base(args)
3135
3136
  static_check_config = load_static_check_from_config()
3136
- audit_rows = audit_static_check_installation(static_check_config)
3137
+ audit_rows = audit_static_check_installation(static_check_config, prj_base)
3137
3138
  table_rows = [
3138
3139
  [language, label, "yes" if installed else "no"]
3139
3140
  for language, label, installed in audit_rows
@@ -4300,6 +4301,8 @@ def run_files_static_check_cmd(files: list[str], args: Namespace) -> int:
4300
4301
  Command `cargo` entries dispatch crate-level `<cmd> [params...]` with the subprocess
4301
4302
  working directory set to the input file's parent directory (SRS-632).
4302
4303
  Dispatch context provides project root for checker runtime execution.
4304
+ Configured entries whose SRS-427 pre-flight availability probe fails are skipped silently,
4305
+ produce no output, and contribute no failure (SRS-428).
4303
4306
  All checks execute with `fail_only=True`: passing checks produce no stdout output (SRS-253).
4304
4307
  The command ignores `"scan-by-dir"` and always dispatches per explicit input file (SRS-591).
4305
4308
  Overall exit code: max of all per-file codes (0=all pass, 1=any fail). (SRS-253, SRS-255)
@@ -4387,6 +4390,8 @@ def run_project_static_check_cmd(args: Namespace) -> int:
4387
4390
  module-native exclusion flags (SRS-590); Command `cargo` invocations receive no
4388
4391
  exclusion flags and rely on cargo manifest dependency-graph discovery (SRS-634).
4389
4392
  Dispatch context provides project root for checker runtime execution.
4393
+ Configured entries whose SRS-427 pre-flight availability probe fails are skipped silently,
4394
+ produce no output, and contribute no failure (SRS-428).
4390
4395
  All checks execute with `fail_only=True`: passing checks produce no stdout output (SRS-256).
4391
4396
  When the selection contains zero supported source files, prints the canonical
4392
4397
  `EMPTY_STATIC_CHECK_DIRECTIVE` system-directive payload to stdout and returns 0 instead
@@ -200,7 +200,7 @@ DEFAULT_STATIC_CHECK: dict[str, list[dict[str, Any]]] = {
200
200
  ],
201
201
  "TypeScript": [
202
202
  {"module": "Command", "cmd": "eslint"},
203
- {"module": "Command", "cmd": "tsc", "params": ["--noEmit"]},
203
+ {"module": "Command", "cmd": "tsc", "params": ["--noEmit", "--ignoreConfig"]},
204
204
  ],
205
205
  }
206
206
  """! @brief Default static-check configuration applied when the configuration stores no
@@ -7,7 +7,7 @@
7
7
  `dispatch_static_check_for_directory`, `entry_scan_by_dir`, `STATIC_CHECK_LANG_CANONICAL`,
8
8
  and `STATIC_CHECK_EXT_TO_LANG` for `--enable-static-check`, `files-static-check`
9
9
  and `static-check` subcommand support, and `audit_static_check_installation` for the
10
- `audit` subcommand installation audit (SRS-621..SRS-628).
10
+ `audit` subcommand installation audit (SRS-621..SRS-628, SRS-643).
11
11
  Class hierarchy: StaticCheckBase (Dummy) -> StaticCheckPylance, StaticCheckRuff, StaticCheckCommand.
12
12
  File resolution supports: explicit file paths, glob patterns (with full `**` recursive expansion),
13
13
  and direct-children-only directory traversal. No custom `--recursive` flag; recursive traversal
@@ -25,6 +25,7 @@ from __future__ import annotations
25
25
 
26
26
  import glob
27
27
  import importlib.util
28
+ import os
28
29
  import shutil
29
30
  import subprocess
30
31
  import sys
@@ -300,9 +301,10 @@ def dispatch_static_check_for_file(
300
301
  - `"Ruff"` -> `StaticCheckRuff`
301
302
  - `"Command"` -> `StaticCheckCommand` (requires `"cmd"` key)
302
303
  Instantiates the checker with `inputs=[filepath]`, `extra_args=params`, and `fail_only`.
303
- For Pylance, forwards `project_base` runtime context.
304
+ For Pylance and Command, forwards `project_base` runtime context; Command uses it for
305
+ the SRS-643 `<prj-base>/node_modules/.bin/<cmd>` availability fallback (SRS-645).
304
306
  Delegates actual check to `checker.run()`.
305
- @see SRS-261, SRS-253, SRS-256, SRS-341
307
+ @see SRS-261, SRS-253, SRS-256, SRS-341, SRS-645
306
308
  """
307
309
  module = lang_config.get("module", "")
308
310
  params: List[str] = lang_config.get("params", [])
@@ -327,7 +329,13 @@ def dispatch_static_check_for_file(
327
329
  f"Error: Command module requires 'cmd' in static-check config for '{filepath}'.",
328
330
  1,
329
331
  )
330
- checker = StaticCheckCommand(cmd=cmd, inputs=[filepath], extra_args=params, fail_only=fail_only)
332
+ checker = StaticCheckCommand(
333
+ cmd=cmd,
334
+ inputs=[filepath],
335
+ extra_args=params,
336
+ fail_only=fail_only,
337
+ project_base=project_base,
338
+ )
331
339
  else:
332
340
  raise ReqError(
333
341
  f"Error: unknown static-check module '{module}'. "
@@ -358,10 +366,12 @@ def dispatch_static_check_for_directory(
358
366
  @throws ReqError If module is unknown, or Command module is missing `"cmd"`.
359
367
  @details Mirrors `dispatch_static_check_for_file` checker construction, then executes
360
368
  exactly one `run_directory(...)` invocation with the root directory as target.
369
+ Forwards `project_base` to Command checkers for the SRS-643 availability fallback
370
+ (SRS-645).
361
371
  Directory-scan eligibility is decided by the caller through `entry_scan_by_dir`
362
372
  (SRS-584, SRS-585, SRS-588).
363
373
  @see dispatch_static_check_for_file, entry_scan_by_dir
364
- @satisfies SRS-588, SRS-589, SRS-590
374
+ @satisfies SRS-588, SRS-589, SRS-590, SRS-645
365
375
  """
366
376
  module = lang_config.get("module", "")
367
377
  params: List[str] = lang_config.get("params", [])
@@ -387,7 +397,11 @@ def dispatch_static_check_for_directory(
387
397
  1,
388
398
  )
389
399
  checker = StaticCheckCommand(
390
- cmd=cmd, inputs=[], extra_args=params, fail_only=fail_only
400
+ cmd=cmd,
401
+ inputs=[],
402
+ extra_args=params,
403
+ fail_only=fail_only,
404
+ project_base=project_base,
391
405
  )
392
406
  else:
393
407
  raise ReqError(
@@ -399,27 +413,59 @@ def dispatch_static_check_for_directory(
399
413
 
400
414
 
401
415
  # ---------------------------------------------------------------------------
402
- # Installation audit helpers (SRS-621..SRS-628)
416
+ # Installation audit helpers (SRS-621..SRS-628, SRS-643)
403
417
  # ---------------------------------------------------------------------------
404
418
 
405
- def _audit_command_entry_installation(entry: Mapping[str, object]) -> tuple[bool, str]:
419
+ def _resolve_command_installation(
420
+ cmd: str, prj_base: Optional[str] = None
421
+ ) -> Optional[str]:
422
+ """!
423
+ @brief Resolve one external command binary through `PATH` with the project-local fallback.
424
+ @param cmd {str} External command name to resolve.
425
+ @param prj_base {Optional[str]} Optional project-base directory enabling the SRS-643
426
+ `<prj-base>/node_modules/.bin/<cmd>` fallback probe.
427
+ @return {Optional[str]} Resolved executable path: the `shutil.which(cmd)` match when
428
+ the command resolves on `PATH`, otherwise the project-local bin path when it exists
429
+ as a regular file with execute permission, otherwise `None`.
430
+ @details `PATH` resolution stays authoritative and drives both the audit verdict and the
431
+ SRS-427 `Command` checker pre-flight; the SRS-643 fallback runs only when `prj_base` is
432
+ accepts the candidate only when `os.path.isfile` and `os.access(..., os.X_OK)` hold.
433
+ No subprocess executes. Complexity: O(1). Side effects: none.
434
+ @see _audit_command_entry_installation, StaticCheckCommand.is_available
435
+ @satisfies SRS-427, SRS-624, SRS-643
436
+ """
437
+ resolved = shutil.which(cmd)
438
+ if resolved is not None:
439
+ return resolved
440
+ if prj_base:
441
+ candidate = os.path.join(prj_base, "node_modules", ".bin", cmd)
442
+ if os.path.isfile(candidate) and os.access(candidate, os.X_OK):
443
+ return candidate
444
+ return None
445
+
446
+
447
+ def _audit_command_entry_installation(
448
+ entry: Mapping[str, object], prj_base: Optional[str] = None
449
+ ) -> tuple[bool, str]:
406
450
  """!
407
451
  @brief Resolve the installation state and the complete audit command of one `Command` static-check entry.
408
452
  @param entry {Mapping[str, object]} Raw `Command` entry mapping holding `"cmd"` and the optional `"params"` list.
453
+ @param prj_base {Optional[str]} Optional project-base directory enabling the SRS-643
454
+ `<prj-base>/node_modules/.bin/<cmd>` fallback probe.
409
455
  @return {tuple[bool, str]} Tuple `(installed, command_label)` where `installed` resolves
410
- through the SRS-427 availability probe (`shutil.which(cmd)` `PATH` lookup) and
411
- `command_label` is the complete checker command: the `cmd` token followed by every
412
- `params` element in stored order, each separated by one space (SRS-627), or the
413
- empty string when `cmd` is absent or not a non-empty string.
414
- @details Reuses the `StaticCheckCommand` availability probe so the audit verdict
415
- matches the execution pre-flight exactly (SRS-427, SRS-624). A `Command` entry
416
- without a non-empty string `cmd` resolves as not installed with an empty label.
417
- `params` entries render through their string form in stored order so the label
418
- stays deterministic; a non-list `params` contributes no tokens. No checker
419
- subprocess executes: only constructor and `is_available()` calls run.
456
+ through `_resolve_command_installation` (`shutil.which(cmd)` `PATH` lookup with the
457
+ SRS-643 project-local fallback) and `command_label` is the complete checker command:
458
+ the `cmd` token followed by every `params` element in stored order, each separated by
459
+ one space (SRS-627), or the empty string when `cmd` is absent or not a non-empty string.
460
+ @details Delegates availability resolution to `_resolve_command_installation` so the
461
+ audit verdict keeps the SRS-427 `PATH` semantics and adds the SRS-643 fallback only
462
+ when `prj_base` is provided. A `Command` entry without a non-empty string `cmd`
463
+ resolves as not installed with an empty label. `params` entries render through their
464
+ string form in stored order so the label stays deterministic; a non-list `params`
465
+ contributes no tokens. No checker subprocess executes.
420
466
  Complexity: O(P) over P params. Side effects: none.
421
- @see audit_static_check_installation
422
- @satisfies SRS-624, SRS-627
467
+ @see audit_static_check_installation, _resolve_command_installation
468
+ @satisfies SRS-624, SRS-627, SRS-643
423
469
  """
424
470
  cmd_value = entry.get("cmd") if isinstance(entry, Mapping) else None
425
471
  if not isinstance(cmd_value, str) or not cmd_value:
@@ -428,20 +474,20 @@ def _audit_command_entry_installation(entry: Mapping[str, object]) -> tuple[bool
428
474
  params = entry.get("params")
429
475
  if isinstance(params, (list, tuple)):
430
476
  parts.extend(str(param) for param in params)
431
- checker = StaticCheckCommand(
432
- cmd=cmd_value, inputs=[], extra_args=None, fail_only=True
433
- )
434
- available, _reason = checker.is_available()
435
- return available, " ".join(parts)
477
+ installed = _resolve_command_installation(cmd_value, prj_base) is not None
478
+ return installed, " ".join(parts)
436
479
 
437
480
 
438
481
  def audit_static_check_installation(
439
482
  static_check_config: Mapping[str, Sequence[Mapping[str, object]]],
483
+ prj_base: Optional[str] = None,
440
484
  ) -> list[tuple[str, str, bool]]:
441
485
  """!
442
486
  @brief Resolve the installation audit rows of the configured `Command` static-check entries.
443
487
  @param static_check_config {Mapping[str, Sequence[Mapping[str, object]]]} Static-check
444
488
  configuration keyed by canonical language name with per-language entry lists.
489
+ @param prj_base {Optional[str]} Optional project-base directory enabling the SRS-643
490
+ `<prj-base>/node_modules/.bin/<cmd>` fallback probe.
445
491
  @return {list[tuple[str, str, bool]]} One `(canonical_language, complete_command, installed)` tuple per
446
492
  configured `Command` entry, where `complete_command` renders the entry `cmd` token
447
493
  followed by every `params` element in stored order separated by one space (SRS-627);
@@ -449,10 +495,11 @@ def audit_static_check_installation(
449
495
  persisted entry insertion order within each language (SRS-626).
450
496
  @details Non-mapping entries and every internally implemented module (`Dummy`,
451
497
  `Pylance`, `Ruff`, and unknown tokens) are skipped: only `Command` entries are
452
- audited through `shutil.which(cmd)` (SRS-624). No checker subprocess executes.
453
- Complexity: O(L log L + E) over L languages and E entries. Side effects: none.
498
+ audited through `_resolve_command_installation` (SRS-624, SRS-643). No checker
499
+ subprocess executes. Complexity: O(L log L + E) over L languages and E entries.
500
+ Side effects: none.
454
501
  @see _audit_command_entry_installation
455
- @satisfies SRS-623, SRS-624, SRS-626, SRS-627
502
+ @satisfies SRS-623, SRS-624, SRS-626, SRS-627, SRS-643
456
503
  """
457
504
  rows: list[tuple[str, str, bool]] = []
458
505
  for canonical_lang in sorted(static_check_config):
@@ -461,7 +508,9 @@ def audit_static_check_installation(
461
508
  continue
462
509
  if str(entry.get("module", "")).lower() != "command":
463
510
  continue
464
- installed, command_label = _audit_command_entry_installation(entry)
511
+ installed, command_label = _audit_command_entry_installation(
512
+ entry, prj_base
513
+ )
465
514
  rows.append((canonical_lang, command_label, installed))
466
515
  return rows
467
516
 
@@ -571,9 +620,9 @@ class StaticCheckBase:
571
620
  @details
572
621
  If the resolved file list is empty a warning is printed to stderr and 0 is returned.
573
622
  Before any file is checked the SRS-427 pre-flight availability probe runs; when the
574
- checker is unavailable every file emits header, `Result: FAIL`, English evidence
575
- identifying the missing checker or binary, and one trailing blank line in both
576
- `fail_only` modes, the overall exit code is 1, and no exception is raised (SRS-428).
623
+ checker is unavailable the checker instance is skipped silently: no output in either
624
+ `fail_only` mode, exit code 0, no exception raised, and the caller continues with the
625
+ next configured static-check entry (SRS-428).
577
626
  For each file `_check_file` is called; the overall return code is the maximum of all
578
627
  per-file return codes (0 = all OK, 1 = at least one FAIL).
579
628
  When `fail_only` is True, trailing blank separator lines are emitted only for failing files.
@@ -586,17 +635,12 @@ class StaticCheckBase:
586
635
  )
587
636
  return 0
588
637
 
589
- available, reason = self.is_available()
638
+ available, _reason = self.is_available()
590
639
  if not available:
591
- for filepath in self._files:
592
- self._emit_line(self._header_line(filepath))
593
- self._emit_line("Result: FAIL")
594
- self._emit_line("Evidence:")
595
- self._emit_line(
596
- f"Error: static checker {self.LABEL} is not available: {reason}"
597
- )
598
- self._emit_line("")
599
- return 1
640
+ # SRS-428: a configured-but-unavailable checker is skipped silently; it emits no
641
+ # output, contributes no failure, and dispatch continues with the next configured
642
+ # static-check entry.
643
+ return 0
600
644
 
601
645
  overall = 0
602
646
  for filepath in self._files:
@@ -614,9 +658,11 @@ class StaticCheckBase:
614
658
  @param exclude_dirs {Sequence[str]} Absolute directory paths excluded through
615
659
  module-native flags (SRS-590).
616
660
  @return {int} Exit code: 0 on pass, 1 on fail.
617
- @details Runs the SRS-427 availability pre-flight; an unavailable checker or an
618
- unsupported directory command emits header, `Result: FAIL`, English evidence, and
619
- one trailing blank line in both fail_only modes, returns 1, and never raises (SRS-428).
661
+ @details Runs the SRS-427 availability pre-flight; an unavailable checker is skipped
662
+ silently with no output and exit code 0 while dispatch continues with the next
663
+ configured entry (SRS-428). An unsupported directory command emits header,
664
+ `Result: FAIL`, English evidence, and one trailing blank line in both fail_only
665
+ modes, returns 1, and never raises.
620
666
  Otherwise executes `_directory_command(...)` exactly once with the root directory as
621
667
  target, resolving the subprocess working directory through `_directory_cwd(target)`
622
668
  (SRS-589, SRS-633), aggregates the subprocess exit code, and renders the
@@ -624,16 +670,12 @@ class StaticCheckBase:
624
670
  (SRS-592); when `fail_only` is True a passing scan produces no output.
625
671
  @satisfies SRS-427, SRS-428, SRS-588, SRS-589, SRS-592
626
672
  """
627
- available, reason = self.is_available()
673
+ available, _reason = self.is_available()
628
674
  if not available:
629
- self._emit_line(self._header_line(target))
630
- self._emit_line("Result: FAIL")
631
- self._emit_line("Evidence:")
632
- self._emit_line(
633
- f"Error: static checker {self.LABEL} is not available: {reason}"
634
- )
635
- self._emit_line("")
636
- return 1
675
+ # SRS-428: a configured-but-unavailable checker is skipped silently; it emits no
676
+ # output, contributes no failure, and dispatch continues with the next configured
677
+ # static-check entry.
678
+ return 0
637
679
  exclude_args: List[str] = []
638
680
  for exclude_dir in exclude_dirs:
639
681
  exclude_args.extend(self._dir_exclude_tokens(exclude_dir))
@@ -990,9 +1032,14 @@ class StaticCheckCommand(StaticCheckBase):
990
1032
  @details Derived from `StaticCheckBase`; overrides `_check_file` to invoke the user-supplied
991
1033
  `cmd` as a subprocess.
992
1034
  Header label: `Command[<cmd>]`.
993
- `cmd` availability is resolved at execution time by the SRS-427 pre-flight via
994
- `shutil.which`; an unavailable `cmd` yields a per-file `Result: FAIL` outcome with
995
- English evidence and execution continues (SRS-428); the constructor does not raise.
1035
+ `cmd` availability is resolved by the SRS-427 pre-flight through
1036
+ `_resolve_command_installation`: `shutil.which(cmd)` on `PATH` first, then the SRS-643
1037
+ `<prj-base>/node_modules/.bin/<cmd>` executable-regular-file fallback when a project base
1038
+ is supplied. PATH-resolved commands keep the literal `<cmd>` subprocess `argv[0]` form
1039
+ (SRS-244); fallback-resolved commands execute the resolved binary path (SRS-645).
1040
+ An unavailable `cmd` skips this checker silently with no output and no failure
1041
+ contribution while dispatch continues with the next configured entry (SRS-428); the
1042
+ constructor does not raise.
996
1043
  @see StaticCheckBase
997
1044
  @satisfies SRS-427, SRS-428
998
1045
  """
@@ -1004,31 +1051,55 @@ class StaticCheckCommand(StaticCheckBase):
1004
1051
  extra_args: Optional[Sequence[str]] = None,
1005
1052
  *,
1006
1053
  fail_only: bool = False,
1054
+ project_base: Optional[Path] = None,
1007
1055
  ) -> None:
1008
1056
  """!
1009
- @brief Initialize the command checker.
1010
- @param cmd External command name (availability resolved by the SRS-427 pre-flight).
1011
- @param inputs Raw path/pattern/directory entries from CLI.
1012
- @param extra_args Additional CLI arguments forwarded to the external command.
1013
- @param fail_only When True, suppress all stdout output for passing checks (SRS-244).
1014
- @details Stores `cmd` and sets `LABEL` dynamically to `Command[<cmd>]`.
1057
+ @brief Initialize the command checker with optional project-local resolution context.
1058
+ @param cmd {str} External command name (availability resolved by the SRS-427 pre-flight).
1059
+ @param inputs {Sequence[str]} Raw path/pattern/directory entries from CLI.
1060
+ @param extra_args {Optional[Sequence[str]]} Additional CLI arguments forwarded to the
1061
+ external command.
1062
+ @param fail_only {bool} When True, suppress all stdout output for passing checks (SRS-244).
1063
+ @param project_base {Optional[Path]} Project base enabling the SRS-643
1064
+ `<prj-base>/node_modules/.bin/<cmd>` availability fallback.
1015
1065
  @return {None} Function return value.
1066
+ @details Stores `cmd`, resolves and stores the project base, sets `LABEL` dynamically
1067
+ to `Command[<cmd>]`, and initializes `self._resolved_cmd` to `None`; the fallback
1068
+ binary path is filled by `is_available()` when availability resolves through the
1069
+ SRS-643 project-local fallback and consumed as subprocess `argv[0]`.
1070
+ @satisfies SRS-427, SRS-645
1016
1071
  """
1017
1072
  self._cmd = cmd
1018
1073
  self.LABEL = f"Command[{cmd}]"
1074
+ self._project_base = project_base.resolve() if project_base is not None else None
1075
+ self._resolved_cmd: Optional[str] = None
1019
1076
  super().__init__(inputs=inputs, extra_args=extra_args, fail_only=fail_only)
1020
1077
 
1021
1078
  def is_available(self) -> tuple[bool, str]:
1022
1079
  """!
1023
- @brief Probe the external command binary on PATH.
1024
- @return {tuple[bool, str]} `(False, reason)` when `shutil.which(self._cmd)` is `None`;
1080
+ @brief Probe the external command binary through the SRS-643 resolution.
1081
+ @return {tuple[bool, str]} `(False, reason)` when neither `shutil.which(self._cmd)` nor
1082
+ the `<prj-base>/node_modules/.bin/<cmd>` fallback resolves an executable regular file;
1025
1083
  `(True, "")` otherwise.
1026
- @details Availability of the checker binary is required before any subprocess dispatch
1027
- (SRS-427); unavailability is reported as FAIL evidence without raising (SRS-428).
1028
- @satisfies SRS-427, SRS-428
1084
+ @details Delegates to `_resolve_command_installation` (SRS-643): `PATH` resolution first,
1085
+ then the project-local bin probe when a project base is supplied. When availability
1086
+ resolves through the project-local fallback, the resolved executable path is cached
1087
+ in `self._resolved_cmd` and consumed as subprocess `argv[0]` so per-file and
1088
+ directory invocations execute the resolved binary (SRS-645); PATH-resolved commands
1089
+ keep `self._resolved_cmd` as `None` and the literal `<cmd>` `argv[0]` form (SRS-244).
1090
+ On failure `run()`/`run_directory()` skip this checker silently (SRS-427, SRS-428).
1091
+ @see _resolve_command_installation
1092
+ @satisfies SRS-427, SRS-428, SRS-643, SRS-645
1029
1093
  """
1030
- if shutil.which(self._cmd) is None:
1031
- return False, f"command '{self._cmd}' is not available on PATH"
1094
+ resolved = _resolve_command_installation(
1095
+ self._cmd, str(self._project_base) if self._project_base else None
1096
+ )
1097
+ if resolved is None:
1098
+ self._resolved_cmd = None
1099
+ return False, (
1100
+ f"command '{self._cmd}' is not available on PATH or in the project-local bin directory"
1101
+ )
1102
+ self._resolved_cmd = None if shutil.which(self._cmd) is not None else resolved
1032
1103
  return True, ""
1033
1104
 
1034
1105
  def _check_file(self, filepath: str) -> int:
@@ -1041,17 +1112,21 @@ class StaticCheckCommand(StaticCheckBase):
1041
1112
  Crate-level commands (SRS-632, `_CRATE_LEVEL_COMMANDS`) invoke
1042
1113
  `<cmd> [extra_args...]` without the filepath, executing with the subprocess working
1043
1114
  directory set to the input file's parent directory.
1115
+ Executes `self._resolved_cmd` as `argv[0]` when availability resolved through the
1116
+ SRS-643 project-local fallback, keeping the literal `cmd` `argv[0]` form otherwise
1117
+ (SRS-645, SRS-244).
1044
1118
  Captures combined stdout+stderr.
1045
1119
  When `fail_only` is False: prints header, then `Result: OK` or `Result: FAIL` with evidence.
1046
1120
  When `fail_only` is True: on pass produces no output; on fail emits header, FAIL, evidence (SRS-244).
1047
1121
  @satisfies SRS-244, SRS-253, SRS-256, SRS-632
1048
1122
  """
1123
+ executable = self._resolved_cmd or self._cmd
1049
1124
  if self._cmd.strip().lower() in _CRATE_LEVEL_COMMANDS:
1050
1125
  cwd: Optional[str] = str(Path(filepath).parent)
1051
- cmd = [self._cmd] + self._extra_args
1126
+ cmd = [executable] + self._extra_args
1052
1127
  else:
1053
1128
  cwd = None
1054
- cmd = [self._cmd] + self._extra_args + [filepath]
1129
+ cmd = [executable] + self._extra_args + [filepath]
1055
1130
  try:
1056
1131
  result = subprocess.run(
1057
1132
  cmd,
@@ -1097,17 +1172,20 @@ class StaticCheckCommand(StaticCheckBase):
1097
1172
  @brief Build the external command for one recursive directory-scan invocation.
1098
1173
  @param target {str} Absolute root directory path passed as the command target.
1099
1174
  @param exclude_args {Sequence[str]} SRS-590 exclusion tokens for this `cmd`.
1100
- @return {Optional[List[str]]} `[<cmd>, <extra_args>..., <exclude_args>..., <target>]`;
1101
- `[<cmd>, <extra_args>...]` for crate-level commands (SRS-633).
1175
+ @return {Optional[List[str]]} `[<resolved-cmd>, <extra_args>..., <exclude_args>...,
1176
+ <target>]`; `[<resolved-cmd>, <extra_args>...]` for crate-level commands (SRS-633).
1177
+ `<resolved-cmd>` is `self._resolved_cmd` (SRS-643 fallback binary path) when set,
1178
+ falling back to `cmd` (SRS-645, SRS-244).
1102
1179
  @details Execution order keeps the per-file form `<cmd> [params...] <target>` with the
1103
1180
  root directory replacing the filename (SRS-588). Crate-level commands omit both the
1104
1181
  exclusion tokens (SRS-634) and the target path; targeting happens through the
1105
1182
  subprocess working directory resolved by `_directory_cwd` (SRS-633).
1106
1183
  @satisfies SRS-588, SRS-633, SRS-634
1107
1184
  """
1185
+ executable = self._resolved_cmd or self._cmd
1108
1186
  if self._cmd.strip().lower() in _CRATE_LEVEL_COMMANDS:
1109
- return [self._cmd, *self._extra_args]
1110
- return [self._cmd, *self._extra_args, *exclude_args, target]
1187
+ return [executable, *self._extra_args]
1188
+ return [executable, *self._extra_args, *exclude_args, target]
1111
1189
 
1112
1190
  def _directory_cwd(self, target: str) -> Optional[str]:
1113
1191
  """!
@@ -81,6 +81,52 @@ TABLE_BORDER_GLYPHS = frozenset(
81
81
  @details Cell payload characters never appear in this set, so colorization preserves payload text.
82
82
  """
83
83
 
84
+ TABLE_HEADER_DOWN_JUNCTION = "╤"
85
+ """! @brief Downward single-vertical double-horizontal junction glyph reserved by the SRS-641 separator vocabulary."""
86
+
87
+ TABLE_HEADER_UP_JUNCTION = "╧"
88
+ """! @brief Upward single-vertical double-horizontal junction glyph reserved by the SRS-641 separator vocabulary."""
89
+
90
+ TABLE_BASE_GLYPHS = frozenset(
91
+ TABLE_TOP_LEFT
92
+ + TABLE_TOP_RIGHT
93
+ + TABLE_BOTTOM_LEFT
94
+ + TABLE_BOTTOM_RIGHT
95
+ + TABLE_HORIZONTAL
96
+ + TABLE_VERTICAL
97
+ + TABLE_TOP_JUNCTION
98
+ + TABLE_BOTTOM_JUNCTION
99
+ + TABLE_ROW_LEFT
100
+ + TABLE_ROW_JUNCTION
101
+ + TABLE_ROW_RIGHT
102
+ )
103
+ """!
104
+ @brief Single-line base glyph set permitted in every CLI-generated table (SRS-641).
105
+ @details Rounded corners `╭╮╰╯`, content separator `│`, horizontal filler `─`, top and bottom column junctions `┬┴`, and inter-row separator junctions `├┼┤`; table cell payload characters never belong to this set.
106
+ @satisfies SRS-641
107
+ """
108
+
109
+ TABLE_SEPARATOR_GLYPHS = frozenset(
110
+ TABLE_HEADER_FILL
111
+ + TABLE_HEADER_LEFT
112
+ + TABLE_HEADER_JUNCTION
113
+ + TABLE_HEADER_RIGHT
114
+ + TABLE_HEADER_DOWN_JUNCTION
115
+ + TABLE_HEADER_UP_JUNCTION
116
+ )
117
+ """!
118
+ @brief Double-line separator glyph set permitted in every CLI-generated table (SRS-641).
119
+ @details Header-separator glyphs `═╞╪╡` emitted by `header_separator` plus the vocabulary-reserved junctions `╤` and `╧`; no composer emits the reserved junctions today.
120
+ @satisfies SRS-641
121
+ """
122
+
123
+ TABLE_STRUCTURAL_GLYPHS = TABLE_BASE_GLYPHS | TABLE_SEPARATOR_GLYPHS
124
+ """!
125
+ @brief Complete structural glyph vocabulary of every CLI-generated table (SRS-641).
126
+ @details Union of `TABLE_BASE_GLYPHS` and `TABLE_SEPARATOR_GLYPHS`; every structural character of every CLI-generated table MUST belong to this 17-glyph set (SRS-641), while cell content colors and fonts stay unconstrained (SRS-642).
127
+ @satisfies SRS-641, SRS-642
128
+ """
129
+
84
130
 
85
131
  def top_border(widths: Sequence[int]) -> str:
86
132
  """!
@@ -101,7 +101,7 @@ wheels = [
101
101
 
102
102
  [[package]]
103
103
  name = "cli-usereq"
104
- version = "0.75.23"
104
+ version = "0.75.24"
105
105
  source = { editable = "." }
106
106
  dependencies = [
107
107
  { name = "bandit" },
File without changes
File without changes
File without changes
File without changes