Repository navigation
Docs: pages open in Edit (ss-edit meta), and pages made before get it with their next save - #3
Merged
Merged
Conversation
…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-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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 andoutlineon 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 namedss-editalready. One that exists, with any value, is left as it is.startonly 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 atoutline, 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.jswrites 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.attrsOfreads a start tag's attributes: names lower-cased, the first of a repeated name kept, either quote or none,/as a separator.attrTextdecodes numeric character references, with or without;. A meta counts when its tag name is exactlymeta, it isn't inside a<template>, and its firstnamedecodes toss-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 addseditAdd(html)inside its ledger-to-end span.Tests
node tests/run.js: 70 passed, 0 failed.tests/edit.jsis new (11 tests). With this branch's tests onmain's skill folder, 8 of them fail. The other 3 are guards thatmainpasses by never adding the meta: an existing meta is kept, a ledger outside<head>gets none, and either starter with an image is refused.<head>, right after the ledger. Without that line it's exactly the frozen 1.0 starter.outline, threewrites anddone.startsaves nothing. The nextwriteadds one meta after the ledger, with nothing about it pushed. A secondwriteanddonekeep it at one.edit,propose,apply(with the proposal's meta taken off first, soapply's own save must add it) anddonealone.content="closed", single quotes, unquoted with content first, an upper-case name,ss-edit,ss-edit,ss-edit(no;),ss-editunquoted,<META NAME=…>,/as separators, spaces around=, andss-editas the first of two names. The first four of the encoded ones fail on b6f72ff.ss-editinside a description's content or in another meta's content,data-name,ss-edit-x,ss-editas the second of two names,ss&edit,ss‐edit(a Unicode hyphen),ss-edİt, a<metax>tag, and a meta inside<template>. The description case fails on b6f72ff.<script>string: the page still gets the real meta.startsees it as blank, andoutlinegives the page the meta. With a typed line:startquotes it,outline --their-titlekeeps it byte for byte and first, saves it as exact replacements, and adds the meta.Staging (bench account):
startadded no version (6 before, 6 after). The newwrite 1added the meta on the line after the ledger, and the newdonekept it at one.start --newwas served with the starter as deployed, meta included (identical apart from whitespace). It then ranoutline, threewrites anddoneto "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
attrsOfandattrText: whether they read a start tag as a browser does. Tag boundaries still come from the existingparse.name="SS-EDIT"counts as the page's own and is left alone. The app's selectormeta[name="ss-edit"][content="open"]matches case-sensitively, so such a page doesn't open in Edit.skills lint: ok, folder hash26bdac051742.