Re-measured the Option-E prototype's reported figures against CONTEXT.md on next (2026-07-31) and recorded the delta rather than overwriting the June numbers: - index counts 393/18 (2026-06-24) -> 416/20 today; CONTEXT.md gained the PROBE (11) and PROHIB (10) classes - of the 3 duplicate predicate IDs, only RULESET.WORKFLOW_MARKDOWN.FENCES remains; the two RULESET.GEMINI.* went with the Gemini runtime removal - gen-context-index.cjs --check exits 1 on next, so Phase 0's "--check green in CI" criterion is unmet (invisible to CI: the example sits outside tests/) Adds Open question 4 (index keyed on baked line numbers re-drifts on any CONTEXT.md line shift, which matters once Phase 1 promotes --check to a CI gate), and records the reviewer-proposed eval-gate question as resolved by the PROBE.*/PROHIB.* predicate classes (ADR-550 D4/D7, ADR-1606). Also names both surfaces of the Windsurf 12 KB throw in Decision 2, since it is duplicated byte-identically in bin/install.js and src/runtime-artifact-conversion.cts. Docs-only. No code, no runtime-loaded text, no behavior change. Co-authored-by: sim <sim@local>
Dynamic context management — Option-E reference example
Reference example for ADR-1671, "Dynamic context management platform."
This is a non-shipping reference example. It lives outside the build (
src/→bin/lib/), the npm packagefiles[], the installer, and the CI test suite (tests/). Nothing here is compiled into or installed with GSD. The production implementation lands in a later phase of the Dynamic Context Management epic (#1671).
What it demonstrates
The predicate fact-store → JIT selector slice of the platform: parse the
repo-root CONTEXT.md CLASS.subkey=value predicates into structured records,
drift-guard a generated index, and select the relevant predicate subset for a
task — the building block for just-in-time agent-brief assembly instead of
hand-citing a 200 KB file.
Files
context-predicates.cjs— parser + selector + deterministic index builder (self-contained).gen-context-index.cjs—--check/--writedrift-guarded generator +--select.CONTEXT-INDEX.json— sample generated output (393 predicates, 18 classes).demo.cjs— runnable usage example.
Run (from the repo root)
node examples/dynamic-context-management/demo.cjs
node examples/dynamic-context-management/gen-context-index.cjs --select PRED.k320
node examples/dynamic-context-management/gen-context-index.cjs --check
Validation
During research this slice was validated with 42 behavioral tests — predicate
forms, fenced-code / prose skipping, duplicate-id detection, the selector, a
deterministic index, and a fast-check property test. Those return as CI tests
under tests/ when the production implementation lands.
It also surfaced 3 latent duplicate predicate IDs in CONTEXT.md
(RULESET.WORKFLOW_MARKDOWN.FENCES, RULESET.GEMINI.TOOLS.ask_user,
RULESET.GEMINI.TEST_SENTINEL), recorded in the index duplicates field.