Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9,888 changes: 0 additions & 9,888 deletions .github/TASK_PLAN.md

This file was deleted.

6 changes: 5 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- **Artifacts:** Session data lives in `{repo}/.rgctl/`. Warm caches invalidate wall-time claims.
- **Features:** Default semantic embedder is compiled **vocab**. Do not require ONNX / Python ML unless behind an explicit feature (e.g. `semantic-onnx` / code-daemon + Git LFS).
- **OpenSpec language work:** Still cite [openspec/changes/_shared/starting-context.md](openspec/changes/_shared/starting-context.md) (pointer here); follow the sections below.
- **Grammar bumps:** When you bump a tree-sitter grammar pin, update that language’s `*-ast-coverage.json` (and add the language to `rgctl-ast-coverage::bundled_specs` for new languages). Unit tests hard-fail the same drift; `cargo check -p rgctl-languages` warns (`RGCTL_AST_COVERAGE_STRICT=1` fails). The website `/docs/languages/` pages are generated from those JSON files — do not maintain parallel tables under `docs/languages/`.

---

Expand All @@ -28,7 +29,7 @@
- **Discover** walks the tree, runs language plugins (tree-sitter), builds the graph, writes compact caches to `.rgctl/`.
- **Query** paths are read-oriented and return versioned JSON (`schema_version` on stdout — never scrape stderr).
- **Analysis** (`rgctl-analysis`) projects CSR / callgraph / centrality / blast-radius / CFG–PDG; see [docs/analysis-architecture.md](docs/analysis-architecture.md).
- **Languages:** `crates/rgctl-lang-*` + `rgctl-plugin-api`; register in `languages.toml`.
- **Languages:** `crates/rgctl-lang-*` + `rgctl-plugin-api`; register in `languages.toml`. See **Grammar bumps** under Must-follow for AST coverage manifests.

---

Expand Down Expand Up @@ -80,8 +81,11 @@ Fetch: `./scripts/fetch-profile-repos.sh`
| **PHP** | Magento 2 | `example/magento2` | `-l php` | `RGCTL_MAGENTO2_REPO` |
| **Python** | Home Assistant | `example/home-assistant` | `-l python` | `RGCTL_HOME_ASSISTANT_REPO` |
| **Ruby** | Discourse | `example/discourse` | `-l ruby` | — |
| **Puppet** | *(deferred)* | `RGCTL_PUPPET_REPO` | `-l puppet` | `RGCTL_PUPPET_REPO` — no default ~10k corpus yet |
| **Rust** | rustc | `example/rust` | `-l rust` | `RGCTL_RUST_REPO` |
| **TypeScript** | VS Code | `example/vscode` | `-l typescript` on `src/` | `RGCTL_VSCODE_REPO` |
| **Kotlin** | JetBrains/kotlin | `example/kotlin` | `-l kotlin` (sparse `libraries` `plugins` `analysis`) | `RGCTL_KOTLIN_REPO` |
| **Groovy** | Gradle | `example/groovy` | `-l groovy` | `RGCTL_GROOVY_REPO` |

File counts are approximate (goal **O(10⁴)** sources). Exclude `vendor/`, `node_modules/`, `target/`, `third_party/`.

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Use the hub checklist for path choice, test matrices, and pre-PR commands:

**[docs/contributor-checklist.md](docs/contributor-checklist.md)**

Tier 1 depth (Layers A–F): [docs/tier-1-language-support.md](docs/tier-1-language-support.md) · language list: [docs/languages/README.md](docs/languages/README.md)
Tier 1 depth (Layers A–F): [docs/tier-1-language-support.md](docs/tier-1-language-support.md) · language matrix SSOT: `crates/rgctl-lang-*/{id}-ast-coverage.json` ([docs/languages/README.md](docs/languages/README.md))

---

Expand Down
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ members = [
"crates/rgctl-lang-markdown",
"crates/rgctl-lang-php",
"crates/rgctl-lang-ruby",
"crates/rgctl-lang-puppet",
"crates/rgctl-lang-kotlin",
"crates/rgctl-lang-groovy",
"crates/rgctl-ast-coverage",
"crates/rgctl-languages",
"crates/rgctl-agent-pack-codegen",
]
Expand Down Expand Up @@ -83,6 +87,10 @@ rgctl-lang-cpp = { path = "crates/rgctl-lang-cpp", version = "0.4.16" }
rgctl-lang-markdown = { path = "crates/rgctl-lang-markdown", version = "0.4.16" }
rgctl-lang-php = { path = "crates/rgctl-lang-php", version = "0.4.16" }
rgctl-lang-ruby = { path = "crates/rgctl-lang-ruby", version = "0.4.16" }
rgctl-lang-puppet = { path = "crates/rgctl-lang-puppet", version = "0.4.16" }
rgctl-lang-kotlin = { path = "crates/rgctl-lang-kotlin", version = "0.4.16" }
rgctl-lang-groovy = { path = "crates/rgctl-lang-groovy", version = "0.4.16" }
rgctl-ast-coverage = { path = "crates/rgctl-ast-coverage", version = "0.4.16" }
rgctl-languages = { path = "crates/rgctl-languages", version = "0.4.16" }
tree-sitter = "0.25"

Expand Down
232 changes: 103 additions & 129 deletions README.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions crates/rgctl-analysis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ tree-sitter-javascript = "0.25"
tree-sitter-typescript = "0.23"
tree-sitter-php = "0.24.2"
tree-sitter-ruby = "0.23.1"
tree-sitter-puppet = "1.3.0"
tree-sitter-kotlin-ng = "1.1.0"
tree-sitter-groovy = "0.1.2"
uuid = { version = "1", features = ["v4", "serde"] }
bit-set = "0.8"
tracing = "0.1"
Expand Down
28 changes: 26 additions & 2 deletions crates/rgctl-analysis/src/ast_skeleton.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ fn find_function<'a>(
"javascript" | "js" | "typescript" | "ts" => {
ecmascript_function_symbol_name(node, source)
}
"puppet" => puppet_callable_name(node, source),
_ => extract_name_from_node(node, source).ok().flatten(),
};
if resolved.as_deref() == Some(name) {
Expand All @@ -193,6 +194,26 @@ fn find_function<'a>(
None
}

/// Match CFG / Function symbol naming for Puppet class/define/node/function hosts.
fn puppet_callable_name(node: Node<'_>, source: &[u8]) -> Option<String> {
let mut cursor = node.walk();
for child in node.children(&mut cursor) {
if matches!(
child.kind(),
"class_identifier" | "identifier" | "node_name" | "string"
) {
if let Ok(t) = child.utf8_text(source) {
let name = t.trim_matches('\'').trim_matches('"');
if node.kind() == "node_definition" {
return Some(format!("node:{name}"));
}
return Some(name.to_string());
}
}
}
extract_name_from_node(node, source).ok().flatten()
}

fn walk_skeleton(
node: Node,
source: &[u8],
Expand Down Expand Up @@ -236,9 +257,11 @@ fn walk_skeleton(
fn classify(kind: &str) -> Option<AstSkeletonKind> {
Some(match kind {
"block" | "compound_statement" | "statement_block" | "body" => AstSkeletonKind::Block,
"if_statement" | "if_expression" | "if" | "unless" => AstSkeletonKind::If,
"if_statement" | "if_expression" | "if" | "unless" | "unless_statement"
| "when_expression" => AstSkeletonKind::If,
"while_statement" | "while_expression" | "for_statement" | "for_expression"
| "loop_expression" | "do_statement" | "foreach_statement" | "while" | "until" | "for" => {
| "loop_expression" | "do_statement" | "do_while_statement" | "foreach_statement"
| "while" | "until" | "for" | "iterator_statement" | "case_statement" => {
AstSkeletonKind::Loop
}
"call_expression" | "method_invocation" | "invocation_expression" | "function_call"
Expand All @@ -255,6 +278,7 @@ fn classify(kind: &str) -> Option<AstSkeletonKind> {
| "local_variable_declaration"
| "variable_declaration"
| "short_var_declaration"
| "property_declaration"
| "declaration" => AstSkeletonKind::Decl,
_ => return None,
})
Expand Down
Loading