Skip to content

Docs: write around lines a person typed on the blank starter - #2

Merged
jamescalam merged 2 commits into
mainfrom
typed-lines
Nov 16, 2026
Merged

jamescalam merged 2 commits into
mainfrom
typed-lines

Conversation

@jamescalam

@jamescalam jamescalam commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

A blank Docs page now opens ready to type, so a person often types a title or a note on it first and then asks for the document. start refused that page as someone else's. With this change, the starter plus only typed text blocks is the skill's page to write on.

What changes

  • Which pages count (typedLines in docs/assets/docs.js): the starter, exactly as shipped apart from text blocks inside its <main data-ss-id="d-doc"> or in <body> above it. Older app builds saved the first typed line above <main>. Allowed blocks are p, h1–h6, ul, ol, blockquote and pre, with inline marks inside. Allowed attributes are class, data-ss-id, href on links, title, dir and lang, read quoted or unquoted. An id or a link counts only in a form that needs no character references worked out, so what's written is what the browser sees: an id is letters, digits, - and _, and never d-… (a clash's rollback removes d-title, so a second one would take the person's line off open tabs); a link is http(s):, mailto:, tel: or within the site, with &amp; its only reference. Anything else still makes the page the person's, refused as before.
  • start quotes the typed lines to the agent as the person's words, to read as the brief. It also says how to use their first line as the title.
  • outline builds on the page itself and puts the title and sections after the typed lines, which stay byte for byte. On such a page the outline goes to open tabs as one append_into on d-doc and is saved as three exact replacements (<title>, the ledger, <main>), so the typed lines are never redrawn or saved over. If that save clashes, the appended blocks are removed from open tabs and nothing is saved. Blank pages keep the old path (a whole-page push and save).
  • outline --their-title "<heading>" … leaves out the skill's own <h1> when the person's first line is the title. The tab's <title> takes that line's words. With no typed line it's refused.

Tests

node tests/run.js: 59 passed, 0 failed. tests/typed.js is new (7 tests). Five of them fail on main; the other two check that pages are still refused, and that plain links and staging's auto-p-… ids stay typed lines.

  • A typed <p> inside <main>, as the app saves it now: the whole run (start, outline, three writes, blocks, done). After every command the test checks that the line is in the saved page once, that no push or save carries it or rewrites it, and that no whole page is pushed or saved.
  • The same run with the line in <body> above <main>: it stays there.
  • A typed heading, a paragraph with bold, a list and another line: all kept, in order, and all quoted by start.
  • --their-title: no d-title, <title> from their line, done passes. On a page with no typed line it's refused.
  • A line typed while the outline's save is in flight: a clash, nothing saved, the outline removed from open tabs, and the next outline writes after both lines.
  • Still refused and left untouched, with nothing pushed: an image, a canvas, a script, onclick, style, a javascript: link (with spaces and a tab in it, behind &colon;, &Tab; or &#106;, or unquoted), data: and ftp: links, a d- id (unquoted, behind &#45; or &#x64;, upper-case, on an inline mark, or as a second data-ss-id), a div, a table, loose text, a block after <main>, a script in <head>, a changed style, title or <main> attribute.

tests/review.js 4.1 listed starter + <p>Mine.</p> as refused. That's the case this change accepts, so the entry now adds an image to the line.

On staging, two pages made from the starter, one with the line inside <main> and one above it, each ran start → outline (--their-title on the first) → write → done to a Checked save. On both, the typed line is unchanged in every version.

Worth a close look

  • typedOk: the attribute parsing, and whether the allowed sets are right.
  • outline's new save path: the <main> replacement, and how a clash takes the outline off open tabs.

skills lint: ok, folder hash 15ac30c4a831.

jamescalam and others added 2 commits November 16, 2026 13:43
…ey are, and the document is written after them

A blank Docs page now opens ready to type, so a person often types a title or a note first and then
asks for the document. start refused that page as someone else's. Now the starter plus only typed
text blocks (inside its <main>, or in <body> above it, where older builds saved the first line) is
the skill's page to write on:

- start quotes the typed lines to the agent as the person's words, to read as the brief.
- outline builds on the page itself and puts the title and sections after the typed lines. On such
  a page it goes to open tabs as one append into the document and is saved as exact changes, so the
  typed lines are never redrawn or saved over; a clash removes the appended outline from open tabs.
- outline --their-title leaves out the skill's own title when the person's first line is the title;
  the tab's <title> takes that line's words.

Typed lines are text blocks only (p, h1-h6, ul, ol, blockquote, pre, with inline marks inside).
A picture, frame, script, form, handler, script link, an id starting with d-, or any other change
to the starter still makes the page the person's, refused as before.

Co-authored-by: Pointman <noreply@pointman.ai>
Co-authored-by: Claude <noreply@anthropic.com>
An id on a typed line counted only when quoted, and a link's address was decoded only for numeric and a few named
character references. So data-ss-id=d-title, or d&#45;title, passed as a typed line, and the outline then wrote a
second d-title; a clash's rollback removes d-title, which takes the person's line off open tabs. And
href="javascript&colon;…" passed as a link.

Attributes are now read quoted or not, and accepted only in forms that need no character references worked out:
an id is letters, digits, - and _, and never d-…; a link is http(s), mailto, tel or within the site, with &amp; its
only reference. Anything else makes the page the person's, as before: a wrong refusal costs one question.

Tests: 12 more pages the starter must refuse (9 of them were accepted before), and plain links with staging's
auto-p ids stay typed lines. 59/59.

Co-authored-by: Pointman <noreply@pointman.ai>
Co-authored-by: Claude <noreply@anthropic.com>
@jamescalam
jamescalam merged commit 12719c9 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