Private
Public Access
0
0

docs(context-curation,shaders): add Structural File Editor (Phase 7) and NERV theme effects sections

This commit is contained in:
2026-06-02 19:21:13 -04:00
parent 959e7f30a3
commit 8444285d70
2 changed files with 60 additions and 0 deletions
+30
View File
@@ -271,3 +271,33 @@ uv run pytest tests/test_fuzzy_anchor.py tests/test_history_manager.py \
tests/test_ts_cpp_tools.py tests/test_ast_parser.py \
tests/test_phase6_simulation.py -v
```
---
## Structural File Editor (Phase 7)
Phase 7 unified two previously separate modals — the **AST Inspector** and the **Slice Editor** — into a single **Structural File Editor** modal. This reduces modal-switching overhead when curating context for a file with both AST-masked symbols and fuzzy-anchored slices.
### Unified Modal Flow
When the user clicks "Inspect" or "Slices" on a file item in the Context Panel:
1. The Structural File Editor modal opens with two side-by-side panes:
- **Left pane:** Hierarchical AST tree (using `ts_*_get_code_outline` for C/C++, `py_get_code_outline` for Python). Each node is a clickable target for AST masking.
- **Right pane:** Slice list with line ranges. Each slice can be edited, deleted, or converted to a fuzzy anchor.
2. Selecting a node in the left pane shows its current mask state (`full` / `def` / `sig` / `agg` / `hide`) and allows modification.
3. The slice list on the right updates in real time as fuzzy anchors are added or resolved.
### Key Files
- `src/gui_2.py:_render_structural_file_editor_modal` — The unified modal renderer.
- The previously separate `_render_ast_inspector_modal` and `_render_slice_editor_modal` functions are deprecated; their state is migrated to the unified editor on first open.
### Behavioral Equivalence
The unified editor preserves the behavior of both predecessors:
- All AST mask operations (set/clear state per symbol) work identically.
- Fuzzy anchor slice operations (create, resolve, annotate) work identically.
- The "Apply" action writes the modified `ast_mask` and slice list to the file item in a single transaction.
This is a UX consolidation, not a data model change. The underlying `ast_mask: dict[str, str]` and slice list structures are unchanged.
+30
View File
@@ -31,3 +31,33 @@ To ensure cross-platform compatibility and avoid brittle Win32 hook collisions w
## 3. Integration with Event Metrics
Both the shader uniforms (time, resolution) and window control events will be hooked into the existing `dag_engine` and `events` systems to ensure minimal performance overhead and centralized configuration via `config.toml`.
---
## 4. NERV Theme Effects
The [NERV Technical Console](https://en.wikipedia.org/wiki/Nerv) theme (`src/theme_nerv.py`, `src/theme_nerv_fx.py`) is a selectable high-density visual variant that uses the shader and window-frame infrastructure above to produce a CRT-style "Tactical Console" aesthetic.
### Visual Characteristics
- **Black Void Palette:** Near-black backgrounds with sharp, high-contrast accents.
- **Zero-Rounding Geometry:** No rounded corners on panels, buttons, or frames. Sharp rectangles.
- **CRT Scanlines:** A repeating horizontal line overlay applied via the `custom_background` callback. The scanline intensity is configurable via `config.toml``[nerv].scanline_alpha`.
- **Status Flickering:** The active tier indicator and other "operational status" elements flicker at a low frequency (configurable rate) to simulate a tactical display.
- **Alert Animations:** When MMA state transitions to "blocked" or "error", a red border pulse animation runs for ~1.5 seconds.
### Implementation Files
- `src/theme_nerv.py` — Color palette, geometry overrides, font selection.
- `src/theme_nerv_fx.py` — Scanline overlay, status flickering, alert animations.
- `src/bg_shader.py` — Custom background shader (uses the FBO pipeline described in Section 1).
### Activation
The NERV theme is selected via the GUI's theme picker (User Menu → Theme → NERV). When activated, `theme_nerv.py` swaps the active color set, geometry style, and font. The FX layer is enabled/disabled via the `[nerv].fx_enabled` config flag.
### Performance Considerations
CRT scanlines use the FBO pipeline and run at full window resolution. On a 1920×1080 display, the scanline pass adds ~1-2ms per frame. For lower-end GPUs, reduce `[nerv].scanline_alpha` (cheaper blending) or disable FX entirely (`[nerv].fx_enabled = false`).
See [guide_nerv_theme.md](guide_nerv_theme.md) (placeholder; written in Task 10) for the full theme API, configuration keys, and customization options.