kiste 0.8.6__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 (58) hide show
  1. kiste-0.8.6/LICENSE +201 -0
  2. kiste-0.8.6/PKG-INFO +475 -0
  3. kiste-0.8.6/README.md +453 -0
  4. kiste-0.8.6/pyproject.toml +49 -0
  5. kiste-0.8.6/setup.cfg +4 -0
  6. kiste-0.8.6/src/kiste/__init__.py +47 -0
  7. kiste-0.8.6/src/kiste/argocd.py +157 -0
  8. kiste-0.8.6/src/kiste/bootstrap.py +123 -0
  9. kiste-0.8.6/src/kiste/cli.py +1418 -0
  10. kiste-0.8.6/src/kiste/cloud.py +96 -0
  11. kiste-0.8.6/src/kiste/data.py +179 -0
  12. kiste-0.8.6/src/kiste/data_cards.py +54 -0
  13. kiste-0.8.6/src/kiste/data_lineage.py +34 -0
  14. kiste-0.8.6/src/kiste/data_providers.py +311 -0
  15. kiste-0.8.6/src/kiste/gitops.py +23 -0
  16. kiste-0.8.6/src/kiste/gitops_core.py +147 -0
  17. kiste-0.8.6/src/kiste/images.py +16 -0
  18. kiste-0.8.6/src/kiste/images_core.py +137 -0
  19. kiste-0.8.6/src/kiste/models.py +434 -0
  20. kiste-0.8.6/src/kiste/module_registry.py +81 -0
  21. kiste-0.8.6/src/kiste/providers.py +304 -0
  22. kiste-0.8.6/src/kiste/release.py +375 -0
  23. kiste-0.8.6/src/kiste/reports.py +299 -0
  24. kiste-0.8.6/src/kiste/scanner.py +24 -0
  25. kiste-0.8.6/src/kiste/scanner_core.py +455 -0
  26. kiste-0.8.6/src/kiste/secrets.py +32 -0
  27. kiste-0.8.6/src/kiste/secrets_core.py +121 -0
  28. kiste-0.8.6/src/kiste/self_hosting.py +117 -0
  29. kiste-0.8.6/src/kiste/storage.py +153 -0
  30. kiste-0.8.6/src/kiste/targets.py +17 -0
  31. kiste-0.8.6/src/kiste/targets_core.py +55 -0
  32. kiste-0.8.6/src/kiste/tokens.py +141 -0
  33. kiste-0.8.6/src/kiste/tokens_core.py +120 -0
  34. kiste-0.8.6/src/kiste/workspace.py +38 -0
  35. kiste-0.8.6/src/kiste/workspace_core.py +279 -0
  36. kiste-0.8.6/src/kiste/workspace_scan.py +49 -0
  37. kiste-0.8.6/src/kiste.egg-info/PKG-INFO +475 -0
  38. kiste-0.8.6/src/kiste.egg-info/SOURCES.txt +56 -0
  39. kiste-0.8.6/src/kiste.egg-info/dependency_links.txt +1 -0
  40. kiste-0.8.6/src/kiste.egg-info/entry_points.txt +2 -0
  41. kiste-0.8.6/src/kiste.egg-info/requires.txt +9 -0
  42. kiste-0.8.6/src/kiste.egg-info/top_level.txt +1 -0
  43. kiste-0.8.6/tests/test_cli.py +9 -0
  44. kiste-0.8.6/tests/test_data_cli.py +46 -0
  45. kiste-0.8.6/tests/test_data_dvc.py +21 -0
  46. kiste-0.8.6/tests/test_data_hf_dataset.py +17 -0
  47. kiste-0.8.6/tests/test_data_kaggle.py +16 -0
  48. kiste-0.8.6/tests/test_data_roboflow.py +16 -0
  49. kiste-0.8.6/tests/test_gitops_sops.py +48 -0
  50. kiste-0.8.6/tests/test_image_target_security.py +45 -0
  51. kiste-0.8.6/tests/test_library_api.py +84 -0
  52. kiste-0.8.6/tests/test_local_scan.py +14 -0
  53. kiste-0.8.6/tests/test_phase8.py +64 -0
  54. kiste-0.8.6/tests/test_phase8_5_release.py +76 -0
  55. kiste-0.8.6/tests/test_provider_scan.py +149 -0
  56. kiste-0.8.6/tests/test_review.py +52 -0
  57. kiste-0.8.6/tests/test_token_metadata.py +24 -0
  58. kiste-0.8.6/tests/test_workspace.py +55 -0
kiste-0.8.6/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ https://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Kiste contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ https://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
kiste-0.8.6/PKG-INFO ADDED
@@ -0,0 +1,475 @@
1
+ Metadata-Version: 2.4
2
+ Name: kiste
3
+ Version: 0.8.6
4
+ Summary: Stabilized repo, data, GitOps, cloud, Argo CD, self-hosting, and release inspector
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Homepage, https://github.com/KisteBox/kiste-py
7
+ Project-URL: Repository, https://github.com/KisteBox/kiste-py
8
+ Project-URL: Issues, https://github.com/KisteBox/kiste-py/issues
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.10
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Provides-Extra: github
16
+ Requires-Dist: PyGithub; extra == "github"
17
+ Provides-Extra: hf
18
+ Requires-Dist: huggingface-hub; extra == "hf"
19
+ Provides-Extra: sops
20
+ Requires-Dist: subprocess-tee; extra == "sops"
21
+ Dynamic: license-file
22
+
23
+ # Kiste
24
+
25
+ Kiste is a Python CLI for inspecting application repositories and preparing them
26
+ for Kubernetes/GitOps packaging.
27
+
28
+ It can scan local, GitHub, and Hugging Face repositories; combine many repos into
29
+ one workspace graph; inspect dataset dependencies; check token capabilities;
30
+ generate a GitOps repo; prepare cloud and Argo CD plans; and create SOPS-style
31
+ encrypted Kubernetes Secret manifests.
32
+
33
+ Kiste is also an importable Python library. The CLI is one interface over the
34
+ same scanner, workspace, GitOps, token, and secret-management APIs.
35
+
36
+ ## Install
37
+
38
+ Install `uv` first if it is not already available:
39
+
40
+ ```powershell
41
+ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
42
+ ```
43
+
44
+ From the repo root:
45
+
46
+ ```bash
47
+ uv sync
48
+ ```
49
+
50
+ Install provider SDK extras when scanning remote repositories:
51
+
52
+ ```bash
53
+ uv sync --extra github
54
+ uv sync --extra hf
55
+ uv sync --extra sops
56
+ uv sync --group dev
57
+ ```
58
+
59
+ The GitHub provider prefers PyGithub when the `github` extra is installed. The
60
+ Hugging Face provider prefers `huggingface_hub` when the `hf` extra is installed.
61
+ Kiste keeps a stdlib HTTP fallback for minimal installs.
62
+
63
+ If `kiste` is not found after install, either run through Python:
64
+
65
+ ```bash
66
+ uv run python -m kiste.cli --help
67
+ ```
68
+
69
+ or use the uv-managed console script:
70
+
71
+ ```bash
72
+ uv run kiste --help
73
+ ```
74
+
75
+ ## Quick Start
76
+
77
+ Local repo scan:
78
+
79
+ ```bash
80
+ kiste init --name robot-api
81
+ kiste scan .
82
+ kiste repo summary
83
+ kiste check --repo . --target k8s
84
+ ```
85
+
86
+ Remote scans:
87
+
88
+ ```bash
89
+ kiste scan github owner/repo --ref main
90
+ kiste scan github owner/repo --ref main --token github-dev
91
+ kiste scan hf owner/model-name
92
+ kiste scan hf owner/dataset-name --type dataset
93
+ kiste provider hf inspect owner/space-name --type space
94
+ ```
95
+
96
+ Token metadata:
97
+
98
+ ```bash
99
+ kiste token add github --name github-dev --scope repo:read,actions:read,packages:write --expires 2026-08-01 --metadata-only
100
+ kiste token add hf --name hf-dev --scope repo:read --expires 2026-08-01 --metadata-only
101
+ kiste token list
102
+ kiste token check github-dev --need repo:read
103
+ ```
104
+
105
+ Workspace workflow:
106
+
107
+ ```bash
108
+ kiste workspace init --name robot-platform
109
+ kiste workspace add github owner/frontend --name frontend --type frontend --token github-dev
110
+ kiste workspace add github owner/api --name api --type backend --token github-dev
111
+ kiste workspace add hf owner/model --name model --type model --token hf-dev
112
+ kiste connect api model --relation loads-model
113
+ kiste workspace scan
114
+ kiste workspace graph
115
+ kiste workspace token matrix
116
+ kiste workspace check --target k8s
117
+ ```
118
+
119
+ Image and target security planning:
120
+
121
+ ```bash
122
+ kiste image inspect docker.io/owner/api:latest
123
+ kiste image tags docker.io/owner/api
124
+ kiste image check-pull docker.io/owner/api:latest
125
+ kiste link image api docker.io/owner/api:latest
126
+ kiste target plan --service api
127
+ kiste workspace check --include-images --target-plan
128
+ ```
129
+
130
+ Dataset workflow:
131
+
132
+ ```bash
133
+ kiste token add roboflow --name roboflow-dev --scope dataset:read,export:read --expires 2026-08-01 --metadata-only
134
+ kiste data add kaggle owner/dataset --name traffic-data
135
+ kiste data add roboflow workspace/project/1 --name weld-detection --token roboflow-dev
136
+ kiste data add hf owner/dataset --name hf-dataset
137
+ kiste data add dvc ./data.dvc --name training-data
138
+ kiste data add local ./datasets/weld-seams --name weld-seams
139
+ kiste data inspect weld-detection
140
+ kiste data scan
141
+ kiste data connect weld-detection model --relation trains-model
142
+ kiste data check weld-detection
143
+ kiste data card weld-detection --output docs/others/datasets/weld-detection.md
144
+ kiste data export-plan weld-detection --format yolov8
145
+ kiste workspace graph --include-data
146
+ kiste workspace check --include-data
147
+ ```
148
+
149
+ Phase 8 bootstrap, cloud, Argo CD, and self-hosting workflow:
150
+
151
+ ```bash
152
+ kiste module list
153
+ kiste module doctor
154
+ kiste bootstrap core
155
+ kiste bootstrap workspace
156
+ kiste bootstrap gitops
157
+ kiste bootstrap argocd
158
+ kiste cloud plan --provider aws
159
+ kiste cloud check --provider aws
160
+ kiste argocd init --repo-url https://github.com/example/kiste-gitops.git
161
+ kiste argocd generate
162
+ kiste argocd validate
163
+ kiste self init
164
+ kiste self scan
165
+ kiste self check
166
+ kiste self improve
167
+ kiste release check
168
+ kiste release freeze
169
+ kiste release package
170
+ kiste release candidate --version 0.8.5-rc1
171
+ ```
172
+
173
+ GitOps and secrets workflow:
174
+
175
+ ```bash
176
+ kiste gitops init --workspace robot-platform --output ./robot-platform-gitops
177
+ kiste secrets init sops --age
178
+ kiste gitops plan
179
+ kiste gitops generate --env dev
180
+ kiste secrets add api --from-env DATABASE_URL --from-env SECRET_KEY --encrypt sops
181
+ kiste secrets scan
182
+ kiste gitops validate
183
+ kiste review
184
+ ```
185
+
186
+ ## Features
187
+
188
+ - Stable Python API under `kiste.scanner`, `kiste.workspace`, `kiste.gitops`,
189
+ `kiste.secrets`, and `kiste.tokens`
190
+ - Typed data models under `kiste.models`
191
+ - Local Docker repo scanning
192
+ - GitHub repo scanning through selected important files
193
+ - Hugging Face model, dataset, and Space scanning with type inference
194
+ - App spec extraction: language, framework, ports, services, env vars, GPU hints
195
+ - Token metadata and capability checks
196
+ - Multi-repo workspace registry
197
+ - Workspace dependency graph with auto and manual connections
198
+ - Token access matrix for scan/build/package readiness
199
+ - GitOps repo generation with Kustomize-style folders
200
+ - SOPS-style encrypted Secret manifests
201
+ - Plaintext secret detection before GitOps commit
202
+ - Phase 4.5 architecture, command, data model, security, GitOps, and roadmap reviews
203
+ - Container image reference validation and mutable-tag/digest warnings
204
+ - Source repo to image linking and Kubernetes/serverless target recommendation
205
+ - Dataset registry for Kaggle, Roboflow, Hugging Face Datasets, DVC, local
206
+ folders, and cloud object-store references
207
+ - Dataset metadata profiling, access checks, lineage connections, dataset-card
208
+ generation, and export/download planning without automatic bulk downloads
209
+ - Module registry, staged bootstrap, cloud readiness plans, Argo CD
210
+ Application/AppProject generation, and safe self-improvement reports
211
+ - Release readiness reports, API/command freeze snapshots, package artifacts,
212
+ release notes, and release candidate checklists
213
+ - CI workflow with tests, lint, type check, and CLI smoke test
214
+
215
+ ## Design Docs
216
+
217
+ Canonical design references:
218
+
219
+ - [Getting Started](docs/getting-started.md): install, first scan, remote SDK setup, tokens, workspace, data-safe workflow, GitOps, and release checks.
220
+ - [Technical Design](docs/technical-design.md): architecture, command groups, data flows, storage, security, bootstrap, modules, and release stabilization.
221
+ - [SDK Design](docs/sdk-design.md): Python API, CLI-to-SDK mapping, provider SDK behavior, token API, return types, and SDK extension rules.
222
+
223
+ ## Python API
224
+
225
+ Scan a repo:
226
+
227
+ ```python
228
+ from kiste.scanner import scan_repo
229
+
230
+ spec = scan_repo("tests/fixtures/fastapi_docker_repo")
231
+ print(spec.app.framework)
232
+ print(spec.app.port)
233
+ ```
234
+
235
+ Work with a workspace:
236
+
237
+ ```python
238
+ from kiste.workspace import load_workspace, scan_workspace, build_graph
239
+
240
+ workspace = load_workspace(".")
241
+ scan_workspace(".")
242
+ connections = build_graph(".")
243
+ ```
244
+
245
+ Load and check token metadata:
246
+
247
+ ```python
248
+ from kiste.tokens import add_token, check_token, list_tokens, load_token_store
249
+
250
+ add_token(
251
+ "github",
252
+ name="github-dev",
253
+ scopes="repo:read,actions:read",
254
+ expires_at="2026-08-01",
255
+ token_value="ghp_example",
256
+ repo_root=".",
257
+ )
258
+ for token in list_tokens("."):
259
+ print(token.name, token.provider, token.secret_reference)
260
+
261
+ report = check_token("github-dev", target="scan")
262
+ print(report["status"])
263
+
264
+ store = load_token_store(".")
265
+ print(store["tokens"])
266
+ ```
267
+
268
+ Work with datasets:
269
+
270
+ ```python
271
+ from kiste.data import add_dataset, check_dataset, inspect_dataset
272
+
273
+ add_dataset("local", "./datasets/weld-seams", name="weld-seams")
274
+ dataset = inspect_dataset("weld-seams")
275
+ report = check_dataset("weld-seams")
276
+ print(dataset.task_type)
277
+ print(report["status"])
278
+ ```
279
+
280
+ Generate and validate GitOps output:
281
+
282
+ ```python
283
+ from kiste.gitops import generate_gitops_repo, validate_gitops_repo
284
+ from kiste.workspace import load_workspace
285
+
286
+ workspace = load_workspace(".")
287
+ generate_gitops_repo(workspace, "./robot-platform-gitops", env="dev")
288
+ report = validate_gitops_repo("./robot-platform-gitops")
289
+ print(report.ok)
290
+ ```
291
+
292
+ Encrypt a SOPS-style secret:
293
+
294
+ ```python
295
+ from kiste.secrets import SopsSecretBackend
296
+
297
+ backend = SopsSecretBackend(config_file=".sops.yaml")
298
+ encrypted = backend.encrypt_secret(
299
+ name="api-secret",
300
+ data={"DATABASE_URL": "...", "SECRET_KEY": "..."},
301
+ )
302
+ ```
303
+
304
+ ## Generated Files
305
+
306
+ Single-repo scan:
307
+
308
+ ```text
309
+ kiste.yaml
310
+ .kiste/
311
+ spec.json
312
+ scan-report.json
313
+ tokens.json
314
+ ```
315
+
316
+ Workspace scan:
317
+
318
+ ```text
319
+ .kiste/
320
+ workspace.json
321
+ graph.json
322
+ token-matrix.json
323
+ workspace-report.json
324
+ datasets/
325
+ weld-detection.dataset.json
326
+ repos/
327
+ api.spec.json
328
+ frontend.spec.json
329
+ ```
330
+
331
+ GitOps/SOPS setup:
332
+
333
+ ```text
334
+ .kiste/
335
+ gitops.json
336
+ secrets.json
337
+ review/
338
+ kiste-phase-4.5-review.md
339
+ release/
340
+ release-check.json
341
+ release-readiness.md
342
+ api-freeze.md
343
+ command-freeze.md
344
+ test-report.md
345
+ security-report.md
346
+ packaging-report.md
347
+ docs-report.md
348
+ release-notes.md
349
+ release-candidate-checklist.md
350
+
351
+ robot-platform-gitops/
352
+ README.md
353
+ .sops.yaml
354
+ clusters/
355
+ apps/
356
+ infrastructure/
357
+ namespaces/
358
+ network-policies/
359
+ secrets/
360
+ api-secret.enc.yaml
361
+ ```
362
+
363
+ ## Security Notes
364
+
365
+ Raw tokens should come from environment variables when possible:
366
+
367
+ PowerShell:
368
+
369
+ ```powershell
370
+ $env:KISTE_TOKEN_GITHUB_DEV="..."
371
+ $env:KISTE_TOKEN_HF_DEV="..."
372
+ ```
373
+
374
+ Bash/zsh:
375
+
376
+ ```bash
377
+ export KISTE_TOKEN_GITHUB_DEV="..."
378
+ export KISTE_TOKEN_HF_DEV="..."
379
+ ```
380
+
381
+ The local token store is metadata-only and writes `.kiste/tokens.json`. Raw token
382
+ values are not stored; records use `env://KISTE_TOKEN_NAME` references. Do not
383
+ commit token metadata that reveals private account, project, or expiry details.
384
+
385
+ GitOps secret files must use the `*.enc.yaml` convention. `kiste secrets scan`
386
+ fails on plaintext Kubernetes Secret manifests, `.env` files, `secret.yaml`,
387
+ `*-secret.yaml`, and unencrypted YAML under `infrastructure/secrets/`.
388
+
389
+ Image references are parsed and validated before registry inspection. Kiste warns
390
+ on mutable tags such as `latest` and recommends digest pinning for deployment
391
+ inputs. Phase 6 planning does not deploy or pull images automatically.
392
+
393
+ Dataset providers are metadata-first. Kiste records dataset refs, profiles local
394
+ and DVC files, checks declared token scopes, generates dataset cards, and plans
395
+ exports, but it does not download large datasets automatically.
396
+
397
+ Phase 8 cloud and Argo CD commands are also safe-by-default. They generate plans,
398
+ reports, and YAML only. They do not provision cloud resources, sync production
399
+ apps, enable pruning, delete clusters, rotate secrets, or auto-merge changes.
400
+
401
+ ## Development
402
+
403
+ Install dev dependencies:
404
+
405
+ ```bash
406
+ uv sync --group dev
407
+ ```
408
+
409
+ Run checks:
410
+
411
+ ```bash
412
+ uv run pytest -q
413
+ uv run ruff check .
414
+ uv run mypy src/kiste
415
+ ```
416
+
417
+ Publish to PyPI:
418
+
419
+ 1. Configure PyPI Trusted Publishing for this repository with workflow
420
+ `.github/workflows/pypi-publish.yml` and environment `pypi`.
421
+ 2. Push a version tag, for example `v0.8.5`.
422
+ 3. The workflow runs checks, builds `dist/`, validates metadata, and publishes
423
+ through GitHub OIDC. No PyPI API token is required.
424
+
425
+ Dependency updates:
426
+
427
+ Dependabot is configured in `.github/dependabot.yml` to update both PyPI
428
+ package versions and workflow/action versions weekly:
429
+
430
+ - PyPI dependencies: `pyproject.toml` and `uv.lock` through the `uv` ecosystem.
431
+ - Workflows: GitHub Actions used by CI and PyPI publishing.
432
+
433
+ Python dev tools, provider SDK extras, and GitHub Actions are grouped into
434
+ focused PRs with `pypi`, `uv`, `workflow`, and `github-actions` labels.
435
+
436
+ Phase 4.5 review reports:
437
+
438
+ ```bash
439
+ kiste review
440
+ kiste review architecture
441
+ kiste review commands
442
+ kiste review data-model
443
+ kiste review security
444
+ kiste review gitops
445
+ kiste review roadmap
446
+ ```
447
+
448
+ These write Markdown reports to `.kiste/review/`.
449
+
450
+ ## Current Limits
451
+
452
+ Kiste still does not:
453
+
454
+ - Deploy to Kubernetes
455
+ - Apply Terraform
456
+ - Push to a container registry
457
+ - Download large datasets automatically
458
+ - Provision or delete cloud resources automatically
459
+ - Auto-sync Argo CD production apps with pruning
460
+ - Auto-merge self-improvement changes
461
+ - Commit or push the generated GitOps repo
462
+ - Integrate with real SOPS, age, KMS, or Vault cryptography
463
+ - Rotate secrets or fetch runtime credentials
464
+
465
+ Phase 4 intentionally produces a GitOps source tree and validates secret hygiene,
466
+ but deployment and production secret backends are later phases.
467
+
468
+ ## License
469
+
470
+ Kiste uses a split license model:
471
+
472
+ - Source code is licensed under the Apache License 2.0. See [LICENSE](LICENSE).
473
+ - Documentation, including this README and files under [docs/](docs/), is
474
+ licensed under Creative Commons Attribution 4.0 International. See
475
+ [docs/LICENSE.md](docs/LICENSE.md).