Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,24 @@ set(CLP_FFI_JS_SRC_MAIN
src/clp_ffi_js/utils.cpp
)

set(CLP_FFI_JS_CLP_CORE_SRC_DIR ${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src)

set(CLP_FFI_JS_SRC_CLP_CORE
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/ffi/EncodedTextAstError.cpp
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/ffi/ir_stream/decoding_methods.cpp
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/ffi/ir_stream/ir_unit_deserialization_methods.cpp
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/ffi/ir_stream/search/ErrorCode.cpp
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/ffi/ir_stream/search/QueryHandlerImpl.cpp
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/ffi/ir_stream/search/utils.cpp
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/ffi/ir_stream/utils.cpp
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/ffi/KeyValuePairLogEvent.cpp
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/ffi/SchemaTree.cpp
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/ir/EncodedTextAst.cpp
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/ir/LogEventDeserializer.cpp
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/ReadOnlyMemoryMappedFile.cpp
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/ReaderInterface.cpp
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/streaming_compression/zstd/Decompressor.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/ffi/EncodedTextAstError.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/ffi/ir_stream/decoding_methods.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/ffi/ir_stream/ir_unit_deserialization_methods.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/ffi/ir_stream/IrDeserializationError.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/ffi/ir_stream/search/ErrorCode.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/ffi/ir_stream/search/QueryHandlerImpl.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/ffi/ir_stream/search/utils.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/ffi/ir_stream/utils.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/ffi/KeyValuePairLogEvent.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/ffi/SchemaTree.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/ir/EncodedTextAst.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/ir/LogEventDeserializer.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/ReadOnlyMemoryMappedFile.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/ReaderInterface.cpp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/streaming_compression/zstd/Decompressor.cpp
)

set(CLP_FFI_JS_SUPPORTED_ENVIRONMENTS
Expand Down Expand Up @@ -159,7 +162,7 @@ find_package(zstd REQUIRED)
message(STATUS "Found zstd ${zstd_VERSION}")

set(CLP_BUILD_CLP_STRING_UTILS ON)
add_subdirectory(${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp/string_utils)
add_subdirectory(${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp/string_utils)

# The `clp_s` component is linked because the IR search feature uses the same KQL syntax as `clp_s`,
# by reusing `clp_s`'s AST and KQL libraries.
Expand All @@ -179,7 +182,7 @@ set(CLP_BUILD_CLP_S_SEARCH_AST ON)
set(CLP_BUILD_CLP_S_SEARCH_KQL ON)
set(CLP_BUILD_CLP_S_TIMESTAMP_PARSER ON)
set(CLP_BUILD_CLP_S_TIMESTAMPPATTERN ON)
add_subdirectory(${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp_s)
add_subdirectory(${CLP_FFI_JS_CLP_CORE_SRC_DIR}/clp_s)

foreach(env ${CLP_FFI_JS_SUPPORTED_ENVIRONMENTS})
set(CLP_FFI_JS_BIN_NAME "ClpFfiJs-${env}")
Expand Down Expand Up @@ -229,8 +232,7 @@ Link options: ${CLP_FFI_JS_LINK_OPTIONS}."
${CLP_FFI_JS_BIN_NAME}
SYSTEM
PRIVATE
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src
${CLP_FFI_JS_CLP_SOURCE_DIRECTORY}/components/core/src/clp
${CLP_FFI_JS_CLP_CORE_SRC_DIR}
)

target_include_directories(${CLP_FFI_JS_BIN_NAME} PRIVATE src/)
Expand Down
3 changes: 2 additions & 1 deletion src/clp_ffi_js/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#include <array>
#include <cstdint>
#include <string_view>
#include <type_utils.hpp>

#include <clp/type_utils.hpp>

namespace clp_ffi_js {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/clp_ffi_js/ir/StructuredIrUnitHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
#include <optional>
#include <string>
#include <string_view>
#include <type_utils.hpp>
#include <utility>

#include <clp/ffi/ir_stream/decoding_methods.hpp>
#include <clp/ffi/SchemaTree.hpp>
#include <clp/ffi/Value.hpp>
#include <clp/ir/types.hpp>
#include <clp/time_types.hpp>
#include <clp/type_utils.hpp>
#include <emscripten/val.h>
#include <spdlog/spdlog.h>

Expand Down
4 changes: 2 additions & 2 deletions taskfiles/deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ tasks:
cmds:
- task: ":utils:remote:download-and-extract-tar"
vars:
FILE_SHA256: "1a70dc757d8e3bc323808cc4b8bc9e060ac3c6add183ed8aef49d918cedc49ff"
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"
Comment on lines +113 to +115
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

Choose a reason for hiding this comment

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

update temporary link

- >-
echo "set(
CLP_FFI_JS_CLP_SOURCE_DIRECTORY \"{{.OUTPUT_DIR}}\"
Expand Down
Loading