0.17 phase 4 / PR A: docs/config drift battery + .zshrc preservation#147
Open
StanMarek wants to merge 5 commits into
Open
0.17 phase 4 / PR A: docs/config drift battery + .zshrc preservation#147StanMarek wants to merge 5 commits into
StanMarek wants to merge 5 commits into
Conversation
…gainst schema Three in-crate drift_tests modules consume gc_config::all_field_paths() to assert install.rs::DEFAULT_CONFIG_TOML, tui::fields::all_fields(), and docs/CONFIGURATION.md mention every leaf key. ghost-complete is a binary-only crate (no lib.rs), so the install + TUI tests live next to the data they test; the docs test lives in gc-config because that crate can reach docs/CONFIGURATION.md via CARGO_MANIFEST_DIR. On this commit the install + docs tests are EXPECTED to fail wholesale — Task 3 (install template backfill) and Task 8 (CONFIGURATION.md backfill) drive them to green. The TUI editor test passes today.
Adds render_block_ms, js_runtime, [suggest.spec_cache], [paths], and experimental.brew_search_cap with help comments. In-crate drift test (drift_tests::install_template_contains_every_schema_field) pins the parity going forward.
content.trim() at install.rs:518 was stripping all leading/trailing whitespace from user content before sandwiching managed blocks. New splice helper replaces blocks in-place (preserving surrounding bytes exactly) or appends with a single separator blank line.
…load table Adds documentation for every field caught by the field-level docs drift test (render_block_ms, js_runtime, spec_cache.*, paths.spec_dirs, brew_search_cap, and any historical drift). Hot-reload table audited against ReloadBehavior enum. If render_block_ms hasn't been wired by rendering-polish, demoted to RequiresRestart to stop lying to users.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gc_config::all_field_paths()catalog (Task 1).against the GhostConfig schema (Task 2; in-crate per binary-crate
constraint).
popup.render_block_ms,suggest.providers.js_runtime, full[suggest.spec_cache],[paths],and
experimental.brew_search_cap(Task 3).install.rs:518content.trim()replaced with a splice helper thatpreserves user
.zshrcbytes outside managed blocks (Task 4).hot-reload table audited against
ReloadBehaviorenum (Task 8).render_block_msleft asLive— rendering-polish (Overlay rendering polish: one DECSET 2026 frame per overlay update #138) wired itthrough
update_config, so docs/editor are now truthful.Test plan
cargo test --workspacegreen.field-level, docs section smoke.
install_preserves_user_blank_lines_around_managed_blocksexercisesinstall + reinstall, asserts no blank-line accumulation.
cargo run -- install --dry-runshows every schema key in thegenerated template.
Notes for the reviewer
Verified state corrections vs. the 2026-05-16 plan snapshot:
content.trim()was actually atinstall.rs:518, not the plan's :505 reference.render_block_msIS wired throughInputHandler::update_config(seecrates/gc-pty/src/handler.rs:763— 13th positional parameter). Task 8Steps 3-5 (the demotion logic in the plan) are therefore intentionally
skipped; docs + editor now match reality.
keybindings.*(6 fields) andtheme.*(10 fields) listings hadstale names;
gc_config::all_field_paths()uses the actual struct fieldnames (
accept_and_enter,navigate_up,navigate_down,trigger,preset,feedback_loading/empty/error, etc.) — 48 total leaf paths.Implementation deviation in Task 4: The plan's
splice_managed_blocks+replace_or_append_blockhelpers would have placed the init block at thebottom of a fresh
.zshrc(no prepend semantics inreplace_or_append).Took the minimal fix instead: remove
.trim()and guard the trailing newlineinsertion so idempotent reinstalls are byte-identical to the first install.
Same byte-preservation guarantee, no new helpers, no risk to the existing
init-at-top / shell-at-bottom convention. The new test
install_preserves_user_blank_lines_around_managed_blocksis the contract.CONFIGURATION.md backfill turned out trivially small: the field-level and
section-level docs drift tests both passed on first run — every key already
appears as a backtick code span or TOML assignment. The only hot-reload table
gap was a missing
[suggest.spec_cache]row, fixed in Task 8.Coordination notes
conflict expected.
tui/{ui,app,editor}.rsand may add filterstate to
tui/fields.rsruntime code. My touch ontui/fields.rsis abottom-of-file
#[cfg(test)] mod drift_testsonly — should auto-merge.If conflicts arise, the test module is the dropper-in.
touch set (
gc-suggest/*,handler.rs:1268-1276/2840-2856,specs/*.json,fig-converter, PROVIDERS.md) does NOT intersect this PR. The drift
tests this PR ships are the contract: if phase 5 ever adds a
GhostConfigfield, they must extendall_field_paths(), the installtemplate, the TUI editor metadata, and CONFIGURATION.md in lockstep.
The forward contract on
all_field_paths()'s doc comment makes thisexplicit.