Repository navigation
fix(runtime): seal authority selectors for prompts rendered at runtime - #1253
mrthankyou wants to merge 1 commit into
Conversation
#1234) A planned task behind a dynamic group has its prompt rendered at runtime, so it was compiled without promptArtifactAuthoritySelectors and materializePromptArtifactAuthority never wrote the authority file its prompt names. On the stock default topology this hit dedupe-findings, aggregate-test-files and final-report. Derive those selectors at compile time from the sealed template copy the runtime render reads, so the sealed manifest stays the single source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| assert.ok( | ||
| (joinTask.promptArtifactAuthoritySelectors ?? []).length > 0, | ||
| "the task that the prompt points at an authority file must carry the selectors that write it" | ||
| ); | ||
| }); |
There was a problem hiding this comment.
Authority file remains untested The test confirms that the rendered prompt names an authority file and that the task has a selector, but the fixture never runs the join task that writes the file. A selector for the wrong output, or a failure to resolve the expanded group’s artifacts, could still pass this test. Please exercise that path and check that the task-local authority JSON contains the selected
plan.json output.
Knowledge Base Used: Runtime orchestration
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/runtime/test/dynamic-lifecycle.test.ts
Line: 1085-1089
Comment:
**Authority file remains untested** The test confirms that the rendered prompt names an authority file and that the task has a selector, but the fixture never runs the join task that writes the file. A selector for the wrong output, or a failure to resolve the expanded group’s artifacts, could still pass this test. Please exercise that path and check that the task-local authority JSON contains the selected `plan.json` output.
**Knowledge Base Used:** [Runtime orchestration](https://app.greptile.com/monad-foudnation/-/custom-context/knowledge-base/monad-developers/ultrafuzz/-/docs/runtime-orchestration.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
Thanks. The root cause is right: deferred-join tasks get no authority selectors, so the authority file their prompt names is never written. Deriving the selectors from the sealed template copy also looks correct. But merging this as-is makes the default profile worse, so we're leaving it open for now. Here's the problem. What breaks. Once ( Repro. In the
Impact. On a default-profile run where any goal child succeeds, What a fix needs. Authority for tasks with dynamic dependencies has to be derived from a manifest that includes the runtime closure. One option is the dynamic task plan re-derived from the sealed base controls plus the digest-bound expansion manifests. The launch snapshot alone isn't enough. Until then, those tasks shouldn't get selectors. Related, and pre-existing: |
|
Agreed on the regression; holding this open. I confirmed the path on this branch. A snapshot-launched engine resolves Proposed rework, not started yet:
Not proposed: leaving selectors off tasks with dynamic dependencies until (2) lands. That would make this PR a no-op for The |
|
Thanks for the detailed follow-up. Your diagnosis is right. I'm closing this, though: we've decided to remove the sealing machinery, and both this PR and the proposed rework build on it (selectors resolved against the sealed base controls and digest-bound expansion manifests). I've rescoped #1234 to a simpler fix: write the prompt input index from the live task plan for every task, and delete the authority seal checks. Thanks for the careful work here. |
|
Superseded by #1285, which implements the rescoped #1234: the prompt input index is written for every task from the live task plan, and the sealed authority selectors are deleted. Your reproduction and diagnosis here shaped it, and its commits credit you as co-author ( |
Fixes #1234.
Problem
A planned task whose prompt waits on a dynamic group is rendered at runtime, not at plan time. Authority selectors were computed only from plan-time renders (
promptArtifactAuthoritySelectorsFor), so these tasks were compiled with none.materializePromptArtifactAuthoritythen returned early, and the authority file the prompt names (.ultrafuzz/authorities/<attempt>.json) was never written.On the stock
defaulttopology this affects:dedupe-findings, which names 3 authorities;aggregate-test-files, which names 1;final-report, which names 2.The goal-group templates name no authorities, so generated children are not affected. Smoke-profile runs have no dynamic groups and were unaffected.
Change
smithers.ts: a selector depends only on its placeholder (a contract ID, or a path list and its selector ID), not on the expansion. For a task with a deferred prompt,promptArtifactAuthoritySelectorsForTemplatetherefore derives the selectors at compile time from the sealed template copy thatrenderReadyRuntimePromptsreads. It usesextractPromptVariablesand keys selectors exactly as a rendered prompt does.Not in this PR
#1237's prompt refresh still publishes runtime prompts without checking their authorities against the compiled selectors (Greptile's declined P1 there). Those tasks now have a compiled set, so that check can be added as a follow-up.
Verification
dynamic-lifecycle.test.ts): a planned join behind thefanoutgroup uses{{ancestor_artifact_path_authority:plan.json}}. The test asserts that its runtime-rendered prompt names the authority file and that the task carries selectors.unstable(reproduced on Linux and macOS) and passes here.runtime.test.ts,resume applies an edited stock review prompt that names artifact authorities once its groups expanded): it now asserts 3, 1 and 2 selectors ondedupe-findings,aggregate-test-filesandfinal-report, and its Write the prompt input index from the live task plan; delete the sealed prompt-artifact authority binding #1234 comment is corrected.node:24-bookworm, Bun 1.3.14), 0 failures in both:dynamic-lifecycle,dynamic-workflowanddynamic-expansiontest files: 48 of 51 passed;runtime.test.tstests matchingauthorit|prompt|refresh|dynamic|selector|deferred: 37 of 40 passed, 3 skipped.runtime.test.ts, which is left to CI.🤖 Generated with Claude Code
The PR appears safe to merge; an end-to-end authority-file assertion would strengthen the regression coverage.
Fix with agent prompt
Summary
The PR compiles authority selectors from sealed templates for prompts deferred until dynamic groups expand, and adds regression assertions for a dynamic join and the stock topology.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Sealed deferred template] --> B[Compile authority selectors] B --> C[Expand dynamic group] C --> D[Render join prompt] C --> E[Publish tasks with child dependencies] D --> F[Execute join] E --> F F --> G[Derive and write task-local authority JSON]Reviews (1) · Last reviewed commit: "fix(runtime): seal authority selectors f..."