@c4a/context-cli 0.7.17 → 0.7.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,177 +1,148 @@
1
1
  ---
2
2
  name: context-inspect-search
3
- description: Use only when the user explicitly invokes context-inspect-search to query a Context workspace's approved knowledge and trace answers to its registered documents or source code. Do not auto-start for ordinary coding, planning, debugging, or an active Context production workflow.
3
+ description: Use only when the user explicitly invokes context-inspect-search to query available Context knowledge packages or approved workspace knowledge and trace answers to their identified sources. A local workspace is optional. Do not auto-start for ordinary coding, planning, debugging, or an active Context production workflow.
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
7
  # Context Inspect Search
8
8
 
9
- Answer questions from a selected knowledge workspace, then investigate its
10
- sources when the answer needs verification. This is an independent query entry,
11
- not an Indexer or a production Route. Use the conversation language.
12
-
13
- ## Invocation and scope
14
-
15
- Start only on the user's explicit command or named Skill invocation. Continue
16
- related follow-up questions without repeated invocation; stop applying this
17
- Skill when the user changes task. An existing workspace, error message, or
18
- knowledge-related phrase is not an activation signal.
19
-
20
- Locate the user-selected workspace. With the CLI available, use
21
- `context entry [project-dir] --format json` to identify it and its installed
22
- instructions. This is inspection: do not execute a returned production command
23
- just because it is actionable. If the CLI is unavailable or state inspection
24
- fails, readable files can still support a bounded answer; report what could not
25
- be checked. Do not initialize a replacement workspace or install tools silently.
26
- If several workspaces could match, resolve which one the user means.
27
-
28
- Keep all paths relative to that workspace. Read its `AGENTS.md` and relevant
29
- configuration before investigating. The presence of a `.tmp` directory alone
30
- does not establish a workspace. Querying must not clear caches, reset tasks,
31
- change checkouts, accept Review, or start Author or close. The one permitted
32
- query preparation build is described below.
33
-
34
- ## Choose the query material
35
-
36
- **Prefer an existing usable dist.** Locate the package output from the workspace
37
- configuration and inspect its index and `context-build-inventory.json`. Choose
38
- the package matching the question; do not silently combine unrelated packages.
39
- A usable package has readable delivered pages, not just an existing directory.
40
- Read its bundled query Skill (usually `skills/knowledge-query/SKILL.md`, but
41
- business templates may use another name) and use its navigation and search
42
- instructions within that package. If it has no query Skill, use its readable
43
- indexes and pages; a missing Skill alone is not a reason to rebuild. Do not
44
- execute unrelated scripts merely because they are bundled.
45
-
46
- Do not build first when usable output exists. It represents its last successful
47
- build and selected scope, not necessarily the latest approved workspace content.
48
- A search miss does not make the package unusable or justify a rebuild. For a
49
- latest-content question or an apparent gap, inspect the corresponding approved
50
- knowledge and distinguish it from the delivered version.
51
-
52
- **If no usable output exists, try one build when allowed.** Inspect the current
53
- Route/status and configured package. Only use the normal CLI build action when
54
- its prerequisites are already satisfied and it will not advance an unrelated
55
- active delivery or revision. Do not create package configuration, approve a
56
- template, run close, recover production state or finish pending work just to
57
- make this query possible. When a safe build is available, run its current
58
- command once in the identified workspace, wait for the same invocation's exit
59
- and receipt, then inspect its actual output and query Skill. Do not launch a
60
- second writer or treat partial output as a completed package. There is no
61
- unverified promise that this takes less than 20 seconds.
62
-
63
- **Otherwise query approved knowledge directly.** If the CLI is unavailable,
64
- state cannot be checked, build is not allowed, or the attempt fails, briefly
65
- explain the limitation and continue from readable approved knowledge. Do not
66
- loop through build repairs. Use `knowledge/structure.yaml` to locate pages,
67
- collections and source associations; search selected `knowledge/` paths with
68
- Host file tools, trying domain terms, symbol names and synonyms. Read relevant
69
- sections in context. A search miss proves neither absence of knowledge nor
70
- absence of the underlying capability. Candidates and `.tmp` reports may explain
71
- pending work but are not approved knowledge. If approval cannot be established,
72
- state that limitation rather than treating arbitrary Markdown as approved.
73
-
74
- ## Trace delivered answers to workspace sources
75
-
76
- For a dist hit, find its `dist_path` in the matching package inventory's
77
- `approved_knowledge.files` and follow that record's `approved_path` into the
78
- workspace. `approved_path` is relative to the workspace's `knowledge/` root,
79
- not the dist directory or workspace root; do not guess the mapping from similar filenames. Read that page and its source
80
- associations in `knowledge/structure.yaml`, then follow the registered sources.
81
- If the inventory or mapping is missing, still answer from readable package
82
- content where possible, but do not claim verified original-source attribution.
83
-
84
- The chain is: delivered page build inventory mapping → approved knowledge and
85
- structure registered raw material at its recorded version. The current
86
- approved page can have changed since build; describe differences rather than
87
- silently replacing one version with another. Dist and knowledge are two forms
88
- of the same content, not independent corroborating evidence. The bundled query
89
- Skill owns package-local retrieval; this explicitly invoked inspection Skill
90
- owns the subsequent, separately scoped workspace/source investigation. Cite
91
- which layer supports each claim.
92
-
93
- ## Prepare only the sources needed for attribution
94
-
95
- Follow the relevant page's source references and `sources/*/index.yaml` records.
96
- Check the selected raw body, attachments or repository module and its recorded
97
- version before claiming deep attribution. This readiness check concerns the
98
- selected materials, not completion of the active production workflow.
99
-
100
- For repositories, `context source recovery-plan --format json` provides a
101
- read-only recovery plan. Reuse an accessible checkout only after checking its
102
- remote, pinned commit and module path. Inspect local changes as well: a matching
103
- HEAD does not prove a dirty file is the recorded source. Do not silently use the
104
- latest branch or reset a user's checkout.
105
-
106
- If material is missing, report what cannot be verified and offer the smallest
107
- necessary recovery. With the user's recovery authorization, follow the installed
108
- `repository-source-recovery.md` procedure and schema in the workflow bundle
109
- identified by entry, using the CLI's `source restore` contract. Recover only the
110
- selected source groups; never run `task prepare` or the whole workspace-reset
111
- procedure to enable a query. If a writer is active or recovery cannot safely
112
- coexist, keep the answer bounded and defer the write. Do not invent recovery
113
- payload fields when the installed schema is unavailable.
114
-
115
- For documents, notes and sessions, read their saved source bodies or summaries
116
- and necessary attachments. A summary is not a full conversation transcript.
117
- An external link is not evidence of its unread target. Fetch missing external
118
- material only within the user's authorized scope; current remote content is not
119
- proof of an older snapshot. If historical raw material is unavailable, identify
120
- the gap rather than reconstructing it from generated knowledge.
121
-
122
- ## Explain and verify
123
-
124
- Trace from the approved claim to the relevant source location. Expand to
125
- adjacent definitions or tests only as necessary and within the selected source
126
- scope. Distinguish declared API, implementation behavior, test assertions and
127
- observed runtime behavior; reading code does not prove a runtime experiment.
128
- Apart from the bounded package build above, do not run repository builds, tests
129
- or arbitrary scripts merely to answer a query. If runtime validation is needed, explain the proposed check
130
- and obtain the user's authorization for that scope.
131
-
132
- Lead with the answer, then cite concrete page paths and source locations,
133
- including the version when it affects the conclusion. Separate confirmed facts,
134
- inferences and unavailable evidence. If source versions differ, describe the
135
- difference before deciding that a knowledge page is wrong. Do not dump runtime
136
- ids, long raw excerpts or a mandatory audit report into every answer.
137
-
138
-
139
- ## Website links in the final summary
140
-
141
- After answering from the pages actually read, optionally append one or more
142
- related document links in the final summary. Read `context-site-map.json` from
143
- the selected package (or its sibling website output in a workspace). Match the
144
- read page to `pages[].package_path` or `approved_path`; use its `title` and resolve
145
- `site_path` relative to `site_url`. The URL already includes the deployment base
146
- path: do not prepend `base` again. Only cite matched articles, deduplicate links,
147
- and do not invent section anchors.
148
-
149
- This is a local formatting step, not retrieval or validation. Do not probe URLs,
150
- make HTTP/HEAD requests, open a browser, inspect a deployment platform, or check
151
- remote versions to add links. Never build, publish or update metadata for this
152
- purpose. If the map, URL or matching page is absent or malformed, keep the local
153
- citation and continue silently. A configured URL does not prove that the site
154
- contains the current local revision; do not claim online verification.
155
-
156
- ## Suggest improvements and hand off
157
-
158
- When evidence supports a correction or worthwhile addition, briefly describe:
159
-
160
- - the affected page or missing topic and the reader's actual problem;
161
- - the supporting source location/version and what it establishes;
162
- - whether to revise an existing page, adjust discoverability, add a topic, or
163
- obtain missing material first;
164
- - the bounded pages/sources involved and any uncertainty.
165
-
166
- Check the existing scope and neighboring pages before recommending new content.
167
- Do not create a page solely because a search missed it, and do not propose
168
- unsupported claims as a knowledge update. With insufficient raw evidence, give
169
- an actionable material request instead of forcing an update.
170
-
171
- A suggestion is not authorization to write. Only when the user accepts the
172
- update, hand the question, evidence, proposed change and scope to the installed
173
- `context` production Skill in the same workspace. Read its fresh Route; it owns
174
- candidate repair, approved-page revision and scheduling around active work.
175
- Do not clear state, reuse an earlier revision, directly edit knowledge, or build
176
- a second update workflow. If the production Skill/CLI is unavailable, provide
177
- the handoff information and state that no update has started.
9
+ ## Entry and boundaries
10
+
11
+ Use on explicit invocation and related follow-up questions; use the conversation
12
+ language. The invocation authorizes read-only investigation of the selected
13
+ knowledge packages, available workspace and identified sources within that scope,
14
+ including isolated source retrieval and bounded non-destructive checks. The Skill
15
+ can run from a global installation with host-provided packages and no workspace.
16
+ Resolve scope from the request, conversation and configuration before asking.
17
+ Continue through non-blocking issues; ask only for missing access, genuinely
18
+ unresolved scope or effects outside existing authorization.
19
+
20
+ Start from the supplied package locations or workspace configuration. If a
21
+ workspace exists, read its `AGENTS.md` and relevant configuration;
22
+ `context entry [project-dir] --format json` may help locate instructions.
23
+ Neither a workspace nor a working Context CLI is required for package retrieval;
24
+ do not call entry in an arbitrary directory just to satisfy a prerequisite.
25
+ Do not execute returned production actions, initialize a replacement workspace,
26
+ or install tools without existing authorization. Querying must not alter source
27
+ registrations, snapshots, tasks, approvals or user checkouts.
28
+
29
+ ## Search available material concurrently
30
+
31
+ Check relevant knowledge packages, the workspace and reusable source checkouts
32
+ in parallel. Search each as soon as it is readable; tool checks and authorized
33
+ upgrades must not block independent reading. If a missing configured workspace
34
+ is needed for further attribution, recover it into an isolated directory while
35
+ package retrieval continues. Without a configured workspace, investigate the
36
+ available packages directly; do not request or create one merely to start.
37
+
38
+ A knowledge package may be workspace build output (usually `dist/`), a global
39
+ installation, or an equivalent host-provided directory. Locate it from available
40
+ configuration or installation metadata rather than assuming a fixed path.
41
+ Select packages relevant to the question. Follow their bundled query Skill when
42
+ present; otherwise search readable indexes and pages. Missing Skills or build
43
+ inventories do not block retrieval or justify rebuilding. If a needed package is
44
+ missing, use the host's configured, authorized package retrieval mechanism while
45
+ other reading continues. Only check or prepare tools needed for the next actual
46
+ operation; installation failure does not block independent local retrieval.
47
+
48
+ For gaps or latest-content questions, also search approved knowledge when a workspace is available:
49
+ use `knowledge/structure.yaml` and relevant `knowledge/` paths, trying business
50
+ terms, symbols and synonyms, then read matching sections in context. Delivered
51
+ content may lag approved knowledge; they are not independent corroboration.
52
+ Candidates and temporary reports are not approved pages. A search miss does not
53
+ prove a capability is absent. Do not build merely to answer a query; a separately
54
+ authorized build must follow its own workflow without advancing unrelated work.
55
+
56
+ When package or approved knowledge leaves a gap, directly trace relevant sources
57
+ without asking whether to deepen the query. Use available document, code-search
58
+ or extraction tools within the authorized scope, recording source identity and
59
+ version. Prepare sources while continuing other reading.
60
+ One failed source blocks only dependent claims. Answer when evidence is
61
+ sufficient, without completing unnecessary preparation.
62
+
63
+ ## Trace and retrieve only relevant sources
64
+
65
+ Without a workspace, use explicit source references in the package, its metadata
66
+ or user configuration to identify relevant documents or repository paths and
67
+ commits. Read or retrieve those sources directly within scope; the workspace
68
+ registry is not a mandatory intermediate step. If the source identity or version
69
+ cannot be established, retain package-grounded findings and qualify attribution;
70
+ do not invent a repository or equate current source with the package's baseline.
71
+
72
+ When a workspace and `context-build-inventory.json` are available, map a delivered page's
73
+ `dist_path` through `approved_knowledge.files` to its `approved_path`, relative
74
+ to the workspace's `knowledge/` root. Follow the approved page's associations in
75
+ `knowledge/structure.yaml` and `sources/*/index.yaml`. Without a reliable mapping,
76
+ continue package retrieval and follow explicit source references where available.
77
+ Do not guess originals from similar filenames or claim attribution without
78
+ checking the referenced material.
79
+
80
+ Use the repository and recorded commit identified by the package or workspace
81
+ as the source baseline.
82
+ Reuse existing checkouts only after checking remote, commit, module coverage
83
+ and local changes; do not reset them or change their sparse configuration.
84
+ Missing code goes into a reusable query-owned path such as
85
+ `.tmp/context-inspect/<host>/<repository-path>/<commit>/`, separate from user
86
+ checkouts and production-managed sources. Use safe, credential-free path
87
+ components and the full commit. Verify identity before reuse; never overwrite
88
+ a mismatched directory. Deduplicate recovery and use one writer per checkout;
89
+ that writer may append sparse paths without resetting existing files.
90
+
91
+ Default to lightweight retrieval and sparse checkout:
92
+
93
+ - Use shallow history (`--depth=1`) and deferred contents (`--filter=blob:none`)
94
+ where supported, with a complete partial-clone setup and named promisor remote.
95
+ Configure the sparse scope before checkout and verify the resulting commit.
96
+ - Start from known module paths. If unclear, inspect
97
+ `git ls-tree -r --name-only <commit>` for candidates, then read code to confirm
98
+ their relevance. Expand along imports, calls and service routes as needed;
99
+ deepen history only when needed. A sparse search miss is not a whole-repository miss.
100
+ - Read ready modules while other recovery proceeds. Allow sufficient command
101
+ time (for example 300 seconds or more), but investigate confirmed stalls
102
+ without waiting for timeout; silence alone is not a stall. If unsupported or
103
+ unsuccessful, try caches, commit-specific file retrieval or bounded shallow
104
+ retrieval; use a full clone only when necessary. Do not retry blindly or
105
+ silently substitute the default branch for an unavailable recorded commit.
106
+
107
+ Query retrieval never runs `context source restore`, `task prepare` or production
108
+ capture/recovery actions. Production recovery gates do not block this independent
109
+ inspection. Preserve unavailable-evidence gaps rather than changing production
110
+ state to get past them.
111
+
112
+ Compare relevant baseline files with current code when accessible, including
113
+ relevant local changes. Use actual diffs to assess impact; current code is not a
114
+ substitute for the baseline. Mention a missing comparison only when it limits
115
+ the answer. For documents, notes and sessions, read saved bodies and necessary
116
+ attachments; fetch missing accessible material within scope. A summary is not a
117
+ full transcript, an unread link is not evidence, and current remote content does
118
+ not prove a historical snapshot.
119
+
120
+ ## Answer with evidence and hand off updates
121
+
122
+ Lead with the conclusion and a concise evidence chain. Distinguish implementation,
123
+ declared contracts, test assertions, runtime observations and inferences. Perform
124
+ bounded non-destructive validation only when useful; inspect its effects first
125
+ and do not run unrelated scripts, builds or tests.
126
+
127
+ Link material actually read: source files at the inspected commit, knowledge
128
+ website articles and original documents. If no reliable clickable link exists,
129
+ give checkable local paths, symbols and short supporting excerpts with the
130
+ limitation. Do not dump internal reasoning, runtime identifiers or routine
131
+ version comparisons. Explain only differences affecting the answer; hashes may
132
+ appear in source URLs without requiring a separate version audit in the prose.
133
+
134
+ For website links, use `context-site-map.json` from the selected package or
135
+ sibling website output. Match `pages[].package_path` or `approved_path`, and
136
+ resolve `site_path` against `site_url` without prepending `base` again. Cite only
137
+ matched pages, deduplicate links and do not invent anchors. If mapping is absent
138
+ or invalid, retain local citations. Do not build, publish or probe remote sites
139
+ just to format citations; a local map is not proof of the current online content.
140
+
141
+ Suggest a knowledge update only with supporting evidence: identify the affected
142
+ page or gap, proposed change and bounded source scope. Check neighboring content
143
+ before proposing a new page. Only after user acceptance, hand the evidence and
144
+ scope to the installed `context` production Skill in the selected workspace and
145
+ its fresh Route. If no target workspace is known, resolve it at that handoff,
146
+ not as a prerequisite to answering. Do not edit approved knowledge, clear state
147
+ or reuse an earlier revision. If that entry
148
+ is unavailable, provide the handoff and state that no update has started.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "c4a",
3
3
  "displayName": "C4A Context",
4
- "version": "0.7.17",
4
+ "version": "0.7.20",
5
5
  "description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
6
6
  "author": {
7
7
  "name": "Context4AI",