feat: dev publish workflow, parser refactor, and quality-of-life improvements by carlos-alm · Pull Request #25 · optave/ops-codegraph-tool · GitHub
Skip to content

feat: dev publish workflow, parser refactor, and quality-of-life improvements#25

Merged
carlos-alm merged 19 commits into
mainfrom
feat/dev-publish-workflow
Feb 23, 2026
Merged

feat: dev publish workflow, parser refactor, and quality-of-life improvements#25
carlos-alm merged 19 commits into
mainfrom
feat/dev-publish-workflow

Conversation

@carlos-alm

Copy link
Copy Markdown
Contributor

Summary

  • Publish workflow consolidation: merge dev + stable publish into a single publish.yml workflow with workflow_dispatch inputs
  • Parser refactor: split monolithic parser.js extractors into per-language files under src/extractors/
  • codegraph stats command: new CLI command for graph health overview
  • Native engine fixes: normalize import paths, throw on explicit --engine native when addon unavailable
  • Registry improvements: TTL-based pruning for idle entries, auto-prune stale entries, skip temp dir registration, isolate CLI tests from real registry
  • Embedding regression CI: real-model integration test with dedicated weekly workflow
  • Worktree workflow hooks: guard-git.sh, track-edits.sh, rebuild-graph.sh for parallel session safety
  • Windows compatibility: replace jq with node in hooks
  • Competitive analysis: expanded from 21 to 135+ tools

Test plan

  • Full test suite passes (385 passed, 43 skipped) on all platforms
  • Lint clean
  • Verify codegraph stats output on a real repo
  • Verify publish.yml workflow_dispatch triggers correctly for dev and stable channels
  • Confirm embedding regression workflow runs on schedule and relevant PR changes

Add dev-publish.yml that triggers on every merge to main, publishing
prerelease versions (e.g. 2.0.1-dev.abc1234) with --tag dev. Includes
concurrency control and skip logic for stable release version bumps.

Simplify publish.yml to release-event-only: remove workflow_dispatch
trigger and inputs, add explicit --tag latest, disable prepublishOnly
in CI since tests already run in preflight.
Merge dev-publish and stable-publish into one publish.yml to satisfy
npm Trusted Publishing's one-workflow-per-package constraint.

- push to main → dev release (e.g. 2.0.1-dev.abc1234) with --tag dev
- GitHub Release event → stable release with --tag latest
- Concurrency group cancels in-flight dev publishes on rapid merges
- Skip logic for stable version bump commits (chore: release v*)
- Version computed in dedicated job, shared via outputs
- No git commits/tags/PRs for dev releases
The Rust resolve_import function produced paths like src/./db.js
because Path::join preserves . segments from relative imports.
This caused import edges to be lost for native engine users.

Fix by normalizing the resolved PathBuf immediately after join using
components().collect(), and upgrading normalize_path to also clean
. / .. segments. Remove the temporary path.normalize() JS workaround
since the Rust side now returns clean paths directly.
Prevent registry pollution from temp directory builds by checking
os.tmpdir() before auto-registration. Auto-prune stale entries on
`registry list` (CLI) and `list_repos` (MCP) so users and AI agents
always see a clean registry.
Prevent concurrent Claude Code instances from unstaging, deleting,
or reverting each other's files.
Wrap native resolveImport and resolveImports results with
normalizePath(path.normalize()) to catch any remaining ./.. segments
that the Rust engine might produce on edge cases.
Track lastAccessedAt on registry entries (updated on build and MCP
query). pruneRegistry now removes entries not accessed within a
configurable TTL (default 30 days) in addition to missing directories.
CLI `registry prune --ttl <days>` exposes the TTL parameter.
Move 9 language extractors (~1,630 lines) from parser.js into
src/extractors/, mirroring the native engine's per-file structure.
parser.js re-exports all extractors for backward compatibility.

Also fix config.test.js to match current embeddings default (jina-code).
Mark registry cleanup (#4) and git-diff guard (#6) as fixed.
Update testing summary for native engine and registry status.
…PATH env var

The cli.test.js afterAll called pruneRegistry() with no arguments, operating
on the real ~/.codegraph/registry.json. The run() helper also lacked HOME
isolation, risking writes to the real registry. Add CODEGRAPH_REGISTRY_PATH
env var support to registry.js, isolate all CLI spawns with a fake HOME, and
remove the bare pruneRegistry() call.
Previously --engine native silently fell back to WASM with a warning,
which was easy to miss. Now it throws a clear error with install
instructions, matching user intent. Auto mode remains unchanged.
…ctors

Each extractor's internal AST traversal function was identically named
`walk`, making codegraph search results ambiguous across languages.
Renamed to walkPythonNode, walkJavaScriptNode, walkGoNode, etc. so
symbol searches return unique, language-specific hits.
Unified command showing node/edge breakdowns, language distribution,
cycle counts, coupling hotspots, and embedding status. Supports --json.
Add guard-git.sh (PreToolUse) to block dangerous git commands that
interfere with parallel sessions, and track-edits.sh (PostToolUse) to
log edited files so commits can be validated against the session log.
Update CLAUDE.md with worktree-first workflow and fix the Claude Code
hooks example in recommended-practices.md to use the correct schema.
Add integration test that runs the embed+search pipeline with the real
minilm model to catch regressions from model updates, embedding text
format changes, or pipeline bugs. Includes a dedicated CI workflow
(weekly + on relevant PR changes) with HuggingFace model caching.
check-readme.sh and enrich-context.sh used jq for JSON parsing, which
isn't available on Windows. Switch to node inline scripts matching the
pattern used by guard-git.sh and track-edits.sh. Also commit
rebuild-graph.sh which was wired into settings.json but never tracked.
@greptile-apps

greptile-apps Bot commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

45 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@carlos-alm carlos-alm merged commit c6bdbaa into main Feb 23, 2026
21 checks passed
@carlos-alm carlos-alm deleted the feat/dev-publish-workflow branch February 23, 2026 00:46
Zeeeepa pushed a commit to Zeeeepa/codegraph that referenced this pull request Jun 22, 2026
feat: dev publish workflow, parser refactor, and quality-of-life improvements
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