thurview 0.17.2 → 0.19.0

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.
@@ -62,10 +62,11 @@ Read the guidance files that exist, in this order; the second wins on conflict.
62
62
  `thurview explain` lists the ones it found under `guidance`.
63
63
 
64
64
  The `thurview` skill ships the references this one shares - document authoring,
65
- components, software map, theme, lifecycle. `thurview skill` prints the path of
65
+ components, software map, searching the code, theme, lifecycle. `thurview skill` prints the path of
66
66
  every bundled SKILL.md; the references sit beside each one. Read **Document
67
67
  authoring** before you write `review.md`, **Components** before you edit
68
- `data.yaml`, **Software map** before you author `map.yaml`, **Theme** before you
68
+ `data.yaml`, **Software map** before you author `map.yaml`, **Searching the
69
+ code** before you look for callers, tests or importers, **Theme** before you
69
70
  write `theme.yaml`, and **Lifecycle** for statuses, storage and thread rules -
70
71
  they are identical for all three kinds.
71
72
 
@@ -86,8 +87,7 @@ thurview explain --commit v1.2.0 # a released commit rather than HEAD
86
87
 
87
88
  The positional argument is a path or a glob; a bare path means that directory
88
89
  and everything under it. It is the **scope**, and everything else obeys it:
89
- `graph architecture` reports the clusters inside it, and coverage accounts for
90
- every file inside it. A scope that matches no file at that commit is refused.
90
+ your searches stay inside it, and coverage accounts for every file inside it. A scope that matches no file at that commit is refused.
91
91
 
92
92
  Record `explainer.id`, `explainer.dir`, `explainer.commit`, `explainer.scope`
93
93
  and `scale.filesInScope` from the output. Everywhere else the id is passed as
@@ -103,10 +103,12 @@ misleading about architecture, which is the one thing an explainer must not be.
103
103
  So work in three layers, and let each carry what it is good at.
104
104
 
105
105
  1. **System — the map carries breadth.** Author `map.yaml` first, seeded from
106
- `thurview graph architecture --review <id>`: communities become nodes, their
107
- files become the node's `files` globs, and the edges between communities
108
- become edges. Every part of the scope should appear here, including the parts
109
- the prose will not reach. See the `thurview` skill's Software map
106
+ the code: the directories in scope become candidate nodes and their files
107
+ the node's `files` globs, and what imports what between them becomes the
108
+ edges. `git ls-tree -d -r --name-only <commit> -- <scope>` lists the
109
+ directories; the `thurview` skill's Searching the code reference has the
110
+ import recipes. Every part of the scope should appear here, including the
111
+ parts the prose will not reach. See the `thurview` skill's Software map
110
112
  reference for the shape.
111
113
  2. **Subsystem — the prose carries depth.** Pick the parts that carry the most
112
114
  structure and the most traffic, and explain those. Three to six sections.
@@ -114,27 +116,37 @@ So work in three layers, and let each carry what it is good at.
114
116
  3. **File and symbol — anchors carry the proof.** Every claim gets an anchor.
115
117
  The reader opens code where they want it and nowhere else.
116
118
 
117
- **Select by structure, not by taste, and say what you selected on.** The graph
118
- gives you the basis: cluster size in files and symbols, the hub symbols of each
119
- cluster (most referenced), and the reference counts on the edges between
120
- clusters. Say in the document which parts you took and why they were the ones -
121
- "the two clusters with the most traffic between them" is a reason a reader can
122
- check. "The interesting bits" is not.
119
+ **Select by structure, not by taste, and say what you selected on.** Your
120
+ searches give you the basis: how many files a part holds, which of its names
121
+ the rest of the scope references most, and how many places one part imports
122
+ another. Say in the document which parts you took and why they were the ones -
123
+ "the two parts that import each other most" is a reason a reader can check,
124
+ with the searches that counted it in `searches`. "The interesting bits" is not.
123
125
 
124
126
  ## Coverage is derived, not claimed
125
127
 
126
128
  `thurview publish` accounts for every file in scope at the pinned commit and
127
- puts one of three states on it:
129
+ puts one of four states on it, from what you did that it can check:
128
130
 
129
131
  - **explained** - an anchor in the document points into the file.
130
132
  - **placed** - a map node's `files` globs match it, and no anchor does. The
131
133
  reader is told where it sits, not what it does.
132
- - **not examined** - neither.
134
+ - **searched** - a search you recorded under `searches` in `data.yaml` matched
135
+ it, and nothing above did. You saw lines of it; the document says nothing
136
+ about it.
137
+ - **not examined** - none of the above.
138
+
139
+ Record the searches you ran - for callers, tests, importers - under `searches`,
140
+ each with its `pattern`, optional `paths` and a `why`. `publish` re-runs every
141
+ one with `git grep -E` at the pinned commit, so what it counts is what the
142
+ commit holds, not what you remember, and a search that matched nothing is shown
143
+ as the zero it is. The shape is in the `thurview` skill's Components reference,
144
+ the recipes in its Searching the code reference.
133
145
 
134
146
  The counts go above the document and onto the Coverage tab, and `publish`
135
147
  prints them with the files it did not examine. You cannot forget to state
136
148
  coverage, and you cannot overstate it: to move a file out of _not examined_ you
137
- have to actually anchor it or actually place it on the map.
149
+ have to actually anchor it, place it on the map, or search it.
138
150
 
139
151
  Two consequences worth planning for:
140
152
 
@@ -145,12 +157,9 @@ Two consequences worth planning for:
145
157
  globs it owns and how many files they match, so `**/*` on one node inflates
146
158
  nothing quietly.
147
159
 
148
- Coverage also states what the code graph could not read: files in languages it
149
- does not parse (`thurview graph` covers TypeScript, JavaScript, Python, Go,
150
- Rust, Java and Elixir), and whether its file list was capped. Those files are absent
151
- from the structure, not empty. If a large part of the scope is outside the
152
- graph, say so in the document rather than letting the map imply the system is
153
- smaller than it is.
160
+ Coverage is the same for every language: it counts files at the commit, so a
161
+ config file, a stylesheet or a language nothing parses is accounted for like
162
+ any other.
154
163
 
155
164
  ## Surface structure; do not grade it
156
165
 
@@ -160,7 +169,8 @@ the reader can **detect** design problems. That is only consistent with the
160
169
  thesis if you surface structure and leave the conclusion to them.
161
170
 
162
171
  The test: **every fact in an explainer is a count, or a list of named things,
163
- at the pinned commit, that the reader could re-derive with `thurview graph`.**
172
+ at the pinned commit, that the reader could re-derive with `git grep` or
173
+ `git ls-tree`.**
164
174
 
165
175
  Observation - write these:
166
176
 
@@ -169,7 +179,8 @@ Observation - write these:
169
179
  - "The API layer reaches the database layer in 14 places and the model layer in
170
180
  2; the model layer reaches the API layer in 6."
171
181
  - "Nothing in the scope references `legacy/` at this commit."
172
- - "No test file reaches this cluster." (a count of zero, stated as one)
182
+ - "No test file names anything in `src/store`." (a count of zero, stated as
183
+ one, with the search that found it)
173
184
 
174
185
  Judgement - never write these:
175
186
 
@@ -188,11 +199,12 @@ the code" - not a finding.
188
199
  ## Workflow
189
200
 
190
201
  1. `thurview explain [<scope>]`. Note the id, the commit and the scope.
191
- 2. `thurview graph architecture --review <id>`. This is the structure at the
192
- pinned commit; do not re-derive it by reading directories.
193
- `thurview graph callers <name>` and `tests-for <name>` answer the follow-ups.
194
- `graph interfaces` and `graph impact` compare two commits and are refused.
195
- 3. Author `map.yaml` from the architecture output, covering the whole scope.
202
+ 2. Survey the scope at the pinned commit: its directories and files
203
+ (`git ls-tree`), then what imports what between them and who calls the
204
+ names that recur, with the `git grep` recipes in the `thurview` skill's
205
+ Searching the code reference. Record each search that shapes what you write
206
+ under `searches` in `data.yaml`.
207
+ 3. Author `map.yaml` from that survey, covering the whole scope.
196
208
  Dispatch a sub-agent for it if you have one, exactly as the `thurview`
197
209
  skill's review does.
198
210
  4. Author `review.md` and `data.yaml` per **Document authoring**, minus the
@@ -202,10 +214,14 @@ the code" - not a finding.
202
214
  `graph: base` on an anchor - there is one commit.
203
215
  5. `theme.yaml` as usual - see **Theme**.
204
216
  6. `thurview publish --review <id>`. Read `coverage` and `notExamined`. If the
205
- split is not the one you meant, anchor or place more and publish again.
217
+ split is not the one you meant, anchor, place or search more and publish
218
+ again.
206
219
  7. `thurview open --review <id>`, then `thurview wait --review <id>`. The loop,
207
220
  the statuses and the thread rules are identical to a review; see
208
221
  **Lifecycle**.
222
+ 8. To share it beyond the browser, `thurview export --review <id> --out <path>`
223
+ writes a static, read-only copy - see the `thurview` skill's **Sharing a
224
+ copy that needs no server**.
209
225
 
210
226
  ## Hand over
211
227
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: thurview-fix
3
- description: Review a change and fix what the review finds - bugs, regressions for callers, missing or broken tests, security issues - with thurview's code graph showing the callers and tests a diff does not. Commits only the fixes that pass the repository's own tests and lint, and reports the rest. Use when the user asks to review and fix a branch, a commit range or a pull or merge request, to find and fix bugs in a change, or invokes /thurview-fix.
3
+ description: Review a change and fix what the review finds - bugs, regressions for callers, missing or broken tests, security issues - with a search of the callers and tests a diff does not show. Commits only the fixes that pass the repository's own tests and lint, and reports the rest. Use when the user asks to review and fix a branch, a commit range or a pull or merge request, to find and fix bugs in a change, or invokes /thurview-fix.
4
4
  user-invocable: true
5
5
  argument-hint: "[<branch> | <base>..<head> | <PR or MR number or URL>] [--post]"
6
6
  ---
@@ -8,12 +8,12 @@ argument-hint: "[<branch> | <base>..<head> | <PR or MR number or URL>] [--post]"
8
8
  # thurview-fix
9
9
 
10
10
  Review a change, fix what you are sure of, report the rest. The diff shows what
11
- changed; thurview's code graph shows what depends on it, which is where a
12
- change breaks code the diff never shows.
11
+ changed; a search of the code around it shows what depends on it, which is
12
+ where a change breaks code the diff never shows.
13
13
 
14
14
  ```mermaid
15
15
  flowchart LR
16
- A[Scope: pin base and head] --> B[Graph: who reaches the change]
16
+ A[Scope: pin base and head] --> B[Search: who reaches the change]
17
17
  B --> C[Findings]
18
18
  C --> D[Fix, then the repo's tests and lint]
19
19
  D -->|green| E[One fix commit]
@@ -42,49 +42,53 @@ $ARGUMENTS
42
42
  ## 1. Scope
43
43
 
44
44
  Start from a clean tree (`git status --porcelain` prints nothing), otherwise
45
- ask: the fixes get committed. Check out the head, then pin both commits with
46
- one graph call:
45
+ ask: the fixes get committed. Check out the head, then pin both commits:
47
46
 
48
- | Request | Check out | Pin with |
49
- | ------------------ | ---------------------------------------------- | --------------------------------------------------------------------------------- |
50
- | empty | the current branch | `thurview graph impact --head HEAD` |
51
- | a branch | `git switch <branch>` | `thurview graph impact --head HEAD` |
52
- | `<base>..<head>` | the branch at `<head>` | `thurview graph impact --base <base> --head HEAD` |
53
- | a PR or MR ref/URL | `gh pr checkout <n>` or `glab mr checkout <n>` | `thurview graph impact --base $(git merge-base origin/<target> HEAD) --head HEAD` |
47
+ | Request | Check out | Base |
48
+ | ------------------ | ---------------------------------------------- | ------------------------------------- |
49
+ | empty | the current branch | `git merge-base origin/HEAD HEAD` |
50
+ | a branch | `git switch <branch>` | `git merge-base origin/HEAD HEAD` |
51
+ | `<base>..<head>` | the branch at `<head>` | `git rev-parse <base>` |
52
+ | a PR or MR ref/URL | `gh pr checkout <n>` or `glab mr checkout <n>` | `git merge-base origin/<target> HEAD` |
54
53
 
55
- With `--head` alone the base is where head forked from trunk. For a change
56
- request, `thurview forge status --change <ref>` names `<target>` as
57
- `change.baseBranch`.
54
+ Head is `git rev-parse HEAD`, taken now. For a change request,
55
+ `thurview forge status --change <ref>` names `<target>` as
56
+ `change.baseBranch`; when `origin/HEAD` is unset, use the trunk branch by name.
58
57
 
59
- The output's `base` and `head` are the pins. Pass `--base <base> --head <head>`
60
- to every later graph command, as its `help` lines do, so your fix commit does
61
- not move what you are reviewing.
58
+ Write both full shas down and use them, not `HEAD`, in every later command, so
59
+ your fix commit does not move what you are reviewing.
62
60
 
63
- ## 2. Ask the graph
61
+ ## 2. Search what the change reaches
62
+
63
+ List what changed, then find what the diff does not show, at the pins, with
64
+ the recipes in the `thurview` skill's Searching the code reference
65
+ (`thurview skill` prints its path):
64
66
 
65
67
  ```sh
66
- thurview graph impact --base <base> --head <head> # changed symbols, who reaches them, tests
67
- thurview graph interfaces --base <base> --head <head> # exports and signatures that moved
68
- thurview graph callers <name> --base <base> --head <head> # every call site; --graph base for before
69
- thurview graph tests-for <name> --base <base> --head <head>
68
+ git diff --stat <base> <head> # the files
69
+ git diff <base> <head> # the change
70
+ git grep -n -E -e '\bname *\(' <head> -- # who calls a changed symbol now
71
+ git grep -n -E -e '\bname *\(' <base> -- # who called it before; a removed one's callers are only here
72
+ git grep -n -E -e '\bname\b' <head> -- '*test*' '*spec*' # which tests name it
70
73
  ```
71
74
 
72
- What to take from them:
75
+ What to look for:
73
76
 
74
- - **`impact.reach`** lists code that calls a changed symbol and was not changed
75
- itself - what the author may have forgotten. `at` is the line of the call,
76
- `via` the changed symbol it reaches. Read each call site against the new
77
- behaviour: this is the finding a diff cannot give you.
78
- - **`reach[].tested: false`**: no test reaches that caller, so nothing catches
79
- a break there.
80
- - **`interfaces`** rows `changed` or `removed`: run `callers` on each, with
81
- `--graph base` for a removed one, since head no longer has its callers.
82
- - **`impact.untested`**: changed symbols no test reaches.
83
- - **`unresolved`, `truncated`**: references the graph could not resolve and
84
- files past its cap. "No callers" is only as true as those allow; say so when
85
- a finding rests on it.
77
+ - **Callers the change left alone.** For every function, method, type or
78
+ export whose signature or behaviour the diff changed, search its callers at
79
+ head and drop the ones the diff itself touched. What is left is what the
80
+ author may have forgotten: read each call site against the new behaviour.
81
+ This is the finding a diff cannot give you.
82
+ - **Removed or renamed interfaces.** Search the old name at head: any hit is
83
+ a caller the change broke.
84
+ - **Untested reach.** A changed symbol, or a caller of one, that no test names
85
+ has nothing to catch a break there.
86
+ - **What a search misses.** A text search finds names, not meaning: a call
87
+ through a variable, a re-export or a string-built name escapes it. "No
88
+ callers" is only as true as the forms you searched; say which when a finding
89
+ rests on it.
86
90
 
87
- Then read the diff (`git diff <base> <head>`) and every call site the rows name.
91
+ Then read every call site the searches name.
88
92
 
89
93
  ## 3. Findings
90
94
 
@@ -95,8 +99,9 @@ For each one, record:
95
99
  `medium` (a likely bug, or a risky path no test reaches), `low` (real but
96
100
  narrow)
97
101
  - why, in one line
98
- - the graph evidence when there is some, e.g.
99
- `reach: checkout src/cart.js:5 via discount, tested false`
102
+ - the search evidence when there is some: the search and the hit, e.g.
103
+ `git grep -n -E -e '\bdiscount *\(' <head>` → `src/cart.js:5`, no test names
104
+ it
100
105
 
101
106
  Security means input crossing a trust boundary: a shell command, query or path
102
107
  built from it, a secret reaching a log, an authorization check the change
@@ -133,9 +138,9 @@ git commit -m "fix: address review findings" -m "<one line per fix: file:line -
133
138
 
134
139
  ## 5. Report
135
140
 
136
- One table - severity, `file:line`, the finding, its graph evidence, and the fix
137
- commit or why it is unfixed - then the tests and lint after the commit, and
138
- what the graph could not see. Do not push; offer to.
141
+ One table - severity, `file:line`, the finding, its search evidence, and the
142
+ fix commit or why it is unfixed - then the tests and lint after the commit, and
143
+ what the searches could not see. Do not push; offer to.
139
144
 
140
145
  ## 6. Post, with `--post` only
141
146