Class DescribeEditController

java.lang.Object
ai.chatur.cortex.spring.graph.DescribeEditController

@RestController public class DescribeEditController extends Object
JSON API consumed by describe.js to propose edits to an already-approved resource from the describe page.

Unlike BranchEditController, which applies a reviewer's edits to a branch in place, this one changes nothing: it stages the edit on a branch of its own and hands the branch name back, so the caller can send the author to the review page. The approved assertions are only ever reached by approving that branch.

  • Constructor Summary

    Constructors
    Constructor
    Description
    DescribeEditController(ai.chatur.cortex.CortexIngestor ingestor)
    Creates the controller.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<ai.chatur.cortex.IngestResult>
    revise(ai.chatur.cortex.ResourceEdit edit)
    Stages a proposed edit to an approved resource on a branch for review.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DescribeEditController

      public DescribeEditController(ai.chatur.cortex.CortexIngestor ingestor)
      Creates the controller.
      Parameters:
      ingestor - the ingestor role the proposed edit is staged through
  • Method Details

    • revise

      @PostMapping("/describe/revise") public org.springframework.http.ResponseEntity<ai.chatur.cortex.IngestResult> revise(@RequestBody ai.chatur.cortex.ResourceEdit edit)
      Stages a proposed edit to an approved resource on a branch for review.
      Parameters:
      edit - the proposed edit, as JSON
      Returns:
      200 OK with the outcome — carrying the name of the branch to review, or no branch if the edit would change nothing — or 422 Unprocessable Content with the lint or validation errors if the edit was rejected