Skip to content

docs(tests): complete the retired-invocation guard's scope declaration - #121

Merged
StackOverFlow11 merged 1 commit into
mainfrom
fix/retired-guard-scope-declaration
Aug 1, 2026
Merged

docs(tests): complete the retired-invocation guard's scope declaration#121
StackOverFlow11 merged 1 commit into
mainfrom
fix/retired-guard-scope-declaration

Conversation

@StackOverFlow11

Copy link
Copy Markdown
Owner

#119 新增了 WHAT IT STILL CANNOT SEE 一节、从而对这个守卫的射程作出了声明。该声明列了两条盲区,实际有四条

补的两条

③ 文件类型过滤器{.py, .md, .yaml, .txt} 之外一律不扫)—— 这条有实际实例,不是假想

  • deploy/systemd/quant-data-update.service全部存在意义就是写一条要跑的命令ExecStart=
  • pyproject.toml 同样可以

把某个退役工具接进 unit 文件或 pyproject entry point,这个守卫不会响。

tests/ 排除 —— 因为 RETIRED_INVOCATIONS 常量自身住在那里、会自我命中。代价是测试文件里的退役调用同样看不见,此前未声明。

定性

suffix 缺口是既有的、不是 #119 引入的rglob 版本有同样的过滤器)。但作出射程声明的那个 commit,要为该声明的完整性负责——这是本仓「守卫的射程要写进它自己的 docstring」那条规矩的另一半:声明得太宽是缺陷,声明得不全同样是。

不做的事

不扩 suffix 集。 那会改变守卫够得到什么,与描述它够得到什么是两回事 —— 属另一件事、要自带自己的证据,docstring 里已写明这一点。

验过,不是断言

探针(untracked-not-ignored,内容相同) 期望 实测
.md 红(牙未变) 1 failed
.sh 绿(正是新声明的盲区 3) 1 passed

tests/test_hand_anchor_record.py 23 passedruff clean,改动仅 docstring。

#119 added the WHAT IT STILL CANNOT SEE section and thereby made a claim
about this guard's reach. The claim listed two blind spots; there are
four. The suffix filter and the tests/ exclusion were both already there
before #119 - the rglob version had the same filter - so this is not a
regression, but the commit that declares a scope owns the completeness of
that declaration.

The third one has live instances rather than hypothetical ones.
deploy/systemd/quant-data-update.service exists for the sole purpose of
naming a command to run, and pyproject.toml can do the same; neither is
scanned. Wiring a retired tool into a unit file would not turn this red.

Widening the suffix set would change what the guard reaches, which is a
different act from describing what it reaches, so it is not done here and
the docstring says so.

Verified rather than asserted: an untracked .md probe still turns it red,
and an untracked .sh probe with identical content leaves it green, which
is exactly what blind spot 3 now claims.
@StackOverFlow11
StackOverFlow11 merged commit 98be920 into main Aug 1, 2026
@StackOverFlow11
StackOverFlow11 deleted the fix/retired-guard-scope-declaration branch August 1, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant