You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- continuity state is preserved without being over-injected into the wrong branch
1570
1570
1571
+
### Track G — Degraded recovery stays tied to the requested task
1572
+
1573
+
**Status:** First slice completed in working tree
1574
+
1575
+
**Delivered so far**
1576
+
- added lightweight `pendingRequestedTask` persistence in `src/main/session-intent-state.js` so a concrete requested TradingView/Pine step can survive a withheld or blocked execution branch
1577
+
- updated `src/cli/commands/chat.js` to record that pending task when an emitted action plan is intentionally withheld as non-executable text, clear it when a fresh branch or execution starts, and use it during minimal `continue` turns
1578
+
- made degraded/blocked continuation recovery task-aware so replies reference the actual pending request (for example Volume Profile or Pine Logs) instead of only replaying a generic stale-continuity warning
1579
+
- extended `scripts/test-chat-actionability.js` and `scripts/test-session-intent-state.js` with regressions for pending-task persistence and task-aware degraded recovery messaging
1580
+
1581
+
**Why this track exists**
1582
+
- Real TradingView testing showed that after a blocked follow-through turn, repeated `continue` messages could keep replaying generic degraded continuity warnings without reconnecting the user to the task they had actually asked for.
1583
+
- The recovery path needs to preserve both safety and task specificity: block blind continuation, but keep pointing back to the last requested actionable step.
1584
+
1585
+
**Goal**
1586
+
- make blocked/degraded continuation recovery explicitly reference the pending requested TradingView/Pine task so the user can retry the correct action instead of falling into a vague continuity loop.
1587
+
1588
+
**Primary files**
1589
+
-`src/main/session-intent-state.js`
1590
+
-`src/cli/commands/chat.js`
1591
+
-`scripts/test-chat-actionability.js`
1592
+
-`scripts/test-session-intent-state.js`
1593
+
1594
+
**Implementation checklist**
1595
+
- persist a compact pending-task record when a concrete requested action is withheld or cannot yet continue safely
1596
+
- clear stale pending-task state when the user starts a new non-continuation branch or the action proceeds into execution
1597
+
- teach degraded `continue` recovery to mention the pending task directly while preserving existing verification/degraded-safety language
- degraded `continue` replies mention the last requested TradingView/Pine task when one is pending
1609
+
-`continue` does not blindly execute when continuity is degraded or absent but a pending task exists
1610
+
- starting a fresh non-continuation branch clears stale pending-task recovery state
1611
+
1612
+
### Track H — TradingView UI grounding becomes truthful before Pine authoring
1613
+
1614
+
**Status:** Planned
1615
+
1616
+
**Why this track exists**
1617
+
- Recent real TradingView/Pine testing showed Liku can generate plausible Pine authoring plans while still failing at the more basic UI truthfulness layers:
1618
+
- requested TradingView window handle vs actual foreground handle drift
1619
+
- app focused vs Pine panel visible vs editor actually active
1620
+
- destructive editor actions being attempted before the UI state is truly established
1621
+
- Official TradingView shortcut references also reinforce that many shortcuts are contextual or customizable, so reliable TradingView automation must start from verified UI state rather than assuming one static hotkey layer always applies.
1622
+
1623
+
**Goal**
1624
+
- make TradingView focus, surface activation, and editor readiness explicit and truthful before Liku attempts Pine authoring or chart-editing flows.
1625
+
1626
+
**Primary files**
1627
+
-`src/main/system-automation.js`
1628
+
-`src/main/ai-service.js`
1629
+
-`src/main/tradingview/verification.js`
1630
+
-`src/main/tradingview/pine-workflows.js`
1631
+
-`scripts/test-windows-observation-flow.js`
1632
+
-`scripts/test-bug-fixes.js`
1633
+
1634
+
**Commit order inside this track**
1635
+
1.**Track H / Slice 1 — Focus truthfulness and handle drift accounting**
1636
+
2.**Track H / Slice 2 — TradingView surface activation and editor-active verification**
1637
+
3.**Track H / Slice 3 — Safe Pine authoring defaults (`new script` / inspect-first) instead of destructive clear-first flows**
1638
+
4.**Track H / Slice 4 — Resume-after-confirmation re-establishes UI prerequisites**
1639
+
1640
+
#### Track H / Slice 1 — Focus truthfulness and handle drift accounting
1641
+
1642
+
**Status:** First slice completed in working tree
1643
+
1644
+
**Delivered so far**
1645
+
- added requested-vs-actual focus metadata to `focus_window` / `bring_window_to_front` results in `src/main/system-automation.js`
1646
+
- updated `src/main/ai-service.js` so `last target window` only advances on exact or explicitly recovered TradingView focus, instead of blindly adopting whatever foreground hwnd happened after a focus attempt
1647
+
- added runtime regressions in `scripts/test-windows-observation-flow.js` for focus mismatch truthfulness and guarded target-window updates
1648
+
- added seam coverage in `scripts/test-bug-fixes.js` for structured focus target metadata and guarded focus-result classification
1649
+
1650
+
**Goal**
1651
+
- stop reporting requested TradingView focus success when a different foreground window actually received focus.
1652
+
1653
+
**Exact files to change**
1654
+
-`src/main/system-automation.js`
1655
+
- tighten `focus_window` / `bring_window_to_front` result shaping so action results preserve:
1656
+
- requested target handle/title/process
1657
+
- actual foreground handle/title/process
1658
+
- whether focus was exact, recovered, or mismatched
1659
+
-`src/main/ai-service.js`
1660
+
- only bless `last target window` updates when the foreground result is:
1661
+
- exact,
1662
+
- or an explicitly accepted recovered TradingView target
1663
+
- surface focus mismatch metadata in execution results instead of silently treating it as clean success
1664
+
-`scripts/test-windows-observation-flow.js`
1665
+
- add a runtime regression where requested TradingView hwnd differs from the actual foreground hwnd and the result is marked as drift/mismatch rather than a plain success
1666
+
-`scripts/test-bug-fixes.js`
1667
+
- add seam assertions for requested-vs-actual focus metadata and guarded last-target-window updates
1668
+
1669
+
**Regression additions**
1670
+
-`scripts/test-windows-observation-flow.js`
1671
+
-`tradingview focus mismatch is not reported as clean success`
1672
+
-`last target window only updates on exact or recovered tradingview focus`
1673
+
-`scripts/test-bug-fixes.js`
1674
+
-`focus results preserve requested and actual target metadata`
1675
+
1676
+
**Acceptance proof**
1677
+
```powershell
1678
+
node scripts/test-windows-observation-flow.js
1679
+
node scripts/test-bug-fixes.js
1680
+
```
1681
+
1682
+
#### Track H / Slice 2 — TradingView surface activation and editor-active verification
1683
+
1684
+
**Status:** First slice completed in working tree
1685
+
1686
+
**Delivered so far**
1687
+
- Pine authoring workflows now request stronger `editor-active` verification when the next meaningful step needs real editor control
1688
+
- the shared observation checkpoint runtime recognizes `editor-active` / `editor-ready` verification kinds and returns Pine-specific failure messaging when activation cannot be confirmed
1689
+
- focused regressions prove Pine typing is blocked until active-editor verification succeeds
1690
+
- seam coverage now protects editor-active/editor-ready checkpoint support from regression
1691
+
1692
+
**Goal**
1693
+
- explicitly distinguish:
1694
+
1. TradingView window focused
1695
+
2. Pine Editor panel visible
1696
+
3. Pine editor control active / ready for typing
1697
+
1698
+
**Exact files to change**
1699
+
-`src/main/tradingview/verification.js`
1700
+
- add editor-state verification kinds such as:
1701
+
-`editor-visible`
1702
+
-`editor-active`
1703
+
-`editor-ready-for-typing`
1704
+
-`src/main/tradingview/pine-workflows.js`
1705
+
- require stronger verification before allowing `ctrl+a`, destructive edit keys, or typing into Pine Editor workflows
1706
+
- separate `open Pine Editor` from `editor ready for authoring`
1707
+
-`src/main/ai-service.js`
1708
+
- wire the stronger verification kinds into post-key checkpoints and failure reasons
1709
+
-`scripts/test-windows-observation-flow.js`
1710
+
- add execution tests proving `ctrl+e` alone is not enough to unlock typing unless editor-active verification succeeds
1711
+
1712
+
**Regression additions**
1713
+
-`scripts/test-windows-observation-flow.js`
1714
+
-`pine editor typing waits for editor-active verification`
1715
+
-`pine editor destructive edit is blocked until editor-ready state is observed`
#### Track H / Slice 3 — Safe Pine authoring defaults
1726
+
1727
+
**Status:** First slice completed in working tree
1728
+
1729
+
**Delivered so far**
1730
+
- generic TradingView Pine creation requests now rewrite into inspect-first Pine Editor flows instead of defaulting to `ctrl+a` + `backspace` clear-first behavior
1731
+
- explicit overwrite requests still preserve destructive clear steps when the user clearly asks to replace the current script
1732
+
- added focused workflow, observation-flow, and seam regressions for safe Pine authoring defaults
1733
+
1734
+
**Goal**
1735
+
- make Pine authoring default to inspect-first and `new script`-style flows instead of `ctrl+a` + `backspace` as the baseline strategy.
1736
+
1737
+
**Exact files to change**
1738
+
-`src/main/tradingview/pine-workflows.js`
1739
+
- add safe authoring intent shaping for requests like:
1740
+
-`create a pine script`
1741
+
-`draft a new pine script`
1742
+
-`build a pine script`
1743
+
- prefer:
1744
+
- open Pine Editor
1745
+
- inspect visible state
1746
+
- create/open a new script path when available
1747
+
- only clear existing content for explicit overwrite intents
1748
+
-`src/main/ai-service/system-prompt.js`
1749
+
- add guidance that Pine authoring should prefer safe new-script flows and bounded edits over destructive clear-first behavior
#### Track H / Slice 4 — Resume-after-confirmation re-establishes prerequisites
1770
+
1771
+
**Goal**
1772
+
- after confirmation pauses, re-verify TradingView focus, Pine surface visibility, and editor-active state instead of assuming ephemeral selection/focus survived.
1773
+
1774
+
**Exact files to change**
1775
+
-`src/main/ai-service.js`
1776
+
- make `resumeAfterConfirmation(...)` rehydrate editor prerequisites for TradingView Pine flows before destructive keys or typing
1777
+
-`src/main/tradingview/pine-workflows.js`
1778
+
- add resume-safe prerequisite hints so Pine workflows can re-establish panel/editor readiness after confirmation
1779
+
-`scripts/test-windows-observation-flow.js`
1780
+
- add behavioral coverage for Pine confirmation-resume flows that must re-open/re-activate the editor before continuing
1781
+
1782
+
**Regression additions**
1783
+
-`scripts/test-windows-observation-flow.js`
1784
+
-`pine confirmation resume re-establishes editor state before destructive edit`
1785
+
-`confirmation pause does not assume ctrl+a selection survived`
1786
+
1787
+
**Acceptance proof**
1788
+
```powershell
1789
+
node scripts/test-windows-observation-flow.js
1790
+
node scripts/test-bug-fixes.js
1791
+
```
1792
+
1793
+
### Track I — TradingView shortcuts become app-specific tool knowledge
1794
+
1795
+
**Status:** Planned
1796
+
1797
+
**Why this track exists**
1798
+
- Official TradingView shortcut documentation and third-party workflow guides show an important distinction:
1799
+
- some shortcuts are stable defaults across many layouts (`/`, `Alt+A`, `Esc`, `Ctrl+K`)
1800
+
- some shortcuts are context-dependent (Trading Panel / DOM / Pine Editor)
1801
+
- some shortcuts are customizable (especially drawing-tool bindings)
1802
+
- Those shortcuts should not live as generic desktop assumptions because they are specific to TradingView and may behave differently in other apps, browser contexts, layouts, or custom hotkey configurations.
1803
+
1804
+
**Goal**
1805
+
- represent TradingView shortcut knowledge as TradingView-specific capability/profile data, not as a generic keyboard rule set.
0 commit comments