reqlanOverviewIdeasFilesCode filesClustersAttributesGraphPrint
Ideas/reqlan_context_model

Idea detail

reqlan_context_model

reqlan rq/extension/module/context-scope.rq:71

block

Summary

Canonical composed context per context-model.ts.
Implementation: context-model.ts.
- context_focus is the single anchor ( idea, file, selection, or none ).
- context_dimensions each contribute context_contribution records with counts and summary lines.
- context_footprint merges enabled dimensions into deduped idea / file sets and an effective_center_id for graph / refs panes.
- current_file_slice is the projection used when the current-file lens is expanded. Includes `isRqFile`, `referencingIdeas`, `commentLinkedIdeas`, `folderReferencingIdeas`, and optional `gitChange`.
- context_selection when the user highlights a non-empty range spanning one or more `.rq` ideas ( selection_pane ).
- global_hop_depth and dimension_hop_control overrides on the model.
Host increments `revision` when any dimension or hop depth changes; webview ignores stale posts by revision.

Jump to outbound references

Jump to inbound references

Navigation

Source file

reqlan rq/extension/module/context-scope.rq

community 25

community cluster

context-scope.rq

file cluster

reqlan rq/extension/module

folder cluster

status: Not present

status cluster

tag: Not present

tag cluster

Printable page

Static print-friendly idea sheet.

Attributes

KeyValue
tests webview-graph-queries.ts, context-model.ts

Browse all attributes

Ancestor context

context_focus

kind: idea | file | selection | none. When sync-with-editor is on, focus follows the caret idea in an active `.rq` editor, or file / selection context otherwise. When pinned, focus stays on the pinned idea until cleared. Selection focus applies when the user highlights text spanning one or more ideas ( [activitybar.selection_pane] ).

context_dimensions

Seven dimensions contribute ideas and files to the effective context footprint. Each dimension has a stable id, human label, default weight, and a one-line summary for collapsed UI. - workspace [workspace_context] Ambient VS Code workspace chrome and multi-base index glance: discovered bases, active base readiness / idea / edge counts — not a full graph dump. Distinct from the active [base] source in v2. - current_file [current_file_context] Active editor file. For `.rq`: caret idea, in-file outline, unresolved refs. For any file: [any_file_scope] links and git badge. - open_files [open_files_context] Other workspace editor tabs currently open ( any language ). - file_history [file_history_context] Session recency of visited workspace files ( navigation history ), distinct from edit history. - edit_history [edit_history_context] Session recency of edited workspace files and caret positions ( typing history ). - manual [manual_context] User-pinned ideas from [activitybar.context_tray] and explicit " add to context " actions. - git [git_context] Focus-centric development history ( branch, recent commits, authors ) per [index_reqs.git_information_capture]; working-tree changes demoted.

context_contribution

Per dimension: id, label, enabled, pinned, weight, ideaCount, fileCount, summary, hopDepth, supportsHopControl. Disabled dimensions do not add to [context_footprint] but may still show a muted chip with zero count. Pinned dimensions stay expanded in [scope_pane_design] until collapsed by the user. Graph-searchable dimensions expose per-lens hop overrides via [dimension_hop_control].

context_footprint

Merged view across enabled dimensions. - deduped idea ids and file uris with [context_provenance] ( which dimensions contributed each entry ). - `summaryLine`: compact human text, e. g. " this file · 3 open · 2 git · 1 pinned ". - `effectiveCenterId`: graph / refs / ancestors panes use this; defaults to focus idea, selection's first idea, first linked requirement for non-. rq files, else first idea in current file.

context_selection

Union of ideas whose line ranges overlap the editor selection in a `.rq` file. Drives [activitybar.selection_pane] and contributes idea ids to [context_footprint].

global_hop_depth

Session default hop depth ( 1 - 4 ) stored in [context_session]. Drives graph slice expansion, reference list breadth, ancestor chain depth, and composed context export. Surfaced in [activitybar.hop_depth_control] and echoed on [reqlan_context_model]. globalHopDepth.

dimension_hop_control

When a graph-searchable dimension lens is expanded in [scope_pane_design], show a local * * − / value / + * * pair. Applies to [current_file_context], [open_files_context], [file_history_context], [edit_history_context], and [manual_context] — not [workspace_context] or [git_context]. Per-dimension override inherits [global_hop_depth] until the user adjusts it; stored in dimensionHopDepth on the session and model. Edge cases match [activitybar.hop_depth_control]: disable − at min, + at max, clamp on apply.

workspace_context

weight: 0. 1 Always on; contributes multi-base readiness and counts ( active base + sibling summary ) unless user opens workspace pane. " Workspace " here means the VS Code workspace surface and ambient index health — not a single ontology base. Active-base routing for focus / graph / refs follows ["../../bases/base.rq".implied_context]; see [context_scope_v2.context_sources] `base`.

current_file_context

weight: 1. 0 Default enabled and expanded lens when a workspace file is active.

any_file_scope

The active editor may be a requirement file or implementation file ( Python, TypeScript, etc. ). [current_file_context] must surface requirement links even when the file contains no block ideas. Signals for non-. rq files ( and. rq files without a caret idea ): - [file_reference_links]: `.rq` ideas whose outbound `file_reference` edges target this file path ( e. g. `["./apythonfile.py"]` ). - [folder_reference_links]: `.rq` ideas whose `file_reference` targets a parent folder of this file. - [comment_reference_links]: ideas resolved from `rq:[…]` tokens in this file's comments per [code_comment_refs.references_in_functional_code_comments]. - [git_context]: focus-centric git history ( recent commits, authors, branch ); working-tree dirty badge secondary. Focus behaviour: - `.rq` file with caret in a block → idea focus ( unchanged ). - Any file with linked requirements → file focus; [effective_center_id] defaults to the first linked requirement. - No links → file focus with empty related lists; graph / refs panes stay idle until a requirement is focused. Implementation: [context_model] uses [file_path_match] and `file_related_requirements` analyser; comment links are also resolved from live buffer text when indexed edges are absent.

open_files_context

weight: 0. 6 Default enabled; summary lists tab count.

file_history_context

weight: 0. 4 Default enabled; capped list ( configurable, default 12 ).

edit_history_context

weight: 0. 5 Default enabled; capped list ( default 12 ); entries include last line touched.

manual_context

weight: 0. 9 Enabled when tray non-empty; pins override sync focus for [effective_center_id] when user chooses " focus pinned ".

git_context

weight: 0. 7 Should detect symbol lifecycle using symbol identity rather than line history for creation: who introduced the symbol, when it was introduced, who last meaningfully changed it, the total number of changes, and the relative change rate versus peer symbols. Default enabled when repository detected. Primary: focus-centric git history — branch, HEAD short hash, recent commits touching the focus file / idea, top authors. Summary prefers history richness ( e. g. " main · 3 commits · 2 authors " ), not staged / unstaged counts. Working-tree dirty files remain available as a demoted nested section and optional footprint contributors. Focus hero shows a history cue ( last commit age / branch ) instead of a staged / unstaged chip. Consumes [index_reqs.git_information_capture] and ["context-scope-v2.rq".development_history_signals]. UI: [activitybar.git_history_lens].

scope_pane_design

The scope pane uses a * * focus + lens * * layout — not seven stacked lists. The experience should feel more like a wiki than a table: surfaced ideas, files, folders, commits, authors, and related context should prefer rich cross-links and drill-in navigation over flat tabular presentation. Grouping should adapt to available context rather than staying fixed: file-heavy views may group by folder / path, development-history views may group by git recency / authorship / churn, and mixed views should choose the most explanatory structure for the current focus.

file_reference_links

Matched when an indexed `file_reference` edge target resolves to the active file path ( exact or suffix match ).

folder_reference_links

Matched when an indexed `file_reference` edge target is a folder prefix of the active file per [file_path_match.match_file_reference_target].

comment_reference_links

Matched from `comment_link` index edges and / or `rq:[target]` spans parsed from the active buffer.

Outbound references

KindIdeaPathSnippet
file_reference analytical_context_model packages/analytical/src/core/context-model.ts context-model.ts
file_reference ../../../packages/analytical/src/index-store/webview-graph-queries.ts packages/analytical/src/index-store/webview-graph-queries.ts webview-graph-queries.ts
file_reference context_model packages/extension/src/activity_bar_module/context-model.ts context-model.ts
references context_contribution reqlan rq/extension/module/context-scope.rq context_contribution
references context_dimensions reqlan rq/extension/module/context-scope.rq context_dimensions
references context_focus reqlan rq/extension/module/context-scope.rq context_focus
references context_footprint reqlan rq/extension/module/context-scope.rq context_footprint
references context_selection reqlan rq/extension/module/context-scope.rq context_selection
references dimension_hop_control reqlan rq/extension/module/context-scope.rq dimension_hop_control
references global_hop_depth reqlan rq/extension/module/context-scope.rq global_hop_depth

Inbound references

KindIdeaPathSnippet
references ai_context_export reqlan rq/extension/module/context-scope.rq reqlan_context_model
references context_scope reqlan rq/extension/module/context-scope.rq reqlan_context_model
references global_hop_depth reqlan rq/extension/module/context-scope.rq reqlan_context_model

Unresolved references

KindIdeaPathSnippet
references current_file_slice current_file_slice
references effective_center_id effective_center_id
references selection_pane selection_pane

Local graph

Initialising graph…