knowledgebuiltin

package
v1.126.4 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 8 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 Pages

func Pages() ([]knowledgepage.BuiltinPage, error)

Pages returns the shipped set, bodies loaded from the embedded files with the dialect contract substituted. 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) 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) (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)

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

This section is empty.

Jump to

Keyboard shortcuts

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