fix: stop the facet preset naming a prompt variable the harness dropped

The preset's persona row copied the deployment's suffix, "Your working directory
is {{cwd}}". The harness substitutes only registered prompt variables and throws
on an unregistered one during prompt assembly — so when a harness release stopped
registering `cwd` (only `provider` and `model` remain), every session on this
preset failed its first turn with

  unknown prompt variable "{{cwd}}" in section "deployment:persona-suffix"

and chat was dead rather than degraded. The row now carries the prefix only.

The folder is stated where it can follow the session instead: the facet binding
already names the facet, and now names the session folder as well when the two
differ — which is every conversation that started higher up and was narrowed, and
exactly the case where relative tool paths need saying out loud.

`test/presets.test.js` makes this class of failure impossible to reintroduce
silently: it scans every shipped preset for a variable reference and requires the
name to be one the harness registers, and holds this bundle's own rule and
binding text to no references at all. Restoring the old suffix fails it.
This commit is contained in:
NotExpectedYet committed 2026-10-19 09:56:26 +01:00
1 parent c49acfdb2c
commit 4bc4296494
6 files changed
+131 -12

No files matched your search

+12 -3
View File
@@ -11,13 +11,17 @@
# It is deliberately not applied for you, and the reason is a real hazard rather
# than caution: a preset declaration replaces the whole plugin list, never merges
# into it, so this file is a frozen copy of the shipped `standard` composition
# plus one change. When the harness next updates `standard` — a new tool, a
# plus two changes. When the harness next updates `standard` — a new tool, a
# renamed row — this copy will not follow it, and the sessions on this preset
# will silently lose whatever was added. Use it if you are prepared to re-copy
# and re-apply when that happens; otherwise take the compaction settings into
# whichever preset you actually run.
#
# The only change from the shipped file is the `compaction-basic` row's config.
# The two changes from the shipped file are the `compaction-basic` row's config,
# and the persona row's missing suffix: the shipped one names the working
# directory with a prompt variable the harness no longer registers, and an
# unregistered variable fails the whole turn instead of rendering. Re-copying
# this file from a newer `standard` reintroduces that suffix — re-apply both.
- insert:
- id: preset-standard
name: '@deepseek-ai/dsh-agent-preset'
@@ -25,10 +29,15 @@
id: standard
order: 1
plugins:
# No suffix, for the reason in `facet.patch.yml`: the harness registers
# only `provider` and `model` as prompt variables, and an unregistered
# one now throws instead of rendering. Nothing in this preset states the
# session's working directory any more — a static prompt template cannot
# name a folder that changes per session, so a deployment that needs it
# belongs in the runtime context rather than here.
- id: persona
name: '@deepseek-ai/dsh-persona'
config:
suffix: Your working directory is {{cwd}}.
prefix: You are a coding agent powered by the {{model}} model.
- id: agent-instructions
name: '@deepseek-ai/dsh-agent-instructions'