@saptools/service-flow 0.1.50 β 0.1.51
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.
- package/CHANGELOG.md +7 -0
- package/README.md +9 -1
- package/TECHNICAL-NOTE.md +6 -1
- package/dist/{chunk-52OUS3MO.js β chunk-YZJKE5UX.js} +470 -29
- package/dist/chunk-YZJKE5UX.js.map +1 -0
- package/dist/cli.js +42 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +14 -10
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/cli.ts +22 -0
- package/src/index.ts +1 -1
- package/src/linker/cross-repo-linker.ts +9 -1
- package/src/linker/service-resolver.ts +15 -4
- package/src/output/table-output.ts +29 -2
- package/src/trace/dynamic-branches.ts +45 -0
- package/src/trace/dynamic-targets.ts +424 -0
- package/src/trace/evidence.ts +117 -7
- package/src/trace/trace-engine.ts +11 -11
- package/src/types.ts +12 -0
- package/dist/chunk-52OUS3MO.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.51
|
|
4
|
+
|
|
5
|
+
- Added trace and graph `--dynamic-mode strict|candidates|infer` with capped `--max-dynamic-candidates` exploration for runtime-dependent remote targets.
|
|
6
|
+
- Ranked dynamic operation candidates with derived `--var` suggestions from service-path, alias, destination, package require, and implementation evidence while keeping strict mode fail-closed.
|
|
7
|
+
- Added infer-mode traversal only when all required placeholders are uniquely derived above threshold; tied candidates remain unresolved with explicit evidence.
|
|
8
|
+
- Normalized dynamic candidate score reasons to arrays and added neutral regression coverage for explicit vars, strict suggestions, candidate branches, and infer ties.
|
|
9
|
+
|
|
3
10
|
## 0.1.50
|
|
4
11
|
|
|
5
12
|
- Resolved local string, enum-member, and const-object decorator arguments with persisted evidence while keeping unsupported expressions conservative.
|
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ Index independent Git repositories, persist CAP/CDS facts in SQLite, resolve cro
|
|
|
24
24
|
- π§© **Static CAP/CDS indexing** β extracts services, actions, functions, events, handler classes, decorator metadata, handler registrations, executable symbols, local helper calls, and package-level `cds.requires`
|
|
25
25
|
- π **Service-to-service linking** β resolves `cds.connect.to(...)`, `remote.send(...)`, `cds.services.*` style calls, helper package imports, dynamic candidates, and unresolved evidence into graph edges
|
|
26
26
|
- ποΈ **SQLite-backed workspace cache** β stores deterministic facts under `.service-flow/service-flow.db` so large workspaces can be queried repeatedly without reparsing everything
|
|
27
|
-
- π§ **Dynamic edge support** β preserves parameterized destinations and service paths such as `svc_${objectCode}_process`, then lets trace and graph commands apply runtime `--var key=value` values
|
|
27
|
+
- π§ **Dynamic edge support** β preserves parameterized destinations and service paths such as `svc_${objectCode}_process`, then lets trace and graph commands apply runtime `--var key=value` values or explicitly explore/infer bounded dynamic target candidates
|
|
28
28
|
- π **Multiple output modes** β renders human-readable tables, JSON for automation, and Mermaid diagrams for architecture docs
|
|
29
29
|
- π©Ί **Diagnostics-first workflow** β records parse/index issues and exposes them through `service-flow doctor` instead of hiding partial analysis
|
|
30
30
|
- π§© **CAP helper-aware binding evidence** β follows imported helpers exported directly or through named export lists and separates alias, destination, and service-path expressions for dynamic `cds.connect.to(alias, options)` calls
|
|
@@ -56,6 +56,7 @@ npm install @saptools/service-flow
|
|
|
56
56
|
|
|
57
57
|
- Runtime `--var` values are considered only for dynamic, ambiguous, or unresolved **remote** graph edges whose alias, destination, service path, or operation path expressions contain supplied placeholders. Placeholder keys are the full trimmed expression inside `${...}`, so keys such as `domainInfo.serviceName`, `domainInfo.shortName?.toLowerCase()`, and `items[0].service` can be supplied literally without JavaScript evaluation. Local database, external HTTP, event, and already resolved static edges keep their persisted status, target, reason, and confidence. Partial substitutions remain dynamic and report the missing placeholder names.
|
|
58
58
|
- `trace` and `graph` both accept repeatable `--var key=value` options. Effective substitutions are rendered in trace evidence without mutating the persisted graph. Confidence values are bounded to `[0, 1]`.
|
|
59
|
+
- Dynamic target exploration is explicit. Default `--dynamic-mode strict` keeps missing-runtime-variable edges unresolved, but diagnostics summarize ranked candidates and copyable `--var` sets when indexed evidence can derive likely values. `--dynamic-mode candidates` renders capped exploratory candidate branches without selecting or traversing them. `--dynamic-mode infer` traverses only when all missing placeholders are derived from deterministic indexed evidence and one candidate is uniquely strongest.
|
|
59
60
|
- Repository selectors on list, trace, graph, and inspect commands narrow scope. Unknown selectors return empty machine-readable diagnostics instead of falling back to the whole workspace.
|
|
60
61
|
- Helper-package dependency edges prefer exact indexed package names. Duplicate package-name candidates are persisted as ambiguous evidence rather than silently selecting one repository.
|
|
61
62
|
- Handler registration parsing is AST-based for common `createCombinedHandler({ handler: ... })` forms: direct arrays, arrays assembled with spreads, non-`handlers` array names, aliased class imports, default-imported arrays, named exported arrays, and safe relative re-exports. Class-level rows keep registration file/line and import evidence.
|
|
@@ -169,6 +170,7 @@ service-flow trace --workspace /path/to/workspace --service /FacadeService --pat
|
|
|
169
170
|
service-flow trace --workspace /path/to/workspace --handler EntryHandler --depth 1 --format json
|
|
170
171
|
service-flow trace --workspace /path/to/workspace --service /FacadeService --path /doWork --depth 2
|
|
171
172
|
service-flow trace --workspace /path/to/workspace --repo facade-service --operation doWork --var objectCode=xx --var objectType=Thing
|
|
173
|
+
service-flow trace --workspace /path/to/workspace --repo facade-service --operation doWork --dynamic-mode candidates --max-dynamic-candidates 20
|
|
172
174
|
service-flow trace --workspace /path/to/workspace --service /FacadeService --path /doWork --implementation-hint service=/TargetService,operation=/runTask,repo=target-helper
|
|
173
175
|
```
|
|
174
176
|
|
|
@@ -188,6 +190,8 @@ service-flow trace --workspace /path/to/workspace --service /FacadeService --pat
|
|
|
188
190
|
| `--implementation-repo <name>` | Select one implementation repository for every ambiguous hop; retained for backward compatibility |
|
|
189
191
|
| `--implementation-hint <scope>` | Select one implementation for a matching hop; repeatable fields are `service`, `operation`, `package`, `repository`, `family`, and required `repo` |
|
|
190
192
|
| `--var <key=value>` | Apply runtime values to dynamic destinations/service paths; repeatable |
|
|
193
|
+
| `--dynamic-mode <mode>` | `strict`, `candidates`, or `infer`; defaults to `strict` |
|
|
194
|
+
| `--max-dynamic-candidates <n>` | Cap dynamic candidate suggestions and exploratory branches; defaults to `5` |
|
|
191
195
|
|
|
192
196
|
### πΊοΈ `service-flow graph`
|
|
193
197
|
|
|
@@ -209,6 +213,8 @@ service-flow graph --workspace /path/to/workspace --repo facade-service --operat
|
|
|
209
213
|
| `--implementation-repo <name>` | Select one implementation repository for every ambiguous hop |
|
|
210
214
|
| `--implementation-hint <scope>` | Apply a repeatable scoped implementation selection |
|
|
211
215
|
| `--var <key=value>` | Apply repeatable runtime substitutions |
|
|
216
|
+
| `--dynamic-mode <mode>` | `strict`, `candidates`, or `infer`; defaults to `strict` |
|
|
217
|
+
| `--max-dynamic-candidates <n>` | Cap dynamic candidate suggestions and exploratory branches; defaults to `5` |
|
|
212
218
|
|
|
213
219
|
### π `service-flow list ...`
|
|
214
220
|
|
|
@@ -347,6 +353,8 @@ service-flow trace --workspace /path/to/workspace --repo facade-service --operat
|
|
|
347
353
|
|
|
348
354
|
When a concrete target exists after variable substitution, the trace shows both the parameterized evidence and the resolved match. When it does not, `service-flow` keeps the edge as a dynamic candidate or unresolved edge so the missing link remains visible.
|
|
349
355
|
|
|
356
|
+
When runtime values are missing, strict trace output includes the missing variable names plus bounded candidate guidance when indexed operations and routing metadata can derive values. JSON includes `dynamicTargetExploration`, `dynamicTargetCandidates`, `dynamicTargetCandidateSuggestions`, `suggestedVarSets`, and `dynamicTargetInference`; table output shows compact candidate counts and copyable `--var` examples. Use `--dynamic-mode candidates` to render capped exploratory branches, or `--dynamic-mode infer` to continue only through a unique fully-derived candidate.
|
|
357
|
+
|
|
350
358
|
Direct sends and same-file or imported wrappers share one path-candidate analysis. Literals and immutable aliases resolve; conditional or branch-assigned static alternatives remain ambiguous with all raw and normalized candidates; dynamic reassignments remain dynamic with the exact runtime identifier. Wrapper definition sends are treated as templates when a concrete caller-site edge can be indexed.
|
|
351
359
|
|
|
352
360
|
Service binding evidence distinguishes a directly persisted binding from caller-to-callee contextual recovery. Persisted binding selection never uses a declaration after the call and does not choose among different mutable client assignments. Contextual trace evidence carries caller and callee sites, argument/property and parameter/local names, original binding location, routing expressions, candidate ties, and selection status.
|
package/TECHNICAL-NOTE.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Service Flow Resolution Notes
|
|
2
2
|
|
|
3
|
+
## 0.1.51 dynamic target exploration notes
|
|
4
|
+
|
|
5
|
+
- Persisted graph storage remains conservative. Runtime-dependent remote targets still link as dynamic or unresolved graph edges unless static evidence is strong enough.
|
|
6
|
+
- Trace and graph now accept `--dynamic-mode strict|candidates|infer`. Strict is the default and does not traverse missing-runtime-variable candidates. Candidates mode renders capped exploratory candidate branches that are explicitly unselected. Infer mode resolves only when all required placeholders are derived from deterministic indexed evidence and the selected candidate is unique above threshold.
|
|
7
|
+
- Dynamic candidate evidence is derived from indexed operation paths, service-path templates, alias/destination templates, `cds.requires`, service-binding facts, and implementation-edge availability. Candidate `reasons` are arrays, and rejected candidates explain mismatches, missing runtime variables, or tied scores.
|
|
8
|
+
- Missing-variable diagnostics retain the copyable `--var key=<value>` placeholders and add bounded candidate suggestions, suggested var sets, candidate counts, and omitted counts for human and CI consumers.
|
|
3
9
|
|
|
4
10
|
## 0.1.33 trace, entity, destination, and upgrade notes
|
|
5
11
|
|
|
@@ -145,4 +151,3 @@ Service-flow now records OData placeholders by semantic layer. Service-routing p
|
|
|
145
151
|
## 0.1.40 analyzer hardening
|
|
146
152
|
|
|
147
153
|
Expression resolution is consumer-specific: operation paths may retain template placeholders for OData normalization, while external URL and destination classifiers require literal or no-substitution-template evidence before a static target is persisted. Identifier resolution is bounded to the call-site lexical scope and ignores sibling scopes, later declarations, nested function bodies, and mutable or computed writes unless they are recorded as conservative candidate evidence.
|
|
148
|
-
|