Skip to content

the cookie-free claim gets a gate: four served trees, one allow-list each - #3920

Merged
borisbat merged 1 commit into
masterfrom
bbatkin/web-third-party-gates
Sep 1, 2026
Merged

the cookie-free claim gets a gate: four served trees, one allow-list each#3920
borisbat merged 1 commit into
masterfrom
bbatkin/web-third-party-gates

Conversation

@borisbat

@borisbat borisbat commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

An audit of daslang.io and dasllama.io found that neither site sets a cookie, and that
nothing stopped the next embed from walking that back. This adds the gate. Sixteen live
pages were loaded in a fresh browser context each: no cookie jar entry, no Set-Cookie on
any response including third-party subresources, no service worker, no IndexedDB. What the
sites do store is six functional localStorage keys, none of which leaves the browser.

gate_web_third_party reads every markup, script and stylesheet file under a served tree
for document.cookie and for a host its allow-list does not name. Markup contributes its
resource tags and inline script bodies, script text its URL literals, a stylesheet its
@import and url(...) addresses. A link the visitor must click is not a load, so a and
meta are left out; a data-* attribute of a resource tag is one, which is how a beacon
endpoint is caught rather than only its src. Schemes, host names and tag names are read
case-insensitively, attribute values quoted or bare, and a multi-address srcset splits.

Four gates, because the served set is wider than the two site folders. site/ and
site-dasllama/ carry the pages. doc/ adds source/conf.py: Sphinx writes
html_css_files and html_js_files into every page head, so that list is a load no
template shows. web/ covers the two playground trees the deploy stages into site/ -
both are gitignored where they land, so no site-rooted gate would see them in a fresh
checkout - plus the canvas shell daspkg release --web wraps user programs in. The web/
allow-list is empty: those trees fetch nothing off-site.

Where to look: gate_web_third_party and the scanners under it in dastest/review_gate.das;
the allow-list in each of the four REVIEW.das files.

Validation, claims, ledger

Validation

  • Fast preflight only (format, lint, hash-refs, review-md, md-ascii, ast-verify; cpp-syntax
    skipped, no C++ changed). No full tier: the diff adds no engine, macro, JIT or AOT
    surface. CI re-proves the rest.
  • Every allow-list entry negative-controlled by removing it and confirming a real call site
    fires - examples.js:15, daspkg.js:6, github-star.js:50, index.html:12 for site/,
    source/conf.py:173 and :182 for doc/. No entry is dead weight.
  • Each scanner arm controlled with a planted defect at the reviewed commit: a tracker
    script tag and a document.cookie write in index.html; a script inside an RST
    .. raw:: html block; @import url("https://fonts.googleapis.com/...") in
    doc/source/_static/custom.css; a pixel URL and a cookie write in
    web/examples/ui/src/main.js.
  • Five parsing bypasses found by external review, each reproduced by a test that fails at
    the reviewed commit before its fix: unquoted attribute values, multi-address srcset,
    protocol-relative URLs in template literals, uppercase URL schemes, and an uppercase
    </SCRIPT> closing tag.
  • 16 gates green tree-wide (utils/internal/review-md/all.das), dastest 43/43.

Claims - stated, not tested

  • The live-browser sweep that motivated the gate is a one-time measurement, not a test: 16
    pages across both sites, fresh context each, cookies and storage read after networkidle
    plus a forced DocSearch query. Nothing in CI re-runs it. A break would show as a cookie
    appearing on a page whose sources the gate still passes - possible only through a host
    already on an allow-list, or through the doc tree's generated output, which is gitignored
    and therefore outside every gate.
  • web/examples/ui/samples is a gate root that reads nothing today: the tree holds .das
    and .json only, and its three .md files are rule documents the walker skips. It is
    listed so the first .html, .js or .css sample added there is gated on arrival, not
    because it closes a live hole.

Not done

  • site/doc (generated Sphinx output) and site/tests (the Playwright harness) are not
    walked. The first is gitignored, so it does not exist in a fresh checkout; its inputs are
    gated at doc/source instead.
  • The document.cookie check reads markup as text, so a blog post that quotes the API in a
    code sample would be a finding. None does today.
  • No gate covers a host once it is on an allow-list. The disclosure rule in each checklist
    is the only thing standing behind that decision.
  • A .das.assets.json sidecar is not scanned. The two that exist carry relative paths only.
  • The rule-document round raised defects in rules this PR did not write - site/REVIEW.md's
    duplicated receipt tail and undefined "editor content", site-dasllama/REVIEW.md's
    three-file page census and two rules carrying two triggers each - plus six automation
    candidates. All are reported to the author rather than rewritten here.

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings September 1, 2026 18:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a repository gate to protect the “cookie-free” property of the served web trees by mechanically scanning markup/script/style sources for document.cookie usage and for off-site resource loads not present in a per-tree host allow-list. This is implemented as a reusable gate in dastest/review_gate.das, then wired into four served-tree checklists (site/, site-dasllama/, doc/, web/).

Changes:

  • Introduces gate_web_third_party plus URL extractors (html_resource_urls, script_urls, css_urls, url_host) in dastest/review_gate.das.
  • Adds/extends tests in dastest/tests/test_review_gate.das for the new scanners and edge cases.
  • Adds new per-folder REVIEW.md/REVIEW.das gates and allow-lists for web/ and doc/, and extends site/ / adds site-dasllama/ gating.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
web/REVIEW.md New checklist rules tying served web trees to the cookie/host gate and allow-list disclosure.
web/REVIEW.das New gate runner wiring web/ deployed roots into gate_web_third_party.
web/LAWS.md New intent-provenance ledger for the new web/ rule documents.
site/REVIEW.md Extends site checklist with weakening/disclosure rules for the cookie/host gate.
site/REVIEW.das Adds ALLOWED_HOSTS + SKIP_DIRS and runs gate_web_third_party over site/.
site/LAWS.md Appends rulings provenance related to adopting the new gate rules.
site-dasllama/REVIEW.md Extends checklist with weakening/disclosure rules for the cookie/host gate.
site-dasllama/REVIEW.das New gate runner for site-dasllama/ using gate_web_third_party.
site-dasllama/LAWS.md New intent-provenance ledger for the new site-dasllama/ rule documents.
doc/REVIEW.md New checklist binding doc inputs to the cookie/host gate + allow-list disclosure.
doc/REVIEW.das New gate runner scanning doc/source plus conf.py absolute URLs against allow-list.
doc/LAWS.md New intent-provenance ledger for the new doc/ rule documents.
dastest/tests/test_review_gate.das Adds tests for URL host parsing and the new HTML/CSS/script scanners and gate behavior.
dastest/review_gate.das Implements the new web cookie/third-party host gate and supporting URL scanners/parsers.
dastest/README.md Updates documentation to include the new gate and helper functions.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread dastest/review_gate.das
Comment thread dastest/tests/test_review_gate.das
Comment thread doc/REVIEW.das
Comment thread site-dasllama/REVIEW.das
Comment thread web/REVIEW.das
Copilot AI review requested due to automatic review settings September 1, 2026 19:44
@borisbat
borisbat force-pushed the bbatkin/web-third-party-gates branch from dd8c8d4 to d26e0d3 Compare September 1, 2026 19:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Comment thread dastest/review_gate.das Outdated
Comment thread dastest/review_gate.das
Copilot AI review requested due to automatic review settings September 1, 2026 19:52
@borisbat
borisbat force-pushed the bbatkin/web-third-party-gates branch from d26e0d3 to afe8a0f Compare September 1, 2026 19:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Comment thread dastest/review_gate.das
Copilot AI review requested due to automatic review settings September 1, 2026 20:06
@borisbat
borisbat force-pushed the bbatkin/web-third-party-gates branch from afe8a0f to 95968a2 Compare September 1, 2026 20:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Comment thread dastest/review_gate.das Outdated
…each

The audit found daslang.io and dasllama.io set no cookies, and nothing stopped
the next embed from walking that back. gate_web_third_party reads every markup,
script and stylesheet file under a served tree for document.cookie and for a
host its allow-list does not name - markup contributes its resource tags and
inline script bodies, script text its URL literals, a stylesheet its @import and
url() addresses. A link the visitor must click is not a load, so <a> and <meta>
are left out; a data-* attribute of a resource tag is one, which is how a beacon
endpoint is caught rather than only its src.

Four gates, because the served set is wider than the two site folders: site/ and
site-dasllama/ carry the pages, doc/ adds source/conf.py (Sphinx writes
html_css_files and html_js_files into every page head, so that list is a load no
template shows), and web/ covers the two playground trees the deploy stages into
site/ - both gitignored where they land, so no site-rooted gate sees them in a
fresh checkout - plus the canvas shell daspkg release --web wraps user programs
in. The web/ list is empty: those trees fetch nothing off-site.

Each allow-list entry is negative-controlled at a real call site, so none is
dead weight. Review rounds found six parsing bypasses, each reproduced by a test
that fails before its fix: single-quoted URLs cut in half by the double-quote-only
comment strip, unquoted attribute values, multi-address srcset, protocol-relative
URLs in template literals, uppercase schemes and closing tags, and bracketed IPv6
hosts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UPY7onu9xGAToiEMWkLBtg
Copilot AI review requested due to automatic review settings September 1, 2026 20:12
@borisbat
borisbat force-pushed the bbatkin/web-third-party-gates branch from 95968a2 to 0524cc2 Compare September 1, 2026 20:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Comment thread doc/LAWS.md
Comment thread site-dasllama/LAWS.md
Comment thread site/LAWS.md
Comment thread web/LAWS.md
@borisbat
borisbat merged commit d76d86f into master Sep 1, 2026
37 checks passed
@borisbat
borisbat deleted the bbatkin/web-third-party-gates branch September 1, 2026 21:20
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