Add multi-language logic exploration
This commit is contained in:
parent
9b4258c852
commit
9161889492
18 changed files with 1639 additions and 76 deletions
|
|
@ -106,11 +106,12 @@ and no-referrer policy. The built-in template uses only same-origin JSON endpoin
|
|||
overview, bounded search, exact descriptor-category filtering, exact node content, bounded
|
||||
incoming-and-outgoing neighborhoods, semantic Flow ancestry, convergence Web context, lazy
|
||||
function-scoped Logic, and one node's bounded project-confined source file.
|
||||
Descriptor filtering accepts only
|
||||
family, authority, status, or tag plus one exact value. There is no write endpoint, arbitrary query
|
||||
endpoint, static filesystem handler, external asset, or project-selection control.
|
||||
Descriptor filtering accepts only family, authority, status, or tag plus one exact value.
|
||||
Search filtering accepts only family, indexed kind or callable, indexed language tag, and the
|
||||
fixed `logic` or `source` capability. There is no write endpoint, arbitrary query endpoint, static
|
||||
filesystem handler, external asset, or project-selection control.
|
||||
|
||||
The `graph-browser@16` template provides mouse-wheel zoom centered on the pointer, left-button drag
|
||||
The `graph-browser@17` template provides mouse-wheel zoom centered on the pointer, left-button drag
|
||||
pan, explicit zoom-in and zoom-out buttons, a reset-view button, and a live zoom percentage. A
|
||||
four-pixel drag threshold defers pointer capture and preserves node activation for ordinary clicks.
|
||||
Loading another root node fits the viewport to the returned neighborhood, including a useful
|
||||
|
|
@ -130,6 +131,10 @@ inspectors. This display shortening is presentation-only and never changes index
|
|||
Left-clicking or pressing Enter on a graph node opens a compact descriptor card containing the
|
||||
validated metadata and content previously shown in the details panel. Its family, authority,
|
||||
status, and tag pills are buttons that replace the left result list with exact matching nodes.
|
||||
The left result panel also exposes composable family, node-kind, language, and capability filters
|
||||
plus fixed convenience presets. These filters are bounded read-only queries over indexed
|
||||
attributes and stored Logic ownership. Selecting a canvas node emphasizes only its incident edges
|
||||
and directly connected nodes; unrelated visible paths are muted but remain present.
|
||||
Right-clicking or pressing Shift+Enter opens the complete inspector. Inspection does not replace
|
||||
the current neighborhood or reset the viewport. Both dialogs support Escape, explicit close
|
||||
controls, and backdrop dismissal. Loading the inspected node as the new root requires the separate
|
||||
|
|
@ -153,7 +158,8 @@ validated snapshot; they do not add or change project relationships.
|
|||
|
||||
Logic is available only when the focused node owns a stored `LogicProjection`. The browser
|
||||
retrieves that projection through a bounded, exact-owner endpoint. Entry, condition, action,
|
||||
control, merge, return, raise, and exit nodes remain outside primary graph search and traversal.
|
||||
control, convergence, return, raise, and exit nodes remain outside primary graph search and
|
||||
traversal.
|
||||
Logic edges retain their declared `TRUE`, `FALSE`, `NEXT`, `CASE`, `LOOP`, `EXCEPTION`, `RETURN`,
|
||||
`RAISE`, `BREAK`, and `CONTINUE` labels. Hiding a logic node creates a visible omitted-path bridge
|
||||
between retained predecessors and successors instead of pruning valid downstream control flow.
|
||||
|
|
@ -171,6 +177,11 @@ distinct palettes and navigation sections. An undirected shortest-hop calculatio
|
|||
distance rings; Flow and Web use left-to-right distance layers with the destination on the right.
|
||||
Each role palette darkens progressively by distance, capped at fifty percent.
|
||||
|
||||
Logic uses a layered left-to-right layout with explicit horizontal clearance and vertical
|
||||
separation between siblings. Control-flow edges use routed curves and distinct lanes, including
|
||||
raised return and loop-back routes, to avoid drawing one path directly over another whenever the
|
||||
bounded topology permits.
|
||||
|
||||
Each invocation creates or reuses one worker through the separately supervised, per-user viewer
|
||||
manager. The manager is outside the short-lived MCP transport and owns all child workers as one OS
|
||||
service unit. It accepts only authenticated loopback requests and a validated immutable snapshot.
|
||||
|
|
|
|||
|
|
@ -126,15 +126,20 @@ anchor node's expected content hash.
|
|||
`LogicProjection` stores control flow separately from the primary architecture graph. It is owned
|
||||
by one function or method node and one source extraction.
|
||||
|
||||
Logic nodes can represent entries, conditions, basic blocks, calls, merges, loops, returns, and
|
||||
raises. Logic edges retain relation, display label, and deterministic ordinal. Adapters may leave
|
||||
Logic nodes can represent entries, conditions, basic blocks, calls, convergence points, loops,
|
||||
returns, and raises. Logic edges retain relation, display label, and deterministic ordinal.
|
||||
Adapters may leave
|
||||
logic empty until they implement a language analyzer.
|
||||
|
||||
This boundary prevents thousands of boolean expressions and basic blocks from polluting Nodes,
|
||||
Flow, Web, ordinary search, or architectural traversal. The Logic tab and `docforge_get_logic`
|
||||
request one function-scoped projection on demand. The built-in Python analyzer covers conditions,
|
||||
short-circuit booleans, loops, `match`, exception paths, returns, and raises. It reports possible
|
||||
static paths; it does not claim runtime branch outcomes.
|
||||
request one function-scoped projection on demand. The built-in analyzers cover Python,
|
||||
JavaScript, and C++. Python uses the standard-library AST. JavaScript and C++ share pinned
|
||||
Tree-sitter infrastructure with thin language-aware control-flow profiles. Parsers run only while
|
||||
extracting a changed source contribution; ordinary graph reads do not load or execute them. A
|
||||
grammar alone supplies syntax, not control-flow meaning, so each new language still needs a small
|
||||
semantic profile for its branch, loop, case, exception, and termination constructs. All analyzers
|
||||
report possible static paths; they do not claim runtime branch outcomes.
|
||||
|
||||
## Full rebuilds
|
||||
|
||||
|
|
|
|||
|
|
@ -86,13 +86,14 @@ only through the explicit local CLI integration command.
|
|||
|
||||
## Visualization boundary
|
||||
|
||||
`docforge_visualize` starts the fixed built-in `graph-browser@16` template against the currently
|
||||
`docforge_visualize` starts the fixed built-in `graph-browser@17` template against the currently
|
||||
validated derived index. It may focus one stable node, run one bounded lexical query, or open the
|
||||
project overview. The tool returns a loopback URL and exact snapshot identity.
|
||||
|
||||
The tool cannot select a project, database, template, host, port, filesystem path, or SQL
|
||||
expression. Its HTTP surface is token-bound, read-only, same-origin, and limited to overview,
|
||||
search, exact family/authority/status/tag filtering, node-neighborhood JSON, semantic Flow,
|
||||
search, exact family/authority/status/tag filtering, composable node-kind/language/capability
|
||||
filtering, node-neighborhood JSON, semantic Flow,
|
||||
convergence Web, lazy function-scoped Logic, and a bounded project-confined source read for one
|
||||
indexed node. `docforge_get_logic` and the browser Logic endpoint accept one exact owner node ID and
|
||||
return only that bounded stored projection. The browser
|
||||
|
|
@ -100,7 +101,8 @@ exposes an exact validated index snapshot. It rejects index
|
|||
replacement or alteration and requires another MCP invocation to refresh.
|
||||
Viewport interaction is entirely client-side: fitted neighborhood framing, wheel zoom, left-button
|
||||
drag pan, explicit zoom buttons, reset, and Space-to-center selection never request or mutate
|
||||
project data. Left activation visibly selects the node and opens a compact descriptor card.
|
||||
project data. Left activation visibly selects the node, highlights its incident edges and direct
|
||||
neighbors, mutes unrelated visible paths, and opens a compact descriptor card.
|
||||
Right-click opens the full inspector. Descriptor-pill activation fills the fixed left panel with an
|
||||
exact bounded category result set. The fixed right panel contains neighborhood navigation.
|
||||
Replacing the current root requires an explicit Explore neighborhood action. Users may hide
|
||||
|
|
|
|||
|
|
@ -309,17 +309,46 @@ graph. The view presents:
|
|||
assertions.
|
||||
- **Action** cards for executable statement blocks and calls.
|
||||
- **Control** cards for loops, `break`, and `continue`.
|
||||
- **Merge** cards where alternate paths converge.
|
||||
- **Convergence** cards where alternate paths rejoin, including decision, case, loop-exit, and
|
||||
exception convergence.
|
||||
- **Terminal** cards for returns and raised exceptions.
|
||||
|
||||
Edges use explicit labels and independent colors for `TRUE`, `FALSE`, `NEXT`, `CASE`, `LOOP`,
|
||||
`EXCEPTION`, `RETURN`, `RAISE`, `BREAK`, and `CONTINUE`. Long predicates wrap on the card. The full
|
||||
expression and source anchor remain available through inspection and source navigation.
|
||||
|
||||
The built-in analyzers cover Python, JavaScript, and C++. Python uses the standard-library AST.
|
||||
JavaScript and C++ use pinned Tree-sitter grammars behind the same language-neutral
|
||||
`LogicProjection` contract. Tree-sitter handles concrete syntax; DocForge keeps a thin
|
||||
language-specific control-flow profile for constructs such as conditions, loops, cases,
|
||||
exceptions, returns, and short-circuit operators. Adding a language therefore requires a grammar
|
||||
and a semantic profile, not a new visualization or database design.
|
||||
|
||||
Logic is static analysis. It shows paths the indexed source permits, not the branch that ran for a
|
||||
particular request or the runtime value of a boolean. Dynamic dispatch, reflection, generated
|
||||
behavior, and values returned by other processes may require runtime tracing to resolve.
|
||||
|
||||
### Finding the right node
|
||||
|
||||
The left panel combines independent filters rather than forcing users to scan the complete node
|
||||
list:
|
||||
|
||||
- **Text** searches indexed titles, summaries, and content.
|
||||
- **Family** selects the project-defined family.
|
||||
- **Node type** selects callables or an exact indexed kind such as function, method, class, route,
|
||||
test, module, or document.
|
||||
- **Language** selects an indexed language tag such as Python, JavaScript, or C++.
|
||||
- **Capability** selects nodes with source navigation or an available Logic projection.
|
||||
|
||||
Quick presets select common combinations for Logic-ready nodes, Python callables, tests, routes,
|
||||
and documentation. Filters compose, so `JavaScript` plus `Logic available` lists only JavaScript
|
||||
functions that can open Logic. Result cards show the readable leaf name, kind, language, path, and
|
||||
source anchor. Full identities remain in the tooltip and inspector.
|
||||
|
||||
Selecting any canvas node highlights its directly connected nodes and the exact edges between
|
||||
them. Other nodes and edges remain visible at reduced opacity. This local trace works in Nodes,
|
||||
Flow, Web, and Logic without changing the root or querying a different graph.
|
||||
|
||||
### Reading graph cards
|
||||
|
||||
The canvas presents nodes as compact semantic cards rather than anonymous circles:
|
||||
|
|
@ -635,7 +664,7 @@ ambiguous adapter evidence.
|
|||
### Full inspector content does not fit
|
||||
|
||||
DocForge 1.0 uses a fixed header and footer with a scrollable inspector body. If an older page is
|
||||
still open, stop and reopen the visualization so it loads the current `graph-browser@16` template.
|
||||
still open, stop and reopen the visualization so it loads the current `graph-browser@17` template.
|
||||
|
||||
### Render output is stale
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue