sanityops-cli 0.1.8__tar.gz → 0.1.10__tar.gz
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.
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/CHANGELOG.md +22 -2
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/PKG-INFO +1 -18
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/README.md +0 -17
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/plans/2026-09-08-config-command.md +1 -1
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/plans/2026-09-20-cross-artifact-rendering.md +1 -1
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/plans/2026-09-20-help-panel-migration.md +2 -2
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/plans/2026-09-20-repair-feature.md +2 -2
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/specs/2026-09-08-config-command-design.md +2 -2
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/specs/2026-09-20-cross-artifact-rendering-design.md +1 -1
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/specs/2026-09-20-help-panel-migration-design.md +6 -6
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/specs/2026-09-20-repair-feature-design.md +4 -4
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/pyproject.toml +1 -1
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/__init__.py +1 -1
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/scanner_agent/models/finding.py +36 -7
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/scanner_agent/prompts.py +114 -18
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/scanner_agent/tools/grep_tool.py +1 -1
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/scanner_agent/tools/readfile_tool.py +1 -1
- sanityops_cli-0.1.10/src/sanityops_cli/code_contract_checker/__init__.py +35 -0
- sanityops_cli-0.1.10/src/sanityops_cli/code_contract_checker/checker.py +484 -0
- sanityops_cli-0.1.10/src/sanityops_cli/code_contract_checker/markdown_reporter.py +191 -0
- sanityops_cli-0.1.10/src/sanityops_cli/code_contract_checker/models.py +202 -0
- sanityops_cli-0.1.10/src/sanityops_cli/code_contract_checker/renderer.py +183 -0
- sanityops_cli-0.1.10/src/sanityops_cli/code_contract_checker/rules/__init__.py +55 -0
- sanityops_cli-0.1.10/src/sanityops_cli/code_contract_checker/rules/qc0_baseline.py +489 -0
- sanityops_cli-0.1.10/src/sanityops_cli/code_contract_checker/rules/qc1_syntax.py +401 -0
- sanityops_cli-0.1.10/src/sanityops_cli/code_contract_checker/rules/qc2_resource.py +345 -0
- sanityops_cli-0.1.10/src/sanityops_cli/code_contract_checker/rules/qc3_pattern.py +337 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/commands/inspect.py +68 -11
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/defect_checker/checker.py +9 -2
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/defect_checker/markdown_reporter.py +170 -47
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/defect_checker/renderer.py +42 -14
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/help_panel.py +2 -3
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/utils/artifact_packer.py +34 -17
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/commands/test_inspect_repair.py +8 -9
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/test_help_panel.py +1 -3
- sanityops_cli-0.1.10/tests/unit/code_contract_checker/test_checker.py +165 -0
- sanityops_cli-0.1.10/tests/unit/code_contract_checker/test_renderer.py +73 -0
- sanityops_cli-0.1.10/tests/unit/code_contract_checker/test_rules.py +328 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/commands/test_inspect.py +106 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/defect_checker/test_markdown_reporter.py +128 -24
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/defect_checker/test_renderer.py +65 -1
- sanityops_cli-0.1.10/tests/unit/progress/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/utils/test_artifact_packer.py +63 -4
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/.github/dependabot.yml +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/.github/scripts/pr_review_bot.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/.github/workflows/ai-review.yml +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/.github/workflows/ci.yml +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/.github/workflows/release.yml +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/.gitignore +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/CODE_OF_CONDUCT.md +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/CONTRIBUTING.md +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/LICENSE +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/NOTICE +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/SECURITY.md +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/plans/2026-08-13-model-config-comments-in-init-template.md +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/plans/2026-08-14-loading-animations.md +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/plans/2026-08-14-skills-files-banner-readme.md +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/plans/2026-08-28-copyright-compliance.md +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/specs/2026-08-13-model-config-comments-in-init-template-design.md +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/specs/2026-08-14-loading-animations-design.md +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/specs/2026-08-14-skills-files-banner-readme-design.md +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/specs/2026-08-28-copyright-compliance-design.md +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/entry.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/release.sh +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/scripts/generate-checksums.ps1 +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/scripts/install.ps1 +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/scripts/install.sh +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/repair_agent/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/repair_agent/agent.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/repair_agent/prompts.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/repair_agent/tools/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/repair_agent/tools/store_repairs_tool.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/scanner_agent/agent.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/scanner_agent/hooks/progress_hook.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/scanner_agent/tools/listfiles_tool.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/scanner_agent/tools/storefindings_tool.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/api/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/api/client.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/commands/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/commands/config.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/commands/init.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/constants/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/constants/config_defaults.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/constants/exit_codes.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/defect_checker/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/defect_checker/llm_config.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/exceptions/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/exceptions/api_exceptions.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/exceptions/base_exceptions.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/logging/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/logging/logger.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/main.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/progress/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/progress/tracker.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/renderers/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/renderers/command_renderer/inspect_command_renderer.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/templates/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/templates/inspect_config.yaml +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/utils/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/utils/config_loader.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/utils/config_resolver.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/utils/validators.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/commands/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/commands/test_config.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/commands/test_init.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/agents/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/agents/repair_agent/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/agents/repair_agent/test_agent.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/agents/repair_agent/test_store_repairs_tool.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/agents/scanner_agent/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/agents/scanner_agent/models/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/agents/scanner_agent/models/test_finding.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/agents/scanner_agent/test_agent.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/agents/scanner_agent/test_deterministic_capture.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/agents/scanner_agent/test_progress_hook.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/agents/scanner_agent/test_prompts.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/api/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/api/test_client.py +0 -0
- {sanityops_cli-0.1.8/tests/unit/defect_checker → sanityops_cli-0.1.10/tests/unit/code_contract_checker}/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/commands/test_version.py +0 -0
- {sanityops_cli-0.1.8/tests/unit/logging → sanityops_cli-0.1.10/tests/unit/defect_checker}/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/defect_checker/test_checker.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/defect_checker/test_llm_config.py +0 -0
- {sanityops_cli-0.1.8/tests/unit/progress → sanityops_cli-0.1.10/tests/unit/logging}/__init__.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/logging/test_logger.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/progress/test_tracker.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/unit/utils/test_config_loader.py +0 -0
- {sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/tests/utils/test_config_resolver.py +0 -0
|
@@ -7,19 +7,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Code Contract (QC) lint check before LLM analysis: AST-based static inspection
|
|
13
|
+
of embedded code blocks and Python source files (syntax, undefined names,
|
|
14
|
+
resource leaks, code patterns) with `--skip-qc-lint` to opt out
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **Breaking**: tool schema uploads now emit the provider-neutral flat format
|
|
19
|
+
`{name, description, parameters}` in both upload paths (push and inspect).
|
|
20
|
+
The OpenAI `{type, function}` wrapper is stripped during packing; the
|
|
21
|
+
backend converts to the selected provider format when a model endpoint is set.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- Failed module inspections now render a CAUTION callout instead of a
|
|
26
|
+
misleading "No defects found" in markdown reports
|
|
27
|
+
- Duplicate defects reported under both `$.inputSchema` and `$.parameters`
|
|
28
|
+
are deduplicated in terminal and markdown output
|
|
29
|
+
|
|
10
30
|
## [0.0.8] - 2026-09-21
|
|
11
31
|
|
|
12
32
|
### Added
|
|
13
33
|
|
|
14
34
|
- `inspect repair` subcommand to generate repaired artifacts from inspection reports
|
|
15
35
|
- Cross-artifact result rendering with aggregate CROSS score in markdown reports
|
|
16
|
-
- Getting Started and Advanced Usage help panels migrated from
|
|
36
|
+
- Getting Started and Advanced Usage help panels migrated from sanityops-cli
|
|
17
37
|
|
|
18
38
|
## [0.0.7] - 2026-09-10
|
|
19
39
|
|
|
20
40
|
### Added
|
|
21
41
|
|
|
22
|
-
- Init command alignment with
|
|
42
|
+
- Init command alignment with sanityops-cli: placeholder UUID, project.name, model block
|
|
23
43
|
- Nested `.gitignore` in `.sanityops` directory to prevent accidental secret commits
|
|
24
44
|
|
|
25
45
|
### Changed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: sanityops-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.10
|
|
4
4
|
Summary: CLI tool for static defect inspection of AI logical artifacts
|
|
5
5
|
Project-URL: Homepage, https://sanityops.org
|
|
6
6
|
Project-URL: Documentation, https://sanityops.org
|
|
@@ -160,23 +160,6 @@ sanityops-cli inspect --config path/to/config.yaml
|
|
|
160
160
|
|
|
161
161
|
`inspect` exits `0` when the run completes — including when defects are found — and non-zero on failure. CI pipelines should therefore gate on the generated report (`.sanityops/results/inspect-*.md`), not on the exit code.
|
|
162
162
|
|
|
163
|
-
### 4. Generate Repairs (Optional)
|
|
164
|
-
|
|
165
|
-
After inspection, generate repaired artifacts from the report:
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
# Use the latest inspection report
|
|
169
|
-
sanityops-cli inspect repair
|
|
170
|
-
|
|
171
|
-
# Use a specific report
|
|
172
|
-
sanityops-cli inspect repair --report .sanityops/results/inspect-20250115-120000.md
|
|
173
|
-
|
|
174
|
-
# Specify timeout and token budget for large projects
|
|
175
|
-
sanityops-cli inspect repair --timeout 3600 --token-budget 500000
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
Repairs are written to `.sanityops/repairs/repair-<timestamp>.md` without modifying source files.
|
|
179
|
-
|
|
180
163
|
## Data Handling
|
|
181
164
|
|
|
182
165
|
What leaves your machine, and when:
|
|
@@ -120,23 +120,6 @@ sanityops-cli inspect --config path/to/config.yaml
|
|
|
120
120
|
|
|
121
121
|
`inspect` exits `0` when the run completes — including when defects are found — and non-zero on failure. CI pipelines should therefore gate on the generated report (`.sanityops/results/inspect-*.md`), not on the exit code.
|
|
122
122
|
|
|
123
|
-
### 4. Generate Repairs (Optional)
|
|
124
|
-
|
|
125
|
-
After inspection, generate repaired artifacts from the report:
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
# Use the latest inspection report
|
|
129
|
-
sanityops-cli inspect repair
|
|
130
|
-
|
|
131
|
-
# Use a specific report
|
|
132
|
-
sanityops-cli inspect repair --report .sanityops/results/inspect-20250115-120000.md
|
|
133
|
-
|
|
134
|
-
# Specify timeout and token budget for large projects
|
|
135
|
-
sanityops-cli inspect repair --timeout 3600 --token-budget 500000
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
Repairs are written to `.sanityops/repairs/repair-<timestamp>.md` without modifying source files.
|
|
139
|
-
|
|
140
123
|
## Data Handling
|
|
141
124
|
|
|
142
125
|
What leaves your machine, and when:
|
{sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/plans/2026-09-08-config-command.md
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
4
4
|
|
|
5
|
-
**Goal:** Migrate the `config` subcommand from
|
|
5
|
+
**Goal:** Migrate the `config` subcommand from sanityops-cli to sanityops-cli, providing CLI-based configuration management for server URL and API key.
|
|
6
6
|
|
|
7
7
|
**Architecture:** Create three new files (`constants/config_defaults.py`, `utils/config_resolver.py`, `commands/config.py`) and modify `main.py` to register the config subcommand. ConfigResolver handles the precedence chain (project > global > env > default) with YAML read/write. The config command provides get/set/list/unset operations via Typer CLI.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
4
4
|
|
|
5
|
-
**Goal:** Migrate cross-artifact result rendering from
|
|
5
|
+
**Goal:** Migrate cross-artifact result rendering from sanityops-cli to sanityops-cli, enabling terminal and markdown display of CROSS module defects.
|
|
6
6
|
|
|
7
7
|
**Architecture:** Add helper functions to resolve artifact names from defect references and aggregate multiple CROSS sub-results into a unified section. The terminal renderer uses Rich panels with artifact names in titles; the markdown reporter merges PS/PT/ST sub-results and calculates a unified score via SDK.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
4
4
|
|
|
5
|
-
**Goal:** Migrate Getting Started and Advanced Usage help panels from
|
|
5
|
+
**Goal:** Migrate Getting Started and Advanced Usage help panels from sanityops-cli to sanityops-cli.
|
|
6
6
|
|
|
7
7
|
**Architecture:** Copy `help_panel.py` verbatim, add `--help` interception logic in `main.py`, update entry points (`entry.py`, `pyproject.toml`) to call `main()` instead of `app()`, and add tests.
|
|
8
8
|
|
|
@@ -82,7 +82,7 @@ def get_advanced_usage_panel() -> Panel:
|
|
|
82
82
|
)
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
**Note:** Step 5 (`inspect cover`) from
|
|
85
|
+
**Note:** Step 5 (`inspect cover`) from sanityops-cli was removed because sanityops-cli has no `cover` subcommand.
|
|
86
86
|
|
|
87
87
|
- [ ] **Step 2: Verify file is importable**
|
|
88
88
|
|
{sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/docs/superpowers/plans/2026-09-20-repair-feature.md
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
4
4
|
|
|
5
|
-
**Goal:** Migrate local repair functionality from
|
|
5
|
+
**Goal:** Migrate local repair functionality from sanityops-cli to sanityops-cli, enabling users to generate repaired artifact content from inspection reports.
|
|
6
6
|
|
|
7
7
|
**Architecture:** Create a RepairAgent that reads inspection reports and uses an LLM to rewrite defective artifacts. The agent uses StoreRepairsTool to collect repairs, which are then written to a markdown report file.
|
|
8
8
|
|
|
@@ -1438,5 +1438,5 @@ Create a test scenario:
|
|
|
1438
1438
|
|
|
1439
1439
|
```bash
|
|
1440
1440
|
git add -A
|
|
1441
|
-
git commit -m "feat(repair): complete repair feature migration from
|
|
1441
|
+
git commit -m "feat(repair): complete repair feature migration from sanityops-cli"
|
|
1442
1442
|
```
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
**Date:** 2026-09-08
|
|
4
4
|
**Status:** Approved
|
|
5
|
-
**Source:**
|
|
5
|
+
**Source:** sanityops-cli → sanityops-cli
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-
Migrate the `config` subcommand from
|
|
9
|
+
Migrate the `config` subcommand from sanityops-cli to sanityops-cli. This provides CLI-based configuration management for the sanityops server backend URL and API key.
|
|
10
10
|
|
|
11
11
|
## Architecture
|
|
12
12
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
sanityops-cli currently skips rendering of cross-artifact defects (module type "CROSS") in both terminal and markdown outputs. The defect-check SDK returns cross-artifact analysis results, but the CLI explicitly skips them.
|
|
10
10
|
|
|
11
|
-
This design migrates the cross-artifact rendering functionality from
|
|
11
|
+
This design migrates the cross-artifact rendering functionality from sanityops-cli to sanityops-cli.
|
|
12
12
|
|
|
13
13
|
## Migration Scope
|
|
14
14
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Help Panel Migration — Design Spec
|
|
2
2
|
|
|
3
3
|
**Date:** 2026-09-20
|
|
4
|
-
**Source:** `/Users/a1234/Documents/project/gitlab/
|
|
4
|
+
**Source:** `/Users/a1234/Documents/project/gitlab/sanityops-cli`
|
|
5
5
|
**Target:** `/Users/a1234/Documents/project/sanityops-cli`
|
|
6
6
|
|
|
7
7
|
## Summary
|
|
8
8
|
|
|
9
|
-
Migrate the Getting Started and Advanced Usage help panels from
|
|
9
|
+
Migrate the Getting Started and Advanced Usage help panels from sanityops-cli to sanityops-cli. The panels appear when users run `sanityops-cli --help` or `sanityops-cli` with no arguments, providing a 4-step quick start workflow and CI/CD integration guidance.
|
|
10
10
|
|
|
11
11
|
**Note:** The original 5-step workflow was reduced to 4 steps because sanityops-cli has no `inspect cover` subcommand.
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ Migrate the Getting Started and Advanced Usage help panels from deeplogic-cli to
|
|
|
14
14
|
|
|
15
15
|
| File | Action |
|
|
16
16
|
|------|--------|
|
|
17
|
-
| `src/sanityops_cli/help_panel.py` | Create (localized from
|
|
17
|
+
| `src/sanityops_cli/help_panel.py` | Create (localized from sanityops-cli) |
|
|
18
18
|
| `src/sanityops_cli/main.py` | Modify (add help interception logic) |
|
|
19
19
|
| `entry.py` | Modify (call `main()` instead of `app()`) |
|
|
20
20
|
| `pyproject.toml` | Modify (entry point `:app` → `:main`) |
|
|
@@ -130,8 +130,8 @@ sanityops-cli = "sanityops_cli.main:main"
|
|
|
130
130
|
|
|
131
131
|
### 5. `tests/test_help_panel.py` (new)
|
|
132
132
|
|
|
133
|
-
Copy from
|
|
134
|
-
- Import path `
|
|
133
|
+
Copy from sanityops-cli with these changes:
|
|
134
|
+
- Import path `sanityops_cli` → `sanityops_cli`
|
|
135
135
|
- **Remove** `test_getting_started_text_is_english()` and `test_advanced_usage_text_is_english()` (CJK assertion tests — will be added back when text is localized)
|
|
136
136
|
|
|
137
137
|
Tests included:
|
|
@@ -169,7 +169,7 @@ sanityops-cli inspect --help
|
|
|
169
169
|
## Out of Scope
|
|
170
170
|
|
|
171
171
|
- Adding `project` command (does not exist in sanityops-cli)
|
|
172
|
-
- Migrating other
|
|
172
|
+
- Migrating other sanityops-cli features
|
|
173
173
|
|
|
174
174
|
## Acceptance Criteria
|
|
175
175
|
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
**Date:** 2026-09-20
|
|
4
4
|
**Status:** Approved
|
|
5
|
-
**Source:** Migration from
|
|
5
|
+
**Source:** Migration from sanityops-cli
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-
Migrate the local `repair` feature from
|
|
9
|
+
Migrate the local `repair` feature from sanityops-cli to sanityops-cli. The repair feature reads an inspection report and uses an LLM agent to generate fixed artifact content.
|
|
10
10
|
|
|
11
11
|
## Scope
|
|
12
12
|
|
|
@@ -241,8 +241,8 @@ Use the store_repairs tool with operation "add" for each repaired artifact:
|
|
|
241
241
|
|
|
242
242
|
**Method:** Direct migration with import path adjustment
|
|
243
243
|
|
|
244
|
-
1. Copy `RepairAgent` from
|
|
245
|
-
2. Copy `StoreRepairsTool` from
|
|
244
|
+
1. Copy `RepairAgent` from sanityops-cli
|
|
245
|
+
2. Copy `StoreRepairsTool` from sanityops-cli
|
|
246
246
|
3. Change imports: `aidynamic_agent` → `sanityops_agent`
|
|
247
247
|
4. Add `repair` subcommand to `inspect.py`
|
|
248
248
|
5. Reuse existing utilities:
|
|
@@ -30,6 +30,7 @@ class FindingType(StrEnum):
|
|
|
30
30
|
|
|
31
31
|
class Section(BaseModel):
|
|
32
32
|
"""A markdown section within a skill file."""
|
|
33
|
+
|
|
33
34
|
title: str = Field(description="Section heading text")
|
|
34
35
|
content: str = Field(description="Section body content")
|
|
35
36
|
|
|
@@ -37,7 +38,9 @@ class Section(BaseModel):
|
|
|
37
38
|
class ToolSchema(BaseModel):
|
|
38
39
|
name: str
|
|
39
40
|
description: str = ""
|
|
40
|
-
parameters: dict = Field(
|
|
41
|
+
parameters: dict = Field(
|
|
42
|
+
default_factory=dict, description="Tool parameters, JSON Schema (Draft-07) format"
|
|
43
|
+
)
|
|
41
44
|
|
|
42
45
|
|
|
43
46
|
class SkillContent(BaseModel):
|
|
@@ -54,7 +57,11 @@ class SkillContent(BaseModel):
|
|
|
54
57
|
#: Frontmatter fields that must be positive integers (QDS-0.4). LLM-based
|
|
55
58
|
#: extraction can stringify numeric values, so coerce them back to int.
|
|
56
59
|
_POSITIVE_INT_FIELDS: tuple[str, ...] = (
|
|
57
|
-
"max_items",
|
|
60
|
+
"max_items",
|
|
61
|
+
"max_chars",
|
|
62
|
+
"timeout_seconds",
|
|
63
|
+
"max_tool_calls",
|
|
64
|
+
"max_retries",
|
|
58
65
|
)
|
|
59
66
|
|
|
60
67
|
@model_validator(mode="after")
|
|
@@ -100,23 +107,45 @@ class SkillContent(BaseModel):
|
|
|
100
107
|
if not parts:
|
|
101
108
|
return ""
|
|
102
109
|
parts.append(
|
|
103
|
-
"\n\n".join(
|
|
104
|
-
f"## {section.title}\n\n{section.content}"
|
|
105
|
-
for section in self.sections
|
|
106
|
-
)
|
|
110
|
+
"\n\n".join(f"## {section.title}\n\n{section.content}" for section in self.sections)
|
|
107
111
|
)
|
|
108
112
|
return "\n".join(parts)
|
|
109
113
|
|
|
110
114
|
|
|
111
115
|
class ToolContent(BaseModel):
|
|
112
116
|
"""Extracted content from a tool file."""
|
|
117
|
+
|
|
113
118
|
name: str = Field(description="Tool name from definition")
|
|
114
119
|
description: str = Field(description="Tool description")
|
|
115
|
-
parameters: dict[str, Any] = Field(
|
|
120
|
+
parameters: dict[str, Any] = Field(
|
|
121
|
+
default_factory=dict, description="JSON Schema of parameters"
|
|
122
|
+
)
|
|
123
|
+
#: pre-inspect-extract alignment: extraction fidelity labels. Default empty
|
|
124
|
+
#: when the analyzer does not provide them (backward compatible).
|
|
125
|
+
completeness: str = Field(
|
|
126
|
+
default="",
|
|
127
|
+
description=(
|
|
128
|
+
"Completeness level per pre-inspect-extract: full original / "
|
|
129
|
+
"assembled / incomplete / summary / not inspectable"
|
|
130
|
+
),
|
|
131
|
+
)
|
|
132
|
+
evidence: str = Field(
|
|
133
|
+
default="", description="Short verbatim excerpt from the source proving the extraction"
|
|
134
|
+
)
|
|
116
135
|
|
|
117
136
|
|
|
118
137
|
class PromptContent(BaseModel):
|
|
119
138
|
content: str
|
|
139
|
+
#: pre-inspect-extract alignment: extraction fidelity labels. Default empty
|
|
140
|
+
#: when the analyzer does not provide them (backward compatible).
|
|
141
|
+
completeness: str = Field(
|
|
142
|
+
default="",
|
|
143
|
+
description=(
|
|
144
|
+
"Completeness level per pre-inspect-extract: full original / "
|
|
145
|
+
"original · variable unexpanded / assembled / incomplete / summary / not inspectable"
|
|
146
|
+
),
|
|
147
|
+
)
|
|
148
|
+
evidence: str = Field(default="", description="Short verbatim excerpt from the source")
|
|
120
149
|
|
|
121
150
|
|
|
122
151
|
class Finding(BaseModel):
|
{sanityops_cli-0.1.8 → sanityops_cli-0.1.10}/src/sanityops_cli/agents/scanner_agent/prompts.py
RENAMED
|
@@ -21,15 +21,27 @@ A directory is a **Skill** if it contains:
|
|
|
21
21
|
- `SKILL.md` file (primary indicator), OR
|
|
22
22
|
- `README.md` with skill-defining frontmatter/headings (`# Skill`, `# Workflow`)
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
A skill may also be **carried inside code** (e.g. a `@skill` decorator, a skill class/definition embedded in a `.py`/`.ts`/`.json` file). In that case treat it like a tool/prompt carrier: strip the code shell and extract the skill definition verbatim; classify the file by what it actually contains.
|
|
25
|
+
|
|
26
|
+
A skill is only inspectable when its definition carries the structural header — `name`/`description` frontmatter. A bare `## Skills` list or a bare function call that only *describes* a capability is documentation, not an artifact; skip it, do not inspect it.
|
|
27
|
+
|
|
28
|
+
**Four-way classification** (before extracting, decide what the candidate is):
|
|
29
|
+
- **Artifact** — the Skill definition itself (with structural header). Send to inspection.
|
|
30
|
+
- **Carrier** — code/markup that wraps a skill definition (decorator, class, embedded dict). Strip the shell, extract verbatim.
|
|
31
|
+
- **Scaffolding** — metadata, `Evaluation Dimensions`, `Scoring Criteria`, `Test Suggestions`, `Notes`. Discard.
|
|
32
|
+
- **Reference file** — pure code or pure data that contains no extractable skill definition. Skip it — do not report it as a skill.
|
|
33
|
+
|
|
34
|
+
## 2. Exclusion Rules (STRICT) - HIGHEST PRIORITY
|
|
35
|
+
These directories MUST be excluded from all search operations:
|
|
25
36
|
- Hidden paths starting with `.` (e.g., `.git`, `.github`, `.vscode`, `.idea`, `.venv`, `.env`, `.cache`)
|
|
26
37
|
- Common dependency & build output folders (e.g., `node_modules`, `vendor`, `dist`, `build`, `out`, `__pycache__`, `.egg-info`, `site-packages`)
|
|
27
38
|
- Test and fixture directories (e.g., `tests/`, `__tests__/`, `fixtures/`, `mocks/`)
|
|
28
39
|
- Irrelevant non-skill docs (e.g., root `README.md`, `CONTRIBUTING.md`, `LICENSE`, `CHANGELOG.md`, component/API docs)
|
|
40
|
+
- Scaffolding content: `Evaluation Dimensions`, `Scoring Criteria`, `Test Suggestions`, `Notes` (metadata describing a skill, not the skill itself)
|
|
29
41
|
|
|
30
|
-
## 3. Search Strategy
|
|
31
|
-
1. Use `glob` to find `**/SKILL.md` within max depth `{depth}`
|
|
32
|
-
2. Verify README.md for skill markers
|
|
42
|
+
## 3. Search Strategy (Exclusions applied at each step)
|
|
43
|
+
1. Use `glob` to find `**/SKILL.md` within max depth `{depth}` - automatically exclude paths matching Section 2 rules
|
|
44
|
+
2. Verify README.md for skill markers - skip excluded directories
|
|
33
45
|
3. Confirm directory structure
|
|
34
46
|
|
|
35
47
|
## 4. Reporting via store_findings
|
|
@@ -53,6 +65,15 @@ Return summary when done: "Completed: found N skills in {directory}"
|
|
|
53
65
|
TOOL_FINDER_RULES = """\
|
|
54
66
|
You are an expert tool discovery agent. Find all **tools** in `{directory}` and report each one immediately via `store_findings`.
|
|
55
67
|
|
|
68
|
+
## 0. Artifact vs Carrier vs Scaffolding vs Reference File (STRICT)
|
|
69
|
+
Before extracting a tool, classify what you see:
|
|
70
|
+
- **Artifact** — the Tool Schema itself (JSON Schema / function-calling definition with `name` + `description` + `parameters`/`inputSchema`). Send to inspection.
|
|
71
|
+
- **Carrier** — code or markup that wraps a tool definition (e.g. `def f(...): return ...`, a `@tool` decorator, a `Tool(...)` constructor call, backtick strings). A carrier is NOT a tool; strip the shell and extract the schema inside.
|
|
72
|
+
- **Scaffolding** — metadata, Evaluation Dimensions, Scoring Criteria, Test Suggestions, Notes, example usage, registration lists. Discard — never report scaffolding as a tool.
|
|
73
|
+
- **Reference file** — pure code or pure data that contains no extractable tool schema (e.g. a utility module, a data file). Skip it — do not report it as a tool.
|
|
74
|
+
|
|
75
|
+
Do NOT enumerate syntax case by case: `Tool(...)`, `@tool`, `BaseTool`, backticks and `"..."` differ only in which shell to strip, not in whether a tool is present.
|
|
76
|
+
|
|
56
77
|
## 1. Framework-Aware Search Patterns
|
|
57
78
|
|
|
58
79
|
Identify tools by recognizing framework-specific patterns:
|
|
@@ -73,16 +94,45 @@ Identify tools by recognizing framework-specific patterns:
|
|
|
73
94
|
- OpenAPI specs: `"type": "function"` with `operationId`
|
|
74
95
|
- JSON/YAML tool configs: Anthropic `"input_schema"`, OpenAI `"parameters"`
|
|
75
96
|
|
|
76
|
-
##
|
|
97
|
+
## 1.5 Extraction Tiers (pre-inspect-extract alignment)
|
|
98
|
+
For each candidate tool, determine which tier it falls into and state the basis:
|
|
99
|
+
|
|
100
|
+
- **Tier 1 — directly readable**: the schema exists in loadable form — a complete
|
|
101
|
+
JSON Schema inside ``` fences, or a `Tool(name=..., description=..., inputSchema=<json-schema-dict>)`
|
|
102
|
+
where `inputSchema` is already a JSON Schema dict, or a pure JSON Schema.
|
|
103
|
+
→ **verbatim copy**: take the schema as-is, drop only the surrounding shell.
|
|
104
|
+
- **Tier 2 — wrapped in code**: the schema is complete but carried inside code
|
|
105
|
+
(a dict literal in a function, a `.parameters`/`input_schema` object property).
|
|
106
|
+
→ **verbatim copy**: extract the literal, unescape, keep variables as-is.
|
|
107
|
+
- **Tier 3 — only code, no ready-made schema**: constraints are written in
|
|
108
|
+
chained calls (Zod `z.object(...)`), decorators with type annotations,
|
|
109
|
+
or builder patterns (`mcp.NewTool(...)` + `WithString/...`).
|
|
110
|
+
→ **assembly**: copy field-by-field everything already literal in the source
|
|
111
|
+
(`name`, `description`, each parameter key + description, `enum` values,
|
|
112
|
+
the `required` list, `default` values). **Add no field absent from the source.**
|
|
113
|
+
If a constraint cannot be converted (e.g. `.refine()`), do not fabricate an
|
|
114
|
+
equivalent — note it as not representable.
|
|
115
|
+
**The `description` field must not be lost**: description / `.describe()` /
|
|
116
|
+
docstring is the core basis of Tool Schema inspection and is the easiest thing
|
|
117
|
+
to lose during assembly. If the source has a description but the result does
|
|
118
|
+
not, label the whole thing `assembled` and record "description field at risk
|
|
119
|
+
of loss". If the source has no description, the result must not have one either
|
|
120
|
+
— do not write one.
|
|
121
|
+
- **Tier X — unrecognizable**: no structural signature, dynamic registration
|
|
122
|
+
with no literal schema, or only a registration list without `inputSchema`/`parameters`.
|
|
123
|
+
→ label **not inspectable**, record the reason, and do not force a verdict.
|
|
124
|
+
|
|
125
|
+
## 2. Exclusion Rules (STRICT) - HIGHEST PRIORITY
|
|
126
|
+
These directories MUST be excluded from all search operations:
|
|
77
127
|
- Hidden paths starting with `.` (e.g., `.git`, `.github`, `.vscode`, `.idea`, `.venv`, `.env`, `.cache`)
|
|
78
128
|
- Common dependency & build output folders (e.g., `node_modules`, `vendor`, `dist`, `build`, `out`, `__pycache__`, `.egg-info`, `site-packages`)
|
|
79
129
|
- Test and fixture directories (e.g., `tests/`, `__tests__/`, `fixtures/`, `mocks/`)
|
|
80
130
|
- Irrelevant non-tool docs (e.g., root `README.md`, `CONTRIBUTING.md`, `LICENSE`, `CHANGELOG.md`, component/API docs)
|
|
81
131
|
|
|
82
|
-
## 3. Search Strategy
|
|
83
|
-
1. **Pattern-based discovery**: Use `glob` for `*tool*`, `*function*`, `*schema*`
|
|
84
|
-
2. **Content search**: Use `grep`/`rg` for framework markers (e.g., `@tool`, `BaseTool`, `input_schema`)
|
|
85
|
-
3. **Extract schema**: Read file, extract tool name, description, and parameter structure
|
|
132
|
+
## 3. Search Strategy (Exclusions applied at each step)
|
|
133
|
+
1. **Pattern-based discovery**: Use `glob` for `*tool*`, `*function*`, `*schema*` - automatically exclude paths matching Section 2 rules
|
|
134
|
+
2. **Content search**: Use `grep`/`rg` for framework markers (e.g., `@tool`, `BaseTool`, `input_schema`) - skip excluded directories
|
|
135
|
+
3. **Extract schema**: Read file, classify the tool (Section 1.5), extract tool name, description, and parameter structure, and record the completeness level
|
|
86
136
|
|
|
87
137
|
## 4. Reporting via store_findings
|
|
88
138
|
For EACH tool found, immediately call:
|
|
@@ -95,21 +145,45 @@ store_findings({{
|
|
|
95
145
|
"content": {{
|
|
96
146
|
"name": "<tool_name>",
|
|
97
147
|
"description": "<brief_description>",
|
|
98
|
-
"parameters": {{<extracted_schema>}}
|
|
148
|
+
"parameters": {{<extracted_schema>}},
|
|
149
|
+
"completeness": "<full original | assembled | incomplete | summary | not inspectable>",
|
|
150
|
+
"evidence": "<short verbatim excerpt from the source proving the extraction>"
|
|
99
151
|
}}
|
|
100
152
|
}}
|
|
101
153
|
}})
|
|
102
154
|
|
|
103
155
|
**CRITICAL**: Report immediately, do NOT wait to collect all tools. Each finding = one tool call.
|
|
104
156
|
|
|
157
|
+
- **Completeness labels**: `full original` = verbatim schema; `assembled` = rebuilt from code;
|
|
158
|
+
`incomplete` = missing base fields (e.g. no schema, only name/description);
|
|
159
|
+
`summary` = cannot be matched to the original in full; `not inspectable` = cannot be extracted.
|
|
160
|
+
- **Evidence**: quote a short verbatim excerpt of the source (head/tail fragment for verbatim
|
|
161
|
+
copies, per-field source fragments for assembled schemas). A reader must be able to find
|
|
162
|
+
every point in the source using only the evidence.
|
|
163
|
+
|
|
105
164
|
## 5. Output Format
|
|
106
|
-
Return summary when done: "
|
|
165
|
+
Return summary when done as JSON: {{"directory": "{directory}", "tools_found": <number>, "not_inspectable": <number>, "status": "completed"}}
|
|
107
166
|
"""
|
|
108
167
|
|
|
109
168
|
PROMPT_FINDER_RULES = """\
|
|
110
169
|
You are a prompt discovery agent. Your objective is to find all **LLM prompts** within `{directory}` by analyzing standalone prompt files and reverse-tracing LLM call sites in the codebase. Report each finding immediately via `store_findings`.
|
|
111
170
|
|
|
112
|
-
##
|
|
171
|
+
## 0. Artifact vs Carrier vs Scaffolding vs Reference File (STRICT)
|
|
172
|
+
Before extracting a prompt, classify what you see:
|
|
173
|
+
- **Artifact** — the System Prompt text itself (prose/markdown instructions for the LLM). Send to inspection.
|
|
174
|
+
- **Carrier** — code or markup that wraps a prompt (a string constant, an f-string triple-quoted block, backtick template strings, a `return "..."` in a function). A carrier is NOT a prompt; strip the shell and copy the string content verbatim.
|
|
175
|
+
- **Scaffolding** — non-prompt content: Metadata, `Evaluation Dimensions`, `Scoring Criteria`, `Test Suggestions`, `Notes`, `Source Profile` sections, or registration lists. Discard — never report scaffolding as a prompt.
|
|
176
|
+
- **Reference file** — pure code or pure data that contains no extractable prompt (e.g. a utility module, a data file). Skip it — do not report it as a prompt.
|
|
177
|
+
|
|
178
|
+
**Verbatim copy rule**: copy the prompt word-for-word; do not rewrite, polish, or complete it. Drop only the shell (assignment statement, function definition line, `return`, fence markers, backticks). Unescape (`\\\\n` → newline); keep variables as-is, do not substitute them.
|
|
179
|
+
|
|
180
|
+
## 0.5 Variable examination (STRICT)
|
|
181
|
+
For every prompt with variables, examine each placeholder:
|
|
182
|
+
- **Runtime data** (e.g. `{{local_tz}}`, `{{date.today()}}`, `{{context}}`) → keep as-is, label **full original**.
|
|
183
|
+
- **A variable that expands into a rule sentence** (e.g. `{{reference_prompt}}`, `{{tone_prompt}}`) → label **original · variable unexpanded**, and state which variable and how many instructions it expands into.
|
|
184
|
+
A rule written inside a variable is absent from the literal string. If labeled "full original", checks like "reference specification not declared" would wrongly fail even though the source did declare it.
|
|
185
|
+
|
|
186
|
+
## 1. Search Strategy (Execute in Sequence, Exclusions applied at each step)
|
|
113
187
|
|
|
114
188
|
### Track A: Reverse Call-Site Tracing (Primary)
|
|
115
189
|
1. **Locate LLM Invocation Sites**: `grep` for common LLM call methods across the codebase:
|
|
@@ -127,11 +201,13 @@ You are a prompt discovery agent. Your objective is to find all **LLM prompts**
|
|
|
127
201
|
- Variable names: `SYSTEM_PROMPT`, `PROMPT_TEMPLATE`, `USER_PROMPT_FMT`, `DEFAULT_PROMPT`
|
|
128
202
|
- String markers: `You are a`, `Act as a`, `System Instructions:`, `<<SYS>>`
|
|
129
203
|
|
|
130
|
-
## 2. Exclusion Rules (STRICT)
|
|
204
|
+
## 2. Exclusion Rules (STRICT) - HIGHEST PRIORITY
|
|
205
|
+
These directories MUST be excluded from all search operations:
|
|
131
206
|
- Hidden paths starting with `.` (e.g., `.git`, `.github`, `.vscode`, `.idea`, `.venv`, `.env`, `.cache`)
|
|
132
207
|
- Common dependency & build output folders (e.g., `node_modules`, `vendor`, `dist`, `build`, `out`, `__pycache__`, `.egg-info`, `site-packages`)
|
|
133
208
|
- Test and fixture directories (e.g., `tests/`, `__tests__/`, `fixtures/`, `mocks/`)
|
|
134
209
|
- Irrelevant non-prompt docs (e.g., root `LICENSE`)
|
|
210
|
+
- Scaffolding sections: `Evaluation Dimensions`, `Scoring Criteria`, `Test Suggestions`, `Notes`, `Source Profile` (metadata, not prompts)
|
|
135
211
|
|
|
136
212
|
## 3. Reporting via store_findings
|
|
137
213
|
For EACH prompt found (whether standalone or traced from a call site), call `store_findings` IMMEDIATELY:
|
|
@@ -142,18 +218,27 @@ store_findings({{
|
|
|
142
218
|
"type": "prompt",
|
|
143
219
|
"relative": "<absolute_file_path>",
|
|
144
220
|
"content": {{
|
|
145
|
-
"content": "<extracted_prompt_text_or_template>"
|
|
221
|
+
"content": "<extracted_prompt_text_or_template>",
|
|
222
|
+
"completeness": "<full original | original · variable unexpanded | assembled | incomplete | summary | not inspectable>",
|
|
223
|
+
"evidence": "<short verbatim excerpt from the source>"
|
|
146
224
|
}}
|
|
147
225
|
}}
|
|
148
226
|
}})
|
|
149
227
|
|
|
150
228
|
**CRITICAL RULES**:
|
|
151
229
|
- For traced prompts, extract the actual prompt content/template defined before the call, NOT just the `client.create()` line itself.
|
|
230
|
+
- **Completeness labels**: `full original` = verbatim copy, complete; `original · variable unexpanded` = verbatim copy with unexpanded rule variables (list them); `incomplete` = missing base fields / assembly logic not provided; `summary` = summarized or transcribed, cannot be matched to the original in full; `not inspectable` = cannot be extracted.
|
|
231
|
+
- **Evidence**: quote a short verbatim excerpt (head/tail fragment) of the source. A reader must be able to find every point in the original using only the evidence.
|
|
152
232
|
- Report immediately upon discovery.
|
|
153
233
|
|
|
154
234
|
## 4. Output Format
|
|
155
|
-
When all searches and tracings are complete, return:
|
|
156
|
-
|
|
235
|
+
When all searches and tracings are complete, return a JSON summary with this exact structure:
|
|
236
|
+
{{
|
|
237
|
+
"directory": "{directory}",
|
|
238
|
+
"prompts_found": <number>,
|
|
239
|
+
"not_inspectable": <number>,
|
|
240
|
+
"status": "completed"
|
|
241
|
+
}}
|
|
157
242
|
"""
|
|
158
243
|
|
|
159
244
|
INSPECT_PARENT_PROMPT = """\
|
|
@@ -213,6 +298,8 @@ store_findings({{
|
|
|
213
298
|
}}
|
|
214
299
|
}}
|
|
215
300
|
}})
|
|
301
|
+
```
|
|
302
|
+
- A skill is only inspectable when its definition carries the `name`/`description` structural header. A markdown file that only *describes* skills (e.g. a `## Skills` list) is scaffolding, not a skill artifact — skip it.
|
|
216
303
|
|
|
217
304
|
**CRITICAL**: Report each file immediately after analysis. Do not batch.
|
|
218
305
|
|
|
@@ -250,13 +337,17 @@ store_findings({{
|
|
|
250
337
|
"content": {{
|
|
251
338
|
"name": "<tool_name>",
|
|
252
339
|
"description": "<tool_description>",
|
|
253
|
-
"parameters": {{<json_schema>}}
|
|
340
|
+
"parameters": {{<json_schema>}},
|
|
341
|
+
"completeness": "<full original | assembled | incomplete | summary | not inspectable>",
|
|
342
|
+
"evidence": "<short verbatim excerpt from the source>"
|
|
254
343
|
}}
|
|
255
344
|
}}
|
|
256
345
|
}})
|
|
257
346
|
|
|
258
347
|
**CRITICAL**: Report each file immediately after analysis. Do not batch.
|
|
259
348
|
|
|
349
|
+
- **Completeness labels**: `full original` = verbatim schema; `assembled` = rebuilt from code (Zod/decorator/builder); `incomplete` = missing base fields (e.g. only name/description, no schema); `summary` = cannot be matched to the original in full; `not inspectable` = cannot be extracted. When a schema is assembled, attach the source fragment for each field.
|
|
350
|
+
|
|
260
351
|
## Completion
|
|
261
352
|
Return: "Completed: analyzed N tools"
|
|
262
353
|
"""
|
|
@@ -281,13 +372,18 @@ store_findings({{
|
|
|
281
372
|
"type": "prompt",
|
|
282
373
|
"relative": "<absolute_file_path>",
|
|
283
374
|
"content": {{
|
|
284
|
-
"content": "<full_prompt_text>"
|
|
375
|
+
"content": "<full_prompt_text>",
|
|
376
|
+
"completeness": "<full original | original · variable unexpanded | assembled | incomplete | summary | not inspectable>",
|
|
377
|
+
"evidence": "<short verbatim excerpt from the source>"
|
|
285
378
|
}}
|
|
286
379
|
}}
|
|
287
380
|
}})
|
|
288
381
|
|
|
289
382
|
**CRITICAL**: Report each file immediately after analysis. Do not batch. The prompt `content` you report is the artifact that gets inspected — a truncated or summarized copy produces false defects.
|
|
290
383
|
|
|
384
|
+
- **Completeness labels**: `full original` = verbatim copy, complete; `original · variable unexpanded` = verbatim copy with unexpanded rule variables (list them); `assembled` = rebuilt from code fragments; `incomplete` = missing base fields; `summary` = summarized or transcribed; `not inspectable` = cannot be extracted.
|
|
385
|
+
- **Variable examination**: for every placeholder, distinguish runtime data (`{{question}}`) from a variable that expands into rules (`{{reference_prompt}}`). The latter must be labeled `original · variable unexpanded`.
|
|
386
|
+
|
|
291
387
|
## Completion
|
|
292
388
|
Return: "Completed: analyzed N prompts"
|
|
293
389
|
"""
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"""
|
|
17
17
|
FileReadTool - A comprehensive file reading tool.
|
|
18
18
|
|
|
19
|
-
Adapted for the
|
|
19
|
+
Adapted for the sanityops-cli agent framework.
|
|
20
20
|
|
|
21
21
|
This module provides functionality to read various file types including:
|
|
22
22
|
- Text files (with line numbers and offset/limit support)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Copyright 2026 zipsonken
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""Code Contract inspection module for Logic Artifacts."""
|
|
16
|
+
|
|
17
|
+
from .models import (
|
|
18
|
+
RULE_DEFINITIONS,
|
|
19
|
+
GateResult,
|
|
20
|
+
QCArtifactResult,
|
|
21
|
+
QCDefect,
|
|
22
|
+
QCInspectionResult,
|
|
23
|
+
QCRuleID,
|
|
24
|
+
Severity,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"QCArtifactResult",
|
|
29
|
+
"QCDefect",
|
|
30
|
+
"QCInspectionResult",
|
|
31
|
+
"QCRuleID",
|
|
32
|
+
"RULE_DEFINITIONS",
|
|
33
|
+
"Severity",
|
|
34
|
+
"GateResult",
|
|
35
|
+
]
|