项目文件夹

文件
wehub-resource-sync 9b395f5cc3
E2E Headed Chrome / e2e-headed (macos-15) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (ubuntu-latest) (push) Has been cancelled
E2E Headed Chrome / e2e-headed (windows-latest) (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / unit-test (push) Has been cancelled
CI / bun-test (push) Has been cancelled
CI / adapter-test (push) Has been cancelled
CI / smoke-test (macos-latest) (push) Has been cancelled
CI / smoke-test (ubuntu-latest) (push) Has been cancelled
Security Audit / audit (push) Has been cancelled
Build Chrome Extension / build (push) Has been cancelled
Trigger Website Rebuild (Docs Updated) / dispatch (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:39:48 +08:00

61 行
1.8 KiB
Markdown

此文件含有模棱两可的 Unicode 字符
此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。
---
schema_version: 1.1
workflow_id: submit-story
intent: submit a new story to HN (URL or text post)
last_verified: 2026-06-02
source: global
---
## Goal
提交一条 storytitle (≤80 char) + url XOR text body。URL post 或 Ask HN / Show HN 文本 post 二选一。
## State signature
- entry: 任意 page,logged_in,title 和 url(or text) 已准备
- success: redirect to /newest 顶部出现新 story by 当前 user
## Best path
- adapter: null
- adapter_health: broken HN 无 write adapter,必须走 browser workflow
- preconditions: logged_in / title ≤ 80 char / url or text ready
- estimated_turns: 4-5
## Fallback path
实际就是唯一 pathbrowser):
1. `opencli browser open https://news.ycombinator.com/submit`
2. type title → `input[name="title"]`
3. type url → `input[name="url"]` || type text → `textarea[name="text"]` **互斥**,不能同时填)
4. click `input[type="submit"]`
5. 验证 redirect /newest,顶部新 story by 当前 user
- estimated_turns: 4-5
## Avoid
- 不要同时填 url + textHN 拒绝)
- 不要 submit 超过 daily rate limit (throw_too_fast)
- 不要重复 submit 同 URLHN dedupe → 抛 "have submitted"
- title 不带 emoji(部分 emoji 引起 form 拒收)
## Re-entry checkpoints
- 已 open /submit,form empty → step 2 起
- title filled 但 url/text 未填 → step 3 起
- form 全填但未 submit → step 4 起
- redirect /newest 且 story 出现 → 完成
## State validation
- redirect URL 含 `/newest``/item?id=<new-id>`
- /newest 顶部 story.by 等于当前 user
- title 完全匹配(HN 不修改 title
## Stale markers
- /submit form field name (`title` / `url` / `text`) 几乎不变(10 年没改 form schema
- HN 偶尔加 captcha 给 new user (< 7 天账号)