Fix/additional polishing - #25
Merged
Merged
Conversation
- Introduced `setup_local_dev.py` to streamline onboarding for local development. - The script generates a `pickled.config.yaml`, merges MCP server entries into Cursor config, and optionally runs a smoke test. - Enhances the development experience by automating configuration tasks and ensuring necessary dependencies are in place.
- Removed the manual handling of the `PICKLED_BDD_LLM_FACTORY` environment variable in favor of a streamlined `build_default_client` function. - Updated `_build_llm_client` in both `cli.py` and `mcp_cli.py` to enhance clarity and reduce complexity in LLM client initialization. - Improved error handling by maintaining the existing `ConfigError` management, ensuring robust client setup.
- Added a new `draft-corpus` command to the CLI for expanding seed examples into a larger differential corpus. - Introduced `CorpusDrafter` class to handle the drafting process, utilizing an LLM client for generating corpus items. - Enhanced `register_with_fastmcp` to integrate the drafting functionality, allowing for LLM-driven corpus generation within the MCP framework. - Improved error handling and output management for the drafting process, ensuring robust user feedback and experience.
- Introduced a new JSON fixture file `seed_corpus.json` containing sample payloads for testing the corpus drafting functionality. - The fixture includes examples for an empty payload, an ASCII word, and a Unicode string, enhancing test coverage for various input scenarios.
- Introduced new test files for the CLI draft-corpus command and the CorpusDrafter class, ensuring robust testing of the corpus drafting functionality. - Implemented tests for various scenarios, including successful drafting, handling warnings for invalid input, and managing exceptions, enhancing overall test coverage and reliability. - These additions support ongoing development and validation of the pickled-diff CLI and drafting functionalities.
…uctions - Expanded the README to include detailed descriptions of the `verify_against_oracle` and `draft_corpus_from_examples` MCP tools. - Added a new section with usage instructions for the `draft-corpus` command, enhancing user guidance for corpus drafting. - Improved clarity on input handling for seed examples and notes, ensuring better understanding of the command's functionality.
- Introduced `pickled.config.yaml` to store configuration for the anthropic provider, including the default model and API key environment variable. - This addition supports the local development environment by providing necessary settings for the anthropic integration.
- Updated the `_build_llm_client` function to utilize `build_default_client` for improved clarity and reduced complexity. - Removed the manual handling of the `PICKLED_SCHEMA_LLM_FACTORY` environment variable, enhancing the client creation process. - Maintained existing error handling for configuration issues, ensuring robust client setup.
- Added `.pickled-cache/` to the .gitignore file to prevent caching files from being tracked. - Retained existing entry for `.cursor/` to ensure proper exclusion of cursor-related files.
- Added `pickled-core` with extras `all-providers` and `mcp` to both `pyproject.toml` and `uv.lock` files. - This update ensures the inclusion of necessary features and providers for enhanced functionality.
- Updated `mcp.md` to include details on LLM-backed tools in `pickled-rules`, `pickled-data`, and `pickled-diff`, highlighting the integration of cache and budget settings. - Added a new section on response caching, budget caps, and model resolution, providing examples of configuration in `pickled.config.yaml`. - Introduced two new decision documents outlining the rationale for implementing cache and budget features, ensuring clarity on their usage and benefits.
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.
Summary
Polishes the monorepo for local MCP/LLM dogfooding and adds corpus drafting to pickled-diff. Introduces a one-shot setup script, documents cache/budget/model behaviour, records ADRs, and aligns bdd/schema/diff MCP CLIs with
build_default_client(requires pickled-core bootstrap fromfeat/update-pickled-core).Changes
Local development onboarding
scripts/setup_local_dev.py— stdlib script that:pickled.config.yaml(provider, model, API key env)pickled-specMCP entry into Cursor config (project or global)scripts/smoke_mcp_stdio.pypickled.config.yaml— generated template for local dogfood (not committed secrets).Documentation and ADRs
docs/mcp.md— cache/budget/model section, env overrides, umbrella tool reference table (rules_*,data_*,diff_*,iac_*, etc.).docs/decisions/0002-cache-and-budget-in-pickled-config.md— cache and budget in YAML.docs/decisions/0003-cache-budget-and-model-resolution.md— model resolution andbuild_default_clientwiring.pickled-diff: corpus drafting
CorpusDrafter— expands seed{"name", "payload"}examples to a target corpus size (JSON output,---RATIONALE---split).pickled-diff draft-corpus—--seeds,--target-size, optional--notes,-o/--output.draft_corpus_from_examples— wired when LLM is configured; stub otherwise.check-allnote.MCP / CLI consistency (bdd, schema, diff)
importlib+build_clientwithbuild_default_client/pickled_core.mcp.llm_client(build_llm_client,optional_llm_client).pickled-bddcli.pyandmcp_cli.py— same bootstrap pattern.pickled-schemamcp_cli.py— optional LLM for umbrella mount.Repo hygiene
.gitignore—.pickled-cache/pyproject.toml/uv.lock— dev depspickled-core[all-providers]andpickled-core[mcp]for tests and smoke runs.Test plan
uv sync uv run pytest -q packages/pickled-diff/tests/test_drafter.py \ packages/pickled-diff/tests/test_cli_draft.py \ packages/pickled-diff/tests/test_mcp_tools.py # Local onboarding (dry-run) uv run python scripts/setup_local_dev.py --dry-run # MCP smoke uv sync --extra mcp uv run python scripts/smoke_mcp_stdio.py # Corpus draft with test factory export PICKLED_DIFF_LLM_FACTORY=pickled_bdd.testing:build_fake_llm uv run pickled-diff draft-corpus \ --seeds packages/pickled-diff/tests/fixtures/seed_corpus.json \ --target-size 5