Skip to content

test(evals): prove an admitted signed-in desktop turn runs its next bash tool while Den returns 503 - #4808

Merged
yomgui merged 2 commits into
devfrom
astra/dev-policy-unreachable
Sep 11, 2026
Merged

yomgui merged 2 commits into
devfrom
astra/dev-policy-unreachable

Conversation

@yomgui

@yomgui yomgui commented Sep 10, 2026

Copy link
Copy Markdown
Member

What

One Daytona-only @openwork/testkit E2E spec, evals/specs/desktop-policy-unreachable.e2e.test.ts, that proves the behaviour #4725 (desktop policy-engine rollback) was meant to guarantee:

an admitted signed-in desktop turn executes its next bash tool while Den returns 503, without a managed-policy plugin

No product code changes.

Why

The v0.18.45 stability soak never combined a signed-in desktop's real agent tool execution with an unreachable Den/policy service at the tool boundary — its tool journeys always had healthy Den transport and the restart fixture was signed out. So prior green runs could not tell whether the removed per-tool managed-policy hooks could still block tools. This spec closes that gap.

How the journey works

  1. Isolated Den (Daytona) with an org, admin, and member; a deterministic mock model (mcpMock agent workload) reachable independently of the Den path.
  2. A fault proxy fronts Den for the desktop. Den Web's /api/runtime-config is rewritten to advertise the proxy API origin so the desktop cannot route around the fault (run 2 found this bypass).
  3. The signed-in member's desktop admits a turn while Den is healthy. Its first real bash tool writes a baseline marker and waits on a fixture gate file.
  4. The proxy then returns 503 for every /api/den request. Calibration on the real desktop-server→Den path: a separate new session admission is rejected 403 policy_unavailable (fail-closed admission is preserved, as fix(desktop): unregister managed policy engine plugins #4725 documents).
  5. The fixture releases the gate. The next real bash tool completes and writes its result file while Den still returns 503; an unrelated file and the signed-in identity are unchanged; the native session inventory is unchanged; the final reply is visible in the desktop.
  6. The engine's runtime plugin registration list is read before and during the outage: known OpenWork plugins present, no managed-policy / managed-policy-next registration.

Proof (Daytona lane, OpenCode v1)

Command Exit P/F/S Notes
OPENWORK_EVAL_REF=e4c5c3e3d49a75287c020111de989a93dbf30281 gtimeout -k 60 2400 pnpm evals:e2e desktop-policy-unreachable --daytona --engine v1 0 1/0/0 281 s; evidence evals/results/test-runs/2026-09-10T16-05-21-402Z-…; both sandboxes deleted by cleanup
pnpm --dir evals run check:browser 0 N/A 838 browser callbacks, no type errors
pnpm --dir evals exec tsc -p . --noEmit (filtered to this spec) — N/A no diagnostics in this spec; the pre-existing failures are unbuilt workspace deps in apps/app/ee

Verdict: Passed for the claim in the test title.

Evidence SHA note (deliberate, disclosed)

The green run's receipt is bound to e4c5c3e3 (fetched origin/dev at run time) because the spec was still untracked when it ran. The PR head 716553e5b differs from e4c5c3e3 only by adding this spec file, whose content was byte-identical during the run (git diff --stat e4c5c3e3 716553e5b → 1 file, the spec). The sticky comment is therefore published with --force and carries the publisher's stale-SHA annotation. Reviewers who want a head-bound receipt can re-run the command above on this branch (≈5 min).

Red runs on the way (all fixture-side; product behaved as documented)

  • Run 1: fixture directory not created before the unrelated-file witness (ENOENT).
  • Run 2: forwarded runtime-config advertised Den's direct API, so the desktop bypassed the fault proxy (admission returned 200 instead of 403) — fixed by rewriting /api/runtime-config.
  • Run 3: null counts; the sandbox source dependency install gate took 1018 s (vs 26–29 s on the neighbouring runs of the same commit) and the launching session's outer budget ended the run. Classified as an environment slowness, not a harness defect. Its two leaked sandboxes were deleted manually.
  • Run 4: 403 reached, but the probe read the denial code from a non-existent error field; the desktop server formats ApiError as { code, message, details }. Fixed and tightened to toBe("policy_unavailable").

Not included

  • Negative control (an old build / re-registered managed-policy plugin blocking the tool) — not cheap: needs a pre-fix(desktop): unregister managed policy engine plugins #4725 build or plugin re-registration plus another Daytona run. The spec proves the positive claim only.
  • The spec is a legacy-style test() spec importing @openwork/behaviors / @openwork/hosts like nine existing sibling E2E specs; it adds two specs-use-testkit-only entries to lint:layers output (the sandbox file witness needs defaultDaytonaExec, which testkit does not re-export). Happy to migrate to spec.world() in a follow-up if preferred.

…ash tool while Den returns 503

Daytona-only testkit journey for the #4725 rollback: a signed-in member's
admitted turn holds its first real bash tool at a fixture gate, the fault
proxy then returns 503 for every /api/den request, a separate new admission
is rejected with policy_unavailable, and the next real bash tool still
completes and writes its file while Den stays unreachable. Runtime config is
checked before and during the outage for the absence of any managed-policy
plugin registration.
@vercel

vercel Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 11, 2026 7:10pm UTC
openwork-den Ready Ready Preview Sep 11, 2026 7:10pm UTC
openwork-diagnostics Ready Ready Preview Sep 11, 2026 7:10pm UTC
openwork-landing Ready Ready Preview, v0 Sep 11, 2026 7:10pm UTC

@yomgui

yomgui commented Sep 10, 2026 •

Copy link
Copy Markdown
Member Author

Passed · 12/12 tests · 18/18 assertions · 8 images

Commit cfb0a9d07cf594d3d483444a1ee7bb9ef2f942ca · selected evidence

Open review report

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run

Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (24457 ms), confidentiality-review (10836 ms), spec-provenance-review (87421 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 2
  • Distinct heads in retained window: 2
  • Current unresolved Warden threads: 0 of 0 observed
  • Observed resolved/unresolved transitions in retained snapshots: 0 / 0
  • First observed resolved/unresolved (state at first collection, not event time): 0 / 0
  • Precision: unavailable (no adjudications; no TP/FP values are inferred)
  • Observation window: 2/20 run attempts retained; truncated: false
  • Transition snapshot: 0/0 current attributed threads retained (limit 500); truncated: false

Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority.

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (716553e5b7e656ed04158550b2f36ded04fe42f1). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

Pick up #4888 so ci-tests.yml's packaged Fast module step finds its test file.

Signed-off-by: Guillaume Loret <[email protected]>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Deploying openwork with  Cloudflare Pages  Cloudflare Pages

Latest commit: cfb0a9d
Status:🚫  Build failed.

View logs

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (cfb0a9d07cf594d3d483444a1ee7bb9ef2f942ca). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@yomgui
yomgui merged commit d65f7b1 into dev Sep 11, 2026
28 of 29 checks passed
@yomgui
yomgui deleted the astra/dev-policy-unreachable branch September 11, 2026 19:29

This branch was successfully deployed

4 active deployments
Preview – openwork-den — cfb0a9d0 Deployed Sep 11, 2026 by vercel[bot]
Preview – openwork-landing — cfb0a9d0 Deployed Sep 11, 2026 by vercel[bot]
Preview – openwork-app — cfb0a9d0 Deployed Sep 11, 2026 by vercel[bot]
Preview – openwork-diagnostics — cfb0a9d0 Deployed Sep 11, 2026 by vercel[bot]
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