Feat/add spec mining - #28
Merged
Merged
Conversation
- Introduced multiple new stages for the mining pipeline, including code extraction, feature drafting, and evaluation. - Added error handling classes for actionable messages during the mining process. - Implemented functionality to parse and collect ADRs, enriching gate documentation with summaries. - Enhanced CLI commands to support new features and improved inventory management. - Created new utility functions for managing code context and handling cycles in the mining process.
- Introduced `feature_glob` option in the configuration to specify the location of feature files relative to the workspace root, defaulting to `features/**/*.feature`. - Updated the `gates_runner.py` to utilize the `feature_glob` setting for locating feature files. - Enhanced the README.md to document the new `feature_glob` configuration and its usage. - Added tests to verify the functionality of default and custom `feature_glob` settings.
- Introduced ADRs for the pickled-diff package, cache and budget management, and workspace layout. - Added new packages for callgraph and resolver tests, including various modules and CLI functionalities. - Created minimal fixtures for testing, including a tiny target package with a basic CLI. - Updated project configurations to support new package structures and dependencies.
- Consolidated ambiguity gate logic into a dedicated function `run_ambiguity_gate` for improved clarity and reusability. - Updated the `check` command to utilize the new function, maintaining backward compatibility with an alias for the ambiguity gate. - Enhanced JSON output formatting for gate results and added exit handling based on verdicts. - Improved feature drafting by stripping markdown fences from generated text, ensuring cleaner output. - Added tests to verify the equivalence of the `ambiguity` command to the `check` command with the ambiguity gate.
- Integrated `strip_markdown_fence` function to clean up generated text in the `MigrationDrafter` class. - Updated the output handling to ensure cleaner and more readable results from the drafting process.
- Added `strip_markdown_fence` function to clean up generated text in the `CorpusDrafter` class. - Updated output handling to ensure cleaner and more readable results from the drafting process.
- Added `strip_markdown_fence` to clean up LLM output in the `OpenAPIDrafter` class. - Updated YAML loading to ensure cleaner and more structured results from the drafting process.
- Replaced manual markdown fence handling with `strip_markdown_fence` in the `IaCDrafter` class. - Enhanced the output from the LLM by ensuring cleaner Terraform HCL results without unnecessary fences or commentary.
- Integrated `enrich_inventory_data` function to enhance the payload generated in the `main` function of `inventory_functionality.py`. - Improved data handling for better inventory management and output consistency.
- Added comprehensive documentation for the `pickled-spec mine` pipeline, detailing its stages and usage. - Introduced a new `mining.md` file outlining the mining process and commands for extracting behavioral specifications from Python repositories. - Documented the `code` stage for static code reading, enhancing story generation with observed code and enabling drift detection against docstrings. - Established ADRs for the mining pipeline decisions, including code reading and code-aware story generation, to ensure clarity and future reference.
- Introduced new JSON and Markdown files for mining output, including `inventory.json`, `mining-report.md`, and `tags-proposals.json`. - Added detailed code context files for various surfaces, enhancing traceability and understanding of the mining process. - Implemented a structure for tracking cycles and code definitions, improving the overall mining pipeline documentation and output.
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
Introduces a seven-stage mining workflow on
pickled-specthat turns a Python repo into inventory, code context, stories, Gherkin features, rule tags, and evaluation reports. Dogfoods the pickled monorepo underdogfood/mining-output/.Also fixes several friction items discovered during dogfood runs: line-based tag injection, call-graph resolver robustness, and defensive stripping of LLM markdown fences before structured parsing.
What's new
Mining CLI (
pickled-spec mine)mine inventoryinventory.jsonmine codecode-context/*.mdmine storiesstories/*.story.mdmine featuresfeatures/*.featuremine tagtags-proposals.json+ in-file tagsmine evaluateevaluation/coverage.json,ambiguity.jsonmine reportmining-report.mdmine allruns the full pipeline;--quick/--interactive,--surfaces,--overwrite-*supported.body/callgraphdepth,--max-hopsdefault 2, cycle detection, callee caps.code-context/and can surface docstring drift.docs/mining.md, ADRs0005–0007.LLM output hardening (friction #17)
pickled_core.llm.sanitize.strip_markdown_fence.IaCDrafter.packages/pickled-core/tests/test_llm_sanitize.py(unit + per-drafter canned-LLM cases).Tag injection fix (friction #16)
Scen@tag/enario:corruption; evaluate skips unparseable features with warnings.Resolver / inventory
Literal[...]and typing annotations in import resolution.tests/fixtures/resolver_zoo/.Other
py.typedonpickled-bddfor mypy whenpickled-coreimports BDD types.feature_globconfiguration for flexible feature paths.gates_runnermulti-ruleset improvements.Dogfood impact
On existing
dogfood/mining-output/before fence-strip:error: 2 (features starting with```)Remaining
fail/warnverdicts are scenario-quality / gate calibration, not parse corruption.Test plan
Notes for reviewers
dogfood/mining-output/artifacts; focus review onpackages/pickled-core/src/pickled_core/mine/, drafters, and tests.strip_markdown_fenceis intentionally not applied to rationale / advisor prose fields.uv run ruff check packages/may still surface pre-existing issues outside this branch’s touched paths.