Skip to content

LazyBrain 3.0: simplify local capability discovery for Codex - #26

Merged
papperrollinggery merged 59 commits into
mainfrom
codex/lazybrain-route-compile-split
Sep 6, 2026
Merged

LazyBrain 3.0: simplify local capability discovery for Codex#26
papperrollinggery merged 59 commits into
mainfrom
codex/lazybrain-route-compile-split

Conversation

@papperrollinggery

@papperrollinggery papperrollinggery commented Sep 6, 2026

Copy link
Copy Markdown
Owner

LazyBrain 2.1 could route a screenplay/Seedance lookup to agent-development merely because the query contained “Skill”, and built-in recipes or cached configuration could appear to be installed capabilities. Version 3.0 makes the product a source-aware local lookup companion: Codex uses known native capabilities directly and consults LazyBrain only for unresolved discovery or a requested inventory.

Changes:

  • Advertise two read-only MCP tools with bounded source/path results, project scope, platform filtering, freshness, and explicit discovery evidence.
  • Keep real capability identities, Chinese/domain matching, disabled/listed audit entries, and explicit-only Skill policy; remove implicit prompt-history writes, invented usage/savings, automatic workflow/hook injection, and default visualization overhead.
  • Bundle the local runtime with zero runtime dependencies; repair metadata-only traversal, YAML/TOML parsing, snapshot writes, and JSON-RPC handling.
  • Preserve the retired development branches as merge ancestors without reviving their obsolete implementation trees. Remove obsolete public operational notes and the second lockfile while preserving local copies/recovery material.

Validation:

  • Full local verify: 203 tests, type check, build, plugin validation, public-content audit, and offline tarball CLI/MCP smoke passed.
  • Independent review identified four boundary defects; all were reproduced, fixed, and independently rechecked (63 targeted tests).
  • Codex CLI 0.153.4 with requested gpt-6-astra / max completed three fresh fixture runs: lookup then use the Skill; use a known entry without routing; answer an ordinary question without routing. Current runtime hashes match those runs.
  • A fresh Codex app-server read back the installed 3.0.0 Skill and the packaged server’s two tool schemas.
  • npm audit reports zero vulnerabilities. Node 18/20/22/24 CI is required before merge.

Compatibility: recommendation schema is v2; MCP calls require an absolute cwd; built-ins are explicit demo recipes; old hook registrations now continue without injection or writes. Metadata discovery is not proof of current-task callability or media/deployment success. Rollback is the v2.1.0 release; existing user data is not migrated by normal lookup.

The first Node 18 CI run exposed repeated metadata tokenization (212.8ms/lookup in the 1,000-entry benchmark). A reviewed WeakMap cache now reuses unchanged metadata while revalidating all scoring inputs and current eligibility; the original 200ms gate is unchanged.

Slim the current branch to verified route, MCP, compile, embeddings, ready, status, and diagnostics paths.

Remove unfinished choices, adoption, regression, public jobs, repairs, doctor-fix, config-test/schema, Cytoscape UI, and planning docs.
Preserve the previously squashed desktop work and retired route/compile experiments as ancestors of the 3.0 mainline. Their useful discovery and evidence principles are implemented in the reviewed 3.0 tree; obsolete workbench, LLM routing, and automatic hook implementations remain retired.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 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-09-06T18:43:32.211461Z 9cd8e91 PR opened
ℹ️ 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: 9cd8e917ad

ℹ️ 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/matcher/terms.ts

export function positiveSearchText(query: string): string {
return query.replace(/(?:不要|不需要|无需|别|不生成)[^,。;,;.!?]*/gu, ' ')
.replace(/\b(?:without|do not|don't)\b[^,;.!?]*/giu, ' ').trim();

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 Preserve positive clauses after negations

When a query puts the desired task after a negated alternative without punctuation—for example, do not generate images but analyze video—this regex consumes everything from do not through the end, leaving no search terms and causing recommend to clarify or return no match instead of finding video-analysis capabilities. Stop negated spans at contrast conjunctions such as but/, or otherwise retain the positive trailing clause.

Useful? React with 👍 / 👎.

Comment thread src/scanner/scanner.ts
Comment on lines +119 to +120
try { stat = statSync(child); } catch { continue; }
if (stat.isDirectory()) {

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 Keep recursive scans inside configured roots

When a configured metadata root contains a directory symlink, statSync(child) follows it and the traversal recursively scans the target without checking that its real path remains under the original root. A symlink to a workspace parent or home directory can therefore make an ordinary lookup read and surface Skill, plugin, MCP, agent, or command metadata outside the advertised scan roots; reject escaping directory symlinks or constrain every visited real path to the resolved root.

Useful? React with 👍 / 👎.

@papperrollinggery
papperrollinggery merged commit 4bf6d26 into main Sep 6, 2026
10 checks passed
@papperrollinggery
papperrollinggery deleted the codex/lazybrain-route-compile-split branch September 6, 2026 18:48
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