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

@@ -0,0 +1,81 @@
# Verify style constraints sit at prompt-end in the museion profile (#1)
> **Date:** 2026-10-30
> **Type:** issue
> **Reference:** git.babylondreams.de/AlexKucera/museion issue #1
## Goal
Confidence that the style constraints (banned vocab, anti-patterns, em-dash
budget — all owned by `deslop`) are assembled at/near the END of the prompt the
mentor actually receives (PRD line 145, prompt-end constraints). Audit the museion
Hermes profile prompt assembly, fix the ordering if constraints land early,
document the verified layout.
## What Was Done
- **Audited the real assembly** on the app's true path: an ACP probe
(`initialize` → `session/new` → `session/prompt`, argv `hermes acp -p
museion-pass1` — the exact `ACPEngineClient` sequence) against the provisioned
profile (claude-sonnet-5-5, hermes 0.22.5+1726), then read the engine-owned
`state.db` message log for true turn order. System prompt: stock Hermes SOUL +
generic blocks + `## Skills` listing at 73–90 % depth (descriptions only —
constraint bodies are NEVER in the system prompt; they enter mid-conversation as
`skill_view` results).
- **Baseline finding:** constraints did NOT land early — the ACP run read the piece
(msg 19) before deslop (msg 23) — but by model choice, unpinned.
- **Fix (engine-side, where methodology lives):** new verbatim-shared section
`## Draft first, rules last` in both persona skills (pass-persona 1.5,
session-persona 1.2): material into context first, rule skills after, rules
fresher than the draft at compose time.
- **`MuseionTests/PersonaLoadOrderTests.swift`** (RED→GREEN): pins the section's
presence in both personas and its verbatim parity over the REAL bundled payload
(`ProfileProvisioner.defaultPayloadRoot()`).
- **Verify run:** real Pass 1 over the real Home — piece (40) → persona (41) →
deslop (45) → verdict (54); 6 fix cards + 2 research candidates landed on the
real rails end-to-end.
- **Docs:** `docs/research/prompt-layout-factsheet.md` (verified layout, probe
traps, propagation cost) + `docs/research/prompt-order-probe.py` (the probe
script, in-repo). DOX: ref/writing skills/AGENTS.md (three→four shared
sections), MuseionTests/AGENTS.md (test-file entry).
## Decisions & Rationale
| Decision | Rationale |
|----------|-----------|
| Fix lives in the persona skills, not the app stub | PassContext.stub is a pinned minimal constant; "the methodology lives engine-side and never travels through the app" (#24). Hermes owns assembly; the personas own work order. |
| Pin load order instead of reordering | Baseline showed constraints weren't early — the conditional reorder never triggered. The gap was confidence: ordering was model choice. A doctrine pin converts observed-once into instructed-always. |
| Hand-copy to master + chat-profile copies (stale v1.3 seed, byte-matched historical commit — no user edits) | Additive-only seeding (G3a) never overwrites; without the hand-copy this machine's profiles stay stale while the test stays green. Next provisioning pass migrates the copies to master symlinks via byte-match. |
| One parity test over the bundle, not per-profile runtime checks | The bundle is the source of truth for fresh installs; per-machine drift is a seeding concern (factsheet §4 discloses it), not a test concern. |
## Gotchas & Fixes
| Problem | Root Cause | Fix |
|---------|------------|-----|
| First CLI probe (`hermes -z`) loaded ZERO skills — persona-less critique | One-shot mode swaps the skills directive for "load only what you lack" (`agent/oneshot_footprint.py`) — `-z` is not the app's path and assembles a different prompt | Re-probed over ACP (the app's real wire); documented as a probe trap in the factsheet |
| Fix cards rejected ("not a piece") in scratch-dir probes | `resolvePostURL` requires the Home layout `projects\|archive/…/post.md` — working as designed | Re-homed the probe piece to `~/Documents/Museion/projects/posts/prompt-order-probe/`; cards then landed (6) |
| Full-suite `debounce flushes after idle…` failure (1/480) | Load flake: suite ran concurrently with gitnexus analyze + 2 review subagents (documented #30 pattern); 6 s hang vs 0.13 s isolated | Verified in isolation — passes; diff touches no app code |
| `session/prompt` not found in probe | First probe draft used ACP method `prompt`; the wire method is `session/prompt` with content-block array | Mirrored `turnCore`'s exact params |
## Files Changed
| File | Change Summary |
|------|---------------|
| `ref/writing skills/pass-persona/SKILL.md` | v1.5 — shared `## Draft first, rules last` section |
| `ref/writing skills/session-persona/SKILL.md` | v1.2 — same section, verbatim |
| `MuseionTests/PersonaLoadOrderTests.swift` | NEW — presence + verbatim-parity pins over the bundled payload |
| `docs/research/prompt-layout-factsheet.md` | NEW — verified layout factsheet (AC1) |
| `docs/research/prompt-order-probe.py` | NEW — the ACP probe script, in-repo |
| `ref/writing skills/AGENTS.md` | shared-sections contract: three → four |
| `MuseionTests/AGENTS.md` | test-file list entry |
| `AGENTS.md` | gitnexus index counter refresh (analyze output) + session-log window |
## Open Items & Next Steps
- [ ] Trash the probe piece `~/Documents/Museion/projects/posts/prompt-order-probe/` (6 cards beside it) when done inspecting
- [ ] If bundled-skill content updates become routine, a version-aware refresh of provisioned copies deserves its own issue (additive-only leaves existing machines stale)
- [ ] Known ceiling (disclosed in factsheet): the pin is doctrine, not runtime enforcement — the test guards text presence + parity, not model obedience
---
*Log written by write-log skill*
+1
View File
@@ -5,6 +5,7 @@ Complete history of session logs in this directory, newest first. One-line summa
<!-- write-log: full-index -->
| Date | Type | File | Summary |
|------|------|------|---------|
| 2026-10-30 | issue | [20261030-issue1-verify-style-constraints-prompt-end_log.md](20261030-issue1-verify-style-constraints-prompt-end_log.md) | #1 prompt-end constraints: ACP audit, draft-first-rules-last persona pin, layout factsheet, real-run verify |
| 2026-10-28 | issue | [20261028-issue137-profiles-s4-engine-lifecycle-model-switch-ux_log.md](20261028-issue137-profiles-s4-engine-lifecycle-model-switch-ux_log.md) | Pass engines on-demand per profile, transient transcripts, chat restart deferred mid-turn, missing-key Run Pass — 2 race fixes |
| 2026-10-27 | issue | [20261027-issue136-profiles-s3-settings-write-path-test-connection_log.md](20261027-issue136-profiles-s3-settings-write-path-test-connection_log.md) | Profiles S3: settings write path (config set + .env), Test Connection probe, three dogfood rounds, three-reviewer audit |
| 2026-10-27 | issue | [20261027-issue135-profiles-s2-settings-page-ui_log.md](20261027-issue135-profiles-s2-settings-page-ui_log.md) | #135 Profiles S2: variant C Settings sidebar+detail over the SettingsWriting seam; NSComboBox stale-stringValue dogfood fix; 432 tests |