jeeves-meta-monorepo
    Preparing search index...

    Function buildArchitectTask

    • Build the architect task prompt.

      Parameters

      • ctx: MetaContext

        Synthesis context.

      • meta: {
            _architect?: string;
            _architectTokens?: number;
            _architectTokensAvg?: number;
            _archived?: boolean;
            _archivedAt?: string;
            _builder?: string;
            _builderTokens?: number;
            _builderTokensAvg?: number;
            _content?: string;
            _critic?: string;
            _criticTokens?: number;
            _criticTokensAvg?: number;
            _crossRefs?: string[];
            _depth?: number;
            _emphasis?: number;
            _error?: {
                code: string;
                message: string;
                step: "architect" | "builder" | "critic";
            };
            _feedback?: string;
            _generatedAt?: string;
            _id?: string;
            _state?: unknown;
            _steer?: string;
            _structureHash?: string;
            _synthesisCount?: number;
            [key: string]: unknown;
        }

        Current meta.json.

        • [key: string]: unknown
        • Optional_architect?: string

          Architect system prompt used this turn. Defaults from config.

        • Optional_architectTokens?: number

          Token count from last architect subprocess call.

        • Optional_architectTokensAvg?: number

          Exponential moving average of architect token usage (decay 0.3).

        • Optional_archived?: boolean

          Present and true on archive snapshots. Distinguishes live vs. archived metas.

        • Optional_archivedAt?: string

          Timestamp when this snapshot was archived. ISO 8601.

        • Optional_builder?: string

          Task brief generated by the architect. Cached and reused across cycles; regenerated only when triggered.

        • Optional_builderTokens?: number

          Token count from last builder subprocess call.

        • Optional_builderTokensAvg?: number

          Exponential moving average of builder token usage (decay 0.3).

        • Optional_content?: string

          Narrative synthesis output. Rendered by watcher for embedding.

        • Optional_critic?: string

          Critic system prompt used this turn. Defaults from config.

        • Optional_criticTokens?: number

          Token count from last critic subprocess call.

        • Optional_criticTokensAvg?: number

          Exponential moving average of critic token usage (decay 0.3).

        • Optional_crossRefs?: string[]

          Explicit cross-references to other meta owner paths. Referenced metas' _content is included as architect/builder context.

        • Optional_depth?: number

          Scheduling priority. Higher = updates more often. Negative allowed; normalized to min 0 at scheduling time.

        • Optional_emphasis?: number

          Emphasis multiplier for depth weighting in scheduling. Default 1. Higher values increase this meta's scheduling priority relative to its depth. Set to 0.5 to halve the depth effect, 2 to double it, 0 to ignore depth entirely for this meta.

        • Optional_error?: { code: string; message: string; step: "architect" | "builder" | "critic" }

          Structured error from last cycle. Present when a step failed. Cleared on successful cycle.

          • code: string

            Error classification code.

          • message: string

            Human-readable error message.

          • step: "architect" | "builder" | "critic"

            Which step failed: 'architect', 'builder', or 'critic'.

        • Optional_feedback?: string

          Critic evaluation of the last synthesis.

        • Optional_generatedAt?: string

          Timestamp of last synthesis. ISO 8601.

        • Optional_id?: string

          Stable identity. Auto-generated on first synthesis if not provided.

        • Optional_state?: unknown

          Opaque state carried across synthesis cycles for progressive work. Set by the builder, passed back as context on next cycle.

        • Optional_steer?: string

          Human-provided steering prompt. Optional.

        • Optional_structureHash?: string

          Hash of sorted file listing in scope. Detects directory structure changes that trigger an architect re-run.

        • Optional_synthesisCount?: number

          Cycles since last architect run. Reset to 0 when architect runs. Used with architectEvery to trigger periodic re-prompting.

      • config: {
            architectEvery: number;
            architectTimeout: number;
            builderTimeout: number;
            criticTimeout: number;
            defaultArchitect?: string;
            defaultCritic?: string;
            depthWeight: number;
            gatewayApiKey?: string;
            gatewayUrl: string;
            maxArchive: number;
            maxLines: number;
            metaArchiveProperty: Record<string, unknown>;
            metaProperty: Record<string, unknown>;
            skipUnchanged: boolean;
            thinking: string;
            watcherUrl: string;
        }

        Synthesis config.

        • architectEvery: number

          Run architect every N cycles (per meta).

        • architectTimeout: number

          Architect subprocess timeout in seconds.

        • builderTimeout: number

          Builder subprocess timeout in seconds.

        • criticTimeout: number

          Critic subprocess timeout in seconds.

        • OptionaldefaultArchitect?: string

          Resolved architect system prompt text. Falls back to built-in default.

        • OptionaldefaultCritic?: string

          Resolved critic system prompt text. Falls back to built-in default.

        • depthWeight: number

          Exponent for depth weighting in staleness formula.

        • OptionalgatewayApiKey?: string

          Optional API key for gateway authentication.

        • gatewayUrl: string

          OpenClaw gateway base URL for subprocess spawning.

        • maxArchive: number

          Maximum archive snapshots to retain per meta.

        • maxLines: number

          Maximum lines of context to include in subprocess prompts.

        • metaArchiveProperty: Record<string, unknown>

          Watcher metadata properties applied to archive snapshots.

        • metaProperty: Record<string, unknown>

          Watcher metadata properties applied to live .meta/meta.json files.

        • skipUnchanged: boolean

          Skip unchanged candidates, bump _generatedAt.

        • thinking: string

          Thinking level for spawned synthesis sessions.

        • watcherUrl: string

          Watcher service base URL.

      Returns string

      The architect task prompt string.