specfact-cli 0.4.2__py3-none-any.whl → 0.6.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- specfact_cli/__init__.py +1 -1
- specfact_cli/agents/analyze_agent.py +2 -3
- specfact_cli/analyzers/__init__.py +2 -1
- specfact_cli/analyzers/ambiguity_scanner.py +601 -0
- specfact_cli/analyzers/code_analyzer.py +462 -30
- specfact_cli/analyzers/constitution_evidence_extractor.py +491 -0
- specfact_cli/analyzers/contract_extractor.py +419 -0
- specfact_cli/analyzers/control_flow_analyzer.py +281 -0
- specfact_cli/analyzers/requirement_extractor.py +337 -0
- specfact_cli/analyzers/test_pattern_extractor.py +330 -0
- specfact_cli/cli.py +151 -206
- specfact_cli/commands/constitution.py +281 -0
- specfact_cli/commands/enforce.py +42 -34
- specfact_cli/commands/import_cmd.py +481 -152
- specfact_cli/commands/init.py +224 -55
- specfact_cli/commands/plan.py +2133 -547
- specfact_cli/commands/repro.py +100 -78
- specfact_cli/commands/sync.py +701 -186
- specfact_cli/enrichers/constitution_enricher.py +765 -0
- specfact_cli/enrichers/plan_enricher.py +294 -0
- specfact_cli/importers/speckit_converter.py +364 -48
- specfact_cli/importers/speckit_scanner.py +65 -0
- specfact_cli/models/plan.py +42 -0
- specfact_cli/resources/mappings/node-async.yaml +49 -0
- specfact_cli/resources/mappings/python-async.yaml +47 -0
- specfact_cli/resources/mappings/speckit-default.yaml +82 -0
- specfact_cli/resources/prompts/specfact-enforce.md +185 -0
- specfact_cli/resources/prompts/specfact-import-from-code.md +626 -0
- specfact_cli/resources/prompts/specfact-plan-add-feature.md +188 -0
- specfact_cli/resources/prompts/specfact-plan-add-story.md +212 -0
- specfact_cli/resources/prompts/specfact-plan-compare.md +571 -0
- specfact_cli/resources/prompts/specfact-plan-init.md +531 -0
- specfact_cli/resources/prompts/specfact-plan-promote.md +352 -0
- specfact_cli/resources/prompts/specfact-plan-review.md +1276 -0
- specfact_cli/resources/prompts/specfact-plan-select.md +401 -0
- specfact_cli/resources/prompts/specfact-plan-update-feature.md +242 -0
- specfact_cli/resources/prompts/specfact-plan-update-idea.md +211 -0
- specfact_cli/resources/prompts/specfact-repro.md +268 -0
- specfact_cli/resources/prompts/specfact-sync.md +497 -0
- specfact_cli/resources/schemas/deviation.schema.json +61 -0
- specfact_cli/resources/schemas/plan.schema.json +204 -0
- specfact_cli/resources/schemas/protocol.schema.json +53 -0
- specfact_cli/resources/templates/github-action.yml.j2 +140 -0
- specfact_cli/resources/templates/plan.bundle.yaml.j2 +141 -0
- specfact_cli/resources/templates/pr-template.md.j2 +58 -0
- specfact_cli/resources/templates/protocol.yaml.j2 +24 -0
- specfact_cli/resources/templates/telemetry.yaml.example +35 -0
- specfact_cli/sync/__init__.py +10 -1
- specfact_cli/sync/watcher.py +268 -0
- specfact_cli/telemetry.py +440 -0
- specfact_cli/utils/acceptance_criteria.py +127 -0
- specfact_cli/utils/enrichment_parser.py +445 -0
- specfact_cli/utils/feature_keys.py +12 -3
- specfact_cli/utils/ide_setup.py +170 -0
- specfact_cli/utils/structure.py +179 -2
- specfact_cli/utils/yaml_utils.py +33 -0
- specfact_cli/validators/repro_checker.py +22 -1
- specfact_cli/validators/schema.py +15 -4
- specfact_cli-0.6.8.dist-info/METADATA +456 -0
- specfact_cli-0.6.8.dist-info/RECORD +99 -0
- {specfact_cli-0.4.2.dist-info → specfact_cli-0.6.8.dist-info}/entry_points.txt +1 -0
- specfact_cli-0.6.8.dist-info/licenses/LICENSE.md +202 -0
- specfact_cli-0.4.2.dist-info/METADATA +0 -370
- specfact_cli-0.4.2.dist-info/RECORD +0 -62
- specfact_cli-0.4.2.dist-info/licenses/LICENSE.md +0 -61
- {specfact_cli-0.4.2.dist-info → specfact_cli-0.6.8.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Update idea section metadata in a plan bundle (optional business context)"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# SpecFact Update Idea Command
|
|
6
|
+
|
|
7
|
+
## User Input
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
$ARGUMENTS
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
You **MUST** consider the user input before proceeding (if not empty).
|
|
14
|
+
|
|
15
|
+
## ⚠️ CRITICAL: CLI Usage Enforcement
|
|
16
|
+
|
|
17
|
+
**YOU MUST ALWAYS USE THE SPECFACT CLI**. Never create artifacts directly.
|
|
18
|
+
|
|
19
|
+
### Rules
|
|
20
|
+
|
|
21
|
+
1. **ALWAYS execute CLI first**: Run `specfact plan update-idea` before any analysis - execute the CLI command before any other operations
|
|
22
|
+
2. **NEVER write code**: Do not implement idea update logic - the CLI handles this
|
|
23
|
+
3. **NEVER create YAML/JSON directly**: All plan bundle updates must be CLI-generated
|
|
24
|
+
4. **NEVER bypass CLI validation**: CLI ensures schema compliance and metadata - use it, don't bypass its validation
|
|
25
|
+
5. **Use CLI output as grounding**: Parse CLI output, don't regenerate or recreate it - use the CLI output as the source of truth
|
|
26
|
+
6. **NEVER manipulate internal code**: Do NOT use Python code to directly modify PlanBundle objects, Idea objects, or any internal data structures. The CLI is THE interface - use it exclusively.
|
|
27
|
+
7. **No internal knowledge required**: You should NOT need to know about internal implementation details (PlanBundle model, Idea class, etc.). All operations must be performed via CLI commands.
|
|
28
|
+
8. **NEVER read artifacts directly**: Do NOT read plan bundle files directly to extract information unless for display purposes. Use CLI commands (`specfact plan select`) to get plan information.
|
|
29
|
+
|
|
30
|
+
### What Happens If You Don't Follow This
|
|
31
|
+
|
|
32
|
+
- ❌ Artifacts may not match CLI schema versions
|
|
33
|
+
- ❌ Missing metadata and telemetry
|
|
34
|
+
- ❌ Format inconsistencies
|
|
35
|
+
- ❌ Validation failures
|
|
36
|
+
- ❌ Works only in Copilot mode, fails in CI/CD
|
|
37
|
+
- ❌ Breaks when CLI internals change
|
|
38
|
+
- ❌ Requires knowledge of internal code structure
|
|
39
|
+
|
|
40
|
+
## ⏸️ Wait States: User Input Required
|
|
41
|
+
|
|
42
|
+
**When user input is required, you MUST wait for the user's response.**
|
|
43
|
+
|
|
44
|
+
### Wait State Rules
|
|
45
|
+
|
|
46
|
+
1. **Never assume**: If input is missing, ask and wait
|
|
47
|
+
2. **Never continue**: Do not proceed until user responds
|
|
48
|
+
3. **Be explicit**: Clearly state what information you need
|
|
49
|
+
4. **Provide options**: Give examples or default suggestions
|
|
50
|
+
|
|
51
|
+
## Goal
|
|
52
|
+
|
|
53
|
+
Update idea section metadata in a plan bundle. The idea section is OPTIONAL and provides business context and metadata, not technical implementation details.
|
|
54
|
+
|
|
55
|
+
**Note**: All parameters are optional - you only need to provide the fields you want to update.
|
|
56
|
+
|
|
57
|
+
## Operating Constraints
|
|
58
|
+
|
|
59
|
+
**STRICTLY READ-WRITE**: This command modifies plan bundle metadata and content. All updates must be performed by the specfact CLI.
|
|
60
|
+
|
|
61
|
+
**Command**: `specfact plan update-idea`
|
|
62
|
+
|
|
63
|
+
**Mode Auto-Detection**: The CLI automatically detects operational mode (CI/CD or CoPilot) based on environment. No need to specify `--mode` flag.
|
|
64
|
+
|
|
65
|
+
## What This Command Does
|
|
66
|
+
|
|
67
|
+
The `specfact plan update-idea` command:
|
|
68
|
+
|
|
69
|
+
1. **Loads** the existing plan bundle (default: active plan or latest in `.specfact/plans/`)
|
|
70
|
+
2. **Validates** the plan bundle structure
|
|
71
|
+
3. **Creates** idea section if it doesn't exist
|
|
72
|
+
4. **Updates** only the specified fields (all parameters are optional)
|
|
73
|
+
5. **Validates** the updated plan bundle
|
|
74
|
+
6. **Saves** the updated plan bundle
|
|
75
|
+
|
|
76
|
+
## Execution Steps
|
|
77
|
+
|
|
78
|
+
### 1. Parse Arguments and Validate Input
|
|
79
|
+
|
|
80
|
+
**Parse user input** to extract:
|
|
81
|
+
|
|
82
|
+
- Title (optional)
|
|
83
|
+
- Narrative (optional, brief description)
|
|
84
|
+
- Target users (optional, comma-separated personas)
|
|
85
|
+
- Value hypothesis (optional, value statement)
|
|
86
|
+
- Constraints (optional, comma-separated)
|
|
87
|
+
- Plan bundle path (optional, defaults to active plan or latest)
|
|
88
|
+
|
|
89
|
+
**Note**: All parameters are optional. If no parameters are provided, the command will report a warning.
|
|
90
|
+
|
|
91
|
+
**WAIT STATE**: If user wants to update but hasn't specified what, ask:
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
"Which idea fields would you like to update?
|
|
95
|
+
- Title
|
|
96
|
+
- Narrative
|
|
97
|
+
- Target users
|
|
98
|
+
- Value hypothesis
|
|
99
|
+
- Constraints
|
|
100
|
+
|
|
101
|
+
Please specify the fields and values:
|
|
102
|
+
[WAIT FOR USER RESPONSE - DO NOT CONTINUE]"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 2. Check Plan Bundle Existence
|
|
106
|
+
|
|
107
|
+
**Execute CLI** to check if plan exists:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Check active plan
|
|
111
|
+
specfact plan select
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**If plan doesn't exist**:
|
|
115
|
+
|
|
116
|
+
- CLI will report: "No plan bundles found"
|
|
117
|
+
- **WAIT STATE**: Ask user if they want to create a new plan with `specfact plan init`
|
|
118
|
+
|
|
119
|
+
### 3. Execute Update Idea Command
|
|
120
|
+
|
|
121
|
+
**Execute CLI command**:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Update target users and value hypothesis
|
|
125
|
+
specfact plan update-idea \
|
|
126
|
+
--target-users "Developers, DevOps" \
|
|
127
|
+
--value-hypothesis "Reduce technical debt" \
|
|
128
|
+
--plan <plan_path>
|
|
129
|
+
|
|
130
|
+
# Update constraints
|
|
131
|
+
specfact plan update-idea \
|
|
132
|
+
--constraints "Python 3.11+, Maintain backward compatibility" \
|
|
133
|
+
--plan <plan_path>
|
|
134
|
+
|
|
135
|
+
# Update multiple fields
|
|
136
|
+
specfact plan update-idea \
|
|
137
|
+
--title "Project Title" \
|
|
138
|
+
--narrative "Brief project description" \
|
|
139
|
+
--target-users "Developers, QA Engineers" \
|
|
140
|
+
--value-hypothesis "Improve code quality" \
|
|
141
|
+
--constraints "Python 3.11+, Test coverage >= 80%" \
|
|
142
|
+
--plan <plan_path>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Capture from CLI**:
|
|
146
|
+
|
|
147
|
+
- Plan bundle loaded successfully
|
|
148
|
+
- Idea section created if it doesn't exist
|
|
149
|
+
- Fields updated (only specified fields)
|
|
150
|
+
- Plan bundle saved successfully
|
|
151
|
+
|
|
152
|
+
### 4. Handle Errors
|
|
153
|
+
|
|
154
|
+
**Common errors**:
|
|
155
|
+
|
|
156
|
+
- **No plan bundles found**: Report error and suggest creating plan with `specfact plan init`
|
|
157
|
+
- **Plan bundle not found**: Report error if specified path doesn't exist
|
|
158
|
+
- **Invalid plan structure**: Report validation error
|
|
159
|
+
|
|
160
|
+
### 5. Report Completion
|
|
161
|
+
|
|
162
|
+
**After successful execution**:
|
|
163
|
+
|
|
164
|
+
```markdown
|
|
165
|
+
✓ Idea section updated successfully!
|
|
166
|
+
|
|
167
|
+
**Updated Fields**: title, target_users, value_hypothesis
|
|
168
|
+
**Plan Bundle**: `.specfact/plans/main.bundle.yaml`
|
|
169
|
+
|
|
170
|
+
**Idea Metadata**:
|
|
171
|
+
- Title: Project Title
|
|
172
|
+
- Target Users: Developers, QA Engineers
|
|
173
|
+
- Value Hypothesis: Improve code quality
|
|
174
|
+
- Constraints: Python 3.11+, Test coverage >= 80%
|
|
175
|
+
|
|
176
|
+
**Next Steps**:
|
|
177
|
+
- Review plan: `/specfact-cli/specfact-plan-review`
|
|
178
|
+
- Update features: `/specfact-cli/specfact-plan-update-feature`
|
|
179
|
+
- Promote plan: `/specfact-cli/specfact-plan-promote`
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Guidelines
|
|
183
|
+
|
|
184
|
+
### Idea Section Purpose
|
|
185
|
+
|
|
186
|
+
The idea section is **OPTIONAL** and provides:
|
|
187
|
+
|
|
188
|
+
- **Business context**: Who the plan is for and why it exists
|
|
189
|
+
- **Metadata**: High-level constraints and value proposition
|
|
190
|
+
- **Not technical implementation**: Technical details belong in features/stories
|
|
191
|
+
|
|
192
|
+
### Field Guidelines
|
|
193
|
+
|
|
194
|
+
- **Title**: Brief, descriptive project title
|
|
195
|
+
- **Narrative**: Short description of the project's purpose
|
|
196
|
+
- **Target Users**: Comma-separated list of user personas (e.g., "Developers, DevOps, QA Engineers")
|
|
197
|
+
- **Value Hypothesis**: Statement of expected value or benefit
|
|
198
|
+
- **Constraints**: Comma-separated technical or business constraints
|
|
199
|
+
|
|
200
|
+
### Best Practices
|
|
201
|
+
|
|
202
|
+
- Keep idea section high-level and business-focused
|
|
203
|
+
- Use target users to clarify who benefits from the plan
|
|
204
|
+
- State value hypothesis clearly to guide decision-making
|
|
205
|
+
- List constraints that affect all features (language, platform, etc.)
|
|
206
|
+
|
|
207
|
+
## Context
|
|
208
|
+
|
|
209
|
+
{ARGS}
|
|
210
|
+
|
|
211
|
+
--- End Command ---
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Run validation suite for reproducibility and contract compliance"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# SpecFact Repro Command
|
|
6
|
+
|
|
7
|
+
## User Input
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
$ARGUMENTS
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
You **MUST** consider the user input before proceeding (if not empty).
|
|
14
|
+
|
|
15
|
+
## ⚠️ CRITICAL: CLI Usage Enforcement
|
|
16
|
+
|
|
17
|
+
**YOU MUST ALWAYS USE THE SPECFACT CLI**. Never create artifacts directly.
|
|
18
|
+
|
|
19
|
+
### Rules
|
|
20
|
+
|
|
21
|
+
1. **ALWAYS execute CLI first**: Run `specfact repro` before any analysis - execute the CLI command before any other operations
|
|
22
|
+
2. **NEVER write code**: Do not implement validation logic - the CLI handles this
|
|
23
|
+
3. **NEVER create YAML/JSON directly**: All validation reports must be CLI-generated
|
|
24
|
+
4. **NEVER bypass CLI validation**: CLI ensures schema compliance and metadata - use it, don't bypass its validation
|
|
25
|
+
5. **Use CLI output as grounding**: Parse CLI output, don't regenerate or recreate it - use the CLI output as the source of truth
|
|
26
|
+
6. **NEVER manipulate internal code**: Do NOT use Python code to directly modify validation results or any internal data structures. The CLI is THE interface - use it exclusively.
|
|
27
|
+
7. **No internal knowledge required**: You should NOT need to know about internal implementation details (ReproChecker, validation tools, etc.). All operations must be performed via CLI commands.
|
|
28
|
+
8. **NEVER read artifacts directly**: Do NOT read validation report files directly to extract information unless for display purposes. Use CLI output to get validation results.
|
|
29
|
+
|
|
30
|
+
### What Happens If You Don't Follow This
|
|
31
|
+
|
|
32
|
+
- ❌ Artifacts may not match CLI schema versions
|
|
33
|
+
- ❌ Missing metadata and telemetry
|
|
34
|
+
- ❌ Format inconsistencies
|
|
35
|
+
- ❌ Validation failures
|
|
36
|
+
- ❌ Works only in Copilot mode, fails in CI/CD
|
|
37
|
+
- ❌ Breaks when CLI internals change
|
|
38
|
+
- ❌ Requires knowledge of internal code structure
|
|
39
|
+
|
|
40
|
+
## ⏸️ Wait States: User Input Required
|
|
41
|
+
|
|
42
|
+
**When user input is required, you MUST wait for the user's response.**
|
|
43
|
+
|
|
44
|
+
### Wait State Rules
|
|
45
|
+
|
|
46
|
+
1. **Never assume**: If input is missing, ask and wait
|
|
47
|
+
2. **Never continue**: Do not proceed until user responds
|
|
48
|
+
3. **Be explicit**: Clearly state what information you need
|
|
49
|
+
4. **Provide options**: Give examples or default suggestions
|
|
50
|
+
|
|
51
|
+
## Goal
|
|
52
|
+
|
|
53
|
+
Run full validation suite for reproducibility and contract compliance. This command executes comprehensive validation checks including linting, type checking, contract exploration, and tests.
|
|
54
|
+
|
|
55
|
+
## Operating Constraints
|
|
56
|
+
|
|
57
|
+
**STRICTLY READ-ONLY**: This command runs validation checks and generates reports. It does not modify the codebase (unless `--fix` is used for auto-fixes).
|
|
58
|
+
|
|
59
|
+
**Command**: `specfact repro`
|
|
60
|
+
|
|
61
|
+
**Mode Auto-Detection**: The CLI automatically detects operational mode (CI/CD or CoPilot) based on environment. No need to specify `--mode` flag.
|
|
62
|
+
|
|
63
|
+
## What This Command Does
|
|
64
|
+
|
|
65
|
+
The `specfact repro` command:
|
|
66
|
+
|
|
67
|
+
1. **Runs** comprehensive validation checks:
|
|
68
|
+
- Lint checks (ruff)
|
|
69
|
+
- Async patterns (semgrep)
|
|
70
|
+
- Type checking (basedpyright)
|
|
71
|
+
- Contract exploration (CrossHair)
|
|
72
|
+
- Property tests (pytest tests/contracts/)
|
|
73
|
+
- Smoke tests (pytest tests/smoke/)
|
|
74
|
+
|
|
75
|
+
2. **Displays** validation results in a summary table
|
|
76
|
+
3. **Generates** validation report (YAML format)
|
|
77
|
+
4. **Returns** appropriate exit codes (0=success, 1=failed, 2=timeout)
|
|
78
|
+
|
|
79
|
+
## Execution Steps
|
|
80
|
+
|
|
81
|
+
### 1. Parse Arguments and Validate Input
|
|
82
|
+
|
|
83
|
+
**Parse user input** to extract:
|
|
84
|
+
|
|
85
|
+
- Repository path (optional, default: `.`)
|
|
86
|
+
- Verbose output (optional, default: `false`)
|
|
87
|
+
- Time budget (optional, default: `120` seconds)
|
|
88
|
+
- Fail-fast (optional, default: `false`)
|
|
89
|
+
- Auto-fix (optional, default: `false`)
|
|
90
|
+
- Output path (optional, default: `.specfact/reports/enforcement/report-<timestamp>.yaml`)
|
|
91
|
+
|
|
92
|
+
**WAIT STATE**: If user wants to run validation but hasn't specified options, ask:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
"Validation suite options:
|
|
96
|
+
- Repository path (default: current directory)
|
|
97
|
+
- Time budget in seconds (default: 120)
|
|
98
|
+
- Fail-fast: Stop on first failure (default: false)
|
|
99
|
+
- Auto-fix: Apply auto-fixes where available (default: false)
|
|
100
|
+
- Verbose: Show detailed output (default: false)
|
|
101
|
+
|
|
102
|
+
Proceed with defaults or specify options?
|
|
103
|
+
[WAIT FOR USER RESPONSE - DO NOT CONTINUE]"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 2. Execute Repro Command
|
|
107
|
+
|
|
108
|
+
**Execute CLI command**:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Basic usage (default options)
|
|
112
|
+
specfact repro
|
|
113
|
+
|
|
114
|
+
# With verbose output
|
|
115
|
+
specfact repro --verbose
|
|
116
|
+
|
|
117
|
+
# With custom budget and fail-fast
|
|
118
|
+
specfact repro --budget 180 --fail-fast
|
|
119
|
+
|
|
120
|
+
# With auto-fix enabled
|
|
121
|
+
specfact repro --fix
|
|
122
|
+
|
|
123
|
+
# With custom output path
|
|
124
|
+
specfact repro --out .specfact/reports/custom-report.yaml
|
|
125
|
+
|
|
126
|
+
# Full example
|
|
127
|
+
specfact repro \
|
|
128
|
+
--repo . \
|
|
129
|
+
--verbose \
|
|
130
|
+
--budget 180 \
|
|
131
|
+
--fail-fast \
|
|
132
|
+
--fix \
|
|
133
|
+
--out .specfact/reports/enforcement/report.yaml
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Capture from CLI**:
|
|
137
|
+
|
|
138
|
+
- Validation checks running (progress indicator)
|
|
139
|
+
- Check summary table (Check, Tool, Status, Duration)
|
|
140
|
+
- Summary statistics (Total checks, Passed, Failed, Timeout, Skipped)
|
|
141
|
+
- Report written to output path
|
|
142
|
+
- Exit code (0=success, 1=failed, 2=timeout)
|
|
143
|
+
|
|
144
|
+
### 3. Handle Errors
|
|
145
|
+
|
|
146
|
+
**Common errors**:
|
|
147
|
+
|
|
148
|
+
- **Validation failures**: CLI will report failed checks in summary table
|
|
149
|
+
- **Timeout**: CLI will report timeout if budget is exceeded (exit code 2)
|
|
150
|
+
- **Repository not found**: CLI will report error if repository path doesn't exist
|
|
151
|
+
|
|
152
|
+
### 4. Report Completion
|
|
153
|
+
|
|
154
|
+
**After successful execution**:
|
|
155
|
+
|
|
156
|
+
```markdown
|
|
157
|
+
✓ Validation suite completed!
|
|
158
|
+
|
|
159
|
+
**Summary**:
|
|
160
|
+
- Total checks: 6
|
|
161
|
+
- Passed: 5
|
|
162
|
+
- Failed: 1
|
|
163
|
+
- Timeout: 0
|
|
164
|
+
- Skipped: 0
|
|
165
|
+
- Total duration: 45.23s
|
|
166
|
+
|
|
167
|
+
**Check Results**:
|
|
168
|
+
|
|
169
|
+
| Check | Tool | Status | Duration |
|
|
170
|
+
|-------|------|--------|----------|
|
|
171
|
+
| Lint | ruff | ✓ PASSED | 2.34s |
|
|
172
|
+
| Async Patterns | semgrep | ✓ PASSED | 5.67s |
|
|
173
|
+
| Type Check | basedpyright | ✓ PASSED | 8.12s |
|
|
174
|
+
| Contract Exploration | CrossHair | ✓ PASSED | 25.45s |
|
|
175
|
+
| Property Tests | pytest | ✓ PASSED | 3.21s |
|
|
176
|
+
| Smoke Tests | pytest | ✗ FAILED | 0.44s |
|
|
177
|
+
|
|
178
|
+
**Report**: `.specfact/reports/enforcement/report-2025-01-17T14-30-00.yaml`
|
|
179
|
+
|
|
180
|
+
**Next Steps**:
|
|
181
|
+
- Review failed checks (use --verbose for details)
|
|
182
|
+
- Fix issues and re-run validation
|
|
183
|
+
- Configure enforcement: `/specfact-cli/specfact-enforce`
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**If validation failed**:
|
|
187
|
+
|
|
188
|
+
```markdown
|
|
189
|
+
✗ Validation suite failed!
|
|
190
|
+
|
|
191
|
+
**Failed Checks**: 1
|
|
192
|
+
**Exit Code**: 1
|
|
193
|
+
|
|
194
|
+
**Failed Checks**:
|
|
195
|
+
- Smoke Tests (pytest): Test failures detected
|
|
196
|
+
|
|
197
|
+
**Next Steps**:
|
|
198
|
+
- Run with --verbose to see detailed error messages
|
|
199
|
+
- Fix issues and re-run validation
|
|
200
|
+
- Use --fix to apply auto-fixes where available
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Guidelines
|
|
204
|
+
|
|
205
|
+
### Validation Checks
|
|
206
|
+
|
|
207
|
+
**Lint Checks (ruff)**:
|
|
208
|
+
|
|
209
|
+
- Code style and formatting
|
|
210
|
+
- Common Python issues
|
|
211
|
+
- Import organization
|
|
212
|
+
|
|
213
|
+
**Async Patterns (semgrep)**:
|
|
214
|
+
|
|
215
|
+
- Async/await anti-patterns
|
|
216
|
+
- Potential race conditions
|
|
217
|
+
- Async best practices
|
|
218
|
+
|
|
219
|
+
**Type Checking (basedpyright)**:
|
|
220
|
+
|
|
221
|
+
- Type annotation compliance
|
|
222
|
+
- Type safety issues
|
|
223
|
+
- Missing type hints
|
|
224
|
+
|
|
225
|
+
**Contract Exploration (CrossHair)**:
|
|
226
|
+
|
|
227
|
+
- Contract violation detection
|
|
228
|
+
- Edge case discovery
|
|
229
|
+
- Property validation
|
|
230
|
+
|
|
231
|
+
**Property Tests (pytest tests/contracts/)**:
|
|
232
|
+
|
|
233
|
+
- Contract-based tests
|
|
234
|
+
- Property-based testing
|
|
235
|
+
- Contract compliance
|
|
236
|
+
|
|
237
|
+
**Smoke Tests (pytest tests/smoke/)**:
|
|
238
|
+
|
|
239
|
+
- Basic functionality tests
|
|
240
|
+
- Integration smoke tests
|
|
241
|
+
- Quick validation
|
|
242
|
+
|
|
243
|
+
### Time Budget
|
|
244
|
+
|
|
245
|
+
- Default: 120 seconds
|
|
246
|
+
- Used for contract exploration and long-running checks
|
|
247
|
+
- Exceeding budget results in timeout (exit code 2)
|
|
248
|
+
- Increase budget for large codebases
|
|
249
|
+
|
|
250
|
+
### Auto-Fix
|
|
251
|
+
|
|
252
|
+
- Applies Semgrep auto-fixes where available
|
|
253
|
+
- Does not modify code for other checks
|
|
254
|
+
- Review changes before committing
|
|
255
|
+
|
|
256
|
+
### Best Practices
|
|
257
|
+
|
|
258
|
+
- Run validation before committing changes
|
|
259
|
+
- Use `--fail-fast` in CI/CD to stop on first failure
|
|
260
|
+
- Use `--verbose` for debugging failed checks
|
|
261
|
+
- Review validation reports to track improvements
|
|
262
|
+
- Set appropriate time budget for your codebase size
|
|
263
|
+
|
|
264
|
+
## Context
|
|
265
|
+
|
|
266
|
+
{ARGS}
|
|
267
|
+
|
|
268
|
+
--- End Command ---
|