Skip to content

feat(foraging): add @colony/foraging package skeleton#41

Merged
NagyVikt merged 2 commits intomainfrom
agent/claude/add-colony-foraging-package-with-example-2026-04-24-11-29
Apr 24, 2026
Merged

feat(foraging): add @colony/foraging package skeleton#41
NagyVikt merged 2 commits intomainfrom
agent/claude/add-colony-foraging-package-with-example-2026-04-24-11-29

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Automated by gx branch finish (PR flow).

NagyVikt and others added 2 commits April 24, 2026 11:37
Adds an `examples` table keyed on (repo_root, example_name) that caches
each `<repo_root>/examples/<name>` food source's content hash, manifest
kind, and cached observation count. Repeat SessionStart scans can then
skip unchanged directories without touching the observation table.

New methods on `Storage`: `upsertExample`, `getExample`, `listExamples`,
`deleteExample`. Schema version bumped 6 → 7.

Foundation for the upcoming `@colony/foraging` package; no callers yet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pure-fs primitives for foraging example directories: scanner,
extractor, redact, and shared types. No storage writes or MCP wiring
yet — those arrive in the follow-up so this layer can be unit-tested
without pulling in MemoryStore.

- `scanExamplesFs({ repo_root, limits? })` discovers direct children of
  `<repo_root>/examples/` and returns classified `FoodSource[]` with a
  stable content_hash over manifest bytes + sorted (path, size) pairs.
- `extract(abs_path, limits)` walks a single example with depth/size
  caps, detecting `npm` / `pypi` / `cargo` / `go` / `unknown` manifests
  and picking up README + canonical entrypoints.
- `redact(text, extraEnvNames?)` scrubs common cloud-service secret
  assignments and armored PEM private-key blocks before content hits
  storage.

Public API, types, and constants re-exported from the package index.
20 unit tests across scanner / extractor / redact.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@NagyVikt NagyVikt merged commit beaf0f4 into main Apr 24, 2026
@NagyVikt NagyVikt deleted the agent/claude/add-colony-foraging-package-with-example-2026-04-24-11-29 branch April 24, 2026 09:45
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