sourcecode 4.10.6__py3-none-any.whl → 4.10.7__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.
Potentially problematic release.
This version of sourcecode might be problematic. Click here for more details.
- sourcecode/__init__.py +1 -1
- sourcecode/cache.py +8 -3
- sourcecode/cache_model.py +100 -43
- sourcecode/canonical_ir.py +2 -1
- sourcecode/change_plan.py +8 -3
- sourcecode/cli.py +352 -62
- sourcecode/data_exposure.py +10 -1
- sourcecode/execution_plan.py +428 -0
- sourcecode/posture.py +3 -3
- sourcecode/remedies.py +37 -5
- sourcecode/repository_ir.py +25 -1
- sourcecode/security_posture.py +1 -1
- sourcecode/serializer.py +13 -0
- sourcecode/verify_repo.py +2 -2
- {sourcecode-4.10.6.dist-info → sourcecode-4.10.7.dist-info}/METADATA +6 -3
- {sourcecode-4.10.6.dist-info → sourcecode-4.10.7.dist-info}/RECORD +19 -18
- {sourcecode-4.10.6.dist-info → sourcecode-4.10.7.dist-info}/WHEEL +0 -0
- {sourcecode-4.10.6.dist-info → sourcecode-4.10.7.dist-info}/entry_points.txt +0 -0
- {sourcecode-4.10.6.dist-info → sourcecode-4.10.7.dist-info}/licenses/LICENSE +0 -0
sourcecode/__init__.py
CHANGED
sourcecode/cache.py
CHANGED
|
@@ -336,10 +336,15 @@ def cache_dir(repo_root: Path) -> Path:
|
|
|
336
336
|
def status(repo_root: Path) -> dict[str, Any]:
|
|
337
337
|
"""Return a stats dict describing the current cache state for *repo_root*.
|
|
338
338
|
|
|
339
|
-
Keys: ``cache_dir``, ``
|
|
339
|
+
Keys: ``cache_dir``, ``cached_cores``, ``views``, ``cas_blobs``,
|
|
340
340
|
``total_size_bytes``, ``total_size_mb``, ``ris_exists``, ``ris_git_head``,
|
|
341
341
|
``ris_last_updated_at``, ``ris_is_stale``, ``current_git_head``.
|
|
342
342
|
|
|
343
|
+
``cached_cores`` counts ``core-*.json.gz`` entries in this cache. It was
|
|
344
|
+
named ``cores`` until 4.10.7, which is the field name a captured baseline
|
|
345
|
+
uses for the machine's CPU count (``env.cores``) — two different facts under
|
|
346
|
+
one name, on the same machine, minutes apart (C4-18).
|
|
347
|
+
|
|
343
348
|
Note: ``snapshots`` is a legacy v1 field — always 0 in v2 (kept for
|
|
344
349
|
backward compatibility; v2 writes ``core-*`` and ``view-*`` files only).
|
|
345
350
|
"""
|
|
@@ -377,7 +382,7 @@ def status(repo_root: Path) -> dict[str, Any]:
|
|
|
377
382
|
if not cache_d.exists():
|
|
378
383
|
return {
|
|
379
384
|
"cache_dir": str(cache_d),
|
|
380
|
-
"
|
|
385
|
+
"cached_cores": 0, "snapshots": 0, "views": 0, "cas_blobs": 0,
|
|
381
386
|
"total_size_bytes": 0, "total_size_mb": 0.0,
|
|
382
387
|
"current_git_head": current_head,
|
|
383
388
|
"stores": _store_breakdown(repo_root, 0),
|
|
@@ -391,7 +396,7 @@ def status(repo_root: Path) -> dict[str, Any]:
|
|
|
391
396
|
total_bytes = sum(f.stat().st_size for f in all_files if f.exists())
|
|
392
397
|
return {
|
|
393
398
|
"cache_dir": str(cache_d),
|
|
394
|
-
"
|
|
399
|
+
"cached_cores": len(cores),
|
|
395
400
|
"snapshots": len(snapshots),
|
|
396
401
|
"views": len(views),
|
|
397
402
|
"cas_blobs": len(cas_blobs),
|
sourcecode/cache_model.py
CHANGED
|
@@ -27,6 +27,7 @@ warm buys `endpoints` and `migrate-check` **nothing**, and on a small diff it ma
|
|
|
27
27
|
from __future__ import annotations
|
|
28
28
|
|
|
29
29
|
from dataclasses import dataclass
|
|
30
|
+
from typing import Optional
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
@dataclass(frozen=True)
|
|
@@ -54,6 +55,32 @@ class CommandCache:
|
|
|
54
55
|
#: then the command — because measuring them in sequence lets one command warm the
|
|
55
56
|
#: next and reports a benefit the user will not get.
|
|
56
57
|
measured: str = ""
|
|
58
|
+
#: What the command has to touch to answer, in the vocabulary the budget
|
|
59
|
+
#: floors already use (C4-19). This is the axis that decides how a command can
|
|
60
|
+
#: be *run* — in the foreground, after a warm, or detached — as opposed to how
|
|
61
|
+
#: much a warm saves it, which is `warm` above:
|
|
62
|
+
#: ``core`` — a symbol, one file, a diff, or stored metadata
|
|
63
|
+
#: ``repo-wide`` — one pass over the repository
|
|
64
|
+
#: ``deep`` — a composition of several repo-wide passes
|
|
65
|
+
#: ``none`` — not an analysis of a repository at all
|
|
66
|
+
#: It lives here because this is where the measurements live; `cli`'s budget
|
|
67
|
+
#: floors and `detach.detachable_commands()` read it rather than keeping a
|
|
68
|
+
#: second table, which is how `posture`, `modernize` and `repo-ir` — three of
|
|
69
|
+
#: the commands the field could not run — ended up undetachable.
|
|
70
|
+
analysis_class: str = "repo-wide"
|
|
71
|
+
#: The same figures `measured` describes, in machine form: seconds on the
|
|
72
|
+
#: reference repository, cold and after `cache warm`. ``None`` where the row
|
|
73
|
+
#: was never timed — an axis that could not be measured is never a number.
|
|
74
|
+
cold_seconds: "Optional[float]" = None
|
|
75
|
+
warm_seconds: "Optional[float]" = None
|
|
76
|
+
#: The other measured point: this command on the field repository
|
|
77
|
+
#: (3 342 Java files, Windows 11 / PowerShell 5.1 / pipx, cold), from field
|
|
78
|
+
#: evaluations #13 and #14. Seconds where a run finished; `field_blocked`
|
|
79
|
+
#: where it did not — the harness promoted the process and the session died,
|
|
80
|
+
#: which is a measurement of a different kind and is never written as a
|
|
81
|
+
#: duration. Rows with neither were not attempted there.
|
|
82
|
+
field_seconds: "Optional[float]" = None
|
|
83
|
+
field_blocked: bool = False
|
|
57
84
|
|
|
58
85
|
|
|
59
86
|
#: Where every `measured` figure comes from.
|
|
@@ -61,6 +88,25 @@ REFERENCE_REPOSITORY = (
|
|
|
61
88
|
"BroadleafCommerce (2 000+ Java files, dirty tree), warm machine, 3.2.2"
|
|
62
89
|
)
|
|
63
90
|
|
|
91
|
+
#: The size of that repository, so a reader on a different one knows what the
|
|
92
|
+
#: figures are relative to.
|
|
93
|
+
REFERENCE_JAVA_FILES = 2000
|
|
94
|
+
|
|
95
|
+
#: The other end of the measured range, and the reason this module publishes a
|
|
96
|
+
#: *class* rather than a projected duration (C4-19). Field evaluation #13, on
|
|
97
|
+
#: Windows 11 / PowerShell 5.1 / pipx / Python 3.10: `spring-audit` on a
|
|
98
|
+
#: 3 342-file repository ran **408 s** — 46× the 8.8 s the same command takes on
|
|
99
|
+
#: the 2 000-file reference. Cost does not scale with file count in any way this
|
|
100
|
+
#: product has measured, so a projected "~15 s on your repository" would be a
|
|
101
|
+
#: confident falsehood of exactly the kind the ledger exists to prevent. What can
|
|
102
|
+
#: be said honestly is the class, the two measured anchors, and how to run it.
|
|
103
|
+
FIELD_ANCHOR = (
|
|
104
|
+
"field evaluation #13: spring-audit on 3 342 Java files took 408 s "
|
|
105
|
+
"(Windows, pipx, cold) against 8.8 s on the 2 000-file reference"
|
|
106
|
+
)
|
|
107
|
+
FIELD_ANCHOR_JAVA_FILES = 3342
|
|
108
|
+
FIELD_ANCHOR_SECONDS = 408.0
|
|
109
|
+
|
|
64
110
|
|
|
65
111
|
#: Every layer keys on `cache.worktree_signature` — the exact tree state (C1-9).
|
|
66
112
|
#: One sentence covers all of them: **any change to the analysed files invalidates,
|
|
@@ -125,78 +171,78 @@ COMMANDS: tuple[CommandCache, ...] = (
|
|
|
125
171
|
"`--env-map`, `--depth N` and `--exclude` change the *analysis*, so they miss the "
|
|
126
172
|
"warmed core and rescan — this is the 171 s the field measured after a 103 s warm.",
|
|
127
173
|
"--compact 13.3 s cold → 0.3 s warm (cold re-measured on 3.7.0: was 19.3 s, C3-6); "
|
|
128
|
-
"--agent --full --env-map --depth 20 34.7 s → 33.9 s (no gain)"),
|
|
174
|
+
"--agent --full --env-map --depth 20 34.7 s → 33.9 s (no gain)", analysis_class="repo-wide", cold_seconds=13.3, warm_seconds=0.3, field_seconds=115.0),
|
|
129
175
|
CommandCache("posture", ("cir", "parse"), "shared", False,
|
|
130
176
|
"Resolves the conditional bean graph on every run, over the shared CIR a warm "
|
|
131
177
|
"builds — the parse it used to repeat for itself. `--diff` compares two profile "
|
|
132
178
|
"sets over that one IR, so the second side costs the resolution only.",
|
|
133
|
-
"10.1 s → 1.6 s"),
|
|
179
|
+
"10.1 s → 1.6 s", analysis_class="repo-wide", cold_seconds=10.1, warm_seconds=1.6, field_blocked=True),
|
|
134
180
|
CommandCache("risk", ("cir", "parse"), "shared", False,
|
|
135
181
|
"Composes what the audit, impact-chain and the posture already answer, so it "
|
|
136
182
|
"pays each of their costs once over the shared CIR a warm builds — one parse "
|
|
137
183
|
"for the whole composition, and the reachability query is cached per symbol "
|
|
138
184
|
"within the run.",
|
|
139
185
|
"not measured on the battery yet — the composition is bounded by the "
|
|
140
|
-
"`spring-audit` + `impact-chain` costs listed here, not by new analysis"),
|
|
186
|
+
"`spring-audit` + `impact-chain` costs listed here, not by new analysis", analysis_class="deep"),
|
|
141
187
|
CommandCache("enrich", ("cir", "parse"), "shared", False,
|
|
142
188
|
"Runs the same composition as `risk` over the repository, then joins a SARIF "
|
|
143
189
|
"log to it. Reading the log is negligible; everything a warm helps with is the "
|
|
144
190
|
"repository side, so what it buys is what it buys `risk`.",
|
|
145
191
|
"not measured on the battery yet — bounded by the `risk` composition, plus "
|
|
146
|
-
"reading one JSON file"),
|
|
192
|
+
"reading one JSON file", analysis_class="deep"),
|
|
147
193
|
CommandCache("audit-report", ("cir", "parse"), "shared", False,
|
|
148
194
|
"Packages `risk` and `posture` evidence. A warm helps the repository side; "
|
|
149
195
|
"`--from-risk risk.json` skips risk recomputation entirely and only builds "
|
|
150
196
|
"the posture/report projection.",
|
|
151
197
|
"not measured on the battery yet — bounded by `risk` + `posture`, or by "
|
|
152
|
-
"`posture` when `--from-risk` is supplied"),
|
|
198
|
+
"`posture` when `--from-risk` is supplied", analysis_class="deep"),
|
|
153
199
|
CommandCache("migrate-recipe", ("parse",), "shared", False,
|
|
154
200
|
"Runs the same scan as `migrate-check` and projects its findings into an "
|
|
155
201
|
"OpenRewrite recipe, so it buys exactly what a warm buys `migrate-check`: "
|
|
156
202
|
"the parse, not the rule pass.",
|
|
157
203
|
"not measured on the battery yet — bounded by `migrate-check` on the same "
|
|
158
|
-
"repository (openmrs-core ~2 s)"),
|
|
204
|
+
"repository (openmrs-core ~2 s)", analysis_class="repo-wide"),
|
|
159
205
|
CommandCache("data-exposure", ("cir", "parse"), "shared", False,
|
|
160
206
|
"Walks the same call reach as `impact-chain` once per declared type and "
|
|
161
207
|
"reads the endpoint security surface, both over the shared CIR a warm "
|
|
162
208
|
"builds. Cost scales with the number of declared types, not with the "
|
|
163
209
|
"size of the label.",
|
|
164
210
|
"not measured on the battery yet — one `impact-chain` traversal per "
|
|
165
|
-
"declared seed type over a CIR the warm already paid for"),
|
|
211
|
+
"declared seed type over a CIR the warm already paid for", analysis_class="repo-wide"),
|
|
166
212
|
CommandCache("endpoints", ("ris", "parse"), "shared", False,
|
|
167
213
|
"Recomputes the endpoint surface on every run, over a parse a warm has already "
|
|
168
214
|
"paid for. Until 3.7.0 the extractor parsed every file itself instead of reading "
|
|
169
215
|
"the shared parse cache, and a warm measurably bought it nothing (C3-6).",
|
|
170
|
-
"3.3 s → 1.4 s (re-measured on 3.7.0; was 2.8 s → 2.9 s)"),
|
|
216
|
+
"3.3 s → 1.4 s (re-measured on 3.7.0; was 2.8 s → 2.9 s)", analysis_class="repo-wide", cold_seconds=3.3, warm_seconds=1.4, field_seconds=4.2),
|
|
171
217
|
CommandCache("spring-audit", ("ris", "parse"), "shared", False,
|
|
172
218
|
"Recomputes every run, but over a parse a warm has already paid for.",
|
|
173
|
-
"8.8 s → 3.7 s"),
|
|
219
|
+
"8.8 s → 3.7 s", analysis_class="repo-wide", cold_seconds=8.8, warm_seconds=3.7, field_seconds=408.0),
|
|
174
220
|
CommandCache("migrate-check", ("cir",), "none", False,
|
|
175
221
|
"Computes its own inventory and shares nothing a warm builds. Only `--blast-radius` "
|
|
176
222
|
"reuses the shared CIR.",
|
|
177
|
-
"4.8 s → 4.8 s"),
|
|
223
|
+
"4.8 s → 4.8 s", analysis_class="repo-wide", cold_seconds=4.8, warm_seconds=4.8, field_blocked=True),
|
|
178
224
|
CommandCache("impact-chain", ("cir", "parse"), "shared", False,
|
|
179
225
|
"The CIR is the expensive half — this is where a warm pays most.",
|
|
180
|
-
"9.9 s → 1.7 s"),
|
|
181
|
-
CommandCache("impact", ("parse",), "shared", False, "", "4.9 s → 2.8 s"),
|
|
226
|
+
"9.9 s → 1.7 s", analysis_class="core", cold_seconds=9.9, warm_seconds=1.7),
|
|
227
|
+
CommandCache("impact", ("parse",), "shared", False, "", "4.9 s → 2.8 s", analysis_class="core", cold_seconds=4.9, warm_seconds=2.8),
|
|
182
228
|
CommandCache("pr-impact", ("parse",), "shared", False,
|
|
183
|
-
"Diff-dependent: the answer itself is never stored."),
|
|
184
|
-
CommandCache("verify", (), "none", False, "Runs the contracts against a fresh reading."),
|
|
229
|
+
"Diff-dependent: the answer itself is never stored.", analysis_class="core"),
|
|
230
|
+
CommandCache("verify", (), "none", False, "Runs the contracts against a fresh reading.", analysis_class="core"),
|
|
185
231
|
CommandCache("verify-edit", ("parse",), "shared", True,
|
|
186
232
|
"Built for the edit loop: the parse cache is what keeps an unchanged file out of the "
|
|
187
233
|
"next run. Its own second run is faster again.",
|
|
188
|
-
"14.6 s → 9.6 s → 5.6 s on repeat"),
|
|
234
|
+
"14.6 s → 9.6 s → 5.6 s on repeat", analysis_class="repo-wide", cold_seconds=14.6, warm_seconds=9.6, field_blocked=True),
|
|
189
235
|
CommandCache("review-pr", ("cir",), "none", False,
|
|
190
236
|
"Diff-dependent, and it reuses the CIR only if one exists. On a small diff, loading "
|
|
191
237
|
"the warmed CIR costs more than the work it saves.",
|
|
192
|
-
"1.1 s → 2.3 s (slower)"),
|
|
193
|
-
CommandCache("plan", ("parse",), "shared", False, "", "9.3 s → 3.8 s"),
|
|
194
|
-
CommandCache("compare", ("parse",), "shared", False, ""),
|
|
195
|
-
CommandCache("delta", (), "none", False, "Analyses two states — two checkouts, or two refs materialised into temporary trees; neither is the tree the cache describes."),
|
|
196
|
-
CommandCache("contract-diff", (), "none", False, "Analyses two states (checkouts or refs); neither is the tree the cache describes."),
|
|
238
|
+
"1.1 s → 2.3 s (slower)", analysis_class="core", cold_seconds=1.1, warm_seconds=2.3),
|
|
239
|
+
CommandCache("plan", ("parse",), "shared", False, "", "9.3 s → 3.8 s", analysis_class="core", cold_seconds=9.3, warm_seconds=3.8),
|
|
240
|
+
CommandCache("compare", ("parse",), "shared", False, "", analysis_class="core"),
|
|
241
|
+
CommandCache("delta", (), "none", False, "Analyses two states — two checkouts, or two refs materialised into temporary trees; neither is the tree the cache describes.", analysis_class="repo-wide"),
|
|
242
|
+
CommandCache("contract-diff", (), "none", False, "Analyses two states (checkouts or refs); neither is the tree the cache describes.", analysis_class="repo-wide"),
|
|
197
243
|
CommandCache("fix-bug", ("task",), "none", True,
|
|
198
|
-
"Shorthand for `prepare-context fix-bug`; caches its own answer, which a warm never runs."),
|
|
199
|
-
CommandCache("rename-class", (), "none", False, ""),
|
|
244
|
+
"Shorthand for `prepare-context fix-bug`; caches its own answer, which a warm never runs.", analysis_class="core"),
|
|
245
|
+
CommandCache("rename-class", (), "none", False, "", analysis_class="core"),
|
|
200
246
|
CommandCache("prepare-context", ("task", "ris", "cir", "parse"), "answer", True,
|
|
201
247
|
"Per task: `onboard` and `explain` are served from the RIS a warm rebuilds; "
|
|
202
248
|
"`refactor`, `fix-bug` and `generate-tests` cache their own answer, but a warm does "
|
|
@@ -204,7 +250,7 @@ COMMANDS: tuple[CommandCache, ...] = (
|
|
|
204
250
|
"diff-dependent and never cached.",
|
|
205
251
|
"onboard 6.5 s → 0.3 s with a warm — but a second run with NO warm recomputes "
|
|
206
252
|
"(10.2 s → 9.4 s at 5 486 files; C1-40) · refactor 7.7 s → 7.7 s (0.3 s on "
|
|
207
|
-
"repeat) · generate-tests 12.4 s → 11.0 s (0.3 s on repeat)"),
|
|
253
|
+
"repeat) · generate-tests 12.4 s → 11.0 s (0.3 s on repeat)", analysis_class="repo-wide", cold_seconds=6.5, warm_seconds=0.3),
|
|
208
254
|
CommandCache("onboard", ("task", "ris"), "answer", False,
|
|
209
255
|
"Shorthand for `prepare-context onboard`. A warm stores its answer; the command "
|
|
210
256
|
"does NOT store its own, so a second run without a warm pays full price. C1-40: "
|
|
@@ -212,33 +258,33 @@ COMMANDS: tuple[CommandCache, ...] = (
|
|
|
212
258
|
"56 s then 23,5 s — this row said it would be a hit.",
|
|
213
259
|
"with a warm: 6.5 s → 0.3 s (2 000 files) · 10.2 s → 0.7 s (5 486 files). "
|
|
214
260
|
"WITHOUT a warm, a second identical run: 10.2 s → 9.4 s (5 486 files) — "
|
|
215
|
-
"no answer hit"),
|
|
261
|
+
"no answer hit", analysis_class="repo-wide", cold_seconds=6.5, warm_seconds=0.3),
|
|
216
262
|
CommandCache("explain", ("cir",), "shared", False, "Serves from the shared CIR a warm builds.",
|
|
217
|
-
"9.8 s → 1.6 s"),
|
|
218
|
-
CommandCache("export", ("parse",), "shared", False, "", "8.8 s → 3.7 s"),
|
|
219
|
-
CommandCache("repo-ir", ("parse",), "shared", False, "", "5.1 s → 2.9 s"),
|
|
220
|
-
CommandCache("validation", ("parse",), "shared", False, "", "11.6 s → 6.4 s"),
|
|
221
|
-
CommandCache("modernize", ("parse",), "shared", False, "", "5.2 s → 3.0 s"),
|
|
222
|
-
CommandCache("chunk-file", (), "none", False, "Reads one file; nothing to cache."),
|
|
263
|
+
"9.8 s → 1.6 s", analysis_class="core", cold_seconds=9.8, warm_seconds=1.6),
|
|
264
|
+
CommandCache("export", ("parse",), "shared", False, "", "8.8 s → 3.7 s", analysis_class="repo-wide", cold_seconds=8.8, warm_seconds=3.7),
|
|
265
|
+
CommandCache("repo-ir", ("parse",), "shared", False, "", "5.1 s → 2.9 s", analysis_class="repo-wide", cold_seconds=5.1, warm_seconds=2.9, field_blocked=True),
|
|
266
|
+
CommandCache("validation", ("parse",), "shared", False, "", "11.6 s → 6.4 s", analysis_class="repo-wide", cold_seconds=11.6, warm_seconds=6.4),
|
|
267
|
+
CommandCache("modernize", ("parse",), "shared", False, "", "5.2 s → 3.0 s", analysis_class="repo-wide", cold_seconds=5.2, warm_seconds=3.0, field_blocked=True),
|
|
268
|
+
CommandCache("chunk-file", (), "none", False, "Reads one file; nothing to cache.", analysis_class="core"),
|
|
223
269
|
CommandCache("cold-start", ("ris",), "answer", True,
|
|
224
270
|
"Reads the RIS a warm rebuilds — that is all it does. Without one it answers "
|
|
225
271
|
"`no_ris` instead of a snapshot.",
|
|
226
|
-
"0.2 s either way"),
|
|
227
|
-
CommandCache("trend", (), "none", False, "Reads stored baseline artifacts from disk; analyses no source, so no cache layer applies. Same command as `baseline trend`."),
|
|
272
|
+
"0.2 s either way", analysis_class="core", cold_seconds=0.2, warm_seconds=0.2),
|
|
273
|
+
CommandCache("trend", (), "none", False, "Reads stored baseline artifacts from disk; analyses no source, so no cache layer applies. Same command as `baseline trend`.", analysis_class="none"),
|
|
228
274
|
CommandCache("baseline", ("parse",), "shared", False, "`capture`/`diff`/`trend` over architectural metrics.",
|
|
229
|
-
"capture 8.7 s → 3.6 s"),
|
|
275
|
+
"capture 8.7 s → 3.6 s", analysis_class="repo-wide", cold_seconds=8.7, warm_seconds=3.6, field_seconds=11.0),
|
|
230
276
|
CommandCache("retrieve", ("cir", "parse"), "shared", False,
|
|
231
|
-
"Every query builds or reuses the shared CIR a warm builds."),
|
|
232
|
-
CommandCache("archetype", ("parse",), "shared", False, "", "9.3 s → 5.6 s"),
|
|
233
|
-
CommandCache("activate", (), "none", False, "Not an analysis."),
|
|
234
|
-
CommandCache("auth", (), "none", False, "Not an analysis."),
|
|
235
|
-
CommandCache("cache", (), "none", False, "Operates on the caches themselves."),
|
|
236
|
-
CommandCache("config", (), "none", False, "Not an analysis."),
|
|
277
|
+
"Every query builds or reuses the shared CIR a warm builds.", analysis_class="core"),
|
|
278
|
+
CommandCache("archetype", ("parse",), "shared", False, "", "9.3 s → 5.6 s", analysis_class="repo-wide", cold_seconds=9.3, warm_seconds=5.6),
|
|
279
|
+
CommandCache("activate", (), "none", False, "Not an analysis.", analysis_class="none"),
|
|
280
|
+
CommandCache("auth", (), "none", False, "Not an analysis.", analysis_class="none"),
|
|
281
|
+
CommandCache("cache", (), "none", False, "Operates on the caches themselves.", analysis_class="none"),
|
|
282
|
+
CommandCache("config", (), "none", False, "Not an analysis.", analysis_class="none"),
|
|
237
283
|
CommandCache("mcp", ("snapshot", "ris", "cir", "parse"), "shared", True,
|
|
238
|
-
"Serves the same commands over MCP, with the same layers."),
|
|
239
|
-
CommandCache("schema", (), "none", False, "Prints registries; reads no repository."),
|
|
240
|
-
CommandCache("telemetry", (), "none", False, "Not an analysis."),
|
|
241
|
-
CommandCache("version", (), "none", False, "Not an analysis."),
|
|
284
|
+
"Serves the same commands over MCP, with the same layers.", analysis_class="none"),
|
|
285
|
+
CommandCache("schema", (), "none", False, "Prints registries; reads no repository.", analysis_class="none"),
|
|
286
|
+
CommandCache("telemetry", (), "none", False, "Not an analysis.", analysis_class="none"),
|
|
287
|
+
CommandCache("version", (), "none", False, "Not an analysis.", analysis_class="none"),
|
|
242
288
|
)
|
|
243
289
|
|
|
244
290
|
_WARM_LABEL = {
|
|
@@ -274,6 +320,11 @@ def as_dict() -> dict:
|
|
|
274
320
|
for lyr in LAYERS
|
|
275
321
|
],
|
|
276
322
|
"reference_repository": REFERENCE_REPOSITORY,
|
|
323
|
+
"reference_java_files": REFERENCE_JAVA_FILES,
|
|
324
|
+
# Published beside the reference so no consumer reads the figures as a
|
|
325
|
+
# law: the same command has been measured 46× slower on a repository 1.7×
|
|
326
|
+
# the size, on a different platform (C4-19).
|
|
327
|
+
"field_anchor": FIELD_ANCHOR,
|
|
277
328
|
"commands": [
|
|
278
329
|
{
|
|
279
330
|
"command": cmd.command,
|
|
@@ -282,6 +333,12 @@ def as_dict() -> dict:
|
|
|
282
333
|
"repeat_run_is_cached": cmd.repeat,
|
|
283
334
|
"note": cmd.note,
|
|
284
335
|
"measured": cmd.measured or None,
|
|
336
|
+
"analysis_class": cmd.analysis_class,
|
|
337
|
+
"reference_seconds": (
|
|
338
|
+
None
|
|
339
|
+
if cmd.cold_seconds is None
|
|
340
|
+
else {"cold": cmd.cold_seconds, "warm": cmd.warm_seconds}
|
|
341
|
+
),
|
|
285
342
|
}
|
|
286
343
|
for cmd in COMMANDS
|
|
287
344
|
],
|
sourcecode/canonical_ir.py
CHANGED
|
@@ -636,6 +636,7 @@ def project_blast_radius(
|
|
|
636
636
|
target: str,
|
|
637
637
|
*,
|
|
638
638
|
max_depth: int = 4,
|
|
639
|
+
root=None,
|
|
639
640
|
) -> dict:
|
|
640
641
|
"""Project blast radius from CIR.
|
|
641
642
|
|
|
@@ -645,7 +646,7 @@ def project_blast_radius(
|
|
|
645
646
|
All endpoints in the result come from cir.endpoints (via route_surface).
|
|
646
647
|
No independent endpoint reconstruction.
|
|
647
648
|
"""
|
|
648
|
-
return _compute_blast_radius(cir._raw_ir, target, max_depth=max_depth)
|
|
649
|
+
return _compute_blast_radius(cir._raw_ir, target, max_depth=max_depth, root=root)
|
|
649
650
|
|
|
650
651
|
|
|
651
652
|
# ---------------------------------------------------------------------------
|
sourcecode/change_plan.py
CHANGED
|
@@ -81,10 +81,15 @@ def _node_meta(cir: "CanonicalRepositoryIR") -> dict[str, dict]:
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
def build_change_plan(
|
|
84
|
-
cir: "CanonicalRepositoryIR", target: str, *, max_depth: int = 4
|
|
84
|
+
cir: "CanonicalRepositoryIR", target: str, *, max_depth: int = 4, root=None
|
|
85
85
|
) -> dict:
|
|
86
|
-
"""Build the deterministic change plan for `target` over `cir`.
|
|
87
|
-
|
|
86
|
+
"""Build the deterministic change plan for `target` over `cir`.
|
|
87
|
+
|
|
88
|
+
`root` is optional and is used for one thing: the advice attached to an
|
|
89
|
+
unresolved target names a command, and whether that command can be run on
|
|
90
|
+
this repository is a property of the repository (C4-20).
|
|
91
|
+
"""
|
|
92
|
+
blast = project_blast_radius(cir, target, max_depth=max_depth, root=root)
|
|
88
93
|
resolution = blast.get("resolution", "not_found")
|
|
89
94
|
|
|
90
95
|
# Unresolvable target → return a plan-shaped resolution notice (never crash).
|