Repository navigation
Import SOUL.md into AGENTS.md; ship broad interface goals, keep Leaf's exact specs - #4498
Conversation
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
left a comment
There was a problem hiding this comment.
[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.
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".
|
@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
|
# 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".
# Conflicts: # dist/kernel/kernel.json
# Conflicts: # browser/AGENTS.md # dist/kernel/kernel.json
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 readSOUL.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
AGENTS.mdnow opens with@SOUL.md, which Claude Code expands inline, replacing the pointer paragraph. "Where instructions live" names the importedSOUL.mdas maintainer direction, and the repository map gainsREADME.md.##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 ofinterface-goals.md, each opening with the goal and its reason fromSOUL.md, followed by Leaf's exact specs with one check and one owner each.mainnow). 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 (fitAnswerinfloating-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.skills/leaf/references/interface-goals.mdgives other authors seven goals for how a page should feel, with no formatting specs.SKILL.md,module-authoring.mdandpackages/AGENTS.mdroute to it. Both files say which rules bind outside authors is still being settled.page-authoring.mddrops 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 withmain, one sample per arm. Each candidate run opened the changed file named beside its case:brief-document-needs-no-outlinepage-authoring.md, with the card paragraph cutchanging-feedback-keeps-placeinterface-goals.md, reached through the newSKILL.mdroutecontrols-repay-their-costinterface-goals.mdwidget-checked-before-handoffmodule-authoring.md, with its new pointerIn
controls-repay-their-costboth 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
testjob'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.