Repository navigation
feat(security): what the worker serves to code is faked (ruling 133) - #2219
wanderdev0 wants to merge 15 commits into
Conversation
What the worker serves to code must reach it with each registered value replaced by its same-length fake, before code sees it. These rows plant a registered value in each input and each code kind and assert the cell prints the fake (RDCT, the value's length), whose reversal holds no window of the value; the stored table rows 250,000 of 300,000 across delimited, Arrow file, Arrow stream and Parquet; typed and binary columns; a registry value holding U+0000; the whole-text deref; a page-started cell's stdout, value and inputTables; unreadable forms failing closed; a cell's realm reaching no browser JavaScript; and the spec's stated live-page limit. Fail-first at de7f424: 20 rows red, each printing today's [REDACTED:NAME]/[REDACTED]/[server] marker or the raw value; 3b (no forms, exact read) and 7 (unreadable forms) are guards that pass today and must keep passing. Co-Authored-By: Claude Code <noreply@anthropic.com>
Every value the worker serves to a Python cell, a survey or an approved exec reaches it with each registered value replaced by the session's same-length fake: the wire's answers (a catch-all, first answer and after an ask), workerReadonlyMl's members, derefWhole (faked before any pipe runs, through a mask the run's resolver applies), readStoredColumns (forms required), the main world's pre-reads, and the offscreen document's read of a stored table (delimited text and Arrow faked in place, Parquet holding a value handed over as an Arrow stream, or refused naming a column that cannot carry a fake). A page-started cell's inputTables are the tables as the cell read them. Spec: SECRET_HANDLES.md, "What the worker serves to code is faked (ruling 133)". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mes and metadata searched, the page-hosted limit stated Each Arrow column is decided by its type, from an enumerated list: text and bytes (FixedSizeBinary included) faked in place, nested ones through their containers, view types searched and refused when holding a value, numbers, decimals, dates and booleans not searched (a stated limit), and any other type refused. A column name or a metadata string (Arrow schema and field, Parquet key-value) holding a value refuses the read. The key-clash refusal says the answer is not read, and a table refusal's source is faked. The spec states the byte-length invariant, that a match never spans two cells, and that a page-hosted run's pointers are not faked (ruled a limit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Spec text and the four model-facing strings read at 5acd418 (
Accepted as written: the type lists, the refusals, metadata refusing, the join and its fallbacks, the adjacent-cells statement, the unsearched number columns as a stated limit,
|
…racle stated, the measured bundle pair, dev-doc pointers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Delta 5acd418...25a664d read ( Points 1, 2, 4, 5 and 6 of the earlier comment are applied and accepted. The oracle paragraph's correction is accepted: two forms of one value get different fakes, checked against Open: point 3. Add e4's rewritten 1h, the per-type rows and the oracle row to "Rows" by title when they are on the branch. That delta comes to me; the PR does not merge before it.
|
…page's candidate-list oracle as a stated limit Row 1h, rewritten to the ruling (packages, 2026-12-01; docs/spec/SECRET_HANDLES.md "a page-hosted run's pointers are not faked"): a PAGE-hosted run's pointer read in its main world returns the raw value, and the same read of the same pointer in a WORKER-hosted run returns the session fake. Today's behaviour on both sides, not a defect row. Row 11: a page's own ml.pythonExec hoists a table column of candidate strings and learns which candidates equal a registered form. Pins the stated limit: each matching candidate comes back as a session fake that carries no name, two forms of one value get different fakes, a re-read gets different fakes again, an unregistered candidate is unchanged, and a value under REGISTRY_MIN_VALUE (8) cannot be registered so the only `*` a page list meets is a GitHub token's own mask. Co-Authored-By: Claude Code <noreply@anthropic.com>
… about 1 ms, not 12 (ruling 133) Every read served to code is faked through `byteString`, which built its string from character codes at about 12 ms a megabyte. A cell's loop of unpiped dereferences of a stored megabyte fakes each read twice, so tests/ml-wire.test.mjs's budget row ran past its 30 s cap on CI (1.2 s on main). All-ASCII bytes now decode as they are, and any other bytes are widened to UTF-16 code units 0 to 255 and decoded natively: 0.8 ms a megabyte for ASCII, 1.8 ms with one non-ASCII character. A row pins both paths, 0x80 to 0x9f, a leading 0xfe 0xff and a mixed megabyte to one character per byte. The spec states the measured cost and that the page's candidate-list oracle stays a stated limit (Shane, 2026-12-01). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…library src/python/table-fake.ts decides a stored table's columns by Arrow type id; these rows pin that decision for every type id apache-arrow 21 can write, with the ids enumerated from the library's own classes rather than sampled. Text (Utf8, LargeUtf8) and bytes (Binary, LargeBinary, FixedSizeBinary) are faked where they lie and the value's bytes are gone from the buffer; a view type (Utf8View, BinaryView) holding a value refuses, naming the column and type and never the value, while a clean one is served as it is; containers (List, LargeList, FixedSizeList, Struct, Map, a Dictionary through its dictionary, nested shapes at any depth) are searched through their children; the unsearched types (Null, ints, floats, Bool, Decimal, dates, times, timestamps, durations, intervals) are served byte-identical as the stated limit, including a Decimal holding the value's own bytes, which only a table someone wrote with the value in it can carry. Two ids cannot be driven and say why: 22 (RunEndEncoded) does not exist in this library, and a Union (14) — a container by id — cannot enter a Schema here (its type carries type ids where fields belong), so no cell can receive one. Co-Authored-By: Claude Code <noreply@anthropic.com>
… empty answer says so CI failed rows reading the 300,000-row table at about 32 s: the cell ran past the 15 s attach deadline and detached, so the tool's answer carried no stdout and a setup assertion read `printed(py, …)` as null with nothing to show. Every python_exec reading such a table (1c, 2, 3, 3b, 4a, 4b) now passes expect_ms 120000, each raises `assertAttached` on an answer starting `Detached:` with the answer in its message, and row 4a attaches the cell's whole output to the test so a failure carries it. Co-Authored-By: Claude Code <noreply@anthropic.com>
…ell, with and without a value registered (ruling 133) Measured in Chromium: `ml.table` of a Parquet BYTE_ARRAY table takes 4.2 s with the value registered and 1.7 s without (about 8.5 µs a row), an Arrow Binary table 2.3 s and 1.6 s (about 2.3 µs a row). The whole python_exec step on the Parquet table is 8.6 s against 6.1 s, and a one-line cell is 4.3 s, so faking is about a third of the step. The spec states that such a cell can cross python_exec's 15 s default on a slower runner and detach, as e4's row 4a did on CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…asured timing (ruling 133) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er/window-ml into feat/code-reads-fakes
…w rows and the byteString row with them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a registry value, a config field's shorter form or a GitHub token (ruling 133) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What the worker serves to code now reaches it with each registered value replaced by the session's same-length fake (ruling 133, Shane 2026-11-29). Code here means a Python cell, a survey, or an approved
exec. A cell that reverses, splits or encodes a value now transforms the fake. Spec: SECRET_HANDLES.md, "What the worker serves to code is faked (ruling 133)".Where the mask sits:
ml-wire-serve.tsanswerOfthroughctx.fake,sw-ml-wire.tswireFake). This is the catch-all: the first answer and the one after anask, values, object keys and a pointer's label.workerReadonlyMl's members (fakedMember), and an isolated exec'sml.settings.derefWhole. Every read is faked before any pipe runs, through a mask the run's resolver applies (tokenSink's optional fourth argument). The model's dereference tool passes none.readStoredColumnstakes the forms as a required argument, and each of its three callers passes its run's.preReadsFor).table-fake.ts):inputTablesare the tables as the cell read them (sw-python.tshoistedAsRead).The key is the run's session. A wire client with no run uses
page:<handle>, and a page-hosted run's column read usespage:<tab id>. Forms that cannot be read fail every read.Model-facing text (new; no prompt or tool description changed):
Tests:
Detached:notice with no stdout. A copy of the row with a 16 s busy loop gave exactly that answer locally. Unmodified, the row's python_exec step takes 8.6 s locally, and the faking held: the same row printed the fake at its length, the other row and every row.expect_ms, an assertion that the answer is not a detach, the cell's output recorded) green on CI at this head. If it is red there, the output it records goes to the coordinator before any rerun.ml.pythonExeccan test a list of candidate strings against the registered values in one call (each registered one comes back as a fake, with no name). Stated under "The cost (stated)". It stays a stated limit (Shane, 2026-12-01), and e4's oracle row pins it.secretsgenre. They cover:ml.shmarkers;byteStringin tests/secret-mask.test.mjs: one character per byte on both paths, 0x80 to 0x9f, a leading 0xfe 0xff, and a megabyte each of ASCII, ASCII with one high byte, and mixed text.The cost, measured 2026-12-01 (figures and method in the spec's "The cost"):
byteString(src/secret-mask.ts) built its one-character-per-byte string from character codes at about 12 ms a megabyte, so tests/ml-wire.test.mjs's loop of unpiped dereferences of a stored megabyte ran past its 30 s cap on CI (1.2 s on main). It now decodes natively: ASCII as it is, any other bytes widened to UTF-16 code units 0 to 255.ml.tableof a 300,000-row table with a binary column takes 4.2 s with a value registered and 1.7 s without for Parquet (about 8.5 µs a row), and 2.3 s and 1.6 s for Arrow (about 2.3 µs a row). The whole python_exec step on the Parquet table is 8.6 s against 6.1 s, and a one-line cell is 4.3 s, so faking is about a third of the step. On a runner about 1.75 times slower, such a cell crosses the 15 s default and detaches; no runner's speed was measured against this one.The offscreen bundle grows from 270 KB (main at f750ae3) to 997 KB: apache-arrow and hyparquet are bundled in, and evaluated only when a stored table is read. The table below gives the offscreen document's start time, from
chrome.offscreen.createDocumentto its first answered message. Each figure is a median over 10 to 20 starts in one browser, and the runs alternate main and branch. The machine was shared with other sessions' runs, which is the spread.Read as about 20 to 30 ms more per start, within this noise.
Found, not repaired here. Shane decided both (2026-12-01), and the next PR in this lane builds them: the approval card marks a loopback or private-address target, and the self-approval words add "your machine and network" beside logins. A self-approving site is not made to ask; SITE_ACCESS.md states that as a limit in that PR.
fetchUrlFor(src/sw/sw-fetch-url.ts:70) refuses only non-http(s) schemes (:83), andfetchTarget(:50) only resolves the URL. So an uncredentialed fetch ofhttp://localhost/…, 127.0.0.1 or 192.168.x.x goes ahead once the URL is approved (:145), and on a self-approving site with no approval at all. The worker's fetch runs under the extension's host permissions, so it reaches hosts the page itself cannot. The approval card does not mark such a target.credentials: truefetch is made withcredentials: "include"(src/sw/sw-fetch.ts:137). Cross-origin, it needs only the person's per-URL grant (src/sw/sw-fetch-url.ts:125), and on a self-approving site none. The self-approval grant's words name logins and do not name the person's machine and network.🤖 Generated with Claude Code