Repository navigation
Docs: write around lines a person typed on the blank starter - #2
Merged
Merged
Conversation
…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-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:…" 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 & 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>
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.
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.
startrefused 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
typedLinesindocs/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 arep,h1–h6,ul,ol,blockquoteandpre, with inline marks inside. Allowed attributes areclass,data-ss-id,hrefon links,title,dirandlang, 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 neverd-…(a clash's rollback removesd-title, so a second one would take the person's line off open tabs); a link ishttp(s):,mailto:,tel:or within the site, with&its only reference. Anything else still makes the page the person's, refused as before.startquotes 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.outlinebuilds 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 oneappend_intoond-docand 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.jsis new (7 tests). Five of them fail onmain; the other two check that pages are still refused, and that plain links and staging'sauto-p-…ids stay typed lines.<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.<body>above<main>: it stays there.start.--their-title: nod-title,<title>from their line,donepasses. On a page with no typed line it's refused.outlinewrites after both lines.onclick,style, ajavascript:link (with spaces and a tab in it, behind:,	orj, or unquoted),data:andftp:links, ad-id (unquoted, behind-ord, upper-case, on an inline mark, or as a seconddata-ss-id), adiv, a table, loose text, a block after<main>, a script in<head>, a changed style, title or<main>attribute.tests/review.js4.1 listedstarter + <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-titleon 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 hash15ac30c4a831.