Skip to content

Add the tasks eval and fix the eval graph capture (#3763) - #3783

Merged
malibio merged 6 commits into
mainfrom
issue-3763-agent-eval-task-scenarios
Oct 13, 2026
Merged

malibio merged 6 commits into
mainfrom
issue-3763-agent-eval-task-scenarios

Conversation

@malibio

@malibio malibio commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds bun run eval:tasks: five end-state-graded scenarios for the Creating a Task and Answering a Question procedures, on a seeded entity-tier workspace (project, three people with the owner as "me", tasks assigned through person.tasks, an accepted decision, a done task with an unticked box, a question task waiting on the owner). The daemon seeds the queues and skills itself; the fixture adds instance data only.

Scenario Pass condition (graph, not wording)
bug-created-ready one new task with a text brief, unticked checkbox(es), its project, open and unblocked; the reported task untouched
bug-not-reproducible nothing written
declined-request nothing written (the accepted decision declines it)
question-blocks-task one new task assigned to the owner of the answer, blocking the stopped task, which is left unchanged
answer-asks-user nothing written, and the reply names the waiting question

Harness defects found and fixed on the way

Three pre-existing defects made every end-state verdict in graph.ts-graded fixtures (including eval:agent) vacuous. Verified by a first run in which a task the agent said it created was absent from the recorded diff.

  • captureSnapshot read schema ids from a nodes array; schema list emits schemas. No type was ever queried, so expectNoWrites passed over every write and createdNode could never pass. The reader now lives once in graph.ts (decisions fixture imports it).
  • The per-type query limit was 200 while a fresh database seeds 300+ text nodes, so a written note fell off the list. Limit raised, and a type that fills it now fails the capture.
  • A fixture-named relation (assignee, blocks, ...) errors on node types that do not declare it. Only that refusal is tolerated; any other failure still fails the capture.

The runner now also checks at the start of each rep that the snapshot sees schemas and nodes, and aborts on the first capture failure rather than scoring it as a model failure. graph.relations is a new optional fixture field. Seed CLI helpers shared with the grounding fixture moved to fixtures/seed-helpers.ts.

Any eval:agent baseline recorded before this was measured under the blind capture and should not be compared against.

Baseline (E4B, gemma-4-e4b-q4km, 3 reps, purged daemon between reps, commit 8e5bf74)

pass^3: 1/5. Per rep 1/5, 1/5, 1/5. Contention checked before launch (no other generative model resident; some CPU load from another build, see latency note).

Scenario Reps What the agent did
bug-not-reproducible 3/3 tried create_node, which errored every rep; passes because the write was refused, not because the agent held back. A weak pass
bug-created-ready 0/3 rep 1: get_node only. Reps 2-3: ran to the 240s turn limit, with an update_node that added a stray property to the project
declined-request 0/3 created the task every rep, one create_node, no search for a decision
question-blocks-task 0/3 create_relationship with no question task created (first call errored); rep 2 also changed a task
answer-asks-user 0/3 search_semantic only; never found the waiting question and asked for context

Known gaps (recorded, procedure text not changed)

The failures are not wording of the procedures. For all five prompts the routed skill list led with generic Graph Editing / Node Creation / Schema Creation, with Creating a Task or Answering a Question present only as a lower-ranked candidate (or absent: bug-created-ready routed to Implementing a Task), and the agent did ad-hoc graph edits instead of following the procedure. Rewording a shipped skill description to win these prompts would be tuning to the eval, so it is left as a measured gap. The next step is a routing or resident-prompt change evaluated against the whole confusion matrix, not edits here.

Not covered: the Codex/other-harness runs; the guidance read-back (guidance seeded: none found) is a separate pre-existing gap, node query no longer exposes _seed metadata, so provenance cannot be read back (the daemon under test was a fresh build of this branch).

Latency note: bug-created-ready hit the 240s turn limit in 2 of 3 reps while a workspace build ran on the same machine, so those two turns may be shorter-limit artifacts; the scenario also failed in the rep that did not time out.

The runbook entry (development/agent-eval.md) is updated in nodespace-docs, including the filtered RUST_LOG that keeps the daemon log from rotating several times inside one turn.

Test plan

  • bun run test:scripts (1519 pass), including unit tests for each scenario's scoring, the fake-CLI capture tests, and the schema-list shape
  • guidance_is_not_contaminated_by_eval_prompts
  • one-rep smoke on two writing scenarios, audited against replies and recorded tool calls, before the 3-rep
  • 3-rep baseline, all five scenarios
  • one full eval:agent smoke run under the corrected capture (pending)

🤖 Generated with Claude Code

@malibio

malibio commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

Known gaps from the baseline are tracked in #3784.

@malibio

malibio commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

Code Review Summary

Verdict: REQUEST CHANGES (one blocker, small fix; everything else is solid).

The change does what #3763 asks: it adds a graph-graded eval:tasks fixture with one scenario per bullet, and it fixes three real capture defects in the shared harness (schema list read from nodes instead of schemas, a 200-node truncation, an unhandled "relation not declared" refusal). Scoring is outcome-based and wording-independent, the id comparison is prefix-safe (same() strips nodespace:// on both sides), module-level seeded is set by seedGroup before any scoring and guarded by !seeded, and the canary/abort logic is correct for every other graph-graded fixture (the daemon always seeds schemas and skill text nodes, so a legitimate zero-node database does not occur; edgesFor: () => false keeps it cheap). The relation tolerance is narrowly scoped as claimed. No AGENTS.md violations found (no suppression, no any, no raw console, no issue numbers in comments, no compat code; check-node-type-literals passes).

Findings

Critical Issues

  • scripts/eval/graph.ts, QUERY_LIMIT = 5000 and its truncation guard: the daemon silently clamps this to 500, so the guard can never fire and the original bug is only half fixed. node query calls QueryNodesSimple, which applies (req.limit).min(MAX_ROW_LIMIT) where MAX_ROW_LIMIT = 500 (packages/daemon/src/services/node_service.rs:110; the doc comment there says explicitly "The clamp is silent: a truncated response looks exactly like a complete one... a client distinguishing the two compares the row count against this value"). So a request for 5000 returns at most 500 rows, listed.length >= 5000 is unreachable, and a type with more than 500 nodes (fresh text is already "a few hundred" by the PR's own comment, ordered created-ascending, so the newest node is the one dropped) is still read short with no error: precisely the failure the new comment says is now impossible. The "type that fills the limit now fails the capture" claim is false as written.
    Fix: use 500 (mirror MAX_ROW_LIMIT) and either page with --offset until a short page, or throw when listed.length >= 500. Paging is better since the text type will sit near the ceiling. Add a fake-CLI test where the stand-in returns exactly 500 nodes (and one where it pages) so the guard is exercised; the current tests never reach it, which is how this went unnoticed.

Suggested Improvements

  • scripts/eval/fixtures/tasks.ts, scoreQuestionTask / "keeps its status and assignee": the assignee clause is not actually checked. A task's assignee is the derived inverse of person.tasks, so re-assigning the stopped task changes an edge on a seeded node. The diff only reports changed node content/properties, seeded nodes are not walked for edges (edgesFor is group-created nodes only), and removed edges are not tracked at all. An agent that moves "Draft the vendor contract" to Anoop passes. Either walk the stopped task's assignee in before/after (e.g. let a fixture name seeded ids to always walk) or drop "assignee" from the failure text and the header so the scenario claims only what it measures.
  • scripts/eval/fixtures/tasks.ts, scoreAsksUser: passes on "no writes + reply names the subject + ? anywhere in the reply". A reply that answers the question itself and ends "Anything else?" passes, which is the failure the issue names ("never answers it itself"). The test even enshrines it (turn("Done. Anything else?", ["create_node"]) only fails because of the write). Prefer requiring route_clarify (or the ask tool the procedure names) as the pass condition, falling back to the ? heuristic only as a diagnostic.
  • scripts/eval/runner.ts, abort on capture failure: converting a post-turn capture error into an EnvironmentError is the right call for a systematic defect, but it also aborts a multi-hour multi-rep run on one transient daemon hiccup and discards earlier reps. Acceptable given the explicit failure-text, but worth confirming partial results of completed reps are still written before the abort.
  • Tests: the runner canary and the new abort path have no test (pure helper extraction of the "blind" decision would make it trivially testable); the fake-CLI tests leak temp dirs (no cleanup) and depend on /bin/sh case globbing on joined args, which is fine on macOS but brittle if an arg order changes.

Nitpicks

  • Nit: tasks.ts n.node_type === "decision" / === type and WORK_TYPES compare exact types; it passes the literal checker (scripts are not scanned), but isA semantics would be consistent with the AGENTS.md rule if a task subtype ever lands.
  • Nit: no-writes clauses are graded by expectNoWrites, which only sees edges on group-created nodes; an edge added between two seeded nodes with no new node is invisible. Low risk for these prompts; note in the header if intentional.
  • Nit: the eval runbook in nodespace-docs should list eval:tasks; not verifiable from this repo.

Requirements check (#3763)

Seeding the entity tier and one scenario per bullet with wording-independent outcomes: met. Baseline recorded as 3 reps; full smoke run deliberately skipped by the author; failing scenarios tracked in #3784. Not re-reported here.

Recommendation

REQUEST CHANGES. Fix the QUERY_LIMIT clamp (500 + paging or a >= 500 guard, with a test); it is a one-line-class fix and is the only thing standing between this and approval. The assignee-clause and asks-user strictness items are strongly recommended in the same pass.

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review posted above. Verdict: REQUEST CHANGES. Blocker: QUERY_LIMIT=5000 is silently clamped to 500 by the daemon (MAX_ROW_LIMIT), so the truncation guard never fires and a type over 500 nodes is still read short.

@malibio

malibio commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

Review addressed (commit 86fc712)

Addressed

  • 🔴 Query limit. Verified: the daemon clamps node query to 500 rows silently, so --limit 5000 returned at most 500 and the truncation guard never fired. A type is now read a page at a time with --offset until a page comes back short; a later page that fails, or a type past 100 pages, fails the capture. Fake-CLI tests cover multi-page, exactly-one-page, and a failing later page.
  • 🟡 Transient capture failure. One retry of a capture that failed, so a single CLI hiccup does not void a multi-rep run. A defect fails twice and still voids it.
  • 🟡 Canary untested. The blind-snapshot decision is now a pure helper (snapshotBlindness) with tests.
  • 🟡 Temp dirs. The fake-CLI directories are removed after the file.
  • 🟡 Assignee claim. The question-task scoring no longer says the stopped task's assignee is asserted. It is not, and the fixture header and failure text now say so.

Skipped

  • Requiring route_clarify in answer-asks-user: it is in the tool surface only when the right skill leads, so the scenario would be unwinnable and would count routing twice. A reply that answers in prose records nothing, and the scenario already fails on any write.
  • Asserting the stopped task's assignee: needs removed-edge tracking in the shared diff and a walk of seeded nodes. Revisit if a scenario needs it.
  • Exact node_type comparisons in the fixture and seeded-to-seeded edges: fixtures assert concrete types the way tests do; the second is a documented limit.
  • Partial results on abort: left as is (an aborted run writes no results file).

Scripts tier: 1526 pass. quality:fix clean.

Re-Review Decision

Decision: RE-REVIEW NEEDED

Rationale: The critical finding was fixed with new logic in the shared harness (paging, a retry, a new exported helper), not a wording change, and it is the same code that every graph-graded fixture runs through.

🤖 Generated with Claude Code

@malibio

malibio commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

Re-Review (commit 86fc712)

Review Type: Re-Review

Previous recommendations

  • Query limit clamp (blocker): ADDRESSED. QUERY_PAGE=500 matches MAX_ROW_LIMIT; --offset is passed (packages/cli/src/commands/node.rs:347,811) and the daemon applies limit.min(500) plus offset over the always-deterministic default CreatedAsc order (node_service.rs query_nodes_simple, order_by_from_proto), which its own comment says tiles the set exactly once. Termination listed.length < QUERY_PAGE is right for one short page, exactly one full page (one extra empty page, then stop) and multi-page. seen dedupe still guards overlap between sibling types. MAX_PAGES=100 (50k nodes) throws rather than reads short. Cost: a fresh DB (~300 text nodes) is one call per type, unchanged.
  • Transient capture failure: ADDRESSED with one retry in runner.ts. Cannot mask a defect (same failure twice still voids); worst case doubles cost of an already-failing capture, negligible.
  • Canary untested: ADDRESSED. snapshotBlindness is byte-for-byte the same decision order (captureError, no schemas, no nodes) and messages as the inline code; the runner still throws EnvironmentError on non-null. Four tests added.
  • Temp dirs: ADDRESSED. Assignee claim: ADDRESSED (comment and failure text now accurate).
  • Skipped items: justified. route_clarify is only offered when the right skill leads, so requiring it double-counts routing and is unwinnable; assignee needs removed-edge tracking; exact node_type and seeded-to-seeded edges are documented limits; an aborted run writing no results is acceptable.

New issues

None blocking.

  • Improvement (non-blocking, pre-existing shape): a transient failure on the FIRST page of a real type (e.g. text) is still swallowed by the catch { continue; }, so it yields no captureError, is not retried, and drops the whole type. The canary only catches the all-types-blind case. Distinguishing "type does not exist" from a transport error (or checking the type is in schemas before tolerating) would close this; later pages are already strict.
  • Nit: fixture.graph?.types ?? [] in capture is only reachable when fixture.graph is set; passing fixture.graph into the helper (or narrowing once) removes the fallback.
  • Nit: the "exactly one page" test passes but a count of exactly 2x the page is not covered; the failing-later-page test incidentally exercises it.

Recommendation

APPROVE. The blocker is fixed correctly and tested; the remaining items are optional polish.

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Re-review verdict: APPROVE. Query paging blocker fixed and tested; only non-blocking suggestions remain (see comment above).

@malibio

malibio commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

Re-review addressed (commit 9c81536)

Addressed

  • 🟢 First-page failure swallowed. A transient failure on the first page of a type the schema list names dropped the whole type with no capture error. Only a type the schema list does not name may now be absent; a failure on a named type fails the capture. Test added.
  • Nit: removed the fixture.graph?.types ?? [] fallback; the capture helper returns nothing for a fixture that does not grade on the graph.
  • Nit: added a paging test for exactly two pages, and one for a failing first page.

Scripts tier: 1529 pass. quality:fix clean.

Re-Review Decision

Decision: NO RE-REVIEW NEEDED

Rationale: The reviewer approved the previous commit. This one only narrows a tolerance toward stricter (a failure that was swallowed now fails the capture), is covered by two new tests, and otherwise removes a fallback and adds tests.

🤖 Generated with Claude Code

@malibio

malibio commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

Note on the baseline

The 3-rep baseline above was measured on the previous scenario content (a vendor contract, a launch invite, a pricing page, an offline mode request). Commit b857449 rewrites that content to developer-workflow subjects (a query engine rewrite with a migration guide, a release branch, an index design, and a declined GraphQL API), following the decision to keep eval content on the dev-workflow use case. Scoring, ids and the shape of every scenario are unchanged and covered by the same unit tests.

The numbers describe the old wording and have not been re-measured on the new one. A 1-rep confirmation on the rewritten scenarios will be posted on the issue once this lands, because another PR's gate is holding the GPU and the contention check does not pass yet.

Review: re-review APPROVE on 86fc712; the follow-up commits (9c81536, b857449) only tighten a tolerance, add tests and change eval wording.

malibio and others added 6 commits October 13, 2026 14:03
…on the graph (closes #3763)

Five end-state scenarios on a seeded entity-tier workspace: a visible bug becomes a ready task, an unseen one writes nothing, a declined request creates nothing, a stopping question becomes a task for its owner blocking the stopped task, and a waiting question is put to the user. The graph capture walks the type-declared relations a fixture names, and the seed helpers are shared with the grounding fixture.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…loses #3763)

captureSnapshot read schema ids from a nodes array that schema list does not emit, so no type was ever queried and every nothing-was-written clause passed vacuously. It also pulled 200 nodes per type, fewer than the text nodes a fresh database seeds, so a written note fell off the list. The schema reader now lives in graph.ts, the limit is raised, and a type that fills it fails the capture. The waiting-question scenario now requires the reply to name the question.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…eclared relations (closes #3763)

A run now checks at the start of each rep that the snapshot sees schemas and nodes, and aborts on the first capture failure instead of scoring it as a model failure. The relations a fixture names are skipped on node types that do not declare them; any other relationship failure still fails the capture.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…lamp (closes #3763)

- The daemon clamps a node query to 500 rows without saying so, so the 5000 limit and its guard never fired. A type is now read a page at a time by --offset until a page comes back short; a later page that fails or a type past 100 pages fails the capture.

- One retry of a capture that failed, so a single CLI hiccup does not void a multi-rep run; a defect fails twice and still voids it.

- The blind-snapshot decision is a pure helper with tests, the paging has fake-CLI tests (including a failing later page), and the fake CLI temp dirs are removed.

- The question-task scoring text no longer claims the stopped task's assignee is asserted; it is not (an edge on a seeded node, which is not walked).

Skipped: requiring route_clarify for the asks-user scenario (it is only in the tool surface when the right skill leads, so it would be unwinnable and count routing twice); exact node_type comparisons in the fixture (fixtures assert concrete types like tests do); edges between two seeded nodes (documented limit).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ema names

A transient failure reading the first page of a real type dropped the whole type from the snapshot with no capture error, so its writes went unseen. Only a type the schema list does not name may be absent now. Also removes the optional-chaining fallback in the runner's capture helper and adds paging tests for exactly two pages and for a failing first page.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The seed and prompts named a vendor contract, a launch invite and a pricing page, and a graph test used an invoice type, against the decision to keep eval content on NodeSpace's dev-workflow use case. The workspace is now a query engine rewrite with a migration guide, a release branch, an index design and a declined GraphQL API; scoring is unchanged. The predicted-type paging test now has the fake CLI refuse the type, so it reaches the tolerance branch it names.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@malibio
malibio force-pushed the issue-3763-agent-eval-task-scenarios branch from b857449 to 1b6daf7 Compare October 13, 2026 12:03
@malibio
malibio merged commit cc1dba3 into main Oct 13, 2026
@malibio
malibio deleted the issue-3763-agent-eval-task-scenarios branch October 13, 2026 12:04
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