Sprint ai workflow - #8
Open
dang0705 wants to merge 198 commits into
Open
Conversation
added 30 commits
May 31, 2026 17:45
…ns and relevant configurations, integrate care behavior timeline in diagnose follow-up logic
…nts, integrate updated review scope and dispatch role-context policies.
….codex/skills` directory, update references and integrate modular output templates for clarity and maintainability.
…ls definition files for clarity and alignment with modular structure.
…d configuration files
…and add configurable care planner thresholds
…vironmental care calculation details in diagnosis review
…ine `brv swarm query` as an optional capability, clarify boundary rules, and enhance byterover pipeline integration. Add care timeline interface components and event sources.
…ight schema - Added comprehensive unit tests for `daylight-and-d0-weather-cache` and `user-plant-light-schema-contract`. - Introduced e2e test artifacts for diverse visual replay diagnosis with batch processing.
…ions - Implemented `
…constants - Deleted legacy components, including `byterover-install.json`, `CHANGELOG.md`, and unused diagnose-popup constants. - Added dispatch governance validation enforcement and pest-routing logic.
…e routing - Introduced `ensureDiagnosisStartRefactorReady` to improve readiness validation for diagnosis initiation. - Refined diagnosis mode routing to support confidence-based pest mode decision-making. - Updated unit tests to align with modified readiness logic and routing behavior. - Adjusted question package handling for single-candidate evidence cases.
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
- Replace fixed 0.65/0.9 candidate thresholds with 0.60/0.80/0.90/0.95 tiers mapping to 3/2/1/0 question budgets (very_likely keeps 1 optional question) - full profile: low-confidence candidates (>=0.60) now enter question paths instead of falling back to uncertain; uncertain is final fallback only - Support all full modes (yellow leaf, wilting, pest, fungi/mold) not pest-only - Dynamic maxQuestions in buildSpecificPestQuestionPackage driven by tier - 0.90-<0.95: attachLikelyOptionalQuestion adds "很像" result + 1 optional check question (skippable); frontend shows optional entry via existing hasActiveQuestions/questionPackage state - Candidates with all questions locked by visual evidence output candidate result instead of uncertain - nextSteps dedup preserved - Supplementary tests cover single yellow/pest/mold, symptom-only, mode+symptom, multi-mode, confidence boundaries, 3/2/1/0 questions, skip questions, public question dedup, candidates-no-questions
1dd5df4 inadvertently deleted the root .brvspace (BRV binding config) which is outside the handoff allowed paths. Restore it to the origin/trae-test baseline content.
…w tier full profile 下合法 mode_candidates 无论 confidence 高低都进入路由: <0.60 走 low tier(questionBudget=3),不再被丢弃到 uncertain。 pest profile 严格边界不变(仍需证据或单候选 >=0.60)。 同步修正 isCandidateAdmissible 单元测试中与新合同冲突的断言。
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
…ion-choice tier, module split - P1: frontend-response.js optional follow-up no longer dropped by early return - P2: non-pest direct routes (powdery_mildew etc) no longer dropped in orchestrator - P2: direction-choice runtime passes confidenceTier/questionBudget when valid - P2: split diagnosis-mode-router.js (334 lines) and pest-visual-orchestrator.js (454 lines) under 500-line limit - Added unit tests for all three fixes
…ion-flow.js (453) under 500-line limit - Extract pure helpers to diagnosis-direction-choice-helpers.js (376 lines) - Extract mergeQuestionState to question-flow-helpers.js (98 lines) - All exports, direction-choice contracts, and optional follow-up behavior preserved
Co-authored-by: traeagent <traeagent@users.noreply.github.com>
…orchestrator split - Fix 3: 固定题包模式 (yellow_leaf/wilting_droop) 不再走 non-pest direct final, 只有 visual_direct_only 模式可直接结论;orchestrator 的 nonPestModes 过滤增加 isVisualDirectOnlyMode 守卫。 - Fix 4: non-pest direct final 的 outcomeType 改为 problematic(含 visibleOutcomes), 不再使用 diagnosis。 - Fix 5: >=0.95 单虫害候选(direct tier 来自 confidence)通过 directEvidenceLedgerForDirectResult 合成 direct_match 证据,并清空 probableModes, 确保最终文案/置信度/locked evidence 与 direct tier 一致,不再显示"可能是"低置信。 directFromConfidence 守卫确保该逻辑仅在无 evidence-based direct match 时生效, 避免把 evidence 直达场景下的 confirmation 候选错误提升为 direct。 - 拆分 pest-visual-orchestrator.js (>500 行):将 buildRetakeRequest 移至 pest-route-helpers.js(482 行 / 218 行,均低于 500 行限制), 顺手移除 helpers 中未使用的 PEST_MODE_LABELS 导入。 - 新增 pest-visual-orchestrator-direct-result.mjs 定向回归测试覆盖 Fix 3/4/5。
) 低置信 visual-direct 模式(如 powdery_mildew)此前无论置信度高低都走 direct_result, 导致弱模型猜测越过问诊直接结论。 - diagnosis-mode-router.js: candidateAllVisualDirectOnly 增加 (likelyResult || directConclusion) 守卫,仅 very_likely (0.90-0.95) / direct (>=0.95) 可直接结论; low/medium/high 置信落入 question_package 按 3/2/1 题预算进入可解释路径。 - diagnosis-mode-router-full-tiers.mjs: 更新 0.85 期望为 question_package, 新增 0.55 low 置信回归断言(question_package + budget=3)。
feat(diagnosis-full): unify mode/symptom routing with confidence tiering (re-submit after .brvspace restore)
… anomalies - Added new visual rules for general anomalies, including "powdery_white" and "sooty_mold". - Introduced functions for compiling general visual mappings and anomaly descriptions (`compileGeneralVisualMapping`, `compileGeneralVisibleAnomalyDescriptions`). - Enhanced pest mode routing logic to account for multiple fixed question packages and edge cases. - Updated static and structured workflow rules to support broader anomaly context. - Refined question package handling and reduced default question counts for optimized user flow. - Adjusted watering planner to accurately inject D0 weather context and timezone management for forecasting. - Added support for new watering dose classes with enriched backend normalization and dose inference.
… anomalies - Added new visual rules for general anomalies, including "powdery_white" and "sooty_mold". - Introduced functions for compiling general visual mappings and anomaly descriptions (`compileGeneralVisualMapping`, `compileGeneralVisibleAnomalyDescriptions`). - Enhanced pest mode routing logic to account for multiple fixed question packages and edge cases. - Updated static and structured workflow rules to support broader anomaly context. - Refined question package handling and reduced default question counts for optimized user flow. - Adjusted watering planner to accurately inject D0 weather context and timezone management for forecasting. - Added support for new watering dose classes with enriched backend normalization and dose inference.
…l flow - #1 environment-context-v7: load resolveMlToDoseClass via /opt/utils-first try/catch (MODULE_NOT_FOUND on CloudBase deploy) - #2 weather.js: filter D0 (by diagnosisDate) before slice(0,14) to avoid double-counting D0 and dropping D+14 - #3 useCareBehaviorTimeline: persist default dose (2nd tier) to emitted timeline when user selects watering date but doesn't touch slider - #4 weather-window-service + app.js: resolve and expose locationKey at response top-level so catalog plants can fetch D0 day-file observation - #5 weather-day-file-reader: split 538-line module into paths/timeout/current-weather sub-modules + reader entry (222 lines), all <500 - #6 diagnosis-mode-helpers: filter mode candidates by registry enabled state (reject root_rot skeleton) - #9 diagnosis-mode-router: when directMatches contain both fixed-package and visual-direct-only modes, route to choose_direction (preserve visual direct outcome) - #10 validate-handoff-owner: guard branch prefix check by nonEmptyString to avoid TypeError on malformed handoff - #8 DiagnoseResultStage: replace internal "题包完善中" copy with user-facing root-check advice - #7 by design: diagnosis-mode currentWeather (D0 observation) is intentionally frontend-display only; backend planner uses historicalDays only (forecastDays omitted) Verified: oxlint 0 errors; 12 related unit test files pass.
- #22 P1 pest-visual-orchestrator: question_package branch with empty pestCandidateModes but non-pest visual_direct_only candidate (e.g. powdery_mildew 0.85) now falls through to buildNonPestDirectResult instead of returning zero-question retake
- #23 P2 pest-visual-orchestrator: buildNonPestDirectResult now accepts likelyResult flag, applies 很像 prefix and confidenceLevel='likely' + optionalFollowUp marker for 0.90-<0.95 very_likely tier
- #25 P1 frontend-response: buildFrontendDiagnosisResponse hasActiveQuestionPackage now excludes optionalFollowUp responses, so initial /diagnosis/start likely results preserve finalResult/visibleOutcomes (parity with buildFrontendAnswerResponse)
- #26 P1 WateringReminderSheet: loadWeatherDays now uses plant.careLocation first (with locationKey passthrough) so D0 day-file and forecast come from same source; falls back to userStore.location only when plant has no careLocation
- #27 P2 validate-handoff-owner: push_ref must equal ${remote}/${branch}; trae/ prefix forbidden on push_ref too
- #24 P2 by design: router accepts all candidates for evidence-derived flexibility; 3-question fallback is defense-in-depth for synthetic tests
Verified: oxlint 0 errors; 7 related unit test files pass.
- #72 pest-route-evidence: filter direct tier candidates by confidence>=0.95 when routeResult exposes confidence; fall back to original behavior when confidence is unavailable (router doesn't propagate visualModeCandidates.confidence) - #73 non-pest-direct-result: introduce resolveNonPestCandidateTier, <0.90 candidate keeps uncertainty and goes retake path instead of high confidence - #74 non-pest-direct-result: populate outcomeType/resultId/problemId so session persistence recognizes the direct result - #75 watering-advisor: loadWeatherDays uses plant.careLocation to keep D0 and forecast from the same source - #76 useCareBehaviorTimeline: when hasSelection=true and selectedMl===null (user picked "don't know"), keep null instead of replacing with fallbackMl - #77 pest-visual-orchestrator: split evidence ledger and non-pest direct result into pest-route-evidence.js and non-pest-direct-result.js (521->399 lines) - #78 diagnosis-round-presenter: propagate questions and questionPackage through non-question branch when optionalFollowUp=true so client can render the optional confirmation question on likely results Verification: oxlint 0 errors; pest-visual-orchestrator-direct-result, pest-response-presenter, diagnosis-mode-router (full/full-tiers/standard), refactor-readiness, result-formatter, diagnosis-handlers, care-behavior-payload, watering-reminder-reopen-cache, watering-reminder-v21-schema-contract, water-volume-format-frontend unit tests pass.
…l flags + file splits Round 4 review comments (commit e0682a5): #24 (P2) frontend-response.js: preserve optionalFollowUp/likelyResult/ questionPackage in buildFrontendDiagnosisResponse terminal branch so initial 0.90-<0.95 likely results carry the optional confirmation question instead of being rendered inactive by the client. #25 (P1) DiagnoseResultStage.vue (531->169): extract question-package swiper + additional-image section into DiagnoseQuestionPackageSection.vue (385 lines), both below the 500-line ceiling. #26 (P1) question-flow.js (512->448): extract environment weather window orchestration into question-weather-window.js (103 lines) composable. #27 (P1) WateringReminderSheet.vue (529->429): extract weather/planner coordination into useWateringReminderPlanner.js (165 lines) composable. #28 (P1) watering-advisor.vue (504->445): extract weather window loading + plannerLocationKey into useWateringAdvisorWeather.js (89 lines) composable. Updated contract tests (diagnose-flow-contract, watering-reminder-reopen-cache, watering-d0-injection-contract) to assert against the extracted modules per the unit mirror convention.
- DiagnoseQuestionPackageSection.vue: normalize the chained </text\n></view closing pattern around the question-package swiper into one-tag-per-line form so the v-else (empty-question) block stays adjacent to its v-if (currentQuestion) for the Vite Vue plugin. - question-weather-window.js: isLightEnvironmentQuestion is exported from @/utils/light-environment.js, not care-behavior-timeline.js; fix the import to match the original question-flow.js source.
…estionPackageSection IDs #15 (P1): watering-d0-injection-contract.mjs asserted the old normalizedForecastDays.slice(...) spelling, but the implementation (fix for review #2) now filters D0 first as forecastDaysWithoutD0 then slices. Update the assertion to match, plus assert the D0 filter step. #16 (P1): DiagnoseQuestionPackageSection.vue was extracted from DiagnoseResultStage.vue (review #25) carrying ~20 popup interaction IDs (prev/next, risk consent/skip, options, collapse, upload slots, remove, clear, blocked, etc.) that were never registered. Add a D.1 subsection to frontend-automation-id-policy.md mapping each ID to the new file.
…s + outcome keys #13 (P1): diagnosis-mode-router.js return object now exports normalizedModeCandidates (with per-candidate confidence) so directEvidenceLedgerForDirectResult and resolveNonPestCandidateTier can filter by confidence instead of falling back to promoting all candidates. #18 (P2): non-pest-direct-result.js visibleOutcomes entries now carry outcomeKey + problemKey = modeKey, matching finalResult/topProblem, so resolveOutcomeIdentityKey no longer falls back to a synthetic outcome_N key. #17 (P1): buildNonPestDirectResult now accepts modeKeys (array) instead of a single modeKey. When multiple high-confidence non-pest modes match (e.g. powdery_mildew + sooty_mold), all are emitted as visibleOutcomes / candidateModes; finalResult/topProblem take the highest-confidence mode; directionChoices subdivision entry is attached and routePrimaryAction set to choose_direction. resolveNonPestCandidateTier accepts modeKeys array. Both orchestrator call sites updated. #14 (P2): no code change - optionalFollowUp retained as future entry point; hasActiveQuestions=false is correct when no real question exists. Will be explained in the PR reply. Tests: added #13/#17/#18 regression cases to pest-visual-orchestrator-direct-result.mjs (router exports normalizedModeCandidates; multi non-pest produces 2 outcomes + 2 candidateModes + directionChoices + choose_direction; single mode stays finalize with no directionChoices; visibleOutcomes carry outcomeKey/ problemKey).
trae-test
… confidence handling - Added support for the `main_takeover` mode, including validation workflows and explicit authorization requirements. - Enhanced direct tier handling with new confidence >= 0.95 logic, suppress flags, and correct confidence propagation at multiple layers. - Integrated `selection_to_consumer` contract enforcement into dispatch task validations. - Updated pest visual orchestrator to ensure confidence filtering (`eligibleModeKeys`) for direct
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.