Conversation
Wires the foraging pipeline from fs discovery to persisted
observations:
- `indexFoodSource(food, store, opts)` turns a `FoodSource` into 1–N
`foraged-pattern` observations (manifest, README, entrypoints,
filetree). Every write goes through `MemoryStore.addObservation` so
the redact → compress → persist contract is preserved, and env-style
secret assignments are scrubbed first by `redact`.
- `scanExamples({ repo_root, store, session_id, limits?, extra_secret_env_names? })`
diffs each discovered source's `content_hash` against the cached
`examples` row; re-indexes only when changed, clears stale
observations via the new `Storage.deleteForagedObservations`, then
upserts the row with the new hash + observation count.
Storage helpers so no other package opens the DB:
- `deleteForagedObservations(repo_root, example_name): number`
- `listForagedObservations(repo_root, example_name): ObservationRow[]`
New `settings.foraging` block gated by `enabled: true` with
`maxDepth: 2`, `maxFileBytes: 200_000`, `maxFilesPerSource: 50`,
`scanOnSessionStart: true`, `extraSecretEnvNames: []`. `colony config
show` / `settingsDocs()` pick it up automatically.
MCP tools, CLI commands, and the SessionStart hook wiring arrive in
the next PR.
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).