feat(mentor): pin prompt-end constraint ordering (#1)
CI / ci (push) Canceled after 0s

Both personas gain the verbatim-shared "Draft first, rules last"
section (pass 1.5, session 1.2): the writer's material enters
context before the rule skills, so the deslop constraint tables sit
after the draft, nearest the writing they govern — the PRD's
prompt-end rule. A real ACP audit (the app's exact wire — never
-z: one-shot mode swaps the skills directive and loads nothing)
showed the baseline already read the piece before deslop, but by
model choice; the pin converts observed-once into instructed-
always, and PersonaLoadOrderTests guards presence + verbatim
parity over the bundled payload.

Verified layout, probe traps, and the additive-only propagation
cost are documented in docs/research/prompt-layout-factsheet.md
with the probe script in-repo; real-run verify: piece → persona →
deslop → verdict, 6 fix cards + 2 research candidates landed on
the real rails. Suite 479 + 1 load-flake cleared in isolation.

Closes #1
This commit is contained in:
AlexKucera committed 2026-10-30 11:20:01 +01:00
1 parent a1d1cd3d3c
commit 22bca36857
11 files changed
+332 -14

No files matched your search

+2
View File
@@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file. The format
### Added
- **mentor:** Prompt-end constraint ordering verified + pinned (#1) — the PRD's cross-cutting rule audited on the app's REAL wire: an ACP probe (initialize → session/new → session/prompt against the provisioned museion-pass1) plus the engine's own state.db read-back show constraint bodies never ride the system prompt — they enter as `skill_view` results, so "assembly order" is the mentor's tool-call order, and the baseline already loaded deslop AFTER the piece but by model choice. Both personas (pass 1.5 / session 1.2) gain the verbatim-shared "Draft first, rules last" pin converting observed-once into instructed-always; `PersonaLoadOrderTests` guards presence + parity over the bundled payload; the verified layout, the `hermes -z` trap (one-shot swaps the skills directive — a `-z` probe loads ZERO skills and assembles a different prompt), and the additive-only propagation cost (content edits need a hand-copy to master/profile copies; byte-match then migrates) live in `docs/research/prompt-layout-factsheet.md` with the probe script in-repo. Suite 479 + 1 load-flake cleared in isolation (issue #1)
- **mentor:** Profiles S4 — per-surface engine lifecycle + model-switch UX (#137) — passes run on their OWN one-shot engines (`hermes acp -p museion-passN` spawned per pass run, torn down at the verdict — a model switch costs nothing, the next spawn reads fresh config) streaming into transient unrostered transcripts (#129: one Sessions surface over the chat engine); the Chat engine stays resident and a Chat model change in Settings restarts it in place, deferred to turn end while a reply streams; Run Pass names the missing provider key and disables with an Open Settings link until the key lands (pane re-entry re-checks). Finish-audit (3 reviewers) fixed a post-await activation steal that could flip the surface mid-pass and lose the Cancel (one `claimActive` gate), plus a PRE-EXISTING `rescan` bug where a stale scan snapshot "vanished" a just-opened piece and killed its session with unflushed edits. Suite 477 (issue #137)
- **settings:** Profiles S3 — the real write path + Test Connection (#136) — every Settings change now persists: model/effort writes ride the engine's own CLI (`hermes -p <profile> config set/unset` model.provider/default/reasoning_effort/base_url, wire-verified) and provider keys upsert `VAR=value` into ALL THREE profiles' `.env` (0600, foreign lines preserved, line-broken values refused at the sink — an env-file injection guard); hydration reads model blocks and keys back at pane open, so a restart neither blanks the UI nor refuses Test Connection, and a custom z.ai base_url survives instead of being clobbered to a family default. Per-target writes coalesce AND chain past the debounce guard — the last edit is always the last write to land. Test Connection is a two-step probe (`GET /models` then a minimal streaming chat) with honest decode per the factsheet: z.ai 1113 → wrong key type, 401s → auth failed with request id, finish=length → starved, empty 200 → request failed. Live-probed wire corrections: `Content-Type: application/json` on every request (URLSession defaults to form-urlencoded — z.ai answers 200 with an error envelope), OpenAI speaks the Responses API (`/responses`, `input` + `max_output_tokens`, flagship `gpt-6.1-sol`), probe token cap 512 (64 starved reasoning models into "no content"). Suite 468; three-reviewer finish-audit fixed a write-ordering race, an `.env` lost-update race, a mid-hydrate stomp, and cut ~30 lines of dead flexibility (issue #136)