Line

You are reading docs for v0.8. See latest (v0.9)

ui/server/src/planService-1

Cockpit server, v0.8. Source: n/a.

Variables#

MAX_SEEDS#

const MAX_SEEDS: 50 = 50

Defined in: ui/server/src/planService.mjs:23


MAX_STEPS#

const MAX_STEPS: 50 = 50

Defined in: ui/server/src/planService.mjs:21


MAX_TEXT#

const MAX_TEXT: 20000 = 20_000

Defined in: ui/server/src/planService.mjs:22


NOT_OFFERED#

const NOT_OFFERED: Readonly<{ pipeline.run: "Running a raw Context Envelope is not offered in the Cockpit: an envelope is an opaque program of generator steps, not something a plan review can show plainly."; }>

Defined in: ui/server/src/planService.mjs:27

Flows the Cockpit will not run from a browser-supplied plan, with the reason a person can read.


PATH_ARGS#

const PATH_ARGS: Readonly<{ create.controller.bind: string[]; create.page.from: string[]; create.service.openapi: string[]; create.workflow.from: string[]; import.unit: string[]; project.init: string[]; research.workflow: string[]; }>

Defined in: ui/server/src/planService.mjs:33

Which arguments hold a file path, per flow. Every one must be project-relative. The drift guard in planService.test.mjs fails if a flow gains a path-looking argument that is not listed here.

Functions#

checkPlan()#

checkPlan(plan, root): object

Defined in: ui/server/src/planService.mjs:139

validatePlan() + the Cockpit checks + a preview of what each step would run. Pure over (plan, root).

Parameters#

plan

any

root

any

Returns#

object

errors

errors: object[] = shaped

steps

steps: object[]

touches

touches: object

touches.features

features: string[]

touches.files

files: object[]

valid

valid: boolean


cockpitErrors()#

cockpitErrors(plan, root): any[]

Defined in: ui/server/src/planService.mjs:83

The Cockpit's own checks on top of validatePlan(). Only steps that name a whitelisted flow are examined.

Parameters#

plan

any

root

any

Returns#

any[]


createPlanService()#

createPlanService(o): object

Defined in: ui/server/src/planService.mjs:205

Parameters#

o
getRoot

() => string

the current project's root (never from a request)

startPlan

(plan) => object

starts a validated plan; injected so tests can watch that nothing starts on refusal

Returns#

context()

context(): any

Returns

any

impact()

impact(body): any

seeds: unit refs the user picked (explicit). accepted: refs the user confirmed from the proposals; they are recomputed from text here, so they keep their evidence and stay inferred.

Parameters
body

any

Returns

any

propose()

propose(body): any

Proposals only. Nothing is analysed and no model is called: a heuristic text match with evidence.

Parameters
body

any

Returns

any

run()

run(body): any

Re-validates, then starts. On ANY error nothing is created and nothing is started.

Parameters
body

any

Returns

any

validate()

validate(body): any

Parameters
body

any

Returns

any


flowCatalogue()#

flowCatalogue(): object[]

Defined in: ui/server/src/planService.mjs:162

The flow catalogue the review UI adds steps from: every whitelisted flow, its arguments and executors.

Returns#

object[]


plainMessage()#

plainMessage(e): any

Defined in: ui/server/src/planService.mjs:130

Plain-language text for a named error, shown next to the step. The code stays alongside so a test or a script can match on it; the sentence is what a person reads.

Parameters#

e

any

Returns#

any


readConstraints()#

readConstraints(root): object

Defined in: ui/server/src/planService.mjs:182

Constraints as the project's own architecture.yml states them: layers, active rules, frozen regions.

Parameters#

root

any

Returns#

object

exceptions

exceptions: number

featuresRoot

featuresRoot: string

framework

framework: any

frozen

frozen: any[]

layers

layers: object[]

rules

rules: object[]


unsafePathReason()#

unsafePathReason(root, value): "must be a non-empty path." | "must not contain control characters." | "must be a path inside the project, not a URL." | "must be relative to the project, not an absolute path." | "must use forward slashes." | "must stay inside the project (no "..")." | "must stay inside the project." | "could not be resolved inside the project." | "leads outside the project through a symbolic link."

Defined in: ui/server/src/planService.mjs:50

Returns a plain reason the value is not a safe project-relative path, or null when it is.

Parameters#

root

any

value

any

Returns#

"must be a non-empty path." | "must not contain control characters." | "must be a path inside the project, not a URL." | "must be relative to the project, not an absolute path." | "must use forward slashes." | "must stay inside the project (no "..")." | "must stay inside the project." | "could not be resolved inside the project." | "leads outside the project through a symbolic link."