system-diff 0.2.0__tar.gz → 0.3.4__tar.gz

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.
Files changed (61) hide show
  1. {system_diff-0.2.0 → system_diff-0.3.4}/PKG-INFO +60 -32
  2. {system_diff-0.2.0 → system_diff-0.3.4}/README.md +59 -31
  3. system_diff-0.3.4/docs/diagrams/system.json +1055 -0
  4. {system_diff-0.2.0 → system_diff-0.3.4}/docs/diagrams/system.svg +44 -32
  5. {system_diff-0.2.0 → system_diff-0.3.4}/mods/system-diff/.claude-plugin/plugin.json +1 -1
  6. system_diff-0.3.4/mods/system-diff/hooks/page.tsx +205 -0
  7. system_diff-0.3.4/mods/system-diff/hooks/pane.test.tsx +184 -0
  8. system_diff-0.3.4/mods/system-diff/hooks/register.tsx +297 -0
  9. system_diff-0.3.4/mods/system-diff/types/index.d.ts +39 -0
  10. {system_diff-0.2.0 → system_diff-0.3.4}/pyproject.toml +1 -1
  11. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/__init__.py +1 -1
  12. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/activity.py +17 -5
  13. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/agent.py +21 -2
  14. system_diff-0.3.4/src/system_diff/architecture.py +324 -0
  15. system_diff-0.3.4/src/system_diff/canvas.py +521 -0
  16. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/cli.py +12 -1
  17. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/compare.py +3 -3
  18. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/config.py +20 -8
  19. system_diff-0.3.4/src/system_diff/design.py +486 -0
  20. system_diff-0.3.4/src/system_diff/extract.py +1048 -0
  21. system_diff-0.3.4/src/system_diff/inside.py +209 -0
  22. system_diff-0.3.4/src/system_diff/pane.py +383 -0
  23. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/panel.py +5 -8
  24. system_diff-0.3.4/src/system_diff/profile.py +41 -0
  25. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/topics.py +31 -0
  26. {system_diff-0.2.0 → system_diff-0.3.4}/system-diff.toml +94 -2
  27. system_diff-0.3.4/tests/test_capture.py +214 -0
  28. system_diff-0.3.4/tests/test_design_and_pane.py +227 -0
  29. {system_diff-0.2.0 → system_diff-0.3.4}/tests/test_terminal_and_learning.py +3 -2
  30. system_diff-0.2.0/docs/diagrams/system.json +0 -378
  31. system_diff-0.2.0/mods/system-diff/hooks/diagram.tsx +0 -182
  32. system_diff-0.2.0/mods/system-diff/hooks/pane.test.tsx +0 -139
  33. system_diff-0.2.0/mods/system-diff/hooks/register.tsx +0 -233
  34. system_diff-0.2.0/mods/system-diff/types/index.d.ts +0 -33
  35. system_diff-0.2.0/src/system_diff/extract.py +0 -307
  36. {system_diff-0.2.0 → system_diff-0.3.4}/.claude-plugin/marketplace.json +0 -0
  37. {system_diff-0.2.0 → system_diff-0.3.4}/.gitattributes +0 -0
  38. {system_diff-0.2.0 → system_diff-0.3.4}/.github/workflows/ci.yml +0 -0
  39. {system_diff-0.2.0 → system_diff-0.3.4}/.github/workflows/release.yml +0 -0
  40. {system_diff-0.2.0 → system_diff-0.3.4}/.github/workflows/system-diff.yml +0 -0
  41. {system_diff-0.2.0 → system_diff-0.3.4}/.gitignore +0 -0
  42. {system_diff-0.2.0 → system_diff-0.3.4}/LICENSE +0 -0
  43. {system_diff-0.2.0 → system_diff-0.3.4}/mods/system-diff/hooks/hooks.json +0 -0
  44. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/__main__.py +0 -0
  45. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/companion.py +0 -0
  46. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/diff.py +0 -0
  47. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/graph.py +0 -0
  48. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/learn.py +0 -0
  49. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/mcp_server.py +0 -0
  50. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/narrate.py +0 -0
  51. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/pictures.py +0 -0
  52. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/png.py +0 -0
  53. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/readme.py +0 -0
  54. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/sources.py +0 -0
  55. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/statusline.py +0 -0
  56. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/textmap.py +0 -0
  57. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/tui.py +0 -0
  58. {system_diff-0.2.0 → system_diff-0.3.4}/src/system_diff/watch.py +0 -0
  59. {system_diff-0.2.0 → system_diff-0.3.4}/tests/conftest.py +0 -0
  60. {system_diff-0.2.0 → system_diff-0.3.4}/tests/test_checkpoint_watch_mcp.py +0 -0
  61. {system_diff-0.2.0 → system_diff-0.3.4}/tests/test_system_diff.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: system-diff
3
- Version: 0.2.0
3
+ Version: 0.3.4
4
4
  Summary: Draws your system from its code (parts, entry points, data, outside systems) and what each change adds, changes or removes. No dependencies; SVG pictures for PRs and READMEs.
5
5
  Project-URL: Homepage, https://github.com/simplifiedmachine/system-diff
6
6
  Project-URL: Documentation, https://github.com/simplifiedmachine/system-diff/wiki
@@ -73,35 +73,48 @@ hooks it added before, and frees `/system-diff` for the pane.
73
73
 
74
74
  ### The System diff pane
75
75
 
76
- A tab beside Claude Code's own file diff: the *system* diff, live, in four views.
77
-
78
- - **Now** follows Claude, top to bottom in the order your attention needs it:
79
- - **What Claude is doing** and what that part is: "● Claude is working ✎ Editing API · an entry point: where
80
- people, other programs or AI tools reach the system", and what you asked.
81
- - **▲ Needs your attention**, only when something does: an endpoint removed or added, stored data changed, a new
82
- outside system, a part removed. Each with why it matters ("whatever called it now gets an error"). The moment to
83
- ask Claude why, or steer it.
84
- - **This turn**: every change to the system as a sentence ("API now uses Billing") with its reason in gray ("a
85
- change in Billing can now break API").
86
- - **The part, zoomed in on**: a diagram of what calls it and what it calls, its own endpoints and settings, what
87
- changed marked. **Click it, then ← ↑ ↓ → pick a block and Enter zooms in on it**, as far as you want to walk the
88
- system; `b` goes back, `f` follows Claude again, Esc hands the keys back.
89
- - **About the part**: what it is and does, what is changing in it and why that matters.
90
- - **What just happened**: › what you asked, ◎ what Claude read, ✎ what it edited, ▲ what each step did to the
91
- system, ✓ when it finished.
92
- - **Learn**: a topic behind the part, a new one every 20 seconds: the technologies its code imports (FastAPI,
93
- SQLAlchemy, React, subprocesses, threads…) and the ideas behind its role (entry points, layers, migrations,
94
- coupling…), in plain words.
95
- - **Map**: the whole system, a row of blocks per column (what people use, entry points, logic, data access, stored
96
- data, outside systems); the same keys pick and zoom in.
97
- - **Changes**: exactly what changed since your checkpoint, and this turn. Once you have understood it, tell Claude
98
- "mark it as seen" (or run `system-diff checkpoint`): from then on you see only what is new to you.
99
- - **Topics**: everything the system is built with, and which parts use each.
100
-
101
- One meaning per colour, so your eye goes where it should: **blue** is where Claude is and what you picked, **yellow**
102
- what changed and what needs you, **green** what is new, done or to learn, **white** what to read, **gray** the
103
- background (why, when, labels), **red** only what was taken away. Keys while the pane has the focus (ctrl+x tab, or a
104
- click): `n` `m` `c` `t` switch views.
76
+ A tab beside Claude Code's own file diff: your system drawn the way a system designer draws it, live, with what
77
+ Claude is changing in it. `/system-diff close` (or "× close" in its tab row) hides it; `/system-diff` brings it back.
78
+
79
+ - **Now** follows Claude, in the order your attention needs it:
80
+ - **What Claude is doing** ("● Claude is working ✎ Editing API") and what you asked.
81
+ - **▲ Needs your attention**, only when something does. That means: an endpoint removed that a page still calls, a
82
+ new way to change state, a dependency cycle, a dependency pointing up the layers, a new outside system inside a
83
+ request, a table dropped, or a setting no deploy sets. Each comes with what it trades off and the question to ask
84
+ Claude before it goes on.
85
+ - **The system diagram**:
86
+ - What it draws: who uses the system (people, programs, AI agents), where they come in, the containers that do
87
+ the work with their components inside, and the data and outside systems it relies on. Flows join them, named
88
+ for what they carry (HTTPS, MCP, SQL, a terminal).
89
+ - Colours: Claude's component is lit in blue; what this turn added is green, changed yellow, removed red.
90
+ - **Pick:** click the diagram, then ← ↑ ↓ → picks a box. Its flows in and out light up with the boxes at their
91
+ other ends, and a line says what it uses and what uses it.
92
+ - **Zoom:** Enter (or a second click) zooms in on a container's components, with the lines between them. `b` goes
93
+ back, `f` follows Claude again.
94
+ - **Scroll:** `[` `]` scroll a wide diagram across; shift ↑ ↓, Page Up/Down or the wheel scroll a tall one.
95
+ - **This turn**: each change to the design, and what it trades off.
96
+ - **Learn**: how the part Claude works on is designed.
97
+ - The principle its place calls for: an edge of the system, an adapter, a shared foundation, a coordinator.
98
+ - Where it sits, and what to watch, such as cycles and layering.
99
+ - The basics of a technology only where it is new: new to the system this turn, or one you marked new to you.
100
+ - **What just happened**: the system diff, step by step. Each change an edit made is said in plain words, with why
101
+ it matters and the file it came from. Edits that changed no structure are told once.
102
+ - **Map**: the system diagram since your checkpoint, every box to pick and zoom into.
103
+ - **Changes**: every change since your checkpoint, and this turn, read for design. Once you have understood it, tell
104
+ Claude "mark it as seen" (or run `system-diff checkpoint`): from then on you see only what is new to you.
105
+ - **Topics**: the stack, technology by technology. Pick one and the parts that use it light up in the diagram; space
106
+ marks it new to you, so Learn explains its basics.
107
+
108
+ One meaning per colour, so your eye goes where it should:
109
+
110
+ - **Blue:** where Claude is and what you picked.
111
+ - **Yellow:** what changed and what needs you.
112
+ - **Green:** what is new, done or to learn.
113
+ - **White:** what to read.
114
+ - **Gray:** the background (why, when, labels).
115
+ - **Red:** only what was taken away.
116
+
117
+ `n` `m` `c` `t` switch views.
105
118
 
106
119
  ### In the conversation
107
120
 
@@ -122,8 +135,16 @@ without touching your index, HEAD or branches; the checkpoint and the start of e
122
135
 
123
136
  ## Configuration
124
137
 
125
- With no config, every folder of code is a part named by its path. A `system-diff.toml` at the repository root names the
126
- parts and says what is what:
138
+ With no config, system-diff makes a first picture from the code:
139
+
140
+ - **Parts:** every folder of code is a part named by its path; tests and build tooling are left out.
141
+ - **Front end:** a front end goes under What people use, and the paths it calls are matched to the endpoints that
142
+ answer them.
143
+ - **Data and outside systems:** databases and outside services are found from the compose file and the client
144
+ libraries the code imports; tables from the migrations and the models.
145
+ - **Who uses it:** a front end's people, an API's callers, an MCP server's AI agents, a command line's developer.
146
+
147
+ A `system-diff.toml` at the repository root names the parts and says what is what:
127
148
 
128
149
  ```toml
129
150
  tests = ["tests/**"]
@@ -131,10 +152,17 @@ tests = ["tests/**"]
131
152
  [code]
132
153
  roots = ["app/", "web/src/"]
133
154
 
155
+ [[actors]] # who uses the system, drawn first
156
+ id = "customers"
157
+ label = "Customers"
158
+ uses = ["web:browser"] # part: what the flow carries
159
+
134
160
  [[components]]
135
161
  id = "api"
136
162
  label = "API"
137
163
  kind = "interface" # ui | interface | logic | data: the column it is drawn in
164
+ group = "Backend" # the container it is drawn in, with the others of its group
165
+ about = "orders and payments"
138
166
  paths = ["app/api/**"]
139
167
 
140
168
  [[externals]]
@@ -41,35 +41,48 @@ hooks it added before, and frees `/system-diff` for the pane.
41
41
 
42
42
  ### The System diff pane
43
43
 
44
- A tab beside Claude Code's own file diff: the *system* diff, live, in four views.
45
-
46
- - **Now** follows Claude, top to bottom in the order your attention needs it:
47
- - **What Claude is doing** and what that part is: "● Claude is working ✎ Editing API · an entry point: where
48
- people, other programs or AI tools reach the system", and what you asked.
49
- - **▲ Needs your attention**, only when something does: an endpoint removed or added, stored data changed, a new
50
- outside system, a part removed. Each with why it matters ("whatever called it now gets an error"). The moment to
51
- ask Claude why, or steer it.
52
- - **This turn**: every change to the system as a sentence ("API now uses Billing") with its reason in gray ("a
53
- change in Billing can now break API").
54
- - **The part, zoomed in on**: a diagram of what calls it and what it calls, its own endpoints and settings, what
55
- changed marked. **Click it, then ← ↑ ↓ → pick a block and Enter zooms in on it**, as far as you want to walk the
56
- system; `b` goes back, `f` follows Claude again, Esc hands the keys back.
57
- - **About the part**: what it is and does, what is changing in it and why that matters.
58
- - **What just happened**: › what you asked, ◎ what Claude read, ✎ what it edited, ▲ what each step did to the
59
- system, ✓ when it finished.
60
- - **Learn**: a topic behind the part, a new one every 20 seconds: the technologies its code imports (FastAPI,
61
- SQLAlchemy, React, subprocesses, threads…) and the ideas behind its role (entry points, layers, migrations,
62
- coupling…), in plain words.
63
- - **Map**: the whole system, a row of blocks per column (what people use, entry points, logic, data access, stored
64
- data, outside systems); the same keys pick and zoom in.
65
- - **Changes**: exactly what changed since your checkpoint, and this turn. Once you have understood it, tell Claude
66
- "mark it as seen" (or run `system-diff checkpoint`): from then on you see only what is new to you.
67
- - **Topics**: everything the system is built with, and which parts use each.
68
-
69
- One meaning per colour, so your eye goes where it should: **blue** is where Claude is and what you picked, **yellow**
70
- what changed and what needs you, **green** what is new, done or to learn, **white** what to read, **gray** the
71
- background (why, when, labels), **red** only what was taken away. Keys while the pane has the focus (ctrl+x tab, or a
72
- click): `n` `m` `c` `t` switch views.
44
+ A tab beside Claude Code's own file diff: your system drawn the way a system designer draws it, live, with what
45
+ Claude is changing in it. `/system-diff close` (or "× close" in its tab row) hides it; `/system-diff` brings it back.
46
+
47
+ - **Now** follows Claude, in the order your attention needs it:
48
+ - **What Claude is doing** ("● Claude is working ✎ Editing API") and what you asked.
49
+ - **▲ Needs your attention**, only when something does. That means: an endpoint removed that a page still calls, a
50
+ new way to change state, a dependency cycle, a dependency pointing up the layers, a new outside system inside a
51
+ request, a table dropped, or a setting no deploy sets. Each comes with what it trades off and the question to ask
52
+ Claude before it goes on.
53
+ - **The system diagram**:
54
+ - What it draws: who uses the system (people, programs, AI agents), where they come in, the containers that do
55
+ the work with their components inside, and the data and outside systems it relies on. Flows join them, named
56
+ for what they carry (HTTPS, MCP, SQL, a terminal).
57
+ - Colours: Claude's component is lit in blue; what this turn added is green, changed yellow, removed red.
58
+ - **Pick:** click the diagram, then ← ↑ ↓ → picks a box. Its flows in and out light up with the boxes at their
59
+ other ends, and a line says what it uses and what uses it.
60
+ - **Zoom:** Enter (or a second click) zooms in on a container's components, with the lines between them. `b` goes
61
+ back, `f` follows Claude again.
62
+ - **Scroll:** `[` `]` scroll a wide diagram across; shift ↑ ↓, Page Up/Down or the wheel scroll a tall one.
63
+ - **This turn**: each change to the design, and what it trades off.
64
+ - **Learn**: how the part Claude works on is designed.
65
+ - The principle its place calls for: an edge of the system, an adapter, a shared foundation, a coordinator.
66
+ - Where it sits, and what to watch, such as cycles and layering.
67
+ - The basics of a technology only where it is new: new to the system this turn, or one you marked new to you.
68
+ - **What just happened**: the system diff, step by step. Each change an edit made is said in plain words, with why
69
+ it matters and the file it came from. Edits that changed no structure are told once.
70
+ - **Map**: the system diagram since your checkpoint, every box to pick and zoom into.
71
+ - **Changes**: every change since your checkpoint, and this turn, read for design. Once you have understood it, tell
72
+ Claude "mark it as seen" (or run `system-diff checkpoint`): from then on you see only what is new to you.
73
+ - **Topics**: the stack, technology by technology. Pick one and the parts that use it light up in the diagram; space
74
+ marks it new to you, so Learn explains its basics.
75
+
76
+ One meaning per colour, so your eye goes where it should:
77
+
78
+ - **Blue:** where Claude is and what you picked.
79
+ - **Yellow:** what changed and what needs you.
80
+ - **Green:** what is new, done or to learn.
81
+ - **White:** what to read.
82
+ - **Gray:** the background (why, when, labels).
83
+ - **Red:** only what was taken away.
84
+
85
+ `n` `m` `c` `t` switch views.
73
86
 
74
87
  ### In the conversation
75
88
 
@@ -90,8 +103,16 @@ without touching your index, HEAD or branches; the checkpoint and the start of e
90
103
 
91
104
  ## Configuration
92
105
 
93
- With no config, every folder of code is a part named by its path. A `system-diff.toml` at the repository root names the
94
- parts and says what is what:
106
+ With no config, system-diff makes a first picture from the code:
107
+
108
+ - **Parts:** every folder of code is a part named by its path; tests and build tooling are left out.
109
+ - **Front end:** a front end goes under What people use, and the paths it calls are matched to the endpoints that
110
+ answer them.
111
+ - **Data and outside systems:** databases and outside services are found from the compose file and the client
112
+ libraries the code imports; tables from the migrations and the models.
113
+ - **Who uses it:** a front end's people, an API's callers, an MCP server's AI agents, a command line's developer.
114
+
115
+ A `system-diff.toml` at the repository root names the parts and says what is what:
95
116
 
96
117
  ```toml
97
118
  tests = ["tests/**"]
@@ -99,10 +120,17 @@ tests = ["tests/**"]
99
120
  [code]
100
121
  roots = ["app/", "web/src/"]
101
122
 
123
+ [[actors]] # who uses the system, drawn first
124
+ id = "customers"
125
+ label = "Customers"
126
+ uses = ["web:browser"] # part: what the flow carries
127
+
102
128
  [[components]]
103
129
  id = "api"
104
130
  label = "API"
105
131
  kind = "interface" # ui | interface | logic | data: the column it is drawn in
132
+ group = "Backend" # the container it is drawn in, with the others of its group
133
+ about = "orders and payments"
106
134
  paths = ["app/api/**"]
107
135
 
108
136
  [[externals]]