Skip to content

🤖 docs: halve agent-facing text, enforce its rules as checks, and fix the drift it hid - #8233

Merged
ThomasK33 merged 33 commits into
mainfrom
agent-docs-pj8f
Dec 4, 2026
Merged

ThomasK33 merged 33 commits into
mainfrom
agent-docs-pj8f

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

Cuts the agent-facing text in this repo roughly in half, turns the rules a machine can check into lints and tests, and fixes the stale facts and drift that the prose was hiding. docs/AGENTS.md goes from 37 KB to 5.9 KB, and the project skills from 184 KB to 87 KB. Two real bugs surfaced on the way and are fixed here: Terminal-Bench results have not reached BigQuery since the repo rename, and agent shells picked up the wrong bun.

Background

Most of AGENTS.md and the skills restated the Makefile, scripts and workflows, and much of that had drifted (wrong exit codes, file:line references that no longer point at the code, a nonexistent TB_SAMPLE_SIZE, a bun add fix that breaks the lockfile rule). Rules that only live in prose also get skipped. This follows the pstack no-prose method: delete what restates code, encode what a check can enforce, keep only judgment.

What stayed was decided on evidence, not byte counts:

Implementation

New checks (each shown failing on a real violation before the prose went):

  • ESLint local/no-emoji-in-jsx, local/require-html-sink-audit, local/no-history-service-double, and no-console in src/node (mirrored in .oxlintrc.json); scripts/agent-rule-lints.test.ts covers them.
  • scripts/agentDocsLayout.test.ts: agent docs live where agents look, user docs are in docs.json.
  • scripts/formalStopRetrySkill.test.ts: every function, path and test title the formal-stop-retry skill and StopRetry.tla cite exists in src/, and no new caller of the retry path goes unnamed. 11 of 15 old file:line references had drifted.
  • scripts/verifyXumFeatures.test.ts: verify-xum feature files keep their shape, are all indexed, links and anchors resolve, and cite symbols instead of line numbers.
  • tests/bugbash/reproRules.test.ts: repro tests carry bugbash plus a bug ID, mock-only when they send [mock: prompts, and an issue number on known-failure.
  • scripts/crap/check.ts: the CRAP report no longer says "or test it" when the score counts complexity only.

Text: AGENTS.md keeps the project, commands, public-action and design-judgment sections plus main's iOS section. Rules about one file moved into a comment at that file. Each skill now holds its judgment calls and guardrails and points to the script, header or Makefile target for the rest. .xum/agents/exec.md is gone (it repeated the Commands section).

Fixes:

  • terminal-bench.yml: both BigQuery upload steps checked github.repository == 'coder/mux' and have been skipped on every run since the rename (the 2026-08-17 runs still uploaded; every sampled run from 2026-09-14 skipped both). They now check coder/xum.
  • .xum/tool_env puts the pinned bun first on PATH, and .xum/init generates src/version.ts for new worktrees: most eval runs lost time to both.
  • The 🤖 bug: a creation draft whose delete fails comes back with the sent text (#6620 dropped the retry) #7551 reconnect test waited on a race (38 of 40 local runs failed before, 40 of 40 pass after).
  • The pull-requests skill's merge rule now reads "never merge, enqueue or enable auto-merge unless the user explicitly asked you to land the PR", which matches its own merge-queue section.

Validation

  • make formal-check: 6 of 6 configs as expected after the formal-stop-retry edits.
  • Each new check failed on a planted violation (renamed function, unlinked feature file, missing tag, file:line citation) and passes on the tree.
  • Usage evidence: read-only scans of transcripts on two hosts; counts only, no transcript text in the repo.

Risks

Low; mostly text. The lints are new errors: if one fires on code this branch did not see, its message names the replacement. The config path filter in pr.yml now includes three skill folders, so Markdown-only edits there run the unit lane. If the BigQuery upload fails on the next run, it is a secrets or permissions question for coder/xum, not this change.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $32.28

…L sink audits, backend logging, HistoryService doubles, docs layout)
…into code comments and process text into skills
Replace prose that restates scripts, the Makefile or pr.yml with pointers to
the source, and fix stale facts (story locations, the socket path limit,
references to a removed AGENTS.md section, a missing test file path).
…t overrides

A blinded ablation (3 replicates x 2 real tasks per condition) found no
score gap of 2 points or more between the full text, root+domain, and
root-only AGENTS.md (medians 9.0 / 8.77 / 7.875). Under the
pre-registered rule, the domain section, the workflow section and the
.xum/agents exec/plan overrides go.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…rules in AGENTS.md

The pre-registered ablation rule deletes every skill an A run opened when
the full text does not beat root+domain by 2 points (it did not: 9.0 vs
8.77). One A run opened pull-requests. The rules agents cannot discover
from the repo (title prefix, attribution footer, never merge yourself,
wait_pr_ready.sh) move into the root AGENTS.md section.

The eval graded code changes, not PR or commit text, so this commit is
separate and can be reverted on its own.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…session opened

Pre-registered rule R3: delete the prose of any skill or RFC that 0 of
the 6 full-text eval runs opened and at most 1 of 94 real xum sessions
on this host opened. Deleted: bug-bash, react-effects,
generate-readme-screenshots, verify-xum (SKILL.md and features/), tbench,
formal-stop-retry, the vendored dogfood and electron skills (and their
skills-lock.json entries), and every RFC except
20261030_cursor-plugin-support.md (opened in 14 or more real sessions).

Code that a Makefile target, workflow or test calls stays and moves out
of the skill folders:
- verify-xum.sh and webkit-capture.mjs -> scripts/verify-xum/ (now
  shfmt-checked like the rest of scripts/; covered by the `scripts/**`
  CI path filter).
- the TLA+ model, configs and check.sh -> formal/stop-retry/
  (`make formal-check`); each config names its Stop entry point.
- benchmarks/terminal_bench/README.md was a symlink to the tbench
  SKILL.md; it is now a regular README with the same text.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…EADME example

The Makefile has no TB_SAMPLE_SIZE; TB_TASK_NAMES is the knob that limits a run.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
Reverts 4bdd2bb4d. The ablation graded code tasks only, so it says
nothing about PR, commit or review work, which is what this skill covers
(and it is the most-read project skill: 20 of 94 real sessions).

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
R3 deleted verify-xum because no full-text eval run and only one real
session opened it. Neither eval task needed a check in the running app,
so the eval never measured it, and the skill is the repo's means of
proving a UI change against the real artifact. The skill comes back
unchanged with its scripts in their old place; only the links to the
deleted electron and bug-bash skills now name the Makefile targets.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
Like verify-xum, R3 deleted them on usage counts the eval could not
test: neither eval task needed a repro story or touched the auto-retry
code. bug-bash is how a finding becomes a failing repro test, and
formal-stop-retry tells an agent that touches RetryManager or the
stream-error code to run `make formal-check` and maps the model to the
code. Both come back unchanged, with the TLA+ files in their old place.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…ent's LoC rule

The ablation scored root + design judgment above root only on both tasks
(medians 9.04 vs 7.50 and 8.50 vs 8.25), short of the 2-point bar with
only 3 runs each. Four weeks of transcripts show agents acting on rules
that exist nowhere else in the repo, such as checking a UI change at
375px (20 sessions) and `.nullish()` tool inputs (16). The rules are not
discoverable from the code, so the section comes back.

.xum/agents/plan.md (net LoC estimate per approach) returns too: every
eval run used Exec mode, so the eval never measured it.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…kills

- rfc/*: design records that humans own (rfc/README.md), including an open
  Draft (foreign-plugin-agent-aliases). Agent read counts are the wrong
  test for them.
- react-effects: the design-judgment section points to it, and code
  comments cite it (RightSidebar.tsx).
- tbench: back as the skill, with benchmarks/terminal_bench/README.md
  linking to it as before; its example no longer names the nonexistent
  TB_SAMPLE_SIZE.
- electron (vendored, with its skills-lock.json entry): the only how-to
  for driving the desktop app over CDP; dev-desktop-sandbox and
  verify-xum point to it.

Also fixes .storybook/test-runner.ts, which said a limit is stated in
docs/AGENTS.md; it is in the tests skill.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
The transcripts of a second Xum host (12 months, about 18,000 xum
sessions) show both in use: agents loaded dogfood in 129 sessions, 35 of
them in November 2026, and generate-readme-screenshots in 13 sessions,
8 in November. The first host only covered four weeks.

generate-readme-screenshots now matches scripts/capture-readme-screenshots.ts:
a 3 s settle (not 2 s), 3 attempts in total, a viewport-only capture, and
`bun install --frozen-lockfile` instead of `bun add` for missing deps.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
…arry

Delete what the scripts already print or document: the mergeable/merge-state
table and rebase command (wait_pr_checks.sh), the security-receipt mechanics
(check_codex_comments.sh, wait_pr_codex.sh), the heredoc comment example
(wait_pr_codex.sh), the queue-reading details and check-name pointer
(watch_pr_state.sh header). Delete the copies of AGENTS.md rules (local
validation, the PR creation gate) and merge the triplicated
coder-agents-review and push-upkeep rules into one place each.

Keep the footer, readiness definition, loop, early-stop cases, review-fix
scope, gate-at-origin/main and merge-queue lessons. Add `docs` to the title
prefixes (used on main), state that the readiness script's Codex usage-limit
pass is not approval, and say merges need the user's explicit request (the
merge-queue section assumes agents land PRs when asked). Make the
no-hand-written-polling-loop rule prominent: transcripts still show hand
loops in 1 of 5 sessions.
The skill restated the Makefile, the workflow inputs and each script's
docstring, and several of its facts had drifted:

- Results are Harbor job folders (`jobs/<timestamp>/`), not `runs/...`
  with `sessions/agent.log` (terminal-bench.yml "Print results summary").
- CI has uploaded no run artifacts since #4002, so download_run_logs.py
  and the download modes of prepare_leaderboard_submission.py find nothing
  for new runs; the skill still sent agents there.
- The scheduled run covers five models twice a week, not "Claude and GPT
  nightly", and its example models did not match the workflow.
- The Daytona tier and speed numbers contradicted the workflow's
  25-sandbox note.

Keep the judgment the code does not carry: CI dispatch by default,
MUX_RUN_ARGS instead of per-flag plumbing, one global TB_TIMEOUT, the
monitored local run, and where results and failure analysis live. List
TB_TASK_NAMES, MUX_RUN_ARGS and MUX_RUN_AS_GOAL in the `make help` line
instead of the skill, move the Hugging Face upload fallback into the
docstring of the script that prints the upload command, and drop the
leaderboard no-submit rule that AGENTS.md already holds.
… traps

Delete what scripts/capture-readme-screenshots.ts already states: the
viewport, DPR and WebP constants, the story-to-file table, the retry and
wait steps, the dimension check (the script prints each size and exits 1
on a failed story) and the ProductHero note. Two of those claims were
stale: MobileServerMode uses the postProcess hook the skill called unused,
and four stories crop with a clip, so not every image is 3800 px wide. The
description and file table named src/browser/stories/mockFactory.ts, which
no longer exists; the mocks are under src/browser/stories/mocks/.

Keep the procedure (static build, background server, capture), the stop
rule for missing dependencies, the bun-fetch versus curl trap, the retry
advice for interactive stories and the fix-the-story-not-the-script rule.
Applies the pstack no-prose method (Steps 1-2) to the verify-xum skill.

- Deletes prose that restates verify-xum.sh, its refusal messages (which
  name their fixes), warmViteModules.ts and the Makefile: the launch
  readiness list, the per-refusal list, doctor's check list, the run-home
  rules, WebKit host/Docker mechanics and the Playwright bump recipe.
- Keeps one owner per rule: SKILL.md Drive owns the driving rules that
  features/README.md repeated, and the threat model now also covers the
  Xum Browser tab turning a session's stream on (moved from
  dev-server-sandbox).
- Makes the rules agents broke in transcripts prominent with the failure
  seen: the token in an `agent-browser open` argument, a missing `eval`
  of `verify-xum.sh env`, and runs that ended without cleanup.
- Fixes stale code refs (App.tsx:1386 and App.tsx:1133 had drifted) by
  citing symbols, and drops dated history lines.
- Adds scripts/verifyXumFeatures.test.ts, which replaces the "Feature
  entry contract" prose: feature-file shape, index links, relative links
  and anchors, and no file:line refs. The PR workflow's config filter now
  covers the whole skill folder so Markdown edits run it.
Applies the pstack no-prose method (Steps 1-2) to both sandbox skills.

- dev-server-sandbox: deletes what the script, its --help, its banner
  and the Makefile's comments already say (seeding steps, Allowed hosts,
  token mechanics and lifetimes, the Unix socket and its length limit).
  Keeps the monitored background start, the stdin curl and agent-browser
  recipes, and the guardrails no code enforces: the seeded API keys,
  XUM_DEV_SERVER_NO_AUTH=1 and XUM_VITE_ALLOWED_HOSTS=all. The DevTools,
  stream and Xum Browser tab warnings now live once, in verify-xum's
  threat model, which this skill points to.
- dev-desktop-sandbox: points to the dev-server sandbox for seeding and
  the background start instead of repeating them, names the electron
  skill and the printed Electron debug port for driving the app, and
  says to set ELECTRON_DEBUG_PORT=0 on a host with other accounts
  because that port has no credential. Moves the XUM_SERVER_PORT
  override into the script's header comment, beside the others.
- Fixes the dev-server script header's stale ~/.mux-dev default.
- scripts/verifyXumFeatures.test.ts now also resolves these skills'
  links and anchors into verify-xum, and the PR workflow's config
  filter covers both folders.
Wait timeouts were the most frequent failure in the sampled verify-xum
and dev-server-sandbox transcripts. The Gotchas now start from that
symptom: run idle, reload on exit 3, and run idle once more on a slow
Loading Xum. The Launch section also says that source edits hot-reload,
so an edit needs no new launch.
…ts skill

SKILL.md goes from 27,342 to 11,401 bytes. It cited 15 file:line numbers,
11 of them drifted (such as agentSession.ts:3554 and workspaceTurnManager.ts:4038),
and repeated the sync-line rule. Its diff recipe also resolved the sync
commit with `git log -G`, which now finds the 2026-12-04 skill restore
instead of #7903, so it showed no code change since the last sync.

- scripts/formalStopRetrySkill.test.ts fails when SKILL.md or
  StopRetry.tla cite a file:line, name a function, file or event that is
  not in src/, quote a test title that no test file holds, or write
  anything but a PR number in the sync line. It also fails when a new
  function calls handleStreamFailureForAutoRetry,
  retryManager.handleStreamFailure or beginWorkspaceStop and neither file
  names it.
- The diff recipe finds the sync commit by the PR number on the sync
  line, and diffs the src/ files the folder cites plus every file that
  sets disableAutoRetry, instead of a hand-kept list.
- The scope, the gaps and why each is safe move from SKILL.md into the
  header of StopRetry.tla (no line numbers). The table keeps function
  names only. The run details that check.sh's header and the Makefile
  already give are gone.
SKILL.md goes from 20,121 to 5,336 bytes. Most of it restated the
headers of tests/bugbash/run.ts, sandbox/launch.ts, proxy.ts, runner.ts,
hostPause.ts and aiMode.ts, the Makefile comments, the stories files and
the Stories workflows. It keeps the judgment calls and the guardrails
(the key variable, the budget is not a billing cap, paid repro calls, the
manual leftover check before `docker rm -f`).

- tests/bugbash/reproRules.test.ts now also fails on a repro test with
  no `bugbash` tag or no bug ID tag, one that sends a `[mock:...]` prompt
  (directly, through a file-level constant or a local helper) without
  `mock-only`, and a `known-failure` test without the open issue's
  number. Those rules leave the skill.
- The skill's exit-code table described `make bug-bash`, but make exits 2
  on any failure; the run's own code is make's `Error N`. The skill now
  says so and points at run.ts's header.
- The charter rules (name the workspace and view, keep explorers out of
  MCP servers and editor commands) move to the charters.txt header.
- cacheSeed.ts told readers to copy a job's cache into the seed folder,
  which grows the seed until checkSeed refuses it; it now names
  `summary.ts --next-seed`. launch.ts pointed at docs/AGENTS.md for the
  manual leftover check, which is in the bug-bash skill.
…anges

The Bun unit job runs only when pr.yml's src or config filter matches. A
PR that edits only .xum/skills/formal-stop-retry (a new file:line
citation, a renamed function in the code map, a branch SHA on the sync
line) matched neither, so scripts/formalStopRetrySkill.test.ts did not
run for it. The config filter now lists the folder, as it lists
verify-xum's scripts for scripts/verifyXumWebkit.test.ts.
Drop text that restates the Makefile, .storybook/main.ts, the test runner
and AGENTS.md (the tautology rule), and fix stale facts: tests/ui starts
from createAppHarness() (47 files) rather than renderReviewPanel(), scroll
settling is waitForScrollStabilization() in storyPlayHelpers.ts (useAutoScroll
no longer waits a frame), and the Storybook test runner pins a viewport for
stories in PINNED_VIEWPORT_STORIES. The runner's own comment now carries the
diagram-timing limit the skill used to repeat.
…help

crap-check's repair line offered "or test it" even when the report scored
complexity alone (the commit hook, plain `make crap-check`), where no test
lowers the score. The line now says so in that mode, with a test, so the
skill drops its paragraph about it. The skill also drops text the report
already prints (rules, reliefs, the shrink repair), the `!` half of the
`?.` rule that ESLint's no-non-null-assertion enforces, and the Crap-Debt
approval rule that AGENTS.md holds. It keeps the async split rules, the
anti-gaming rules and the trailer-versus-label mechanics.
Drop text the reports, markers.py and pr.yml already carry (the DRY repair
steps, "do not change code only to kill a mutant", the CI modes, the marker
examples' parsing rules) and the assertion rule the crap-gate skill holds.
Keep marker discipline, the moved-file note and the partial-run procedure.

The skill, the check.ts header and the Makefile said exit 3 means a test
failed without a mutant. check.ts returns 3 for any dropped test, including
one that hung or met the 15-minute deadline (a slow suite), which needs a
hand run of its mutants rather than a test fix; all three now say so. The
skill also names the most common equivalent mutant (`??` to `||` on a value
that is never falsy), which agents rewrote code to dodge.
Keep the decision order, the anti-pattern examples, useSyncExternalStore
and the stale-fetch guard in one shorter page. Drop the app-initialization
section (no agent used it in 78 sessions that loaded the skill) and the
react.dev link.

No lint replaces the prose yet: the pinned eslint-plugin-react-hooks 5.2.0
has only rules-of-hooks and exhaustive-deps, and oxlint 1.88's
react/set-state-in-effect flags 129 sites in 80 files, a mix of real
prop-to-state syncs and legitimate fetch effects, so it is not enabled.
Merge the review rubric into the lane list (they named the same areas),
drop the generic diff-reading steps and the anti-patterns that repeated
the intro, and keep the lanes, the severity scale and the synthesis
format that past reviews used. Questions now go only to what the code
cannot answer: users often replied to a review's question list by telling
the agent to decide. The docs page and the built-in xum-docs skill embed
this file and are regenerated.
Both BigQuery upload steps in terminal-bench.yml ran only when
`github.repository == 'coder/mux'`. After the repo became coder/xum in
August 2026 every run skipped them: the nightly runs of 2026-08-17 still
show one upload step succeeding per job, and every sampled run from
2026-09-14 on shows both skipped. The steps now check for coder/xum.

The tbench skill notes the gap, so nobody reads it as missing runs.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
#8231 added an iOS section to the old AGENTS.md while this branch
shortened it. The section stays as written: its rule binds changes made
outside ios/ (settings, workspace actions, route shapes), so it must be
always-on rather than in a skill.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
@mintlify

mintlify Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Mux 🟢 Ready View Preview Dec 4, 2026, 3:59 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T16:28:15.467613Z 4e4d0a8 Manual request
🔒 Security Review ✅ Completed 2026-12-04T16:31:30.308764Z 4e4d0a8 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc4860dad2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/crap/check.test.ts Resolved
The test failed only when the hint's wording changed, which AGENTS.md
rules out. The mode-dependent hint in check.ts stays; its comment says why.

---
_Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

🟢 e2e stories (Haiku): 14 passed

21 agent steps · 6 replayed from cache · 15 model calls · 47.5k tokens (23% cached)
Spend: $0.09 of the $1.00 cap (proxy ledger)

All 14 tests in 9 files
Test Agent Time
🟢 chatRestart.e2e.ts · 1 passed 1 step · 1 call 6.4s
🟢 a chat survives a restart of the server 1 step · 1 call 6.4s
🟢 compaction.e2e.ts · 1 passed 1 step · 1 call 4.9s
🟢 /compact replaces the old chat with a summary 1 step · 1 call 4.9s
🟢 pluginTrustRestart.e2e.ts · 1 passed 3 steps · 2 calls 9.2s
🟢 a trusted plugin hook stays trusted after the server restarts 3 steps · 2 calls 9.2s
🟢 settingsRoundTrip.e2e.ts · 1 passed 2 steps · 1 call 9.2s
🟢 a chat survives trips through Settings 2 steps · 1 call 9.2s
🟢 sidebarPerWorkspace.e2e.ts · 1 passed 4 steps · 1 call 4.7s
🟢 a new workspace starts with its right sidebar collapsed while another keeps it open 4 steps · 1 call 4.7s
🟢 smoke.e2e.ts · 1 passed 2 steps · 1 call 2.8s
🟢 the agent opens the playground workspace 2 steps · 1 call 2.8s
🟢 streamErrors.e2e.ts · 1 passed 1 step · 1 call 10.5s
🟢 stream errors show in the chat, and the chat recovers 1 step · 1 call 10.5s
🟢 todoNudge.e2e.ts · 1 passed 1 step · 1 call 3.1s
🟢 the agent finishes open TODO items after the turn-end nudge 1 step · 1 call 3.1s
🟢 touchAlignment.e2e.ts · 6 passed 6 steps · 6 calls 24.5s
🟢 the Settings close button is level with the title on a touch screen 390px wide 1 step · 1 call 3.6s
🟢 the Settings close button is level with the title on a touch screen 768px wide 1 step · 1 call 5.9s
🟢 Backup settings checkboxes are small and level with their labels on a touch phone 1 step · 1 call 5.2s
🟢 the heartbeat checkbox is small and level with its label on a touch phone 1 step · 1 call 3.4s
🟢 a reply's model and time stay on one line on a touch phone 1 step · 1 call 3.4s
🟢 the workspace actions menu stays on the title row on a touch phone 1 step · 1 call 3.1s

e2e 0.20.0 · 1m 19s · web · run artifacts

🟢 e2e Electron stories (Haiku): 3 passed

3 agent steps · 3 model calls · 7.9k tokens (22% cached)
Spend: $0.02 of the $1.00 cap (proxy ledger)

All 3 tests in 3 files
Test Agent Time
🟢 electron/deepLink.e2e.ts · 1 passed 1 step · 1 call 7.1s
🟢 a deep link of a second launch starts a chat in the running app 1 step · 1 call 7.1s
🟢 electron/menuBar.e2e.ts · 1 passed 1 step · 1 call 5.6s
🟢 the workspace menu bar is the desktop title bar 1 step · 1 call 5.6s
🟢 electron/smoke.e2e.ts · 1 passed 1 step · 1 call 5.2s
🟢 Xum Electron opens the playground workspace 1 step · 1 call 5.2s

e2e 0.20.0 · 20.4s · electron · run artifacts

🟢 e2e agent repros (Haiku): no tests selected

Spend: $0.00 of the $1.00 cap (proxy ledger)

e2e 0.20.0 · 6.5s · 2 targets (web, phone) · run artifacts

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: dc4860dad2

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 4e4d0a895e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 4e4d0a895e

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33

Copy link
Copy Markdown
Member Author

Ready except the review gate: Codex approved 4e4d0a8, every review thread is resolved, and every required check passes (44 pass, 8 skipped). The main reviews ruleset needs one approving review, which only a human can give, so this waits for an approval or a maintainer bypass.

@ThomasK33
ThomasK33 merged commit 4080671 into main Dec 4, 2026
52 checks passed
@ThomasK33
ThomasK33 deleted the agent-docs-pj8f branch December 4, 2026 18:18
ThomasK33 added a commit that referenced this pull request Dec 5, 2026
…ts first oracle found (#8228)

## Summary

Adopts `@tanstack/oracles` in Xum, starting with an oracle for the
memory secret detector (`src/node/services/memorySecretRedaction.ts`).
The oracle states six laws about what `redactSecretLike`,
`redactWithinCap`, `containsSecretLike` and `addsSecretLike` promise,
and checks them against an independent model with generated notes. It
found six classes of leaks and false refusals, and this PR fixes them.

## Background

The detector guards every memory write (`memoryService.ts`
`assertNoNewSecret`) and redacts what the memory harvest quotes. Its
unit tests pin examples, but the inputs are open-ended: any note, line
order, lead character and JSON escaping. An oracle generates those
inputs and judges each result against the law, and its gap check mutates
the owned code to show which changes no law notices.

## What the oracle found (fixed here)

The share is the measured share of generated inputs in each family that
broke the law before the fix.

| Rule broken | Example | Share |
| --- | --- | --- |
| A nested YAML key leaked its value | `token:` over ` api_key: X` |
15/65 combinations |
| In JSON-escaped text, a provider key, `Bearer` or JWT on a later line
leaked | `"a\nsk-..."` | 7/20 shapes |
| A key that its own quotes wrap took the closing quote as its value,
eating the text after it | `\"API_KEY=\"` inside a JSON string | 3–5/14
forms |
| A cookie value two JSON layers deep lost its closing quote |
`\\\"Cookie: sid=S\\\"` | 7/9 frames |
| A note that quotes a key's marker was refused | `password=[redacted]`,
`API_KEY: [redacted]` | every unquoted key form |
| A key behind leading punctuation on the line under a key leaked (also
on `main`) | `password=` over `(API_KEY: <value>` | found by CI's random
seed |
| A cookie value ran past its line or its list's `]` | `curl -H "Cookie:
sid=S"; echo done`, `["a=]b", "sid=S"]` | both shapes |

Also tightened: a key pair on the line under a key (YAML's nested
`api_key:`, or one behind punctuation such as `(API_KEY:`) is never the
value of the key above, so its own value goes, while a key name glued
into a value on the key's own line (`password=hunter2_api_key:`) is the
value's text and goes with it, a key's own closing quote is not its
value, and an unquoted value of Markdown structure or a placeholder
alone (`` ` ``, `**`, `~~`, `>`, `...`) is no value, while any other
symbols are (`password=!@#$%^`). Each fix went oracle-first: the law
failed on the old code, then passed after the fix. New unit tests also
fail on the old code.

## Implementation

- **Toolchain:** `@tanstack/oracles` 0.0.1,
`@tanstack/eslint-plugin-oracles` 0.0.1, `fast-check` 4.11.0, `vitest`
4.1.12, pinned. `bunfig.toml` exempts the two TanStack packages from the
7-day release wait; remove that after 2026-12-10.
- **Lint:** the oracle presets in `eslint.config.mjs`, mirrored in
`.oxlintrc.json` (the plugin is aliased to `oracle`, its rule prefix).
`oracle/no-oracle-disable` cannot run in oxlint (its JS plugin API lacks
`getInlineConfigNodes`), so `check-oxlint-config.mjs` lists it as an
intentional gap.
- **Running:** `make test-oracles` runs the oracles and the gap check
(local, about 90 s). `make check-oracles` runs only the laws (about 5
s); CI runs it in `Test / Unit` shard 1, because the gap check exits 0
even when a law fails. `vitest.oracle.config.mts` joins the `config`
path filter.
- **Agents:** an "Oracle tests" block in `AGENTS.md` (the tool's
template 4, condensed to the shorter style of #8233), and skill pointers
in `.agents/skills` and `.claude/skills` that load the skills shipped in
`node_modules/@tanstack/oracles`.
- **The oracle:** `tests/oracles/memorySecretRedaction.oracle.ts`, six
laws: secrets go, ordinary text stays, guards agree, a quoted marker is
no credential, the cap shows only its own text, no throw. Laws 1–4 also
hold on notes JSON-escaped once or twice.

## Validation

- Gap check: 665 mutants, 562 killed, 103 gaps (268 at the first full
run). The guards-agree law now covers a renamed key that keeps its value
(`password=hunter2` to `API_KEY: hunter2`, accepted), which kills the
change that would compare main's key read with its key. Remaining gaps:
68 in the cookie reader's list and quote paths (mostly code that no
history reaches, since the regex pass redacts those values first), 18 in
marker tails (non-ASCII letters, the `]` scan), 14 in the `]` tracking
between passes, 3 in the cap.
- Every unit test file that imports the detector or the memory service
passes (2313 tests). The linear-time tests can miss their CPU ceiling on
a loaded host; they pass on rerun, and timings match `main`.

- CI runs the laws with a fresh random seed on each run, as the tool
intends. That seed found two of the bugs here, one of them also on
`main` (`password=` over `(API_KEY: <value>` leaked the value). A
failure prints its seed and a replay line; when it also fails on `main`,
it is not the PR's bug and should be filed, not block (the tool's own
guidance).

## Risks

Medium, limited to memory notes. Redaction keeps more text in one place:
a quoted marker (`password=[redacted]`) is accepted when no letter or
digit follows its closing quote. A key that ends its line still takes
the next line's first word as its value, as on `main`, including a
heading over prose (`## Deploy token:` over `Rotate every password.`).
This PR first narrowed that read to keep prose readable, and three
security-review rounds each found a credential that the narrower read
left readable (`password:` over `hunter2`, then `hunter2 # comment`), so
the read is `main`'s again. For the same reason a key that ends a JSON
string after other text (`{"title": "## Deploy token:"}`) takes the
string's closing quote as its value's opening one, as on `main`: a
quoted value may start with `,`, `}` or `]` (`{"password": ",
hunter2"}`, which a guard for that case left readable in 48 of 60 probed
forms). The guards refuse at least what `main`'s guard refuses, by
construction: they also count what `main`'s key read and `Bearer` read
take out (`MAIN_READS`), apart from the passes (Option B, chosen after
four security reviews in a row found a credential that a rule leaving a
key's value out let through). A differential fuzz of 400,000 texts and
edits, cookie headers included, found no text or edit that `main`'s
guards refuse and these accept. The cost is `main`'s: a note that leaves
a value out behind its key's own quote (`Set "API_KEY=" before deploy.`)
or behind Markdown (`**Token:** rotate monthly.`) is refused, and so is
any edit below such a quote, whose read runs to the next quote in the
text. The same holds for a marker that main's key read takes as a value:
a quoted marker after a key (`"password": "[redacted]"`, `credential:
"[redacted]", word`) and a `Bearer` marker after a key (`Authorization:
Bearer [redacted]`) are refused, as on `main`. Redaction still returns
those lines unchanged. A cookie header's marker (`Cookie: [redacted]`)
is refused too, as on `main` (Option A, third round): every rule that
accepted it left a way to glue a value onto it behind its closing quote,
which the shell joins onto the header. Every other change redacts more
or refuses more.

## Decisions and follow-ups

- **Kept as on main:** a cookie header with no value (`Set-Cookie:`
alone on a line) is still redacted and refused, and the guards refuse a
cookie header's marker (`Cookie: [redacted]`) and a signed URL's marker
alone (`?sig=[redacted]`). The guard refuses at least what main's regex
passes refuse, and these refusals expose no secret. The oracle states
both as limits.
- **Follow-up:** a cookie header after other text inside a JSON string
(`"Send the Cookie:\nnext"`) has a raw frame, so its value runs to the
end of the note. That loses text and never leaks. Fixing it needs the
reader to track which string the header sits in.
- **Follow-up PR (decided on this PR, Option B):** redaction leaves text
that the shell joins onto a quoted cookie header readable: a word or a
second quoted segment glued behind its closing quote (`curl -H "Cookie:
a=b",sid=<value>`, `curl -H "Cookie: a=b","<value>"`). `main` does the
same in raw and once-escaped text. In twice-escaped text `main` removes
it only because its pattern cannot find the header's closing quote and
reads to the end of the text; this PR finds that quote at every depth.
The guards refuse such a line at every depth, because they count the
header's value. The fix needs the cookie reader to tell a quote that
closes a shell word from one that closes a JSON list item (`["Cookie:
a=b","Accept: */*"]`), with its own oracle law (a shell argument's value
runs to the end of its shell word).
- **Next:** more oracles across the codebase.

---

_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking:
`high` • Cost: `$37.71`_

<!-- mux-attribution: model=anthropic:claude-opus-5-5 thinking=high
costs=37.71 -->
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