-
Notifications
You must be signed in to change notification settings - Fork 1
feat(requirements): validate native source readiness #649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
5 changes: 5 additions & 0 deletions
5
openspec/changes/requirements-04-upstream-source-readiness/.openspec.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| schema: spec-driven | ||
| created: 2026-07-14 | ||
| goal: Provide a core-owned, deterministic source-readiness contract that | ||
| protects evidence integrity without creating an upstream authoring schema or | ||
| hard runtime dependency. |
59 changes: 59 additions & 0 deletions
59
openspec/changes/requirements-04-upstream-source-readiness/CHANGE_VALIDATION.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Change Validation Report: requirements-04-upstream-source-readiness | ||
|
|
||
| **Validation Date**: 2026-07-17 Europe/Berlin | ||
| **Change Proposal**: [proposal.md](./proposal.md) | ||
| **Validation Method**: Interface dry run in `/private/tmp/specfact-validation-requirements-04`, dependency search, strict OpenSpec validation, focused tests, and repository quality-gate verification. | ||
|
|
||
| ## Executive Summary | ||
|
|
||
| - Breaking Changes: 0 detected | ||
| - Dependent Files: 3 affected | ||
| - Impact Level: Medium | ||
| - Validation Result: Pass | ||
| - User Decision: Resolved the readiness policy as `validation.openspec.require_native_validation`; the enterprise tier defaults it to `true`, and the compatibility fixture is pinned to Spec Kit `v0.12.18`. | ||
|
|
||
| ## Breaking Changes Detected | ||
|
|
||
| None. `import_openspec_change` adds optional keyword-only `profile` and | ||
| `project_root` parameters, preserving its existing one-argument call contract. | ||
|
|
||
| ## Dependencies Affected | ||
|
|
||
| ### Critical Updates Required | ||
|
|
||
| - `src/specfact_cli/requirements/importers.py`: add atomic readiness gates before normalization. | ||
| - `src/specfact_cli/requirements/context.py`: resolve the layered native-validation policy. | ||
|
|
||
| ### Recommended Updates | ||
|
|
||
| - `tests/unit/requirements/test_upstream_evidence_imports.py`: fixture-backed source-readiness and policy tests. | ||
| - `docs/reference/requirements-context-adapter.md`: document diagnostics and layered policy behavior. | ||
|
|
||
| ## Impact Assessment | ||
|
|
||
| - **Code Impact**: Read-only source import behavior becomes fail-closed for incomplete inputs; accepted source IDs, revisions, and scenarios remain unchanged. | ||
| - **Test Impact**: Native importer and profile-resolution regression coverage. | ||
| - **Quality-Gate Impact**: The workflow uses the configured line-coverage threshold and propagates quality-gate failures through its log pipeline. | ||
| - **Documentation Impact**: Requirements adapter reference documents readiness diagnostics and policy configuration. | ||
| - **Release Impact**: Minor feature; version/release work remains a delivery task after this PR is accepted. | ||
|
|
||
| ## Format Validation | ||
|
|
||
| - **proposal.md Format**: Pass under repository strict OpenSpec validation. | ||
| - **tasks.md Format**: Pass; tests precede production edits and evidence is recorded in `TDD_EVIDENCE.md`. | ||
| - **specs Format**: Pass; scenarios cover incomplete sources, required validator failure, unavailable validators, and portable imports. | ||
| - **Config.yaml Compliance**: Pass. | ||
|
|
||
| ## OpenSpec Validation | ||
|
|
||
| - **Status**: Pass | ||
| - **Command**: `openspec validate requirements-04-upstream-source-readiness --strict --json` | ||
| - **Issues Found/Fixed**: 0 | ||
|
|
||
| ## Validation Artifacts | ||
|
|
||
| - Temporary interface workspace: `/private/tmp/specfact-validation-requirements-04` | ||
| - Failing-before and passing-after commands: [TDD_EVIDENCE.md](./TDD_EVIDENCE.md) | ||
| - The sibling internal repository is available, but it has no | ||
| `wiki/sources/requirements-04-upstream-source-readiness.md` mirror to update; | ||
| create that tracking page before release coordination if it becomes required. |
3 changes: 3 additions & 0 deletions
3
openspec/changes/requirements-04-upstream-source-readiness/README.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # requirements-04-upstream-source-readiness | ||
|
|
||
| Reject incomplete or policy-invalid native OpenSpec and Spec Kit sources before normalizing requirements evidence. |
42 changes: 42 additions & 0 deletions
42
openspec/changes/requirements-04-upstream-source-readiness/TDD_EVIDENCE.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # TDD Evidence: requirements-04-upstream-source-readiness | ||
|
|
||
| ## Failing-before | ||
|
|
||
| - **Date:** 2026-07-17 (Europe/Berlin) | ||
| - **Command:** `hatch run test -- tests/unit/requirements/test_upstream_evidence_imports.py` | ||
| - **Result:** 6 failed, 22 passed. | ||
| - **Expected failures:** the pristine v0.12.18 Spec Kit scaffold emitted six | ||
| placeholder records; incomplete Spec Kit sources returned the prior | ||
| compatibility result or partial records; and native-validation tests could | ||
| not exercise a policy-gated subprocess because that behavior did not exist. | ||
| - **Non-blocking environment warnings:** pytest could not write its cache in | ||
| the sandboxed feature worktree. | ||
|
|
||
| ## Passing-after | ||
|
|
||
| - **Date:** 2026-07-17 (Europe/Berlin) | ||
| - **Command:** `hatch run test -- tests/unit/requirements/test_upstream_evidence_imports.py` | ||
| - **Result:** 44 passed. | ||
| - **Summary:** The pinned v0.12.18 scaffold, incomplete Functional | ||
| Requirements, placeholder Functional Requirements, sources with no user | ||
| story, scenarios outside a user story, invalid native validator results, | ||
| timeouts, and unavailable validators now fail atomically. Enterprise aliases | ||
| and layered policy overrides are covered, while portable imports do not probe | ||
| an ambient executable. | ||
|
|
||
| ## Quality evidence | ||
|
|
||
| - `hatch run format`, `hatch run lint`, `hatch run yaml-lint`, and | ||
| `hatch run contract-test`: passed. `hatch run lint` includes the repository | ||
| basedpyright type-check gate. | ||
| - `hatch run smart-test-full`: 2,869 tests passed and 9 skipped; the local | ||
| full-suite line coverage is 64%, above the configured 50% threshold. The | ||
| PR runner independently measures 68.57% for its coverage artifact. | ||
| - `hatch run smart-test`: focused-change execution passed; it is not used as | ||
| the full-suite coverage assertion. | ||
| - `hatch run semgrep-sast --json --output logs/static-analysis/semgrep.json`, | ||
| `hatch run semgrep-sast-gate --results logs/static-analysis/semgrep.json | ||
| --baseline tools/semgrep/sast-baseline.json`, and `hatch run bandit-scan -f | ||
| json -o logs/static-analysis/bandit.json`: passed with no blocking findings. | ||
| - `hatch run python scripts/pre_commit_code_review.py ...`: passed with zero | ||
| findings; report written to `.specfact/code-review.json`. | ||
|
djm81 marked this conversation as resolved.
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.