Skip to content

fix: default push title to article H1 instead of filename slug - #17

Merged
leether merged 1 commit into
mainfrom
leether/push-title-h1-fallback-20260718
Jul 18, 2026
Merged

fix: default push title to article H1 instead of filename slug#17
leether merged 1 commit into
mainfrom
leether/push-title-h1-fallback-20260718

Conversation

@leether

@leether leether commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Changed

  • scripts/orchestrator.mjs: 新增 extractH1FromMarkdown / extractH1FromFile;主流程新增 pushTitle = --title || H1 || slug,自动 relay 分支(remoteTitle)与 manual relay 命令构建(buildManualRelayCommand 调用点)统一使用。
  • CHANGELOG.md:[Unreleased] → Fixed 记录本修复。

事故背景

2026-07-18 星流涌动 7 篇系列推送时,未传 --title 的首推产出标题为「publish」的废草稿(manualTitle = args.title || slug,slug 取自 publish.md 文件名)。废草稿已用微信 draft/delete API 清理,后续 6 篇均显式传 --title 绕过。

Verification

  • node --check 通过
  • npm run check 全套 9 项 harness 契约测试通过
  • 实跑验证:不传 --title 对 articles/2026-07-19-token-factory-era/publish.md 跑管线,生成的推送命令为 --title 'Token 工厂时代:英伟达的全栈与中国拼图',不再退化为 publish

Residual risk

  • buildManualRelayCommand 内部仍保留 title || slug 兜底(防御性),当前调用点已恒传 pushTitle。
  • relay 侧 create_wechat_draft.mjs 无改动,仅接收更正确的 --title 值。

Claim level

repo-verified: 本地测试与干跑验证;生产事故来自 2026-07-18 真实推送回执。

Without --title, both relay push paths fell back to the input filename
slug, producing WeChat drafts literally titled 'publish' (2026-07-18
production incident, waste draft cleaned up via draft/delete API).

Add extractH1FromMarkdown/extractH1FromFile and a single pushTitle
chain (--title > H1 > slug) used by both the automatic relay branch
and the manual relay command builder.
@leether
leether merged commit f5f0a97 into main Jul 18, 2026
2 checks passed
@leether
leether deleted the leether/push-title-h1-fallback-20260718 branch July 18, 2026 13:47
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