knowledgebuiltin

package
v1.147.0 Latest Latest
Warning

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

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

Documentation

Overview

Package knowledgebuiltin ships the platform's own knowledge pages: the rationale behind the advanced features that is not readable from tool schemas (the managed-script dialect and its gotchas, export identity, the semi-dynamic dashboard pattern, provenance and the capture loop), embedded in the binary and reconciled into the knowledge-page store at startup (#1390), so a release that changes them updates every deployment on its next start.

Once reconciled they are ordinary rows: the indexjobs consumer embeds them in chunks like any other page, search ranks them in the knowledge_pages source, fetch dereferences them, and the portal renders them. The builtin marker makes them read-only where people edit; an operator hides one by deleting it, and the reconcile respects that instead of resurrecting it (see knowledgepage.BuiltinReconciler for the exact per-slug rules).

It is an internal/platform seam, following utilconn: composition the platform facade wires with one call, never a Platform field or method (the god-object budget is frozen, #854).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PagesWith added in v1.143.0

func PagesWith(state *maps.State) ([]knowledgepage.BuiltinPage, error)

PagesWith returns the shipped set, bodies loaded from the embedded files with the dialect contract substituted and the maps page naming the basemap regions state holds, or saying they could not be read when state is nil. It fails only on a malformed build (a missing file or H1), which the tests catch before a release does.

func Reconcile

func Reconcile(ctx context.Context, store knowledgepage.Store, ms MapState) error

Reconcile upserts the shipped pages into the store and prunes builtin rows whose slug left the shipped set. A store without the capability — a nil store included — is a clean no-op.

The reconcile converges on whatever binary started last: it has no notion of release ordering, exactly like the prompt static ingest and the embedded API-spec seeds. During a staggered upgrade, replicas restarting on different binaries can therefore rewrite a changed page back and forth until the fleet converges — transient version-history entries and re-embeds, bounded by the upgrade window, and accepted rather than paid for with a stored release counter no other reconciled content carries.

func Restore

func Restore(ctx context.Context, store knowledgepage.Store, ms MapState) (int, error)

Restore is the way back from hiding: it un-hides the operator-hidden built-in pages and immediately reconciles, so a restored page carries the running release's content (and a restored page this release no longer ships is pruned right back). It returns how many pages came back. A store without the capability restores nothing.

func Start

func Start(ctx context.Context, store knowledgepage.Store, ms MapState)

Start runs Reconcile in the background, logging a failure instead of returning it: the reconcile is a startup job that must never block or fail a boot — a deployment that cannot reconcile still serves, one release staler. It is called by the composition root (internal/server), not by pkg/platform, whose size budget is at its cap.

Types

type MapState added in v1.143.0

type MapState interface {
	State(ctx context.Context) (maps.State, error)
}

MapState reads what the maps surface offers a map. *maps.Reader satisfies it; nil is a deployment with no database, so no maps.

func MapsOf added in v1.143.0

func MapsOf(db *sql.DB) MapState

MapsOf returns the map state over db, or nil without a database.

Jump to

Keyboard shortcuts

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