stacklatch 0.1.0a1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stacklatch/__init__.py +2 -0
- stacklatch/cli.py +76 -0
- stacklatch/core.py +386 -0
- stacklatch/v21.py +273 -0
- stacklatch/v22.py +483 -0
- stacklatch/v23.py +159 -0
- stacklatch/v24.py +199 -0
- stacklatch/v24_contract.py +188 -0
- stacklatch/v24_graph.py +338 -0
- stacklatch/v25.py +156 -0
- stacklatch/v31.py +380 -0
- stacklatch/v31_checkout.py +146 -0
- stacklatch/v31_graph.py +600 -0
- stacklatch/v31_graph_legacy.py +506 -0
- stacklatch-0.1.0a1.dist-info/METADATA +70 -0
- stacklatch-0.1.0a1.dist-info/RECORD +21 -0
- stacklatch-0.1.0a1.dist-info/WHEEL +5 -0
- stacklatch-0.1.0a1.dist-info/entry_points.txt +2 -0
- stacklatch-0.1.0a1.dist-info/licenses/LICENSE +21 -0
- stacklatch-0.1.0a1.dist-info/licenses/LICENSE_INVENTORY.md +12 -0
- stacklatch-0.1.0a1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
"""V3.1 static package graph and conservative dictionary return evidence.
|
|
2
|
+
|
|
3
|
+
This parser never imports repository modules on the host. Unsupported syntax
|
|
4
|
+
fails closed for a selected closure; unrelated modules remain unselected.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import ast
|
|
9
|
+
import hashlib
|
|
10
|
+
import re
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
from .core import Analysis, InspectionError, _copy_checked
|
|
14
|
+
from .v22 import (DENIED, IDENT, STDLIB, _constant_value, _literal,
|
|
15
|
+
_metadata_v22, _read_ast, _return_shape, _score)
|
|
16
|
+
|
|
17
|
+
MAX_MODULES = 32
|
|
18
|
+
MAX_GRAPH_DEPTH = 6
|
|
19
|
+
MAX_FUNCTIONS = 128
|
|
20
|
+
MAX_FIELDS = 24
|
|
21
|
+
PRIMITIVE_CONSTRUCTORS = frozenset({"len", "str", "int", "float", "bool"})
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _value_type(node, assignments, shadowed=frozenset(), helpers=None):
|
|
25
|
+
"""Infer only expressions whose JSON primitive type follows from syntax."""
|
|
26
|
+
if isinstance(node, ast.Constant):
|
|
27
|
+
return {str: "string", int: "integer", float: "number", bool: "boolean",
|
|
28
|
+
type(None): "null"}.get(type(node.value))
|
|
29
|
+
if isinstance(node, ast.Name):
|
|
30
|
+
return assignments.get(node.id)
|
|
31
|
+
if (helpers and isinstance(node, ast.Subscript) and
|
|
32
|
+
isinstance(node.slice, ast.Constant) and type(node.slice.value) is str and
|
|
33
|
+
isinstance(node.value, ast.Call) and isinstance(node.value.func, ast.Name)):
|
|
34
|
+
call = node.value
|
|
35
|
+
name = call.func.id
|
|
36
|
+
if (name in helpers and name not in shadowed and not call.keywords and
|
|
37
|
+
len(call.args) <= 8 and all(isinstance(arg, (ast.Name, ast.Constant))
|
|
38
|
+
for arg in call.args)):
|
|
39
|
+
helper = helpers[name]
|
|
40
|
+
if (not helper.decorator_list and not helper.args.vararg and
|
|
41
|
+
not helper.args.kwarg and len(call.args) ==
|
|
42
|
+
len(helper.args.posonlyargs + helper.args.args) and
|
|
43
|
+
not helper.args.kwonlyargs):
|
|
44
|
+
fields, _ = _dict_fields(helper, helpers=None)
|
|
45
|
+
return fields.get(node.slice.value, {}).get("type")
|
|
46
|
+
if (isinstance(node, ast.Call) and isinstance(node.func, ast.Name)
|
|
47
|
+
and node.func.id in {"len", "str", "int", "float", "bool"}
|
|
48
|
+
and node.func.id not in shadowed
|
|
49
|
+
and len(node.args) == 1 and not node.keywords):
|
|
50
|
+
return {"len": "integer", "str": "string", "int": "integer",
|
|
51
|
+
"float": "number", "bool": "boolean"}[node.func.id]
|
|
52
|
+
return None
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def _dict_fields(fn, helpers=None):
|
|
56
|
+
"""All return branches must prove identical literal keys and field types."""
|
|
57
|
+
assignments = {}
|
|
58
|
+
# Python makes assignments anywhere in a function local throughout that
|
|
59
|
+
# function. A call spelled len(...) is not evidence of an integer when a
|
|
60
|
+
# parameter, import or binding shadows the builtin, even in a later branch.
|
|
61
|
+
shadowed = {a.arg for a in (fn.args.posonlyargs + fn.args.args + fn.args.kwonlyargs)}
|
|
62
|
+
for node in ast.walk(fn):
|
|
63
|
+
if isinstance(node, ast.Name) and isinstance(node.ctx, (ast.Store, ast.Del)):
|
|
64
|
+
shadowed.add(node.id)
|
|
65
|
+
elif isinstance(node, (ast.Import, ast.ImportFrom)):
|
|
66
|
+
shadowed.update(a.asname or a.name.split('.')[0] for a in node.names)
|
|
67
|
+
elif isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef)) and node is not fn:
|
|
68
|
+
shadowed.add(node.name)
|
|
69
|
+
elif isinstance(node, ast.ExceptHandler) and node.name:
|
|
70
|
+
shadowed.add(node.name)
|
|
71
|
+
if not fn.body or not _guaranteed_return(fn.body):
|
|
72
|
+
return {}, "Return path can fall through without a dictionary"
|
|
73
|
+
if any(isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef, ast.Lambda))
|
|
74
|
+
for statement in fn.body for node in ast.walk(statement)):
|
|
75
|
+
return {}, "Nested callable prevents return-flow proof"
|
|
76
|
+
for node in fn.body:
|
|
77
|
+
if isinstance(node, ast.Assign) and len(node.targets) == 1 and isinstance(node.targets[0], ast.Name):
|
|
78
|
+
name = node.targets[0].id
|
|
79
|
+
inferred = _value_type(node.value, assignments, shadowed, helpers)
|
|
80
|
+
assignments[name] = inferred if name not in assignments or assignments[name] == inferred else None
|
|
81
|
+
for statement in fn.body:
|
|
82
|
+
if isinstance(statement, (ast.Global, ast.Nonlocal)):
|
|
83
|
+
return {}, "Nonlocal or global return field dependency"
|
|
84
|
+
if isinstance(statement, ast.Assign) and len(statement.targets) == 1 and isinstance(statement.targets[0], ast.Name):
|
|
85
|
+
descendants = ast.walk(statement.value)
|
|
86
|
+
else:
|
|
87
|
+
descendants = ast.walk(statement)
|
|
88
|
+
if any(isinstance(node, (ast.Global, ast.Nonlocal)) or
|
|
89
|
+
isinstance(node, ast.Name) and isinstance(node.ctx, (ast.Store, ast.Del))
|
|
90
|
+
and node.id in assignments for node in descendants):
|
|
91
|
+
return {}, "A return field local is mutated in nested control flow"
|
|
92
|
+
returns = [node for node in ast.walk(fn) if isinstance(node, ast.Return)]
|
|
93
|
+
if not returns or len(returns) > 16:
|
|
94
|
+
return {}, "No bounded returns"
|
|
95
|
+
result = None
|
|
96
|
+
for node in returns:
|
|
97
|
+
value = node.value
|
|
98
|
+
if not isinstance(value, ast.Dict) or len(value.keys) > MAX_FIELDS:
|
|
99
|
+
return {}, "Return is not a bounded literal dictionary"
|
|
100
|
+
fields = {}
|
|
101
|
+
for key, expression in zip(value.keys, value.values, strict=True):
|
|
102
|
+
if not isinstance(key, ast.Constant) or not isinstance(key.value, str) or not IDENT.fullmatch(key.value):
|
|
103
|
+
return {}, "Dynamic or invalid dictionary key"
|
|
104
|
+
kind = _value_type(expression, assignments, shadowed, helpers)
|
|
105
|
+
if kind is None or key.value in fields:
|
|
106
|
+
return {}, "Unproven or duplicate dictionary field type"
|
|
107
|
+
fields[key.value] = {"type": kind, "line": expression.lineno}
|
|
108
|
+
if result is not None and {k: v["type"] for k, v in fields.items()} != {k: v["type"] for k, v in result.items()}:
|
|
109
|
+
return {}, "Conflicting dictionary return branches"
|
|
110
|
+
result = fields
|
|
111
|
+
return result or {}, "All literal return branches agree"
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def _guaranteed_return(statements):
|
|
115
|
+
"""Recognize only bounded, unconditional terminal return control flow."""
|
|
116
|
+
for statement in statements:
|
|
117
|
+
if isinstance(statement, ast.Return):
|
|
118
|
+
return True
|
|
119
|
+
if isinstance(statement, ast.If) and statement.orelse:
|
|
120
|
+
if _guaranteed_return(statement.body) and _guaranteed_return(statement.orelse):
|
|
121
|
+
return True
|
|
122
|
+
return False
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def _string_parameter_evidence(fn, parameter):
|
|
126
|
+
"""A behavioral hint, never a static proof or an original annotation."""
|
|
127
|
+
methods = {}
|
|
128
|
+
for node in ast.walk(fn):
|
|
129
|
+
if (isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute)
|
|
130
|
+
and isinstance(node.func.value, ast.Name)
|
|
131
|
+
and node.func.value.id == parameter and not node.keywords
|
|
132
|
+
and node.func.attr in {"strip", "lower", "replace", "split"}):
|
|
133
|
+
if (node.func.attr in {"strip", "lower"} and not node.args or
|
|
134
|
+
node.func.attr == "replace" and len(node.args) == 2 and
|
|
135
|
+
all(isinstance(a, ast.Constant) and isinstance(a.value, str) for a in node.args) or
|
|
136
|
+
node.func.attr == "split" and (not node.args or len(node.args) == 1 and
|
|
137
|
+
isinstance(node.args[0], ast.Constant) and isinstance(node.args[0].value, str))):
|
|
138
|
+
methods[node.func.attr] = node.lineno
|
|
139
|
+
for first, second in (("strip", "lower"), ("replace", "split")):
|
|
140
|
+
if first in methods and second in methods:
|
|
141
|
+
return [methods[first], methods[second]]
|
|
142
|
+
return []
|
|
143
|
+
AUDITED_MODULES = STDLIB | {"unicodedata", "string", "collections", "dataclasses", "hashlib", "json", "base64", "html"}
|
|
144
|
+
AUDITED_FROM = {"collections": {"Counter"}, "dataclasses": {"dataclass"},
|
|
145
|
+
"typing": {"Final", "Dict", "List", "Tuple", "Optional", "Any", "Sequence", "Literal"},
|
|
146
|
+
"pathlib": {"Path"}, "urllib.parse": {"quote", "unquote"}}
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def _annotation(node):
|
|
150
|
+
if node is None or isinstance(node, ast.Name):
|
|
151
|
+
return True
|
|
152
|
+
if isinstance(node, ast.Constant) and node.value is None:
|
|
153
|
+
return True
|
|
154
|
+
if isinstance(node, ast.Subscript):
|
|
155
|
+
return _annotation(node.value) and _annotation(node.slice)
|
|
156
|
+
if isinstance(node, ast.Tuple):
|
|
157
|
+
return all(_annotation(x) for x in node.elts)
|
|
158
|
+
if isinstance(node, ast.BinOp) and isinstance(node.op, ast.BitOr):
|
|
159
|
+
return _annotation(node.left) and _annotation(node.right)
|
|
160
|
+
return False
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def _safe_constant(node, names):
|
|
164
|
+
if _constant_value(node, names):
|
|
165
|
+
return True
|
|
166
|
+
if (isinstance(node, ast.Subscript) and isinstance(node.value, ast.Name)
|
|
167
|
+
and node.value.id == "Literal" and
|
|
168
|
+
isinstance(node.slice, (ast.Tuple, ast.Constant))):
|
|
169
|
+
values = node.slice.elts if isinstance(node.slice, ast.Tuple) else [node.slice]
|
|
170
|
+
return 1 <= len(values) <= MAX_FIELDS and all(
|
|
171
|
+
isinstance(item, ast.Constant) and isinstance(item.value, str)
|
|
172
|
+
and len(item.value) <= 64 for item in values)
|
|
173
|
+
if isinstance(node, ast.Call) and isinstance(node.func, ast.Name) and node.func.id == "frozenset" and len(node.args) == 1 and not node.keywords and _literal(node.args[0]):
|
|
174
|
+
return True
|
|
175
|
+
return (isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute)
|
|
176
|
+
and isinstance(node.func.value, ast.Name) and node.func.value.id == "re"
|
|
177
|
+
and node.func.attr == "compile" and len(node.args) in (1, 2) and not node.keywords
|
|
178
|
+
and _literal(node.args[0]) and (len(node.args) == 1 or
|
|
179
|
+
(isinstance(node.args[1], ast.Attribute)
|
|
180
|
+
and isinstance(node.args[1].value, ast.Name) and node.args[1].value.id == "re"
|
|
181
|
+
and node.args[1].attr in {"UNICODE", "IGNORECASE", "MULTILINE", "DOTALL"})))
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def _modules(analysis: Analysis) -> dict[str, str]:
|
|
185
|
+
result = {}
|
|
186
|
+
for path in analysis.files:
|
|
187
|
+
if not path.endswith(".py") or Path(path).name == "setup.py" or any(
|
|
188
|
+
p in {"tests", "test", ".github"} for p in Path(path).parts):
|
|
189
|
+
continue
|
|
190
|
+
parts = list(Path(path).parts)
|
|
191
|
+
if parts[0] == "src":
|
|
192
|
+
parts.pop(0)
|
|
193
|
+
# Implicit namespace packages are valid Python and have no initializer
|
|
194
|
+
# to execute. Any present initializer is audited before staging.
|
|
195
|
+
if parts[-1] == "__init__.py":
|
|
196
|
+
parts.pop()
|
|
197
|
+
else:
|
|
198
|
+
parts[-1] = parts[-1][:-3]
|
|
199
|
+
if parts and all(IDENT.fullmatch(p) for p in parts):
|
|
200
|
+
name = ".".join(parts)
|
|
201
|
+
if name in result:
|
|
202
|
+
raise InspectionError("Ambiguous source module path")
|
|
203
|
+
result[name] = path
|
|
204
|
+
return result
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def _project_import(node: ast.ImportFrom, module: str, initializer: bool,
|
|
208
|
+
modules: dict[str, str]) -> tuple[str, dict[str, tuple[str, str]]]:
|
|
209
|
+
if node.level:
|
|
210
|
+
package = module if initializer else module.rpartition(".")[0]
|
|
211
|
+
parts = package.split(".") if package else []
|
|
212
|
+
if node.level > len(parts):
|
|
213
|
+
raise InspectionError("Relative import escapes package")
|
|
214
|
+
base = parts[:len(parts) - node.level + 1]
|
|
215
|
+
requested = ".".join([*base, *(node.module.split(".") if node.module else [])])
|
|
216
|
+
else:
|
|
217
|
+
requested = node.module or ""
|
|
218
|
+
if requested not in modules:
|
|
219
|
+
raise InspectionError("Unresolved in-repository import")
|
|
220
|
+
aliases = {}
|
|
221
|
+
for name in node.names:
|
|
222
|
+
if name.name == "*" or not IDENT.fullmatch(name.name):
|
|
223
|
+
raise InspectionError("Wildcard or invalid import name")
|
|
224
|
+
target = f"{requested}.{name.name}"
|
|
225
|
+
if target in modules: # from . import helper_module
|
|
226
|
+
aliases[name.asname or name.name] = (target, "")
|
|
227
|
+
else:
|
|
228
|
+
aliases[name.asname or name.name] = (requested, name.name)
|
|
229
|
+
return requested, aliases
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def _scan(root: Path, analysis: Analysis, module: str, modules: dict[str, str]):
|
|
233
|
+
path = modules[module]
|
|
234
|
+
tree = _read_ast(root, analysis, path)
|
|
235
|
+
imports = {}
|
|
236
|
+
edges = set()
|
|
237
|
+
constants = set()
|
|
238
|
+
definitions = {n.name for n in tree.body if isinstance(n, (ast.FunctionDef, ast.ClassDef))}
|
|
239
|
+
if definitions & PRIMITIVE_CONSTRUCTORS:
|
|
240
|
+
raise InspectionError("Import-time definition shadows a primitive")
|
|
241
|
+
for node in tree.body:
|
|
242
|
+
if isinstance(node, ast.Expr) and isinstance(node.value, ast.Constant) and isinstance(node.value.value, str):
|
|
243
|
+
continue
|
|
244
|
+
if isinstance(node, ast.Import):
|
|
245
|
+
for alias in node.names:
|
|
246
|
+
if alias.name.split('.')[0] in PRIMITIVE_CONSTRUCTORS | definitions:
|
|
247
|
+
raise InspectionError("Import shadows a primitive or callable")
|
|
248
|
+
if alias.name in AUDITED_MODULES and not alias.asname:
|
|
249
|
+
continue
|
|
250
|
+
if alias.name not in modules or alias.asname:
|
|
251
|
+
raise InspectionError("Unaudited or aliased module import")
|
|
252
|
+
edges.add(alias.name)
|
|
253
|
+
elif isinstance(node, ast.ImportFrom):
|
|
254
|
+
if node.level == 0 and node.module == "__future__" and [a.name for a in node.names] == ["annotations"]:
|
|
255
|
+
continue
|
|
256
|
+
if node.level == 0 and node.module in AUDITED_FROM and all(
|
|
257
|
+
a.name in AUDITED_FROM[node.module] and not a.asname for a in node.names):
|
|
258
|
+
if any(a.name in PRIMITIVE_CONSTRUCTORS | definitions for a in node.names):
|
|
259
|
+
raise InspectionError("Import shadows a primitive or callable")
|
|
260
|
+
continue
|
|
261
|
+
target, aliases = _project_import(node, module, path.endswith("/__init__.py"), modules)
|
|
262
|
+
if imports.keys() & aliases.keys() or aliases.keys() & (PRIMITIVE_CONSTRUCTORS | definitions | constants):
|
|
263
|
+
raise InspectionError("Ambiguous imported alias")
|
|
264
|
+
imports.update(aliases)
|
|
265
|
+
edges.add(target)
|
|
266
|
+
edges.update(m for m, name in aliases.values() if not name)
|
|
267
|
+
elif isinstance(node, (ast.Assign, ast.AnnAssign)):
|
|
268
|
+
targets = node.targets if isinstance(node, ast.Assign) else [node.target]
|
|
269
|
+
if len(targets) != 1 or not isinstance(targets[0], ast.Name) or node.value is None or not _safe_constant(node.value, constants):
|
|
270
|
+
raise InspectionError("Dynamic import-time constant")
|
|
271
|
+
if targets[0].id in PRIMITIVE_CONSTRUCTORS | definitions or targets[0].id in constants:
|
|
272
|
+
raise InspectionError("Import-time binding shadows a primitive or callable")
|
|
273
|
+
constants.add(targets[0].id)
|
|
274
|
+
elif isinstance(node, ast.FunctionDef):
|
|
275
|
+
if node.decorator_list or node.args.vararg or node.args.kwarg:
|
|
276
|
+
raise InspectionError("Unsupported function definition")
|
|
277
|
+
if any(not _literal(default) for default in
|
|
278
|
+
node.args.defaults + [d for d in node.args.kw_defaults if d is not None]):
|
|
279
|
+
raise InspectionError("Evaluated function default")
|
|
280
|
+
if not any(isinstance(n, ast.ImportFrom) and n.module == "__future__" for n in tree.body):
|
|
281
|
+
anns = [a.annotation for a in node.args.posonlyargs + node.args.args + node.args.kwonlyargs] + [node.returns]
|
|
282
|
+
if any(not _annotation(a) for a in anns):
|
|
283
|
+
raise InspectionError("Evaluated annotation")
|
|
284
|
+
elif isinstance(node, ast.ClassDef):
|
|
285
|
+
if (len(node.bases) == 1 and isinstance(node.bases[0], ast.Name)
|
|
286
|
+
and node.bases[0].id in {"ValueError", "TypeError"}
|
|
287
|
+
and not node.keywords and not node.decorator_list
|
|
288
|
+
and all(isinstance(item, ast.Pass) or isinstance(item, ast.Expr)
|
|
289
|
+
and isinstance(item.value, ast.Constant)
|
|
290
|
+
and isinstance(item.value.value, str) for item in node.body)):
|
|
291
|
+
continue
|
|
292
|
+
decorator = node.decorator_list[0] if len(node.decorator_list) == 1 else None
|
|
293
|
+
safe_decorator = (isinstance(decorator, ast.Name) and decorator.id == "dataclass") or (
|
|
294
|
+
isinstance(decorator, ast.Call) and isinstance(decorator.func, ast.Name)
|
|
295
|
+
and decorator.func.id == "dataclass" and not decorator.args
|
|
296
|
+
and all(k.arg in {"frozen", "slots"} and isinstance(k.value, ast.Constant)
|
|
297
|
+
and type(k.value.value) is bool for k in decorator.keywords))
|
|
298
|
+
if (not safe_decorator or node.bases or node.keywords
|
|
299
|
+
or not any(isinstance(n, ast.ImportFrom) and n.module == "dataclasses"
|
|
300
|
+
and [a.name for a in n.names] == ["dataclass"] for n in tree.body)):
|
|
301
|
+
raise InspectionError("Unsupported class initialization")
|
|
302
|
+
if any(not (isinstance(n, ast.AnnAssign) and isinstance(n.target, ast.Name)
|
|
303
|
+
and _annotation(n.annotation) and (n.value is None or _literal(n.value)))
|
|
304
|
+
and not (isinstance(n, ast.FunctionDef) and not n.decorator_list
|
|
305
|
+
and not n.args.vararg and not n.args.kwarg
|
|
306
|
+
and all(_literal(d) for d in n.args.defaults))
|
|
307
|
+
and not (isinstance(n, ast.Expr) and isinstance(n.value, ast.Constant)
|
|
308
|
+
and isinstance(n.value.value, str)) for n in node.body):
|
|
309
|
+
raise InspectionError("Unsupported dataclass body")
|
|
310
|
+
elif (isinstance(node, ast.If) and isinstance(node.test, ast.Compare)
|
|
311
|
+
and isinstance(node.test.left, ast.Name) and node.test.left.id == "__name__"
|
|
312
|
+
and len(node.test.ops) == 1 and isinstance(node.test.ops[0], ast.Eq)
|
|
313
|
+
and len(node.test.comparators) == 1 and isinstance(node.test.comparators[0], ast.Constant)
|
|
314
|
+
and node.test.comparators[0].value == "__main__" and not node.orelse):
|
|
315
|
+
continue
|
|
316
|
+
else:
|
|
317
|
+
raise InspectionError("Unsupported import-time statement")
|
|
318
|
+
return tree, imports, edges
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
def _closure(root, analysis, module, function, modules, checked, active, functions):
|
|
322
|
+
key = (module, function)
|
|
323
|
+
if key in active:
|
|
324
|
+
raise InspectionError("Cyclic helper closure")
|
|
325
|
+
if key in functions:
|
|
326
|
+
return
|
|
327
|
+
if len(functions) >= MAX_FUNCTIONS:
|
|
328
|
+
raise InspectionError("Helper closure exceeds limit")
|
|
329
|
+
tree, imports, _ = checked[module]
|
|
330
|
+
defs = {n.name: n for n in tree.body if isinstance(n, ast.FunctionDef)}
|
|
331
|
+
if function not in defs:
|
|
332
|
+
raise InspectionError("Unresolved helper function")
|
|
333
|
+
active.add(key)
|
|
334
|
+
for node in ast.walk(defs[function]):
|
|
335
|
+
if isinstance(node, (ast.Import, ast.ImportFrom)):
|
|
336
|
+
raise InspectionError("Dynamic function import")
|
|
337
|
+
if isinstance(node, ast.Name) and node.id in DENIED:
|
|
338
|
+
raise InspectionError("Unsafe function name")
|
|
339
|
+
if (isinstance(node, ast.Attribute) and node.attr.startswith("__")
|
|
340
|
+
and not (node.attr == "__name__"
|
|
341
|
+
and isinstance(node.value, ast.Call)
|
|
342
|
+
and isinstance(node.value.func, ast.Name)
|
|
343
|
+
and node.value.func.id == "type"
|
|
344
|
+
and len(node.value.args) == 1
|
|
345
|
+
and isinstance(node.value.args[0], ast.Name)
|
|
346
|
+
and not node.value.keywords)):
|
|
347
|
+
raise InspectionError("Unsafe function attribute")
|
|
348
|
+
if isinstance(node, ast.Call):
|
|
349
|
+
if isinstance(node.func, ast.Name):
|
|
350
|
+
name = node.func.id
|
|
351
|
+
if name in DENIED:
|
|
352
|
+
raise InspectionError("Unsafe function call")
|
|
353
|
+
if name in defs:
|
|
354
|
+
_closure(root, analysis, module, name, modules, checked, active, functions)
|
|
355
|
+
elif name in imports:
|
|
356
|
+
other, called = imports[name]
|
|
357
|
+
if not called:
|
|
358
|
+
raise InspectionError("Module used as callable")
|
|
359
|
+
_closure(root, analysis, other, called, modules, checked, active, functions)
|
|
360
|
+
elif isinstance(node.func, ast.Attribute) and isinstance(node.func.value, ast.Name):
|
|
361
|
+
alias = node.func.value.id
|
|
362
|
+
if alias in imports and not imports[alias][1]:
|
|
363
|
+
other = imports[alias][0]
|
|
364
|
+
_closure(root, analysis, other, node.func.attr, modules, checked, active, functions)
|
|
365
|
+
active.remove(key)
|
|
366
|
+
functions.add(key)
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
def index_graph(root: Path, analysis: Analysis):
|
|
370
|
+
if analysis.language != "python" or analysis.license != "MIT-like (heuristic)" or analysis.dependencies:
|
|
371
|
+
raise InspectionError("Only MIT-like dependency-free Python is supported")
|
|
372
|
+
_metadata_v22(root, analysis)
|
|
373
|
+
modules = _modules(analysis)
|
|
374
|
+
if len(modules) > MAX_MODULES:
|
|
375
|
+
raise InspectionError("Module graph exceeds limit")
|
|
376
|
+
checked = {}
|
|
377
|
+
rejected = {}
|
|
378
|
+
|
|
379
|
+
def visit(module, active, depth):
|
|
380
|
+
if module in checked:
|
|
381
|
+
return
|
|
382
|
+
if module in active or depth > MAX_GRAPH_DEPTH:
|
|
383
|
+
raise InspectionError("Cyclic or deep package imports")
|
|
384
|
+
tree, imports, edges = _scan(root, analysis, module, modules)
|
|
385
|
+
for edge in sorted(edges):
|
|
386
|
+
# A package initializer may re-export the child currently being
|
|
387
|
+
# audited. This is the only allowed back edge; all other cycles
|
|
388
|
+
# fail closed.
|
|
389
|
+
if edge in active and modules[module].endswith("/__init__.py") and edge.startswith(module + "."):
|
|
390
|
+
continue
|
|
391
|
+
visit(edge, active | {module}, depth + 1)
|
|
392
|
+
# Python imports parent initializers before submodules.
|
|
393
|
+
parts = module.split(".")
|
|
394
|
+
for n in range(1, len(parts)):
|
|
395
|
+
parent = ".".join(parts[:n])
|
|
396
|
+
if parent in modules and parent not in active:
|
|
397
|
+
visit(parent, active | {module}, depth + 1)
|
|
398
|
+
checked[module] = (tree, imports, edges)
|
|
399
|
+
|
|
400
|
+
for name in sorted(modules):
|
|
401
|
+
try:
|
|
402
|
+
visit(name, set(), 1)
|
|
403
|
+
except InspectionError as exc:
|
|
404
|
+
rejected[name] = str(exc)
|
|
405
|
+
indexed = []
|
|
406
|
+
for module in sorted(checked):
|
|
407
|
+
tree, _, _ = checked[module]
|
|
408
|
+
for fn in (n for n in tree.body if isinstance(n, ast.FunctionDef) and not n.name.startswith("_")):
|
|
409
|
+
params = fn.args.posonlyargs + fn.args.args
|
|
410
|
+
# Optional source controls do not need a binding. Keep a bounded
|
|
411
|
+
# signature while allowing ordinary APIs with five parameters.
|
|
412
|
+
if len(params) + len(fn.args.kwonlyargs) > 8:
|
|
413
|
+
continue
|
|
414
|
+
shape, keys, evidence = _return_shape(fn)
|
|
415
|
+
helpers = {n.name: n for n in tree.body if isinstance(n, ast.FunctionDef) and n is not fn}
|
|
416
|
+
fields, field_evidence = _dict_fields(fn, helpers) if shape == "dict" else ({}, "Not a dictionary return")
|
|
417
|
+
item = {"module": module, "path": modules[module], "name": fn.name,
|
|
418
|
+
"line": fn.lineno, "file_sha256": analysis.file_sha256[modules[module]],
|
|
419
|
+
"parameters": [{"name": p.arg, "annotation": ast.unparse(p.annotation) if p.annotation else "unknown",
|
|
420
|
+
"inferred_type": "str" if not p.annotation and _string_parameter_evidence(fn, p.arg) else None,
|
|
421
|
+
"type_evidence": _string_parameter_evidence(fn, p.arg) if not p.annotation else [],
|
|
422
|
+
"required": i < len(params) - len(fn.args.defaults),
|
|
423
|
+
"kind": "positional_only" if i < len(fn.args.posonlyargs) else "positional_or_keyword"}
|
|
424
|
+
for i, p in enumerate(params)] +
|
|
425
|
+
[{"name": p.arg, "annotation": ast.unparse(p.annotation) if p.annotation else "unknown",
|
|
426
|
+
"required": fn.args.kw_defaults[i] is None, "kind": "keyword_only"}
|
|
427
|
+
for i, p in enumerate(fn.args.kwonlyargs)],
|
|
428
|
+
"return_shape": shape, "return_keys": keys, "shape_evidence": evidence,
|
|
429
|
+
"return_fields": fields, "field_evidence": field_evidence,
|
|
430
|
+
"docstring": ast.get_docstring(fn) or "", "supported": True}
|
|
431
|
+
try:
|
|
432
|
+
closure = set()
|
|
433
|
+
_closure(root, analysis, module, fn.name, modules, checked, set(), closure)
|
|
434
|
+
staged = {m for m, _ in closure} | {module}
|
|
435
|
+
pending = list(staged)
|
|
436
|
+
while pending:
|
|
437
|
+
current = pending.pop()
|
|
438
|
+
parents = [".".join(current.split(".")[:n])
|
|
439
|
+
for n in range(1, len(current.split(".")))]
|
|
440
|
+
for dependency in checked[current][2] | set(parents):
|
|
441
|
+
if dependency in modules and dependency not in staged:
|
|
442
|
+
if dependency not in checked:
|
|
443
|
+
raise InspectionError("Unresolved package initializer")
|
|
444
|
+
staged.add(dependency)
|
|
445
|
+
pending.append(dependency)
|
|
446
|
+
item["closure"] = sorted(staged)
|
|
447
|
+
except InspectionError as exc:
|
|
448
|
+
item["supported"], item["reason"] = False, str(exc)
|
|
449
|
+
indexed.append(item)
|
|
450
|
+
return indexed, rejected
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
def propose_graph(left: Analysis, right: Analysis, left_root: Path, right_root: Path, goal: str):
|
|
454
|
+
if not isinstance(goal, str) or not goal.strip() or any(
|
|
455
|
+
a.provenance != "fetched_git_commit" for a in (left, right)):
|
|
456
|
+
raise InspectionError("Pinned fetched commits and goal required")
|
|
457
|
+
indexes = [index_graph(root, analysis) for root, analysis in
|
|
458
|
+
zip((left_root, right_root), (left, right), strict=True)]
|
|
459
|
+
candidates = []
|
|
460
|
+
for source in indexes[0][0]:
|
|
461
|
+
if (not source["supported"] or not source["parameters"]
|
|
462
|
+
or not source["parameters"][0]["required"]
|
|
463
|
+
or any(p["required"] for p in source["parameters"][1:])):
|
|
464
|
+
continue
|
|
465
|
+
for target in indexes[1][0]:
|
|
466
|
+
if not target["supported"]:
|
|
467
|
+
continue
|
|
468
|
+
required = [p for p in target["parameters"] if p["required"]]
|
|
469
|
+
pattern = ("direct" if len(required) == 1 else "fields" if len(required) == 2
|
|
470
|
+
and source["return_shape"] == "dict" and source["return_keys"] else None)
|
|
471
|
+
if pattern is None:
|
|
472
|
+
continue
|
|
473
|
+
score, evidence = _score(source, target, pattern)
|
|
474
|
+
candidates.append({"pattern": pattern, "score": score, "score_kind": "ranking_evidence_not_probability",
|
|
475
|
+
"contributions": evidence, "source": {k: source[k] for k in ("module", "path", "name", "closure")},
|
|
476
|
+
"target": {k: target[k] for k in ("module", "path", "name", "closure")},
|
|
477
|
+
"target_required": [p["name"] for p in required], "available_fields": source["return_keys"],
|
|
478
|
+
"mapping_suggestion": ({required[0]["name"]: "$output"} if pattern == "direct" else
|
|
479
|
+
{p["name"]: p["name"] for p in required
|
|
480
|
+
if p["name"] in source["return_keys"]}),
|
|
481
|
+
"requires_confirmation": True, "verified": False})
|
|
482
|
+
candidates.sort(key=lambda c: (-c["score"], c["source"]["path"], c["source"]["name"],
|
|
483
|
+
c["target"]["path"], c["target"]["name"]))
|
|
484
|
+
for i, candidate in enumerate(candidates):
|
|
485
|
+
candidate["id"] = i
|
|
486
|
+
return {"schema_version": 24, "goal": goal, "proposed": True, "verified": False,
|
|
487
|
+
"sources": [{"url": a.source, "commit": a.commit, "content_sha256": a.content_sha256,
|
|
488
|
+
"file_sha256": a.file_sha256, "kind": a.provenance} for a in (left, right)],
|
|
489
|
+
"indexes": [x[0] for x in indexes], "rejected_modules": [x[1] for x in indexes],
|
|
490
|
+
"candidates": candidates, "risk_flags": ["AST cannot establish semantic correctness"]}
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
def stage_graph(root: Path, analysis: Analysis, selected: dict, target: Path):
|
|
494
|
+
modules = _modules(analysis)
|
|
495
|
+
for name in selected["closure"]:
|
|
496
|
+
path = modules[name]
|
|
497
|
+
parts = list(Path(path).parts)
|
|
498
|
+
if parts[0] == "src":
|
|
499
|
+
parts.pop(0)
|
|
500
|
+
_copy_checked(root, path, target.joinpath(*parts), analysis.file_sha256[path])
|
|
501
|
+
for n in range(1, len(parts)):
|
|
502
|
+
parent = Path("src") if path.startswith("src/") else Path()
|
|
503
|
+
init = (parent / Path(*parts[:n]) / "__init__.py").as_posix()
|
|
504
|
+
if init in analysis.file_sha256:
|
|
505
|
+
_copy_checked(root, init, target / Path(*parts[:n]) / "__init__.py", analysis.file_sha256[init])
|
|
506
|
+
return selected["module"]
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stacklatch
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: Bounded analysis and verified integration of pinned Python repositories
|
|
5
|
+
Author: StackLatch contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Classifier: Development Status :: 3 - Alpha
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
9
|
+
Requires-Python: >=3.12
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
License-File: LICENSE_INVENTORY.md
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# StackLatch — Discover compatibility between software repositories
|
|
16
|
+
|
|
17
|
+
**StackLatch Core** is an experimental Python integration engine whose planning analysis runs locally after fetching pinned sources. It inspects two public GitHub repositories at exact commits, indexes Python interfaces with AST analysis, extracts bounded capabilities, and proposes an adapter. A proposal is **not** a working integration. A separate, explicitly confirmed verification runs independently supplied cases inside a restricted container before reporting success.
|
|
18
|
+
|
|
19
|
+
StackLatch Cloud (website, authentication, billing, AI invention reports and private datasets) is separate and **not included** in Core.
|
|
20
|
+
|
|
21
|
+
```mermaid
|
|
22
|
+
flowchart LR
|
|
23
|
+
A["Pinned GitHub commits"] --> B["Bounded inspection"]
|
|
24
|
+
B --> C["AST interfaces and capability evidence"]
|
|
25
|
+
C --> D["Ranked integration proposal"]
|
|
26
|
+
D --> E["Explicit confirmation + test cases"]
|
|
27
|
+
E --> F["Restricted Docker verification"]
|
|
28
|
+
F --> G["Evidence report + deterministic ZIP"]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
Requires Python 3.12 or later. The alpha has no runtime PyPI dependencies. Before a PyPI release, install the locally built wheel:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
python3.12 -m pip install dist/stacklatch-0.1.0a1-py3-none-any.whl
|
|
37
|
+
stacklatch --help
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`pip install stacklatch` is the **target command after a separately authorized PyPI release**; the candidate is not published. Verification additionally needs Docker and the pinned Python image (see Security). Planning requires network access to public GitHub repositories.
|
|
41
|
+
|
|
42
|
+
## Quick start
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
stacklatch plan \
|
|
46
|
+
--left https://github.com/bakhbk/slugify \
|
|
47
|
+
--left-sha c0c2053418f1ab722f05cc284f206b154eb8155e \
|
|
48
|
+
--right https://github.com/okunishinishi/python-stringcase \
|
|
49
|
+
--right-sha 57aae96649f5cf7fc98e50b1d62479456d492715 \
|
|
50
|
+
--goal 'Slugify an input phrase, then convert the resulting slug to camel case.' \
|
|
51
|
+
--out ./output
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Inspect `output/plan.json` and its `abstained`, `verified`, `sources`, and evidence fields. This exact planning command returned one selected candidate and `verified: false` during preparation. Other goals may abstain. `stacklatch verify --help` shows required schema and case files. Verification is deliberately separate and requires `--confirm`; see [examples/README.md](examples/README.md). The CLI never calls paid APIs.
|
|
55
|
+
|
|
56
|
+
## CLI
|
|
57
|
+
|
|
58
|
+
| Command | Result |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| `stacklatch --help` | Core command overview |
|
|
61
|
+
| `stacklatch plan --left URL --left-sha SHA --right URL --right-sha SHA --goal TEXT --out DIR` | Pinned-source analysis; writes unverified `plan.json` |
|
|
62
|
+
| `stacklatch verify --plan FILE --cases-file FILE --input-schema FILE --intermediate-schema FILE --output-schema FILE --out DIR --confirm` | Re-fetches commits, validates evidence, runs tests in Docker; writes `report.json`, and only on success a prototype ZIP |
|
|
63
|
+
|
|
64
|
+
## Support and security
|
|
65
|
+
|
|
66
|
+
The alpha targets small, public, MIT-like **Python-to-Python** repositories with bounded source trees and statically indexable functions. Type hints and simple return shapes improve matching. AST/text analysis cannot prove behavior, dependencies, legal license compatibility, or universal repository support. Exact commits and hash checks reduce source drift. Input limits, path and symlink checks, restricted imports, fail-closed verification, no network inside the non-root Docker container, read-only mounts, resource limits and a pinned image digest are implemented. Treat every fetched repository as untrusted; never run its code on your host. MIT-like detection is only a heuristic and a human must review third-party licenses before reuse. See [SECURITY.md](SECURITY.md).
|
|
67
|
+
|
|
68
|
+
## Roadmap and community
|
|
69
|
+
|
|
70
|
+
See [ROADMAP.md](ROADMAP.md), [CONTRIBUTING.md](CONTRIBUTING.md), [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md), and [CHANGELOG.md](CHANGELOG.md). Core source is licensed under [MIT](LICENSE). The candidate contains no private Git history. The suggested future public repository is separate from the existing private commercial repository.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
stacklatch/__init__.py,sha256=AY7HFrr1nM_x-5930aTh-uamDM2WtvQLyGihk-vbyDk,92
|
|
2
|
+
stacklatch/cli.py,sha256=JP4urbG5pXhh5UfSvexU_RN5FPZevVCcJZ3q8McPAkk,3930
|
|
3
|
+
stacklatch/core.py,sha256=eaZps0bsnZsTFnxLiVeu3nPKvtUML4JQ2algDDQ0-iQ,21846
|
|
4
|
+
stacklatch/v21.py,sha256=3x8x4ppsS7ZoCW3k9OUexsoWnV-hmAvUYE3if6CUD8s,16344
|
|
5
|
+
stacklatch/v22.py,sha256=fHoKYSkmQVox8XOsnEfrBOsaz0yf0Xrv4-mBhyZH3qw,27316
|
|
6
|
+
stacklatch/v23.py,sha256=RznErVSeI9nF_-gdogq-5pI33UcXjO6OSOTp4asqKPU,7977
|
|
7
|
+
stacklatch/v24.py,sha256=Bd5Aai6mJDziAOS72J0iFsWge9dfiR7A-beQZDqMQSY,10903
|
|
8
|
+
stacklatch/v24_contract.py,sha256=FUSW7zP-TKMQec7X8htAX_H1bYIQJuRZcIX8R-o82rs,8054
|
|
9
|
+
stacklatch/v24_graph.py,sha256=9Kw-4AVIHG_bUs3IbBF-iN6A-7GPya9rPveLO_R1EGk,18115
|
|
10
|
+
stacklatch/v25.py,sha256=Fj81yQXba0S5jvF7Hl7P5B2da1JGGK0raBmhSo03HuA,8462
|
|
11
|
+
stacklatch/v31.py,sha256=Tc8TX4lezrhhbqX3SmjYyMFR6sg5SK3F4xOBB9gR3FI,22710
|
|
12
|
+
stacklatch/v31_checkout.py,sha256=SB-VMk_qRRQlc1El0GFT1ZK06b9X3PjAMASofypkxAc,7717
|
|
13
|
+
stacklatch/v31_graph.py,sha256=ngNnU6fa9I0fTzTrGP7CJbc3x1JuLc729eknPPS2kF4,35460
|
|
14
|
+
stacklatch/v31_graph_legacy.py,sha256=g4amHzbejZ0f2B60855MfZmz1roGjN4LD3lmg9mH9xU,28754
|
|
15
|
+
stacklatch-0.1.0a1.dist-info/licenses/LICENSE,sha256=TOlQlr1CUpDzNKXhoFjxUis8bRhX3t5Kvv7-xXbQOkk,1080
|
|
16
|
+
stacklatch-0.1.0a1.dist-info/licenses/LICENSE_INVENTORY.md,sha256=vI394Q17bJqrV3ctSphdjHGdHiHXn9l7m3dNothRrdE,2280
|
|
17
|
+
stacklatch-0.1.0a1.dist-info/METADATA,sha256=lNCJrXifGEoaAro1vbgZVXrPerUwpM8eOYFR4xcpZmA,4427
|
|
18
|
+
stacklatch-0.1.0a1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
19
|
+
stacklatch-0.1.0a1.dist-info/entry_points.txt,sha256=7fJdZwVDrpDqtsPWdyiSqTLtrO6LzQSaNXw6_XSWxx8,51
|
|
20
|
+
stacklatch-0.1.0a1.dist-info/top_level.txt,sha256=7db1B7nQLJ3_U4V0IHzaZefZrZLANyslDYRaQitvCNw,11
|
|
21
|
+
stacklatch-0.1.0a1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 StackLatch 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.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# License inventory — candidate 0.1.0a1
|
|
2
|
+
|
|
3
|
+
| Component | License evidence | Distribution decision |
|
|
4
|
+
| --- | --- | --- |
|
|
5
|
+
| Exported StackLatch Python, tests, docs, local fixtures | Private source commit `c07b9d156c418fc7cb92ac5f5eae04155635cfcb` contained an MIT-labeled but abbreviated LICENSE; candidate uses the complete MIT permission, notice and disclaimer text. Fixture LICENSE copies are retained. | Intended MIT; owner must confirm rights for all contributions and approve final notices before public release. |
|
|
6
|
+
| Public GitHub repositories in examples | Only URL, commit, names, cases, interface evidence; **no third-party source** in wheel/sdist/clean archive. At the pinned commits, `bakhbk/slugify` and `okunishinishi/python-stringcase` expose MIT-like LICENSE files (Git blobs `b77bf2ab…` and `825618f6…`). | The references are not a redistribution grant. Review each pinned repository license before distributing any generated adapter containing its source. |
|
|
7
|
+
| Python standard library | Python runtime supplied by user; not bundled. | No runtime Python package dependencies. |
|
|
8
|
+
| `setuptools>=68` / `wheel` / transitive `packaging` | Build tools in isolated build environment; installed metadata: setuptools 84.2.1 MIT, wheel 0.48.0 MIT, packaging 26.3 `Apache-2.0 OR BSD-2-Clause`. None are vendored into candidate. | Build dependencies only; no third-party code copied into wheel. |
|
|
9
|
+
| `pytest` and its support packages | Development tests only; no development dependencies bundled in wheel/sdist. | Users may install separately under their respective notices; review installed versions when establishing CI. |
|
|
10
|
+
| Docker image `python:3.12-slim@sha256:…` | Referenced by digest, **not distributed**. Includes separate upstream Python, Debian and OS package licenses. | Must review image supply chain, SBOM and licenses on the Docker validation host. |
|
|
11
|
+
|
|
12
|
+
The existing source license's short final disclaimer was replaced by the standard MIT text in this candidate. This is an extraction change, not evidence of contributor authorization. The copyright line remains `Copyright (c) 2026 StackLatch contributors`. No contributor license agreement or explicit signed copyright grants were located in this export. Do not infer ownership from a Git author field alone.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
stacklatch
|