reqlanOverviewIdeasFilesCode filesClustersAttributesGraphPrint
Ideas/context_scope

Idea detail

context_scope

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

block

Summary

Reqlan sidebar and AI workflows reason about a composed reqlan_context_model, not a single " current file " blob.
Context applies to * * any workspace file * *, not only `.rq` sources — see any_file_scope.
Context is built from orthogonal context_dimensions that the user can enable, pin, or collapse.
The activity bar scope_pane is the primary surface for inspecting and steering context; context_tray holds the manual_context dimension.
Token discipline per ai_integration: show summaries and counts by default; expand a dimension only on intent.
Parses per reference_wikilink.
Decision-oriented v2 ( sources → signals → synthesis → views → consumers ) and show-don ' t-tell widgets: context_scope_v2.

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

No attributes declared.

Ancestor context

reqlan_context_model

Canonical composed context per [analytical_context_model]. Implementation: [context_model]. - [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 ( [activitybar.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.

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.

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.

manual_context

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

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_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.

current_file_context

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

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.

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].

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`.

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.

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.

Outbound references

KindIdeaPathSnippet
file_reference ../../../packages/analytical/src/core/context-model.ts packages/analytical/src/core/context-model.ts —
file_reference ../../../packages/analytical/src/core/file-path-match.ts packages/analytical/src/core/file-path-match.ts —
file_reference ../../../packages/analytical/src/index-store/webview-graph-queries.ts packages/analytical/src/index-store/webview-graph-queries.ts —
file_reference ../../../packages/extension/src/activity_bar_module/context-model.ts packages/extension/src/activity_bar_module/context-model.ts —
file_reference ../../../packages/extension/src/activity_bar_module/context-session.ts packages/extension/src/activity_bar_module/context-session.ts —
file_reference ../../../packages/extension/webviews/activity-bar/components/ScopePane.svelte packages/extension/webviews/activity-bar/components/ScopePane.svelte —
file_reference ../agents/features-ai.rq reqlan rq/extension/agents/features-ai.rq —
file_reference ../features-non-rq-code-comment/functional-code-comment-references.rq reqlan rq/extension/features-non-rq-code-comment/functional-code-comment-references.rq —
file_reference ./activitybar.rq reqlan rq/extension/module/activitybar.rq —
file_reference ./apythonfile.py reqlan rq/extension/module/apythonfile.py —
file_reference ./context-scope-v2.rq reqlan rq/extension/module/context-scope-v2.rq —
file_reference ./graph-path.rq reqlan rq/extension/module/graph-path.rq —
file_reference ./index.rq reqlan rq/extension/module/index.rq —
references any_file_scope reqlan rq/extension/module/context-scope.rq any_file_scope
references context_dimensions reqlan rq/extension/module/context-scope.rq context_dimensions
references manual_context reqlan rq/extension/module/context-scope.rq manual_context
references reqlan_context_model reqlan rq/extension/module/context-scope.rq reqlan_context_model

Inbound references

KindIdeaPathSnippet
None

Unresolved references

KindIdeaPathSnippet
references ai_integration ai_integration
references context_scope_v2 context_scope_v2
references context_tray context_tray
references reference_wikilink reference_wikilink
references scope_pane scope_pane

Local graph

Initialising graph…