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