feat(config): implement project-level config discovery for .terraphim/#881
feat(config): implement project-level config discovery for .terraphim/#881AlexMikhalev wants to merge 23 commits into
Conversation
…1721 Replace byte-slice truncation prompt[..MAX_PROMPT_LENGTH] with prompt.chars().take(MAX_PROMPT_LENGTH).collect() to prevent panic when MAX_PROMPT_LENGTH falls inside a multi-byte UTF-8 character. Adds test_sanitize_multibyte_boundary to verify correct behaviour.
- Redirect all command output through tee to build-output.log - ADF agent runner truncates stderr at ~8KB, hiding clippy/build/test results - Fix parse_build_md: was concatenating lines without newlines - BUILD_LOG set to $ADF_WORKING_DIR/build-output.log per run Refs #1721
- Add project.rs with discover() function that walks up from cwd to find .terraphim/ - Change global_shortcut from String to Option<String> in Config - Add merge_with() and with_project() methods to ConfigBuilder - Update TuiService::new to accept no_project_config parameter - Add merge_project_config() helper that discovers and merges project config - Update all call sites and tests to use new signatures Refs #1674
- Add project.rs with discover() function that walks up from cwd to find .terraphim/ - Change global_shortcut from String to Option<String> in Config - Add merge_with() and with_project() methods to ConfigBuilder - Update TuiService::new to accept no_project_config parameter - Add merge_project_config() helper that discovers and merges project config - Update all call sites and tests to use new signatures Refs #1674
- cargo clippy -D warnings caught &real.join() where real.join() works - Affects create_dir_all and canonicalize calls in test Refs #1721
# Conflicts: # crates/terraphim_config/src/project.rs
…ld-runner fixes - Replace byte-indexed prompt truncation with .chars().take() to prevent UTF-8 byte-boundary panic in sanitize_system_prompt (Fixes #1721) - Add test_sanitize_multibyte_boundary test for char-safe truncation - Implement project-level config discovery for .terraphim/ directories - Fix build-runner-llm.sh: pipefail for correct exit codes, tee output to build-output.log (ADF truncates stderr), fix parse_build_md command extraction - Fix clippy warnings: needless_borrows_for_generic_args in project.rs, unnecessary_cast in llm_bridge.rs, field-reassign-with-default in config - Revert incorrect TuiService::new(None, false) to TuiService::new(None) - Fix global_shortcut Option<String> consistency across test files - Mark LLM bridge integration tests as #[ignore] (require live client) Refs #1721
Refs: release v2026.05.19
|
Closing as stale/conflicting after remote convergence. This PR has the same commit list and changed files as GitHub PR #882, and current active merge work is tracked in Gitea. No branch is being deleted; head branch push-1721 and all commits remain available for recovery/cherry-pick if needed. Last PR commit observed: 2f3ada1. |
|
Reopened for explicit feature-verification after closure. Current finding: the .terraphim project config discovery feature appears present on main, but this PR was not itself merged. Keeping open until validation is documented so no feature work is lost. |
|
Feature-level validation after reopening: current main already contains the .terraphim project config discovery feature. Evidence: crates/terraphim_config/src/project.rs exists; crates/terraphim_config/src/lib.rs exports project and includes ConfigBuilder::with_project(); crates/terraphim_agent/src/service.rs calls terraphim_config::project::discover(None). Targeted validation passed: cargo test -p terraphim_config project::tests -- --nocapture (10/10). Comparing current main to this PR's tip shows only crates/terraphim_config/src/project.rs differs, and main has the safer canonical-path implementation/tests. Keeping this PR open for human confirmation before closing again, so no feature work or review trace is lost. |
Summary
project.rswithdiscover()function that walks up from cwd to find.terraphim/global_shortcutfromStringtoOption<String>inConfigmerge_with()andwith_project()methods toConfigBuilderTuiService::newto acceptno_project_configparametermerge_project_config()helper that discovers and merges project configTesting
Verification
Refs #1674