Repository navigation
Agent operating guidance in host notes and README; redact token-bearing URLs from js results - #28
Merged
Merged
Conversation
…aring URLs redacted Issue #23: the host notes are rebuilt from general, native and Chrome sets. New general rules: end_task when done, one serial controller, observe-act-verify with a stop on an unchanged state, readiness waits instead of fixed delays. New Chrome rules: only ids from profiles_list and never pick or bind a profile, locators take their own timeoutMs, evaluate is read-only. Instructions stay under the 2,048-character cap (2,017 with both surfaces). README gains Operating guidance for agents. Issue #24: js/js_reset results have token-, key- and secret-named URL parameter values, the Playwright MCP extension connect URL's parameters and the loopback relay path replaced by <redacted>, in text and structured content. Requests, images, _meta and error replies are untouched. README documents what is redacted and that cua filters nothing else.
Locator actions, waits and playwright.evaluate stop at 3 s whatever timeoutMs or the js timeout_ms say; the browser note now tells the agent to loop short waits under a longer js timeout_ms. Other notes trimmed to stay under the cap (2,035 characters with both surfaces).
…s and in bracketed values Review of PR #28: a non-secret parameter's value is now scanned on rather than consumed, so a token in a redirect URL (raw or encoded) is found; percent-encoded names are decoded before the test; a value runs to its URL's delimiter less trailing closing punctuation instead of stopping at brackets; a separator after a space starts no parameter, so source text such as 'int &key=v;' is left alone.
…n unopened bracket Second review round on PR #28: a parameter at the start of a string counts again; names inside an encoded redirect are decoded twice; a value ends at a closing bracket it did not open, so adjacent Markdown links and citations survive. Remaining pattern-list gaps logged in tech-debt-tracker.md.
Re-review of 4d8307d: after a bracket-terminated value the delimiter search ran over the whole remaining text before the bracket cut it short, so adjacent token-bearing links cost quadratic time on the result path (5.2 s at 736 KB). The delimiter and the unopened closing bracket are now found in one pass: 736 KB of adjacent links redacts in about 20 ms, with a test bounding it under 200 ms.
Owner
Author
|
Fixed the quadratic redaction scan from the re-review of 4d8307d in e0015d6. Before, after a value that ended at a closing bracket, the scanner searched the rest of the text for a delimiter before cutting the value at the bracket, so every token-bearing link searched to the end of the text. Now one forward scan finds whichever comes first: a delimiter (including Measured with
A new test checks that the 736 KB case redacts correctly in under 200 ms. |
This was referenced Nov 23, 2026
SSFSKIM
added a commit
that referenced
this pull request
Nov 23, 2026
…N_ENGINE_VERSION 0.4.4, plugin 0.29.9 (#516) * #487: an Electron drop's settle rests as its press source's family does On the dedicated foreground route the drag's pacing is the named window's, but the Electron settle waits for the source's drag loop. A zero-rest named window (GTK 4) beside an Electron source gave both pings no rest between them, so a stale accept could pass as settled. The floor allowance and sync_and_rest now take the source family's rest (settle_rest; the flags' when they fix the pacing); the motion keeps the named window's pacing. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #488: a take the handle hold's first read saw settles the end A first before_release read that already reported a take skipped the hold's wait and left held_take false, so with the cursor watcher behind, the settle was skipped and a landed drop answered unconfirmed. The end's settle decision (settles) now counts the hold's take at its first read or in its wait, beside the watcher's own. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * Ruling 1034: the handle tail reads the pointer before its first visit too The tail's first visit went to the place read before the legacy revisit, the release dwell and the take read, so a person's motion in that window was undone. end_steps now puts the pointer check before every visit, the first included; a change stops the tail before anything is sent and is answered as an interrupted tail (interrupted_unconfirmed). Ends with no tail (no take, excluded) keep f9d1f86's exact calls. The tracker entry moves to Resolved. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * linux-engine 0.4.4: the version, the README's change lines, and 0.4.3's residual bound filled Cargo.toml and its lockfile name 0.4.4. The README says what 0.4.4 changes (#487's settle rest, #488's first-read take, 1034's first-visit read), and the placeholders 0.4.3 shipped with get task 132's numbers before any tag (ruling 1038's checklist; N=200, X=1.5%, as the spec's notes give them). native/ holds no <N>, <X>, <…> or @…@ now. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * Task 140 fix wave: #487's regression drives drag_along; a settle records its rest_ms The review found #487's test checked settle_rest's lookup only, so either call site could go back to the named window's pacing.rest unseen. drag_along now asks its Electron watch through DropCursorWatch (DropCursor is the engine's), and a live unit test runs drag_along on the X display with a recording fake: a GTK 4 paced drag whose source is Electron's family reserves 30 ms of the floor (hold.floor_until_ms, new) and pings, rests 30 ms, revisits the path's end and pings again. Each call site reverted alone fails it. Ruling 1102 (b): every settle records the rest it took, drop_cursor.settle.rest_ms, for drags and handle ends alike. Both begin through Settle::begin, which keeps the rest it passed to sync_and_rest. The review's minors: the recorder's unwatched row is a Chrome take now, and EndStep::Check's doc says it runs before every visit. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * linux-engine README: 0.4.3's residual bound carried by 0.4.4, and the settle's rest_ms Ruling 1102: the long Chrome drag bound was measured on 0.4.3, and 0.4.4 carries it because that path is unchanged. The settle's --stats now names drop_cursor.settle.rest_ms, and the #487 line names hold.floor_until_ms. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 task 142: t17-fix3's judge holds every settle to Electron's 30 ms rest on engines from 0.4.4 (#487) The judge reads the run's engine version from its meta row's cua_version ("cua-engine X.Y.Z (sha)"). On 0.4.4 or later, a settled row (drop_cursor.settle, a drag's or a handle's) whose rest_ms is not 30, or is missing or not an integer, fails, named. An earlier engine's rows predate the field and are not checked; a finding says so. A version that cannot be read fails the check rather than skipping it. The check is t17-fix3's alone (item 1: H1, H2, L4a). Rejudged with the base judge (da7585c) beside: 179 stored drop-signals runs under m4/ and m5/, 40 of them t17-fix3, including H8's H1 on both arches; no verdict moved (m5/harness-487/). Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 task 142: a development plan for #487's own case, t487-named (Electron beside a named GTK 4 window) Each drag of the new lane cua:named-gtk4 names the run's GTK 4 window (pages/gtk4-button.py) in dedicated mode. GTK 4 has no drag rest and its drags take the foreground route, so XTEST's press over the Electron page beside it is Electron's: the case #487 was found with. The path is the plain cell's, given in the GTK 4 window's coordinates. The window sits right of the scene, and the sitting refuses to start if its frame covers any point of the path. Rows now carry the drag's pacing (`--stats` drag_pacing) and the named window. namedSourceTable counts each drop by T17's definitions (landed, false ok, stale drop, honest unconfirmed, with ambiguous and error). It counts the drops that proved the case apart from those that did not. A drop proves it with GTK 4's pacing at rest 0, the foreground route, an Electron press (its drop-cursor watch), its source started on the page, and a settle that ran. It also tallies the settles' rest_ms. No gate judge holds the plan. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 task 142: t487-named's x64 pilot on 0.4.3 and the 0.4.4 candidate, with five diagnostics The pilot ran 5 drops on each engine. Every drop took the foreground route with GTK 4's pacing at rest 0, and every press reached Electron, but Electron never started its drag. There was no take and no settle, so #487's case was not exercised. T17's counts are 5 false oks on each engine, all of them untaken plain drags. The diagnostics ran on 0.4.3 with temporary lanes that are not committed. Electron's own pacing (set by flags) and activating the named window first changed nothing: 0 of 20 foreground drops took. An XTEST drag on the desktop route over the same page, with the GTK 4 window activated by the harness, took 5 of 5. On every foreground drop, and on none of the desktop drops, Electron asked for activation at the press. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * Task 140 fix wave 2: a handle's settle keeps its record when the release read no cursor The re-review: a settle begun on the hold's first take, whose last hold read then failed, judged nothing and was counted as entered, but only an existing cursor record took its settle, so the drop had no record and no rest_ms. record_settle now makes { "read": false } when there is none, as a drag's end does; the judgement and the reply are unchanged. floor_until_ms is the cutoff given to the keepalives, not when they stopped; the code and the README say so. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 task 142 fix wave 1: a settle is expected from the engine's take, the version is read whole, the named proof needs Electron and a settle record The task review of 86d6b94 (three Important, two Minor): - The settle-rest check no longer takes the settle record as its own evidence. An Electron scene's drop that the engine's hold saw taken (a drag's hold.taken; a handle's handle.hold.taken with its button down), whose cursor watch did not fail, is held to the check. If its settle record is missing it fails, and so does a settle that is not a record. Untaken drops and failed watches stay exempt. - engineVersionOf validates the whole recorded line, `cua-engine X.Y.Z (<7-40 hex>|unknown)`. A truncated `cua-engine 0.4.3 (` is unreadable and fails, never exempt. - The named lane's proof now requires the Electron scene, a live drop-cursor watch and a settle record on the drag's own watch. A Chrome-labelled row with `settle: false` is no longer exercised. - Rows carry `drag_pacing: null` when the engine gives no stat. - The README records the candidate's full SHA-256. Rejudge rerun: 186 stored runs (144 judged, 40 of them t17-fix3), no fail list moved from base, and both H8 H1 runs still pass with the check not applying (0.4.3). Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * Linux engine (#171, task 145): pin linux-engine-v0.4.4 Written by scripts/linux-engine-pin.mjs from the release commit 23f3421 (this branch's base): both assets verified against the release run 45138098451's attestations (run 45135771944's, publish=false, verify too) and SHA256SUMS. Nothing under native/ changes (rulings 1099, 1115). Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * Linux service (#171, task 145): MIN_ENGINE_VERSION 0.4.4 0.4.3 rested an Electron drop's settle by the named window's family, so a drag named to a GTK 4 window whose path starts in Electron pinged twice with no rest between, and its accept could answer for a place the pointer had left (#487). The service cannot tell that ok from a real drop, so a 0.4.3 engine is refused before anything is sent: a fourth case of the shared refusal helper, beside 0.4.0-0.4.2. Every pin of the old minimum follows: the client, bootstrap and doctor tests, the selection test's releases below the minimum (0.4.3 is the released plugin's pin), the fake engine's default, the document test and the README's lines. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 task 142 fix wave 2: the settle check holds each drop to the engine's own settle count, the family label and both copies The re-review of 1be3760: - Each drop-signals row now carries `settle_count`, the engine's `drop_settles.entered` after the drop's requests less before them. On 0.4.4 and later, t17-fix3's check holds each drop to that count instead of a predicate rebuilt from the hold and the watch: - one settle entered needs a settle object resting 30 ms; - none entered needs no settle field; - more than one entered fails; - a drop without the count fails. So a handle whose take only its cursor watch saw, or a drag whose release read carried an error, now fails when its settle record is deleted. A watch that failed to start (`{accepted: null, error}`, no read) is told apart from a release read's own error. - In the counted Electron plan, a missing or non-electron family label fails the row; it no longer opts the row out. - When both copies of a settle exist (drop_cursor.settle and handle.drop_cursor.settle), they must agree. - The named lane's proof uses the same count, copies and watch-start rule. A live check on the 0.4.4 candidate (t17-fix3, one drag per cell): all 14 rows carry entered 1 with a settle record, and each handle's copies agree. The only settle fail is the missing rest_ms of that pre-fix-wave build. The rejudge of the stored m4/m5 runs is unchanged: no verdict moved. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 task 147: arm64's counted reach at H9 (0.4.4): item 1 passes, L4d fails on one false ok; items 3 and 4 not run H1, H2 and L4a (t17-fix3) pass on the pinned linux-engine-v0.4.4 (f54b2aeb...da3e) at H9 cd03a47, with 560 of 560 settled drags resting 30 ms in each. L4d fails at ruling 993's bar: t14-floor left #28 answered ok with no drop (Chrome released on a stale in-zone accept and its activation confirmed it; the in-floor path overran its keepalive under twice the load). The run stopped there, so items 3 and 4 did not run. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 task 148: x64's reach at H9 (cd03a47) on the pinned linux-engine 0.4.4 Every step passed once, on private displays, under the lock as h9-x64: - H1, H2, L4a (t17-fix3): pass. 560 of 560 settled Electron rows rested 30 ms in each. - L4d: every part passes. 0 false oks and 0 stale drops on every Chrome cell, and the Electron part exercised 30 of 30. - Chrome drag_handle long-left x100 at twice the load (development): 0 false oks and 0 stale. The tail's motions were 4 on all 100, interrupted_unconfirmed on 0, and it added 16.8 / 22.4 / 25.6 ms (p50 / p95 / max). The scans found 0 tokens, 0 key codes and no window titles. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 task 147: ruling 1140's development runs on arm64 at H9: items 3 and 4 meet their bars; t14-floor left x100 gives 2 false oks Development, not counted, on the pinned linux-engine-v0.4.4, arm64 at twice the load, private displays: - item 3, Chrome drag_handle long-left x100: 0 false oks, 0 stale; the tail ran on 100 of 100 with 4 motions, 0 interrupted_unconfirmed, +22.1 / 27.0 / 31.1 ms; - item 4, t487-named x30: exercised 0, not exercised 30 (no drag began), as ruling 1113 expects; - t14-floor left x100 through task 132's harness with each row's release_sync: 2 false oks (r2 #3, r2 #13), both in floor with Chrome's leave never shown before the release; one had a dropped visit, the other ran both. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 0.4.4: plugin 0.29.5, the Decision Log entry for 0.4.4 and its reach, and two tracker lines Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 task 142 fix wave 3: the named path from the real client origin, counts from the drop's own replies, versions held to the candidate, whole counts, own-operation evidence, settles observed The 0.4.4 PR's whole-branch review of 4e0ba0a (two P1, four P2): - P1 1: the named lane gives its path, and checks its frame, from the client's real root origin (xwininfo's absolute upper-left, `rootClientRect`). Under Openbox, `xdotool getwindowgeometry` counts the decoration's offset twice: (962, 284) against (961, 262). Each named drop also records its aim: the press's root point, the real pointer parked there and the window chain under it, and the plain source's root rectangle. The judge requires the press inside the source (`aim`). - P1 2: the settle count comes from the stats lines matched to the drop's own requests (`counterOf`): the drag's reply or the handle end's, and the engine's previous reply or a fresh engine's zero. It never comes from the engine's last counter. A missing line leaves the count null. A count of none must carry that provenance (`zeroCountOwn`). - P2 3: a run's cua_version stands only where the candidate it recorded agrees, in version and in its attested asset's name. A counted run must have recorded one. - P2 4: a count is read only when whole: non-negative integer endpoints, and entered equal to after less before. - P2 5: the settle record is the drop's own operation's: the drag's drop_cursor on a drag lane, the handle end's on a handle lane. A copy elsewhere may corroborate but never substitutes. - P2 6: each lane and cell of a 0.4.4 t17-fix3 run must show at least one observed settle. Each of the six reproduces on 4e0ba0a (0 fails) and fails now. Offline, 216 stored drop-signals runs (153 judged, H8 and H9 included) give the same fail lists as 4e0ba0a's judge. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 task 142 fix wave 3: the named pilot exercises #487's case 5 of 5 on 0.4.3 and on the pinned 0.4.4 With the real client origin, every named drop pressed at (530, 128) inside the plain source (505, 110, 50x36), with the pointer parked there over the Electron window. Every drop was paced as GTK 4 at rest 0 on the foreground route; the source started, the hold took, and the engine counted one settle from the drop's own replies. All 5 drops were exercised and landed on each engine, with 0 false ok. rest_ms is absent on 0.4.3 and 30 on 0.4.4. The earlier pilots' untaken drops were the harness's: xdotool's double-counted origin pressed at (529, 106), above the source. Also stored here: the constructed rows (each of the six findings passes at 4e0ba0a and fails now), the offline rejudge of 216 stored runs with H9's (no fail list moved), and the offset's reach (t17-fix3's off-window ends: every end verified under its window, none could have moved). Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 task 147: #487's case on arm64, t487-named x100 at twice the load (ruling 1143 (c)): 0.4.4 lands 100 of 100 exercised Development, gating by ruling 1143 (c), from 5f59e5b (harness fix wave 3's real client origin) on private displays: - 0.4.4 (home-arm64-044, f54b2aeb...da3e): 100 of 100 exercised, 100 landed, 0 false ok, 0 stale; rest_ms 30 on 100; - 0.4.3, the control (home-arm64-043, dd74e19b...cf1e): 100 of 100 exercised, 100 landed, 0 false ok, 0 stale. No drop unexercised on either; no proof missing. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 0.4.4: the Decision Log's #487 entry with the gate's counts, the settle check's final rules, and a tracker line for xdotool's origin Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 task 142 fix wave 4: zero counts need ordered request ids, counted runs a verified attestation, the aim its content; no input after a refused aim The whole-branch re-review of 1317cc3 (four P2), each fixed test-first from the reviewer's constructed case: - P2 1: a count of none must be the drop's own. Each count now records the drop's first and last request ids. The after must be read from the last of them, and the before from a positive id before the first; a fresh engine's zero is before 0 with no request of its own. {before 19, after 19, entered 0, before_from 12, after_from 12} fails. - P2 2: a counted run's candidate needs a verified attestation with at least one subject of its digest; a development run needs none. x64 H8's stored H1 meta stands as recorded and fails with its attestation removed. - P2 3: the named aim proves by its content: the root point inside the recorded source rectangle, the parked point equal to it, and the scene row's Electron window in the chain under it. {inside: true, park: {ok: true}} alone is unproven. - P2 4: before any warp, `namedAim` reads what is on top at the press point (`desktop.topAt`). If the scene's Electron window does not hold it, or the park is refused after the warp, no input is sent. The trial is recorded as skipped with its reason, counted unexercised, and never counted as an outcome. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 task 142 fix wave 4: its evidence (constructed cases, rejudge with 0 moved, named runs regraded, a live check) - Each of the re-review's cases passed at 1317cc3 and fails now. - The offline rejudge of 218 stored runs (H8 and H9 included) moved 0 against 1317cc3's judge. - With the aim read by its content, wave 3's named pilots are still 5 of 5 exercised. - A live check on the pinned 0.4.4, with the pre-warp read, exercised and landed 5 of 5, every count carrying its own request ids. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 0.4.4: the counted #487 named runs regraded offline by task 142's fix wave 4: 100 of 100 exercised and landed on each engine Wave 4's judge regraded t487-named x100 on 0.4.4 and x100 on 0.4.3 (arm64, twice the load, harness 5f59e5b), with the rows as stored. The aim was read by its content. On each engine: 100 of 100 exercised and landed, 0 false ok, 0 stale, 0 honest unconfirmed, 0 refused, and 0 drops whose aim is unproven. Every press was at (530, 128) inside the source (505, 110, 50x36). rest_ms is 30 on all 100 drops on 0.4.4, and absent on all 100 on 0.4.3, which predates it. Nothing moved, and no evidence was changed. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 0.4.4: plugin 0.29.6 (main took 0.29.5) Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 0.4.4: plugin 0.29.7 (#513 took 0.29.6) Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 0.4.4: plugin 0.29.8 (#515 took 0.29.7) Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68) * #171 0.4.4: plugin 0.29.9 (#507 took 0.29.8) Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
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.
Two follow-ups from the first real-use run (
docs/evidence/2026-10-05-homework-1b-dogfooding.md).Host notes and operating guidance (#23)
src/mcp/surface.mjs: the host notes are built from three sets: general (every surface), native, and Chrome. A browser-only connection gets the general rules without the native ones.end_taskas soon as the task is done; one controller and onejscall at a time; observe, act, verify, and stop when the state is unchanged; wait for a visible readiness condition, not a fixed delay.profiles_listreturned, and never pick or bind a profile for the user; browser locator actions, waits andplaywright.evaluatestop at 3 s whatevertimeoutMsor thejstimeout_mssay, so to wait longer the agent loops short waits in the cell under a longerjstimeout_ms(spike Spike: which timeout governs locator and CDP actions in the vendor browser API (3 s deadline seen regardless of js timeout) #25's finding);evaluateis read-only (nofetch, norequire, non-extensible objects).Token-bearing URL redaction (#24)
redactTokensruns onjs/js_resetresults besidecorrectImages. It covers text content and structured content at any depth:<redacted>when the query or fragment parameter's name ends in the wordtoken,key,secretorapikey. This includes the URL-encoded form nested inside another parameter.connect.htmlURL has every parameter value redacted._metaand JSON-RPC error replies.&/?after a space starts no parameter (so source text likeint &key=v;is left alone). A second review round added bare?…/#…references, names encoded twice, and values that stop at a closing bracket they did not open, so adjacent Markdown links survive. URL-like prose such asx?key=1is still rewritten, which README states. The remaining pattern-list gaps are intech-debt-tracker.md.Verification
npm test: 422/422 pass.CUA_SHIM_SURFACES=computer,browser node verify.mjsfrom the branch: no problems, five tools,instructionsChars2035 (re-run after the review fixes).getStateinventory through the redaction (it would list the owner's real tabs). The redaction is covered by fixtures only.Decision Log entries for both issues are in the spec.
Closes #23
Closes #24