feat(artifacts): view-template role and J_DISPATCHES_TO from dispatch sites to the Artifact they reach - #260
Merged
Merged
Conversation
…-dispatch literal tier (#259) - ArtifactDiscovery classifies the JSP family, Facelets, and Thymeleaf html under templates/ or WEB-INF/ as view-template; faces-config.xml becomes tool-config; bare html elsewhere stays unknown. - return body nodes carry the returned expression in argument_expr. - ViewDispatches resolves forward/include/sendRedirect sites to the artifact they reach, by declared receiver type, or records them unresolved as non-literal / no-such-artifact / ambiguous. - Literals hoists the string-literal decoders ConfigUses and the new pass share.
…wTiers (#259) Hoists the L3 intra and L4 interprocedural tiers out of ConfigUses into DataflowTiers, unchanged, and runs them over non-literal dispatch targets: a bare local closes over the callable's own DDG, a parameter over every call site that binds it, and any disagreement stays non-literal.
…fault view resolver (#259) A Spring entrypoint's String return, new ModelAndView(name) and setViewName(name) are view-name dispatch sites. Names expand through spring.mvc.view.* when declared and spring.thymeleaf.* or Thymeleaf's defaults otherwise; redirect:/forward: prefixes re-dispatch as paths; a return outside a Spring entrypoint is never a view name.
… application (#259) - JApplication.view_dispatches / view_dispatches_unresolved, wired in CodeAnalyzer after config reads at every level. - V2SchemaCatalog declares J_DISPATCHES_TO from JBodyNode to Artifact with via and prov; V2GraphProjector emits one edge per resolved dispatch and none for unresolved ones; schema.neo4j.json regenerated. - The v2 JSON oracle accepts the two lists; the CLI test drives both projections end to end over a servlet fixture; plantsbywebsphere's view-template set is pinned exactly. - SCHEMA_DECISIONS D32 and the README record the contract.
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #259. Spec: codellm-devkit/.github#80 (
docs/design/specs/2026-09-11-java-view-templates-and-dispatch.md).What
view-templaterole.ArtifactDiscoveryclassifies*.jsp *.jspx *.jspf *.tag *.tagx(format: jsp),*.xhtml(xhtml) and.htmlundertemplates/orWEB-INF/(html) asroles: ["view-template"];faces-config.xmlbecomestool-config. A bare.htmlelsewhere staysunknown— a static page and a Thymeleaf template are not distinguishable by name.returnbody nodes carry their expression inargument_expr(empty for a barereturn). Population of an existing field, no schema addition.ViewDispatches, the same shape asConfigUses: detection by declared receiver type (RequestDispatcher.forward/include,HttpServletResponse.sendRedirect,ModelAndViewconstruction /setViewName, and a Spring entrypoint's Stringreturn), a literal tier at every level, the L3/L4 dataflow tiers widening it, and a target that closes on exactly one artifact or is recorded unresolved asnon-literal/no-such-artifact/ambiguous. View names expand throughspring.mvc.view.*when declared andspring.thymeleaf.*or Thymeleaf's defaults otherwise;redirect:/forward:prefixes re-dispatch as paths.DataflowTiershoists the intra (DDG) and interprocedural (call-graph) tiers out ofConfigUsesunchanged so both passes share them;Literalslikewise for the string decoders.application.view_dispatches[] {src, dst, via, prov}andview_dispatches_unresolved[] {site, callee, target, via, reason, prov}inanalysis.json;J_DISPATCHES_TO {via, prov}fromJBodyNodetoArtifactin Neo4j. Unresolved dispatches have no target node and stay JSON-only.schema.neo4j.jsondiff is exactly the one relationship;schema_versionstays 2.0.0.Tests
ArtifactDiscoveryTest: each rule, the bare-.htmlrefusal, and plantsbywebsphere's view-template set pinned to its 16 JSP/Facelets files exactly.ReturnExpressionTest: literal, expression, bare return.ViewDispatchesTest: forward / include / redirect resolve; servlet URL →no-such-artifact; twodup.jsp→ambiguous; variable →non-literal; projection carriesvia/provwith both endpoints present and nothing for unresolved.ViewDispatchDataflowTierTest: a local closes at −a 3 (prov: ["dataflow"]), a parameter at −a 4; disagreeing definitions and two callers with different pages staynon-literalwith both tiers listed as attempted; a traced literal naming no file isno-such-artifact.ViewNameDispatchTest: Thymeleaf defaults, declaredspring.mvc.view.*,redirect:prefix,ModelAndViewboth forms, and the gate (return "home"outside a Spring entrypoint and a non-String return are not dispatches).CodeAnalyzerV2CliTest: end to end over a servlet fixture in both projections.Full suite: 593 tests green except
CodeAnalyzerIntegrationTest, which needs Docker.Caveats (from #259)
returnnodes exist from L3, so a controller's return-based view name is invisible at −a 1; itsModelAndViewsites are not.rd.forward(...)) isnon-literalfor now (ponytail:comment inViewDispatches.dispatcherArgument).via: "navigation"is reserved and emits nothing until a JSF entrypoint finder exists.Follow-up
python-sdk:
JViewDispatch/JViewDispatchUnresolvedmodels,get_view_dispatches/get_view_dispatchers, Neo4j reconstruct — filed against the 3.3.0 wheel once it is cut.