Skip to content

Build inspectable page content before composing explanations - #4629

Merged
max-sixty merged 3 commits into
mainfrom
codex/concrete-authoring
Oct 28, 2026
Merged

max-sixty merged 3 commits into
mainfrom
codex/concrete-authoring

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

Leaf pages could describe a proposed diagram, interface or experiment without producing material the reader could inspect or use. This changes authoring around constructing that material first: a fresh-context author produces the subject and captions, and the conversation owner integrates it with explanations and decisions. Decision evidence stays beside its answering control; drawings earn their place through useful arrangement, connections or scale.

The skill and owning references replace accumulated reminders with that workflow. The eval suite adds content and interaction cases, uses the actual saved task when grading, and archives/replays linked pages without losing sibling pages or colliding on their basenames. Author sessions drain notifications continuously and isolate scratch files and installed instructions.

Validation compared the final authoring instructions against original baseline 8b0d1b04ce8a95d4cb821ece5e05b0b7add52332 across 104 affected cases:

Cohort Original Candidate
75 source cases, recovered grades and corrected width criterion 53 pass 62 pass
29 page/workflow cases, raw automatic grades 18 pass 20 pass
Same 29, including two qualified archive recoveries 18 pass 22 pass

The source candidate scores 61/75 under the old literal-width rule. Independent review of the 29 workflow pairs found five gains, 22 retained required behaviors and two shared content failures. This is a descriptive comparison, not a statistical reliability claim. Some presentation costs remain; an inherited phone-tab obstruction was traced to an intervening runtime change. The two recovered workflow grades remain distinct from the original errors.

Opus and independent page/code reviews completed. Integration with main preserves its newer page styling, vocabulary and page-currentness contracts. The 104-case comparison precedes this integration. The new decision-record-after-its-work case and its no-work-pick variant both pass on the merge parent and merged candidate (four samples total), preserving retirement of completed decisions and the unfinished-work guard. Integration validation also covers all eight Python eval smoke tests, the Node eval test, and pnpm run check (browser build/tests, 696 runtime tests and 85 Worker tests). The four source-only integration outputs were also inspected directly; successful skill invocations and per-arm plugin paths are recorded, though injected skill bodies are not retained by the SDK. One candidate removes an untested label without execution; this remains a qualification of the output, not a failed decision-state assertion. No product CLI or event contract changes.

This was written by Codex on behalf of max-sixty

Give substantial new material to a fresh author with the reader question,
facts, content owner and a private output directory. Define the result as a
representative case, keeping illustration distinct from measured behavior.
Simplify the operating workflow and remove competing whole-question window
guidance while retaining picture-comparison sizing and canonical review.

Extend native continuation fixtures and calibrate content criteria against
actual outputs. Give source graders their task context. Isolate native authors
from shared scratch artifacts and host plugin payloads, retain subagent activity,
and give browser judges their owned socket directory and compatible launch.

Validation: paired source and native affected-case comparisons, independent
rendered review and Opus review; Python eval smoke4/4, Node smoke1/1,
pnpm check and changed-file pre-commit. Generated content remains stochastic:
retained report failures are recorded alongside successful concrete examples;
no aggregate reliability claim is made from adaptive experiments.
Replace the question paragraph with its purpose, context and evidence ordering.
Remove the playground's competing generic stacking prescription. The final
instructions repair the observed table/context and 900px comparison failures
without another prefatory reminder.

Make evals preserve the task and delivered pages: share live grader wiring,
retain same-name and linked pages, restore known links only in disposable judge
copies, and drain native output while the driver observes the page. Stop every
initialized page server. The cleanup errno66 cause itself remains unproven.

Correct the width-attribute, forced document-shape and open-overlay proxies.
The saved-output controls still reject unreadable prose and persistent
obstruction. Exercise real batch submission in the workspace case and state
the same prototype-capture facts in both panel-task arms.

Compared final instructions against original 8b0d1b0 across75 source and29
native cases. Source scores50→61 raw,53→62 after grader recovery and criterion
correction. Native raw18→20 passes, with two separately qualified final
same-output recoveries. Independent native inspection finds five task gains,
two shared task failures and retained presentation costs. No reliability or
instruction-only causal claim; original failures remain in the evidence.

Validation:8 Python eval smokes,1 Node grader smoke, changed-file pre-commit.
@max-sixty
max-sixty merged commit 5d4b922 into main Oct 28, 2026
4 checks passed
@max-sixty
max-sixty deleted the codex/concrete-authoring branch October 28, 2026 17:56
leaf-agent added a commit that referenced this pull request Nov 15, 2026
…amps from files.py (#6039)

This is the weekly duplicate sweep of `src/leaf/` and `hooks/` (ISO week
46). It moves four capabilities that were implemented more than once to
one home each, and moves every caller. Behavior does not change. Every
replaced copy computed the same result as the home it now calls.

- **Applying non-overlapping `(start, end, text)` edits to a source.**
The new home is `structure.splice`, which is
`revision_delivery._spliced` moved and generalised to str or bytes. It
replaces five copies:
  - `revision_delivery._spliced`, from #3313, removed.
- The reverse-slice loop in `revision_artifact.bind_imports`, from
#1280.
  - The loop in `structure.rewrite_attribute_references`, from #1658.
  - The loop in `leaf_dev.docs.compose`, from #2660.
  - The loop in `leaf_dev.arrangement_eval`, from #4629.

The four reverse-slice loops copied the whole source once per edit. Each
of them applies edits that don't overlap and don't start at the same
offset, so splicing them in one pass gives the same output.
- **The file name of a stamped version.** `live_shell` wrote
`f"v{version}.html"` inline, from #666. It now calls
`files.version_name`.
- **Whether a note stamps a revision.** `validation/source_history.py`
scanned for the note inline, from fe4e8ea. It now calls
`files.stamped_version`, which was added in the same commit.
- **The `sha256:` digest of a revision's HTML.**
`revision_artifact._capture_artifact` hashed `document.data` again, from
#666. It now reads `SourceDocument.digest`, from #606, which holds the
same value.

I left `compose_document`'s two-insertion loop in `revision_delivery.py`
alone. `splice` orders edits at the same offset by their text, but that
loop relies on list order when `<html>` and `<head>` are both implicit.

**Verification.** `ruff` and `ty` pass on the touched files. These model
tests pass: `test_module_url_delivery`, `test_revision_delivery`,
`test_live_shell_artifact`, `test_product_page`,
`test_interact_document`, `test_interact_anchors` and
`test_interact_layer`, 626 tests in all. In
`dev/tests/model/test_product_page.py`, the second case of
`test_a_composed_part_refuses_an_authored_copy` fails at `assert slot in
authored`, before `compose` runs. Its fixture string expects `<img`
followed by `alt="Sandbox` at 16 spaces of indentation, and
`docs/index.html` on `main` now indents that line by 18. The failure is
in the test's fixture, not in this change.

<details><summary>Sets found but not consolidated here</summary>

Another open pull request already changes each of these:

- **Claude Code and Codex config homes, and the inline-delivery opening,
repeated in `leaf_dev`.** #6014 moves them onto
`harness.claude_code_config`, `harness.codex_home` and
`hook_transport.INLINE_OPENING`.
- **`hooks._awaits_agent` repeats `holding.running_turns`.** #6032
rewrites `running_turns`.
- **The "N user updates with no answer" sentence**, written in both
`activity.unanswered` and the `page-open-owes` finding. `activity.py`,
`findings.py` and `session.py` are all being changed in #5979, #6018 and
#6032.
- **Raster magic bytes**, read in both `media._UPLOAD_TYPES` and
`revision_delivery.media_size`. `media.py` is being changed in #6014.

These are not worth a shared helper, because they are one-line stdlib
idioms or the copies differ in meaning:

- `json.dumps(..., sort_keys=True)` used as a cache key.
- Compact `json.dumps` with `separators=(",", ":")`.
- The `script_kind(...) in {"module", "classic"}` membership test.
- `lock_is_held(page_dir / SERVER_LOCK)`.
- Inline closed-object JSON schemas.

**Not consolidated, needs a separate look.**
`sample_content._non_json_number` repeats `http.reject_json_constant`.
The real question is where Leaf refuses non-finite numbers. The HTTP
path refuses NaN and numbers past a double's range. Sample fixtures
refuse only NaN and infinity. No other reader of event JSON in
`src/leaf/` passes `parse_constant`. Sharing the helper would change the
`sample-json` message without settling that question, so it is left out
of this PR.

</details>

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Nov 15, 2026
…5901)

This restores the "Show the subject" section at the top of
`skills/leaf/references/page-authoring.md`. The section tells an author
which form each kind of subject takes. Under it, a mechanism nothing can
show yet is drawn, including where things sit, what calls or feeds what,
and today beside the proposal. Numbers whose shape is the point become
an `lf-chart`. #4267 and #4629 replaced the section with "Develop the
work", which has one sentence on drawing. That sentence is removed here,
since the section covers it. `SKILL.md`'s step that starts a fresh
author now names both sections.

The restored text differs from 2715471's in four places:

- The screenshot bullet points to `authoring-evidence.md`, "Interactive
and visual evidence", for capture detail (crops and shadows), which that
reference now owns.
- The link to `authoring-decisions.md` is dropped, because that file no
longer exists.
- The motion bullet stops at naming `lf-motion`, and the chart bullet's
pointer to "Reading cost" is dropped.
- The behavior bullet adds that an order of events between actors is an
`lf-timeline`, as `authoring-evidence.md` says.

## Scores: head is no better than base

In #5900's runs on Fable 5.2, 20ad05c's text gave 0 of 3 pages a
chart of the measurements, and this variant 2 of 3. The new case,
`mechanism-proposal-shows-its-measurements`, gives the author about
3,200 words of notes on a photo-upload pipeline moving its variant
generation from the request to a queue and workers: the parts, one
upload's path through them, timings measured against today's path, and
three decisions. It asks for the proposal on a Leaf page. Two text
rubrics judge the page's HTML. Paired against main, 4 runs per arm:

| Model | Arm | Charts the timings | Draws one upload's path, or today
beside the proposal | `lf-chart`s per page |
| --- | --- | --- | --- | --- |
| Opus 5.5 | base 5cc9aef | 4 of 4 | 4 of 4 | 3, 2, 3, 2 |
| Opus 5.5 | this branch | 4 of 4 | 4 of 4 | 2, 2, 2, 3 |
| Fable 5.2 | base 5cc9aef | 4 of 4 | 4 of 4 | 2, 3, 3, 2 |
| Fable 5.2 | this branch | 4 of 4 | 4 of 4 | 2, 3, 2, 2 |

```sh
uv run leaf-dev eval run mechanism-proposal-shows-its-measurements --harness claude-code --base 5cc9aef --repeat 4 -j 2
uv run leaf-dev eval run mechanism-proposal-shows-its-measurements --harness claude-code --base 5cc9aef --model claude-fable-5-2 --repeat 4 -j 2
```

Base already charts, so this case doesn't reproduce #5900 and can't show
the restored section helping. Every author on both arms read
`authoring-evidence.md`, whose `lf-chart` line `SKILL.md` routes
measured facts to, and none started a fresh author for the page. The
judge's reasons match the pages: each has two or three `lf-chart`s of
the timings, most of them response time and ready time against upload
rate, and a sequence diagram, timeline or drawn figure of one upload,
today's beside the proposal's in most. One page on this branch (Opus)
failed its render check, where an `lf-chart` annotation overlapped a
tick label at 360–480px.

#5900's runs differ from these in the notes' length (about 9,500 words),
the user's global instructions, xhigh effort, and possibly a fresh
author started per `SKILL.md`, whose brief at base names only "Develop
the work". I didn't test those. A variant that handed a fresh author
only `page-authoring.md` was stopped early: four of the five authors
that started loaded the Leaf skill on their own, so it didn't isolate
the file.

The case stays as a guard on the default: an author run costs about $2
and 8 minutes on Opus 5.5, and $4 on Fable 5.2.

## Also in this branch

- `leaf-dev eval run --model` now sets the Claude Code author too. It
was refused unless `--harness codex`, though authoring cases already
passed it through; `claude_child`'s default bound the pin at import, and
the read-only probe ignored it.
- `SKILL.md`'s changed paragraph is rewrapped to the file's width.

`tests/model/test_interact_layer.py` (175) and `dev/tests/test_evals.py`
(13) pass, as do the pre-commit hooks on the changed files.

Closes #5900

---------

Co-authored-by: leaf-agent <[email protected]>
Co-authored-by: Maximilian Roos <[email protected]>
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