yobitsugi 0.1.0__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.
Files changed (37) hide show
  1. yobitsugi-0.1.0/.gitignore +174 -0
  2. yobitsugi-0.1.0/CHANGELOG.md +44 -0
  3. yobitsugi-0.1.0/LICENSE +21 -0
  4. yobitsugi-0.1.0/PKG-INFO +520 -0
  5. yobitsugi-0.1.0/README.md +482 -0
  6. yobitsugi-0.1.0/npm/README.md +31 -0
  7. yobitsugi-0.1.0/pyproject.toml +82 -0
  8. yobitsugi-0.1.0/yobitsugi/__init__.py +4 -0
  9. yobitsugi-0.1.0/yobitsugi/__main__.py +6 -0
  10. yobitsugi-0.1.0/yobitsugi/cli.py +300 -0
  11. yobitsugi-0.1.0/yobitsugi/core/__init__.py +1 -0
  12. yobitsugi-0.1.0/yobitsugi/core/apply.py +238 -0
  13. yobitsugi-0.1.0/yobitsugi/core/detect.py +142 -0
  14. yobitsugi-0.1.0/yobitsugi/core/fix.py +197 -0
  15. yobitsugi-0.1.0/yobitsugi/core/llm.py +418 -0
  16. yobitsugi-0.1.0/yobitsugi/core/parse.py +552 -0
  17. yobitsugi-0.1.0/yobitsugi/core/pipeline.py +123 -0
  18. yobitsugi-0.1.0/yobitsugi/core/scan.py +148 -0
  19. yobitsugi-0.1.0/yobitsugi/core/tests_gen.py +158 -0
  20. yobitsugi-0.1.0/yobitsugi/core/validate.py +88 -0
  21. yobitsugi-0.1.0/yobitsugi/data/SKILL.md +158 -0
  22. yobitsugi-0.1.0/yobitsugi/data/fix_prompts.md +114 -0
  23. yobitsugi-0.1.0/yobitsugi/data/parser_recipes.md +135 -0
  24. yobitsugi-0.1.0/yobitsugi/data/providers.md +120 -0
  25. yobitsugi-0.1.0/yobitsugi/data/scanners.yaml +115 -0
  26. yobitsugi-0.1.0/yobitsugi/data/test_templates.md +161 -0
  27. yobitsugi-0.1.0/yobitsugi/installers/__init__.py +5 -0
  28. yobitsugi-0.1.0/yobitsugi/installers/aider.py +88 -0
  29. yobitsugi-0.1.0/yobitsugi/installers/base.py +116 -0
  30. yobitsugi-0.1.0/yobitsugi/installers/claude.py +57 -0
  31. yobitsugi-0.1.0/yobitsugi/installers/codex.py +43 -0
  32. yobitsugi-0.1.0/yobitsugi/installers/copilot.py +47 -0
  33. yobitsugi-0.1.0/yobitsugi/installers/cursor.py +53 -0
  34. yobitsugi-0.1.0/yobitsugi/installers/gemini.py +41 -0
  35. yobitsugi-0.1.0/yobitsugi/installers/opencode.py +41 -0
  36. yobitsugi-0.1.0/yobitsugi/installers/utils.py +12 -0
  37. yobitsugi-0.1.0/yobitsugi/templates/slash_command.md +47 -0
@@ -0,0 +1,174 @@
1
+ # ---------- Python ----------
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ *.pyd
7
+ *.pyo
8
+
9
+ # Build artifacts
10
+ build/
11
+ dist/
12
+ sdist/
13
+ wheels/
14
+ *.egg
15
+ *.egg-info/
16
+ .eggs/
17
+ MANIFEST
18
+ pip-wheel-metadata/
19
+ share/python-wheels/
20
+
21
+ # Installer logs
22
+ pip-log.txt
23
+ pip-delete-this-directory.txt
24
+
25
+ # ---------- Virtual environments ----------
26
+ .venv/
27
+ venv/
28
+ env/
29
+ ENV/
30
+ .env/
31
+ .python-version
32
+ .tool-versions
33
+
34
+ # ---------- Test / type / lint caches ----------
35
+ .pytest_cache/
36
+ .mypy_cache/
37
+ .dmypy.json
38
+ dmypy.json
39
+ .ruff_cache/
40
+ .pyre/
41
+ .pytype/
42
+ .cache/
43
+
44
+ # Coverage
45
+ .coverage
46
+ .coverage.*
47
+ coverage.xml
48
+ htmlcov/
49
+ .hypothesis/
50
+ nosetests.xml
51
+ *.cover
52
+ *.py,cover
53
+
54
+ # ---------- Node / npm wrapper ----------
55
+ node_modules/
56
+ npm-debug.log*
57
+ yarn-debug.log*
58
+ yarn-error.log*
59
+ .pnpm-debug.log*
60
+ .npm/
61
+ .yarn-integrity
62
+ # Note: package-lock.json / yarn.lock / pnpm-lock.yaml are committed on purpose.
63
+
64
+ # ---------- Editors / IDEs ----------
65
+ .vscode/
66
+ !.vscode/settings.json.example
67
+ .idea/
68
+ *.iml
69
+ *.swp
70
+ *.swo
71
+ *~
72
+ .project
73
+ .pydevproject
74
+ .spyderproject
75
+ .spyproject
76
+ .ropeproject
77
+ *.sublime-project
78
+ *.sublime-workspace
79
+ .vim/
80
+
81
+ # ---------- OS metadata ----------
82
+ .DS_Store
83
+ .DS_Store?
84
+ ._*
85
+ .Spotlight-V100
86
+ .Trashes
87
+ ehthumbs.db
88
+ Thumbs.db
89
+ Desktop.ini
90
+
91
+ # ---------- Secrets / env files (NEVER commit these) ----------
92
+ .env
93
+ .env.*
94
+ !.env.example
95
+ *.pem
96
+ *.key
97
+ *.p12
98
+ *.pfx
99
+ .netrc
100
+ credentials.json
101
+ secrets.yaml
102
+ .secrets/
103
+
104
+ # Local-only LLM/API key config
105
+ .api_keys
106
+ api_keys.txt
107
+ *.token
108
+
109
+ # ---------- Yobitsugi runtime artifacts ----------
110
+ # Workspaces created by `yobitsugi run` / `yobitsugi scan`
111
+ .yobitsugi/
112
+ yobitsugi_workspace/
113
+
114
+ # Per-file backups written by `apply` before patching
115
+ *.yobitsugi.bak
116
+
117
+ # Local LLM provider config (lives in ~/.yobitsugi/ but guard against accidental commits)
118
+ config.yaml
119
+ !yobitsugi/data/*.yaml
120
+
121
+ # Generated scanner outputs accidentally placed in repo
122
+ findings.json
123
+ applied.json
124
+ languages.json
125
+ scan_report.json
126
+ validation.json
127
+ raw/
128
+
129
+ # ---------- Documentation builds ----------
130
+ docs/_build/
131
+ docs/_static/
132
+ docs/_templates/
133
+ site/
134
+
135
+ # ---------- Jupyter / notebooks ----------
136
+ .ipynb_checkpoints/
137
+ *.ipynb_checkpoints
138
+
139
+ # ---------- Logs / temp ----------
140
+ *.log
141
+ *.tmp
142
+ *.bak
143
+ *.orig
144
+ *.rej
145
+
146
+ # ---------- Tool-specific ----------
147
+ # Hatch
148
+ .hatch/
149
+
150
+ # pyenv
151
+ .python-version
152
+
153
+ # PEP 582
154
+ __pypackages__/
155
+
156
+ # Direnv
157
+ .envrc
158
+
159
+ # Celery
160
+ celerybeat-schedule
161
+ celerybeat.pid
162
+
163
+ # SageMath
164
+ *.sage.py
165
+
166
+ # Translations
167
+ *.mo
168
+ *.pot
169
+
170
+ # ---------- IDE / Claude Code workspace ----------
171
+ .claude/cache/
172
+ .claude/logs/
173
+ .claude/sessions/
174
+ # keep .claude/settings.json + skills, ignore caches
@@ -0,0 +1,44 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ### Changed
6
+ - **Python 3.11+ is now required.** Python 3.10 is no longer supported.
7
+ - The pipeline orchestrator now runs **in-process**. Stages are imported and called as Python functions instead of being forked as subprocesses. Each stage is still a standalone CLI entrypoint, and the JSON-file workspace contract between stages is preserved.
8
+ - `core.fix.generate_fix(finding, root, ...)` is now a public pure function that returns the diff string. `core.fix.main()` is a thin CLI wrapper around it.
9
+ - `core.apply.apply_diff(diff_text, root, workspace, ...)` is now a public pure function. `core.apply.main()` is a thin CLI wrapper around it.
10
+ - Each `core.<stage>.main()` accepts an optional `argv: list[str] | None` parameter so it can be invoked from Python without mutating `sys.argv`.
11
+
12
+ ### Fixed
13
+ - `cli.cmd_config` was passing an `argparse.Namespace` to `llm.resolve_config()` which expects positional strings — this raised a `TypeError` at runtime. The CLI now calls `resolve_config()` correctly.
14
+ - `cli.cmd_run` no longer mutates `sys.argv`; it calls `pipeline.run_pipeline()` directly.
15
+ - `cli.cmd_scan` and `cli.cmd_rollback` no longer spawn Python subprocesses; they call the relevant `main([...])` in-process.
16
+
17
+ ### Added
18
+ - **Unit test suite** (`tests/`) — 147 hermetic pytest tests covering `detect`, `parse`, `apply`, `llm`, `pipeline`, `cli`, and all platform installers. Runs in ~2 seconds. Tested against Python 3.11, 3.12, 3.13.
19
+ - **GitHub Actions CI** (`.github/workflows/ci.yml`) — runs ruff, mypy, and pytest on every push and PR across Python 3.11 / 3.12 / 3.13.
20
+ - **GitHub Actions release + publish workflow** (`.github/workflows/publish.yml`) — fully automates tagging, GitHub Release creation, and PyPI publishing. Five jobs:
21
+ - **prep** — reads the version from `pyproject.toml`, compares against existing tags, decides whether to release on this run.
22
+ - **tag** — when a push to `main` bumps `pyproject.toml`'s version above any existing tag, verifies `yobitsugi/__init__.py` matches, then creates and pushes the `v<version>` git tag. Bumping the version in one place is the **only** action a maintainer needs to take to cut a release.
23
+ - **build** — produces sdist + wheel from the tagged commit, validates with `twine check --strict`.
24
+ - **release** — creates a GitHub Release at https://github.com/FiNiX-GaMmA/yobitsugi/releases with notes extracted from the matching `## <version>` section of `CHANGELOG.md` (auto-generated from commits as a fallback) and the wheel + sdist attached as assets. Tags containing `-rc`, `-alpha`, or `-beta` are marked as pre-releases.
25
+ - **publish** — uploads the same artifacts to PyPI, gated behind the `pypi` GitHub Environment. Authenticated by a single `PYPI_TOKEN` repository secret (the workflow passes `__token__` as the username, per PyPI's API-token convention).
26
+ - Alternative triggers still work: a manual `v*` tag push, a manually-published GitHub Release, or a `workflow_dispatch` from the Actions tab.
27
+ - `pyproject.toml` now includes `[tool.pytest.ini_options]`, `[tool.mypy]`, and an expanded `[tool.ruff.lint]` configuration.
28
+ - `Changelog` URL in project metadata.
29
+ - **Comprehensive `.gitignore`** covering Python build/cache artifacts, virtual environments, lint/type/test caches, IDE files, OS metadata, every common secret/credential filename (`.env`, `*.pem`, `*.key`, `*.token`, `credentials.json`, etc.), `yobitsugi` runtime outputs (workspaces, `.yobitsugi.bak` backups, accidental root-level `findings.json`/`applied.json`/`languages.json`/`scan_report.json`/`validation.json`/`raw/`), and documentation builds — with a negation rule (`!yobitsugi/data/*.yaml`) so the shipped scanner registry is never accidentally swallowed.
30
+
31
+ ### Removed
32
+ - The redundant `yobitsugi/yobitsugi/yobitsugi/` wrapper folder layer. The Python package now sits directly under the repo root.
33
+ - Phantom `yobitsugi/{core,data,installers,templates,viz}` directory (created accidentally by a failed shell brace expansion).
34
+
35
+ ## 0.1.0 — initial release
36
+
37
+ - Pipeline: detect → scan → parse → fix → apply → tests → validate.
38
+ - Unified Finding schema across 17 SAST/SCA scanner parsers.
39
+ - LLM provider abstraction: OpenAI, Anthropic, Google, Ollama, and any OpenAI-compatible endpoint (Groq, Together, Fireworks, vLLM, LM Studio, OpenRouter).
40
+ - Platform installers: Claude Code, Codex, Cursor, Gemini CLI, Aider, OpenCode, GitHub Copilot CLI.
41
+ - Three install paths: Python (`pipx`/`uv`/`pip`), npm/npx (delegates to `uvx`), or manual git-clone into `~/.claude/skills/`.
42
+ - Canonical `SKILL.md` at repo root, bundled inside the wheel so the Claude installer writes the exact same file you'd get from a manual drop-in.
43
+ - CLI: `install`, `uninstall`, `list-platforms`, `detect-platforms`, `run`, `scan`, `findings`, `rollback`, `config`, `version`.
44
+ - Safety: dirty-tree guard, `.yobitsugi.bak` per modified file, `applied.json` rollback log, prompt-injection wrapping of untrusted snippets, unified-diff-only model output.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 yobitsugi contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.