Skip to content

feat(foraging): add indexer, storage-aware scanExamples, settings#43

Merged
NagyVikt merged 1 commit intomainfrom
agent/claude/add-foraging-indexer-and-storage-aware-s-2026-04-24-11-47
Apr 24, 2026
Merged

feat(foraging): add indexer, storage-aware scanExamples, settings#43
NagyVikt merged 1 commit intomainfrom
agent/claude/add-foraging-indexer-and-storage-aware-s-2026-04-24-11-47

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Automated by gx branch finish (PR flow).

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 NagyVikt merged commit 90bc096 into main Apr 24, 2026
@NagyVikt NagyVikt deleted the agent/claude/add-foraging-indexer-and-storage-aware-s-2026-04-24-11-47 branch April 24, 2026 09:59
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>
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