Tags: ix-infrastructure/Ix
Tags
fix: sync CLI version from formula version during Homebrew build Uses npm version to set package.json version to match the formula, so ix --version always matches the release tag regardless of what version is committed in the repo. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Patch/parse refinement (#96) * feat(ingest): add GlobalResolutionIndex for cross-batch edge resolution Fixes cross-batch IMPORTS and REFERENCES edges in large repos (e.g. Kubernetes 15k-file Go codebase) where streaming per-chunk commits meant that resolveEdges() only saw 1,000 files at a time, causing imports pointing to files in other batches to resolve to nonexistent same-file nodes instead of their real targets. ## Problem The ingest pipeline processes files in streaming batches of 1,000. After each batch is parsed, resolveEdges() is called on only that batch and the batch is committed. Because resolveEdges() builds its lookup maps (goPkgPathToFiles, goPkgDirToFiles, stemToFiles, fileHasSymbol, etc.) solely from the current batch, cross-batch edges like: cmd/kube-apiserver/app/server.go → pkg/controlplane/instance.go cmd/kube-scheduler/app/server.go ← pkg/scheduler/scheduler.go were never resolved. A previous fix accumulated all ParsedFile[] and called flushAll() once at the end, which produced correct edges but eliminated streaming commits — nothing appeared in the graph until all 15,800 files were parsed (~400s). That approach was rejected. ## Solution: Fast Pre-Scan Global Index (Option 3) Before tree-sitter parsing starts, a fast pre-scan builds a GlobalResolutionIndex covering all discovered file paths: Phase 1 — path-only index (zero I/O, instant): stemToFiles, dirToIndexFiles, packageToFiles, goPkgDirToFiles, goPkgPathToFiles Phase 2 — entity enrichment via regex text scan (~1–2s for ~11k Go files): For each .go file: extract package name, exported types (type X struct/ interface/alias), exported top-level functions (func X...), and exported methods (func (r T) X...) using fast regex patterns — no tree-sitter. Package name extraction is critical for Chain 5: resolveEdges resolves `scheduler.Scheduler` via a two-part check where the second part looks for the package name "scheduler" in fileHasSymbol. Without it, the file pkg/scheduler/scheduler.go is never matched. The GlobalResolutionIndex is passed into every resolveEdges() call as an optional third parameter. Inside resolveEdges(), each map is seeded from the global index before batch data is added; batch entries (fully parsed by tree-sitter) override global regex-extracted data for files in the current batch. ## Changes core-ingestion/src/index.ts: - Export GlobalResolutionIndex interface with 8 map fields - Export buildGlobalResolutionIndex(filePaths, sources?) function - Add optional globalIndex?: GlobalResolutionIndex third param to resolveEdges - Seed goPkgDirToFiles, goPkgPathToFiles, stemToFiles, dirToIndexFiles, packageToFiles from globalIndex before adding batch data - Seed fileQKeys from globalIndex (batch entries overwrite); rebuild fileHasSymbol and symbolToFiles from merged fileQKeys so per-batch overrides propagate correctly ix-cli/src/cli/commands/ingest.ts: - Revert both Path A (mtime-changed) and Path B (--force/first ingest) from the flushAll(allParsedForResolution) accumulation back to per-chunk flushBatch(batch) streaming commits - Add globalIndex pre-scan in both paths: reads all .go files from the full filePaths list (not just changed files) so the index covers the entire repository - Thread globalIndex as third arg into resolveEdgesFn calls in both flushBatch and flushAll ix-cli/src/cli/commands/ingestion-loader.ts: - Add buildGlobalResolutionIndex to IngestionModule type ## Expected result - Streaming commits preserved: data appears every ~1,000 files as before - Cross-batch IMPORTS resolved: goPkgPathToFiles now covers all 15k Go file paths so server.go → pkg/controlplane resolves correctly (Chain 4) - Cross-batch REFERENCES resolved: regex pre-scan puts Scheduler and package name "scheduler" into fileHasSymbol before the batch containing server.go is processed (Chain 5) - Total overhead vs. original: ~2–4s for Go file text scan + negligible in-memory index build; no change to parse throughput or commit streaming Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(go): capture qualified type refs and add Chain 4/5 regression tests queries.ts: Extend GO_QUERIES to capture qualified_type references (e.g. scheduler.Scheduler, *scheduler.Scheduler) in field declarations, parameter declarations, and function/method return types. Previously only bare type_identifier nodes were captured, so function signatures like `func Run(sched *scheduler.Scheduler) error` never emitted a REFERENCES edge. This is load-bearing for Chain 5 — without it resolveEdges has no edge to resolve regardless of the global index. queries.go.test.ts: Add test verifying that parseFile emits both the IMPORTS edge for k8s.io/kubernetes/pkg/scheduler and a REFERENCES edge for Scheduler when a function parameter uses the qualified form *scheduler.Scheduler. resolveEdges.test.ts: - Relax two existing "no edges" assertions from toEqual([]) to filtering for CALLS edges before asserting empty, since resolveEdges now correctly emits IMPORTS edges in those fixtures. - Add two new tests covering the Kubernetes verification chains: Chain 4: server.go (kube-apiserver) imports pkg/controlplane and resolveEdges picks instance.go as the anchor (highest import count). Chain 5: server.go (kube-scheduler) has Run(*scheduler.Scheduler) and resolveEdges resolves the REFERENCES edge to pkg/scheduler/scheduler.go via the import-scoped qualifier tier. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(go): resolve aliased import CALLS edges and improve file discovery canonicalization Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * feat(trace): disambiguate same-named functions in trace output with source path Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * Fix Python parser edge extraction regressions * Add YAML parsing support to ix * Use config_entry for YAML entities * Fix ix map ingest crash and suppress nested output * feat: support Dockerfile parsing and singleton map regions * perf(ingest): restore parse-commit pipeline overlap Commit 1689b45 accidentally serialized parse and commit by replacing the pendingFlush pipeline pattern with a plain `await flushBatch(batch)`. This caused the full backend commit round-trip (tombstone + bulk insert + revision update) to block parsing of the next chunk, creating visible ~N-second pauses every 1000 files and increasing total map time proportionally. Restores the pendingFlush / pendingFlushB pattern in both Path A and Path B so each chunk's backend commit runs concurrently with parsing of the next chunk. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * refactor(parse): apply pr96 review suggestions - ix trace: revert single-direction JSON to compactTreeNode, drop redundant nodes/edges arrays - resolveEdges: add Python language guard to IMPORTS PascalCase fallthrough so unresolvable Go imports don't leak into Tier 2/3 - resolveEdges: extract narrowGoImportCandidates helper from resolveImportTargets and resolveImportQualifierTargets - ingest: add sources.clear() after each buildGlobalResolutionIndex call to release source map before parse loop - tests: add Python IMPORTS happy-path and Go guard tests for the fallthrough fix Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Joseph Mikhail <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
fix: compass upgrade on Windows and stop nagging when not installed (#94 ) - Add cygpath conversion for tar paths on Windows/MINGW (matches CLI upgrade behavior) so compass extraction doesn't fail - Only show compass update notifications in background check when compass is actually installed (version != 0.0.0), preventing persistent nag on every command after a failed install Co-authored-by: Claude Opus 4.6 <[email protected]>
fix: build multi-platform Docker image (amd64 + arm64) The memory layer image was amd64-only, causing a platform mismatch warning and Rosetta emulation overhead on Apple Silicon. Now builds for both linux/amd64 and linux/arm64 using QEMU + Buildx. Co-Authored-By: Claude Opus 4.6 <[email protected]>
fix: make Homebrew formula step non-blocking in release workflow The Homebrew PR step failed on v0.4.2 due to missing createPullRequest permission, which killed the entire release — preventing the Docker image from being published. With continue-on-error, the release completes even if Homebrew update fails. Co-Authored-By: Claude Opus 4.6 <[email protected]>
fix: ensure compose file exists on start even when backend is already… … healthy When 'ix docker start' found the backend already healthy, it returned early without downloading docker-compose.yml to ~/.ix/backend/. This meant 'ix docker stop' from a different directory couldn't find the compose file. Now start always ensures the standalone compose file exists before the health check short-circuit. Co-Authored-By: Claude Opus 4.6 <[email protected]>
PreviousNext