Commit graph

19 commits

Author SHA1 Message Date
tobjend
c059d0b7a4 feat: file-level package mapping; add 7 new tests
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- _file_to_package: infer package from file path (kotlin/java/python/src)
- _top_packages: most common packages per cluster
- Packages included in meta dict and JSON output
- New tests: test_file_to_package, test_top_packages, test_extract_imports,
  test_extract_imports_empty, test_extract_imports_no_imports,
  test_extract_arg_info_python, test_summarize_arg_info
2026-07-03 21:59:26 +02:00
tobjend
b6c18c39f2 feat: per-call argument pattern extraction
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- _classify_arg_node: classify AST args as var/lit/call/lambda/kwarg/expr/other
- _find_arglist_node: language-agnostic arglist detection (named field →
  argument_list/call_suffix/template_string fallback)
- _iterate_arg_nodes: extract arg expressions from call_suffix (Kotlin lambdas),
  value_arguments (Kotlin parens), and standard argument lists
- extract_arg_info: per-file arg structure for all behavioral captures
- _summarize_arg_info: merge across files into min/max/common arg counts
- _build_arg_patterns: cluster-scoped aggregation
- Output shows top-4 calls per cluster with arg count + type patterns
- e.g. assertEquals: n=2 [lit,var], every: n=1 [lambda], verify: n=0-1 [lambda|var]
2026-07-03 21:57:15 +02:00
tobjend
2d4fc8eed5 feat: per-cluster import extraction + JSON output
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- _extract_imports scans source files for language-agnostic import patterns
- analyze_clusters tracks file paths through frequency_filter via identity
- Each cluster output includes its unique imports and file paths
- --json flag outputs structured JSON for LLM prompt injection
- Flat mode (--cluster false) also extracts imports
2026-07-03 21:52:02 +02:00
tobjend
73b94af959 feat: cluster methods by n-gram patterns before inference
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- _extract_call_tokens filters to call-like captures only
- cluster_methods groups sequences by shared 3-gram call patterns
- analyze_clusters runs per-cluster CRX/iDRegEx/kORE inference
- Lists 17 convention clusters for RAGSAK test code
- iDRegEx and kOREInference now produce ordered grammars per cluster
- (other) cluster captures diverse conventions as CRX vocabulary
- min-cluster-size (default 3) and ngram-size (default 3) CLI flags
2026-07-03 21:41:46 +02:00
tobjend
2620b6e49f feat: method-level sequence extraction via child_by_field_name('body')
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- _find_method_bodies uses tree-sitter's universal body field (9/10 grammars)
- Kotlin fallback: scan children for body-like types
- preprocess_by_method groups highlight captures by enclosing method body
- Returns per-method sequences for k-ORE ordering analysis
- analyze.py infer() now uses preprocess_by_method
- Document findings in ANALYSIS.md
- 97 tests pass
2026-07-03 21:34:25 +02:00
tobjend
0c7703f63b feat: universal tag-preprocessor orchestrator with frequency filter
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- Rename bex/tag-preprocessor/ to bex/tag_preprocessor/ (valid Python package)
- Add analyze.py: scan_directory, frequency_filter, infer, analyze_directory
- Frequency filter removes symbols below min_coverage threshold (Phase 1.0 step 4)
- infer() wires preprocess → frequency_filter → ensemble (Phase 1.0 step 5)
- --dir CLI mode for running full pipeline on directories (Phase 1.0 step 6)
- 9 new tests (test_analyze.py), all 94 tests pass
2026-07-03 20:58:18 +02:00
tobjend
ee5ebc9eb4 feat: universal AST preprocessor with nvim-treesitter queries
- Replace old per-language query files with unified tag-preprocessor
- Universal preprocessor uses nvim-treesitter highlights.scm for 10 langs
- Resolves ; inherits: directives (ecma, jsx) for JS/TS
- ts-kotlin bundled query for Kotlin compatibility
- Strips unsupported #set! 3-arg predicates for jsx
- archive old community queries
2026-07-03 20:48:47 +02:00
tobjend
8d06ac2d52 chore: add downloaded community queries for kotlin + typescript
Kotlin (fwcd/tree-sitter-kotlin) and TypeScript packages
don't bundle queries. These are downloaded from upstream repos.
2026-07-03 18:05:19 +02:00
tobjend
036a84cc76 docs: add min_coverage to MCP tool + README, include core in output
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
2026-07-01 15:16:24 +02:00
tobjend
9045769d57 feat: core+outlier analysis via min_coverage parameter, 6 new tests
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
2026-07-01 15:09:10 +02:00
tobjend
edd6d9d4dd feat: implement kOREInference (Algorithm 4) with MDL scoring, add to ensemble, 79 tests
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
2026-07-01 14:50:09 +02:00
tobjend
dc559a4aee fix badge position; purge remaining German user-reference comments
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2026-07-01 13:28:55 +02:00
tobjend
6b60e0131f clean up agent-betraying comments; fix stale test names
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2026-07-01 13:26:03 +02:00
tobjend
b8cc40177c remove redundant infer_grammar tool; update docs to single-tool MCP 2026-07-01 13:15:19 +02:00
tobjend
6bf7a681ce purge make_charts.py, examples/, full-text papers, blog_post (moved to ~/Desktop/kesai/); translate German CLI to English 2026-07-01 11:28:42 +02:00
tobjend
d7477344a6 move format-specific adapters to examples/, purge format-specific MCP tools 2026-07-01 10:36:14 +02:00
tobjend
0e2aec582b Grammar inference engine: CRX + iDRegEx ensemble with MDL scoring, MCP server, showcase, and blog post
- Ensemble inference (infer_ensemble) runs both CRX and iDRegEx, picks best by MDL
- CRX: CRX algorithm for wide coverage (accepts all sequences, large vocabulary)
- iDRegEx: iDRegEx for minimal core grammar (tightest common pattern)
- MDL scoring: fixed model_cost to count alphabet symbol occurrences, fixed dispatch order in _count_words_fast
- Fixed _match_tokens: rewritten as _match_possible with proper backtracking
- Fixed _parse_parts disjunction: children use _parse_flat_symbol to avoid dot-splitting
- MCP server: infer_best_grammar and infer_grammar tools
- Added prefer parameter (crx/idregex) to skip ensemble
- 28 passing tests
- SHOWCASE.md with Geerlingguy Galaxy demonstration
- blog_post.md with full technical deep-dive
2026-07-01 09:51:41 +02:00
tobjend
adc52c99ec Add MCP server: grammar inference via FastMCP
- bex/mcp_server.py: FastMCP server with 3 tools:
  * infer_grammar(sequences, method='crx'|'idregex')
  * infer_yaml_grammar(yaml_dir, pattern, method)
  * infer_ansible_role_grammar(roles_dir)
- pyproject.toml: add bex-mcp console_scripts entry point
2026-07-01 08:03:10 +02:00
tobjend
7c00c6713d Initial commit: BEX-based grammar inference engine
- CRX: direct CHARE inference (Algorithm 7, TODS 2010)
- iDRegEx: k-ORE inference (Algorithm 4, arXiv 2010)
- RWR₀: SORE repair (Algorithm 6, TODS 2010)
- rwr²: k-ORE extraction (Algorithm 3, arXiv 2010)
- SOA, k-OA, iKoa, 2T-INF, Baum-Welch
- Ansible role grammar adapter
- Generic YAML key-path converter
- 28 tests, all passing
2026-07-01 08:01:16 +02:00