Skip to content

Port Fig generators to Rust - #391

Merged
acarl005 merged 4 commits into
mainfrom
factory/port-fig-generators
Sep 4, 2026
Merged

Port Fig generators to Rust#391
acarl005 merged 4 commits into
mainfrom
factory/port-fig-generators

Conversation

@warp-agent-staging

@warp-agent-staging warp-agent-staging Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Port ignored Fig generators to supported generatorName wiring (APP-5776). Identical command+script generators share one name and one CommandSignatureGenerators value. Original generateSpec JSON is restored from main and left unimplemented.

Changes

  • Collapse duplicate Fig script generators; Amplify env_list is one registration
  • Semantic names only—no numeric suffixes, no fig_<hash>
  • One registry entry per command; no DynamicCompletionData::extend
  • Restore original generateSpec fields on 13 specs (15 occurrences)
  • Drop the unit tests this PR had added

Verification

  • cargo test: 176 + 10 passed
  • cargo fmt --check, cargo clippy ... -D warnings, npm run format:check: passed

Out of scope

Structured postProcess parsers, token-aware custom generators, and template filters land on the stacked PR above this one.

@warp-agent-staging

Copy link
Copy Markdown
Contributor Author

This PR was generated with Warp.

Comment @warp-factory on this PR to send it follow-up work.

View run View conversation View on Slack

@acarl005
acarl005 marked this pull request as ready for review September 3, 2026 17:26
@acarl005

acarl005 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@warp-factory /review

@warp-agent-staging warp-agent-staging Bot added the factory:large-factory-test Label associated to the "large-factory-test" factory label Sep 3, 2026
@warp-factories

warp-factories Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Merged by @acarl005 — closing out. The factory's last posted verdict was changes-requested on 890bd8ba; the merged revision 9f81e912 was a rebase of that same work onto current main, so the findings carried over unreviewed.

One item to carry forward: fig_parse::lines splits raw output on newlines, so the branches/log/status generators emit decorated text (* my-branch, abc1234 subject) as literal completion values. These names are consumed by hub.json, watson.json, and tailscale.json, so it is user-visible. The description scopes structured parsers to the stacked follow-up PR — worth covering there.

Responding as Warp for OSS: Open session · View run

@warp-factories warp-factories Bot added the factory:warp-for-oss Owned by the Warp for OSS factory label Sep 3, 2026

@warp-factories warp-factories Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This replaces the ignored Fig JavaScript generators/generateSpec fields with Rust-backed generatorName registrations, removing all 963 such JSON keys. Requesting changes: the shared parser converts structured command output into invalid completion values, and the new generators ship without the verification evidence this repository requires.

Concerns

  • fig_parse::lines emits one suggestion per trimmed line, but it is wired to 137 registrations whose removed postProcess functions extracted arguments from JSON or structured text. amplify env list --json, ansible-doc --list --json, and cargo read-manifest will now offer raw JSON fragments as completion values. Parse per output format and add representative output fixtures for each migrated contract.
  • The same parser is applied to git log --oneline, git status --short, and git branch, all of which emit decorated lines rather than bare values, so the inserted text is not a valid ref or path. These need the format-aware handling noted inline.
  • No completion-dropdown evidence accompanies 137 new registrations across 90 generator modules. Repository guidance requires a real Warp screenshot showing generated entries for every new or modified generator; please add that before merge.
  • Review coverage: correctness carries the blocking findings above; standards could not be verified locally because no Rust toolchain is available in this environment, though CI is green; complexity and comments were examined with no material concern; naming has the inline nit; tests do not cover the newly introduced parsers; security was examined with no applicable finding.

Verdict

Checks: build unverified (cargo unavailable), tests unverified (cargo unavailable), CI green (8/8), visual proof missing

Found: 0 critical, 3 important, 0 suggestions, 1 nit

Recommendation: request changes

Responding as Warp for OSS: Open session · View run

output
.lines()
.map(str::trim)
.filter(|line| !line.is_empty())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] This line parser is wired to 137 new registrations, but many of the postProcess functions it replaces extracted arguments out of JSON or structured output. amplify env list --json, ansible-doc --list --json, and cargo read-manifest will now surface raw JSON fragments instead of completion values. Parse per output format and add representative output fixtures for each migrated contract.

.add_generator(
"branches",
Generator::script(
CommandBuilder::single_command("git --no-optional-locks branch --no-color --sort=-committerdate"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] git branch marks the checked-out branch with a leading * , so this parser suggests * my-branch rather than the valid ref my-branch. This module already has post_process_branches (git.rs:468), which strips the marker and preserves current-branch semantics — reuse it here. The log, status, and tag generators added just below have the same problem: --oneline, --short, and decorated tag output are not bare values.

fig_parse::lines,
),
)
.add_generator(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 [NIT] unknow_dev_null_possible neither describes the values being completed nor spells unknown correctly, which makes the JSON-to-Rust wiring hard to audit. Rename these script-derived identifiers to semantic names such as paging_values, decorations_values, color_values, and wrap_values.

@warp-agent-staging warp-agent-staging Bot changed the title Port Fig generators and generateSpec to Rust Port Fig generators and postProcess to Rust Sep 3, 2026
@warp-agent-staging
warp-agent-staging Bot force-pushed the factory/port-fig-generators branch from e950930 to 890bd8b Compare September 3, 2026 18:26
@warp-agent-staging warp-agent-staging Bot changed the title Port Fig generators and postProcess to Rust Port Fig generators to Rust Sep 3, 2026
@warp-agent-staging
warp-agent-staging Bot marked this pull request as draft September 3, 2026 18:34
@warp-factories
warp-factories Bot dismissed their stale review September 3, 2026 18:36

Superseded by a new review pass at 890bd8b

@warp-factories warp-factories Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This revision ports the ignored Fig generators fields to Rust generatorName registrations, collapses duplicate script generators, and restores the original generateSpec JSON (15 keys across 13 specs) as unimplemented. Requesting changes: the shared line parser still hands decorated and structured command output to the completion menu as literal values.

Concerns

  • fig_parse::lines splits raw output on newlines and is the parser for all 137 migrated registrations, including ones whose removed postProcess extracted values out of JSON. amplify env list --json, ansible-doc --list --json, and cargo read-manifest will offer JSON fragments where environment, plugin, and binary names belong. See the inline findings for representative paths.
  • On the stacked-PR split: the description places structured postProcess parsers on a follow-up PR, which is a reasonable way to divide the work, but the regression ships with this change. Once this merges, those 137 call sites execute and return unusable values until the follow-up lands. Either hold the affected registrations until their parsers exist, or land the two together.
  • This revision drops the unit tests the PR had added, and the remaining registry test only asserts that a generator name resolves — it never exercises parser output. Add table-driven fixtures per output contract, covering git branch, git log --oneline, git status --short, and malformed JSON.
  • The PR body contains no images. Repository guidance requires a real Warp completion dropdown showing generator-produced candidates for every new or modified generator; please add that evidence before merge.
  • Review coverage: correctness carries the blocking findings above; standards are unverified locally because no Rust toolchain is available in this environment, though CI is green; complexity and comments were examined with no material concern; naming has the inline nit; security was examined with no applicable finding, as there are no dependency or CI changes and the restored JSON fields are inert.

Verdict

Checks: build unverified (cargo unavailable), tests unverified (cargo unavailable), CI green (8/8), visual proof missing

Found: 0 critical, 4 important, 0 suggestions, 1 nit

Recommendation: request changes

Responding as Warp for OSS: Open session · View run

output
.lines()
.map(str::trim)
.filter(|line| !line.is_empty())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] This raw line splitter is the parser for 137 new registrations, though many of the postProcess functions it replaces extracted command arguments out of JSON or structured output. amplify env list --json, ansible-doc --list --json, and cargo read-manifest will now offer JSON fragments instead of environment, plugin, or binary names. Use a parser per output contract and add representative fixtures for each.

"branches",
Generator::script(
CommandBuilder::single_command("git --no-optional-locks branch --no-color --sort=-committerdate"),
fig_parse::lines,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] git branch prints the checked-out branch as * <branch>, so this parser suggests an invalid ref; branches_no, log --oneline, and status --short just below likewise expose decorated records verbatim. This module already has post_process_branches (git.rs:468) for the branch case — reuse it for both branch generators, and add parsers that extract the commit hash and the status path before suggesting them.

),
)
.add_generator(
"unknow_dev_null_possible",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 [NIT] unknow_dev_null_possible neither describes the values being completed nor spells unknown correctly, which makes the JSON-to-Rust wiring hard to audit. Rename these script-derived identifiers to semantic names such as paging_values, decorations_values, color_values, and wrap_values.

@acarl005
acarl005 marked this pull request as ready for review September 3, 2026 18:37
@acarl005 acarl005 self-assigned this Sep 3, 2026
Replace ignored argument-level generators with generatorName/template
wiring and register script-backed completions through shared line
parsers. Remove generateSpec after materializing the static python
manage.py case. Custom JS generators without a script fall back to
filepaths templates.
Keep source JSON byte-stable except surgical generators/generateSpec
edits so Unicode and escaping are unchanged. Replace hashed fig_*
names with semantic generator names and split the dump module into
per-command generator files.
Collapse identical command+script registrations, including amplify
env_list, and reuse existing parsers when the script already has one.
Register each command in a single CommandSignatureGenerators value.
Drop DynamicCompletionData::extend, the extra merge path, numeric-suffix
names, and the unit tests this PR added.
Put generateSpec back on the specs that had it, without implementing
dynamic command trees.
@acarl005
acarl005 force-pushed the factory/port-fig-generators branch from 890bd8b to 9f81e91 Compare September 4, 2026 02:56
@acarl005
acarl005 merged commit dd90aa3 into main Sep 4, 2026
8 checks passed
@acarl005
acarl005 deleted the factory/port-fig-generators branch September 4, 2026 02:59
acarl005 pushed a commit to warpdotdev/warp that referenced this pull request Sep 4, 2026
## Description
Bump `warp-command-signatures` (and the locked
`warp-completion-metadata` from the same git source) from
`6a39d62048abbf3885be54a7887f1916ebcf7445` to
`d69b340ef622540ac28340ef565dae45287d51d8`. That revision includes
[command-signatures#391](warpdotdev/command-signatures#391)
and
[command-signatures#392](warpdotdev/command-signatures#392)
(Rust Fig generators and template filters).

Lockfile sources for both packages were updated to the same rev.
Unrelated `cargo update` resolution churn was not included.

## Linked Issue
-
[APP-5776](https://linear.app/warpdotdev/issue/APP-5776/port-fig-javascript-argument-generators-and-template-filters-to-rust)

## Testing
Verification was not run, at the requester’s direction.

- [ ] I have manually tested my changes locally with `./script/run`

## Agent Mode
- [ ] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-NONE

<!-- warp:pr-description-artifacts start -->
<!-- warp:pr-description-artifacts end -->

Co-authored-by: warp-agent-staging[bot] <240773466+warp-agent-staging[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed factory:large-factory-test Label associated to the "large-factory-test" factory factory:warp-for-oss Owned by the Warp for OSS factory factory:wilson

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant