Skip to content

Add a live check that a document given to create_node becomes a titled record with its body below it - #4278

Merged
mstomar125 merged 2 commits into
mainfrom
issue-4237-live-create-document
Nov 16, 2026
Merged

mstomar125 merged 2 commits into
mainfrom
issue-4237-live-create-document

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Adds an ignored live test (live_create_node_document) that measures, on a small local model, what the agent's create_node does with a markdown document: one turn on the real production tool definitions over a real store, three repetitions of four scenarios. It asserts what the store holds afterwards, never what the tool returned: the root's type, its single-line title without the heading marker, and the number of nodes below it.

Scenarios: a task given as a document (with the three write tools offered), the same task with create_task withheld so the document form of create_node is the only route, a decision, and a spec with three sections.

Result on CPU (gemma-4-E4B Q4_K_M, 4 threads, 3 repetitions each): 12 of 12 created the right record. The model uses create_task for a task when it is offered (type issue, title, brief and three checkboxes) and the document form of create_node otherwise. No tool wording was changed.

The test changes no product code. It needs the CPU-only environment described in live_small. bun run test:changed passes locally and clippy with warnings as errors is clean.

🤖 Generated with Claude Code

@mstomar125

Copy link
Copy Markdown
Contributor Author

APPROVE (head c547485), with non-blocking nits.

Verified by reading the diff, live_small.rs, the sibling live tests, AGENTS.md and the node-type-literal rule. I did not compile or run anything.

  1. Gate safety: #[ignore] is present (reason text identical to golden_scenario6_*). Without --ignored nextest never runs it. With --ignored, load_engine/require_cpu_only panic with a clear message if NODESPACE_FORCE_CPU or NODESPACE_LIVE_CHAT_MODEL is unset. A missing model path fails the load loudly. Generation is capped at 1024 tokens, 12 turns total, so it cannot loop forever. Module is registered in tests/it/main.rs alphabetically; no other registration or golden file applies to a test-only module.
  2. Outcome assertions: type, exact title (trim() == "Fix the login redirect loop", so a leading # fails), and a whole-subtree descendant count are read from the store via get_node/get_children, not from the tool result. The withheld variant really withholds: write_tools(WITHOUT_CREATE_TASK) filters the production list before the request, and its allowed types are ["task"] only.
  3. Real tool definitions (all_tool_definitions) and a real SqliteStore/NodeService through GraphToolExecutor are used; no mocks. Only the SYSTEM prompt is hand-written (it stands in for the production loop's prompt and can drift; it is stated in the comment).
  4. Nothing machine-specific is hardcoded; no ticket numbers, no #[allow]; output goes through println! like the sibling live tests. There is no node_type == "<literal>" comparison (only contains(&...) against a slice), so check-node-type-literals should pass.
  5. The PR body (3 reps, 4 scenarios, 12/12) matches the constants (REPS = 3, 4 SCENARIOS).

Non-blocking nits:

  • The module doc (lines 17-21) says "Three scenarios" and lists three, but there are four. The withheld-create_task variant is missing from the list. The "split issue" scenario asks for a spec, so its label is a misnomer.
  • The module doc and the issue ask for child counts and types. Only the count is asserted. Child types are printed but never checked, so a document that becomes N nodes of the wrong type still passes.
  • The final assert! is only sum > 0. This is a measurement test: a regression to 1/12 still passes and is visible only in the LIVE SUMMARY lines. That is acceptable if stated, but the doc comment should say there is no pass threshold. It currently states reps but no threshold.
  • The doc header lists NODESPACE_LIVE_EMBED_MODEL, but this test never loads the embedder, so the variable is not needed.

Could not verify: compilation or clippy of this exact head, the 12/12 result (needs the model), and that test:changed passed (taken from the PR body).

@mstomar125

Copy link
Copy Markdown
Contributor Author

Review nits addressed in 653767b, a new commit on the PR branch (no force-push):

  1. The module doc now says four scenarios and lists the withheld create_task variant.
  2. The third scenario is renamed 'spec with three sections'.
  3. Each repetition is also scored on the child TYPES (the root's direct children must include the expected types: text for the two tasks, text + header + header for the decision, three headers for the spec), besides the type, the title and the nodes below.
  4. The final assertion is now per scenario: at least 2 of 3 repetitions must create the right record (MIN_PASSES), and the module doc states the threshold. The run no longer passes on a single success.
  5. NODESPACE_LIVE_EMBED_MODEL is removed from the module doc; the test only loads the chat model.

Re-run on CPU (gemma-4-E4B Q4_K_M, 4 threads) with the stricter assertions: 12 of 12 repetitions pass (3/3 in each of the four scenarios). quality:fix is clean and bun run test:changed passes locally (an earlier attempt hit a rustc abort under load in shape:check, rerun clean).

mstomar125 and others added 2 commits November 16, 2026 09:54
…d record with its body below it

One turn on the real production tool definitions over a real store, three repetitions of each scenario (a task, a decision and a spec given as markdown documents, and the task again with create_task withheld). It asserts what the store holds: the root's type, its single-line title without the heading marker, and the nodes below it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…equire two of three repetitions

The module documentation now lists all four scenarios and drops the embedding model it never loads, the third scenario is named for what it is, each repetition also has to produce the expected child types, and the run fails when any scenario creates the right record in fewer than two of its three repetitions.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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