LazyBrain 3.0: simplify local capability discovery for Codex - #26
Conversation
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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
|
|
||
| export function positiveSearchText(query: string): string { | ||
| return query.replace(/(?:不要|不需要|无需|别|不生成)[^,。;,;.!?]*/gu, ' ') | ||
| .replace(/\b(?:without|do not|don't)\b[^,;.!?]*/giu, ' ').trim(); |
There was a problem hiding this comment.
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 👍 / 👎.
| try { stat = statSync(child); } catch { continue; } | ||
| if (stat.isDirectory()) { |
There was a problem hiding this comment.
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 👍 / 👎.
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:
Validation:
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.