Skip to content

feat: cora affected + index --watch + call graph wiring (#267, #269)#283

Merged
ajianaz merged 1 commit into
developfrom
feat/v0.7-affected-watcher
Jun 14, 2026
Merged

feat: cora affected + index --watch + call graph wiring (#267, #269)#283
ajianaz merged 1 commit into
developfrom
feat/v0.7-affected-watcher

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Three features in one PR

Call graph edge extraction (wiring)

Made cora callers and cora impact actually work by extracting call edges during indexing.

  • extract_calls() in index/extract.rs: scope tracking + call site extraction
  • Reuses engine/context/extraction.rs for symbol reference detection
  • detect_function_entry() for Rust/Go/C/Java/Python
  • is_builtin() filter (skips 40+ stdlib names)
  • Edges stored in call_graph table during index_file()

Runtime verified:

cora callers execute_commit → 1 caller (main)
cora impact open_index --depth 2 → 5 affected sites at depth 1

#267cora affected

Find test files affected by source code changes.

cora affected src/main.rs src/index/mod.rs
git diff --name-only | cora affected --stdin
cora affected --json

Two strategies:

  1. Call graph: changed symbols → find callers in test files
  2. Naming convention: foo.rsfoo_test.rs, tests/foo.rs, foo.test.ts

Runtime verified:

echo "src/main.rs" | cora affected --stdin
→ tests/cli_basic.rs, tests/config_loading.rs

#269cora index --watch

Auto-sync file watcher (poll-based, no extra deps).

cora index --watch
# 🔍 Initial index... 1349 symbols
# ✅ Watching for changes... (Ctrl+C to stop)
# 🔄 Updated 2 files, 15 symbols

Tests

  • 552 total, clippy clean, fmt clean
  • No new deps (reuses existing crates)

#269)

#267 — cora affected:
- Find test files affected by source changes
- Strategy 1: reverse call graph traversal (changed symbols → callers in test files)
- Strategy 2: naming convention (foo.rs → foo_test.rs, tests/foo.rs)
- CLI: cora affected [files...] [--stdin] [--filter glob] [--json]
- git diff --name-only | cora affected --stdin for CI pipeline
- Runtime verified: src/main.rs → tests/cli_basic.rs + tests/config_loading.rs

#269 — cora index --watch:
- Poll-based auto-sync (2s interval, no extra deps)
- Initial full index, then incremental re-index on file changes
- Ctrl+C to stop
- Real-time output of updated files

Call graph edge extraction (wired to index pipeline):
- extract_calls() in index/extract.rs: scope tracking + call site extraction
- Reuses engine/context/extraction.rs symbol extraction
- detect_function_entry() for Rust/Go/C/Java/Python scope tracking
- is_builtin() filter to skip stdlib calls
- Edges stored in call_graph table during index_file()
- Runtime verified:
  cora callers execute_commit → 1 caller (main)
  cora impact open_index --depth 2 → 5 affected sites

552 tests pass, clippy clean.
@ajianaz
ajianaz merged commit d239b68 into develop Jun 14, 2026
10 checks passed
@ajianaz
ajianaz deleted the feat/v0.7-affected-watcher branch June 14, 2026 07:22
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.

1 participant