From 16e0fe881a633abd7c65bb5ceca0d211266b488c Mon Sep 17 00:00:00 2001 From: "warp-factories[bot]" <243557089+warp-factories[bot]@users.noreply.github.com> Date: Tue, 8 Sep 2026 19:04:34 +0000 Subject: [PATCH 1/3] spec: add du time completion specification --- specs/GH403/product.md | 49 +++++++++++++++++++++ specs/GH403/tech.md | 98 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 specs/GH403/product.md create mode 100644 specs/GH403/tech.md diff --git a/specs/GH403/product.md b/specs/GH403/product.md new file mode 100644 index 00000000..39258024 --- /dev/null +++ b/specs/GH403/product.md @@ -0,0 +1,49 @@ +# Product specification: `du --time` completion + +## Issue + +[GH403: du completion spec missing the `--time` long option](https://github.com/warpdotdev/command-signatures/issues/403) + +## Problem + +Warp's `du` completion spec does not offer GNU `du`'s `--time` option. Users therefore receive no completion for showing timestamps alongside disk-usage output and no guidance for the optional `--time=WORD` values. + +The current spec is otherwise usable for its existing BSD-style short options, including the commonly combined `-h` option. This change should add the requested GNU option without changing those completions. + +## Desired behavior + +- Offer `--time` as a top-level `du` option. +- Describe bare `--time` as showing the last modification time of files or directories in the output. +- Keep the option's argument optional so both `du --time` and `du --time=WORD` are represented by one completion entry. +- When completing the optional `WORD`, offer every value documented by GNU `du`: `atime`, `access`, `use`, `ctime`, and `status`. +- Explain that `atime`, `access`, and `use` select last access time, while `ctime` and `status` select last status-change time. +- Preserve every existing `du` option and file/directory argument completion unchanged. + +## User-visible details + +`du --time` remains useful without an argument and uses modification time in that form. After the equals sign, completion candidates should make the two synonym groups understandable instead of presenting five unexplained words. + +The completion must not imply that the optional value can only be supplied or that the default modification-time behavior requires a value. It must also avoid suggesting undocumented values such as `mtime`. + +## Acceptance criteria + +1. Typing a `du` option prefix can surface `--time` with a description of its modification-time behavior. +2. Accepting or entering bare `--time` does not require another token. +3. Completing `du --time=` offers exactly `atime`, `access`, `use`, `ctime`, and `status`. +4. Each value communicates whether it selects access time or status-change time. +5. The five values insert their exact GNU-supported spelling. +6. The existing options and the optional variadic file/folder argument in `command-signatures/json/du.json` remain unchanged. +7. The updated JSON is formatted, deserializes through the repository's completion schema, and passes the repository presubmit checks. + +## Out of scope + +- Adding `--time-style=STYLE`. +- Adding other missing GNU long options, including `--max-depth`. +- Pairing existing short options with GNU long aliases. +- Changing option-name conventions across the repository. +- Adding or changing Rust generators, schemas, or completion-engine behavior. + +## Open questions + +1. Should synonymous values be displayed as two grouped alias suggestions or five independent suggestions? **Recommendation:** use grouped aliases—`atime`/`access`/`use` and `ctime`/`status`—with one description per semantic group. This matches the existing `ls --color` pattern, produces all five candidates, and avoids duplicated descriptions. +2. Should neighboring `--time-style=STYLE` be included? **Recommendation:** keep it out of scope. It has separate behavior and values, and the issue only requests `--time`; it can be added in a follow-up issue. diff --git a/specs/GH403/tech.md b/specs/GH403/tech.md new file mode 100644 index 00000000..17948441 --- /dev/null +++ b/specs/GH403/tech.md @@ -0,0 +1,98 @@ +# Technical specification: `du --time` completion + +## Current implementation + +`command-signatures/json/du.json` is a single Fig-compatible JSON command definition with: + +- Fourteen option entries: `-a`, `-c`, `-H`, `-h`, `-g`, `-k`, `-m`, `-I`, `-L`, `-r`, `-P`, `-d`, `-s`, and `-x`. +- No option whose name begins with `--`. +- One optional, variadic top-level `files` argument using the `filepaths` and `folders` templates. + +The JSON is embedded and deserialized through `command-signatures/src/lib.rs`. Its `all_command_specs_succeed_deserialization` test loads every embedded signature through the completion metadata schema. + +## Recommended implementation + +Add one object to the existing `options` array in `command-signatures/json/du.json`: + +```json +{ + "name": "--time", + "description": "Show the time of the last modification of any file in the directory, or any of its subdirectories", + "args": { + "name": "WORD", + "isOptional": true, + "suggestions": [ + { + "name": [ + "atime", + "access", + "use" + ], + "description": "Show the last access time" + }, + { + "name": [ + "ctime", + "status" + ], + "description": "Show the last status-change time" + } + ] + } +} +``` + +This is one option with one optional argument, not separate entries for bare `--time` and each `--time=WORD` spelling. It follows `command-signatures/json/ls.json`'s `--color` structure: `isOptional` preserves the bare form, while a suggestion `name` array expands aliases into separate insertable candidates with a shared description. `command-signatures/json/eza.json`'s `--icons` option independently confirms the optional fixed-suggestion shape. + +Use uppercase `WORD` because GNU `du --help` documents the syntax as `--time[=WORD]`, consistent with the repository authoring guide's instruction to match the command's help-text casing. Do not add `requiresEquals`; the reference `ls --color` option omits it, and no completion-engine or schema change is part of this issue. + +## Files and components affected + +- `command-signatures/json/du.json`: add the `--time` option and static value suggestions. + +No Rust source, generator registration, schema, dependency, or API change is required. The spec documents under `specs/GH403/` are workflow artifacts and remain on this branch for the implementation stage. + +## Data and completion behavior + +The two suggestion objects intentionally encode semantic aliases: + +- `["atime", "access", "use"]` becomes three candidates that share the access-time description. +- `["ctime", "status"]` becomes two candidates that share the status-change-time description. + +The conversion in `completion-metadata/src/fig_types.rs` expands each `name` array into individual internal suggestions and copies the shared description to each one. Static suggestions are sufficient; no shell process or `generatorName` is needed. + +The optional argument must not change the behavior of the command's existing optional variadic `files` argument. Bare `--time` must remain complete by itself, while an equals-sign value context must expose the five fixed candidates. + +## Edge cases + +- Do not suggest `mtime`: GNU `du` uses modification time for bare `--time`, but does not document `mtime` as a `WORD` value. +- Do not collapse the five accepted spellings into only the two conceptual time types; all documented aliases must remain insertable. +- Do not add `--time-style` while editing the neighboring option surface. +- Do not pair or rewrite existing short options as part of this change; issues #372 and #374 track related but separate work. +- Preserve the current file/folder templates and option exclusivity metadata. + +## Validation and testing + +The implementation must: + +1. Format the edited JSON: + + `npm run format -- command-signatures/json/du.json` + +2. Run the repository presubmit from the repository root: + + `script/presubmit` + + This verifies all JSON formatting with `npm run format:check`, runs `cargo fmt --check`, runs Clippy with warnings denied, and runs the full Rust test suite. The test suite includes deserializing every embedded command spec, which validates the new optional argument and suggestion aliases against the actual schema. + +3. Inspect the resulting completion behavior, preferably in a local Warp session: + - `du --t` can offer `--time`. + - `du --time=` offers all five documented values. + - Selecting each candidate inserts its exact spelling. + - Bare `du --time` does not force an argument. + +No generator screenshot is required because this change adds only static suggestions and no generator. CI in `.github/workflows/CI.yml` separately repeats JSON formatting, Cargo formatting and Clippy, and the full Rust test suite. + +## Open questions + +The implementation depends on maintainer confirmation of the product decisions in `product.md`: grouped synonym suggestions are recommended, and `--time-style=STYLE` is recommended to remain out of scope. From bf2c572c76db0af8604ca7092a3b7e575f48088c Mon Sep 17 00:00:00 2001 From: "warp-factories[bot]" <243557089+warp-factories[bot]@users.noreply.github.com> Date: Tue, 8 Sep 2026 19:53:52 +0000 Subject: [PATCH 2/3] Add du --time completion option Adds the GNU --time option to du.json with an optional WORD argument, offering the documented atime/access/use (last access time) and ctime/status (last status-change time) value groups. Fixes #403 --- command-signatures/json/du.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/command-signatures/json/du.json b/command-signatures/json/du.json index 6413f3ba..edabf2d6 100644 --- a/command-signatures/json/du.json +++ b/command-signatures/json/du.json @@ -112,6 +112,31 @@ { "name": "-x", "description": "Display an entry for each specified file. (Equivalent to -d 0)" + }, + { + "name": "--time", + "description": "Show the time of the last modification of any file in the directory, or any of its subdirectories", + "args": { + "name": "WORD", + "isOptional": true, + "suggestions": [ + { + "name": [ + "atime", + "access", + "use" + ], + "description": "Show the last access time" + }, + { + "name": [ + "ctime", + "status" + ], + "description": "Show the last status-change time" + } + ] + } } ], "args": { From 291edfe4a81ad796d2f036ea0e72295cd850fac7 Mon Sep 17 00:00:00 2001 From: "warp-agent-staging[bot]" <240773466+warp-agent-staging[bot]@users.noreply.github.com> Date: Fri, 11 Sep 2026 20:18:04 +0000 Subject: [PATCH 3/3] Remove GH403 specification files --- specs/GH403/product.md | 49 --------------------- specs/GH403/tech.md | 98 ------------------------------------------ 2 files changed, 147 deletions(-) delete mode 100644 specs/GH403/product.md delete mode 100644 specs/GH403/tech.md diff --git a/specs/GH403/product.md b/specs/GH403/product.md deleted file mode 100644 index 39258024..00000000 --- a/specs/GH403/product.md +++ /dev/null @@ -1,49 +0,0 @@ -# Product specification: `du --time` completion - -## Issue - -[GH403: du completion spec missing the `--time` long option](https://github.com/warpdotdev/command-signatures/issues/403) - -## Problem - -Warp's `du` completion spec does not offer GNU `du`'s `--time` option. Users therefore receive no completion for showing timestamps alongside disk-usage output and no guidance for the optional `--time=WORD` values. - -The current spec is otherwise usable for its existing BSD-style short options, including the commonly combined `-h` option. This change should add the requested GNU option without changing those completions. - -## Desired behavior - -- Offer `--time` as a top-level `du` option. -- Describe bare `--time` as showing the last modification time of files or directories in the output. -- Keep the option's argument optional so both `du --time` and `du --time=WORD` are represented by one completion entry. -- When completing the optional `WORD`, offer every value documented by GNU `du`: `atime`, `access`, `use`, `ctime`, and `status`. -- Explain that `atime`, `access`, and `use` select last access time, while `ctime` and `status` select last status-change time. -- Preserve every existing `du` option and file/directory argument completion unchanged. - -## User-visible details - -`du --time` remains useful without an argument and uses modification time in that form. After the equals sign, completion candidates should make the two synonym groups understandable instead of presenting five unexplained words. - -The completion must not imply that the optional value can only be supplied or that the default modification-time behavior requires a value. It must also avoid suggesting undocumented values such as `mtime`. - -## Acceptance criteria - -1. Typing a `du` option prefix can surface `--time` with a description of its modification-time behavior. -2. Accepting or entering bare `--time` does not require another token. -3. Completing `du --time=` offers exactly `atime`, `access`, `use`, `ctime`, and `status`. -4. Each value communicates whether it selects access time or status-change time. -5. The five values insert their exact GNU-supported spelling. -6. The existing options and the optional variadic file/folder argument in `command-signatures/json/du.json` remain unchanged. -7. The updated JSON is formatted, deserializes through the repository's completion schema, and passes the repository presubmit checks. - -## Out of scope - -- Adding `--time-style=STYLE`. -- Adding other missing GNU long options, including `--max-depth`. -- Pairing existing short options with GNU long aliases. -- Changing option-name conventions across the repository. -- Adding or changing Rust generators, schemas, or completion-engine behavior. - -## Open questions - -1. Should synonymous values be displayed as two grouped alias suggestions or five independent suggestions? **Recommendation:** use grouped aliases—`atime`/`access`/`use` and `ctime`/`status`—with one description per semantic group. This matches the existing `ls --color` pattern, produces all five candidates, and avoids duplicated descriptions. -2. Should neighboring `--time-style=STYLE` be included? **Recommendation:** keep it out of scope. It has separate behavior and values, and the issue only requests `--time`; it can be added in a follow-up issue. diff --git a/specs/GH403/tech.md b/specs/GH403/tech.md deleted file mode 100644 index 17948441..00000000 --- a/specs/GH403/tech.md +++ /dev/null @@ -1,98 +0,0 @@ -# Technical specification: `du --time` completion - -## Current implementation - -`command-signatures/json/du.json` is a single Fig-compatible JSON command definition with: - -- Fourteen option entries: `-a`, `-c`, `-H`, `-h`, `-g`, `-k`, `-m`, `-I`, `-L`, `-r`, `-P`, `-d`, `-s`, and `-x`. -- No option whose name begins with `--`. -- One optional, variadic top-level `files` argument using the `filepaths` and `folders` templates. - -The JSON is embedded and deserialized through `command-signatures/src/lib.rs`. Its `all_command_specs_succeed_deserialization` test loads every embedded signature through the completion metadata schema. - -## Recommended implementation - -Add one object to the existing `options` array in `command-signatures/json/du.json`: - -```json -{ - "name": "--time", - "description": "Show the time of the last modification of any file in the directory, or any of its subdirectories", - "args": { - "name": "WORD", - "isOptional": true, - "suggestions": [ - { - "name": [ - "atime", - "access", - "use" - ], - "description": "Show the last access time" - }, - { - "name": [ - "ctime", - "status" - ], - "description": "Show the last status-change time" - } - ] - } -} -``` - -This is one option with one optional argument, not separate entries for bare `--time` and each `--time=WORD` spelling. It follows `command-signatures/json/ls.json`'s `--color` structure: `isOptional` preserves the bare form, while a suggestion `name` array expands aliases into separate insertable candidates with a shared description. `command-signatures/json/eza.json`'s `--icons` option independently confirms the optional fixed-suggestion shape. - -Use uppercase `WORD` because GNU `du --help` documents the syntax as `--time[=WORD]`, consistent with the repository authoring guide's instruction to match the command's help-text casing. Do not add `requiresEquals`; the reference `ls --color` option omits it, and no completion-engine or schema change is part of this issue. - -## Files and components affected - -- `command-signatures/json/du.json`: add the `--time` option and static value suggestions. - -No Rust source, generator registration, schema, dependency, or API change is required. The spec documents under `specs/GH403/` are workflow artifacts and remain on this branch for the implementation stage. - -## Data and completion behavior - -The two suggestion objects intentionally encode semantic aliases: - -- `["atime", "access", "use"]` becomes three candidates that share the access-time description. -- `["ctime", "status"]` becomes two candidates that share the status-change-time description. - -The conversion in `completion-metadata/src/fig_types.rs` expands each `name` array into individual internal suggestions and copies the shared description to each one. Static suggestions are sufficient; no shell process or `generatorName` is needed. - -The optional argument must not change the behavior of the command's existing optional variadic `files` argument. Bare `--time` must remain complete by itself, while an equals-sign value context must expose the five fixed candidates. - -## Edge cases - -- Do not suggest `mtime`: GNU `du` uses modification time for bare `--time`, but does not document `mtime` as a `WORD` value. -- Do not collapse the five accepted spellings into only the two conceptual time types; all documented aliases must remain insertable. -- Do not add `--time-style` while editing the neighboring option surface. -- Do not pair or rewrite existing short options as part of this change; issues #372 and #374 track related but separate work. -- Preserve the current file/folder templates and option exclusivity metadata. - -## Validation and testing - -The implementation must: - -1. Format the edited JSON: - - `npm run format -- command-signatures/json/du.json` - -2. Run the repository presubmit from the repository root: - - `script/presubmit` - - This verifies all JSON formatting with `npm run format:check`, runs `cargo fmt --check`, runs Clippy with warnings denied, and runs the full Rust test suite. The test suite includes deserializing every embedded command spec, which validates the new optional argument and suggestion aliases against the actual schema. - -3. Inspect the resulting completion behavior, preferably in a local Warp session: - - `du --t` can offer `--time`. - - `du --time=` offers all five documented values. - - Selecting each candidate inserts its exact spelling. - - Bare `du --time` does not force an argument. - -No generator screenshot is required because this change adds only static suggestions and no generator. CI in `.github/workflows/CI.yml` separately repeats JSON formatting, Cargo formatting and Clippy, and the full Rust test suite. - -## Open questions - -The implementation depends on maintainer confirmation of the product decisions in `product.md`: grouped synonym suggestions are recommended, and `--time-style=STYLE` is recommended to remain out of scope.