Skip to content

fix: 门禁豁免技术记法 / step_01 如实改名 ingest / README 门禁与 runner 说法纠正 / TAB 损坏路径修复 - #2

Merged
TryWorld2026 merged 3 commits into
mainfrom
fix/first-principles-user-gaps
Oct 24, 2026
Merged

TryWorld2026 merged 3 commits into
mainfrom
fix/first-principles-user-gaps

Conversation

@TryWorld2026

Copy link
Copy Markdown
Owner

背景

从第一性原理用户视角审查本仓库(克隆、跑通 57 项测试、实测门禁与 runner)后,修几类「文档说法与代码行为不一致 / 首次使用必踩坑」的问题。不改变任何硬门禁语义(确认闸门、sha256 绑定、交付核验退出码不变)。

改动

1. 标点豁免技术记法(实测 16:9 曾被 exit 1)

check_prose.py 新增窄豁免:只放行数字间的 16:9、4:3、12:30、2024–2026(降为可见提示)。提示性冒号、—— 破折号、带空格 12 :30、词间 – 照旧拦截。

  • 视频做成 16:9 横版,封面用 4:3 和 3:4。发布时间 12:30 与 19:30。 → exit 0(豁免提示)
  • 请注意以下三点:第一,带身份证。 → exit 1(不变)
  • 价格降了一半——这个降幅很少见。 → exit 1(不变)

2. step_01_optimize → step_01_ingest(诚实改名)

该步骤一直逐字复制输入(原注释:For now, pass through. In production, Agent would optimize here.),README 却写 01 optimize 并演示 --steps 1,2,用户会误以为 draft 已被润色。改名 + docstring/argparse/输出全部如实(这是逐字副本,优化与净化是 agent 按 SKILL.md 的活)。test_runner 三处断言同步。

3. README「禁的是修辞动作不是字面」改为如实描述(中英)

实测:换词表达同一动作可过(其实是统计,而非理解 → exit 0),而平实因果会误杀(不是因为原料贵,而是…… → exit 1)。实现是字面正则+词表,不是语义分析。新文案如实分层:5 类可拦截(标点/硬停词/绝对黑话/模型路标/翻案句式)· 约 17 类仅提示 · 换词可漏网 · 活人感本体在 workflow.md §1.2.1 七遍改稿指令。

workflow.md §1.2.1 第 5 条与 titles.md 同步口径,防散文与代码漂移。

4. 修复 TAB 损坏的路径引用(自 6f81f86 / 2026-09-01 起影响所有安装)

koubo/SKILL.md:21、topics/SKILL.md:12 的 \tryworld-paper/...、\topic_sources、\topic_rules(真实制表符吞掉路径与字段名,导致这些引用在任何安装环境都无法解析),已在 git blob 层修复。本地 ~/.agents/skills 的安装副本同样带此损坏。

5. --whitelist 接入流水线并写明可见性

脚本一直支持该参数,但全部 .md 零提及、step_02/runner 也不转发。现已接入(路径按调用方 cwd 解析为绝对路径)。豁免=删除文本不再检查,运行会打印 NOTE: 行;README 写明只宜具体词条(过宽模式清空全文则 exit 2)。

测试

  • python -m pytest tests/ -q → 65 passed(57 旧 + 8 新:豁免边界、拦截保持、白名单行为含非法正则不崩溃)
  • python -X utf8 scripts/check_skills.py → All checks passed
  • git diff --check 干净;提交 blob 全部 LF(git show <ref>:<file> | tr -cd '\r' | wc -c = 0)
  • runner 冒烟:--steps 1 输出如实提示;--dry-run --whitelist 正确转发

说明(刻意不做)

  • E:\Codex口播视频 等默认值保留:字段已参数化(content theme JSON 的 topic_dedup_dir 可改);文档中 21 处 $env:USERPROFILE 在本机 PowerShell 5.1/7 均实测有效,不做无收益的大范围替换
  • CI/Docker 仍无 ffmpeg/hyperframes,端到端出片冒烟留待有完整依赖的环境;本 PR 全部改动离线可测

验证方法

git clone -b fix/first-principles-user-gaps https://github.com/TryWorld2026/paper-algorithm.git
cd paper-algorithm && python -m pip install pytest
python -m pytest tests/ -q                      # 65 passed
python -X utf8 scripts/check_skills.py          # All checks passed

…d paths

Three first-principles user-facing defects, each verified against the suite
(57 passed) and the repo self-check (All checks passed):

1. check_prose.py: exempt technical punctuation from the colon/dash ban.
   "16:9 横版 / 封面 4:3 和 3:4 / 12:30 / 2024–2026" are unavoidable notation
   for this content genre but were hard-failing the gate (exit 1). The fix is
   narrow: only "digit : digit" and "digit – digit" (no spaces, ASCII-side)
   pass as a warning; ":", "——" and prose-colon enumeration still fail as
   before. Verified: tech.md exit 0, bad.md (三点: / ——) exit 1.

2. step_01_optimize.py -> step_01_ingest.py. The step copied the input verbatim
   yet was named "optimize" and told the user to "Review draft.md" as if it were
   polished. Renamed; docstring, argparse help, the pass-through comment and the
   "ACTION REQUIRED" output now say plainly: this is a verbatim copy, the agent
   must optimize + sanitise per SKILL.md, then run step 02. Three test_runner.py
   assertions updated from the old name to "ingest". step_02 hint updated too.

3. TAB-corruption: skills/tryworld-koubo/SKILL.md:21 and
   skills/tryworld-topics/SKILL.md:12 had "tryworld-paper" / "topic_sources" /
   "topic_rules" mangled by a lost backslash-t (a literal TAB mid-word), so the
   path/field references were never resolvable on any install. Repaired in the
   git blob (verified: tab count 1 and 3 -> 0).
@TryWorld2026
TryWorld2026 merged commit 1086213 into main Oct 24, 2026
4 checks passed
@TryWorld2026
TryWorld2026 deleted the fix/first-principles-user-gaps branch October 24, 2026 05:52
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