-
Notifications
You must be signed in to change notification settings - Fork 289
fix(native): relay loop-stop decisions and survive stale children indexes #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
ddde9bf
76c48d4
4222402
5a03d75
8959dc4
9f83337
54a878e
4bbc7be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "version": "0.4.0-rc.1", | ||
| "version": "0.4.0-rc.2", | ||
| "skills": [ | ||
| "comet/SKILL.md", | ||
| "comet/agents/openai.yaml", | ||
|
|
||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -654,7 +654,10 @@ export function confirmNativeVerifierUnavailable(options: { | |
| }); | ||
| } | ||
|
|
||
| export function resolveNativeVerifierBlocker(stateInput: NativePortableState): NativePortableState { | ||
| export function resolveNativeVerifierBlocker( | ||
| stateInput: NativePortableState, | ||
| options?: { reason?: string; now?: Date }, | ||
| ): NativePortableState { | ||
| const state = parseNativePortableState(stateInput); | ||
| if ( | ||
| state.phase !== 'verify' || | ||
|
|
@@ -670,8 +673,21 @@ export function resolveNativeVerifierBlocker(stateInput: NativePortableState): N | |
| ) { | ||
| throw new Error('Native change is not awaiting resolution of a semantic Verifier blocker'); | ||
| } | ||
| // The user's resolution context is the only place the next Verifier round | ||
| // can learn what information unblocked the semantic judgment, so it must be | ||
| // persisted in history instead of dying with the command invocation. | ||
| const withHistory = appendNativePortableHistory( | ||
| state, | ||
| historyEntry({ | ||
| state, | ||
| outcome: 'recovery', | ||
| summary: | ||
| options?.reason ?? 'Resolved the semantic Verifier blocker and resumed verification.', | ||
|
Comment on lines
+689
to
+690
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an Agent resolves the blocker with a whitespace-only Knowledge Base Used: Native workflow runtime |
||
| completedAt: (options?.now ?? new Date()).toISOString(), | ||
| }), | ||
| ); | ||
|
Comment on lines
+684
to
+693
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 当用户通过 Knowledge Base Used: Native workflow runtime
greptile-apps[bot] marked this conversation as resolved.
|
||
| return parseNativePortableState({ | ||
| ...state, | ||
| ...withHistory, | ||
| status: 'active', | ||
| state_version: nextVersion(state), | ||
| verification_result: 'pending', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -175,6 +175,62 @@ function nativePortableUserCommunication( | |
| }; | ||
| } | ||
|
|
||
| if ( | ||
| state.phase === 'verify' && | ||
| state.status === 'await-user' && | ||
| state.loop.next_action === 'resolve-verifier-blocker' | ||
| ) { | ||
| return state.language === 'zh-CN' | ||
| ? { | ||
| required: true, | ||
| message: | ||
| '验证暂时无法下结论,因为缺少只有你能提供的信息,例如外部系统的真实行为或某个业务决定。你的代码和已经完成的检查都已安全保留。补充所需信息后可继续验证,也可以选择修改实现或调整需求。', | ||
| suggestedReply: null, | ||
| agentInstruction: | ||
| '向用户转述 message,请用户补充缺失的信息,或在继续验证(resolve-verifier-blocker)、修改实现、调整需求之间明确选择,再执行 commandAlternatives 中对应的完整命令。不要把“继续”当作默认选择,也不要展示内部轮次、计数、路径或恢复步骤。', | ||
|
sourcery-ai[bot] marked this conversation as resolved.
|
||
| } | ||
| : { | ||
| required: true, | ||
| message: | ||
| 'Verification cannot reach a verdict yet because information only you can provide is missing, such as the real behavior of an external system or a business decision. Your code and completed checks are safely preserved. Supply the missing information to resume verification, or choose to revise the implementation or the requirements.', | ||
| suggestedReply: null, | ||
| agentInstruction: | ||
| 'Relay message and ask the user to supply the missing information or explicitly choose between resuming verification (resolve-verifier-blocker), revising the implementation, and revising the requirements; run the matching commandAlternative afterwards. Do not treat “Continue” as a default choice, and do not expose internal rounds, counters, paths, or recovery steps.', | ||
|
Comment on lines
+195
to
+198
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When a Verifier needs information from the user, this handoff promises that supplying it will resume verification, but the required Knowledge Base Used: Native workflow runtime |
||
| }; | ||
| } | ||
|
|
||
| if ( | ||
| state.phase === 'verify' && | ||
| state.status === 'await-user' && | ||
| state.loop.next_action === 'await-user' | ||
| ) { | ||
| // The stop path is not persisted separately: no_progress_count >= 3 means | ||
| // the three-non-progressive-results stop, otherwise the failed-iteration | ||
| // budget was exhausted even if every round made progress. | ||
| const stalled = state.loop.no_progress_count >= 3; | ||
| const zhMessage = stalled | ||
| ? '验证已连续三轮失败且未通过的验收场景一直没有减少,本次修改已暂停,以避免在同一个问题上反复循环。你的代码和已经完成的检查都已安全保留。可以让 Builder 换一种修复思路继续,也可以回到需求阶段调整验收项。' | ||
| : '本次修改的验证失败次数已用完配置的预算,因此暂停等待你的决定,而不是自动重试。你的代码和已经完成的检查都已安全保留。可以让 Builder 换一种修复思路继续,也可以回到需求阶段调整验收项。'; | ||
| const enMessage = stalled | ||
| ? 'Verification has failed three times in a row without the unresolved scenarios shrinking, so this change is paused to avoid looping on the same problem. Your code and completed checks are safely preserved. You can have the Builder try a different repair approach, or go back and adjust the requirements.' | ||
| : 'Verification for this change has used its configured failure budget, so it is paused for your decision instead of retrying automatically. Your code and completed checks are safely preserved. You can have the Builder continue with a different repair approach, or go back and adjust the requirements.'; | ||
|
greptile-apps[bot] marked this conversation as resolved.
Outdated
|
||
| return state.language === 'zh-CN' | ||
| ? { | ||
| required: true, | ||
|
greptile-apps[bot] marked this conversation as resolved.
Outdated
|
||
| message: zhMessage, | ||
| suggestedReply: '继续修复', | ||
| agentInstruction: | ||
| '向用户转述 message 和 suggestedReply,等待用户在“继续修复实现”(revise-implementation)与“调整需求”(revise-requirements)之间明确选择,再执行 commandAlternatives 中对应的完整命令。选择继续修复时,要求 Builder 更换修复思路。不要替用户选择,也不要展示内部轮次、计数、路径或恢复步骤。', | ||
| } | ||
| : { | ||
| required: true, | ||
| message: enMessage, | ||
| suggestedReply: 'Continue repairing', | ||
| agentInstruction: | ||
| 'Relay message and suggestedReply, then wait for the user to explicitly choose between continuing the implementation (revise-implementation) and adjusting the requirements (revise-requirements); run the matching commandAlternative afterwards. When continuing, ask the Builder to change its repair approach. Do not choose for the user, and do not expose internal rounds, counters, paths, or recovery steps.', | ||
| }; | ||
| } | ||
|
|
||
| return noUserUpdate( | ||
| localized( | ||
| state, | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a Native change has at least 31 acceptance and spec detail items, this stores the user's blocker answer only in history after those items, while the replacement Verifier receives an unpaged details command and is instructed to read only pages covering
scopeIds. The answer is therefore omitted from the Verifier's context, causing it to block again on the same missing information.Knowledge Base Used: Native workflow runtime