Skip to content

feat(config): implement project-level config discovery for .terraphim/#881

Open
AlexMikhalev wants to merge 23 commits into
mainfrom
push-1721
Open

feat(config): implement project-level config discovery for .terraphim/#881
AlexMikhalev wants to merge 23 commits into
mainfrom
push-1721

Conversation

@AlexMikhalev
Copy link
Copy Markdown
Contributor

Summary

  • 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

Testing

  • 36 unit tests in terraphim_config (including 10 new project discovery tests)
  • 246 unit tests in terraphim_agent
  • 29 integration tests in repl_integration_tests
  • 10 tui_service_tests
  • 17 unit_test

Verification

  • UBS scan: 0 critical issues (pre-existing warnings)
  • cargo fmt: clean
  • cargo clippy: pass
  • cargo check: pass

Refs #1674

forge-admin and others added 23 commits May 19, 2026 11:30
…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
- Add project-level config discovery section to terraphim_config summary
- Update main summary.md with new ProjectConfig type and discovery feature
- Add release announcement to .docs/releases/v2026.05.19.md

Refs: project config discovery feature (commits 59cd233, 26f5b87)
…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
@AlexMikhalev
Copy link
Copy Markdown
Contributor Author

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.

@AlexMikhalev
Copy link
Copy Markdown
Contributor Author

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.

@AlexMikhalev AlexMikhalev reopened this May 22, 2026
@AlexMikhalev
Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant