de-meta the system prompts; method leads the composition (owner, 2026-09-27)

The owner's capture-vs-composition check confirmed the wire sends exactly
what composes (byte-identical save the nodeId paragraph ebfe058 had since
changed). This wave removes the implementation meta that leaked into the
prompts and reorders so the method carries weight:

- base: owner's new opener verbatim (install understanding; the
  understanding definition — which absorbs the old 'Understanding is
  structure' paragraph); Voice moved in from shared/10 (deleted); the
  philosophy keeps edge-dependence + logistics ('standard learning'
  dropped per owner); intro's two-agents/fragments sentence gone.
- teacher/05-method opens with the owner's methodology bridge ('No other
  teaching methods come close') — paragraph 3 of the opener, placed here
  so the shared base never points the prober at methodology it doesn't
  carry.
- deleted: teacher/60-probing-in-brief (self-evident from shared history;
  its mid-lesson mini-probe move salvaged into 20-teaching as one
  sentence), the 'Session shape — the durable artifact' section
  (extraction-pipeline meta), the fragments-meta lines in shared/20 and
  05-method, 'the transcript's seam' phrasing, prober's 'the teacher
  that takes over' / 'the handoff is automatic'.
- composition reorder (listSourceSegments): base -> the agent's own
  fragments -> shared/ appendix. Teacher method now starts at 12% in
  (was 62%); prober doctrine at 34%. shared/20 opens with the owner's
  decision rule (quiz only for known-correct-answer, ask for everything
  else).
- HANDOFF_TEXT: the owner's user-message version — first-person, paces
  the planning (unconditional truths, motivated derivations), ends at
  plan_init + accept-or-changes.

Teacher 31.4k -> 28.7k chars; prober 10.0k -> 9.6k. Gates: typecheck 0,
1018/1018, lint clean, build green. (Suite runs 16s; the earlier 10-min
timeout was stale node_modules after master's df1328e 0.87.1 sync —
npm install fixed it.)
This commit is contained in:
amosblomqvist
2026-09-27 04:14:42 +03:00
parent 921cacbb8f
commit 07b25c4ffd
14 changed files with 77 additions and 81 deletions
+15 -13
View File
@@ -13,10 +13,10 @@
* core port) stays in src/store/prompt-overrides.ts. Both sides share the
* pure path grammar (src/core/prompt-segments.ts).
*
* SEGMENTS: the SHARED base (src/agent/system-prompt.md), the shared/
* fragments directory (composed by BOTH agents between the base and their
* own fragments — sources v1 2026-09-19), plus every numeric-prefix *.md
* fragment in the agent's own directory, sorted by filename. The segment
* SEGMENTS: the SHARED base (src/agent/system-prompt.md), then every
* numeric-prefix *.md fragment in the agent's own directory (sorted by
* filename), then the shared/ fragments directory (composed by BOTH
* agents as a trailing appendix — the 2026-09-27 reorder). The segment
* list adapts to the code: an override keyed to a segment the source no
* longer ships stops composing automatically.
*
@@ -52,19 +52,14 @@ export function readPromptOverride(segmentPath: string): string | null {
}
/** List the SOURCE segments for one agent, in composition order — the
* shared base, then the shared/ fragments, then the agent's own sorted
* by filename (the exact order composeInstructions composes them in). */
* shared base, then the agent's own fragments sorted by filename, then
* the shared/ fragments (the 2026-09-27 reorder: the agent's job and
* method lead; the shared tool/file/format mechanics are an appendix).
* The exact order composeInstructions composes them in. */
export function listSourceSegments(agent: PromptAgent): Array<{ path: string; shared: boolean; file: string }> {
const segments: Array<{ path: string; shared: boolean; file: string }> = [
{ path: "system-prompt.md", shared: true, file: PATHS.teacherPrompt },
];
const sharedDir = path.join(PROMPTS_DIR, "shared");
if (fs.existsSync(sharedDir)) {
const sharedFragments = fs.readdirSync(sharedDir).filter((f) => FRAGMENT_RE.test(f)).sort();
for (const f of sharedFragments) {
segments.push({ path: `shared/${f}`, shared: true, file: path.join(sharedDir, f) });
}
}
const dir = path.join(PROMPTS_DIR, agent);
if (fs.existsSync(dir)) {
const fragments = fs.readdirSync(dir).filter((f) => FRAGMENT_RE.test(f)).sort();
@@ -72,6 +67,13 @@ export function listSourceSegments(agent: PromptAgent): Array<{ path: string; sh
segments.push({ path: `${agent}/${f}`, shared: false, file: path.join(dir, f) });
}
}
const sharedDir = path.join(PROMPTS_DIR, "shared");
if (fs.existsSync(sharedDir)) {
const sharedFragments = fs.readdirSync(sharedDir).filter((f) => FRAGMENT_RE.test(f)).sort();
for (const f of sharedFragments) {
segments.push({ path: `shared/${f}`, shared: true, file: path.join(sharedDir, f) });
}
}
return segments;
}