Skip to content

feat(bench): reshape tasks to api-first framework-focus grading#191

Open
hfurkanbozkurt wants to merge 16 commits into
mainfrom
bench/tasks-framework-focus
Open

feat(bench): reshape tasks to api-first framework-focus grading#191
hfurkanbozkurt wants to merge 16 commits into
mainfrom
bench/tasks-framework-focus

Conversation

@hfurkanbozkurt

Copy link
Copy Markdown
Contributor

What & why

Reshapes all 10 bench tasks to be API-first ("just use the framework" — Ask E). Core grading now runs through an api namespace (JSON-RPC via POST /aws-blocks/api) backed by real framework blocks, with the DOM reduced to a light smoke test (mount renders + primary control works). This follows the tasks/observability-api gold-standard pattern: heavy request→JSON-RPC assertions, light DOM.

Task content only — no harness, scoring, workflow, or model changes. Only tasks/** (PROMPT.md + test.spec.ts) are touched.

Per-task changes (8 reshaped)

Task Blocks api surface (new core grading) DOM (reduced to smoke)
auth-notes AuthBasic + KVStore saveNote/getNote gated by session cookie; overwrite, verbatim/no-HTML, per-user isolation (2 contexts), unauth gating sign up → editor → save → reload persists
async-word-counter AsyncJob + KVStore enqueue/getJob/listJobs; whitespace/unicode counts, keyed-by-id dedupe, unknown-id error, persistence input → submit → row resolves done
file-gallery FileBucket putFile/listFiles/deleteFile/getDownloadUrl; byte-exact size, real download URL bytes, binary/empty/unicode names, overwrite file input + list
sql-kb-catalog Database + KnowledgeBase addProduct/listProducts (id-ordered), searchKb; seeded return/refund FAQ product input + kb query
oidc-dsql-notes ⚠️ AuthOIDC + DistributedDatabase addNote/listNotes gated by OIDC session; verbatim/SQL-injection-safe, oldest-first ordering, unauth gating OIDC sign-in smoke
cognito-profile ⚠️ AuthCognito (email OTP) whoami gated by session; identity, gating, post-signout gating; getLastCode test hook OTP flow → profile
kb-chat-agent Agent (Bedrock Sonnet 4.6) + KnowledgeBase ask{reply,toolsUsed,citations}; real retrieval of seeded facts, deterministic tool output, tool routing, no-fabrication, blank rejected chat input → transcript + tool/citation
collab-presence-board ⚠️ Realtime + DistributedTable join/listPresent; name-keyed dedupe, verbatim/unicode round-trip, blank rejected, multi-visitor persistence disabled control, XSS-as-text, reload restores, 1 realtime 2-context fan-out

Left as-is (already API-first): observability-api (gold standard), email-digest (API-first hybrid).

Flagged — not fully framework-focusable

  • ⚠️ oidc-dsql-notes, cognito-profile — MODERATE. Auth flows (OIDC redirect, email-OTP) are intrinsically multi-view DOM; core data ops moved to api, but sign-in stays a DOM smoke. OIDC stub IdP is single-subject, so cross-user isolation isn't demonstrable → tests auth gating instead.
  • ⚠️ collab-presence-board — PARTIALLY-DOM. Realtime fan-out genuinely needs two browser contexts; that ONE check stays DOM. Everything else (roster persistence/dedupe/verbatim/validation) moved to api.

Validation

  • tsc --noEmit (Playwright types) on all 10 specs → clean.
  • Deep E2E on async-word-counter: real reference solution (AsyncJob+KVStore) scaffolded from the bare template, run against the dev server → 12/12 pass (10 api-first core + 2 DOM smoke).
  • Changeset: tasks/** is not a publishable package → changesets status and verify-changeset-coverage.ts both pass with no changeset.

Do not merge — opening for review.

Comment thread tasks/async-word-counter/test.spec.ts
Comment thread tasks/async-word-counter/test.spec.ts Outdated
…ng-state smokes, add changeset

- #11 dead OTP-gate else: cognito-profile's api.getLastCode test dropped the never-executed `else` (bench always runs BLOCKS_MOCK=true) and documents the production gate is prompt-enforced but grader-unverified; keeps the live mock-mode assertion
- #12 restore auth-notes DOM XSS smoke: saved <b>/<i> markup must render as literal text (note-display .locator('b')/('i') toHaveCount 0), alongside the api round-trip equality
- #13 restore async-word-counter enqueue-time persistence: a job must be readable as status 'processing' the instant it is enqueued (getJob + listJobs), matching PROMPT lines 3/19/22/32, then resolves to done
- #14 fix stale async:129 comment (reuses the request fixture, not a new context)
- add empty-frontmatter changeset so the required 'Require changeset' check passes (internal bench/task content only, no packages/* change)
soberm
soberm previously approved these changes Jul 13, 2026
ahmedhamouda78
ahmedhamouda78 previously approved these changes Jul 13, 2026
…-focus

# Conflicts:
#	scripts/agent-bench/steps/3-build-and-test.sh
@changeset-bot

changeset-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4dfd91b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

The post-enqueue read asserted status === 'processing' with a null count,
which flakes against a legitimately-fast reference impl whose background
job finishes before the read. DONE (20s) is a poll CEILING, not a floor,
so accept 'processing' | 'done' for the immediate read (require null count
only while 'processing'). The listJobs still-processing surfacing and the
final countOf() === 5 assertion are unchanged.
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.

3 participants