Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4d05418
feat: migrate cache module to core library
flyingrobots Jul 10, 2025
8562cc9
fix: avoid CI TODO detection in mkdtemp template string
flyingrobots Jul 10, 2025
7508421
fix: resolve CI build failures and improve portability
flyingrobots Jul 10, 2025
dad6be3
fix: use hex escapes to avoid CI TODO detection in mkdtemp template
flyingrobots Jul 10, 2025
88e8c1b
feat: implement C23 standards and improve CRoaring integration
flyingrobots Jul 10, 2025
04c8afd
fix: add CRoaring dependency to CI workflows
flyingrobots Jul 10, 2025
ea02228
refactor: implement C23 standards for cache/bitmap system
flyingrobots Jul 10, 2025
6ca4b49
fix: resolve CI compatibility issues for C23 implementation
flyingrobots Jul 10, 2025
39cb5f4
fix: resolve roaring bitmap API and build warnings
flyingrobots Jul 10, 2025
4c84b60
fix: resolve clang-tidy magic number warnings
flyingrobots Jul 10, 2025
81adae8
fix: move cache constants above struct definitions
flyingrobots Jul 10, 2025
779194e
fix: resolve clang-tidy warnings in cache/cache.h
flyingrobots Jul 10, 2025
ffe21d3
fix: improve parameter names for clang-tidy compliance
flyingrobots Jul 10, 2025
0809c7b
fix: eliminate magic number in bitmap header struct
flyingrobots Jul 10, 2025
28f3ebb
fix: add assert.h include for static_assert in C23
flyingrobots Jul 10, 2025
f69d701
fix: add missing stdint.h include for uint64_t in bitmap.c
flyingrobots Jul 11, 2025
16c1922
fix: properly fix clang-tidy warnings in bitmap.c
flyingrobots Jul 11, 2025
ecc76a7
fix: mark roaring headers as system includes and fix alignment issues
flyingrobots Jul 11, 2025
10801d4
fix: eliminate NOLINT suppressions for insecureAPI warnings
flyingrobots Jul 11, 2025
349653a
docs: remove dates and update project status
flyingrobots Jul 11, 2025
0e90288
fix: modernize Meson configuration and dependency handling
flyingrobots Jul 11, 2025
3dbd0ec
PRD: First-class, time-travel-safe semantics (names+derived IDs) + do…
flyingrobots Sep 12, 2025
1b97c61
PRD: expand with entity vocabulary, hybrid advice merge (CRDT), and c…
flyingrobots Sep 12, 2025
bd00cc8
ADR 0001: Names-as-truth semantics, derived IDs, hybrid CRDT advice m…
flyingrobots Sep 12, 2025
a14ed71
Fix tidy: add assert include; include <stddef.h> in security string; …
flyingrobots Sep 12, 2025
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
2 changes: 2 additions & 0 deletions .ci/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!Dockerfile
25 changes: 22 additions & 3 deletions .ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
FROM ubuntu:22.04
LABEL com.gitmind.project="git-mind" \
org.opencontainers.image.title="git-mind-ci"
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=UTC
RUN apt-get update && \
apt-get install -y wget gnupg lsb-release python3-pip pkg-config software-properties-common && \
apt-get install -y --no-install-recommends wget gnupg lsb-release python3-pip pkg-config software-properties-common ca-certificates && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
wget -O - https://apt.llvm.org/llvm.sh | bash -s -- 20 && \
apt-get install -y clang-20 clang-tidy-20 cppcheck libsodium-dev git ninja-build && \
apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
apt-get update && \
apt-get install -y --no-install-recommends clang-20 clang-tidy-20 cppcheck \
libsodium-dev libgit2-dev git ninja-build pkg-config build-essential cmake ca-certificates && \
apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
Comment on lines +7 to +14

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.

🛠️ Refactor suggestion

Tighten apt layers and pin external installer trust.

  • Combine update+install to avoid stale indexes; reduce cleans.
  • Piping llvm.sh to bash is supply-chain fragile; at least pin a specific commit or verify checksum/signature.
-RUN apt-get update && \
-    apt-get install -y --no-install-recommends wget gnupg lsb-release python3-pip pkg-config software-properties-common ca-certificates && \
-    rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
-    wget -O - https://apt.llvm.org/llvm.sh | bash -s -- 20 && \
-    apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
-    apt-get update && \
-    apt-get install -y --no-install-recommends clang-20 clang-tidy-20 cppcheck \
-        libsodium-dev libgit2-dev git ninja-build pkg-config build-essential cmake ca-certificates && \
-    apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
+RUN apt-get update && \
+    apt-get install -y --no-install-recommends wget gnupg lsb-release python3-pip pkg-config software-properties-common ca-certificates && \
+    rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
+    wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && bash /tmp/llvm.sh 20 && rm -f /tmp/llvm.sh && \
+    apt-get update && \
+    apt-get install -y --no-install-recommends clang-20 clang-tidy-20 cppcheck \
+        libsodium-dev libgit2-dev git ninja-build pkg-config build-essential cmake ca-certificates && \
+    rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
apt-get install -y --no-install-recommends wget gnupg lsb-release python3-pip pkg-config software-properties-common ca-certificates && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
wget -O - https://apt.llvm.org/llvm.sh | bash -s -- 20 && \
apt-get install -y clang-20 clang-tidy-20 cppcheck libsodium-dev git ninja-build && \
apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
apt-get update && \
apt-get install -y --no-install-recommends clang-20 clang-tidy-20 cppcheck \
libsodium-dev libgit2-dev git ninja-build pkg-config build-essential cmake ca-certificates && \
apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
RUN apt-get update && \
apt-get install -y --no-install-recommends wget gnupg lsb-release python3-pip pkg-config software-properties-common ca-certificates && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && bash /tmp/llvm.sh 20 && rm -f /tmp/llvm.sh && \
apt-get update && \
apt-get install -y --no-install-recommends clang-20 clang-tidy-20 cppcheck \
libsodium-dev libgit2-dev git ninja-build pkg-config build-essential cmake ca-certificates && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
🤖 Prompt for AI Agents
.ci/Dockerfile around lines 7 to 14: the Dockerfile creates multiple apt layers
and runs apt-get update/install in separate commands and pipes the llvm.sh
installer directly to bash which is supply-chain risky; fix by combining apt-get
update and apt-get install into a single RUN step to avoid stale indexes and
extra layers, remove repeated apt-get clean/rm lines by doing a single cleanup
at the end of that RUN, and replace the wget | bash usage by downloading the
llvm.sh to a file, verifying it against a pinned checksum or signature (or pin a
specific trusted release URL/commit), then execute the verified script; ensure
package installs are explicit (use package versions or distro packages where
possible) and keep cleanup (rm -rf /var/lib/apt/lists/*
/var/cache/apt/archives/*) only once at the end of the combined RUN.

ln -sf /usr/bin/clang-tidy-20 /usr/local/bin/clang-tidy && \
ln -sf /usr/bin/clang++-20 /usr/local/bin/clang++ && \
ln -sf /usr/bin/clang-20 /usr/local/bin/clang && \
pip3 install meson ninja
pip3 install --no-cache-dir meson ninja && \
# Install CRoaring from apt if available, otherwise build from source
apt-get update && (apt-get install -y --no-install-recommends libroaring-dev || true) && \
if ! pkg-config --exists roaring; then \
echo "Building CRoaring from source..." && \
rm -rf /tmp/croaring && \
git clone --depth 1 https://github.com/RoaringBitmap/CRoaring.git /tmp/croaring && \
cmake -S /tmp/croaring -B /tmp/croaring/build -DCMAKE_BUILD_TYPE=Release -DENABLE_POPCNT=ON -DENABLE_AVX=OFF -DENABLE_NEON=ON && \
cmake --build /tmp/croaring/build -j"$(nproc)" && \
cmake --install /tmp/croaring/build && \
rm -rf /tmp/croaring && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/croaring.conf && ldconfig; \
fi
Comment on lines +18 to +30

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.

🧹 Nitpick (assertive)

Make CRoaring path reproducible.

Pin CRoaring to a tag to stabilize headers/ABI; also ensure git is present before clone (it is), and prefer -DBUILD_SHARED_LIBS=ON/OFF explicitly for predictable linkage.

-      git clone --depth 1 https://github.com/RoaringBitmap/CRoaring.git /tmp/croaring && \
+      git clone --branch v2.3.1 --depth 1 https://github.com/RoaringBitmap/CRoaring.git /tmp/croaring && \
       cmake -S /tmp/croaring -B /tmp/croaring/build -DCMAKE_BUILD_TYPE=Release -DENABLE_POPCNT=ON -DENABLE_AVX=OFF -DENABLE_NEON=ON && \
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pip3 install --no-cache-dir meson ninja && \
# Install CRoaring from apt if available, otherwise build from source
apt-get update && (apt-get install -y --no-install-recommends libroaring-dev || true) && \
if ! pkg-config --exists roaring; then \
echo "Building CRoaring from source..." && \
rm -rf /tmp/croaring && \
git clone --depth 1 https://github.com/RoaringBitmap/CRoaring.git /tmp/croaring && \
cmake -S /tmp/croaring -B /tmp/croaring/build -DCMAKE_BUILD_TYPE=Release -DENABLE_POPCNT=ON -DENABLE_AVX=OFF -DENABLE_NEON=ON && \
cmake --build /tmp/croaring/build -j"$(nproc)" && \
cmake --install /tmp/croaring/build && \
rm -rf /tmp/croaring && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/croaring.conf && ldconfig; \
fi
pip3 install --no-cache-dir meson ninja && \
# Install CRoaring from apt if available, otherwise build from source
apt-get update && (apt-get install -y --no-install-recommends libroaring-dev || true) && \
if ! pkg-config --exists roaring; then \
echo "Building CRoaring from source..." && \
rm -rf /tmp/croaring && \
git clone --branch v2.3.1 --depth 1 https://github.com/RoaringBitmap/CRoaring.git /tmp/croaring && \
cmake -S /tmp/croaring -B /tmp/croaring/build -DCMAKE_BUILD_TYPE=Release -DENABLE_POPCNT=ON -DENABLE_AVX=OFF -DENABLE_NEON=ON && \
cmake --build /tmp/croaring/build -j"$(nproc)" && \
cmake --install /tmp/croaring/build && \
rm -rf /tmp/croaring && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/croaring.conf && ldconfig; \
fi

WORKDIR /workspace
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Reduce Docker build context size when building images from repo root
.git
build
build-*
build_*

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.

🧹 Nitpick (assertive)

Trim trailing space (MD009) and prefer directory suffixes

Minor polish to keep diffs clean and linters quiet.

-build_* 
+build_*
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
build_*
build_*
🤖 Prompt for AI Agents
In .dockerignore around line 5, the entry "build_* " has a trailing space and
uses a glob without a directory suffix; remove the trailing space and change it
to a directory-focused pattern like "build_*/" (or "build_*" without trailing
whitespace if you need files too) so the line is clean and linters won't flag
MD009 or suggest directory suffixes.

compile_commands.json
ci_logs.zip
*.o
*.a
*.so
*.dylib
*.obj
*.exe
*.log
*.tmp
__pycache__/
*.pyc
node_modules/
2 changes: 1 addition & 1 deletion .github/workflows/c_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y wget gnupg lsb-release python3-pip
wget -O - https://apt.llvm.org/llvm.sh | sudo bash -s -- 20
sudo apt-get install -y clang-20 clang-tidy-20 cppcheck libsodium-dev libgit2-dev
sudo apt-get install -y clang-20 clang-tidy-20 cppcheck libsodium-dev libgit2-dev libroaring-dev
sudo ln -sf /usr/bin/clang-tidy-20 /usr/local/bin/clang-tidy
sudo ln -sf /usr/bin/clang++-20 /usr/local/bin/clang++
sudo ln -sf /usr/bin/clang-20 /usr/local/bin/clang
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/core-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang clang-tidy libsodium-dev libgit2-dev build-essential python3-pip
sudo apt-get install -y clang clang-tidy libsodium-dev libgit2-dev libroaring-dev build-essential python3-pip
pip3 install --break-system-packages meson ninja

- name: Check for TODOs/FIXMEs
Expand Down
88 changes: 88 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Repository Guidelines

## Project Structure & Module Organization
- `core/` — C23 library: `include/` (public headers), `src/` (impl), `tests/` (unit). Add new code here.
- `include/` — Umbrella API (`gitmind.h`) and namespaced headers under `include/gitmind/`.
- `src/` — Legacy code under migration. Avoid adding new modules here.
- `apps/` — Future CLI/hooks/apps. Until announced, prefer `core/` additions.
- `tests/` — E2E/integration/legacy tests and fixtures.
- `tools/`, `quality/`, `.githooks/` — Dev tooling (clang-tidy, formatting, gauntlet, secret scanning).
- `docs/` — Architecture, dev setup, and operational notes.

Comment on lines +3 to +11

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.

🧹 Nitpick (assertive)

Fix markdown spacing (MD022/MD032).

Headings need blank lines before lists. Apply across sections.

-## Project Structure & Module Organization
-- `core/` — C23 library: `include/` (public headers), `src/` (impl), `tests/` (unit). Add new code here.
+## Project Structure & Module Organization
+
+- `core/` — C23 library: `include/` (public headers), `src/` (impl), `tests/` (unit). Add new code here.
@@
-## Build, Test, and Development Commands
-- Configure + build: `meson setup build && ninja -C build`
+## Build, Test, and Development Commands
+
+- Configure + build: `meson setup build && ninja -C build`
@@
-## Coding Style & Naming Conventions
-- Language: C23 with warnings-as-errors; no VLAs or shadowing; explicit prototypes.
+## Coding Style & Naming Conventions
+
+- Language: C23 with warnings-as-errors; no VLAs or shadowing; explicit prototypes.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Project Structure & Module Organization
- `core/` — C23 library: `include/` (public headers), `src/` (impl), `tests/` (unit). Add new code here.
- `include/` — Umbrella API (`gitmind.h`) and namespaced headers under `include/gitmind/`.
- `src/` — Legacy code under migration. Avoid adding new modules here.
- `apps/` — Future CLI/hooks/apps. Until announced, prefer `core/` additions.
- `tests/` — E2E/integration/legacy tests and fixtures.
- `tools/`, `quality/`, `.githooks/` — Dev tooling (clang-tidy, formatting, gauntlet, secret scanning).
- `docs/` — Architecture, dev setup, and operational notes.
## Project Structure & Module Organization
- `core/` — C23 library: `include/` (public headers), `src/` (impl), `tests/` (unit). Add new code here.
- `include/` — Umbrella API (`gitmind.h`) and namespaced headers under `include/gitmind/`.
- `src/` — Legacy code under migration. Avoid adding new modules here.
- `apps/` — Future CLI/hooks/apps. Until announced, prefer `core/` additions.
- `tests/` — E2E/integration/legacy tests and fixtures.
- `tools/`, `quality/`, `.githooks/` — Dev tooling (clang-tidy, formatting, gauntlet, secret scanning).
- `docs/` — Architecture, dev setup, and operational notes.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

8-8: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


9-9: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

🤖 Prompt for AI Agents
In AGENTS.md around lines 3 to 11, several headings are immediately followed by
Markdown lists which violates MD022/MD032; add a single blank line between each
heading and the subsequent list (and ensure one blank line after the list where
appropriate) throughout the file, removing any extra trailing spaces so headings
and lists have exactly one blank line separation for consistent MD formatting.

## Build, Test, and Development Commands
- Configure + build: `meson setup build && ninja -C build`
- Run unit tests: `ninja -C build test` (or `meson test -C build`)
- Make shims: `make`, `make test`, `make clean`
- Lint (CI parity): `./tools/docker-clang-tidy.sh` → produces `clang-tidy-report.txt`
- Strict multi-compiler build: `./tools/gauntlet/run-gauntlet.sh` (recommended before PRs)
- Enable hooks: `pre-commit install` (clang-format + detect-secrets)

## Coding Style & Naming Conventions
- Language: C23 with warnings-as-errors; no VLAs or shadowing; explicit prototypes.
- Formatting: `.clang-format` (LLVM-based, 4 spaces, 80 cols, pointer alignment right). Pre-commit runs `clang-format`.
- Naming: functions/vars `lower_snake_case` (prefix `gm_`), macros `UPPER_SNAKE`, types end in `_t`, header guards `GITMIND_*`.
- Includes: prefer specific headers; order/regroup per `.clang-format`.

## Testing Guidelines
- Unit tests live in `core/tests/unit/` as `test_<module>.c`. Keep deterministic and isolated.
- Meson wires test backends as needed—just build and run tests via Meson/Ninja.
- E2E/integration under `tests/` for CLI/flow checks. Keep fixtures minimal.

## Commit & Pull Request Guidelines
- Conventional commits: `type(scope): description` (e.g., `fix(core/cbor): handle null keys`). Reference issues (`Fixes #123`).
- PRs must describe changes, link issues, include a short test plan, pass CI, and introduce no new clang-tidy warnings (`./tools/docker-clang-tidy.sh`). Update docs when applicable.

Comment on lines +26 to +34

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.

🧹 Nitpick (assertive)

More markdown spacing fixes.

Continue adding blank lines before lists to satisfy MD022/MD032.

-## Testing Guidelines
-- Unit tests live in `core/tests/unit/` as `test_<module>.c`. Keep deterministic and isolated.
+## Testing Guidelines
+
+- Unit tests live in `core/tests/unit/` as `test_<module>.c`. Keep deterministic and isolated.
@@
-## Commit & Pull Request Guidelines
-- Conventional commits: `type(scope): description` (e.g., `fix(core/cbor): handle null keys`). Reference issues (`Fixes #123`).
+## Commit & Pull Request Guidelines
+
+- Conventional commits: `type(scope): description` (e.g., `fix(core/cbor): handle null keys`). Reference issues (`Fixes #123`).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Testing Guidelines
- Unit tests live in `core/tests/unit/` as `test_<module>.c`. Keep deterministic and isolated.
- Meson wires test backends as needed—just build and run tests via Meson/Ninja.
- E2E/integration under `tests/` for CLI/flow checks. Keep fixtures minimal.
## Commit & Pull Request Guidelines
- Conventional commits: `type(scope): description` (e.g., `fix(core/cbor): handle null keys`). Reference issues (`Fixes #123`).
- PRs must describe changes, link issues, include a short test plan, pass CI, and introduce no new clang-tidy warnings (`./tools/docker-clang-tidy.sh`). Update docs when applicable.
## Testing Guidelines
- Unit tests live in `core/tests/unit/` as `test_<module>.c`. Keep deterministic and isolated.
- Meson wires test backends as needed—just build and run tests via Meson/Ninja.
- E2E/integration under `tests/` for CLI/flow checks. Keep fixtures minimal.
## Commit & Pull Request Guidelines
- Conventional commits: `type(scope): description` (e.g., `fix(core/cbor): handle null keys`). Reference issues (`Fixes #123`).
- PRs must describe changes, link issues, include a short test plan, pass CI, and introduce no new clang-tidy warnings (`./tools/docker-clang-tidy.sh`). Update docs when applicable.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

29-29: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


30-30: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

🤖 Prompt for AI Agents
AGENTS.md around lines 26 to 34: the markdown lists lack a blank line before
them which triggers MD022/MD032; insert a single blank line immediately before
each list block (i.e., add an empty line before the "- Unit tests..." list and
before the "- Conventional commits..." list) so each list is separated from the
preceding paragraph/heading, then re-run your markdown linter to verify no
MD022/MD032 warnings remain.

## Security & Configuration
- Do not commit secrets. Pre-commit runs `detect-secrets` with `.secrets.baseline`.
- Use `.env.example` as a template; never check in real credentials.

## Agent-Specific Notes
- Make minimal, focused diffs; avoid drive-by refactors. Match existing patterns in `core/` and headers under `include/`.
- Run build, tests, and lint locally before proposing changes. Keep changes zero-warnings and formatted.

## Working Knowledge (for agents)
Comment on lines +35 to +43

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.

🧹 Nitpick (assertive)

⚠️ Potential issue

Finalize spacing and fix examples.

Add spacing and correct the Cypher property assignment in the example: started_at=datetime().

-## Security & Configuration
-- Do not commit secrets. Pre-commit runs `detect-secrets` with `.secrets.baseline`.
+## Security & Configuration
+
+- Do not commit secrets. Pre-commit runs `detect-secrets` with `.secrets.baseline`.
@@
-## Agent-Specific Notes
-- Make minimal, focused diffs; avoid drive-by refactors. Match existing patterns in `core/` and headers under `include/`.
+## Agent-Specific Notes
+
+- Make minimal, focused diffs; avoid drive-by refactors. Match existing patterns in `core/` and headers under `include/`.
@@
-  - Start task: `echo '{"statements":[{"statement":"MERGE (t:Task:GM {id:$id}) ON CREATE SET t.title=$title, t.status=\"in_progress\", t.started_at:datetime(), t.repo=\"git-mind\" ON MATCH SET t.status=\"in_progress\", t.repo=\"git-mind\"","parameters":{"id":"gm-docker-namespacing","title":"Docker image names + cleanup"}}]}' | bash scripts/neo4j-curl.sh`
+  - Start task: `echo '{"statements":[{"statement":"MERGE (t:Task:GM {id:$id}) ON CREATE SET t.title=$title, t.status=\"in_progress\", t.started_at=datetime(), t.repo=\"git-mind\" ON MATCH SET t.status=\"in_progress\", t.repo=\"git-mind\"","parameters":{"id":"gm-docker-namespacing","title":"Docker image names + cleanup"}}]}' | bash scripts/neo4j-curl.sh`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Security & Configuration
- Do not commit secrets. Pre-commit runs `detect-secrets` with `.secrets.baseline`.
- Use `.env.example` as a template; never check in real credentials.
## Agent-Specific Notes
- Make minimal, focused diffs; avoid drive-by refactors. Match existing patterns in `core/` and headers under `include/`.
- Run build, tests, and lint locally before proposing changes. Keep changes zero-warnings and formatted.
## Working Knowledge (for agents)
## Security & Configuration
- Do not commit secrets. Pre-commit runs `detect-secrets` with `.secrets.baseline`.
- Use `.env.example` as a template; never check in real credentials.
## Agent-Specific Notes
- Make minimal, focused diffs; avoid drive-by refactors. Match existing patterns in `core/` and headers under `include/`.
- Run build, tests, and lint locally before proposing changes. Keep changes zero-warnings and formatted.
## Working Knowledge (for agents)
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

39-39: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


40-40: Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

🤖 Prompt for AI Agents
In AGENTS.md around lines 35 to 43, adjust spacing (add the requested blank
lines) and correct the Cypher example property assignment by changing
started_at=datetime() to use the proper Cypher syntax started_at: datetime();
update the surrounding example text to reflect that change.

- Journal-first graph: Edges are CBOR commits under `refs/gitmind/edges/<branch>`; cache lives in `refs/gitmind/cache/<branch>` and is rebuildable (never merged).
- Semantics as names: Store `type_name` and `lane_name` as UTF-8 strings on edges; do not collapse into a generic/custom type. Derive 64-bit IDs from names (NFC + stable hash) only for cache/filters.
- Time-travel correctness: All semantics (and optional advice) are in-history; queries evaluate against the chosen commit and branch.
- Merge/conflict model: Append-only journal; edge ULIDs form an OR-Set; “Semantics Advice” (optional) merges with hybrid CRDT (LWW scalars, OR-Set collections).
- Link vs code authors: Edge attribution `author` is the link creator (from `git config` unless provided); code authorship at the chosen commit is recorded separately (per-file last commit author/time) when using Neo4j upsert tooling.
- Docker hygiene: Images are namespaced/labeled (`gitmind/ci:clang-20`, `gitmind/gauntlet:<compiler>`; label `com.gitmind.project=git-mind`). Use `make docker-clean` to reclaim space safely.
- CI/Tidy nuance: Local builds and tests pass. Clang-tidy in Docker depends on CRoaring headers in the CI image; add a source build step for deterministic results on aarch64 if CI flags it.


## Neo4j Codex Log (Memory Graph)
- Purpose: record tasks, touched files, and relationships to enable impact/risk queries for this repo.
- Project tagging: all nodes carry label `:GM` and `repo:'git-mind'`.
- Setup env:
- `export NEO4J_HTTP_URL=http://localhost:7474`
- `export NEO4J_USER=neo4j`
- `export NEO4J_PASSWORD=password123` (use real local creds; don’t commit)
- One‑time constraints (HTTP):
- Use `scripts/neo4j-constraints.json` which creates GM-scoped constraints (Task:GM.id unique, File:GM.path unique, repo existence).
- Helper script: `scripts/neo4j-curl.sh`
- Pipe JSON or use `-f payload.json`. Posts to `NEO4J_HTTP_URL/db/neo4j/tx/commit` with basic auth.
- Quick start examples:
- Start task: `echo '{"statements":[{"statement":"MERGE (t:Task:GM {id:$id}) ON CREATE SET t.title=$title, t.status=\"in_progress\", t.started_at:datetime(), t.repo=\"git-mind\" ON MATCH SET t.status=\"in_progress\", t.repo=\"git-mind\"","parameters":{"id":"gm-docker-namespacing","title":"Docker image names + cleanup"}}]}' | bash scripts/neo4j-curl.sh`
- Link touched file: `echo '{"statements":[{"statement":"MERGE (t:Task:GM {id:$id}) MERGE (f:File:GM {path:$p}) ON CREATE SET f.repo=\"git-mind\" ON MATCH SET f.repo=\"git-mind\" MERGE (t)-[:TOUCHES]->(f)","parameters":{"id":"gm-docker-namespacing","p":"tools/docker-clean.sh"}}]}' | bash scripts/neo4j-curl.sh`
- Record dependency: `echo '{"statements":[{"statement":"MERGE (a:File:GM {path:$a}) ON CREATE SET a.repo=\"git-mind\" ON MATCH SET a.repo=\"git-mind\" MERGE (b:File:GM {path:$b}) ON CREATE SET b.repo=\"git-mind\" ON MATCH SET b.repo=\"git-mind\" MERGE (a)-[:DEPENDS_ON]->(b)","parameters":{"a":"tools/docker-clang-tidy.sh","b":".ci/Dockerfile"}}]}' | bash scripts/neo4j-curl.sh`

### Ready-to-run payloads in this repo
- Initialize constraints (once): `bash scripts/neo4j-curl.sh -f scripts/neo4j-constraints.json`
- Log this task (files touched): `bash scripts/neo4j-curl.sh -f scripts/neo4j-task-gm-docker-neo4j-2025-09-12.json`
- Verify touched files for a task: `scripts/neo4j-show-task.sh gm-docker-namespacing-neo4j-2025-09-12`

## Neo4j Proto Edge Schema (git-mind semantics)
- Relationship: `(a:File:GM {repo:'git-mind'})-[:EDGE {ulid, type, lane, confidence, ts, commit, src_path, tgt_path, src_sha, tgt_sha, author, source_type, session_id, repo:'git-mind'}]->(b:File:GM {repo:'git-mind'})`
- Properties map 1:1 to libgitmind edge fields (ulid, attribution, lane, SHAs, etc.).
- Upsert example (script):
- `scripts/gm-neo4j-upsert-edge.sh --commit HEAD --src core/src/io/io.c --tgt core/include/gitmind/io/io.h --type IMPLEMENTS --lane verified --author user@local --source human --confidence 90`
- Export edges to JSON/NDJSON:
- `scripts/neo4j-export-edges.sh` (uses jq if available)

### Importer plan (proto → journal)
- Extract edges: `scripts/neo4j-export-edges.sh > edges.json`
- For each edge row:
- Resolve paths to blob OIDs at `edge.commit` (already present as `src_sha`/`tgt_sha`)
- Write journal entry under `refs/gitmind/edges/<lane>` with full properties (ulid, attribution, type)
- Rebuild cache: `gm_cache_rebuild()` (Meson test harness covers core APIs)
- Validate parity: compare fanout/fanin against Neo4j MATCH results on the same commit.
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ For workflows that apply to ALL contributors (human and AI):
- __NEVER__ alter, disable, or otherwise circumvent git hooks or tests
- __NEVER__ use `git add -A`, __ALWAYS__ stage changes intentionally

> [!DANGER] __NEVER__ use `NOLINT` to suppress clang tidy warnings. __ALWAYS__ fix them problem in your code. Suppressions lead to real bugs. Static analysis is part of the CI gate. Silencing it violates the repo’s “no warnings” contract and kills developer trust. No excuses, push clean builds. End of story.

Comment on lines +19 to +20

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.

⚠️ Potential issue

Fix grammar and hyphenation in warning block

Public-facing docs should be crisp. Also use “clang-tidy” consistently.

-> [!DANGER] __NEVER__ use `NOLINT` to suppress clang tidy warnings. __ALWAYS__ fix them problem in your code. Suppressions lead to real bugs. Static analysis is part of the CI gate. Silencing it violates the repo’s “no warnings” contract and kills developer trust. No excuses, push clean builds. End of story.
+> [!DANGER] __NEVER__ use `NOLINT` to suppress clang-tidy warnings. __ALWAYS__ fix the problem in your code. Suppressions lead to real bugs. Static analysis is part of the CI gate. Silencing it violates the repo’s “no warnings” contract and kills developer trust. No excuses—push clean builds. End of story.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
> [!DANGER] __NEVER__ use `NOLINT` to suppress clang tidy warnings. __ALWAYS__ fix them problem in your code. Suppressions lead to real bugs. Static analysis is part of the CI gate. Silencing it violates the repo’s “no warnings” contract and kills developer trust. No excuses, push clean builds. End of story.
> [!DANGER] __NEVER__ use `NOLINT` to suppress clang-tidy warnings. __ALWAYS__ fix the problem in your code. Suppressions lead to real bugs. Static analysis is part of the CI gate. Silencing it violates the repo’s “no warnings” contract and kills developer trust. No excusespush clean builds. End of story.
🤖 Prompt for AI Agents
In CLAUDE.md around lines 19–20, the warning block needs grammar and hyphenation
fixes and consistent use of “clang-tidy”: rewrite the sentence to be crisp and
professional (e.g., remove excessive emphasis like ALL CAPS, fix “clang tidy” →
“clang-tidy”, change “fix them problem” → “fix the problem in your code”),
ensure hyphenation is correct (e.g., “public-facing” if needed), and keep the
imperative clear and concise while preserving the original meaning that NOLINT
must not be used and static analysis is required by CI.

## ENCOURAGED ACTIONS

- __USE SEQUENTIAL THINKING__ if you’re planning, doing __RECON__, or find yourself thrashing on an issue
Expand Down
Loading
Loading