Commit 407b559
authored
feat(help): hard-gate empty positional
Why
- `opencli twitter followers --help` rendered:
Arguments:
user
with a blank trailing column. Both humans and agents could not
recover the parameter's purpose without reading source. WAWQAQ
surfaced this directly: "没有说明当后面的 followers [user] [options]
如果都没填的时候,获取的是什么?"
- This is metadata completeness, not stylistic taste. Failing closed
is the only way to keep the help surface trustworthy as adapters
land.
What
- src/build-manifest.ts: add `findManifestMetadataIssues()` that flags
any positional with empty / whitespace-only / missing `help`. Wired
into `main()` after the import-failures gate; build aborts non-zero
with a per-arg report (`site/cmd positional "name" (sourceFile)`).
- src/build-manifest.test.ts: cover the gate (positives + negatives,
scoped strictly to positionals — named flags are intentionally
out-of-scope).
- 18 adapter offenders (16 required + 2 optional) get explicit help
text:
twitter: followers/following/list-add/list-remove/list-tweets/
search/thread
reddit: search/subreddit/user/user-comments/user-posts
douyin: stats/update
bilibili: subtitle
jike: search
Optional positionals (`twitter followers/following [user]`) now
document the omit semantics — fetches the currently logged-in
account.
- CHANGELOG: document the build gate and the offender list.
Out of scope (planned follow-ups)
- Semantic-quality advisory: optional positional help should also
contain `default / omit / current / logged-in / required unless …`
keywords. That belongs to the planned Arg metadata v2 work
(`when_omitted / when_present / value_format` 3-field schema).
- Named-flag `help` quality. Named flags carry the flag name itself
in help, so a missing `help` is not as opaque; if we want to gate
those too, do it as a separate, intentional decision.
Validation
- `npm run build` → 799 entries, clean.
- `npm run typecheck` → clean.
- `npx vitest run --project unit --project adapter` → 257 + 4 files,
all green (build-manifest 13 tests, manifest gate added).
- Smoke: temporarily reverted `followers.js` help to empty → build
aborts with the exact `twitter/followers positional "user" (...)`
line; restored, build is clean again.
- `npm run check:silent-column-drop` and `check:typed-error-lint`
baselines unchanged.help text + fix 18 offenders (#1403)1 parent dc7b88d commit 407b559
20 files changed
Lines changed: 230 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
5 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2443 | 2443 | | |
2444 | 2444 | | |
2445 | 2445 | | |
2446 | | - | |
| 2446 | + | |
2447 | 2447 | | |
2448 | 2448 | | |
2449 | 2449 | | |
| |||
8491 | 8491 | | |
8492 | 8492 | | |
8493 | 8493 | | |
8494 | | - | |
| 8494 | + | |
8495 | 8495 | | |
8496 | 8496 | | |
8497 | 8497 | | |
| |||
8517 | 8517 | | |
8518 | 8518 | | |
8519 | 8519 | | |
8520 | | - | |
| 8520 | + | |
8521 | 8521 | | |
8522 | 8522 | | |
8523 | 8523 | | |
| |||
13173 | 13173 | | |
13174 | 13174 | | |
13175 | 13175 | | |
13176 | | - | |
| 13176 | + | |
13177 | 13177 | | |
13178 | 13178 | | |
13179 | 13179 | | |
| |||
19350 | 19350 | | |
19351 | 19351 | | |
19352 | 19352 | | |
19353 | | - | |
| 19353 | + | |
19354 | 19354 | | |
19355 | 19355 | | |
19356 | 19356 | | |
| |||
19408 | 19408 | | |
19409 | 19409 | | |
19410 | 19410 | | |
19411 | | - | |
| 19411 | + | |
19412 | 19412 | | |
19413 | 19413 | | |
19414 | 19414 | | |
| |||
19553 | 19553 | | |
19554 | 19554 | | |
19555 | 19555 | | |
19556 | | - | |
| 19556 | + | |
19557 | 19557 | | |
19558 | 19558 | | |
19559 | 19559 | | |
| |||
19579 | 19579 | | |
19580 | 19580 | | |
19581 | 19581 | | |
19582 | | - | |
| 19582 | + | |
19583 | 19583 | | |
19584 | 19584 | | |
19585 | 19585 | | |
| |||
19614 | 19614 | | |
19615 | 19615 | | |
19616 | 19616 | | |
19617 | | - | |
| 19617 | + | |
19618 | 19618 | | |
19619 | 19619 | | |
19620 | 19620 | | |
| |||
22375 | 22375 | | |
22376 | 22376 | | |
22377 | 22377 | | |
22378 | | - | |
| 22378 | + | |
22379 | 22379 | | |
22380 | 22380 | | |
22381 | 22381 | | |
| |||
22409 | 22409 | | |
22410 | 22410 | | |
22411 | 22411 | | |
22412 | | - | |
| 22412 | + | |
22413 | 22413 | | |
22414 | 22414 | | |
22415 | 22415 | | |
| |||
22537 | 22537 | | |
22538 | 22538 | | |
22539 | 22539 | | |
22540 | | - | |
| 22540 | + | |
22541 | 22541 | | |
22542 | 22542 | | |
22543 | 22543 | | |
22544 | 22544 | | |
22545 | 22545 | | |
22546 | 22546 | | |
22547 | | - | |
| 22547 | + | |
22548 | 22548 | | |
22549 | 22549 | | |
22550 | 22550 | | |
| |||
22573 | 22573 | | |
22574 | 22574 | | |
22575 | 22575 | | |
22576 | | - | |
| 22576 | + | |
22577 | 22577 | | |
22578 | 22578 | | |
22579 | 22579 | | |
22580 | 22580 | | |
22581 | 22581 | | |
22582 | 22582 | | |
22583 | | - | |
| 22583 | + | |
22584 | 22584 | | |
22585 | 22585 | | |
22586 | 22586 | | |
| |||
22609 | 22609 | | |
22610 | 22610 | | |
22611 | 22611 | | |
22612 | | - | |
| 22612 | + | |
22613 | 22613 | | |
22614 | 22614 | | |
22615 | 22615 | | |
| |||
22929 | 22929 | | |
22930 | 22930 | | |
22931 | 22931 | | |
22932 | | - | |
| 22932 | + | |
22933 | 22933 | | |
22934 | 22934 | | |
22935 | 22935 | | |
| |||
22980 | 22980 | | |
22981 | 22981 | | |
22982 | 22982 | | |
22983 | | - | |
| 22983 | + | |
22984 | 22984 | | |
22985 | 22985 | | |
22986 | 22986 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
0 commit comments