Skip to content

Import SOUL.md into AGENTS.md; ship broad interface goals, keep Leaf's exact specs - #4498

Merged
max-sixty merged 21 commits into
mainfrom
principles-survey
Oct 31, 2026
Merged

max-sixty merged 21 commits into
mainfrom
principles-survey

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

A survey of Leaf's principle layers (SOUL.md, root AGENTS.md, browser/AGENTS.md, developing-leaf, the shipped references) found that maintainer sessions rarely read SOUL.md, and that the interface rules mixed Leaf's own exact specs with goals every page author should meet. This change puts SOUL.md in every session's context, and splits the interface rules into Leaf's own specs and broad goals for other authors.

SOUL.md in every session

  • The root AGENTS.md now opens with @SOUL.md, which Claude Code expands inline, replacing the pointer paragraph. "Where instructions live" names the imported SOUL.md as maintainer direction, and the repository map gains README.md.
  • Responsiveness and "Pages across Leaf updates" become ## sections, since they stood under "Stage" only by position. The cross-runtime section drops a restatement of Responsiveness.
  • SOUL.md's foundation principle gains the common-path rule: a guarantee is owed to the paths users take often, and a rare path the user takes in at a glance may move or redraw rather than carry a mechanism of its own. browser/AGENTS.md's "The page holds still under the user's aim" applies it.

Leaf's interface vs. other authors' pages

  • browser/AGENTS.md's "Layout and motion" becomes "Leaf's interface", binding Leaf's runtime, chrome and bundled packages. Its sections are now the seven goals of interface-goals.md, each opening with the goal and its reason from SOUL.md, followed by Leaf's exact specs with one check and one owner each.
  • The section had mixed four levels, and each incident added its exception to the shared rule (1,873 words after Cut Leaf's maintainer guidance by 31% #3777's cut, 2,372 four days later, and 2,533 on main now). How one module meets a spec, and exceptions the user chose for one surface, are cut where the owning module or test header already states them (fitAnswer in floating-panel.js, reply-continuity.js, shift_watch.js's credits, comment-placement.js); the intro says they belong there. The four code-structure rules move to "Layouts, styles and controls" under "Runtime ownership". The section is about 2,400 words, about 350 of them the new goal paragraphs. Specs main added since are ported into it.
  • Every comment, docstring and skill citing the old subsection names (Stability, Space and scrolling, Visual grammar, Words stay where they were typed, Editing in place, Motion) follows; the kernel's source digests move with those comments.
  • New shipped reference skills/leaf/references/interface-goals.md gives other authors seven goals for how a page should feel, with no formatting specs. SKILL.md, module-authoring.md and packages/AGENTS.md route to it. Both files say which rules bind outside authors is still being settled.
  • page-authoring.md drops a CSS and card paragraph the theme and registry guidance already cover.

Instruction evals

The shipped edits were scored with evals/ on Claude Code, this branch against its merge base with main, one sample per arm. Each candidate run opened the changed file named beside its case:

Case Changed file the candidate read Base Candidate
brief-document-needs-no-outline page-authoring.md, with the card paragraph cut 2/2 2/2
changing-feedback-keeps-place interface-goals.md, reached through the new SKILL.md route pass pass
controls-repay-their-cost interface-goals.md 1/3 2/3
widget-checked-before-handoff module-authoring.md, with its new pointer 2/2 2/2

In controls-repay-their-cost both arms kept playback at real speed only, which the case fails; only the candidate showed the short method note inline rather than behind a disclosure. One sample per arm shows no regression and can't establish an improvement.

The test job's only failure, tests/journeys/test_thread_response_continuity.py::test_refused_reply_retains_its_live_foot, is inherited: main's scheduled run 41194441570 fails it too, and #4225 tracks main's scheduled failures. This branch changes only comments there.

This was written by Claude Code on behalf of max-sixty

The browser rules section was called "Layout and motion" but also holds
the rules for typed words, editing in place and visual grammar. Rename it
"Interface principles", say which SOUL.md principle each part applies so a
case no rule covers is weighed against the principle, and point
developing-leaf at it before any change to what Leaf draws: in the last
three days, 52 of 104 Claude Code session files that edited
browser/runtime or browser/styles never opened browser/AGENTS.md.

Drop page-authoring.md's first statement of the page-CSS and card-surface
guidance; "Read the registry" states both in full.
Maintainer sessions rarely followed the pointer: in the last three days,
none of 104 Claude Code session files that edited the browser opened
SOUL.md with the Read tool, and 19 printed it in a shell. Claude Code
expands an @path import in AGENTS.md, so SOUL.md's 398 words now load with
the root instructions; Codex still reads the line as a pointer.
# Conflicts:
#	dist/kernel/kernel.json
…UL.md

Responsiveness and Pages across Leaf updates were subsections of Stage,
whose subject is that Leaf has no users to stay compatible with; both are
lasting rules, so they are top-level sections now. The cross-runtime
invariant drops its restatement that log-dependent facts come from the
server's reading, which Responsiveness owns.

SOUL.md's foundation principle now says a guarantee is owed to the paths
users take often, generalizing the stability rule chosen on 25 October
(#4124) to every guarantee; browser/AGENTS.md's "Stability is owed to the
common path" cites it.
The rules for what moves, what takes room, how controls look and how motion
behaves hold for everything drawn on a page: the runtime, every package's
widgets and a page's own CSS. They lived in browser/AGENTS.md, which
package authors outside this repository never read and the shipped
module references only pointed past. They now live in
skills/leaf/references/interface-principles.md, each rule with its check;
SKILL.md routes widget, package CSS and page CSS work there, and
module-authoring.md, packages/AGENTS.md, developing-leaf and ui-sweep point
to it. browser/AGENTS.md keeps an "Interface owners" table naming the
runtime code behind each rule. Every citation of the moved sections now
names the new file. No rule changed; "A gesture shows the result" now
cites Responsiveness, which owns that budget.
Five of the moved interface rules bind only what the runtime draws over and
beside a page: nothing Leaf draws moves the page's content, the chrome
opens over the page, a runtime region declares data-lf-reflow, a floating
box grows inside the window, and one value paints a thread's unread and
attention. No package or page can keep or break them, so they cost a
shipped reader context for nothing. They return to browser/AGENTS.md as
"Leaf's chrome", with their owners inline, and the three comments citing
them follow. The shipped reference keeps the rules a widget, package CSS
or page CSS can break, News never moves what the reader is reading among
them, since widget-api.js lends packages its holds.
The intro above the import restated what the import loads and put
housekeeping at the top of the principles. The curation rule joins "Where
instructions live", which already guards the sections above Repository
map, and README.md gets its line in the map.
Leaf is moving toward fewer opinions about how agents build pages,
especially their exact visuals. The shipped interface-principles.md
carried Leaf's specs, such as solid contours, one-pixel seams, symbols,
--lf-line and 300 ms, to every outside author. This reverts that move and
the split that followed: the full rules, with their owners inline, are
browser/AGENTS.md's "Leaf's interface" again, binding the runtime, chrome
and bundled packages, and every citation names them there as on main.

skills/leaf/references/interface-goals.md now ships seven broad goals
for how a page should feel, routed from SKILL.md, module-authoring.md and
packages/AGENTS.md. Both files say which rules bind outside authors is
still being settled.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] The new authoring goals need the before/after instruction evaluation required by developing-leaf, “Score an instruction change”. This adds a conditional reading route and new goals governing authored controls and layout; it is more than moving an unchanged rule. The description explicitly says those shipped edits have not been scored, so whether ordinary authors discover and apply the broader guidance remains unverified. Compare base and candidate on representative authoring cases, inspect the outputs, and confirm the candidate runs actually opened the new reference before treating the split as validated.

Comment thread AGENTS.md Resolved
browser/AGENTS.md's "Leaf's interface" mixed four levels: goals, Leaf-wide
specs, how one module meets them, and exceptions the user chose for one
surface. Each incident added its exception to the shared rule, so the section
grew from 1,873 to 2,372 words in four days after #3777's cut.

The section now has the seven goals of interface-goals.md as its headings.
Each opens with the goal and its reason from SOUL.md, and Leaf's specs follow
with one check and one owner each. Module mechanism and per-surface exceptions
are cut where the owning module or test header already states them
(floating-panel.js's fitAnswer, reply-continuity.js's refused-send growth,
shift_watch.js's credits, comment-placement.js's opening scroll); the intro
says they belong there. The four code-structure rules move to "Layouts,
styles and controls" under "Runtime ownership". Every citation of the old
subsection names follows.
# Conflicts:
#	dist/kernel/kernel.json
Main changed specs under the old "Layout and motion" headings; each is ported
into the goal-led section: content-layout.js replaces marginContentLayout,
"Readable content comes before activation" replaces the pre-upgrade box rule,
the pressed control stays live, ACTIONS names a press's symbol, ACTION_FACES
moved to control-faces.js, and theme.css is base.css. Citations main added
under old headings point at the new ones, and the controls and
visual-treatment goals cite SOUL.md's new terminal principle. The kernel
takes main's and is rebuilt.
interface-goals.md's goals carried render-check names, the widget's
first-box rule and pointers to other references, which the references the
goals route from (module-authoring.md, packages.md "Seeing it") already
state. Each goal is now its name and one sentence.
# Conflicts:
#	dist/kernel/kernel.json
# Conflicts:
#	browser/runtime/box-motion.js
#	dist/kernel/kernel.json
The shift watch's header, a base.css comment, TODO.md and the shift-watch
cost note still called the rule and its sensor "Stability", the name of
the browser/AGENTS.md subsection this branch replaced with "The page holds
still under the user's aim".
@max-sixty

Copy link
Copy Markdown
Owner Author

@leaf-agent The before/after instruction evaluation you asked for is now in the description, under "Instruction evals": four cases on Claude Code, merge base against this branch, each candidate run opening the changed file, with no regression. The SOUL.md import thread is answered and resolved. Please re-review the current head.

This was written by Claude Code on behalf of max-sixty

# Conflicts:
#	browser/AGENTS.md
#	dist/kernel/kernel.json
#4851 cited "Stability is owed to the common path", which this branch folded into "The page holds still under the user's aim".
leaf-agent
leaf-agent previously approved these changes Oct 31, 2026
# Conflicts:
#	dist/kernel/kernel.json
leaf-agent
leaf-agent previously approved these changes Oct 31, 2026
# Conflicts:
#	browser/AGENTS.md
#	dist/kernel/kernel.json
@max-sixty
max-sixty merged commit 3d3a0bf into main Oct 31, 2026
3 of 4 checks passed
@max-sixty
max-sixty deleted the principles-survey branch October 31, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants