feat(brainstormer): product-vision discovery + schema (#122)#127
Merged
hadamrd merged 2 commits intoMay 28, 2026
Conversation
Introduces a typed, validated "north star" loader for the Product Brainstormer (epic #121). Without an explicit vision + axes, the brainstormer used to silently fabricate direction; this layer makes that impossible. * New ``forge_loop.product_vision`` module exposing ``Axis``, ``ProductVision``, ``MissingVisionError``, and ``discover()``. * Pydantic v2 models with ``acceptable_work`` min_length=1, ``axes`` min_length=1, and ``extra='ignore'`` on axis entries for forward-compat. * ``discover()`` reads ``<repo>/.forge/product-vision.md`` and ``.forge/axes.yaml``, returning a typed object or raising ``MissingVisionError`` with the offending absolute path and a specific reason for each failure mode (missing vision, missing axes, YAML parse failure, schema error with field path, empty vision, empty axes list, empty acceptable_work). * Twelve tests covering happy paths, every documented sad path, the no-``.forge/``-at-all case, symlinked ``.forge/``, and forward-compat extra keys.
…n/ (#122) The .forge/ pattern is gitignored at repo root; force-add the fixture tree so CI sees the same files the local pytest run did.
Owner
Author
|
Source issue #122 was closed mid-flight (state: closed). Loop refusing auto-merge. Reopen the issue OR merge manually. |
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.
Closes #122. Part of epic #121.
Summary
src/forge_loop/product_vision.pywithAxis,ProductVision,MissingVisionError,discover().acceptable_workandaxesaremin_length=1; axes accept extra keys (forward-compat).discover(repo_path)reads<repo>/.forge/product-vision.md+.forge/axes.yaml, returns a typedProductVision, raisesMissingVisionErrorwith a specific reason + absolute path on any failure.Acceptance criteria mapping
Axisrequired fields + min-length constraint onacceptable_work.ProductVisionholds rawvision_markdown+ non-emptyaxes.discover()returns the object on success; missing/invalid raises.vision markdown is empty.__init__.pyleft untouched — existing pattern does not re-export public submodules wholesale.Tests
tests/test_product_vision.py(12 tests, all passing):valid_minimal,valid_full(incl. verbatim markdown round-trip).missing_vision,missing_axes,empty_vision,invalid_axes_yaml,invalid_axes_schema(missingcustomer),empty_axes_list,acceptable_work_empty..forge/at all →MissingVisionError(noFileNotFoundErrorleak); symlinked.forge/resolves; extra unknown keys on axes are ignored.Fixtures are force-added because the repo
.gitignoreexcludes.forge/.