Skip to content

Docs: pages open in Edit (ss-edit meta), and pages made before get it with their next save - #3

Merged
jamescalam merged 2 commits into
mainfrom
edit-meta
Nov 16, 2026
Merged

jamescalam merged 2 commits into
mainfrom
edit-meta

Conversation

@jamescalam

@jamescalam jamescalam commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Spacesheep opens a page carrying <meta name="ss-edit" content="open"> in Edit for a person who may edit it. The frame reads the meta when the page loads; nothing reads it at publish. Docs pages should open that way, so the starter now carries it, and pages Docs made before get it with their next save.

What changes

  • The starter (docs/references/page.html) has the meta in <head>, right after the ledger. Nothing else in it changed.

  • Pages made before (1.0.0 to 1.0.2): the next save adds the meta as part of the ledger change that every save already makes, on the line after the ledger. This covers write, edit, propose, apply, done's Checked save and outline on a page with typed lines. It's added once. It's added only when the ledger is inside <head> and the page has no meta named ss-edit already. One that exists, with any value, is left as it is. start only reads, so it never adds the meta. The new meta takes effect the next time the page is opened. Nothing about it goes to open tabs.

  • The old starter is frozen as docs/assets/blank-starter-1.0.html (byte-identical to the starter in v1.0.0 to v1.0.2). It still counts as blank, and as the base that typed lines are matched against. A blank page made before therefore gets the new starter at outline, and a typed one gets the meta in the outline's exact ledger replacement. Its typed lines are still never redrawn or saved over.

  • SKILL.md tells the agent that the person may be typing on the page while it writes: that text is theirs, docs.js writes around it, and the agent shouldn't wait for them to stop or undo what they wrote.

  • Finding an existing meta (hasEditMeta) reads the page as a browser would. attrsOf reads a start tag's attributes: names lower-cased, the first of a repeated name kept, either quote or none, / as a separator. attrText decodes numeric character references, with or without ;. A meta counts when its tag name is exactly meta, it isn't inside a <template>, and its first name decodes to ss-edit. The name is compared ASCII case-insensitively, as meta names are. A copy in a comment, a script or another attribute's value doesn't count.

One helper does it: ledgerSwap(html, ledger) gives the ledger replacement with the meta added when it's missing (editAdd). Every save that touched the ledger by hand now goes through it. The Checked save adds editAdd(html) inside its ledger-to-end span.

Tests

node tests/run.js: 70 passed, 0 failed. tests/edit.js is new (11 tests). With this branch's tests on main's skill folder, 8 of them fail. The other 3 are guards that main passes by never adding the meta: an existing meta is kept, a ledger outside <head> gets none, and either starter with an image is refused.

  • The starter has one meta, in <head>, right after the ledger. Without that line it's exactly the frozen 1.0 starter.
  • A new document keeps exactly one meta through outline, three writes and done.
  • A page as 1.0.2 left it: start saves nothing. The next write adds one meta after the ledger, with nothing about it pushed. A second write and done keep it at one.
  • Each kind of save adds the meta to such a page: edit, propose, apply (with the proposal's meta taken off first, so apply's own save must add it) and done alone.
  • Existing metas, kept byte for byte with no second meta added: content="closed", single quotes, unquoted with content first, an upper-case name, ss&#45;edit, ss&#x2D;edit, ss&#45edit (no ;), &#115;s-edit unquoted, <META NAME=…>, / as separators, spaces around =, and ss-edit as the first of two names. The first four of the encoded ones fail on b6f72ff.
  • Not the meta, so the real one is added and the other is kept as it was: ss-edit inside a description's content or in another meta's content, data-name, ss-edit-x, ss-edit as the second of two names, ss&amp;edit, ss&#8208;edit (a Unicode hyphen), ss-ed&#304;t, a <metax> tag, and a meta inside <template>. The description case fails on b6f72ff.
  • A copy in a comment or in a <script> string: the page still gets the real meta.
  • The old starter, blank: start sees it as blank, and outline gives the page the meta. With a typed line: start quotes it, outline --their-title keeps it byte for byte and first, saves it as exact replacements, and adds the meta.

Staging (bench account):

  • A page made and finished by v1.0.2 had no meta. The new start added no version (6 before, 6 after). The new write 1 added the meta on the line after the ledger, and the new done kept it at one.
  • A new page from this branch's start --new was served with the starter as deployed, meta included (identical apart from whitespace). It then ran outline, three writes and done to "ready", with one meta.

The app's frame (spacesheep PR 1869 at 857e74e1) reads meta[name="ss-edit"][content="open"], which is the exact form the skill writes.

Worth a close look

  • attrsOf and attrText: whether they read a start tag as a browser does. Tag boundaries still come from the existing parse.
  • Meta names are case-insensitive in HTML, so name="SS-EDIT" counts as the page's own and is left alone. The app's selector meta[name="ss-edit"][content="open"] matches case-sensitively, so such a page doesn't open in Edit.
  • Pages made before only open in Edit after a save. Opening an old page without asking for a change leaves it as it was.

skills lint: ok, folder hash 26bdac051742.

jamescalam and others added 2 commits November 16, 2026 14:12
…ntent="open">, and a page made before gets it with its next save

The app opens a page with that meta in Edit for a person who may edit it, read in the
frame when the page loads. The starter now carries it, right after the ledger. A page
the skill made before (1.0.0 to 1.0.2) gets it in the ledger change its next save makes
(write, edit, propose, apply, done's Checked save, outline on a typed page), once, and
only when the ledger is in <head> and the page has no meta of that name already, with
any value. start only reads, so it never adds it.

The 1.0 starter is frozen as assets/blank-starter-1.0.html and still counts as blank,
and as the base for typed lines. SKILL.md says the person may be typing while the agent
writes.

Co-authored-by: Pointman <noreply@pointman.ai>
Co-authored-by: Claude <noreply@anthropic.com>
…reads and decodes it

The check matched name="ss-edit" anywhere in the tag's text, so a meta whose name was
written with a character reference (ss&#45;edit, with any value) was missed and the next
save added a second, open meta over the page's own choice; and a name="ss-edit" inside
another attribute's value (a description's content) counted, so no meta was added.

attrsOf reads a start tag's attributes as the browser does (names lower-cased, the first
of a repeated name kept, either quote or none, "/" as a separator); attrText decodes
numeric references with or without ";". A meta counts when its tag name is exactly meta,
it isn't inside a <template>, and its first name attribute decodes to ss-edit, compared
ASCII case-insensitively as meta names are.

Co-authored-by: Pointman <noreply@pointman.ai>
Co-authored-by: Claude <noreply@anthropic.com>
@jamescalam
jamescalam merged commit a0d9b23 into main Nov 16, 2026
1 check passed
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.

1 participant