Commit Graph

7305 Commits

Author SHA1 Message Date
Ayaan Zaidi da0cb592dd perf(e2e): reuse one authorized Telegram Desktop session per Mantis run (#127835)
* refactor(mantis): reuse authorized desktop captures

* fix(mantis): budget desktop authorization failures

* chore(mantis): bound desktop proof retries

* fix(e2e): drop unused recorder failure fact type export

* fix(ci): route Mantis desktop teardown through the recorder wrapper

Cleanup invoked the internal recorder executable as mantis-sut, which is
deliberately kept out of the docker group and cannot read the
recorder-owned session file; teardown therefore failed and blocked
safe_to_release. The cleanup step already runs as the recorder user, so
call the public wrapper whose exec shim cds into the session root.

* fix(e2e): make recorder failure fact lane-readable; document v2 lifecycle

The Mantis workflow runs the recorder as the desktop user while the lane
reads the authorization-failure fact as mantis-sut; 0600 made that read
fail EACCES and silently disabled the two-attempt retry budget. Write the
fact 0644 — the 0770 attempt directory bounds visibility.

Update the mantis doc's recorder section for the v2 session lifecycle:
required --session handle with healthy-session reuse, capture-only stop,
and teardown owning authorization termination and lease release.
2026-08-22 15:58:12 +05:30
Vincent Koc b86062e5b4 fix(release): accept frozen QA completion evidence (#127806) 2026-08-22 01:56:22 -07:00
Ayaan Zaidi 10c774cf38 feat(mantis): keep QA leases alive and stage fixture plugins (#127804)
* feat(mantis): keep leases alive and stage fixture plugins

* refactor(mantis): deduplicate lease keepalive guard

* fix(mantis): retry keepalive on unexpected broker errors

* fix(mantis): fence active proof on terminal lease loss
2026-08-22 14:09:28 +05:30
Ayaan Zaidi 460f5b6c61 perf(mantis): parallelize proof builds and warm caches (#127798)
* perf(mantis): parallelize proof builds and warm caches

* fix(mantis): size build image for the copied pnpm store

* chore(ui): refresh startup JS gzip baseline after streamed-markdown perf work

Identical source measures 345034-345058 B across builds while the
committed baseline left only a 9 B margin under the 512 B ratchet
tolerance, so build-artifacts flips on gzip nondeterminism (green on
main run 32559609413, red on PR run 32559442295, red locally).
Regenerated with scripts/check-control-ui-performance.mts
--update-baseline; the 350 KiB hard ceiling still bounds creep.
2026-08-22 07:53:36 +00:00
Ayaan Zaidi 0933263f76 fix(mantis): publish proof comments on auto-triggered runs (#127787)
## What Problem This Solves

Auto-triggered Mantis proof runs (label/`clawsweeper_label` and other non-comment request sources) end with no PR comment at all. The durable evidence publisher runs with `--create-missing false` and only edits an existing marker comment, but the inline status comment carrying that marker was only created when `request_source == 'issue_comment'`. Label-triggered runs therefore published nothing and logged the misleading "Skipped stale Mantis QA evidence comment because its status is no longer active" — observed on PR #127735. This is the silent-failure class: a Mantis run completes and the PR shows no visible outcome.

## Why This Change Was Made

- `.github/workflows/mantis-telegram-desktop-proof.yml`: the status ack comment (👀 + active-job link + run-scoped marker) is now created for every request source that resolves to a PR (`pr_number != ''`), not only `issue_comment`. The 👀 *reaction* stays `issue_comment`-only (it lives in `mantis-resolve-request.yml`, untouched — there is no triggering comment to react to on label runs).
- The start-failure fallback comment and the existing-artifact republish path now use the same run-scoped marker `<!-- mantis-telegram-desktop-proof:${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT} -->` as the status comment and the main publisher, so every publisher edits the single run-owned comment (ack → progress → final proof; no comment spam). The republish path gets an explicit `--create-missing false` to match. The design invariant that makes `false` safe: the fallback status-comment step is not `continue-on-error`, so a run in which no marker comment could be created fails `resolve_request` and never reaches publish.
- `scripts/mantis/publish-pr-evidence.mjs`: the two skip cases now log honestly — "no existing comment found" vs "could not update existing comment" — instead of one misleading stale-status message.

## User Impact

Operators triggering Mantis via labels (ClawSweeper flows) now get the same single evolving PR comment as comment-triggered runs: an immediate 👀 ack with the running job link, edited in place into the final proof evidence. No more runs that finish invisibly.

## Evidence

- Focused suite: `node scripts/run-vitest.mjs test/scripts/mantis-telegram-desktop-proof-workflow.test.ts` — 28/28, including new assertions that the status/failure comment gates use `pr_number != ''` (and not `request_source`) and that both publishers pass the run-scoped marker with `--create-missing false`.
- `node scripts/check-changed.mjs -- <touched files>` green; `git diff --check` clean.
- Marker alignment verified across all five sites in the workflow (status comment, prior-attempt cleanup regex, fallback comment, failure report, both publisher invocations): all use `mantis-telegram-desktop-proof:${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}`.
- Live-run proof of the label-triggered path requires a merged workflow (GitHub runs the workflow from the default branch for these triggers), so the first post-merge label-triggered Mantis run is the live verification; stated here as the known evidence gap.

Production LOC delta: −4 (workflow/tooling); tests +13.
2026-08-22 11:10:11 +05:30
Ayaan Zaidi 10e0e690df feat(mantis): programmable proof boundaries with recipe library (#127782)
Makes the Mantis Telegram Desktop proof agent programmable at its trust boundaries: declarative Bot API fault rules (drop/status per method), per-request scripted mock-provider responses, observe-until predicates (post-cursor events/text, cumulative provider count), and bounded proxy-side recording of outbound Bot API requests as trusted lane facts. Adds a reusable recipe library under .github/codex/prompts/mantis-recipes/ and raises the proof agent's reasoning effort to high.

Security: the SUT container shadows proxy-control with an inaccessible tmpfs so candidate PR code sharing the mantis-sut uid cannot read or rewrite the proxy's recorded evidence; unmount is blocked by cap-drop/no-new-privileges. Proof doctrine now treats proxy-recorded Bot API facts as trusted comparison evidence and provider request logs as diagnostics.

Follow-up named in PR: move the mock OpenAI server out of the SUT container so provider request facts also become candidate-tamper-proof.
2026-08-22 11:06:06 +05:30
Dallin Romney e1256421d3 fix(e2e): skip package postinstall in git fixture (#127768) 2026-08-21 20:45:19 -07:00
Dallin Romney 53fbe2eb33 fix(release): preserve validation plan across reruns (#127343)
* fix(release): preserve validation plan across reruns

* test(release): align rerun plan assertions

* refactor(release): use canonical plan cache action

* style(test): format release plan cache assertion
2026-08-21 19:08:32 -07:00
Dallin Romney fc5cb9e304 fix(ci): preserve current Kova gate failures (#126034) 2026-08-21 18:18:26 -07:00
Peter Steinberger 0d29baae01 fix(cli): render status timeout JSON failures (#127721) 2026-08-21 18:04:25 -07:00
Peter Steinberger 89bb601b91 fix(qa): replace Linux-only /proc probes in the Telegram proof harness (#127718)
The Mantis lane and the Telegram user driver reached for /proc to enforce
media containment and to prove a pid was still alive. Off Linux those paths
do not exist, so the containment check compared a literal "/proc/self/fd/N"
string against the output root and refused every file, while both liveness
probes silently reported "gone": the lane stole a held harness lock and the
driver deleted the observer pid file without ever signalling the process.

Containment now uses each runtime's strongest portable construct. Python
descends the media path one component at a time from an open directory
descriptor (O_DIRECTORY|O_NOFOLLOW, dir_fd), which is race-free and also
covers the intermediate directories the old leaf-only O_NOFOLLOW did not.
Node has no openat(2), so publicRelativePath re-walks the resolved
components after the descriptor is open and refuses any that became a
symlink. Liveness moves to process.kill(pid, 0) and to ps state/args, which
keeps the pid-reuse and zombie handling the /proc reads provided.

The compound-command approval binding test asserted an operand count that
only held where the host interpreters live in a root-owned prefix; a
Homebrew python3 is writable, so it correctly binds as a third executable
operand. Assert the script operands by path instead.
2026-08-21 17:45:12 -07:00
Vincent Koc 7dfe406d20 perf(ci): parallelize installer smoke validation (#127138)
* fix(ci): parallelize installer smoke groups

* fix(ci): bind installer smoke artifacts

* fix(ci): isolate installer smoke candidate payload

* fix(ci): restore trusted install harness

* fix(ci): run Bun smoke from trusted harness
2026-08-21 17:02:11 -07:00
Peter Steinberger 4e7bf407d1 test: remove redundant extension test seams (#127688) 2026-08-21 16:55:33 -07:00
Peter Steinberger 7469b54272 fix(cli): render plugin search JSON failures (#127679) 2026-08-21 16:35:17 -07:00
Peter Steinberger 74c1900e63 refactor(tooling): unify managed child process cleanup (#127480) 2026-08-21 15:43:39 -07:00
Peter Steinberger 75b736c252 test(runner): reset console routing between non-isolated files (#127604)
enableConsoleCapture() replaces every console method with a forwarder and
routeLogsToStderr()/`--json` mode latch loggingState.forceConsoleToStderr,
which production only unwinds at process exit. loggingState is keyed off
globalThis so it survives vi.resetModules(), so a shared Vitest worker carried
both into the next file: the inherited forwarder writes to process.stderr and
the next file's console.error spy records nothing.

That is the source of the order-dependent
`src/entry.run-main.test.ts > keeps expected conditions at exit 1` flake in
shard core-unit-src-security-2 — it failed only on workers that ran
src/mcp/codex-supervision-tools-serve.test.ts (serveCodexSupervisionToolsMcp
-> routeLogsToStderr) first.

Restore the worker's baseline console methods and logging state in the
runner's existing cross-file cleanup, and drop the two consumer-side
workarounds that were compensating for it.
2026-08-21 14:49:05 -07:00
Peter Steinberger 14cebc477a fix(recovery): keep queued replies alive during session watchdog repair (#127510)
* fix(recovery): preserve queued turns during session watchdog repair

* test(plugins): make stalled response timeout deterministic
2026-08-21 14:14:26 -07:00
Peter Steinberger 1353ce0995 feat: run Codex sessions on approved paired devices (#127202)
* feat(codex): execute paired-device sessions over node carrier

* fix(node-host): preserve approved invocation session identity

* fix(codex): observe paired-node execution leases before handshake

* fix: fence paired-device placement and Codex execution owners

* fix: satisfy paired-device placement CI ownership guards

* fix(codex): reject credentialed paired-node URL parameters

* fix(codex): fence nested remote HTTP session credentials

* fix(codex): scrub node process URLs and preserve plaintext HTTP

* test(codex): republish node inventory after capability approval
2026-08-21 12:50:26 -07:00
Peter Steinberger b9ebfeb950 perf(qa): isolate OTEL model-call test imports (#127420) 2026-08-21 12:33:02 -07:00
Josh Avant 0b85966072 fix gateway conversation route ownership (#126424) 2026-08-21 12:20:21 -07:00
Josh Avant ccbfa6c3a3 feat(ui): explain decision receipts in Activity (#126007)
* fix(audit): project safe decision receipt displays

* docs(agents): preserve audit display privacy

* fix(ci): satisfy audit receipt guardrails
2026-08-21 11:33:32 -07:00
Vincent Koc 1da74794b6 fix(release): establish immutable release plan contract (#127008)
* fix(release): define immutable release plan contract

* fix(release): harden immutable plan authority

* fix(release): tighten release plan authority

* fix(release): share plugin publication authority

* fix(release): verify plan authority remotely

* fix(release): track ClawHub publication authorities

* fix(release): trust remote tooling tag identity

* fix(release): close plugin publication authority

* fix(release): align npm authority selection

* fix(release): bind plans to validation intent

* fix(release): require qualification cadence

* fix(release): reject lossy canonical values

* fix(release): narrow qualification cadence

* fix(release): bind plan parser dependency

* fix(release): add tagless diagnostic plans

* fix(release): attest release plan parser tree

* fix(release): isolate verified plan parser snapshot

* fix(release): verify plan tooling before execution
2026-08-21 11:24:22 -07:00
Dallin Romney 8dd21b0f34 fix(browser): load Playwright runtime on demand (#127049)
* fix(browser): load Playwright runtime on demand

* test(browser): use lazy Playwright accessor

* fix(worker): bind bundled Playwright runtime

* style(worker): format build regression

* style(worker): apply repository formatter
2026-08-21 10:45:18 -07:00
Ayaan Zaidi 10a3df4fb6 feat(mantis): let proof agents extend desktop control (#127271)
* feat(mantis): let proof agents extend desktop control

* fix(mantis): constrain desktop extensions

* docs(mantis): document desktop action authority

* fix(mantis): bind actions to recorded window
2026-08-21 23:09:17 +05:30
Eden 830196c628 fix(scripts): keep Windows lint runs from failing before any file is checked (#126274)
* fix(scripts): keep Windows lint runs from failing before any file is checked

`pnpm lint:extensions` aborts on Windows whenever the plugin SDK boundary
cache is cold: the boundary prep spawns `node_modules/.bin/tsgo` directly,
and Windows cannot execute the extensionless pnpm shim, so the run dies with
ENOENT before oxlint checks a single file. The stylelint runner reached by
`check-changed` fails the same way for the same reason.

Both now build their child process with `createManagedCommandInvocation`,
the launcher every other repo tool runner already uses, which routes the shim
through cmd.exe on Windows and returns the command unchanged everywhere else.

Off Windows the spawned command, arguments, and options are byte-identical to
before, so only the broken platform changes behavior.

* fix(scripts): stop the lint pipeline from spawning a tool shim directly

`pnpm lint` reaches stylelint through the same raw shim spawn that broke the
boundary prep, so the pipeline dies on Windows after oxlint succeeds. Route it
through the managed launcher like every other tool runner.

The remaining hazard is structural: the resolver hands out a path that only
some callers know to normalize, and the three sites that forgot were spread
across two spawn shapes. Add a static guard so a shim can only flow into a
launcher that understands the platform, and so the next occurrence fails on
Linux CI instead of on a contributor's Windows machine.

* test(scripts): trim Windows shim regression coverage

Punchcard-Session: cobalt-orchard-willow-2q

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-08-21 09:31:50 -07:00
Dallin Romney c4d07b398b fix(release): allow unreleased changelog in SHA preflight (#127019) 2026-08-21 09:28:36 -07:00
Vincent Koc a2f0b84e8a fix(release): report blockers before diagnostics finish (#127014)
* fix(release): separate decisions from diagnostic drain

* test(release): align decision drain fixtures

* fix(release): pin artifact downloads to valid v8 SHA

* fix(release): default empty evidence paths in plans

* fix(release): bind complete evidence reuse selection

* fix(release): harden retry artifact integrity

* fix(release): canonicalize reused validation evidence

* fix(release): bind manifest children to execution plan

* test(release): fix validation fixture types

* fix(release): retry transient decision artifact reads
2026-08-21 09:14:39 -07:00
Dallin Romney 8091f7ceb3 test(qa): align failed-tool recovery oracle (#127077)
* test(qa): bound OTEL runtime timeout evidence

* test(qa): identify OTEL runtime wait stage

* test(qa): align failed-tool recovery oracle

* test(qa): bound recent OTEL trace evidence

* test(qa): keep trace summary type private
2026-08-21 09:11:17 -07:00
Dallin Romney 566b0e53d5 fix(ai): retain compaction-only replay checkpoints (#127106)
* test(gateway): publish runtime in agent E2Es

* test(gateway): leave replay fix to owner PR

* fix(ai): retain compaction-only replay checkpoints

* fix(ai): preserve empty compaction replay checkpoints
2026-08-21 09:10:10 -07:00
Dallin Romney 8531da1993 fix(gateway): run transcript cursor E2E with full startup (#127094)
* test(gateway): publish runtime in agent E2Es

* test(gateway): leave replay fix to owner PR
2026-08-21 09:05:05 -07:00
Dallin Romney 2fe6b67871 fix(test): read migrated Codex auth from shared owner (#127097) 2026-08-21 09:04:39 -07:00
Peter Steinberger 0095168ae6 fix(cli): render Nodes validation failures (#127223) 2026-08-21 08:38:57 -07:00
Vincent Koc 7833e242cb fix(ci): isolate performance candidate trust (#127160) 2026-08-21 07:54:56 -07:00
ClawSweeper f94f945314 improve(ui): declutter Automations across desktop and mobile (#127198)
* improve(ui): declutter automations list

* test: align automation UI and process cleanup

Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>

---------

Co-authored-by: RoboClaw <309084314+roboclaw-bot@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-08-21 06:56:43 -07:00
Ayaan Zaidi e8d2b8cb18 fix(mantis): keep Telegram proof running and honest (#127108)
Make long, free-form Telegram proof runs truthful and resilient. Keep the trusted mock harness current across historical SUTs, preserve intentional silence and blocked outcomes, remove fixed attempt/lifetime caps, and export cropped motion proof without the prior memory spike.

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-08-21 17:53:54 +05:30
Peter Steinberger 02bba8ee84 fix(heartbeat): honor configured session for monitor wakes (#127153)
Sessionless interval heartbeat monitor and task wakes now defer to the
configured heartbeat session, while explicit user sessions and ordinary cron
event queue ownership remain unchanged.

Maintainer replacement for #116373 because the external fork cannot satisfy
the strict Clownfish landing transaction. The replacement preserves the
accepted patch exactly on current main.

Fixes #116205.
Thanks @sloptop-the-terrible for the original patch and @QQSHI13 for the report.

Co-authored-by: sloptop-the-terrible <310909503+sloptop-the-terrible@users.noreply.github.com>
2026-08-21 05:11:01 -07:00
Peter Steinberger 7fd243326f fix(process): retain live children after signal errors (#127154) 2026-08-21 03:49:55 -07:00
Vincent Koc 67630f6854 fix(ci): isolate candidate cache authority (#127149) 2026-08-21 03:47:41 -07:00
Vincent Koc 225aa5a178 fix(ci): isolate Actions cache writes (#127107) 2026-08-21 02:45:06 -07:00
Peter Steinberger 9c3335a1a4 fix(qa): restore failed-tool recovery scenarios (#126971)
* fix(qa): sync cron failed-tool honesty fixture

* fix(qa): sync channel failed-tool honesty fixture

Amp-Thread-ID: https://ampcode.com/threads/T-01a02218-492f-73b8-8514-ef342917e129

* test(qa): sync OTEL failed-tool assertion

---------

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
2026-08-21 02:20:53 -07:00
Peter Steinberger 32fb2fc766 fix(cli): render task flow JSON failures (#127080)
* fix(cli): render task flow JSON failures

* test(cli): stabilize entry console capture

* fix(cli): keep JSON terminal resets off stdout

* fix(cli): keep task JSON resets off stdout
2026-08-21 01:48:16 -07:00
Vincent Koc fa86caf94f fix(release): keep protected tooling trusted after main moves (#126881)
* fix(release): keep protected tooling trusted after main moves

* fix(release): cover protected tooling recovery paths

* fix(release): honor live tooling contracts

* fix(release): revalidate tooling at npm publish

* fix(release): bind npm publishers to live tooling

* fix(release): preserve trusted dispatch identity

* fix(release): revalidate parent authorization

* fix(release): bind ClawHub to release parent

* docs(release): define frozen tooling identity

* test(release): align ClawHub protected dispatch ref

* fix(release): trust protected plugin npm preflight tooling

* docs(release): scope protected writer guarantees

* fix(release): keep protected tooling foundation npm-only

* test(release): cover trusted npm preflight tooling
2026-08-21 07:24:31 +00:00
Ayaan Zaidi 190f2edd7f fix(qa): stop Mantis skipping visible Telegram changes (#127032)
Remove the premature visibility classifier and let one proof agent configure and exercise the disposable Telegram gateway. Align mock response timing with the 15-minute lane budget while preserving credential isolation through the alias-token proxy.
2026-08-21 12:33:38 +05:30
Vincent Koc 750f2f3762 fix(release): require concrete validation retry groups (#127012)
* fix(release): require concrete validation retry groups

* fix(release): reject mismatched retry filters

* fix(release): align retry controller vocabulary

* fix(release): preserve historical validation evidence

* fix(release): validate retry filters before scheduling

* test(release): follow shared filter validator

* docs(testing): clarify release QA retry groups
2026-08-20 23:35:16 -07:00
Peter Steinberger 7efc077abe test(onboard): follow canonical secret-ref storage (#126965)
Co-authored-by: Amp <amp@ampcode.com>
2026-08-20 22:31:14 -07:00
Peter Steinberger 57a2677c3c fix(cli): render skills JSON failures (#127016) 2026-08-20 22:23:52 -07:00
Ayaan Zaidi 1aa211be4a fix(qa): make Mantis backfills reliable (#126980)
Preserve honest blocked proof outcomes and publish visible stop-reports without marking them passed. Serialize burst runs through the authoritative Telegram-user lease while reserving time for proof and cleanup.
2026-08-21 10:01:58 +05:30
Dallin Romney 579f9b8a8a fix(package): account for bundled docs growth (#126970) 2026-08-20 20:43:09 -07:00
Peter Steinberger 0f2facaf14 test: remove Docker seed source guards (#126949)
* test: remove Docker seed source guards

* ci: route Docker seed edits to owner lanes
2026-08-20 20:36:38 -07:00
Dallin Romney 59e9765e77 fix(ci): accept extended-stable patch successors (#126936)
* fix(ci): accept extended-stable patch successors

* fix(ci): align Telegram extended-stable successors
2026-08-20 20:13:26 -07:00