Skip to content

ops: 删除 10 个零引用 ps1 + verify-doc-ssot 迁移 Python - #1610

Merged
DeliciousBuding merged 1 commit into
masterfrom
ops/ps1-cleanup-doc-ssot
Aug 4, 2026
Merged

ops: 删除 10 个零引用 ps1 + verify-doc-ssot 迁移 Python#1610
DeliciousBuding merged 1 commit into
masterfrom
ops/ps1-cleanup-doc-ssot

Conversation

@DeliciousBuding

@DeliciousBuding DeliciousBuding commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

删除全仓零引用 ps1(引用盘点:99 个 ps1 中 10 个无任何 yml/md/script 引用):

  • hub-server/scripts/check-local-edge-target-duplicates.ps1
  • scripts/lib/evidence/verify-diff-proposal-manifest.ps1
  • scripts/release/verify-agenthub-brand-assets.ps1
  • scripts/release/verify-tauri-sidecar-runtime-evidence.ps1
  • scripts/smoke/verify-edge-sqlite-durable-hardening.ps1
  • scripts/smoke/verify-edge-sqlite-durable-observed-smoke.ps1
  • scripts/smoke/verify-product-loop-observed-e2e.ps1
  • scripts/smoke/verify-product-loop-qa.ps1
  • scripts/verify/verify-edge-cli-json-readiness.ps1
  • scripts/verify/verify-test-sleep-budget.ps1

verify-doc-ssot.ps1 → verify-doc-ssot.py 迁移(双跑对照 0 diff:147 paths / 34 script paths / 32 CI files / doc SSOT ok,rc 0/0)。ps1 保留待 CI 验证后删除。

Summary by CodeRabbit

  • Documentation

    • Added a Python-based documentation consistency check covering entry points, stale paths, required markers, links, and repository references.
  • Chores

    • Removed several legacy verification and smoke-test scripts covering database migrations, product-loop QA, release assets, sidecar packaging, SQLite durability, CLI readiness, and test sleep budgets.

Copilot AI lite review requested due to automatic review settings August 4, 2026 10:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@DeliciousBuding, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 4 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5165d4ba-3981-4e0a-8ab3-52fecfccf142

📥 Commits

Reviewing files that changed from the base of the PR and between 9b46f0c and b274ca4.

📒 Files selected for processing (11)
  • hub-server/scripts/check-local-edge-target-duplicates.ps1
  • scripts/lib/evidence/verify-diff-proposal-manifest.ps1
  • scripts/release/verify-agenthub-brand-assets.ps1
  • scripts/release/verify-tauri-sidecar-runtime-evidence.ps1
  • scripts/smoke/verify-edge-sqlite-durable-hardening.ps1
  • scripts/smoke/verify-edge-sqlite-durable-observed-smoke.ps1
  • scripts/smoke/verify-product-loop-observed-e2e.ps1
  • scripts/smoke/verify-product-loop-qa.ps1
  • scripts/verify/verify-doc-ssot.py
  • scripts/verify/verify-edge-cli-json-readiness.ps1
  • scripts/verify/verify-test-sleep-budget.ps1
📝 Walkthrough

Walkthrough

The change adds a Python documentation SSOT verifier and removes multiple PowerShell verification and smoke-test scripts. The new verifier checks repository documentation, governance references, forbidden content, path mappings, and duplicate script names.

Changes

Documentation SSOT verifier

Layer / File(s) Summary
Verifier foundation
scripts/verify/verify-doc-ssot.py
Adds repository-root discovery, coded failures, path normalization, Git file listing, text loading, and line counting.
Documentation policy checks
scripts/verify/verify-doc-ssot.py
Validates entry points, stale paths, governance dates, required markers, forbidden content, line limits, AGENTS.md paths, mapping tables, and duplicate script names.
Verifier execution and reporting
scripts/verify/verify-doc-ssot.py
Runs checks in order, reports failures, handles top-level exceptions, and returns an integer exit status.

PowerShell verifier removal

Layer / File(s) Summary
Verification and smoke-test script removal
hub-server/scripts/check-local-edge-target-duplicates.ps1, scripts/lib/evidence/verify-diff-proposal-manifest.ps1, scripts/release/*.ps1, scripts/smoke/*.ps1, scripts/verify/verify-edge-cli-json-readiness.ps1, scripts/verify/verify-test-sleep-budget.ps1
Deletes database preflight, evidence-manifest, branding, sidecar-runtime, SQLite, product-loop, Edge CLI, QA, and test-sleep verification scripts.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了删除 10 个零引用 PowerShell 脚本和将 verify-doc-ssot 迁移到 Python 两项主要变更。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ops/ps1-cleanup-doc-ssot

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/verify/verify-doc-ssot.py`:
- Around line 65-66: 更新 exists() 及 check_agents_md_paths()
使用根目录约束的路径解析逻辑:拒绝空值、绝对路径和包含 .. 的越界路径,并确保解析后的路径仍位于 ROOT 内且指向常规文件,而非目录。对映射表中每个展开后的
ref 执行该校验,避免通过跳过绝对路径绕过检查。
- Around line 129-137: The check_dated_governance function uses os.listdir which
only checks direct children of governance_dir, missing dated files in
subdirectories like docs/governance/reviews/2026-01-01.md. Replace the
os.listdir iteration with a recursive traversal (such as os.walk) that examines
all files throughout the governance_dir tree, and update the failure message to
report relative paths from the governance_dir root instead of just filenames.
- Around line 38-62: 更新 is_active_doc 及 check_forbidden_patterns
使用的活动文档判定,定义共享的活动文档清单或匹配规则,避免扫描范围分散。将根
README.md、docs/developer-quickstart.md、docs/architecture.md 及其架构子文档和其他所有 SSOT
入口文档纳入该清单,并确保禁止模式扫描复用同一判定。
- Around line 356-376: Update the validate job in `.github/workflows/checks.yml`
(around lines 818-824) to execute both the existing
`./scripts/verify/verify-doc-ssot.ps1` and the new Python verifier alongside it,
ensuring that a non-zero exit code from either verifier causes the job to fail.
Additionally, update the AGENTS.md mapping table entry for the doc-ssot verifier
to indicate that both the .ps1 and .py implementations are being executed during
this migration period, with the understanding that once Python becomes the
authoritative implementation, the mapping will be switched to reference only the
.py verifier.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1cd22f2d-2784-4d85-9649-41ab0e560310

📥 Commits

Reviewing files that changed from the base of the PR and between 899af14 and 9b46f0c.

📒 Files selected for processing (11)
  • hub-server/scripts/check-local-edge-target-duplicates.ps1
  • scripts/lib/evidence/verify-diff-proposal-manifest.ps1
  • scripts/release/verify-agenthub-brand-assets.ps1
  • scripts/release/verify-tauri-sidecar-runtime-evidence.ps1
  • scripts/smoke/verify-edge-sqlite-durable-hardening.ps1
  • scripts/smoke/verify-edge-sqlite-durable-observed-smoke.ps1
  • scripts/smoke/verify-product-loop-observed-e2e.ps1
  • scripts/smoke/verify-product-loop-qa.ps1
  • scripts/verify/verify-doc-ssot.py
  • scripts/verify/verify-edge-cli-json-readiness.ps1
  • scripts/verify/verify-test-sleep-budget.ps1
💤 Files with no reviewable changes (10)
  • scripts/smoke/verify-edge-sqlite-durable-hardening.ps1
  • scripts/smoke/verify-product-loop-observed-e2e.ps1
  • scripts/release/verify-tauri-sidecar-runtime-evidence.ps1
  • scripts/smoke/verify-edge-sqlite-durable-observed-smoke.ps1
  • scripts/release/verify-agenthub-brand-assets.ps1
  • hub-server/scripts/check-local-edge-target-duplicates.ps1
  • scripts/verify/verify-edge-cli-json-readiness.ps1
  • scripts/smoke/verify-product-loop-qa.ps1
  • scripts/lib/evidence/verify-diff-proposal-manifest.ps1
  • scripts/verify/verify-test-sleep-budget.ps1

Comment on lines +38 to +62
def is_active_doc(path: str) -> bool:
p = normalize_path(path)
if re.match(r"^docs/(archive|archives|audit|release)/", p):
return False
if p in ("AGENTS.md", "CONTRIBUTING.md", "reference/INDEX.md"):
return True
if p in ("api/README.md", "api/events.md", "api/conventions.md"):
return True
if p == "edge-server/README.md":
return True
if p in ("hub-server/README.md", "hub-server/deployments/README.md", "hub-server/tests/README.md"):
return True
if p in ("app/web/README.md", "app/desktop/README.md", "app/mobile-rn/README.md"):
return True
if p == "docs/reference/backend-performance-gates.md":
return True
if p in ("docs/README.md", "docs/history.md", "docs/decisions.md", "docs/reference/README.md", "docs/api-reference.md"):
return True
if p == "docs/roadmap.md":
return True
if re.match(r"^docs/(analysis|plan|progress|governance)/.+\.md$", p):
return True
if re.match(r"^\.agents/skills/.+\.md$", p):
return True
return False

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

将所有活动入口文档纳入禁止模式扫描。

check_forbidden_patterns() 只扫描 is_active_doc() 返回 True 的文件。该函数遗漏根 README.md,也遗漏 docs/developer-quickstart.mddocs/architecture.md 和架构子文档。任一 forbidden 模式都可进入这些受 SSOT 管理的入口文档,而检查仍会成功。

定义共享的活动文档清单,并让禁止模式扫描复用该清单。至少将根 README.md 和所有 SSOT 入口文档加入范围。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/verify/verify-doc-ssot.py` around lines 38 - 62, 更新 is_active_doc 及
check_forbidden_patterns 使用的活动文档判定,定义共享的活动文档清单或匹配规则,避免扫描范围分散。将根
README.md、docs/developer-quickstart.md、docs/architecture.md 及其架构子文档和其他所有 SSOT
入口文档纳入该清单,并确保禁止模式扫描复用同一判定。

Comment on lines +65 to +66
def exists(rel_path: str) -> bool:
return os.path.exists(os.path.join(ROOT, rel_path.replace("/", os.sep)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

限制映射表脚本路径到仓库内的常规文件。

映射表中的 ref 直接传入 exists()。空值会解析为 ROOT,绝对路径会使 os.path.join() 忽略 ROOT,目录和 .. 路径也可通过存在性检查。check_agents_md_paths() 会跳过绝对路径,因此不会阻断此路径。

使用根目录约束的路径解析器,并要求每个展开后的映射值为非空的仓库内常规文件。

建议的校验边界
+def is_repo_file(rel_path: str) -> bool:
+    if not rel_path or os.path.isabs(rel_path):
+        return False
+    root = os.path.realpath(ROOT)
+    candidate = os.path.realpath(os.path.join(root, rel_path.replace("/", os.sep)))
+    try:
+        return os.path.commonpath((root, candidate)) == root and os.path.isfile(candidate)
+    except ValueError:
+        return False
+
 ...
-                if not exists(candidate):
+                if not is_repo_file(candidate):
                     fail(f"AGENTS.md mapping table references missing path: {candidate}")

Also applies to: 327-333

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/verify/verify-doc-ssot.py` around lines 65 - 66, 更新 exists() 及
check_agents_md_paths() 使用根目录约束的路径解析逻辑:拒绝空值、绝对路径和包含 .. 的越界路径,并确保解析后的路径仍位于 ROOT
内且指向常规文件,而非目录。对映射表中每个展开后的 ref 执行该校验,避免通过跳过绝对路径绕过检查。

Comment on lines +129 to +137
def check_dated_governance() -> None:
governance_dir = os.path.join(ROOT, "docs", "governance")
dated = []
if os.path.isdir(governance_dir):
for name in os.listdir(governance_dir):
if name.endswith(".md") and re.search(r"\d{4}-\d{2}-\d{2}", name):
dated.append(name)
if dated:
fail("dated governance evidence must live in the external archive indexed by docs/history.md: " + ", ".join(sorted(dated)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

递归检查带日期的治理文档。

os.listdir(governance_dir) 只检查直接子项。docs/governance/reviews/2026-01-01.md 会被 is_active_doc() 视为活动治理文档,但不会被此检查发现。

递归遍历 docs/governance,并在失败信息中报告相对路径。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/verify/verify-doc-ssot.py` around lines 129 - 137, The
check_dated_governance function uses os.listdir which only checks direct
children of governance_dir, missing dated files in subdirectories like
docs/governance/reviews/2026-01-01.md. Replace the os.listdir iteration with a
recursive traversal (such as os.walk) that examines all files throughout the
governance_dir tree, and update the failure message to report relative paths
from the governance_dir root instead of just filenames.

Comment on lines +356 to +376
def main() -> int:
check_root_entrypoints()
check_stale_paths()
check_dated_governance()
check_readme_entrypoints()
check_required_markers()
check_forbidden_patterns()
check_max_lines()
check_agents_md_paths()
check_agents_md_mapping_table()
check_no_script_mirror()
print("doc SSOT ok")
return 0


if __name__ == "__main__":
try:
sys.exit(main())
except Exception as exc: # noqa: BLE001 —— 顶层兜底,对齐 ps1 $ErrorActionPreference='Stop'
print(f"ERROR: {exc}", file=sys.stderr)
sys.exit(1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

validate job 中执行 Python verifier。

.github/workflows/checks.yml Line 818 through Line 824 仍只执行 ./scripts/verify/verify-doc-ssot.ps1AGENTS.md 映射表也仍声明 .ps1 verifier。因此,新增 main() 当前没有 CI 调用方,Python 迁移的行为差异不会阻断合并。

迁移期间请在同一个 validate job 中双跑两个 verifier,并让任一非零退出码失败。Python 成为权威实现后,再将 AGENTS.md 映射切换到 .py

🧰 Tools
🪛 Ruff (0.16.0)

[warning] 374-374: Comment contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF003)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/verify/verify-doc-ssot.py` around lines 356 - 376, Update the
validate job in `.github/workflows/checks.yml` (around lines 818-824) to execute
both the existing `./scripts/verify/verify-doc-ssot.ps1` and the new Python
verifier alongside it, ensuring that a non-zero exit code from either verifier
causes the job to fail. Additionally, update the AGENTS.md mapping table entry
for the doc-ssot verifier to indicate that both the .ps1 and .py implementations
are being executed during this migration period, with the understanding that
once Python becomes the authoritative implementation, the mapping will be
switched to reference only the .py verifier.

@DeliciousBuding
DeliciousBuding force-pushed the ops/ps1-cleanup-doc-ssot branch from e1eeb9e to b274ca4 Compare August 4, 2026 15:08
@DeliciousBuding
DeliciousBuding merged commit a51aade into master Aug 4, 2026
26 checks passed
@DeliciousBuding
DeliciousBuding deleted the ops/ps1-cleanup-doc-ssot branch August 4, 2026 15:21
DeliciousBuding added a commit that referenced this pull request Aug 11, 2026
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.

2 participants