Skip to content

feat: make model-free indexing and coding-tool setup reliable - #131

Merged
PatrickSys merged 35 commits into
masterfrom
codex/cbc-product-relaunch-20261011
Oct 30, 2026
Merged

PatrickSys merged 35 commits into
masterfrom
codex/cbc-product-relaunch-20261011

Conversation

@PatrickSys

@PatrickSys PatrickSys commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

New projects default to local, model-free indexing and search. Setup configures Claude Code, Codex, Cursor and OpenCode together, preserves unrelated settings, and launches the installed package directly through Node.

Writers publish complete index generations and readers retain a consistent snapshot. Search checks nominated source excerpts, relationship checks distinguish excluded or unavailable targets from missing imports, and watcher exclusions are relative to the project. Windows ticket replacement retries are limited to the exact owned rename failure reproduced with ordinary Node read handles; the generic config writer and failed-read behavior are unchanged. Existing semantic indexes retain their recorded mode, with directed imports and re-exports available up to three hops.

Includes the commits from #138, #139 and #142. PR140's extra clients and HTTP setup remain separate.

Validation:

  • Windows full suite on the complete final tree: 1,309 passed with one existing skip across 122 test files. The normal pre-push hook passed without bypassing checks. All 54 focused init checks also passed. CI passed on that same head.
  • Normal clean local-tarball install with scripts enabled and no optional-dependency omission. All 392 packaged artifacts match the build, including 106 executable files and grammars; neither optional model nor LanceDB package resolves. Actual installed four-client init preserved existing registrations and produced a byte-identical rerun on a Windows path containing spaces, &, % and Unicode.
  • A native Codex consumer made the five original Express MCP searches and read source for four answers; the graph question retains its explicit limitation. The other three native applications were not opened.
  • The 21 queries were frozen before the repairs: Express found an expected file in the top five for 8/10, Hono for 6/11. All 21 completed without tool errors. This is a file-hit proxy, not answer accuracy or a comparison with another tool.
  • The installed candidate migrated the preserved Hono index. Sampled peak server RSS was about 1.38 GB for Hono and 302 MB for warm Express, with a 100 ms polling delay. These are observations, not unique physical memory or a controlled performance comparison.

Limits: all five native searches reported low confidence. Ranked search does not establish the globally least-connected module. Earlier Windows runs included an uncaptured SDK response, baseline timeout, ticket-open error and a separate confinement error; their causes are not established by later passing runs. The ordinary-read-handle rename failure was reproduced separately and has a bounded ticket-only repair. No stable release, universal error-free operation or complete product acceptance is claimed.

Fresh projects index without model runtimes; successful existing modes are preserved. Codex setup supports noninteractive project configuration and installed npm launchers. Current source validation, directed import/re-export traversal and root-relative persistence keep source evidence confined and explicit about unresolved paths.

Validation: build/typecheck/format and lint (zero errors); 97 files and 703 tests pass on the local Windows suite. Exact Node 22 Windows and Ubuntu WSL consumers matched all 377 package files and passed first-use source/graph checks. The matching 173-package production audit reported zero current findings. Natural-language retrieval still abstains on the frozen difficult question; native Codex tool use remains approval-denied. This is an unreleased source candidate.

AI-assisted engineering: Codex configured GPT-6.1 Sol High prime and specialists, GPT-6 Luna Medium implementation, GPT-6 Luna High independent review, and one bounded native GPT-6 Astra advisory. Configured routing is observed; backend serving identity is not attested.
Linux Node22 CI passed all703 assertions but correctly failed on an unhandled early rejection: this test started search before awaiting the case-variant filesystem probe. Resolve the probe first so the existing exact corruption rejection is handled immediately. Keep both success and rejection criteria unchanged.

Validation: focused case1/1 and source-validity15/15 pass; Prettier passes. Independent LunaHigh review confirms the sole test ordering change, with no runtime, fixture, assertion, skip or error-suppression change. Linux CI will confirm.

AI contribution: configured GPT-6 Luna Medium implementation, Luna High independent review and GPT-6.1 Sol High integration; backend serving identity is not independently attested.
@PatrickSys

Copy link
Copy Markdown
Owner Author

Every get_symbol_references call now reads and Tree-sitter-parses every indexed file: the chunk prefilter is gone, and findIdentifierOccurrences parses without a cheap text check first. Testing the word on the current file text before parsing would keep current-source truth without the full scan.

  • const candidateFiles = new Map<string, string>();
    for (const chunkRaw of chunks) {
    const chunk = chunkRaw as IndexedChunk;
    const absPath = resolveAbsoluteChunkPath(rootPath, chunk);
    if (!absPath) {
    return {
    status: 'error',
    message:
    'Indexed source location is invalid. Refresh the index before trusting reference results.'
    };
    }
    const relPath = path.relative(rootPath, absPath).replace(/\\/g, '/');
    candidateFiles.set(relPath, absPath);
    }
    let realRootPath: string;
    try {
    realRootPath = await fs.realpath(rootPath);
    } catch {
    return { status: 'error', message: 'Selected project path is missing or unreadable.' };
    }
    for (const [relativePath, absolutePath] of candidateFiles) {
  • const occurrences = await findIdentifierOccurrences(
  • tree = parser.parse(content);

@PatrickSys

Copy link
Copy Markdown
Owner Author

If any of the ~30 search candidates was edited after indexing (before the watcher catches up, or from the CLI), search throws IndexCorruptedError, starts a full re-index and returns status: indexing, while get_code_relationships keeps answering and just marks drifted edges stale. Dropping or flagging the drifted candidate would keep search working.

  • private async validateCandidateSources(
    chunks: Iterable<CodeChunk>,
    checkedSources: Map<string, string>
    ): Promise<void> {
    if (!this.sourceManifest) {
    throw new IndexCorruptedError('Source manifest is unavailable. Full rebuild required.');
    }
    let realRootPath: string | undefined;
    for (const chunk of chunks) {
    const sourcePath = this.getIndexedSourcePath(chunk);
    const sourceKey = path.resolve(this.rootPath, chunk.filePath);
    if (checkedSources.has(sourceKey)) continue;
    const relativePath = path.relative(this.rootPath, sourcePath).replace(/\\/g, '/');
    const expectedHash = this.sourceManifest.files[relativePath];
    if (typeof expectedHash !== 'string') {
    throw new IndexCorruptedError(
    'Indexed source is absent from its manifest. Full rebuild required.'
    );
    }
    try {
    realRootPath ??= await fs.realpath(this.rootPath);
    const realSourcePath = await fs.realpath(sourcePath);
    if (!isPathWithin(realRootPath, realSourcePath)) {
    throw new Error('Source resolves outside the selected project');
    }
    if (!(await fs.stat(realSourcePath)).isFile()) {
    throw new Error('Source is not a regular file');
    }
    const content = await fs.readFile(realSourcePath, 'utf-8');
    if (hashFileContent(content) !== expectedHash) throw new Error('Source content changed');
    checkedSources.set(sourceKey, content);
    } catch {
    throw new IndexCorruptedError(
    `Indexed source is changed or unreadable (${relativePath}). Full rebuild required.`
    );
    }
    }
  • await this.validateCandidateSources(
  • if (error instanceof IndexCorruptedError) {
    console.error('[Auto-Heal] Index corrupted. Triggering background re-index...');
    void ctx.performIndexing();
  • const collectionKeys = ['paths', 'unresolved', 'staleEdges', 'staleUnresolvedEdges'];

@PatrickSys PatrickSys changed the title Make CBC model-free by default with verified source navigation Make CBC model-free by default with current source context Oct 15, 2026
PatrickSys and others added 11 commits October 16, 2026 18:18
* fix(search): clarify first-use indexing guidance

* fix(search): clarify index retry guidance

* fix: require Node 22 and test supported LTS versions
* fix: route help to CLI usage

* test: keep the original help response timeout
* docs: align 2.4.0 release guidance

* fix: align release workflow with 2.4.0

* docs: explain real setup and 2.4.0 changes

* fix(release): require an explicit manual publish tag

* docs: qualify unreleased version commands across guides

* Fix 2.4.0 setup notices
@PatrickSys PatrickSys changed the title Make CBC model-free by default with current source context Search locally without model downloads and follow imports Oct 16, 2026
PatrickSys and others added 3 commits October 20, 2026 09:49
* docs: use published npm install commands

* docs: keep 2.2.0 analyzers current and mark 2.4.0-only commands

Addresses Codex/Greptile review on #141: Angular/React/Next.js analyzers ship in 2.2.0 (only NestJS is upcoming); init --client/--yes, codebase-context-review and parsing.maxChunks require unpublished 2.4.0, so those commands are pinned and labelled. Release-truth test allows 2.4.0 pins only next to a 'requires 2.4.0' note.
Init configures Claude Code, Codex, Cursor, and OpenCode together and saves the Node binary plus the package file from the npx cache. map indexes before it prints, --version prints the package version, and a low-confidence search tells the agent a weak result is not proof the code is missing.
Update Hono to 4.12.16 in pnpm-lock.yaml and default Windows test files to one worker. Explicit worker flags remain available.

The full 667-test suite passed on Windows both directly and through the repository pre-push hook. Node 22 and 24 CI passed, and an independent code review passed for this exact candidate.

Agent-Harness: codex
Agent-Session: J62-cbc-night-20261029-28964
Freeze 21 retrieval cases and one graph capability check across pinned Express and Hono sources before retrieval repairs. This is test input only; no advantage or product acceptance is claimed. Existing source suite and hook passed 667 tests before this non-executable data addition; JSON structure and every expected source path were checked.

Agent-Harness: codex
Agent-Session: J62-cbc-night-20261029-28964
Intermediate ancestry checkpoint. Interrupted full/incremental publication and refresh behavior are known RED; the following repair is required before this is a delivery candidate.

Agent-Harness: codex
Agent-Session: 01a18908-1b3d-7c80-b4fb-71e52adce843
Retain detected four-client setup already shared by PR131 and PR139. Preserve current published-version commands instead of the incoming unpublished 2.4.0 examples. Private integration checkpoint; consistency repair remains required.

Agent-Harness: codex
Agent-Session: 01a18908-1b3d-7c80-b4fb-71e52adce843
Retain the four-client Node and package-entrypoint launch, missing-index map bootstrap, file-count fallback, version/help handling and low-confidence search guidance. Preserve PR131 explicit embedding flags and recorded-mode behavior. Private integration checkpoint; archived consistency and setup safety repairs follow before final validation.

Agent-Harness: codex
Agent-Session: 01a18908-1b3d-7c80-b4fb-71e52adce843
Stage full and incremental artifacts behind one atomic metadata publication, serialize writers before baseline reads, and pin each reader operation. Preserve semantic vectors and recoverable orphan data under bounded retention; recheck map first-build eligibility after writer admission.

Keep client setup on the running package, preserve TOML semantics, publish configs atomically, and apply shared project indexing options. Retain model-free defaults and explicit recorded-mode recovery.

Validation: 1173 tests passed, one unchanged Linux-only skip; build, type-check and formatting passed; lint has zero errors. Independent source review passed on the exact frozen75-file candidate. Package, native-client, search-quality, memory and CI gates remain separate.

Agent-Harness: codex
Agent-Session: 01a18908-1b3d-7c80-b4fb-71e52adce843
Preserve source order and faithful metadata when merging adjacent chunks. Validate each produced interval against its normalized file before staging, and make integrity failures fatal without replacing the committed generation. Advance the index format to rebuild existing malformed chunks while preserving old generation authority and bounded recovery.

Keep the native response consistent with the tool's validated recovery outcome, including failed or already-running rebuilds. Exercise actual SDK late corruption, unchanged semantic vectors, old-format migration, and isolated CLI map publication and reuse.

Validation: 1214 tests passed with one unchanged skip; build, type-check, formatting and independent source review passed. Actual isolated Hono indexing produced no invalid source intervals. Packaged/native acceptance, fixed-query quality, memory and CI gates remain separate.

Agent-Harness: codex
Agent-Session: 01a18908-1b3d-7c80-b4fb-71e52adce843
@PatrickSys PatrickSys changed the title Search locally without model downloads and follow imports feat: make model-free indexing and coding-tool setup reliable Oct 30, 2026
@PatrickSys
PatrickSys marked this pull request as ready for review October 30, 2026 00:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T05:17:59.226580Z 51305e2 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c536317677

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/core/file-watcher.ts Outdated
Comment on lines +53 to +54
const pathParts = filePath.split(/[\\/]+/);
return EXCLUDED_DIRECTORY_NAMES.some((directoryName) => pathParts.includes(directoryName));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply watcher exclusions relative to the selected project root

When a checkout is beneath an ancestor named worktrees, .worktrees, build, or another excluded directory, this predicate matches that ancestor in every absolute path, including rootPath itself. For example, both /home/user/worktrees/my-project and its src/main.ts are marked ignored, so the watcher never triggers incremental refreshes for that project. Apply exclusions to paths relative to rootPath, exempting the selected root itself, so excluded directories inside the project are skipped without disabling watching based on the checkout's location.

Useful? React with 👍 / 👎.

@greptile-apps

greptile-apps Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; the excluded-import warning is fixed and no new actionable issues were found.

Summary

This PR makes new indexes model-free, configures four coding tools, and publishes complete index builds while readers keep one consistent view.

  • Setup configures selected coding tools to launch the project package directly.
  • Fresh projects build keyword indexes without downloading models.
  • Index updates publish complete generations while readers keep one snapshot.
  • Search checks nominated excerpts against current source before ranking results.
  • A new tool follows verified imports and re-exports between source files.
  • Indexed code chunks keep their source spans and clearer symbol ownership.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Sources[Project source] --> Build[Build a complete generation]
  Build --> Publish[Replace index metadata]
  Publish --> Latest[Latest committed generation]
  Latest --> Pin[Reader pins one generation]
  Pin --> Check[Check current source evidence]
  Check --> Results[Search or relationship results]
Loading

Reviews (3) · Last reviewed commit: "Preserve saved Codex settings during set..." · Reviewed by Greptile

Comment thread src/core/search.ts Resolved
Comment thread src/core/search.ts Resolved
Comment thread src/tools/get-code-relationships.ts Resolved
@PatrickSys
PatrickSys marked this pull request as draft October 30, 2026 00:43
Scope watcher exclusions to the selected project. Reuse the pinned build-bound manifest and validate every nominated chunk body against current source before retaining its exact snippet. Recheck unresolved imports with the current resolver within the existing inspection allowance.

Share the producer interval predicate, retain corruption and stale-source negatives, correct synthetic fixture bounds and manifest metadata, and capture native SDK envelopes before strict decoding.

Validation: 1253 tests passed with one unchanged skip; build, type-check, formatting and independent source/test review passed. The captured full run contains valid responses for all eight late-recovery phase envelopes. An earlier intermittent SDK status failure remains unexplained because its original raw response was not retained; passing reruns do not establish a fix. Package, native consumer, pre-push and CI gates remain separate.

Agent-Harness: codex
Agent-Session: 01a18908-1b3d-7c80-b4fb-71e52adce843
@PatrickSys
PatrickSys marked this pull request as ready for review October 30, 2026 02:57
Comment thread src/tools/get-code-relationships.ts Resolved
Distinguish known unindexed targets and unavailable analysis from missing imports without promoting unverified graph edges. Preserve canonical target evidence and validate persisted relationship records before traversal.

Agent-Harness: codex
Agent-Session: 01a18ab2-0c07-7283-b655-55084e9cd414
Ordinary Node readers can temporarily block numbered and released ticket replacement. Bound retries to the exact owned Windows rename failure while retaining complete old tickets, ordering and fail-closed errors.

Agent-Harness: codex
Agent-Session: 01a18ab2-0c07-7283-b655-55084e9cd414
Carry the original saved-file regressions through the semantic TOML implementation and explain how to replace a conflicting custom launch without discarding unrelated settings.

Agent-Harness: codex
Agent-Session: 01a18ab2-0c07-7283-b655-55084e9cd414
@PatrickSys
PatrickSys marked this pull request as ready for review October 30, 2026 05:15
@PatrickSys
PatrickSys merged commit e87020f into master Oct 30, 2026
5 checks passed
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.

2 participants