Skip to content

Feat/add dogfooding demo - #26

Merged
bartrosa merged 12 commits into
mainfrom
feat/add-dogfooding-demo
May 26, 2026
Merged

bartrosa merged 12 commits into
mainfrom
feat/add-dogfooding-demo

Conversation

@bartrosa

Copy link
Copy Markdown
Owner

Summary

This branch adds the first dogfood workspace and the foundations for mining any Python repo with pickled-spec. You can inventory a target project, generate a mining report, and run multi-ruleset coverage in workspaces that do not keep features under a flat features/ tree. The dogfood area holds hand-written stories, seed rulesets, and the first end-to-end loop output (bdd-drafter).

What’s in the branch

New top-level command group with six subcommands. Implemented today:

  • mine inventory — introspects a target repo (CLI via Click, optional MCP tools, gates via AST, ADRs, workspaces) and writes inventory.json under --output
  • mine report — renders mining-report.md from whatever stage outputs exist
  • mine all — runs inventory → report (full pipeline wiring comes in follow-up PRs)

Stubbed (exit 2 with a clear message): stories, features, tag, evaluate (Phases 8b/8c).

  • Library core lives in pickled_core.mine (inventory_lib, inventory_stage, report_stage, io, types)
  • scripts/inventory_functionality.py now delegates to the same library (same JSON shape as before)
  • Optional extra: pickled-core[mine] → pickled-bdd, pickled-rules
  • Fixture: packages/pickled-core/tests/fixtures/tiny_target/ (minimal Click CLI for pipeline tests)

Multi-ruleset workspaces (pickled-rules)

  • pickled.ruleset.yaml accepts rulesets: (list) in addition to singular ruleset:
  • One coverage gate per ruleset: rules.coverage.<short_name> (single ruleset keeps rules.coverage)
  • Tests in test_gates_runner_multi.py; README + docs/mcp.md updated

Dogfood workspace

  • Stories: nine .story.md files under dogfood/bdd/stories/ describing pickled-spec surfaces (drafter, ambiguity, coverage, check-all, etc.)
  • Rulesets: ten seed YAML files under dogfood/rulesets/ + dogfood/pickled.ruleset.yaml
  • Inventory: dogfood/inventory_schema.json, generated inventory.json / inventory.md (gitignored where appropriate)
  • First loop artifact: dogfood/bdd/features/bdd_drafter.feature (tagged), dogfood/FRICTION.md session log, dogfood/runs/ for session logs
  • Docs: dogfood/README.md explains layout and how to regenerate inventory

Other

  • .gitignore entries for generated dogfood inventory and mining outputs
  • pickled.config.yaml / lockfile tweaks aligned with local dev setup

What’s intentionally not in this PR

  • Mine stages 2–5 (LLM stories, feature drafting, tagging, evaluate) — stubs only
  • pickled-bdd ambiguity CLI alias and feature_glob: in pickled.ruleset.yaml — tracked from dogfood friction; separate small PR
  • AmbiguityGate tuning
  • New MCP tools for mine (CLI-first by design)

How to review

uv sync --extra mcp
uv run pytest -q packages/pickled-core/tests/test_mine_*.py \
                 packages/pickled-rules/tests/test_gates_runner_multi.py

pickled-spec mine --help
pickled-spec mine inventory packages/pickled-core/tests/fixtures/tiny_target/ \
  --output /tmp/m_inv/ --no-mcp
pickled-spec mine report /tmp/m_inv/ --output /tmp/m_inv/

# Multi-ruleset (example workspace still uses singular ruleset; dogfood uses plural)
uv run pickled-spec check-all --workdir dogfood/ --warn-ok

Note: Dogfood expects features under dogfood/features/ (symlink features → bdd/features may exist locally). Until feature_glob: lands, check-all on dogfood/ may WARN on coverage if only bdd/features/ is populated.

Follow-ups

  1. Mine 8b — stories, features, tag stages + story_from_inventory.md prompt
  2. Mine 8c — evaluate, full mine all, docs/mining.md, ADR, friction fixes (ambiguity alias, feature_glob:)
  3. Dogfood — remaining eight stories through the semi-automatic loop (one story per session)

bartrosa added 12 commits May 25, 2026 19:32
- Introduced a new `_RulesetEntry` dataclass to encapsulate ruleset path and short name.
- Added `_resolve_ruleset_entries` function to validate and resolve ruleset configurations from `pickled.ruleset.yaml`.
- Updated `run_all` function to handle multiple rulesets, returning results for each entry with appropriate verdicts.
- Implemented comprehensive tests for multi-ruleset scenarios, including validation for exclusive keys, duplicate short names, and missing ruleset files.
- Enhanced `mcp.md` to document the new `rulesets:` list feature in `pickled.ruleset.yaml`, allowing multiple rule sets to be enforced in parallel.
- Added a new decision document `0004-multi-ruleset-workspace.md` outlining the rationale and implications of supporting multi-ruleset configurations.
- Updated `README.md` in `packages/pickled-rules` to reflect the new workspace configuration options for single and multiple rulesets, including examples and usage details.
- Added a new mining pipeline in `pickled-core` with stages for inventory introspection and report generation.
- Introduced `run_inventory` function to introspect target projects and generate `inventory.json`.
- Created `run_report` function to render a markdown report from mining outputs.
- Implemented CLI commands for inventory and report stages, enhancing usability for mining operations.
- Established shared types for inventory results and mining paths to streamline data handling.
- Added the `mine` command to the CLI for enhanced mining functionality.
- Updated `pyproject.toml` to include dependencies for `pickled-bdd` and `pickled-rules`, ensuring necessary components are available for mining operations.
- Introduced tests for the `mine` command in the CLI, verifying help output and inventory generation.
- Added tests for the inventory stage, ensuring correct handling of target projects and command outputs.
- Implemented tests for the report stage, confirming the presence of CLI commands in generated reports.
- Introduced a new `tiny-target` package as a fixture for mine inventory tests.
- Added a minimal Click-based CLI with `greet` and `ping` commands for testing purposes.
- Created `pyproject.toml` to define package metadata and dependencies.
- Introduced a new script `inventory_functionality.py` to handle inventory generation for pickled-spec CLI commands, MCP tools, gates, ADRs, and workspaces.
- Implemented command-line argument parsing for output formats (JSON and Markdown) and sections to include.
- Added functions to render inventory data in Markdown format and to write output to specified directories or stdout.
- Integrated logging for error handling and information during execution.
- Introduced multiple new YAML rulesets for different domains including BDD, best practices, core, data, diff, IaC, OSS hygiene, internal invariants, rules, and schema.
- Each ruleset includes metadata and specific rules with enforcement levels, aimed at standardizing practices across the pickled-spec ecosystem.
- Rules cover aspects such as observable outcomes, feature requirements, validation, and hygiene checks, enhancing the overall framework for development and compliance.
- Introduced multiple BDD stories in the `dogfood/bdd/stories/` directory, covering key functionalities of the pickled-spec framework, including ambiguity checks, Gherkin drafting, rules coverage, schema validation, and data migration drift.
- Each story outlines the context, current implementation, verification criteria, and open questions, serving as a comprehensive specification for future development and testing.
- The stories aim to enhance understanding and facilitate testing of the various components within the pickled-spec ecosystem.
- Introduced a new feature file `bdd_drafter.feature` containing multiple scenarios for drafting Gherkin features from well-formed user stories via CLI and MCP.
- Scenarios cover various cases including handling empty stories, identical submissions, and ensuring consistent output between CLI and MCP.
- Added specifications for LLM call behavior and output structure, enhancing the BDD workflow for developers and agents.
- Created the `dogfood` directory to facilitate the development and testing of the pickled-spec framework.
- Added `FRICTION.md` to log observations from dogfood sessions, capturing insights and issues encountered.
- Introduced `inventory_schema.json` to define the structure and requirements for the inventory functionality.
- Established `pickled.ruleset.yaml` to outline various rulesets for different domains.
- Included a symlink for `features` to support BDD feature drafting.
- Updated `README.md` to provide an overview of the directory's purpose and contents.
…inventory management

- Added `.pickled-cache` directory to `.gitignore` for cache management.
- Updated `pickled.config.yaml` to include cache directory settings and budget constraints for cost management.
- Enhanced `uv.lock` to include new dependencies for `pickled-bdd` and `pickled-rules`, improving the mining command functionality.
@bartrosa
bartrosa merged commit 6fb21e2 into main May 26, 2026
0 of 4 checks passed
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