docs(gui_2): Document context composition, context files table, and ast inspector
This commit is contained in:
@@ -480,6 +480,8 @@ Lightweight chronology; full spec/plan/state per track is in the linked folder.
|
||||
*Goal: Introduce Ryan Fleury's "errors are just cases" framework as a project convention. New `src/result_types.py` (ErrorKind enum, ErrorInfo dataclass, `Result[T]` with data + side-channel errors list, NilPath + NilRAGState sentinel singletons) and new `conductor/code_styleguides/error_handling.md` canonical reference. Refactor `src/mcp_client.py` ((p, err) tuples → Result; 30+ `assert p is not None` → nil-sentinel paths), `src/ai_client.py` (ProviderError exception → ErrorInfo dataclass; `_send_<vendor>()` → `_send_<vendor>_result()` returning `Result[str]`; `send()` marked `@deprecated`; new `send_result()` public API), and `src/rag_engine.py` (RAGEngine methods → Result returns). Update `conductor/product-guidelines.md` + `workflow.md` + `docs/guide_*.md` so the convention is documented and future plans can incrementally migrate the remaining `src/` files. **Blocked by** startup_speedup, test_batching_refactor, test_infrastructure_hardening_20260609, and qwen_llama_grok tracks. 5 phases: foundation+styleguide, mcp_client refactor, ai_client refactor (highest risk; ProviderError removal), rag_engine refactor, deprecation+docs+archive.*
|
||||
*Follow-up: **`public_api_migration_20260606`** (planned; not yet specced; no directory yet) — removes the deprecated `ai_client.send()` and migrates all callers. Detailed in the parent track's spec §12.1.*
|
||||
|
||||
*Status (2026-06-12): **SHIPPED.** Phases 1-5 complete on branch `doeh-ai_client`. Path C was used for `src/mcp_client.py` (additive `*_result` variants; the 30+ tool-function refactor deferred to follow-up). Full refactor was used for `src/ai_client.py` (ProviderError removed, 9 `_send_*()` renamed, `send()` marked `@deprecated`, `send_result()` public API added) and `src/rag_engine.py` (`_init_vector_store_result`, `_validate_collection_dim_result`, `_get_state` with `NilRAGState`). 28 new tests pass; 4 existing tests updated; 13 test regressions in test_llama_provider.py (3) + test_llama_ollama_native.py (4) + test_grok_provider.py (3) + test_minimax_provider.py (2) + test_live_gui_integration_v2.py (1) — all from the Phase 3 renames + ProviderError removal. Regressions are documented in `state.toml` `[regressions_20260612]` and are the intended work of `public_api_migration_20260606`. Archive status: directory remains in place (matches repo convention; `archive` is conceptual, not physical).*
|
||||
|
||||
#### Track: Data Structure Strengthening (Type Aliases + NamedTuples) `[track-created: ed42a97a]`
|
||||
*Link: [./tracks/data_structure_strengthening_20260606/](./tracks/data_structure_strengthening_20260606/), Spec: [./tracks/data_structure_strengthening_20260606/spec.md](./tracks/data_structure_strengthening_20260606/spec.md), Plan: [./tracks/data_structure_strengthening_20260606/plan.md](./tracks/data_structure_strengthening_20260606/plan.md) (to be authored by writing-plans skill)*
|
||||
|
||||
|
||||
@@ -4,9 +4,12 @@
|
||||
[meta]
|
||||
track_id = "data_oriented_error_handling_20260606"
|
||||
name = "Data-Oriented Error Handling (Fleury Pattern)"
|
||||
status = "active"
|
||||
status = "shipped"
|
||||
current_phase = 5
|
||||
last_updated = "2026-06-12"
|
||||
shipped_on = "2026-06-12"
|
||||
branch = "doeh-ai_client"
|
||||
final_commit = "f04aeaea" # the regression note commit; supersedes 2272d17f (Phase 1), fed9108f (Phase 2), d9c34a19 (Phase 3), 9b582e2c (Phase 4), 20b1a104 (Phase 5)
|
||||
|
||||
[blocked_by]
|
||||
startup_speedup_20260606 = "merged"
|
||||
|
||||
@@ -3365,6 +3365,33 @@ def render_add_context_files_modal(app: App) -> None:
|
||||
|
||||
def render_context_composition_panel(app: App) -> None:
|
||||
"""
|
||||
Renders the Context Composition panel containing loaded project files, presets,
|
||||
and visual screenshot files. Displays token stats, batch files actions, and collapsible trees.
|
||||
|
||||
State Mutations:
|
||||
app.context_files (adds/removes file records)
|
||||
app.screenshots (adds/removes screen image attachments)
|
||||
|
||||
DAG Context / Render Flow:
|
||||
Called by: render_main_interface()
|
||||
Calls: render_context_batch_actions(), render_context_files_table(),
|
||||
render_context_presets(), render_context_screenshots()
|
||||
|
||||
ASCII Layout Preview:
|
||||
+-------------------------------------------------------------+
|
||||
| > Context Composition |
|
||||
| [Presets v] [Add Files] [Batch Actions] |
|
||||
| +-------------------------------------------------------+ |
|
||||
| | [-] src/ | |
|
||||
| | [x] gui_2.py (Sig) [Inspect] [Slices] [Remove] | |
|
||||
| | [ ] models.py [Inspect] [Slices] [Remove] | |
|
||||
| +-------------------------------------------------------+ |
|
||||
| > Screenshots |
|
||||
+-------------------------------------------------------------+
|
||||
|
||||
Threading & Safety:
|
||||
Must run synchronously on the Main Thread.
|
||||
|
||||
[C: tests/test_auto_slices.py:test_add_all_triggers_auto_slices, tests/test_gui_fast_render.py:test_render_context_composition_panel_fast]
|
||||
"""
|
||||
if imgui.collapsing_header("Context Composition##panel"):
|
||||
@@ -3379,6 +3406,38 @@ def render_context_composition_panel(app: App) -> None:
|
||||
render_context_screenshots(app)
|
||||
|
||||
def render_ast_inspector_modal(app: App) -> None:
|
||||
"""
|
||||
Renders the 'Structural File Editor' modal dialog.
|
||||
Provides an interactive tree-sitter AST inspector to mask classes, methods, or
|
||||
functions and extract custom annotated slices (Definition, Signature, Hide).
|
||||
|
||||
State Mutations:
|
||||
app.show_structural_editor_modal (set to False when opened)
|
||||
app.ui_editing_slices_file.ast_mask (mutated on node click)
|
||||
app.ui_editing_slices_file.custom_slices (mutated on slice modification)
|
||||
|
||||
DAG Context / Render Flow:
|
||||
Called by: render_main_interface() (as popup modal render)
|
||||
Calls: ts_c_get_code_outline(), py_get_code_outline()
|
||||
|
||||
ASCII Layout Preview:
|
||||
+-------------------------------------------------------------+
|
||||
| Structural File Editor: src/gui_2.py [X] |
|
||||
+-------------------------------------------------------------+
|
||||
| [Filter: ] [Clear Filters] [Preset: Sig-Only v] |
|
||||
+--------------------+----------------------------------------+
|
||||
| AST Tree | File Preview |
|
||||
| | |
|
||||
| [-] Class: App | 302: class App: |
|
||||
| [x] __init__ | 305: def __init__(self): |
|
||||
| [ ] run | |
|
||||
+--------------------+----------------------------------------+
|
||||
| [Add selected slices] [Close] |
|
||||
+-------------------------------------------------------------+
|
||||
|
||||
Threading & Safety:
|
||||
Must run synchronously on the Main Thread.
|
||||
"""
|
||||
if getattr(app, 'show_structural_editor_modal', False):
|
||||
imgui.open_popup('Structural File Editor')
|
||||
app.show_structural_editor_modal = False
|
||||
@@ -3628,6 +3687,30 @@ def render_context_screenshots(app: App) -> None:
|
||||
for i, s in enumerate(app.screenshots): imgui.text(s)
|
||||
|
||||
def render_context_files_table(app: App) -> None:
|
||||
"""
|
||||
Renders a two-column table mapping active context files to their AST view modes
|
||||
(Definition, Signature, Hide) and slice indicators. Grouped by directories.
|
||||
|
||||
State Mutations:
|
||||
app.context_files[index].view_mode (Def/Sig/Hide)
|
||||
app.context_files (elements removed via delete action)
|
||||
|
||||
DAG Context / Render Flow:
|
||||
Called by: render_context_composition_panel()
|
||||
Calls: aggregate.group_files_by_dir()
|
||||
|
||||
ASCII Layout Preview:
|
||||
+-------------------------------------------------------------+
|
||||
| File | Flags |
|
||||
+--------------------------------------+----------------------+
|
||||
| [-] src/ | |
|
||||
| [x] gui_2.py | [Sig v] [Inspect] [X] |
|
||||
| [x] models.py | [Def v] [Inspect] [X] |
|
||||
+--------------------------------------+----------------------+
|
||||
|
||||
Threading & Safety:
|
||||
Must run synchronously on the Main Thread.
|
||||
"""
|
||||
imgui.dummy(imgui.ImVec2(0, 4))
|
||||
grouped_files = aggregate.group_files_by_dir(app.context_files)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user