Skip to content

Commit 2b80b31

Browse files
committed
Merge remote-tracking branch 'origin/main' into HEAD
2 parents 1b89228 + 93486bc commit 2b80b31

163 files changed

Lines changed: 11761 additions & 648 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/_lint.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ jobs:
6868
- name: Install build deps
6969
run: sudo apt-get update && sudo apt-get install -y zlib1g-dev
7070

71-
- name: Install LLVM 22 (pinned analyzer toolchain)
71+
- name: Install LLVM 21 (pinned analyzer toolchain)
7272
run: |
7373
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
74-
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-22 main" | sudo tee /etc/apt/sources.list.d/llvm-22.list
74+
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm-21.list
7575
sudo apt-get update
76-
sudo apt-get install -y clang-tidy-22
76+
sudo apt-get install -y clang-tidy-21
7777
7878
- name: Memory-analyzer gate
79-
run: scripts/ci/lint-mem.sh clang-tidy-22
79+
run: scripts/ci/lint-mem.sh clang-tidy-21

‎.github/workflows/_security.yml‎

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ jobs:
4141
codeql-gate:
4242
runs-on: ubuntu-latest
4343
timeout-minutes: 240
44+
# Without security-events:read this job inherits the workflow's
45+
# contents:read, the code-scanning alert API answers 403, and the gate
46+
# below reported "0 alerts" on every run it has ever made. actions:read is
47+
# what the CodeQL-run poll above needs for the same reason.
48+
permissions:
49+
contents: read
50+
security-events: read
51+
actions: read
4452
steps:
4553
- name: Wait for CodeQL on current commit (max 150 min)
4654
env:
@@ -77,11 +85,43 @@ jobs:
7785
env:
7886
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7987
run: |
88+
# FAIL CLOSED. The previous form was `gh api ... 2>/dev/null || echo "0"`,
89+
# which looks defensive and is the opposite. gh writes the API error
90+
# BODY to stdout, so a 403 made ALERTS the string
91+
# {"message":"Resource not accessible by integration",...,"status":"403"}0
92+
# every `[` comparison then failed as non-integer, the `if` took its
93+
# false branch, and the step printed "CodeQL gate passed (0 alerts)"
94+
# and exited 0. That is exactly how a security gate should NEVER fail:
95+
# silently, in the direction of "everything is fine". An unreadable
96+
# alert list is now an error, not a zero.
97+
# NOTE: this runs in a command substitution, so it must `return`, not
98+
# `exit` -- an `exit` here would only end the subshell and let the
99+
# caller continue with an empty count, recreating the very bug this
100+
# replaces. The callers below check the status explicitly.
101+
count_open_alerts() {
102+
local body status
103+
body=$(gh api 'repos/${{ github.repository }}/code-scanning/alerts?state=open' \
104+
--jq 'length' 2>/dev/null)
105+
status=$?
106+
if [ $status -ne 0 ]; then
107+
echo "BLOCKED: cannot read code scanning alerts (gh exit $status)." >&2
108+
echo " Refusing to treat an unreadable alert list as zero." >&2
109+
echo " Most likely cause: the job lacks security-events:read." >&2
110+
return 1
111+
fi
112+
case "$body" in
113+
''|*[!0-9]*)
114+
echo "BLOCKED: alert count was not a number: ${body:-<empty>}" >&2
115+
return 1
116+
;;
117+
esac
118+
printf '%s' "$body"
119+
}
80120
echo "Waiting 60s for alert API to settle..."
81121
sleep 60
82-
ALERTS=$(gh api 'repos/${{ github.repository }}/code-scanning/alerts?state=open' --jq 'length' 2>/dev/null || echo "0")
122+
ALERTS=$(count_open_alerts) || exit 1
83123
sleep 15
84-
ALERTS2=$(gh api 'repos/${{ github.repository }}/code-scanning/alerts?state=open' --jq 'length' 2>/dev/null || echo "0")
124+
ALERTS2=$(count_open_alerts) || exit 1
85125
[ "$ALERTS" -lt "$ALERTS2" ] && ALERTS=$ALERTS2
86126
if [ "$ALERTS" -gt 0 ]; then
87127
echo "BLOCKED: $ALERTS open alert(s)"

‎.github/workflows/_test.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,12 @@ jobs:
227227
- name: Install deps
228228
run: sudo apt-get update && sudo apt-get install -y zlib1g-dev ccache
229229

230-
- name: Install LLVM 22 (pinned diagnostic toolchain)
230+
- name: Install LLVM 21 (pinned diagnostic toolchain)
231231
run: |
232232
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
233-
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-22 main" | sudo tee /etc/apt/sources.list.d/llvm-22.list
233+
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm-21.list
234234
sudo apt-get update
235-
sudo apt-get install -y clang-22
235+
sudo apt-get install -y clang-21
236236
237237
- name: Compiler cache (content-verified, restore)
238238
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
@@ -247,11 +247,11 @@ jobs:
247247
# lane: stack-use-after-return, stack-use-after-scope, and strict string
248248
# checks. Mirrors `make -f Makefile.cbm diag`, including its reasoning
249249
# for leaving detect_invalid_pointer_pairs out.
250-
- name: Test (clang-22, ASan+UBSan + off-by-default ASan checks)
250+
- name: Test (clang-21, ASan+UBSan + off-by-default ASan checks)
251251
env:
252252
ASAN_OPTIONS: "detect_stack_use_after_return=1:strict_string_checks=1:detect_stack_use_after_scope=1"
253253
run: |
254-
scripts/test.sh CC=clang-22 CXX=clang++-22 \
254+
scripts/test.sh CC=clang-21 CXX=clang++-21 \
255255
SANITIZE="-fsanitize=address,undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls"
256256
257257
- name: Compiler cache (save)

‎.github/workflows/pr.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ concurrency:
2222
jobs:
2323
security:
2424
uses: ./.github/workflows/_security.yml
25+
# The called job requests security-events:read to count code-scanning
26+
# alerts; a reusable workflow cannot request more than its caller grants,
27+
# so withholding this here fails the whole run at startup.
28+
permissions:
29+
contents: read
30+
security-events: read
31+
actions: read
2532
secrets: inherit
2633

2734
lint:

‎.github/workflows/release.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ jobs:
4444
# ── Security (starts immediately, blocks only verify) ───────────
4545
security:
4646
uses: ./.github/workflows/_security.yml
47+
# The called job requests security-events:read to count code-scanning
48+
# alerts; a reusable workflow cannot request more than its caller grants,
49+
# so withholding this here fails the whole run at startup.
50+
permissions:
51+
contents: read
52+
security-events: read
53+
actions: read
4754
secrets: inherit
4855

4956
# ── 0. Preflight: refuse malformed dispatch inputs ──────────────

‎Makefile.cbm‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ SANITIZE = -fsanitize=address,undefined -fno-omit-frame-pointer
8484
EDITOR_TEST_DEFINES = -DCBM_JSON_LIKE_ENABLE_TEST_API=1 \
8585
-DCBM_TOML_EDIT_ENABLE_TEST_API=1 -DCBM_YAML_ENABLE_TEST_API=1 \
8686
-DCBM_TEXT_EDIT_ENABLE_TEST_API=1 -DCBM_CLI_ENABLE_TEST_API=1 \
87+
-DCBM_CONFIG_EDIT_PATH_ENABLE_TEST_API=1 \
8788
-DCBM_DIAGNOSTICS_ENABLE_TEST_API=1 -DCBM_ENABLE_TEST_SEAMS=1
8889
# The build system is the single source of truth for "is this binary
8990
# instrumented": compiler-specific probes (__SANITIZE_ADDRESS__) miss
@@ -409,7 +410,7 @@ GIT_SRCS = src/git/git_context.c
409410
CLI_SRCS = src/cli/cli.c src/cli/progress_sink.c src/cli/hook_augment.c src/cli/client_adapter.c \
410411
src/cli/agent_clients.c src/cli/agent_profiles.c \
411412
src/cli/config_json_like.c src/cli/config_toml_edit.c src/cli/config_yaml_edit.c \
412-
src/cli/config_text_edit.c src/cli/activation_transaction.c
413+
src/cli/config_text_edit.c src/cli/config_edit_path.c src/cli/activation_transaction.c
413414

414415
# UI module (graph visualization)
415416
UI_SRCS = \
@@ -707,6 +708,7 @@ TEST_REPRO_SRCS = \
707708
tests/repro/repro_issue787.c \
708709
tests/repro/repro_issue842.c \
709710
tests/repro/repro_issue964.c \
711+
tests/repro/repro_issue1692.c \
710712
tests/repro/repro_invariant_calls.c \
711713
tests/repro/repro_invariant_graph.c \
712714
tests/repro/repro_invariant_breadth.c \

‎README.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ overwrite user-modified agents.
491491
| Agent | Activation | MCP config | Durable context / augmentation |
492492
|-------|------------|------------|--------------------------------|
493493
| Claude Code | Detected | `~/.claude.json` | Skill + three exact-tool graph agents; `SessionStart`, `SubagentStart`, non-blocking `PreToolUse` for `Grep`/`Glob`/`Bash`, and post-`Read` coverage |
494-
| Codex CLI | Detected | `$CODEX_HOME/config.toml` | `AGENTS.md`, skill, three read-only agents; `SessionStart` + `SubagentStart` |
494+
| Codex CLI | Detected | `$CODEX_HOME/config.toml` | Managed `AGENTS.md` activation pointer, skill, three read-only agents; `SessionStart` + `SubagentStart` |
495495
| Gemini CLI | Detected | `.gemini/settings.json` | `GEMINI.md`, three explicit read/graph-tool subagents; `BeforeTool`, `AfterTool` `read_file` coverage, and `SessionStart` |
496496
| Zed | Detected | platform `settings.json` (JSONC) | `AGENTS.md` + shared skill |
497497
| OpenCode | Detected | `$OPENCODE_CONFIG` or resolved global config | `AGENTS.md`, skill, three deny-by-default read-only agents; plugin adds grep/glob graph lookup, post-`read` coverage, first-tool-result session context, and post-compaction reinjection |
@@ -536,6 +536,11 @@ overwrite user-modified agents.
536536
| Oh My Pi (omp) | Detected | Effective agent directory (`OMP_PROFILE` / `PI_CODING_AGENT_DIR`; default `~/.omp/agent/mcp.json`) | Skill and three direct-MCP graph-tool subagents (Scout/Verify/Auditor); preserves user `AGENTS.md` |
537537
| Sourcegraph Cody | Explicit opt-in | Existing `$CBM_CODY_CONFIG_PATH` | MCP only |
538538

539+
For Codex, install keeps only a tiny managed activation pointer in global
540+
`$CODEX_HOME/AGENTS.md`; all detailed behavior lives in the installed `codebase-memory` skill.
541+
Fresh installs create the pointer, upgrades replace the legacy full managed block while preserving
542+
all user-owned bytes, and uninstall removes only the managed pointer.
543+
539544
### Sessions, compaction, and subagents
540545

541546
Hooks installed by this project are fail-open and context-only. Claude Code's

‎graph-ui/package-lock.json‎

Lines changed: 48 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎graph-ui/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"tailwindcss": "^4.1.0",
3838
"typescript": "^5.7.0",
3939
"vite": "^6.4.3",
40-
"vitest": "^4.1.0"
40+
"vitest": "^4.1.11"
4141
},
4242
"overrides": {
4343
"form-data": ">=4.0.6",

0 commit comments

Comments
 (0)