feat: story regression foundation - @pytest.mark.story marker + traceability API (#1699)#1713
Open
prompt-driven-github[bot] wants to merge 1 commit into
Open
feat: story regression foundation - @pytest.mark.story marker + traceability API (#1699)#1713prompt-driven-github[bot] wants to merge 1 commit into
prompt-driven-github[bot] wants to merge 1 commit into
Conversation
…ability API (#1699) Add the deterministic, marker-traceable pytest story regression foundation: new story_regression_python.prompt, a public story_id identity helper in user_story_tests, and an orthogonal per-story has_regression_test dimension in coverage_contracts. Co-Authored-By: Claude Opus 4 <[email protected]>
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
Establishes the story-regression foundation for EPIC #1698: a deterministic, marker-traceable pytest oracle that links
user_stories/story__*.mdfiles to runnable regression tests via a@pytest.mark.storymarker and a bidirectional story↔test traceability API. No test generation yet (that is sub-issue 2).Closes #1699
Changes Made
Prompts Modified
pdd/prompts/story_regression_python.prompt(NEW) - deterministic, marker-traceable pytest oracle (pdd/story_regression.py). Builds a bidirectionalstory_id ↔ {nodeid}map via apytest --collect-onlyplugin; exposestests_for_story,story_for_test, andhas_regression_test; detects both orphan directions. No LLM, no test execution.pdd/prompts/user_story_tests_python.prompt- promotes the private_slug_from_story_path()slug extractor to a public, documentedstory_idhelper so the marker mechanism and story files share one identity space. Purely additive; LLM-oracle flow unchanged.pdd/prompts/coverage_contracts_python.prompt- adds an orthogonal, story-keyedhas_regression_testdimension (true when ≥1 collected test claims the story via the marker), computed by queryingstory_regression.tests_for_story. Existing rule-keyed (test_R<n>) statuses and priority are untouched.Direct Edits (no originating prompt)
pytest.ini- registers thestory(story_id)marker alongsidee2e/integration/slow/real/private_promptsopytest -m storyselects exactly the marked tests with noPytestUnknownMarkWarning.Documentation Updated
docs/coverage_contracts.md- new "Story regression coverage" section + Rule-fields note.docs/generating_user_stories.md- new "Story regression tests (@pytest.mark.story)" section + Quick-reference row.README.md- one-clause coverage-matrix pointer.Other
architecture.json- updated to reflect the newstory_regressionmodule.User Stories
warnuser_stories/story__coverage_contracts_story_regression_user_story_tests.md— issue-derived story linked to:coverage_contracts_python.prompt,story_regression_python.prompt,user_story_tests_python.promptuser_stories/contracts/coverage_contracts_story_regression_user_story_tests.contract.md— generated machine-checkable contractuser_stories/story__coverage_contracts_story_regression_user_story_tests.mdReview Checklist
Next Steps After Merge
pytest -m storyshould select exactly the story-backed regression tests)Created by pdd change workflow