Skip to content

refactor(config): unify [[flow_rules]] into [[effect_rules]] - #52

Merged
hungpham10 merged 2 commits into
mainfrom
fix/add-missing-effect-for-mapping-some-macros-to-specific-markers
Oct 26, 2026
Merged

hungpham10 merged 2 commits into
mainfrom
fix/add-missing-effect-for-mapping-some-macros-to-specific-markers

Conversation

@hungpham10

Copy link
Copy Markdown
Owner

Merge the control-flow marker config surface into the existing [[effect_rules]] table so there is one config surface and one MCP tool (codegraph_config_effects). FlowRule is deleted; EffectRule now carries effect, marker, label, and keep_call (≥1 of effect/marker required).

  • codegraph-core: EffectRule { effect: Option, marker, label, keep_call }; FlowMarker whitelist (try_start, try_end, catch_start, throw, if_true, if_false, branch_end, loop, loop_back, break, continue, return); keep_call defaults: throw=true, others=false.
  • codegraph-extract: config CRUD/build_classifiers validate ≥1 dimension, label only for throw|catch_start|if_true, keep_call only with marker; legacy [[flow_rules]] ignored + warn; FlowClassifier::with_config(Vec); try/catch lifecycle uses Vec{Body,Handler} stack (fixes nested PG_TRY); branch_end does not touch try state.
  • codegraph-mcp/graphql: dispatch_config_flow route removed; tool count 42; response_tests assert updated.
  • AGENTS.md: progressive disclosure root + docs/agent/{mcp-workflow, conventions, testing, extraction, git-release}; .agents/AGENTS.md deleted; mandatory verify+PR process (8 steps) added.
  • Tests: merge flows_config.rs (5 tests) into effects_config.rs ported to EffectRule/FlowClassifier::with_config; delete flows_config.rs; add CRUD, validation, legacy-ignore, effect-none shadow, 4 flow-marker, and branch_end-does-not-touch-try tests.

Clippy clean (-D warnings), fmt clean, cargo test --workspace green (except 4 pre-existing storage::redis Connection-refused tests requiring a running redis-server).

Co-authored-by: CodeGraph agent

Merge the control-flow marker config surface into the existing
[[effect_rules]] table so there is one config surface and one MCP tool
(codegraph_config_effects). FlowRule is deleted; EffectRule now carries
effect, marker, label, and keep_call (≥1 of effect/marker required).

- codegraph-core: EffectRule { effect: Option, marker, label, keep_call };
  FlowMarker whitelist (try_start, try_end, catch_start, throw, if_true,
  if_false, branch_end, loop, loop_back, break, continue, return);
  keep_call defaults: throw=true, others=false.
- codegraph-extract: config CRUD/build_classifiers validate ≥1 dimension,
  label only for throw|catch_start|if_true, keep_call only with marker;
  legacy [[flow_rules]] ignored + warn; FlowClassifier::with_config(Vec<EffectRule>);
  try/catch lifecycle uses Vec<TryPhase>{Body,Handler} stack (fixes nested
  PG_TRY); branch_end does not touch try state.
- codegraph-mcp/graphql: dispatch_config_flow route removed; tool count 42;
  response_tests assert updated.
- AGENTS.md: progressive disclosure root + docs/agent/{mcp-workflow,
  conventions, testing, extraction, git-release}; .agents/AGENTS.md deleted;
  mandatory verify+PR process (8 steps) added.
- Tests: merge flows_config.rs (5 tests) into effects_config.rs ported to
  EffectRule/FlowClassifier::with_config; delete flows_config.rs; add CRUD,
  validation, legacy-ignore, effect-none shadow, 4 flow-marker, and
  branch_end-does-not-touch-try tests.

Clippy clean (-D warnings), fmt clean, cargo test --workspace green
(except 4 pre-existing storage::redis Connection-refused tests requiring a
running redis-server).

Co-authored-by: CodeGraph agent
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6e1d8dd8-351a-44d4-81d6-b82e0d1a77f8
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

MySQL rejects TEXT columns in PRIMARY KEY without a key length
(error 1170: BLOB/TEXT column 'path' used in key specification
without a key length). GraphIndex::open_route auto-creates
sg_file_deps and sg_fn_ptr_assigns at runtime with path TEXT, which
broke open_route on MySQL.

Switch both tables to path VARCHAR(700) NOT NULL, matching the
sql/mysql/001-initial-schema.sql migration (700 fits under InnoDB's
3072-byte index limit for utf8mb4). Postgres accepts TEXT in PK, so
its runtime DDL is unchanged.

Signed-off-by: CodeGraph agent
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.92471% with 86 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.04%. Comparing base (2098651) to head (ab15888).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
crates/codegraph-mcp/src/tools.rs 12.82% 34 Missing ⚠️
crates/codegraph-extract/src/languages/common.rs 80.48% 16 Missing ⚠️
crates/codegraph-core/src/semgraph.rs 57.14% 15 Missing ⚠️
crates/codegraph-graphql/src/mutation.rs 0.00% 15 Missing ⚠️
crates/codegraph-extract/src/config.rs 98.56% 4 Missing ⚠️
crates/codegraph-extract/src/languages/flows.rs 98.36% 2 Missing ⚠️

❌ Your patch status has failed because the patch coverage (85.92%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
+ Coverage   78.22%   80.04%   +1.81%     
==========================================
  Files          96       97       +1     
  Lines       23490    28765    +5275     
==========================================
+ Hits        18376    23026    +4650     
- Misses       5114     5739     +625     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed

codspeed Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 22 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 38 untouched benchmarks


Comparing fix/add-missing-effect-for-mapping-some-macros-to-specific-markers (ab15888) with main (598f47f)

Open in CodSpeed

@hungpham10
hungpham10 merged commit f57ccf9 into main Oct 26, 2026
22 checks passed
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.

2 participants