Package ai.chatur.cortex.spring.branch
Class BranchController
java.lang.Object
ai.chatur.cortex.spring.branch.BranchController
Web UI for reviewing branches staged by ingestion: listing branches pending review, viewing a
single branch's staged statements, and approving or rejecting it.
-
Constructor Summary
ConstructorsConstructorDescriptionBranchController(ai.chatur.cortex.CortexBranches branches) Creates the controller. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.servlet.view.RedirectViewapproveBranch(String branch) Merges a branch's staged assertions into the knowledge graph.Renders the assertions staged on a single branch, grouped by subject.listBranches(org.springframework.ui.Model model) Lists every branch pending review with its provenance summary.org.springframework.web.servlet.view.RedirectViewrejectBranch(String branch) Rejects a branch, discarding its staged assertions.
-
Constructor Details
-
BranchController
public BranchController(ai.chatur.cortex.CortexBranches branches) Creates the controller.- Parameters:
branches- the branches role used to list, inspect, and resolve pending branches
-
-
Method Details
-
listBranches
Lists every branch pending review with its provenance summary.- Parameters:
model- receivesbranches, theBranchInfoof every pending branch- Returns:
- the
branchesview name
-
getBranch
@GetMapping("/branches/{branch}") public String getBranch(@PathVariable("branch") String branch, org.springframework.ui.Model model) Renders the assertions staged on a single branch, grouped by subject.- Parameters:
branch- the branch namemodel- receivesbranch(the branch name) andsubjects(theBranchSubjects staged on it)- Returns:
- the
branchview name
-
approveBranch
@PostMapping("/branches/{branch}/approve") public org.springframework.web.servlet.view.RedirectView approveBranch(@PathVariable("branch") String branch) Merges a branch's staged assertions into the knowledge graph.- Parameters:
branch- the branch name- Returns:
- a redirect to
/branches, so a reviewer working through several branches lands back on the list rather than on a class tree that says nothing about what just merged
-
rejectBranch
@PostMapping("/branches/{branch}/reject") public org.springframework.web.servlet.view.RedirectView rejectBranch(@PathVariable("branch") String branch) Rejects a branch, discarding its staged assertions.- Parameters:
branch- the branch name- Returns:
- a redirect to
/branches
-