Commit Graph

251 Commits

Author SHA1 Message Date
24cd248a22 Resolve chained static string constants for path binding cases.
Follow one-hop static final indirection for Map.of keys and switch case labels so route constants can alias literals without losing fail-closed behavior on cycles or computed values.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 18:36:50 +02:00
b9db614cb1 Expand map route keys from static final string constants.
Resolve Map.of keys through compile-time static final String fields so route tables can use named constants while still failing closed on computed or non-static keys.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 18:34:59 +02:00
fba7a0c90c Resolve static-import map routes for path binding expansion.
Follow import static CommandRoutes.ROUTES to the declaring type when proving Map.get keys, and add regression coverage for switch expressions, sibling-module routes, FQN lookups, and fail-closed non-literal map keys.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 18:33:24 +02:00
12db9dbef4 Harden static map path binding for cross-class and ofEntries routes.
Resolve Routes.ROUTES-style QualifiedName receivers and Map.ofEntries initializers so commandKey expansion works for typical route-table dispatch patterns.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 18:30:34 +02:00
79bb4e2aba Expand path bindings from static Map.get lookup keys.
Prove commandKey variants from compile-time Map.of routes instead of failing closed when dispatch uses map lookup rather than switch or enum valueOf.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 18:25:27 +02:00
80b784da29 Resolve nested boolean predicate helpers for path binding.
Recursively peel predicate chains like matchesOrder -> isOrderKey(normalize(raw)) when extracting if-chain literals and inlining branch constraints, with regression tests for static-import, multi-module, and nested forms.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 18:21:04 +02:00
610c83a7ec Expand path bindings through boolean predicate helpers safely.
Recognize single-literal equals predicates in if-chains, inline them (including negated else-if constraints) for branch compatibility, skip traversing into predicate helpers during alias walks, and fail closed when a path variable cannot be proven.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 18:18:14 +02:00
fd21cfa440 Support Objects.equals for path binding and branch constraints.
Expand machineType routing when dispatchers use java.util.Objects.equals with helper-wrapped parameters, and evaluate those compound constraints without breaking existing receiver-equals forms.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 18:06:00 +02:00
8d7e04cc33 Expand path bindings for if-equals on helper-wrapped parameters.
Use balanced-paren receiver-equals substitution so compound branch constraints stay correct while supporting forms like "ORDER".equalsIgnoreCase(normalizeType(machineType)).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 18:03:40 +02:00
2d478d5779 Add multi-module path binding and enterprise flow linkKey regressions.
Verify sibling-module scan resolves cross-module EventNormalizer helpers for path expansion and assert HTML export embeds linkKey on structured business-flow steps.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 17:50:59 +02:00
252255f8b0 Resolve path bindings through static-imported helper methods.
When helper invocations have no receiver, look up single static imports and static star imports before giving up; add cross-package, chained-helper, and fail-closed expander regressions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 17:49:25 +02:00
a70059331b Resolve path bindings through cross-class static helpers.
EntryPointBindingExpander follows single-arg normalize helpers declared on other types and accepts switch selectors wrapped by those helpers when extracting string case arms.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 17:47:45 +02:00
8ef6e5ef8f Resolve path bindings through single-arg string helper methods.
Enum.valueOf(normalize(event)) now expands when normalize trivially forwards its parameter; add expander regression test and assert flow highlight helper in enterprise HTML export.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 17:46:09 +02:00
5348dafb69 Follow intra-method parameter aliases during path binding expansion.
Local renames like eventCode = event or normalized = event.trim() no longer break Enum.valueOf case extraction; add multi-hop and normalization coverage in EntryPointBindingExpanderTest.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 17:44:21 +02:00
a3789ceb3c Add enterprise business flows and fix layered sample compile.
Structured {source, event} steps in state_machine_enterprise flows.json enable HTML flow highlighting; fix additional-state configuration in layered_dispatcher_sample and refresh enterprise golden JSON.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 17:42:09 +02:00
e3f3350398 Link expanded generic REST paths via parameter alias tracking
Follow renamed path variables through call-graph aliases, expand machineType×event bindings from branch-scoped valueOf, treat fully resolved URLs as internal, and synthesize concrete polymorphic events from path constraints for transition linking.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 07:15:16 +02:00
5d432e8893 Improve REST path binding for enum path variables and valueOf
Treat enum @PathVariable parameters as internal triggers, expand multiple path placeholders via cartesian bindings, derive event cases from proven Enum.valueOf chains, and add enterprise HTML regression coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 06:52:27 +02:00
24fe8dfe00 Support structured source/event steps in business flows
Add FlowStep with backward-compatible JSON (strings or objects), precompute linkKey in HTML export, and document precise flow highlighting in flows.json.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 06:48:33 +02:00
00d1f24709 Precompute matched-transition link keys for HTML export
Embed linkKey on matchedTransitions in HTML metadata so explorer highlighting uses the same SVG #link_* suffix as PlantUML, avoiding JS/Java format drift while keeping golden JSON unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 06:46:23 +02:00
d11f8afd79 Thread context through transition and state canonicalization
Machine-scoped transition/state labels and polymorphic event harvesting now use context-aware canonicalizeLabel so ambiguous import-style enum names are not rewritten during export or validation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 06:33:37 +02:00
dbeab64e1b Fail closed on cross-package enum switch constraints
Switch-arm equality now requires compatible enum types when both sides are package-qualified, while still accepting import-style vs FQN pairs like DomainCommand.ORDER_PAY.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 06:31:11 +02:00
d589f65cc1 Use context when canonicalizing matched transitions
Matched transition enum labels now respect ambiguous simple-name fail-closed during finalization instead of guessing package from machine types alone.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 06:31:11 +02:00
4a8b6ae9d9 Thread CodebaseContext through canonical form validator
requireCanonical and event matching now use context-aware enum checks so ambiguous import-style identifiers are not falsely rewritten during export validation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 06:28:56 +02:00
be1ac91beb Scan source context before JSON property resolution
Property placeholders on JSON re-export now qualify through applyResolution with CodebaseContext so ambiguous enum names fail closed instead of guessing without bindings.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 06:26:42 +02:00
8c4f15133e Defer trigger event qualification and resolve types from bindings
Stop rewriting trigger events in TriggerPoint construction; qualify with context during property resolution and export. Upgrade heuristic simple names to JDT binding FQNs for user types only, preserving java.* platform types.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 06:24:40 +02:00
57686c575e Thread context through link policy and symbolic enum expansion
Use machine event type and CodebaseContext for trusted valueOf widen checks and resolveLinkResolution, and apply context-aware enum type matching when expanding symbolic polymorphic placeholders.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 06:17:30 +02:00
5bc65be30d Align enricher pipeline with context-aware enum canonicalization
Use label-only canonicalization for shared-infrastructure triggers, resolve valueOf enum types from JDT bindings when available, and allow trusted valueOf widens using the machine event type when the trigger omits type FQNs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 06:13:34 +02:00
5c0d9c466d Defer polymorphic qualification to linker with context
Stop rewriting polymorphic events in TriggerPoint construction without ambiguity context; canonicalize labels at link time while preserving type FQNs for shared-infrastructure routing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 06:09:00 +02:00
bd9136a45c Require package-qualified enum types for trusted valueOf widen
Reject import-style polymorphic candidates when deciding whether an ambiguous valueOf widen is machine-scoped and safe to link.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 06:06:02 +02:00
cef9dd1f9a Fail closed on ambiguous import-style enum canonicalization
Stop rewriting OrderEvent.PAY to the machine package when the simple name is ambiguous, and apply the same guard when capping polymorphic events to configured transitions.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 05:52:37 +02:00
26560fee6d Fail closed on ambiguous enum type matching during linking
Pass CodebaseContext into StrictFqnMatchingEngine so import-style OrderEvent.PAY
cannot match a.OrderEvent.PAY when OrderEvent is ambiguous across packages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 05:51:03 +02:00
8869ebc706 Align call-graph class matching with ambiguous simple-name guard
Use package-aware simple-name compatibility in VariableTracer and preserve
case-insensitive field-to-type matching only when the simple name is unambiguous.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 05:49:26 +02:00
6401a58c20 Fail closed on ambiguous simple-name type compatibility
Reject cross-package class matching and enum parameter compatibility when
types share an ambiguous simple name but differ by package-qualified FQN.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 05:46:54 +02:00
82f4e5c087 Scope implementation and transition capping to package-qualified types
When an interface simple name is ambiguous, resolve FQN implementation
lookups within the requested package only, and stop capping polymorphic
candidates to machine transitions by constant name across enum types.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 05:45:23 +02:00
828f1260cd Stop inferring machine transitions onto ambiguous triggers
Do not backfill polymorphic events from configured transitions when a
trigger is ambiguous without enum-member constraints, and block symbolic
inference when the symbolic type simple name is ambiguous across packages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 05:43:12 +02:00
fb3218e1a2 Tighten bare-constant filtering and valueOf widen policy
Scope bare polymorphic enum constants to the trigger parameter type (fail
closed on ambiguous simple names and cross-enum constant names), and fail
closed on runtime valueOf widens unless every candidate is package-qualified
for the trigger's declared event type.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 05:40:17 +02:00
5972b9df50 Fail closed on ambiguous symbolic enum expansion
Block expandSymbolicPolymorphicEvents from widening <SYMBOLIC: OrderEvent.*>
when the simple type name is ambiguous across packages, and emit symbolic
markers from the call graph when enum values cannot be resolved.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 05:29:20 +02:00
a94490712f Stop enum expansion from bypassing ambiguous simple-name guard
Remove direct enumValuesMap scan in expandDeclaredEnumValues so ambiguous
OrderEvent-style names fail closed instead of picking an arbitrary package.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-14 05:26:24 +02:00
dcae599d21 Add regression for ambiguous enum simple-name linking
Ensures the call graph and linker fail closed when multiple enums share the same simple name across packages and bindings are unavailable.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 21:59:51 +02:00
4ca42ae3dc Fail closed on ambiguous simple types in implementation widening
Prevent getImplementations("Name") from widening to unrelated classes when multiple types share the same simple name across packages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 21:53:37 +02:00
f3c82d5d7f Fail closed on ambiguous simple enum names
Track enum name collisions during scan and refuse to resolve enum values by simple name when multiple enums share the same identifier across packages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 21:51:22 +02:00
bbfb54c51b Avoid source-state inference collisions across enum types
When inferring missing trigger sourceState from the transition table, preserve enum type context (Type.CONST) so different state enums sharing a constant name do not collapse into a single inferred source.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 21:48:15 +02:00
44497afd32 Avoid borrowing @Qualifier from unrelated injection parameters
Require parameter-name or setter-name agreement when inferring a field qualifier from constructor/autowired parameter annotations, preventing false-positive routing for multi-bean StateMachine<String,String> injections.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 21:41:16 +02:00
69361e5a60 Treat dotted routing keys as concrete boolean bindings
Allow BooleanConstraintEvaluator to substitute simple routing-key bindings like order.pay while avoiding accidental substitution of variable names.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 21:36:47 +02:00
c1085a2bd3 Fail closed when call-graph heuristic lacks class info
Tighten CallGraphPathFinder heuristic matching to avoid cross-class linking when only method names are available and class ownership is unknown.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 21:24:08 +02:00
308dac557e Add parity test for record component access
Ensures record component access (req.type()) flows into sendEvent() consistently between heuristic and JDT call-graph engines.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 21:21:59 +02:00
be5386b972 Add parity test for DTO field access
Ensures public field access (req.type) flows into sendEvent() consistently between heuristic and JDT call-graph engines.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 21:19:21 +02:00
4dd64c6cdf Add parity test for static routing helper
Covers dispatcher routing via static helper methods (e.g. OrderRoutingHelper.payAction()) to ensure JDT and heuristic call-graph engines resolve identical polymorphic events.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 21:17:03 +02:00
73754cf6ea Extend reactive operator support for map and switchMap lambda remapping.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 20:56:14 +02:00
4f3d6c40e7 Gate shared-service multi-attach to provable shared infrastructure.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 20:44:58 +02:00