You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: recover generated state during init indexing (#7)
## Summary
This prepares the `v2.1.1` patch release and fixes the setup/indexing
failure mode seen after upgrading when existing generated
`.gather-step/storage` state is stale or incompatible.
The release also improves operator-facing recovery text so the CLI gives
sentence-cased, actionable guidance instead of exiting with only a
storage-open context.
## Root Cause
`gather-step init --index` invoked the normal index path without
auto-recovery. If generated graph/search/metadata state from an older
version was stale or schema-incompatible, setup could fail before
parsing repos and only surface the surrounding storage-open context.
## Key Decisions
- Treat `init --index` as a setup/rebuild flow and enable
generated-state auto-recovery there.
- Keep plain `gather-step index` conservative; operators still opt into
rebuilds with `--auto-recover`.
- Point unsupported graph schema state to `gather-step index
--auto-recover`.
- Use proper sentence casing for stable operator errors.
- Document Homebrew upgrades as `brew update` followed by `brew upgrade
thedoublejay/tap/gather-step`.
## Files Changed
| File | Change |
| --- | --- |
| `crates/gather-step-cli/src/commands/init.rs` | Enables auto-recovery
for setup-triggered indexing. |
| `crates/gather-step-cli/src/commands/index.rs` | Clarifies recovery
progress output. |
| `crates/gather-step-cli/src/errors.rs` | Adds proper-cased, actionable
recovery messages for generated-state failures. |
| `crates/gather-step-cli/tests/*` | Adds and updates recovery/message
regression coverage. |
| `Cargo.toml`, crate manifests, `Cargo.lock`, `website/package.json` |
Bumps package metadata to `2.1.1`. |
| `website/src/content/docs/changelog.md` | Marks `v2.1.1` as released.
|
| `website/src/content/docs/guides/installation.md` | Clarifies Homebrew
upgrade commands. |
## Verification
- [x] `cargo fmt --check`
- [x] `cargo check -p gather-step --all-targets`
- [x] `cargo test -p gather-step --test cli_wizard_full -- --nocapture`
- [x] `cargo test -p gather-step --test cli_commands
corrupt_graph_index_reports_auto_recover_and_auto_recover_rebuilds --
--exact --nocapture`
- [x] `cargo test -p gather-step --test cli_commands
unsupported_metadata_schema_reports_stable_rebuild_message -- --exact
--nocapture`
- [x] `cargo test -p gather-step --test cli_commands
stable_error_when_config_yaml_is_malformed -- --exact --nocapture`
- [x] `cargo nextest run --all-features`
- [x] `cargo clippy -p gather-step --all-targets --all-features -- -D
warnings`
- [x] `cargo run -q -p gather-step -- --version` prints `gather-step
2.1.1`
- [x] `cd website && bun run build`
## Rollout
After merge, tag `v2.1.1` and run the release workflow.
## Follow-ups
- None for this PR.
Copy file name to clipboardExpand all lines: crates/gather-step-cli/src/errors.rs
+39-13Lines changed: 39 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ use anyhow::Error;
4
4
use gather_step_core::ConfigError;
5
5
use gather_step_storage::{GraphStoreError,MetadataStoreError,SearchStoreError};
6
6
7
-
constUNSUPPORTED_SCHEMA_MESSAGE:&str = "your local index uses an unsupported schema; run `gather-step clean && gather-step index` to rebuild";
7
+
constUNSUPPORTED_SCHEMA_MESSAGE:&str = "Generated index state uses an unsupported schema. Run `gather-step index --auto-recover` to rebuild from source repos.";
return"another gather-step process is using this workspace; stop `gather-step watch` or `gather-step serve --watch`, then retry".to_owned();
30
+
return"Another gather-step process is using this workspace. Stop `gather-step watch` or `gather-step serve --watch`, then retry.".to_owned();
31
31
}
32
32
GraphStoreError::Corrupt{ .. } => {
33
-
return"your index is corrupt or incomplete; run `gather-step index --auto-recover` to rebuild generated state, or run `gather-step clean && gather-step index`".to_owned();
33
+
return"Your index is corrupt or incomplete. Run `gather-step index --auto-recover` to rebuild generated state, or run `gather-step clean && gather-step index`.".to_owned();
34
+
}
35
+
GraphStoreError::SchemaVersionMismatch{ .. } => {
36
+
returnUNSUPPORTED_SCHEMA_MESSAGE.to_owned();
34
37
}
35
38
_ => {}
36
39
}
37
40
}
38
41
}
39
42
40
43
ifcontains_ascii_case_insensitive(&full,"workspace is not a git repository"){
41
-
return"workspace is not a git repository. Next step: run from a git checkout or omit `--release-gate` for an unsealed run".to_owned();
44
+
return"Workspace is not a git repository. Next step: run from a git checkout or omit `--release-gate` for an unsealed run.".to_owned();
return"your index is corrupt or incomplete; run `gather-step index --auto-recover` to rebuild generated state, or run `gather-step clean && gather-step index`".to_owned();
62
+
return"Your index is corrupt or incomplete. Run `gather-step index --auto-recover` to rebuild generated state, or run `gather-step clean && gather-step index`.".to_owned();
0 commit comments