derive-pipeline

62 beliefs (47 IN, 15 OUT)

The derive pipeline topic covers the system responsible for LLM-driven belief generation within the TMS knowledge base. This pipeline builds prompts from existing beliefs, sends them to external LLM processes via CLI subprocess invocation (derive-uses-subprocess-not-sdk), parses the resulting proposals through a versioned format contract (derive-parse-supports-two-formats), validates them defensively, and applies survivors to the belief network. The pipeline's design reflects a core tension between strategic flexibility and deterministic reproducibility (derive-achieves-flexibility-with-reproducibility): three budget strategies allow callers to trade off between reproducibility, diversity, and semantic coherence (derive-budget-three-strategies), while fixed-seed sampling ensures identical results across runs (sample-mode-is-deterministic, derive-prompt-is-deterministic-and-reproducible). Budget allocation distributes prompt token space proportionally across agents with a guaranteed floor of five beliefs per group (derive-agent-budget-proportional, derive-budget-floor-five), using linear accumulation after a bug fix that corrected a quadratic counting error (derive-budget-count-is-linear, derive-agent-count-bug).

The pipeline achieves fault tolerance through layered defenses. Validation is fail-soft, filtering invalid proposals into a skipped list rather than raising exceptions (derive-fail-soft-validation), and a Jaccard similarity guard blocks re-derivation of retracted beliefs at a 50% token-overlap threshold (derive-retraction-guard-uses-jaccard). Application enforces a trust boundary where callers must validate before applying (derive-validate-before-apply), and even if invalid proposals slip through, each is wrapped in independent error handling so one failure cannot corrupt the batch (derive-apply-isolates-per-proposal-errors). The pipeline also strips the CLAUDECODE environment variable before spawning subprocesses to prevent recursive invocation (derive-strips-claudecode-env), and writes partial JSON reports after each round so crash recovery can resume from the last completed step (derive-reports-survive-partial-runs). The prompt format itself is a closed serialization loop: the DERIVE/GATE markdown format serves as a shared contract between LLM output, parser input, and file writer output (derive-prompt-roundtrips-through-parser).

A related cluster of beliefs covers any-mode expansion, which transforms a single multi-antecedent justification into per-premise justifications with OR semantics (any-mode-creates-per-premise-justifications). Each expanded justification inherits the complete outlist specification, preserving non-monotonic defeat semantics under disjunctive expansion (any-mode-preserves-full-outlist-semantics, any-mode-outlist-preserved). These are all premises established through code inspection rather than derived beliefs.

Several composite beliefs that made sweeping claims about the pipeline have been retracted. Notably, derive-pipeline-has-end-to-end-quality-enforcement and derive-quality-is-comprehensively-code-enforced are OUT because they claimed all quality constraints are code-enforced, which conflicts with the standing premise that the minimum-two-antecedents rule and logical soundness of inferences are validated only by the LLM prompt, not in code (derive-min-antecedents-is-prompt-only, derived-belief-soundness-is-llm-only). Similarly, derive-pipeline-is-exhaustive-and-terminating and several other composite summaries were retracted, often because they bundled claims about completeness or production-readiness that could not all be independently verified. The surviving high-level characterizations are more modest: the pipeline is defensive (derive-pipeline-is-defensive), reproducible with defense-in-depth at the apply stage (derive-pipeline-is-reproducible-and-defense-in-depth), and end-to-end fault tolerant through independent layers (derive-pipeline-achieves-end-to-end-fault-tolerance). The pattern of retractions reflects a healthy self-correcting process where overclaiming composite beliefs are replaced by more precise, independently justified ones.