structure

package
v2.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PieceDeliverable = "Deliverable"
	PieceScopeOut    = "ScopeOut"
)

Kinds a structured piece may be besides a kind of record.

Variables

View Source
var Keys = map[string]bool{"name": true, "outOfScope": true, "policy": true, "ongoing": true, "runsToday": true, "groupsForFunding": true,
	"coordinatesProjects": true, "outputOf": true, "changeOfItsOwn": true, "dependedOnBy": true, "none": true, "change": true, "deliverable": true}

Keys are the keys a piece may carry: its name and the answers.

View Source
var Questions = []Question{
	{"outOfScope", "Does another body lead and fund it to its own plan, so the work only depends on it or mentions it?", "Not a record here: a scope-out line of the work, and a dependency risk if the work waits on it."},
	{"policy", "Is it a standing policy or rule with no end date that the work puts into effect?", "A Goal at goal level, its horizon ending at its next review. The rules taking effect go in the project's notes."},
	{"ongoing", "Does it keep running with no end date: a service or a function, whether it runs today or a project will set it up?", "An Operation: running if it runs today, otherwise planned and named by the project that sets it up as where it lands."},
	{"groupsForFunding", "Does it group projects or programmes only to decide what to fund and in what order?", "A Portfolio, with its strategic objectives."},
	{"coordinatesProjects", "Does it coordinate several projects, each with its own sponsor or budget, that together bring about one change?", "A Programme, with its theory of change; the projects are its components."},
	{"changeOfItsOwn", "Does it bring about a change of its own that another piece of work depends on: a survey that sets a baseline, a system or portal people use, an app, a study? Yes even when it also hands over a report, a dataset or a list. Where the document has a deliverable register, give deliverable, the code of the row that hands it over (D4).", "A Project of its own, with one objective, listed as a component of each piece that depends on it."},
	{"outputOf", "Is it an output another piece of work hands over: a document, materials, a toolkit, a training delivered, an event?", "A deliverable of that piece of work, whoever leads it."},
	{"", "None of these (answer none: true):", "A Project: work that ends, with one objective. A project the others are components of is the parent."},
}

Questions are asked of every piece, in this order; the first yes decides.

Functions

func NewID

func NewID() string

NewID is a generated id part: a record's id never comes from its name.

Types

type Piece

type Piece struct {
	Name string `json:"name"`
	// OutOfScope: another body leads and funds it to its own plan, and the
	// work only depends on it or mentions it.
	OutOfScope bool `json:"outOfScope,omitempty"`
	// Policy: it is a standing policy or rule with no end date, which the
	// work puts into effect.
	Policy bool `json:"policy,omitempty"`
	// Ongoing: it keeps running with no end date, a service or function
	// (whether it runs today or a project will set it up).
	Ongoing bool `json:"ongoing,omitempty"`
	// RunsToday: for an ongoing piece, it runs already.
	RunsToday bool `json:"runsToday,omitempty"`
	// GroupsForFunding: it groups projects or programmes to decide what to
	// fund and in what order, with no causal link between them.
	GroupsForFunding bool `json:"groupsForFunding,omitempty"`
	// CoordinatesProjects: it coordinates several projects, each with its
	// own sponsor or budget, that together bring about one change.
	CoordinatesProjects bool `json:"coordinatesProjects,omitempty"`
	// OutputOf names the piece whose output this is: a document,
	// materials, a toolkit, a training delivered, an event.
	OutputOf string `json:"outputOf,omitempty"`
	// ChangeOfItsOwn: its result is a change of its own (a survey that sets
	// a baseline, a system or portal people use, an app, a study), not an
	// output handed over.
	ChangeOfItsOwn bool `json:"changeOfItsOwn,omitempty"`
	// DependedOnBy names the pieces that depend on it.
	DependedOnBy []string `json:"dependedOnBy,omitempty"`
	// Change says, for a change of its own, what it changes that the work
	// depending on it needs: a baseline set, a system in use, a list
	// published. A piece that can only say what it hands over is an
	// output, not a project.
	Change string `json:"change,omitempty"`
	// Deliverable is, for a change of its own in a document with a
	// deliverable register, the code of the row that hands it over (D4):
	// a component project is work the document itself lists, never a
	// phase, a service or a theme renamed.
	Deliverable string `json:"deliverable,omitempty"`
	// None says every question was asked and none is yes: the piece is
	// work that ends with no other answer. A piece says it, or answers.
	None bool `json:"none,omitempty"`
}

Piece is one piece of work a document or a person names, with the answers to the structure questions. Each answer is asked plainly in structureQuestions.

type Placed

type Placed struct {
	Name string `json:"name"`
	Kind string `json:"kind"`
	// Record is Kind/id for a piece that is a record of its own, with an
	// id generated for it: the work to pass to next, as it is.
	Record string   `json:"record,omitempty"`
	Where  string   `json:"where"`
	Of     []string `json:"of,omitempty"`
}

Placed is what one piece is, and where it goes.

type Question

type Question struct {
	Field    string `json:"field"`
	Question string `json:"question"`
	Then     string `json:"then"`
}

Question is one question, as people and agents are asked it.

type Result

type Result struct {
	Pieces []Placed `json:"pieces"`
	Order  []string `json:"order"`
	// Work is every record to write, as Kind/id, in the order to write
	// them: what next takes as work, unchanged.
	Work     []string `json:"work"`
	Problems []string `json:"problems,omitempty"`
	Next     string   `json:"next"`
}

Result is the answer for a whole document: each piece, the order to write the records in, and anything the answers leave inconsistent.

func Classify

func Classify(pieces []Piece) Result

Classify answers what each piece is from its answers, the first yes deciding, and orders the records for writing: goals, then operations, then projects with the ones depended on first, then programmes, then portfolios. Deliverables and scope-out lines are written inside the project they belong to.

func (Result) Drafts

func (s Result) Drafts() []map[string]any

Drafts are the records a structure says to write, as first drafts in its order: each named, with a goal's level, an operation's status, the components each piece lists, each deliverable inside the work it is an output of, and each scope-out line in the work at the top. What only the documents can say is left for the checks to ask for, one at a time.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL