@wringer/gunshi 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/{build-guide-ports.d.ts → guide-command/build-guide-ports.d.ts} +1 -1
  2. package/dist/{pick-cli-outcome.d.ts → invocation/pick-cli-outcome.d.ts} +2 -2
  3. package/dist/{pick-dispatch-plan.d.ts → invocation/pick-dispatch-plan.d.ts} +1 -1
  4. package/dist/read-guide.d.ts +1 -1
  5. package/dist/resolve-lint-failures.d.ts +1 -1
  6. package/guide/create.md +8 -7
  7. package/guide/overview.md +6 -6
  8. package/guide/template/verify/SKILL.md +46 -41
  9. package/guide/template/verify.ts +1 -1
  10. package/package.json +4 -4
  11. package/src/build-cli-wringer.ts +2 -2
  12. package/src/{build-guide-command.ts → guide-command/build-guide-command.ts} +1 -1
  13. package/src/{build-guide-ports.ts → guide-command/build-guide-ports.ts} +1 -1
  14. package/src/{pick-cli-outcome.ts → invocation/pick-cli-outcome.ts} +4 -4
  15. package/src/{pick-dispatch-plan.ts → invocation/pick-dispatch-plan.ts} +2 -2
  16. package/src/{resolve-invocation.ts → invocation/resolve-invocation.ts} +2 -2
  17. package/src/{build-lint-command.ts → lint-command/build-lint-command.ts} +1 -1
  18. package/src/{read-template-hash.ts → lint-command/read-template-hash.ts} +1 -1
  19. package/src/{resolve-journey-problem.ts → lint-command/resolve-journey-problem.ts} +2 -2
  20. package/src/read-guide.ts +3 -3
  21. package/src/resolve-lint-failures.ts +12 -9
  22. package/src/run-cli.ts +9 -9
  23. package/src/wringer-gunshi.ts +2 -2
  24. /package/dist/{build-guide-command.d.ts → guide-command/build-guide-command.d.ts} +0 -0
  25. /package/dist/{build-guide-wringer.d.ts → guide-command/build-guide-wringer.d.ts} +0 -0
  26. /package/dist/{parse-guide-topic.d.ts → guide-command/parse-guide-topic.d.ts} +0 -0
  27. /package/dist/{pick-guide-data.d.ts → guide-command/pick-guide-data.d.ts} +0 -0
  28. /package/dist/{build-gunshi-args.d.ts → gunshi-commands/build-gunshi-args.d.ts} +0 -0
  29. /package/dist/{build-gunshi-commands.d.ts → gunshi-commands/build-gunshi-commands.d.ts} +0 -0
  30. /package/dist/{build-positional-args.d.ts → gunshi-commands/build-positional-args.d.ts} +0 -0
  31. /package/dist/{build-raw-args.d.ts → gunshi-commands/build-raw-args.d.ts} +0 -0
  32. /package/dist/{collect-boolean-flags-with-value.d.ts → gunshi-commands/collect-boolean-flags-with-value.d.ts} +0 -0
  33. /package/dist/{collect-flags-without-value.d.ts → gunshi-commands/collect-flags-without-value.d.ts} +0 -0
  34. /package/dist/{keep-flag-text.d.ts → gunshi-commands/keep-flag-text.d.ts} +0 -0
  35. /package/dist/{parse-arg-properties.d.ts → gunshi-commands/parse-arg-properties.d.ts} +0 -0
  36. /package/dist/{find-signed-value-flag.d.ts → invocation/find-signed-value-flag.d.ts} +0 -0
  37. /package/dist/{pick-command-name.d.ts → invocation/pick-command-name.d.ts} +0 -0
  38. /package/dist/{resolve-invocation.d.ts → invocation/resolve-invocation.d.ts} +0 -0
  39. /package/dist/{scrub-parsed-invocation.d.ts → invocation/scrub-parsed-invocation.d.ts} +0 -0
  40. /package/dist/{build-lint-command.d.ts → lint-command/build-lint-command.d.ts} +0 -0
  41. /package/dist/{check-feature-file.d.ts → lint-command/check-feature-file.d.ts} +0 -0
  42. /package/dist/{collect-dead-globs.d.ts → lint-command/collect-dead-globs.d.ts} +0 -0
  43. /package/dist/{collect-journey-commands.d.ts → lint-command/collect-journey-commands.d.ts} +0 -0
  44. /package/dist/{collect-lint-files.d.ts → lint-command/collect-lint-files.d.ts} +0 -0
  45. /package/dist/{collect-unclaimed-files.d.ts → lint-command/collect-unclaimed-files.d.ts} +0 -0
  46. /package/dist/{parse-feature-table-span.d.ts → lint-command/parse-feature-table-span.d.ts} +0 -0
  47. /package/dist/{parse-shell-words.d.ts → lint-command/parse-shell-words.d.ts} +0 -0
  48. /package/dist/{parse-skill-metadata.d.ts → lint-command/parse-skill-metadata.d.ts} +0 -0
  49. /package/dist/{read-template-hash.d.ts → lint-command/read-template-hash.d.ts} +0 -0
  50. /package/dist/{resolve-journey-problem.d.ts → lint-command/resolve-journey-problem.d.ts} +0 -0
  51. /package/dist/{build-failure-envelope.d.ts → output/build-failure-envelope.d.ts} +0 -0
  52. /package/dist/{pick-output-mode.d.ts → output/pick-output-mode.d.ts} +0 -0
  53. /package/dist/{render-envelope.d.ts → output/render-envelope.d.ts} +0 -0
  54. /package/dist/{render-human-envelope.d.ts → output/render-human-envelope.d.ts} +0 -0
  55. /package/dist/{render-human-event.d.ts → output/render-human-event.d.ts} +0 -0
  56. /package/guide/template/{verify-registry.ts → create-verify-registry.ts} +0 -0
  57. /package/src/{build-guide-wringer.ts → guide-command/build-guide-wringer.ts} +0 -0
  58. /package/src/{parse-guide-topic.ts → guide-command/parse-guide-topic.ts} +0 -0
  59. /package/src/{pick-guide-data.ts → guide-command/pick-guide-data.ts} +0 -0
  60. /package/src/{build-gunshi-args.ts → gunshi-commands/build-gunshi-args.ts} +0 -0
  61. /package/src/{build-gunshi-commands.ts → gunshi-commands/build-gunshi-commands.ts} +0 -0
  62. /package/src/{build-positional-args.ts → gunshi-commands/build-positional-args.ts} +0 -0
  63. /package/src/{build-raw-args.ts → gunshi-commands/build-raw-args.ts} +0 -0
  64. /package/src/{collect-boolean-flags-with-value.ts → gunshi-commands/collect-boolean-flags-with-value.ts} +0 -0
  65. /package/src/{collect-flags-without-value.ts → gunshi-commands/collect-flags-without-value.ts} +0 -0
  66. /package/src/{keep-flag-text.ts → gunshi-commands/keep-flag-text.ts} +0 -0
  67. /package/src/{parse-arg-properties.ts → gunshi-commands/parse-arg-properties.ts} +0 -0
  68. /package/src/{find-signed-value-flag.ts → invocation/find-signed-value-flag.ts} +0 -0
  69. /package/src/{pick-command-name.ts → invocation/pick-command-name.ts} +0 -0
  70. /package/src/{scrub-parsed-invocation.ts → invocation/scrub-parsed-invocation.ts} +0 -0
  71. /package/src/{check-feature-file.ts → lint-command/check-feature-file.ts} +0 -0
  72. /package/src/{collect-dead-globs.ts → lint-command/collect-dead-globs.ts} +0 -0
  73. /package/src/{collect-journey-commands.ts → lint-command/collect-journey-commands.ts} +0 -0
  74. /package/src/{collect-lint-files.ts → lint-command/collect-lint-files.ts} +0 -0
  75. /package/src/{collect-unclaimed-files.ts → lint-command/collect-unclaimed-files.ts} +0 -0
  76. /package/src/{parse-feature-table-span.ts → lint-command/parse-feature-table-span.ts} +0 -0
  77. /package/src/{parse-shell-words.ts → lint-command/parse-shell-words.ts} +0 -0
  78. /package/src/{parse-skill-metadata.ts → lint-command/parse-skill-metadata.ts} +0 -0
  79. /package/src/{build-failure-envelope.ts → output/build-failure-envelope.ts} +0 -0
  80. /package/src/{pick-output-mode.ts → output/pick-output-mode.ts} +0 -0
  81. /package/src/{render-envelope.ts → output/render-envelope.ts} +0 -0
  82. /package/src/{render-human-envelope.ts → output/render-human-envelope.ts} +0 -0
  83. /package/src/{render-human-event.ts → output/render-human-event.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import type { CLIPorts } from './run-cli.ts';
1
+ import type { CLIPorts } from '../run-cli.ts';
2
2
  type RepoPorts = Pick<CLIPorts, 'readRepoRoot' | 'openRepo'>;
3
3
  export declare function buildGuidePorts(selfCommand: readonly string[]): RepoPorts;
4
4
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { WringerError } from '@wringer/core';
2
- import type { Invocation } from './build-gunshi-commands.ts';
3
- import type { OutputMode } from './pick-output-mode.ts';
2
+ import type { Invocation } from '../gunshi-commands/build-gunshi-commands.ts';
3
+ import type { OutputMode } from '../output/pick-output-mode.ts';
4
4
  export type ParsedInvocation = {
5
5
  readonly kind: 'invoked';
6
6
  readonly invocation: Invocation;
@@ -1,6 +1,6 @@
1
1
  import { WringerError } from '@wringer/core';
2
2
  import type { Envelope } from '@wringer/core';
3
- import type { Invocation } from './build-gunshi-commands.ts';
3
+ import type { Invocation } from '../gunshi-commands/build-gunshi-commands.ts';
4
4
  export type DispatchPlan = {
5
5
  readonly kind: 'refuse';
6
6
  readonly envelope: Envelope;
@@ -1,3 +1,3 @@
1
- import type { Guide } from './pick-guide-data.ts';
1
+ import type { Guide } from './guide-command/pick-guide-data.ts';
2
2
  export declare const guideFolder: string;
3
3
  export declare function readGuide(folder?: string): Promise<Guide>;
@@ -1,6 +1,6 @@
1
1
  import type { Wringer } from '@wringer/core';
2
2
  import { z } from 'zod';
3
- import type { MarkdownFile } from './collect-journey-commands.ts';
3
+ import type { MarkdownFile } from './lint-command/collect-journey-commands.ts';
4
4
  export declare const lintFailureSchema: z.ZodObject<{
5
5
  check: z.ZodEnum<{
6
6
  "feature-file": "feature-file";
package/guide/create.md CHANGED
@@ -4,8 +4,8 @@ Write the verify CLI, its registry and the repo's verify skill
4
4
 
5
5
  Add the verify CLI, its
6
6
  [registry](https://github.com/zgeoff/wringer/blob/main/docs/reference/terms.md#registry) and the
7
- repo's `verify` skill. `verify-registry.ts` in the template shows one target, driver, action, repo
8
- command, doctor check and feature, on the builder that `createWringer` returns.
7
+ repo's `verify` skill. `create-verify-registry.ts` in the template shows one target, driver, action,
8
+ repo command, doctor check and feature, on the builder that `createWringer` returns.
9
9
 
10
10
  The mistakes that cost the most:
11
11
 
@@ -41,10 +41,10 @@ The mistakes that cost the most:
41
41
  its config for a target.
42
42
 
43
43
  2. Add `.wringer/` to `.gitignore`. The CLI keeps each run's state and evidence there.
44
- 3. Copy `verify.ts` and `verify-registry.ts` from the template (`bun verify guide template` names
45
- its folder) into `scripts/verify/`. Add `"verify": "bun scripts/verify/verify.ts"` to the
44
+ 3. Copy `verify.ts` and `create-verify-registry.ts` from the template (`bun verify guide template`
45
+ names its folder) into `scripts/verify/`. Add `"verify": "bun scripts/verify/verify.ts"` to the
46
46
  `scripts` of `package.json`. Expect: `bun verify --help` lists the template's commands.
47
- 4. In `verify-registry.ts`, write the `local` target with `mode: 'launch'` and
47
+ 4. In `create-verify-registry.ts`, write the `local` target with `mode: 'launch'` and
48
48
  `access: 'read-write'`. Its `launch` function returns:
49
49
  - `command`: the command a developer runs to start the app;
50
50
  - `env`: the app's environment. Point the app's state at `ctx.runDirectory` here, such as a
@@ -62,8 +62,9 @@ The mistakes that cost the most:
62
62
  the app, such as seeding a record. The CLI runs it as `bun verify action <name>`.
63
63
  8. Write a repo command with `.command` for a read that a journey checks, such as a count.
64
64
  9. Write a doctor check with `.check` for each thing that must hold before a journey means anything,
65
- such as an API that answers. Then run `bun verify up`, then `bun verify doctor`. Expect:
66
- `data.passed: true`. Run `bun verify down`.
65
+ such as an API that answers. When a check holds only on some targets, list them in its `targets`;
66
+ the doctor reports it as `skipped` on the rest. Then run `bun verify up`, then
67
+ `bun verify doctor`. Expect: `data.passed: true`. Run `bun verify down`.
67
68
  10. Write 3 to 5 features with `.feature`, each with `name`, `summary` and `paths`. Pick the
68
69
  journeys users take most, from the app's routes and its README, and give each feature the globs
69
70
  of the files that change its behaviour.
package/guide/overview.md CHANGED
@@ -75,13 +75,13 @@ the CLI with `bun`.
75
75
  CLI, prints the absolute path of the installed template folder. It holds a working example for an
76
76
  invented app, Larder:
77
77
 
78
- | File | Copy to | Holds |
79
- | -------------------- | ----------------------------------- | ----------------------------------------------------------------- |
80
- | `verify.ts` | `scripts/verify/verify.ts` | the entry point that calls `runVerify` |
81
- | `verify-registry.ts` | `scripts/verify/verify-registry.ts` | targets, a driver, an action, a command, a check, a feature |
82
- | `verify/` | `.claude/skills/verify/` | the repo's `verify` skill, and its feature files in `references/` |
78
+ | File | Copy to | Holds |
79
+ | --------------------------- | ------------------------------------------ | ----------------------------------------------------------------- |
80
+ | `verify.ts` | `scripts/verify/verify.ts` | the entry point that calls `runVerify` |
81
+ | `create-verify-registry.ts` | `scripts/verify/create-verify-registry.ts` | targets, a driver, an action, a command, a check, a feature |
82
+ | `verify/` | `.claude/skills/verify/` | the repo's `verify` skill, and its feature files in `references/` |
83
83
 
84
- Skip `verify-registry.test.ts` in the template: it tests the template inside wringer.
84
+ Skip `create-verify-registry.test.ts` in the template: it tests the template inside wringer.
85
85
 
86
86
  These locations are defaults. When you change one, change each place that refers to it:
87
87
 
@@ -5,7 +5,7 @@ description:
5
5
  feature works. Load it before you check a change in the running app, run the journey of a feature,
6
6
  or put the verdicts in a PR.'
7
7
  metadata:
8
- wringer-template: 'sha256:5ad8a6ead397'
8
+ wringer-template: 'sha256:29e4cfe22eaa'
9
9
  wringer-command: bun verify
10
10
  ---
11
11
 
@@ -13,35 +13,34 @@ metadata:
13
13
 
14
14
  Use `bun verify` to start the app, use each feature your change touches the way a user would, and
15
15
  record a verdict that it works. Put the report in the PR with `bun verify publish`, and hand back
16
- the PR link and each feature you could not verify. The CI gate, `bun verify gate`, fails a PR that
17
- changes a feature with no verdict.
16
+ the PR link and each feature you could not verify. `bun verify gate` fails a PR that changes a
17
+ feature with no verdict in the PR's report.
18
18
 
19
19
  The mistakes that cost the most time:
20
20
 
21
21
  - **Using the app before `doctor` passes.** `bun verify doctor` checks that the app answers and that
22
- each driver works. Until it passes on the run that `up` or `attach` started, any command that
23
- touches the app fails with exit code 3.
22
+ each driver works. A driver is the package behind a command group, such as `http` or `browser`.
23
+ Until `doctor` passes after `up` or `attach`, any command that touches the app fails with exit
24
+ code 3.
24
25
  - **Editing the app's code while `up` runs it.** The next command that touches the app fails with
25
26
  `doctor-required`. Run `bun verify up --restart` and `bun verify doctor`, then the journey again.
26
27
  - **Running `done` before you check the end state.** `done` checks only that one command of the
27
- journey succeeded. Check the result yourself first.
28
- - **Branching on the error message.** Branch on the exit code and `error.code`. The message text can
29
- change in any release.
28
+ journey succeeded.
30
29
 
31
30
  ## Key rules
32
31
 
33
32
  - [Check a change](#check-a-change): for each changed feature, run its journey, check the end state,
34
33
  then `done`.
35
- - [Read the envelope](#read-the-envelope): branch on the exit code and `error.code`.
36
- - [Targets](#targets): check a change on a target that `up` starts.
37
- - [Commands](#commands): `bun verify --help` lists every command.
38
- - [Update a feature file](#update-a-feature-file): fix a broken journey in the same PR, and run
39
- `lint`.
34
+ - [Read the envelope](#read-the-envelope): branch on the exit code and `error.code`, never on the
35
+ message, which can change in any release.
36
+ - [Targets](#targets): check a change on a launch target, which `up` starts.
37
+ - [Commands](#commands): read `--help` before you guess a flag.
38
+ - [Edit the skill and the registry](#edit-the-skill-and-the-registry): fix a broken journey in the
39
+ same PR, map each changed file to a feature, and run `lint`.
40
40
 
41
41
  ## References
42
42
 
43
- Read a feature's file before you run its journey: what the feature does, how a user reaches it, the
44
- journey of `bun verify` commands, and the end state that shows it works.
43
+ Read a feature's file before you run its journey.
45
44
 
46
45
  <!-- wringer:features -->
47
46
 
@@ -53,12 +52,12 @@ journey of `bun verify` commands, and the end state that shows it works.
53
52
 
54
53
  ## Check a change
55
54
 
56
- 1. Run `bun verify report`. A feature in `data.report.features` shows `changed: true` when a file
57
- under its `paths` differs from the default branch, committed or not. Each changed feature needs a
58
- verdict.
59
- 2. Unless your task names another target, start a run on `local`, with the commands in the
60
- [Targets](#targets) table. Expect from `up` or `attach`: `ok: true`, and the app's endpoints in
61
- `data.endpoints`.
55
+ 1. Run `bun verify report`. `changed: true` marks each feature in `data.report.features` with a
56
+ file, committed or not, that matches its `paths` in the
57
+ [registry](#edit-the-skill-and-the-registry) and differs from the default branch.
58
+ 2. Start a run on the target your task names. When it names none, take the first launch target in
59
+ the [Targets](#targets) table. Run the commands in its row. Expect from `up` or `attach`:
60
+ `ok: true`, and the app's endpoints in `data.endpoints`.
62
61
  3. Run `bun verify doctor`. Expect: `data.passed: true`. When a check fails, fix its cause, and run
63
62
  `doctor` again.
64
63
  4. Run the journey from the feature's file in [References](#references). Its first line,
@@ -70,28 +69,31 @@ journey of `bun verify` commands, and the end state that shows it works.
70
69
  `bun verify doctor` and the journey again.
71
70
  - When your change means to change the end state, fix the feature's file, and run
72
71
  `bun verify lint`. Then run the journey again.
73
- - Otherwise, skip `done` for this feature. List it in your reply with the end state you expected
74
- and the `data` you got.
72
+ - In any other case, such as a `read-only` failure or a bug your change did not cause, skip
73
+ `done` for this feature. List it in your reply with the end state you expected and the `data`
74
+ you got.
75
75
  6. Run `bun verify done` to record a verdict for the feature that `use --feature` set. Expect:
76
76
  `ok: true`. It fails with `check-failed` until a journey command succeeds after `doctor`.
77
77
  7. Repeat steps 4 to 6 for each feature with `changed: true`, and for each feature your task names,
78
78
  in the order of the table in [References](#references). When [Targets](#targets) names a journey
79
79
  to run last, run it last.
80
80
  8. Run `bun verify report --human` to read the report. Expect: `verified` on each changed feature.
81
- After `done`, an edit to a file under a feature's `paths` makes its verdict `stale`; a commit
82
- alone leaves each verdict as it was. Repeat steps 4 to 6 for each stale feature.
83
- 9. Run `bun verify publish`. Expect: `ok: true`, and `data.action` of `created`, `replaced` or
84
- `unchanged`. It writes the report into the description of the branch's open PR.
81
+ After `done`, an edit to a file that matches a feature's `paths` makes its verdict `stale`; a
82
+ commit alone leaves each verdict as it was. Repeat steps 4 to 6 for each stale feature.
83
+ 9. When the branch has no open PR, open one: without it, `publish` fails and writes nothing. Run
84
+ `bun verify publish`, or `bun verify publish --pr <number>` for another PR. Expect: `ok: true`,
85
+ and `data.action` of `created`, `replaced` or `unchanged`. It writes the report into the PR's
86
+ description, the only report the gate reads.
85
87
  10. End the run: `bun verify down` after `up`, or `bun verify detach` after `attach`.
86
88
 
87
89
  ## Read the envelope
88
90
 
89
- Each command prints one JSON envelope as its last line, or text for a person with `--human`. A
90
- streaming command, such as `doctor`, prints JSON event lines before it. Read these fields:
91
+ Each command prints one JSON envelope as its last line, or text with `--human`. A streaming command,
92
+ such as `doctor`, prints JSON event lines before the envelope. Read these fields:
91
93
 
92
94
  - `ok`, then `data` on success, or `error.code`, `error.message` and `error.hint` on failure;
93
95
  - `evidence`: the files the command kept, under `.wringer/`;
94
- - `truncated` and `truncatedPath`: `data` was too large, and the file at `truncatedPath` holds it.
96
+ - `truncatedPath`: the file that holds `data` when it was too large to print.
95
97
 
96
98
  | Exit | `error.code` | Do |
97
99
  | ---- | -------------------- | ------------------------------------------------------------------------------------------------- |
@@ -102,7 +104,7 @@ streaming command, such as `doctor`, prints JSON event lines before it. Read the
102
104
  | 3 | `doctor-required` | Run the commands in `error.hint`, then run the feature's journey again. |
103
105
  | 3 | `not-running` | Start the run, as step 2 says. |
104
106
  | 3 | `target-not-allowed` | Follow `error.hint`. |
105
- | 4 | `environment` | Read `error.message`, fix the problem on this machine, such as a missing browser, and retry. |
107
+ | 4 | `environment` | Read `error.message` and `error.hint`, fix the problem, such as a missing browser, and retry. |
106
108
  | 4 | `internal` | Report the command and `error.message`: the CLI has a bug. |
107
109
  | 5 | `timeout` | Retry once with twice the timeout; the default is `--timeout-ms=120000`. Report a second timeout. |
108
110
 
@@ -110,11 +112,12 @@ streaming command, such as `doctor`, prints JSON event lines before it. Read the
110
112
 
111
113
  Start a launch target's app with `bun verify up`, and stop it with `bun verify down`. Connect to an
112
114
  attach target, an app that runs apart from `bun verify`, with `bun verify attach`.
113
- `bun verify detach` leaves it running. Your edits never reach an attach target's app, so check a
114
- change on a launch target.
115
+ `bun verify detach` leaves it running. A run lasts from `up` or `attach` to `down` or `detach`. Your
116
+ edits never reach an attach target's app, so check a change on a launch target.
115
117
 
116
- Run `bun verify use --target <target>` to point every later command at a target. `--target` on one
117
- command points that command alone.
118
+ Run `bun verify use --target <target>` to point every later command at a target. `use` saves the
119
+ choice in this worktree's `.wringer/`, for every shell and session. `--target` on one command points
120
+ that command alone. A command with neither runs on the registry's first target, so run `use` first.
118
121
 
119
122
  <!-- repo: targets -->
120
123
 
@@ -127,9 +130,10 @@ command points that command alone.
127
130
 
128
131
  ## Commands
129
132
 
130
- Run `bun verify --help` for the list, with each command marked `[read]` or `[write]`. Run
131
- `bun verify <command> --help` for a command's flags. The top-level list shows only the name of a
132
- group, such as `action`: run `bun verify <group> --help` for its commands.
133
+ Run `bun verify --help` for the list, with each command marked `[read]` or `[write]`. A read-only
134
+ target refuses each `[write]` command that writes app data. `up` and `down` are `[read]`, but start
135
+ and stop the app. Run `bun verify <command> --help` for a command's flags. The top-level list shows
136
+ only the name of a group, such as `action`: run `bun verify <group> --help` for its commands.
133
137
 
134
138
  - Write a negative number with `=`, as in `--offset=-5`.
135
139
  - Pass an object as JSON text, as in `--filter '{"shelf":"top"}'`.
@@ -141,12 +145,13 @@ group, such as `action`: run `bun verify <group> --help` for its commands.
141
145
 
142
146
  <!-- /repo -->
143
147
 
144
- ## Update a feature file
148
+ ## Edit the skill and the registry
145
149
 
146
150
  <!-- repo: registry -->
147
151
 
148
- The registry, `scripts/verify/verify-registry.ts`, declares the targets, actions, commands, doctor
149
- checks and features, with each feature's `paths`.
152
+ The registry, `scripts/verify/create-verify-registry.ts`, declares the targets, actions, commands,
153
+ doctor checks and features, with each feature's `paths`. CI runs `bun verify lint` and
154
+ `bun verify gate` on each PR.
150
155
 
151
156
  <!-- /repo -->
152
157
 
@@ -1,5 +1,5 @@
1
1
  import { runVerify } from '@wringer/gunshi';
2
- import { createVerifyRegistry } from './verify-registry.ts';
2
+ import { createVerifyRegistry } from './create-verify-registry.ts';
3
3
 
4
4
  // The repo's verify CLI. The `verify` script in package.json runs this file, so an agent calls
5
5
  // `bun verify <command>`. `skill` names the folder of the repo's verify skill, which `lint` checks.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wringer/gunshi",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "The gunshi adapter for wringer: turns a wringer registry into a CLI",
5
5
  "homepage": "https://github.com/zgeoff/wringer/tree/main/packages/gunshi#readme",
6
6
  "bugs": "https://github.com/zgeoff/wringer/issues",
@@ -41,13 +41,13 @@
41
41
  "ts-pattern": "5.9.2"
42
42
  },
43
43
  "devDependencies": {
44
- "@wringer/core": "0.3.0",
45
- "@wringer/http": "0.1.3",
44
+ "@wringer/core": "0.3.1",
45
+ "@wringer/http": "0.1.4",
46
46
  "@zgeoff/testing": "0.3.0",
47
47
  "zod": "4.6.7"
48
48
  },
49
49
  "peerDependencies": {
50
- "@wringer/core": "0.3.0",
50
+ "@wringer/core": "0.3.1",
51
51
  "zod": "^4.0.0"
52
52
  },
53
53
  "engines": {
@@ -1,7 +1,7 @@
1
1
  import { WringerError } from '@wringer/core';
2
2
  import type { RegisteredCommand, Wringer } from '@wringer/core';
3
- import { buildGuideCommand } from './build-guide-command.ts';
4
- import { buildLintCommand } from './build-lint-command.ts';
3
+ import { buildGuideCommand } from './guide-command/build-guide-command.ts';
4
+ import { buildLintCommand } from './lint-command/build-lint-command.ts';
5
5
 
6
6
  // The registry with the `lint` and `guide` built-ins added. `lint` parses journey lines with
7
7
  // gunshi, so this package adds them rather than core. `registryFile` is the registry's own file,
@@ -1,9 +1,9 @@
1
1
  import { WringerError, buildBuiltinCommand } from '@wringer/core';
2
2
  import type { RegisteredCommand } from '@wringer/core';
3
3
  import { z } from 'zod';
4
+ import { readGuide } from '../read-guide.ts';
4
5
  import { guideDataSchema, pickGuideData } from './pick-guide-data.ts';
5
6
  import type { GuideData } from './pick-guide-data.ts';
6
- import { readGuide } from './read-guide.ts';
7
7
 
8
8
  const guideArgsSchema = z.strictObject({
9
9
  topic: z.string().min(1).optional().describe('The topic to print; leave out to list the topics'),
@@ -5,7 +5,7 @@ import {
5
5
  makeProcessSupervisorPort,
6
6
  } from '@wringer/core';
7
7
  import type { PullRequestHost, RepoHost, StateFileSystem } from '@wringer/core';
8
- import type { CLIPorts } from './run-cli.ts';
8
+ import type { CLIPorts } from '../run-cli.ts';
9
9
 
10
10
  type RepoPorts = Pick<CLIPorts, 'readRepoRoot' | 'openRepo'>;
11
11
 
@@ -1,9 +1,9 @@
1
1
  import { exitCodeFor } from '@wringer/core';
2
2
  import type { WringerError } from '@wringer/core';
3
- import { buildFailureEnvelope } from './build-failure-envelope.ts';
4
- import type { Invocation } from './build-gunshi-commands.ts';
5
- import type { OutputMode } from './pick-output-mode.ts';
6
- import { renderEnvelope } from './render-envelope.ts';
3
+ import type { Invocation } from '../gunshi-commands/build-gunshi-commands.ts';
4
+ import { buildFailureEnvelope } from '../output/build-failure-envelope.ts';
5
+ import type { OutputMode } from '../output/pick-output-mode.ts';
6
+ import { renderEnvelope } from '../output/render-envelope.ts';
7
7
 
8
8
  export type ParsedInvocation =
9
9
  | { readonly kind: 'invoked'; readonly invocation: Invocation }
@@ -1,7 +1,7 @@
1
1
  import { WringerError, exitCodeFor } from '@wringer/core';
2
2
  import type { Envelope } from '@wringer/core';
3
- import { buildFailureEnvelope } from './build-failure-envelope.ts';
4
- import type { Invocation } from './build-gunshi-commands.ts';
3
+ import type { Invocation } from '../gunshi-commands/build-gunshi-commands.ts';
4
+ import { buildFailureEnvelope } from '../output/build-failure-envelope.ts';
5
5
 
6
6
  export type DispatchPlan =
7
7
  | { readonly kind: 'refuse'; readonly envelope: Envelope; readonly exitCode: number }
@@ -1,8 +1,8 @@
1
1
  import { WringerError } from '@wringer/core';
2
2
  import type { Wringer } from '@wringer/core';
3
3
  import { cli, parseArgs } from 'gunshi';
4
- import { buildGunshiCommands } from './build-gunshi-commands.ts';
5
- import type { InvokeResult } from './build-gunshi-commands.ts';
4
+ import { buildGunshiCommands } from '../gunshi-commands/build-gunshi-commands.ts';
5
+ import type { InvokeResult } from '../gunshi-commands/build-gunshi-commands.ts';
6
6
  import { findSignedValueFlag } from './find-signed-value-flag.ts';
7
7
  import type { SignedValueFlag } from './find-signed-value-flag.ts';
8
8
  import type { ParsedInvocation } from './pick-cli-outcome.ts';
@@ -3,9 +3,9 @@ import { isAbsolute, join, relative, resolve } from 'node:path';
3
3
  import { WringerError, buildBuiltinCommand } from '@wringer/core';
4
4
  import type { BuiltinContext, RegisteredCommand } from '@wringer/core';
5
5
  import { z } from 'zod';
6
+ import { lintFailureSchema, resolveLintFailures } from '../resolve-lint-failures.ts';
6
7
  import { collectLintFiles } from './collect-lint-files.ts';
7
8
  import { readTemplateHash } from './read-template-hash.ts';
8
- import { lintFailureSchema, resolveLintFailures } from './resolve-lint-failures.ts';
9
9
 
10
10
  const lintArgsSchema = z.strictObject({});
11
11
 
@@ -1,7 +1,7 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import { readFile, readdir } from 'node:fs/promises';
3
3
  import { join } from 'node:path';
4
- import { guideFolder } from './read-guide.ts';
4
+ import { guideFolder } from '../read-guide.ts';
5
5
 
6
6
  const templateFolder = join(guideFolder, 'template');
7
7
  const hashLength = 12;
@@ -2,8 +2,8 @@ import { prepareArgs } from '@wringer/core';
2
2
  import type { RegisteredCommand, Wringer } from '@wringer/core';
3
3
  import invariant from 'tiny-invariant';
4
4
  import { match } from 'ts-pattern';
5
- import type { Invocation } from './build-gunshi-commands.ts';
6
- import { resolveInvocation } from './resolve-invocation.ts';
5
+ import type { Invocation } from '../gunshi-commands/build-gunshi-commands.ts';
6
+ import { resolveInvocation } from '../invocation/resolve-invocation.ts';
7
7
 
8
8
  // Why one journey command would fail before it ran, or null when it would run: the words go through
9
9
  // the CLI's own parser, the arguments through the command's schema, and a feature or a target it
package/src/read-guide.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { readFile, readdir } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
3
  import { z } from 'zod';
4
- import { parseGuideTopic } from './parse-guide-topic.ts';
5
- import type { GuideTopic } from './parse-guide-topic.ts';
6
- import type { Guide } from './pick-guide-data.ts';
4
+ import { parseGuideTopic } from './guide-command/parse-guide-topic.ts';
5
+ import type { GuideTopic } from './guide-command/parse-guide-topic.ts';
6
+ import type { Guide } from './guide-command/pick-guide-data.ts';
7
7
 
8
8
  const packageSchema = z.looseObject({ version: z.string().min(1) });
9
9
 
@@ -1,15 +1,18 @@
1
1
  import { buildFeatureFile, isGlobMatch, renderFeatureTable } from '@wringer/core';
2
2
  import type { Wringer } from '@wringer/core';
3
3
  import { z } from 'zod';
4
- import { checkFeatureFile } from './check-feature-file.ts';
5
- import { collectDeadGlobs } from './collect-dead-globs.ts';
6
- import { collectJourneyCommands } from './collect-journey-commands.ts';
7
- import type { JourneyCommand, MarkdownFile } from './collect-journey-commands.ts';
8
- import { collectUnclaimedFiles } from './collect-unclaimed-files.ts';
9
- import { parseFeatureTableSpan, toComparableTable } from './parse-feature-table-span.ts';
10
- import { parseSkillMetadata } from './parse-skill-metadata.ts';
11
- import type { SkillMetadata } from './parse-skill-metadata.ts';
12
- import { resolveJourneyProblem } from './resolve-journey-problem.ts';
4
+ import { checkFeatureFile } from './lint-command/check-feature-file.ts';
5
+ import { collectDeadGlobs } from './lint-command/collect-dead-globs.ts';
6
+ import { collectJourneyCommands } from './lint-command/collect-journey-commands.ts';
7
+ import type { JourneyCommand, MarkdownFile } from './lint-command/collect-journey-commands.ts';
8
+ import { collectUnclaimedFiles } from './lint-command/collect-unclaimed-files.ts';
9
+ import {
10
+ parseFeatureTableSpan,
11
+ toComparableTable,
12
+ } from './lint-command/parse-feature-table-span.ts';
13
+ import { parseSkillMetadata } from './lint-command/parse-skill-metadata.ts';
14
+ import type { SkillMetadata } from './lint-command/parse-skill-metadata.ts';
15
+ import { resolveJourneyProblem } from './lint-command/resolve-journey-problem.ts';
13
16
 
14
17
  export const lintFailureSchema = z.strictObject({
15
18
  // `where` names the feature, the glob group or the file that the check found at fault.
package/src/run-cli.ts CHANGED
@@ -8,15 +8,15 @@ import type {
8
8
  WringerError,
9
9
  } from '@wringer/core';
10
10
  import { parseArgs } from 'gunshi';
11
- import type { Invocation } from './build-gunshi-commands.ts';
12
- import { pickCLIOutcome } from './pick-cli-outcome.ts';
13
- import { pickDispatchPlan } from './pick-dispatch-plan.ts';
14
- import { pickOutputMode } from './pick-output-mode.ts';
15
- import type { OutputMode } from './pick-output-mode.ts';
16
- import { renderEnvelope } from './render-envelope.ts';
17
- import { renderHumanEvent } from './render-human-event.ts';
18
- import { resolveInvocation } from './resolve-invocation.ts';
19
- import { scrubParsedInvocation } from './scrub-parsed-invocation.ts';
11
+ import type { Invocation } from './gunshi-commands/build-gunshi-commands.ts';
12
+ import { pickCLIOutcome } from './invocation/pick-cli-outcome.ts';
13
+ import { pickDispatchPlan } from './invocation/pick-dispatch-plan.ts';
14
+ import { resolveInvocation } from './invocation/resolve-invocation.ts';
15
+ import { scrubParsedInvocation } from './invocation/scrub-parsed-invocation.ts';
16
+ import { pickOutputMode } from './output/pick-output-mode.ts';
17
+ import type { OutputMode } from './output/pick-output-mode.ts';
18
+ import { renderEnvelope } from './output/render-envelope.ts';
19
+ import { renderHumanEvent } from './output/render-human-event.ts';
20
20
 
21
21
  interface RepoPorts {
22
22
  readonly state: StatePort;
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
- import { buildGuidePorts } from './build-guide-ports.ts';
3
- import { buildGuideWringer } from './build-guide-wringer.ts';
2
+ import { buildGuidePorts } from './guide-command/build-guide-ports.ts';
3
+ import { buildGuideWringer } from './guide-command/build-guide-wringer.ts';
4
4
  import { runWringer } from './run-verify.ts';
5
5
 
6
6
  const [, script] = process.argv;