Conversation
Closes the foraging loop end-to-end. CLI (`@imdeadpool/colony-cli`): - `colony foraging scan [--cwd <path>]` — synchronous scan and re-index. Respects every `settings.foraging.*` limit (maxDepth / maxFileBytes / maxFilesPerSource / extraSecretEnvNames) and prints a one-line summary with the counts. - `colony foraging list [--cwd <path>]` — prints the cached `examples` rows. - `colony foraging clear [--example <name>] [--cwd <path>]` — drops rows plus their foraged-pattern observations. The reserved `foraging` session owns every foraged-pattern observation (fixed session id, not per-invocation) so session-wide cleanup stays trivial. Hooks (`@colony/hooks`): - `sessionStart` detach-spawns `colony foraging scan --cwd <cwd>` via `@colony/process#spawnNodeScript` when `settings.foraging.enabled` and `scanOnSessionStart` are both true. Hook never waits — the preface surfaces state from previous scans only, preserving the 150 ms p95 budget. - New `buildForagingPreface(store, input)` renders a compact "## Examples indexed (foraging)" block with up to 5 example names, an overflow count, and a pointer at `examples_query` / `examples_integrate_plan`. Foraging is now usable end-to-end without any manual setup: drop example projects into `<repo_root>/examples/`, open a new session, and the scanner indexes them in the background while the next SessionStart surfaces them in the preface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
NagyVikt
added a commit
that referenced
this pull request
Apr 24, 2026
…_plan (#46) Fills the contract gap between the merged foraging PRs (#41, #43, #44, #45) and CLAUDE.md's 'new MCP tool → update docs/mcp.md' rule. Each entry lists inputs, return shape, and the non-obvious semantics (vector re-rank skipped when filter is set; dependency_delta only computed for npm; target_hint path resolution). Co-authored-by: NagyVikt <nagy.viktordp@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated by gx branch finish (PR flow).