Skip to content

refactor: Remove direct components/core/src/clp include dependency and normalize CLP header includes; Simplify CLP core source path variable usage.#130

Draft
Bill-hbrhbr wants to merge 3 commits intoy-scope:mainfrom
Bill-hbrhbr:remove-include-src-clp-header
Draft

refactor: Remove direct components/core/src/clp include dependency and normalize CLP header includes; Simplify CLP core source path variable usage.#130
Bill-hbrhbr wants to merge 3 commits intoy-scope:mainfrom
Bill-hbrhbr:remove-include-src-clp-header

Conversation

@Bill-hbrhbr
Copy link
Copy Markdown
Contributor

@Bill-hbrhbr Bill-hbrhbr commented Mar 14, 2026

Description

This PR removes the dependency on the explicit components/core/src/clp include directory in clp-ffi-js, which standardizes header usage with namespaced CLP includes. In particular, call sites that previously included type_utils.hpp directly now include clp/type_utils.hpp. The goal is to reduce and tighten target_include_directories surface area.

A related include-path leak also exists in the main CLP repo: components/core/src/clp is exposed transitively via clp::string_utils CMakeLists.txt).

Follow-up cleanup in both this PR and upstream CLP is currently blocked on moving clp::string_utils into ystdlib-cpp.

For further cleanup, the build now uses CLP_FFI_JS_CLP_CORE_SRC_DIR in place of CLP_FFI_JS_CLP_SOURCE_DIRECTORY/components/core/src for cleaner path construction.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • Vitest pass.

Summary by CodeRabbit

  • Chores
    • Centralized core source directory references in the build configuration to simplify path management.
    • Updated internal header includes to use the namespaced locations.
    • Updated an upstream dependency source and checksum.

@Bill-hbrhbr Bill-hbrhbr requested a review from a team as a code owner March 14, 2026 01:58
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 14, 2026

Walkthrough

Introduces a new CMake variable CLP_FFI_JS_CLP_CORE_SRC_DIR to centralize CLP core source/include paths, updates CMakeLists references and add_subdirectory calls to use it, adds IrDeserializationError.cpp to the CLP core sources, updates two C++ includes to clp/type_utils.hpp, and updates a dependency URL and checksum.

Changes

Cohort / File(s) Summary
CMake Path Centralization
CMakeLists.txt
Adds CLP_FFI_JS_CLP_CORE_SRC_DIR, refactors CLP core source lists to use the new base dir, updates add_subdirectory() and target_include_directories() invocations, and includes IrDeserializationError.cpp in the CLP core sources.
Header Include Updates
src/clp_ffi_js/constants.hpp, src/clp_ffi_js/ir/StructuredIrUnitHandler.cpp
Replaces includes from <type_utils.hpp> to <clp/type_utils.hpp> in two source files.
Dependency Update
taskfiles/deps.yaml
Updates clp dependency archive URL and FILE_SHA256 checksum to a different repository/archive reference.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and accurately summarizes the main changes: removing direct components/core/src/clp include dependencies, normalizing CLP header includes, and simplifying path variable usage in CMakeLists.txt.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Bill-hbrhbr Bill-hbrhbr changed the title refactor: Remove direct src/clp include dependency and normalize CLP header includes; Simplify CLP core source path variable usage. refactor: Remove direct components/core/src/clp include dependency and normalize CLP header includes; Simplify CLP core source path variable usage. Mar 14, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@taskfiles/deps.yaml`:
- Around line 113-115: Add an inline comment above the URL entry that documents
why the CLP dependency points to the temporary fork (Bill-hbrhbr/clp at commit
bfae396), include the specific issue or PR in the upstream repo (y-scope/clp)
that tracks the fix (or a link/issue number), and state the condition for
reverting to the official repo (e.g., merge of that upstream PR or a specific
commit). Mention the commit hash bfae396 and that this is a temporary hot-fix to
make the intent and technical debt explicit for future maintainers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 271bfa1b-4d45-49b6-a6f7-784ace813c1d

📥 Commits

Reviewing files that changed from the base of the PR and between fcfcfac and 4241d90.

📒 Files selected for processing (2)
  • CMakeLists.txt
  • taskfiles/deps.yaml

Comment on lines +113 to +115
FILE_SHA256: "8bb01253a37d4d53f0c1fd95dd58a386830968b93972edb64fc09d0310cb48d1"
OUTPUT_DIR: "{{.OUTPUT_DIR}}"
URL: "https://github.com/y-scope/clp/archive/de9fc08.tar.gz"
URL: "https://github.com/Bill-hbrhbr/clp/archive/bfae396.tar.gz"
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Mar 15, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the fork commit exists and check its relationship to the main repo
echo "Checking if the commit exists in the fork..."
curl -s "https://api.github.com/repos/Bill-hbrhbr/clp/commits/bfae396" | jq '{sha: .sha, message: .commit.message, date: .commit.author.date}'

echo ""
echo "Checking for related PRs in y-scope/clp that might merge this fix..."
gh search prs --repo y-scope/clp --author Bill-hbrhbr --state open --json title,url,state --limit 5

Repository: y-scope/clp-ffi-js

Length of output: 428


🏁 Script executed:

# Check the full context of the deps.yaml file around the CLP dependency
cat -n taskfiles/deps.yaml | head -130 | tail -30

# Look for any comments or notes about CLP in the repository
rg -i "bill-hbrhbr\|clp.*fork\|clp.*hot.?fix" --type yaml --type md --type txt --max-count 20

# Check git history for this file if available
git log --oneline -20 taskfiles/deps.yaml 2>/dev/null || echo "Git history not available"

Repository: y-scope/clp-ffi-js

Length of output: 1326


🏁 Script executed:

# Search for any issues or discussions about the CLP string_utils problem
rg -i "clp::string_utils\|components/core/src/clp" --type-list

# Look for any GitHub issue references or TODO comments
rg -i "TODO|FIXME|BUG|issue" taskfiles/deps.yaml

Repository: y-scope/clp-ffi-js

Length of output: 451


🏁 Script executed:

# Fix the search - look for any context about why the fork is needed
rg -i "string_utils|clp.*fork|components/core" --type yaml --type md

# Check if there's a PR or commit that explains this
git show 4241d90 --stat 2>/dev/null || echo "Cannot show full commit details"

# Look for any issue tracking or comments in related files
fd -e md -e txt -e yaml | xargs rg -l "clp|Bill-hbrhbr" 2>/dev/null || echo "No related files found"

Repository: y-scope/clp-ffi-js

Length of output: 3252


🏁 Script executed:

# Check README or docs for any mentions of this CLP dependency issue
fd -i "readme|contributing|known.*issue" -t f | head -5 | xargs cat -n 2>/dev/null || echo "No docs found"

# Look for any CHANGELOG or NOTES about recent changes
fd -i "change|release|notes" -t f | head -5

Repository: y-scope/clp-ffi-js

Length of output: 3322


🏁 Script executed:

# Look for any GitHub issue or PR references in the repo that might explain this
rg "github.com|issue|pull" taskfiles/deps.yaml

# Check if there's any documentation about dependencies or known issues
cat -n README.md | grep -A 10 -B 2 -i "depend\|known\|issue\|fork"

# Search for any comments about CLP in source files
rg -i "clp" src/ --type cpp --type hpp --max-count 10 -B 1 -A 1

Repository: y-scope/clp-ffi-js

Length of output: 2593


Add documentation for temporary CLP fork and track upstream resolution.

The CLP dependency currently uses the personal fork Bill-hbrhbr/clp (commit bfae396) rather than the official y-scope/clp repository. While this appears intentional as a hot-fix branch, there is no in-code documentation explaining:

  • Why the fork is necessary
  • When it can be reverted to the official repository

Add an inline comment in taskfiles/deps.yaml documenting the specific issue that requires this fork and reference any upstream CLP PR or issue that tracks the fix. This will help future maintainers understand the technical debt and know when to revert.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@taskfiles/deps.yaml` around lines 113 - 115, Add an inline comment above the
URL entry that documents why the CLP dependency points to the temporary fork
(Bill-hbrhbr/clp at commit bfae396), include the specific issue or PR in the
upstream repo (y-scope/clp) that tracks the fix (or a link/issue number), and
state the condition for reverting to the official repo (e.g., merge of that
upstream PR or a specific commit). Mention the commit hash bfae396 and that this
is a temporary hot-fix to make the intent and technical debt explicit for future
maintainers.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is temporary and will be reverted later.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Bill-hbrhbr, understood! Since this is intentional and temporary, would you like me to open a follow-up GitHub issue to track reverting this back to the official y-scope/clp repository once the upstream fix is merged? That way it won't get lost.


🧠 Learnings used
Learnt from: junhaoliao
Repo: y-scope/clp-ffi-js PR: 35
File: src/clp_ffi_js/ir/StructuredIrStreamReader.cpp:50-51
Timestamp: 2024-11-14T15:31:45.926Z
Learning: Ensure that `clp-ffi-js` supports JavaScript usage without relying on the TypeScript definition file, and keep track of related TODOs in a GitHub issue.

Learnt from: Bill-hbrhbr
Repo: y-scope/clp-ffi-js PR: 125
File: taskfiles/tests.yaml:7-9
Timestamp: 2026-02-22T14:07:05.069Z
Learning: In taskfiles YAML configurations, do not add or rely on a separate status guard for Playwright installation tasks. Playwright install already performs checksum verification and skips redundant installs when browsers are already present, so a Taskfile status check is unnecessary. If you implement installation guards, prefer removing the guard for Playwright and rely on its built-in optimization to simplify the task and avoid redundant executions.

Copy link
Copy Markdown
Contributor

@hoophalab hoophalab left a comment

Choose a reason for hiding this comment

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

LGTM. I will test again after the deps.yaml is updated and conflicts are resolved.

FILE_SHA256: "8bb01253a37d4d53f0c1fd95dd58a386830968b93972edb64fc09d0310cb48d1"
OUTPUT_DIR: "{{.OUTPUT_DIR}}"
URL: "https://github.com/y-scope/clp/archive/de9fc08.tar.gz"
URL: "https://github.com/Bill-hbrhbr/clp/archive/bfae396.tar.gz"
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.

update temporary link

@junhaoliao
Copy link
Copy Markdown
Member

let's resolve the conflicts once #141 is merged

@junhaoliao junhaoliao marked this pull request as draft March 31, 2026 20:01
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.

3 participants