feat(mentor): pin prompt-end constraint ordering (#1)
CI / ci (push) Canceled after 0s
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:
1 parent
a1d1cd3d3c
commit
22bca36857
11 files changed
+332
-14
No files matched your search
@@ -130,7 +130,7 @@ Single-context: `CONTEXT.md` + `docs/adr/` at the repo root. See `docs/agents/do
|
||||
<!-- gitnexus:start -->
|
||||
# GitNexus — Code Intelligence
|
||||
|
||||
This project is indexed by GitNexus as **museion** (5172 symbols, 19414 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
||||
This project is indexed by GitNexus as **museion** (5211 symbols, 19643 relationships, 300 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
||||
|
||||
> Index stale? Run `node .gitnexus/run.cjs analyze` from the project root — it auto-selects an available runner. No `.gitnexus/run.cjs` yet? `npx gitnexus analyze` (npm 11 crash → `npm i -g gitnexus`; #1939).
|
||||
|
||||
@@ -187,14 +187,14 @@ Session logs live in `docs/devlog/` (one per completed task/issue/milestone). Fu
|
||||
<!-- write-log: window-start -->
|
||||
| Date | Log |
|
||||
|------|-----|
|
||||
| 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 |
|
||||
| 2026-10-27 | issue | [20261027-issue134-profiles-s1-registry-provisioning-x3_log.md](20261027-issue134-profiles-s1-registry-provisioning-x3_log.md) | #134 Profiles S1: ×3 surface registry + provisioner, master-symlink skills with byte-match migration, three-profile backup; 412 tests |
|
||||
| 2026-10-22 | issue | [20261022-issue31-first-draft-stats-capture-s5-1_log.md](20261022-issue31-first-draft-stats-capture-s5-1_log.md) | #31 S5.1: Swift-native first-draft stats stamped in place at pass invocation; two frontmatter-erasure bugs fixed; finish-audit fanout — 396 tests |
|
||||
| 2026-10-22 | issue | [20261022-issue30-sessions-new-post-from-session-drill-offers_log.md](20261022-issue30-sessions-new-post-from-session-drill-offers_log.md) | #30 lands: session-born Posts stamp origin: ai, brainstorm flavor, shared composer, and the real-engine resume wire fix. |
|
||||
| 2026-10-22 | issue | [20261022-issue29-research-library-light_log.md](20261022-issue29-research-library-light_log.md) | #29 research rail: submit_research_notes candidates in-session, ask-before keep into research/, resume replay pin, audit fixes — targeted suites green |
|
||||
| 2026-10-22 | issue | [20261022-issue28-session-lifecycle-ui_log.md](20261022-issue28-session-lifecycle-ui_log.md) | #28 Session lifecycle: multi-session model + names-only roster, pane, pass auto-create, finish-audit with 7 fixes — 359 tests green |
|
||||
| 2026-10-21 | issue | [20261021-issue27-dismiss-decay-learnings_log.md](20261021-issue27-dismiss-decay-learnings_log.md) | #27 dismiss & decay Learnings: per-type pass clock, frontmatter decay state, consult filtering, two review waves with 5 fixes |
|
||||
| 2026-10-21 | issue | [20261021-issue26-promote-consult-learnings_log.md](20261021-issue26-promote-consult-learnings_log.md) | #26 promote/consult Learnings: teaching-shape files, on-disk-truth promote, symlink guard, Learnings pane — 329 tests green |
|
||||
| 2026-10-30 | [20261030-issue1-verify-style-constraints-prompt-end_log.md](20261030-issue1-verify-style-constraints-prompt-end_log.md) |
|
||||
| 2026-10-28 | [20261028-issue137-profiles-s4-engine-lifecycle-model-switch-ux_log.md](20261028-issue137-profiles-s4-engine-lifecycle-model-switch-ux_log.md) |
|
||||
| 2026-10-27 | [20261027-issue136-profiles-s3-settings-write-path-test-connection_log.md](20261027-issue136-profiles-s3-settings-write-path-test-connection_log.md) |
|
||||
| 2026-10-27 | [20261027-issue135-profiles-s2-settings-page-ui_log.md](20261027-issue135-profiles-s2-settings-page-ui_log.md) |
|
||||
| 2026-10-27 | [20261027-issue134-profiles-s1-registry-provisioning-x3_log.md](20261027-issue134-profiles-s1-registry-provisioning-x3_log.md) |
|
||||
| 2026-10-22 | [20261022-issue31-first-draft-stats-capture-s5-1_log.md](20261022-issue31-first-draft-stats-capture-s5-1_log.md) |
|
||||
| 2026-10-22 | [20261022-issue30-sessions-new-post-from-session-drill-offers_log.md](20261022-issue30-sessions-new-post-from-session-drill-offers_log.md) |
|
||||
| 2026-10-22 | [20261022-issue29-research-library-light_log.md](20261022-issue29-research-library-light_log.md) |
|
||||
| 2026-10-22 | [20261022-issue28-session-lifecycle-ui_log.md](20261022-issue28-session-lifecycle-ui_log.md) |
|
||||
| 2026-10-21 | [20261021-issue27-dismiss-decay-learnings_log.md](20261021-issue27-dismiss-decay-learnings_log.md) |
|
||||
<!-- write-log: window-end -->
|
||||
@@ -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)
|
||||
|
||||
@@ -41,6 +41,7 @@ Owned by the root AGENTS.md contract.
|
||||
- ReadingPresenterTests gains the #109 pin: a canonical outline body (nested bullets) renders NESTED `<ul>` through the real apex pipeline — reading mode needs no outline-specific surface (ADR-0013).
|
||||
- `ProseListTests.swift` (#115 / S5) — the prose list model + fold rendering: scan pins (item basics, nested children + fold scope, lazy continuation, blank-separated child folds the blank too, fences end blocks, parents scan), indent/outdent (dash content column, caret ride + park, ordered-marker unit, boundary nils), move (subtree swap with between-text, boundary no-ops); `ProseFoldRenderingTests` (@MainActor, plain `ProseListTextView()` — no window, chrome never installs) — folding never edits the buffer, hidden scopes carry `foldedAttributes`, parent stays body-size, unfold restores, folds re-key to the nearest same-marker parent after an edit above, and a fold dies when its marker text vanishes.
|
||||
- `SettingsModelTests.swift` (#135, Profiles S2 — scenario headers at file top) — the Settings view-model mapping over a live-shaped registry fixture (claude-sonnet-5-5 deliberately ABSENT — custom is the default state): provider → effort ladders (zai low/high/max; OpenAI + Anthropic low/medium/high/xhigh/max) + effort-unset default + provider-switch reset; custom-model state (seed custom, registry id known, per-provider pinned switch defaults, empty registry = all custom free text, blank edits never commit); z.ai key-type → endpoint family (both defaults, toggle swaps, custom endpoint survives, cleared endpoint adopts the family); the `SettingsWriting` seam via a `RecordingWriter` double (surface writes carry config, key writes carry keyType only for zai — struct record, not a tuple, #134 ConfigWrite precedent; `cannedKeys` feeds `readProviderKey(provider:)` — #136 dogfood amendment: keys land in ALL THREE `.env` files, so hydration refills every key field with no per-provider profile list; `failSurfaceWrites` knob pins the failure path — `lastWriteError` surfaces, next success clears it); write-sync via `awaitPendingWrites()` (deterministic, never sleeps); the hydration clamp (an effort outside the provider's ladder reads nil); `ModelRegistry.load` lenient decode (unknown providers skipped, missing file → empty, never fatal); the ModelComboBox commit rails (list pick via `comboBoxSelectionDidChange`, Enter via the action, blur via end-editing — idempotent through the echo guard, blanks never commit; the dogfood #135 pin: a bare dropdown pick fires neither action nor end-editing). **#136 (Profiles S3):** the RecordingWriter double carries the new protocol shape (surface records include `zaiEndpoint`, key records the fan-out `profiles`, `cannedReads` feeds `readSurface`); the #136 model-side pins live in `SettingsModelWritePathTests.swift` (own file, file-length ceiling) sharing the now-internal `RecordingWriter` + `liveShapedRegistry` — a provider switch to a keyed zai threads the endpoint family into the surface write WITHOUT re-firing keys (they pre-landed in all three `.env` files at entry time), key writes carry the surfaces-on-provider list as the zai base_url write-through targets (chat first), rapid key edits coalesce into one write (superseded writes never spawn — partial key prefixes never reach `.env`; `writeDebounce: 0` keeps the suite deterministic), hydrate maps profile reads + infers the zai key type from the coding base_url (unread/unknown-provider surfaces stay seeded) and SEEDS a custom zai base_url instead of clobbering it, an edit made mid-hydrate never gets stomped, a second edit WAITS for the in-flight write (record order pinned `old → new`), and an unkeyed Test Connection authFails fast off the network; `probeModel` picks the first surface on a provider else its flagship. `HermesSettingsWriterTests.swift` (own file) — the real write path against the fake CLI (Real-Process pattern): write→`config get` round-trip, the exact config-set ORDER (provider → model → effort → base_url LAST, because setting model.provider clears base_url — live-probed), nil-effort unset + idempotent unset-when-absent, the `.env` writes over temp profile dirs (the key lands in ALL THREE profiles — a key with no surface on its provider still persists; foreign lines + comments preserved byte-for-byte, 0600 — hermes' own posture, the zai base_url config-set rides ONLY the listed profiles, an empty key leaves bytes alone but still writes the zai base_url, non-zai providers never config-set; readProviderKey round-trips, a line-broken key value is refused with nothing written — the env-injection guard), profile-named failures, missing-binary refusals + nil reads, and pure `upsertEnv` edges (in-place replace, append, trailing-newline, empty). `ProviderProbeTests.swift` (own file) — the factsheet decode matrix: zai 1113 → wrongKeyType, 401s per provider (Anthropic detail carries `request_id`), 429/foreign bodies → requestFailed; the three SSE dialects (zai chat-completions content + reasoning channels, Anthropic text_delta/stop_reason, OpenAI Responses output_text.delta/completed/incomplete/failed) — works carries reply + model count, `finish=length`/`max_tokens`/`incomplete` + empty → starved, response.failed → requestFailed, and the live 2026-10-28 z.ai **200-carried error envelope** (wrong content-type) decodes as the provider error; `ssePayloads` skipping event/DONE/blank lines; `decodeModelsCount` shapes; free `probeHTTPResponse`/`probeData` canned-response helpers live here (shared-helper convention). `ProviderProbeTransportTests.swift` (own file — the decode suite crossed its type-body ceiling, MCPToolsPromoteTests precedent) — the request builders (the 2026-10-28 Content-Type pin across all providers; Anthropic `x-api-key` + pinned version + required max_tokens; zai `thinking:enabled`+`reasoning_effort:low` wire at the 512 cap; **OpenAI in the ResponseLine truncated
|
||||
- `PersonaLoadOrderTests.swift` (#1) — persona-content pins over the REAL bundled payload (`ProfileProvisioner.defaultPayloadRoot()`): both personas carry the `## Draft first, rules last` load-order doctrine (pass-persona 1.5 / session-persona 1.2, the PRD prompt-end rule), and the section is verbatim-shared between the pair (the four-shared-sections contract, ref/writing skills/AGENTS.md). Verified layout lives in `docs/research/prompt-layout-factsheet.md`.
|
||||
|
||||
## Verification
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// PersonaLoadOrderTests.swift
|
||||
// MuseionTests
|
||||
//
|
||||
// #1 (PRD cross-cutting rule — prompt-end constraints): the persona pair
|
||||
// pins the load-order doctrine — the writer's material lands in context
|
||||
// BEFORE the rule skills, so the constraint tables (deslop) sit at/near
|
||||
// the end of the working context, closest to the writing they govern.
|
||||
// The section is shared verbatim between the personas (ref/writing
|
||||
// skills/AGENTS.md: shared sections edit together or not at all).
|
||||
//
|
||||
|
||||
import Foundation
|
||||
@testable import Museion
|
||||
import Testing
|
||||
|
||||
@Suite("PersonaLoadOrderTests")
|
||||
struct PersonaLoadOrderTests {
|
||||
/// The doctrine section heading both personas carry, verbatim.
|
||||
private static let sectionHeading = "## Draft first, rules last"
|
||||
|
||||
private static func personaBody(_ name: String) throws -> String {
|
||||
let dir = ((ProfileProvisioner.defaultPayloadRoot() as NSString)
|
||||
.appendingPathComponent(name) as NSString)
|
||||
return try String(contentsOfFile: dir.appendingPathComponent("SKILL.md"), encoding: .utf8)
|
||||
}
|
||||
|
||||
/// The section text between its heading and the next `## ` heading,
|
||||
/// trimmed — "" when absent.
|
||||
private static func section(after heading: String, in body: String) -> String {
|
||||
guard let range = body.range(of: heading) else { return "" }
|
||||
let tail = body[range.upperBound...]
|
||||
let end = tail.range(of: "\n## ")?.lowerBound ?? tail.endIndex
|
||||
return String(tail[..<end]).trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
}
|
||||
|
||||
@Test func `both personas pin the load-order doctrine`() throws {
|
||||
for name in ["pass-persona", "session-persona"] {
|
||||
let body = try Self.personaBody(name)
|
||||
#expect(body.contains(Self.sectionHeading), "\(name) lost the load-order pin")
|
||||
let section = Self.section(after: Self.sectionHeading, in: body)
|
||||
#expect(!section.isEmpty, "\(name) carries an empty load-order section")
|
||||
}
|
||||
}
|
||||
|
||||
@Test func `the load-order section is verbatim-shared between personas`() throws {
|
||||
let pass = try Self.section(after: Self.sectionHeading, in: Self.personaBody("pass-persona"))
|
||||
let session = try Self.section(after: Self.sectionHeading, in: Self.personaBody("session-persona"))
|
||||
#expect(!pass.isEmpty && pass == session, "the personas' load-order sections diverged")
|
||||
}
|
||||
}
|
||||
@@ -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*
|
||||
@@ -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 |
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
# Museion profile prompt-layout factsheet — where constraints land
|
||||
|
||||
Research artifact for #1, verifying the PRD's cross-cutting rule (*prompt-end
|
||||
constraints*: style constraints sit at/near the end of the assembled pass prompt —
|
||||
Claude/GLM are recency-biased followers; constraints that land early decay by the
|
||||
time the draft and verdict arrive).
|
||||
|
||||
Method: live probes run **2026-10-30** against the real provisioned profiles
|
||||
(`museion-pass1`, claude-sonnet-5-5, hermes-agent 0.22.5+1726), speaking the app's
|
||||
own ACP wire (`initialize` → `session/new` → `session/prompt`, argv
|
||||
`hermes acp -p museion-pass1` — the exact `ACPEngineClient` sequence), then reading
|
||||
the engine-owned `state.db` message log for the true turn order. Probe script:
|
||||
`docs/research/prompt-order-probe.py`; probe piece
|
||||
`projects/posts/prompt-order-probe/` in the real Home (fix-card rail needs the
|
||||
`projects/…/post.md` layout — a scratch path is honestly rejected as *not a piece*).
|
||||
|
||||
---
|
||||
|
||||
## 1. The system prompt (turn 0, fixed by Hermes)
|
||||
|
||||
The profiles carry the stock Hermes assembly (10,375 chars measured, ACP session):
|
||||
|
||||
1. SOUL.md — the **stock Hermes persona** (`hermes profile create` default; the
|
||||
provisioner never writes a Museion SOUL — the mentor's manner lives in the
|
||||
persona skills, not the profile).
|
||||
2. Generic Hermes blocks: finishing-the-job, parallel tool calls, memory note,
|
||||
coding-agent block, mid-turn steering, platform.
|
||||
3. **`## Skills` block at ~73–90 % depth** — the strong directive
|
||||
("MUST load … err on the side of loading") + `<available_skills>` listing
|
||||
(name + description only; deslop's line sits at ~84 % depth).
|
||||
4. Profile line + runtime environment (the actual prompt tail).
|
||||
|
||||
So the *listing* is already near the prompt end, and constraint **bodies are never
|
||||
in the system prompt** — they enter mid-conversation as `skill_view` tool results.
|
||||
|
||||
## 2. In-pass layout (what the model orders itself)
|
||||
|
||||
The stub (`PassContext.stub`) carries only pass name, piece path, and the tool
|
||||
contract — the draft enters context when the mentor `read_file`s the piece. Load
|
||||
order is therefore the mentor's choice, governed by the persona skills.
|
||||
|
||||
**Baseline (pre-fix, 2026-10-30):** piece landed before deslop (msg 19 < 23) — but
|
||||
by model choice, unpinned; nothing in the skill stack demanded it.
|
||||
|
||||
**Fix (#1): both personas gained the verbatim-shared section
|
||||
`## Draft first, rules last`** (pass-persona 1.5, session-persona 1.2): read the
|
||||
material first, then load deslop and the method; the rules behind you must be
|
||||
fresher than the draft. Guarded mechanically by
|
||||
`MuseionTests/PersonaLoadOrderTests.swift`.
|
||||
|
||||
**Verify run (post-fix, 2026-10-30):** piece (40) → pass-persona (41) → learnings
|
||||
(44) → **deslop (45)** → serif-writing (46) → research (48–50) → card submit (53) →
|
||||
verdict (54). Constraints after the draft, near the tail; 6 fix cards + 2 research
|
||||
candidates landed on the real rails. The `state.db` message order of the run:
|
||||
|
||||
```
|
||||
38 user Pass 1 stub
|
||||
40 tool read_file(piece) ← the draft lands
|
||||
41 tool skill_view(pass-persona)
|
||||
44 tool query_learnings
|
||||
45 tool skill_view(deslop) ← constraints land, after the draft
|
||||
46 tool skill_view(serif-writing)
|
||||
48 tool web_search
|
||||
50 tool submit_research_notes (received 2)
|
||||
53 tool submit_fix_cards (6 cards written)
|
||||
54 assistant the verdict
|
||||
```
|
||||
|
||||
Honesty notes: the constraints sit **mid-tail, not at the very end** — research
|
||||
results and the card submit follow them before the verdict; that is inherent to a
|
||||
fact-checking pass and satisfies the PRD's at/near-the-end rule. And the pin is a
|
||||
doctrine the model is told to follow, not a runtime guarantee — the test guards the
|
||||
text's presence and the personas' parity, not the model's obedience. Re-verify any
|
||||
time with the probe script above.
|
||||
|
||||
## 3. Probe traps (recorded so the next audit doesn't misread them)
|
||||
|
||||
- **`hermes -z` (one-shot) is NOT the app's path.** One-shot mode swaps the skills
|
||||
directive for a "load only what you lack" footprint
|
||||
(`agent/oneshot_footprint.py`) — a `-z` probe run loaded **zero** skills and
|
||||
produced a persona-less critique. The app is ACP-only; audit through ACP.
|
||||
- **`-z` and ACP assemble different prompts** (9,161 vs 10,375 chars measured) —
|
||||
never cite a one-shot dump as the pass surface's layout.
|
||||
- The card rail rejects pieces outside `projects/|archive/…/post.md` by design —
|
||||
probe with a piece in the real Home layout.
|
||||
|
||||
## 4. Propagation (the additive-only cost)
|
||||
|
||||
Seeding is additive-only (G3a): a content edit to a bundled skill never overwrites
|
||||
an existing master/profile copy. On this machine the 1.5/1.2 personas were hand-
|
||||
copied to the master (`~/Library/Application Support/Museion/skills/`) and the chat
|
||||
profile's copy-era dirs (which byte-matched historical seed v1.3 — no user edits);
|
||||
the next provisioning pass migrates those copies to master symlinks via the
|
||||
byte-match path. Fresh installs get the new bytes from the bundle. If skill-content
|
||||
updates become routine, version-aware refresh deserves its own issue.
|
||||
`PersonaLoadOrderTests` therefore guards the bundled source of truth (what fresh
|
||||
installs receive) — a provisioned machine that skipped the hand-copy above would
|
||||
still carry stale personas with the test green.
|
||||
@@ -0,0 +1,76 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Issue #1 audit probe: speak ACP to hermes exactly like Museion's ACPEngineClient.
|
||||
|
||||
initialize (slim, pass flavor) -> session/new -> prompt(pass stub).
|
||||
Prints the sessionId + stopReason; the messages land in the profile's state.db
|
||||
where the layout audit reads them back.
|
||||
"""
|
||||
import json, subprocess, sys, threading, queue, time
|
||||
|
||||
PROFILE = sys.argv[1] if len(sys.argv) > 1 else "museion-pass1"
|
||||
STUB = open(sys.argv[2]).read() if len(sys.argv) > 2 else "hello"
|
||||
CWD = "/Users/alex/.hermes/cache/scratch/museion-issue1"
|
||||
|
||||
p = subprocess.Popen(
|
||||
["hermes", "acp", "-p", PROFILE],
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
text=True, bufsize=1,
|
||||
)
|
||||
inq = queue.Queue()
|
||||
|
||||
def reader():
|
||||
for line in p.stdout:
|
||||
inq.put(line.strip())
|
||||
|
||||
threading.Thread(target=reader, daemon=True).start()
|
||||
stderr_lines = []
|
||||
threading.Thread(target=lambda: [stderr_lines.append(l) for l in p.stderr], daemon=True).start()
|
||||
|
||||
_next_id = [0]
|
||||
def request(method, params, timeout=600):
|
||||
_next_id[0] += 1
|
||||
rid = _next_id[0]
|
||||
msg = {"jsonrpc": "2.0", "id": rid, "method": method, "params": params}
|
||||
p.stdin.write(json.dumps(msg) + "\n"); p.stdin.flush()
|
||||
deadline = time.time() + timeout
|
||||
while time.time() < deadline:
|
||||
try:
|
||||
line = inq.get(timeout=1)
|
||||
except queue.Empty:
|
||||
continue
|
||||
try:
|
||||
d = json.loads(line)
|
||||
except json.JSONDecodeError:
|
||||
print("UNPARSED:", line[:200]); continue
|
||||
if d.get("id") == rid:
|
||||
if "error" in d:
|
||||
raise RuntimeError(f"{method}: {d['error']}")
|
||||
return d.get("result")
|
||||
# notifications — log tool traffic compactly for the live view
|
||||
if method_ := d.get("method"):
|
||||
up = (d.get("params") or {}).get("update") or {}
|
||||
kind = up.get("sessionUpdate")
|
||||
if kind == "tool_call":
|
||||
print(f" [tool_call] {up.get('toolCall',{}).get('title','')[:80]}")
|
||||
elif kind == "agent_message_chunk":
|
||||
pass
|
||||
raise TimeoutError(method)
|
||||
|
||||
r = request("initialize", {
|
||||
"protocolVersion": 1, "clientCapabilities": {},
|
||||
"clientInfo": {"name": "Museion", "title": "Museion", "version": "0.1"},
|
||||
})
|
||||
print("agentInfo:", json.dumps(r.get("agentInfo")))
|
||||
|
||||
r = request("session/new", {"cwd": CWD, "mcpServers": []})
|
||||
sid = r["sessionId"]
|
||||
print("sessionId:", sid)
|
||||
|
||||
r = request("session/prompt", {
|
||||
"sessionId": sid,
|
||||
"prompt": [{"type": "text", "text": STUB}],
|
||||
})
|
||||
print("stopReason:", r.get("stopReason"))
|
||||
print("lastChunk:", json.dumps(r.get("lastChunk"))[:200])
|
||||
p.stdin.close(); p.terminate()
|
||||
sys.exit(0)
|
||||
@@ -15,7 +15,7 @@ Owned by the root AGENTS.md contract. Vocabulary is bound by CONTEXT.md (Mentor,
|
||||
- Seeding is additive-only: bundled skills land in the master if absent; existing master skills and profile skills are never overwritten. Copy-era real dirs in a profile migrate to master symlinks only on byte-match (a diverged dir stays a copy); untracked/user skills are never touched.
|
||||
- `seed-manifest.txt` lists the shipped set — update it when adding or removing a mentor skill. `ste-writing` and `writing-for-agents` stay in ref/ as authoring tools, never seeded.
|
||||
- Deslop owns the single subtractive rule set; serif-writing owns the method. Other skills reference both; none restates them.
|
||||
- The persona pair shares three sections verbatim by design (Knife floor, silent learnings, voice anchor) — edit them together or not at all.
|
||||
- The persona pair shares four sections verbatim by design (Knife floor, silent learnings, voice anchor, draft-first-rules-last) — edit them together or not at all. The load-order pin (`## Draft first, rules last`, #1) keeps style constraints at/near the working-context end (PRD prompt-end rule; verified layout: `docs/research/prompt-layout-factsheet.md`); `MuseionTests/PersonaLoadOrderTests.swift` guards presence and verbatim parity.
|
||||
|
||||
## Work Guidance
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ license: GNU GPLv3
|
||||
metadata:
|
||||
author: Alexander Kucera
|
||||
email: a.kucera@babylondreams.de
|
||||
version: "1.4"
|
||||
version: "1.5"
|
||||
---
|
||||
|
||||
# Pass Persona
|
||||
@@ -33,6 +33,10 @@ The Knife holds a constant 30 in every container—the anti-sycophancy floor. Wh
|
||||
|
||||
Consult Learnings before speaking; never announce the consultation. They shape which findings rise, how hard each lands, and which patterns get taught—the critique simply arrives already informed. No "as we've discussed", no reminding, no lecturing. When the writer repeats a known pattern, cut it sharper, not louder.
|
||||
|
||||
## Draft first, rules last
|
||||
|
||||
The writer's material enters context before the rule skills do: read the piece or draft first, then load deslop and the method skills. Constraint tables loaded ahead of the material decay behind it by the time the writing arrives. Whatever you compose next—verdict, card, demonstration—the rules behind you must be fresher than the draft.
|
||||
|
||||
## The voice anchor
|
||||
|
||||
Critique calibrates against the writer's best published prose: a small sample the writer explicitly picked, never auto-collected. When the draft drifts below the anchor, call it out in its form—"this isn't how you write openings; yours are better"—naming what the anchor does that the draft doesn't. The anchor is a critique baseline: never a copy-target, never a generation-style input.
|
||||
|
||||
@@ -5,7 +5,7 @@ license: GNU GPLv3
|
||||
metadata:
|
||||
author: Alexander Kucera
|
||||
email: a.kucera@babylondreams.de
|
||||
version: "1.1"
|
||||
version: "1.2"
|
||||
---
|
||||
|
||||
# Session Persona
|
||||
@@ -33,6 +33,10 @@ The Knife holds a constant 30 in every container—the anti-sycophancy floor. Wh
|
||||
|
||||
Consult Learnings before speaking; never announce the consultation. They shape which findings rise, how hard each lands, and which patterns get taught—the critique simply arrives already informed. No "as we've discussed", no reminding, no lecturing. When the writer repeats a known pattern, cut it sharper, not louder.
|
||||
|
||||
## Draft first, rules last
|
||||
|
||||
The writer's material enters context before the rule skills do: read the piece or draft first, then load deslop and the method skills. Constraint tables loaded ahead of the material decay behind it by the time the writing arrives. Whatever you compose next—verdict, card, demonstration—the rules behind you must be fresher than the draft.
|
||||
|
||||
## The voice anchor
|
||||
|
||||
Critique calibrates against the writer's best published prose: a small sample the writer explicitly picked, never auto-collected. When the draft drifts below the anchor, call it out in its form—"this isn't how you write openings; yours are better"—naming what the anchor does that the draft doesn't. The anchor is a critique baseline: never a copy-target, never a generation-style input.
|
||||
|
||||
Reference in new issue
Block a user