Slim "session_env" digest. Internal, not extension-owned. STRING-KEYED —
crosses the Python boundary as session["env"], so keys AND enum values
(os/shell/kind/primary_language) are strings, never keywords.
Produces a bounded map the model reads each iter:
{"host" {"os" "shell" "clock"} ; cwd lives in session["workspace"]["root"] "project" {"kind" "primary_language"} "extensions" {"active_count" "aliases"}}
Each slice is small (~50 bytes), so the section costs <200 bytes/turn.
Extensions deep-merge their own slices via :ext/ctx-fn returning
{"session_env" {their-key {…}}}; the merge happens in
ctx-loop/render-block! so internal owns the base section, extensions
layer on top.
Heavy environment scans (full byte-counted language tables, polylith
brick listings, multi-repo git status) live in the foundation-core
focused project-shape helpers for explicit deep-dives. The digest never calls
into extensions — host facts come from System/getProperty,
project shape from a single directory peek. AGENTS.md / CLAUDE.md
contents ride in their own system block (internal.prompt), not here.
Slim `"session_env"` digest. Internal, not extension-owned. STRING-KEYED —
crosses the Python boundary as `session["env"]`, so keys AND enum values
(os/shell/kind/primary_language) are strings, never keywords.
Produces a bounded map the model reads each iter:
{"host" {"os" "shell" "clock"} ; cwd lives in session["workspace"]["root"]
"project" {"kind" "primary_language"}
"extensions" {"active_count" "aliases"}}
Each slice is small (~50 bytes), so the section costs <200 bytes/turn.
Extensions deep-merge their own slices via `:ext/ctx-fn` returning
`{"session_env" {their-key {…}}}`; the merge happens in
`ctx-loop/render-block!` so internal owns the base section, extensions
layer on top.
Heavy environment scans (full byte-counted language tables, polylith
brick listings, multi-repo git status) live in the foundation-core
focused project-shape helpers for explicit deep-dives. The digest never calls
into extensions — host facts come from `System/getProperty`,
project shape from a single directory peek. AGENTS.md / CLAUDE.md
contents ride in their own system block (`internal.prompt`), not here.(base-digest environment)Compose the internal-owned base :session/env digest. Extensions
layer additional slices on top via :ext/ctx-fn (render-block!
deep-merges before render).
Compose the internal-owned base `:session/env` digest. Extensions layer additional slices on top via `:ext/ctx-fn` (`render-block!` deep-merges before render).
(deep-merge a b)Merge maps recursively. Latter map wins on scalar collision; nested
maps merge key-by-key. Used to fold extension :ext/ctx-fn contributions
into the internal-base :session/env.
Merge maps recursively. Latter map wins on scalar collision; nested maps merge key-by-key. Used to fold extension `:ext/ctx-fn` contributions into the internal-base `:session/env`.
(extension-contributions environment active-extensions)Collect "session_env" slices from every active extension's :ext/ctx-fn
fn. Returns a single deep-merged map. Extensions that contribute
under other top-level keys (e.g. their own "session_voice") are
silently ignored here — those go straight onto ctx through the
broader :ext/ctx-fn merge path.
Collect `"session_env"` slices from every active extension's `:ext/ctx-fn` fn. Returns a single deep-merged map. Extensions that contribute under other top-level keys (e.g. their own `"session_voice"`) are silently ignored here — those go straight onto ctx through the broader `:ext/ctx-fn` merge path.
(session-env environment active-extensions)Top-level helper: compose internal base + extension contributions
into the final "session_env" value that the renderer pins into the
ctx text.
Top-level helper: compose internal base + extension contributions into the final `"session_env"` value that the renderer pins into the ctx text.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |