mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
Coding sessions need a native way to keep working until a stated completion condition is actually met. This adds a CLI /goal command, goal state and evaluator logic, and a headless-safe command filter so interactive and print-mode runs can both start a goal and continue when the evaluator says more work remains. Constraint: The evaluator must work with saved third-party provider runtimes that may reject structured output schemas. Constraint: Completion evidence must come from visible transcript text, not hidden goal prompts or assistant thinking blocks. Rejected: Implement /goal as a bundled skill only | it would not own the query loop or support native continuation semantics. Rejected: Expose all local-jsx commands to headless mode | interactive UI commands would become available in print mode. Confidence: high Scope-risk: moderate Directive: Keep /goal evaluator evidence scoped to visible transcript text before adding richer completion signals. Tested: bun test src/commands/headless.test.ts src/goals/goalState.test.ts src/goals/goalEvaluator.test.ts Tested: bun run check:server Tested: bun run verify Tested: Real provider /goal smoke with MiniMax-M2.7-highspeed, including a two-turn continuation that logged Goal continuation #1 and completed with GOAL_SMOKE_LOOP_DONE. Not-tested: Durable cross-process goal persistence for resumed sessions.