14 Commits

Author SHA1 Message Date
CooperSheroy ddce15db48 docs: remove stale language and test counts
Signed-off-by: CooperSheroy <sheroycoops@gmail.com>
2026-06-24 09:05:21 +05:30
Martin Vogel 3d9917f325 Add community files and strengthen the contribution terms
Adds the Contributor Covenant 2.1 code of conduct (canonical text,
byte-verified against upstream) and reproduction-first issue forms that
ask for shareable reproductions — dummy snippets or public OSS repos —
plus logs and exact commands, never proprietary code. CONTRIBUTING.md
now states explicitly that a Signed-off-by line certifies the DCO in
full for that contribution, with GitHub ToS inbound=outbound noted as
the independent backstop. The VirusTotal badge now points at the latest
release instead of a pinned historical scan.

Signed-off-by: Martin Vogel <martin.vogel@datadice.io>
2026-06-12 16:58:55 +02:00
Martin Vogel 2a0ec321c3 Adopt the Developer Certificate of Origin for all commits
Every commit must now carry a Signed-off-by trailer matching its
author, certifying the right to submit the change under the project's
MIT license (DCO 1.1, the Linux kernel mechanism). Enforcement is
strict at three layers: a commit-msg hook rejects unsigned commits
locally (scripts/install-git-hooks.sh), and the new DCO workflow
rejects every push and pull request containing one. Merge commits and
bot authors are exempt, matching standard DCO checks.

Signed-off-by: Martin Vogel <martin.vogel@datadice.io>
2026-06-12 14:31:55 +02:00
Martin Vogel 630bd40a90 Replace the graph-UI HTTP server with a first-party implementation
The web server behind the graph UI is now a purpose-built in-house
module (src/ui/httpd.c): localhost-only listener, strict HTTP/1.1
parsing with fixed request caps, a per-connection receive deadline,
and Connection: close semantics. http_server.c keeps the routing and
handlers, rewritten against the new transport API; the public server
API and main.c are unchanged. The previously vendored third-party
server is removed entirely.

Comes with a new 28-test transport + routing suite (tests/test_httpd.c)
covering parsing edge cases (strict CRLF, Content-Length limits, raw
path matching, percent-decode rules) and live-socket behavior (CORS
policy, RPC dispatch, receive deadline, clean shutdown). The security
audit scripts now check the new file layout and treat any network call
in vendored code as a failure.
2026-06-12 02:17:25 +02:00
Martin Vogel 80680ea367 Cross-service communication discovery + RAM-first incremental indexing
AST-based detection of HTTP calls, async dispatch (Pub/Sub, Cloud Tasks,
Kafka, SQS, etc.), and config accesses via resolved qualified names.
Route nodes as cross-service rendezvous points with infra→handler matching.
Constant propagation for module-level string assignments. YAML infrastructure
URL extraction from Cloud Scheduler configs.

RAM-first incremental pipeline: load DB into graph buffer, purge changed
file nodes, extract directly into existing buffer (resolver sees all nodes),
dump back to disk. Zero edge gap on kubernetes/django/meilisearch/neovim.

- service_patterns.c: ~170 library patterns (90 HTTP, 50 async, 30 config)
- pass_route_nodes.c: Route node creation + infra URL matching
- extract_unified.c: string constant collection + string ref classification
- extract_calls.c: first_string_arg + keyword argument extraction
- pipeline_incremental.c: RAM-first load→purge→extract→resolve→dump
- graph_buffer.c: load_from_db, delete_by_file, foreach visitors
- C++ LSP crash fix: NULL guard in cbm_type_substitute
2026-03-28 13:59:42 +01:00
Martin Vogel fad0ff7f90 Merge PR #87: feat(k8s) — Kubernetes and Kustomize indexing (66 languages)
Adds first-class indexing for K8s manifests and Kustomize overlays:
- Resource nodes for K8s kinds (Deployment/my-app, Service/my-svc)
- Module nodes for Kustomize overlays with IMPORTS edges
- Detection via name (kustomization.yaml) and content (apiVersion:)
- Reuses vendored YAML grammar — no new tree-sitter grammar needed

Fix lint: clang-format, implicit bool conversion, magic number.
Resolve CONTRIBUTING.md conflict. Update language count 64 → 66.
Add infrastructure indexing to README features.

Closes #86. Thanks @halindrome!
2026-03-23 13:06:37 +01:00
Martin Vogel eb8fcbf1ca Add commit format convention and one-issue-per-PR rule to CONTRIBUTING.md
- Commit format table: feat, fix, test, refactor, perf, docs, chore
  (adapted from @halindrome's PR #85)
- One issue per PR: no bundling multiple fixes/features
- Open an issue first: every PR must reference a tracking issue

Based on feedback from @halindrome (#84, #85) who identified the need
for structured PR guidelines and commit conventions.
2026-03-23 11:28:00 +01:00
Martin Vogel c371e9f07d Add time-bomb + MCP file read audit, tracked pre-commit hooks
Security audit (Layer 1) new checks:
- Time-bomb scan: flags time()/sleep()/clock() near dangerous calls
- MCP file read audit: tracks fopen/fread count in mcp.c against
  expected max (detects data exfiltration through tool responses)

Pre-commit hooks now tracked in scripts/hooks/:
- Contributors activate with: git config core.hooksPath scripts/hooks
- Runs: lint → security audit → build + test
- setup.sh already configures this automatically
2026-03-21 16:43:48 +01:00
Shane McCarron 340862c619 fix(k8s): address QA round 2 findings
- CONTRIBUTING.md: fix CBMLanguage enum file reference from
  non-existent cbm_language.h to internal/cbm/cbm.h
- CONTRIBUTING.md: rephrase "do not use tree-sitter grammars" to
  "do not require a new tree-sitter grammar", clarifying they reuse
  the existing YAML grammar
- pass_k8s.c: correct header comment from "per top-level resource
  document" to "first document only — multi-document YAML is not
  yet supported"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 09:29:22 -05:00
Shane McCarron 94841e0542 fix(k8s): address QA round 1 findings
- [Major 1+2] pass_k8s: always re-extract K8s manifests with CBM_LANG_K8S,
  discarding any cached YAML result; pass already-read source buffer to
  handle_k8s_manifest to eliminate the double file read
- [Minor 3] CONTRIBUTING.md: fix extractor path to internal/cbm/extract_k8s.c
  and clarify tree-sitter YAML grammar usage
- [Minor 4] language.c: add comment documenting intentional case-sensitive
  FILENAME_TABLE and case-insensitive cbm_is_kustomize_file() split behaviour
- [Minor 5] test_pipeline.c: add k8s_extract_manifest_multidoc test pinning
  single-document-per-file extraction behaviour
- [Minor 6] pass_infrascan: replace strlen with strnlen(content, 4096) in
  cbm_is_k8s_manifest to bound the scan
- [Minor 7] extract_k8s: add "crds" to is_kustomize_list_key
- [Nit 8] extract_k8s: remove dead second block_node unwrap in
  extract_k8s_scalars metadata descent
- [Nit 10] extract_k8s: use cbm_arena_strdup for def.label "Resource"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 09:29:22 -05:00
Shane McCarron 5a663b9c84 docs(k8s): document infra-pass pattern in CONTRIBUTING.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 09:29:22 -05:00
Martin Vogel de427776c0 Fix clang-format in merged PR #79 + update CONTRIBUTING.md
- Fix formatting in mcp.c protocol version negotiation (from PR #79 merge)
- Rewrite CONTRIBUTING.md for pure C project (was still describing Go,
  causing contributors to submit Go PRs that can't be merged)
2026-03-20 20:09:25 +01:00
Martin Vogel ced21194ac Fix Magma import/call extraction, resolve file-path imports in linker
- Add field('path', ...) to Magma load_statement grammar rule so
  parse_generic_imports() finds the import path via field lookup
  instead of the broken text fallback (which only extracted 1 per file)
- Fix passImports() to resolve file-path imports (e.g. "utils.mag",
  "lib/helpers.h") via fqn.ModuleQN() when raw path doesn't match
  any node QN — general fix benefiting any file-path-based import
- Add TestMagmaImport_Regression and TestMagmaCall_Regression
- Update language count 59 → 63 in README, docs/index.html, marketing
2026-03-07 12:55:56 +01:00
Martin Vogel 9e50803ca1 Add CONTRIBUTING.md and GitHub Pages landing page
- CONTRIBUTING.md: build from source, run tests, PR guidelines, language fix workflow
- docs/index.html: SEO-optimized landing page with benchmark data, feature grid, comparison table
2026-03-02 23:13:24 +01:00