systemap 1.0.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 (112) hide show
  1. systemap-1.0.0/.claude/skills/systemap/SKILL.md +1 -0
  2. systemap-1.0.0/.claude-plugin/marketplace.json +22 -0
  3. systemap-1.0.0/.claude-plugin/plugin.json +13 -0
  4. systemap-1.0.0/.gitattributes +6 -0
  5. systemap-1.0.0/.github/workflows/systemap.yml +281 -0
  6. systemap-1.0.0/.gitignore +12 -0
  7. systemap-1.0.0/.python-version +1 -0
  8. systemap-1.0.0/CHANGELOG.md +1054 -0
  9. systemap-1.0.0/LICENSE +21 -0
  10. systemap-1.0.0/PKG-INFO +253 -0
  11. systemap-1.0.0/README.md +229 -0
  12. systemap-1.0.0/assets/hero-light.svg +13 -0
  13. systemap-1.0.0/assets/hero.svg +13 -0
  14. systemap-1.0.0/assets/logo-mark.svg +6 -0
  15. systemap-1.0.0/bench/results.jsonl +10 -0
  16. systemap-1.0.0/bench/run.sh +161 -0
  17. systemap-1.0.0/bench/summary.py +156 -0
  18. systemap-1.0.0/bench/table.py +157 -0
  19. systemap-1.0.0/docs/.nojekyll +0 -0
  20. systemap-1.0.0/docs/benchmarks.md +32 -0
  21. systemap-1.0.0/docs/index.html +5 -0
  22. systemap-1.0.0/docs/map/.gitkeep +0 -0
  23. systemap-1.0.0/docs/map/figures/control.svg +1 -0
  24. systemap-1.0.0/docs/map/figures/structure.svg +1 -0
  25. systemap-1.0.0/docs/map/figures/system.svg +1 -0
  26. systemap-1.0.0/docs/map/index.html +1390 -0
  27. systemap-1.0.0/docs/map/map.json +33 -0
  28. systemap-1.0.0/docs/reference.md +194 -0
  29. systemap-1.0.0/docs/screenshots/graphite.png +0 -0
  30. systemap-1.0.0/docs/screenshots/paper.png +0 -0
  31. systemap-1.0.0/docs/screenshots/tour.gif +0 -0
  32. systemap-1.0.0/docs/screenshots/warm.png +0 -0
  33. systemap-1.0.0/map/model.py +790 -0
  34. systemap-1.0.0/pyproject.toml +65 -0
  35. systemap-1.0.0/scripts/publish.sh +43 -0
  36. systemap-1.0.0/scripts/screenshots.py +218 -0
  37. systemap-1.0.0/skills/systemap/SKILL.md +240 -0
  38. systemap-1.0.0/skills/systemap/references/example.md +201 -0
  39. systemap-1.0.0/skills/systemap/references/journeys-and-invariants.md +63 -0
  40. systemap-1.0.0/skills/systemap/references/layers.md +154 -0
  41. systemap-1.0.0/skills/systemap/references/layout.md +116 -0
  42. systemap-1.0.0/skills/systemap/references/maintenance.md +73 -0
  43. systemap-1.0.0/skills/systemap/references/pitfalls.md +152 -0
  44. systemap-1.0.0/skills/systemap/references/schema.md +336 -0
  45. systemap-1.0.0/skills/systemap/references/second-pass.md +149 -0
  46. systemap-1.0.0/src/systemap/__init__.py +48 -0
  47. systemap-1.0.0/src/systemap/__main__.py +6 -0
  48. systemap-1.0.0/src/systemap/change.py +328 -0
  49. systemap-1.0.0/src/systemap/check.py +873 -0
  50. systemap-1.0.0/src/systemap/cli.py +1006 -0
  51. systemap-1.0.0/src/systemap/config.py +710 -0
  52. systemap-1.0.0/src/systemap/delta.py +670 -0
  53. systemap-1.0.0/src/systemap/describe.py +254 -0
  54. systemap-1.0.0/src/systemap/evidence.py +157 -0
  55. systemap-1.0.0/src/systemap/extract.py +938 -0
  56. systemap-1.0.0/src/systemap/facts.py +218 -0
  57. systemap-1.0.0/src/systemap/figure.py +370 -0
  58. systemap-1.0.0/src/systemap/judgement.py +622 -0
  59. systemap-1.0.0/src/systemap/model.py +732 -0
  60. systemap-1.0.0/src/systemap/nest.py +199 -0
  61. systemap-1.0.0/src/systemap/page.py +1003 -0
  62. systemap-1.0.0/src/systemap/place.py +1053 -0
  63. systemap-1.0.0/src/systemap/py.typed +0 -0
  64. systemap-1.0.0/src/systemap/route.py +819 -0
  65. systemap-1.0.0/src/systemap/scaffold.py +404 -0
  66. systemap-1.0.0/src/systemap/schematic.py +1915 -0
  67. systemap-1.0.0/src/systemap/skill/SKILL.md +240 -0
  68. systemap-1.0.0/src/systemap/skill/references/example.md +201 -0
  69. systemap-1.0.0/src/systemap/skill/references/journeys-and-invariants.md +63 -0
  70. systemap-1.0.0/src/systemap/skill/references/layers.md +154 -0
  71. systemap-1.0.0/src/systemap/skill/references/layout.md +116 -0
  72. systemap-1.0.0/src/systemap/skill/references/maintenance.md +73 -0
  73. systemap-1.0.0/src/systemap/skill/references/pitfalls.md +152 -0
  74. systemap-1.0.0/src/systemap/skill/references/schema.md +336 -0
  75. systemap-1.0.0/src/systemap/skill/references/second-pass.md +149 -0
  76. systemap-1.0.0/src/systemap/skill.py +61 -0
  77. systemap-1.0.0/src/systemap/suggest.py +184 -0
  78. systemap-1.0.0/src/systemap/theme.py +521 -0
  79. systemap-1.0.0/systemap.toml +61 -0
  80. systemap-1.0.0/tests/conftest.py +434 -0
  81. systemap-1.0.0/tests/fixture_workspace.py +1291 -0
  82. systemap-1.0.0/tests/fixtures/bench-session.jsonl +14 -0
  83. systemap-1.0.0/tests/page_driver.js +800 -0
  84. systemap-1.0.0/tests/test_agentic.py +207 -0
  85. systemap-1.0.0/tests/test_bench.py +260 -0
  86. systemap-1.0.0/tests/test_card_text.py +184 -0
  87. systemap-1.0.0/tests/test_check_rules.py +371 -0
  88. systemap-1.0.0/tests/test_cli.py +435 -0
  89. systemap-1.0.0/tests/test_coverage.py +253 -0
  90. systemap-1.0.0/tests/test_delta.py +360 -0
  91. systemap-1.0.0/tests/test_evidence.py +229 -0
  92. systemap-1.0.0/tests/test_extract.py +421 -0
  93. systemap-1.0.0/tests/test_facts.py +336 -0
  94. systemap-1.0.0/tests/test_framing.py +163 -0
  95. systemap-1.0.0/tests/test_interface.py +343 -0
  96. systemap-1.0.0/tests/test_judgement.py +837 -0
  97. systemap-1.0.0/tests/test_keyboard.py +213 -0
  98. systemap-1.0.0/tests/test_layer_figure.py +178 -0
  99. systemap-1.0.0/tests/test_layers.py +404 -0
  100. systemap-1.0.0/tests/test_layout.py +404 -0
  101. systemap-1.0.0/tests/test_model.py +258 -0
  102. systemap-1.0.0/tests/test_nested.py +745 -0
  103. systemap-1.0.0/tests/test_place.py +664 -0
  104. systemap-1.0.0/tests/test_platform.py +94 -0
  105. systemap-1.0.0/tests/test_plugin.py +92 -0
  106. systemap-1.0.0/tests/test_render.py +150 -0
  107. systemap-1.0.0/tests/test_screenshots.py +123 -0
  108. systemap-1.0.0/tests/test_skill.py +221 -0
  109. systemap-1.0.0/tests/test_suggest.py +153 -0
  110. systemap-1.0.0/tests/test_symbol_claims.py +217 -0
  111. systemap-1.0.0/tests/test_theme.py +408 -0
  112. systemap-1.0.0/uv.lock +381 -0
@@ -0,0 +1 @@
1
+ ../../../src/systemap/skill/SKILL.md
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
3
+ "name": "systemap",
4
+ "description": "systemap: the map your coding agent draws of your system. One plugin, one skill.",
5
+ "owner": {
6
+ "name": "0xfauzi",
7
+ "email": "wumpini.hussein@gmail.com"
8
+ },
9
+ "plugins": [
10
+ {
11
+ "name": "systemap",
12
+ "description": "The systemap skill: map a repository with systemap. Extracts the facts, drafts the model, checks it until every module is mapped, renders the page, hands back the judgement list.",
13
+ "author": {
14
+ "name": "0xfauzi",
15
+ "email": "wumpini.hussein@gmail.com"
16
+ },
17
+ "source": "./",
18
+ "category": "development",
19
+ "homepage": "https://github.com/0xfauzi/systemap"
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "systemap",
3
+ "version": "1.0.0",
4
+ "description": "The map your coding agent draws of your system: the systemap skill, which extracts the facts, drafts the model, checks it until every module is mapped, renders the page, makes a second pass with the judgement until nothing changes, and hands back the answers.",
5
+ "author": {
6
+ "name": "0xfauzi",
7
+ "email": "wumpini.hussein@gmail.com"
8
+ },
9
+ "homepage": "https://github.com/0xfauzi/systemap",
10
+ "repository": "https://github.com/0xfauzi/systemap",
11
+ "license": "MIT",
12
+ "keywords": ["architecture", "system map", "documentation", "coding agents"]
13
+ }
@@ -0,0 +1,6 @@
1
+ # Every text file is checked out with LF on every operating system, so a
2
+ # page or a facts file written on one machine is byte for byte what another
3
+ # renders, and the committed map is compared as written.
4
+ * text=auto eol=lf
5
+ *.png binary
6
+ *.gif binary
@@ -0,0 +1,281 @@
1
+ name: systemap
2
+
3
+ # Four things are checked here. The system map under docs/map is generated
4
+ # from the code and the model module, committed so the page can be served
5
+ # as-is and so the diff between two commits of the facts file records what
6
+ # changed about the system; the first job fails when the committed map no
7
+ # longer matches the tree or the renderer, and the fix is one command,
8
+ # named in the failure. The test suite and the type and lint gates run on
9
+ # Linux, macOS and Windows with the oldest and the newest Python the
10
+ # package supports. The built wheel is installed into a clean virtual
11
+ # environment on each of the three and run on a copy of this repository's
12
+ # own map from a directory that is not a checkout. And the repository is
13
+ # validated, added and installed as a Claude Code plugin with the CLI.
14
+
15
+ on:
16
+ push:
17
+ branches: [main]
18
+ pull_request:
19
+ # By hand, from the Actions tab or `gh workflow run`: the push of 0.11.2
20
+ # produced no run, and there was no way to ask for one.
21
+ workflow_dispatch:
22
+
23
+ # Read-only for every job; the delta job widens it for itself alone.
24
+ permissions:
25
+ contents: read
26
+
27
+ concurrency:
28
+ group: ${{ github.workflow }}-${{ github.ref }}
29
+ cancel-in-progress: true
30
+
31
+ jobs:
32
+ systemap:
33
+ runs-on: ubuntu-latest
34
+ timeout-minutes: 10
35
+ steps:
36
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
37
+ with:
38
+ persist-credentials: false
39
+
40
+ - name: Install uv
41
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
42
+ with:
43
+ version: latest
44
+ enable-cache: true
45
+
46
+ - name: Install project
47
+ run: uv sync --frozen --all-extras --dev
48
+
49
+ - name: facts match the tree
50
+ run: |
51
+ uv run systemap extract --check || {
52
+ echo "::error title=Map is stale::the facts no longer describe the tree. Run systemap refresh and commit the output directory."
53
+ exit 1
54
+ }
55
+
56
+ - name: layout, meaning and coverage are consistent
57
+ run: |
58
+ uv run systemap check || {
59
+ echo "::error title=Map check::the model contradicts itself or leaves a module unmapped; see the lines above."
60
+ exit 1
61
+ }
62
+
63
+ - name: every judgement line is answered
64
+ run: |
65
+ uv run systemap judgement --strict || {
66
+ echo "::error title=Judgement::a judgement line is unanswered. Act on it, or answer it under [judgement] answered in systemap.toml."
67
+ exit 1
68
+ }
69
+
70
+ - name: page matches the renderer
71
+ run: |
72
+ uv run systemap render --check || {
73
+ echo "::error title=Map is stale::index.html differs from what systemap renders. Run systemap refresh and commit the output directory."
74
+ exit 1
75
+ }
76
+
77
+ delta:
78
+ # What the pull request does to the map, as one comment: posted once,
79
+ # then updated in place on every push. The base and head commits reach
80
+ # the command through the environment, never through the template. A
81
+ # pull request from a fork has a read-only token, so the comment step
82
+ # warns instead of failing there; the delta is in the log either way.
83
+ if: github.event_name == 'pull_request'
84
+ runs-on: ubuntu-latest
85
+ timeout-minutes: 10
86
+ permissions:
87
+ contents: read
88
+ pull-requests: write # this job posts or updates the delta comment
89
+ steps:
90
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
91
+ with:
92
+ persist-credentials: false
93
+ fetch-depth: 0 # the base and the head commits, for the two extractions
94
+
95
+ - name: Install uv
96
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
97
+ with:
98
+ version: latest
99
+ enable-cache: true
100
+
101
+ - name: Install project
102
+ run: uv sync --frozen --all-extras --dev
103
+
104
+ - name: what this change does to the map
105
+ env:
106
+ BASE: ${{ github.event.pull_request.base.sha }}
107
+ HEAD: ${{ github.event.pull_request.head.sha }}
108
+ run: |
109
+ code=0
110
+ uv run systemap delta --base "$BASE" --head "$HEAD" --format markdown > delta.md || code=$?
111
+ echo "$code" > delta.code
112
+ if [ ! -s delta.md ]; then
113
+ printf '<!-- systemap delta -->\n## What this change does to the map\n\nsystemap delta could not run (exit %s); see the workflow log.\n' "$code" > delta.md
114
+ fi
115
+ cat delta.md
116
+
117
+ - name: post or update the comment
118
+ env:
119
+ GH_TOKEN: ${{ github.token }}
120
+ PR: ${{ github.event.pull_request.number }}
121
+ REPO: ${{ github.repository }}
122
+ run: |
123
+ existing="$(gh api "repos/$REPO/issues/$PR/comments" --paginate --jq 'map(select(.body | startswith("<!-- systemap delta -->"))) | first | .id // empty' | head -n 1)"
124
+ if [ -n "$existing" ]; then
125
+ gh api -X PATCH "repos/$REPO/issues/comments/$existing" -F body=@delta.md > /dev/null
126
+ else
127
+ gh api -X POST "repos/$REPO/issues/$PR/comments" -F body=@delta.md > /dev/null
128
+ fi || echo "::warning title=Map delta::could not post the comment (a pull request from a fork has a read-only token); the delta is in the step above."
129
+
130
+ - name: every line is acted on
131
+ run: |
132
+ code="$(cat delta.code)"
133
+ if [ "$code" != "0" ]; then
134
+ echo "::error title=Map delta::the change needs the map's attention; see the comment on the pull request, act on each line, then run systemap refresh."
135
+ fi
136
+ exit "$code"
137
+
138
+ test:
139
+ # The suite, the type check and the linter on every operating system the
140
+ # package claims, with the oldest and the newest Python it supports.
141
+ # UV_PYTHON overrides the repository's .python-version for the whole job,
142
+ # so uv creates the environment with the matrix interpreter. Node is on
143
+ # the runner for the keyboard test, which drives the page's script.
144
+ runs-on: ${{ matrix.os }}
145
+ timeout-minutes: 15
146
+ strategy:
147
+ fail-fast: false
148
+ matrix:
149
+ os: [ubuntu-latest, macos-latest, windows-latest]
150
+ python: ["3.11", "3.13"]
151
+ env:
152
+ UV_PYTHON: ${{ matrix.python }}
153
+ steps:
154
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
155
+ with:
156
+ persist-credentials: false
157
+
158
+ - name: Install uv
159
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
160
+ with:
161
+ version: latest
162
+ enable-cache: true
163
+
164
+ - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
165
+ with:
166
+ node-version: 22
167
+
168
+ - name: Install project
169
+ run: uv sync --frozen --all-extras --dev
170
+
171
+ - name: tests
172
+ run: uv run pytest -q
173
+
174
+ - name: types
175
+ run: uv run mypy src --strict
176
+
177
+ - name: lint
178
+ run: uv run ruff check .
179
+
180
+ - name: format
181
+ run: uv run ruff format --check src tests map bench
182
+
183
+ install:
184
+ # The wheel, installed with pip into a virtual environment that holds
185
+ # nothing else, run on a copy of this repository's own map from a
186
+ # directory beside the checkout: no .git, no source tree on the path,
187
+ # no uv at run time. init keeps every file that exists and writes the
188
+ # skill; extract reads the facts; refresh renders the page and the
189
+ # figures, since the check refuses a page that is not rendered and the
190
+ # committed page names the commit it was rendered at, which a copy
191
+ # without .git cannot reproduce; check and judgement are the gates a
192
+ # consumer's workflow runs.
193
+ runs-on: ${{ matrix.os }}
194
+ timeout-minutes: 15
195
+ strategy:
196
+ fail-fast: false
197
+ matrix:
198
+ os: [ubuntu-latest, macos-latest, windows-latest]
199
+ python: ["3.11", "3.13"]
200
+ env:
201
+ UV_PYTHON: ${{ matrix.python }}
202
+ defaults:
203
+ run:
204
+ shell: bash
205
+ steps:
206
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
207
+ with:
208
+ persist-credentials: false
209
+
210
+ - name: Install uv
211
+ uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0
212
+ with:
213
+ version: latest
214
+
215
+ - name: build the wheel
216
+ run: uv build --wheel
217
+
218
+ - name: install the wheel into a clean virtual environment
219
+ run: |
220
+ uv venv --seed venv
221
+ if [ "$RUNNER_OS" = "Windows" ]; then . venv/Scripts/activate; else . venv/bin/activate; fi
222
+ pip install --no-deps dist/systemap-*.whl
223
+ systemap --version
224
+ python -c "import systemap, sys; print(systemap.__version__, sys.version)"
225
+
226
+ - name: init, extract, refresh, check on a copy of the self-map beside the checkout
227
+ run: |
228
+ if [ "$RUNNER_OS" = "Windows" ]; then . venv/Scripts/activate; else . venv/bin/activate; fi
229
+ python -c "import shutil; shutil.copytree('.', '../selfmap', ignore=shutil.ignore_patterns('.git', '.venv', 'venv', 'dist', 'bench', 'node_modules', '__pycache__', '.mypy_cache', '.pytest_cache', '.ruff_cache'))"
230
+ cd ../selfmap
231
+ systemap init
232
+ systemap extract
233
+ systemap refresh
234
+ systemap check
235
+ systemap judgement --strict
236
+ systemap render --check
237
+ systemap describe
238
+
239
+ plugin:
240
+ # The repository is also a Claude Code plugin and its own marketplace.
241
+ # Both manifests, and the skill under skills/, are validated in strict
242
+ # mode so an unrecognised field or a missing description fails here.
243
+ # Then the checkout is added as a marketplace and the plugin installed
244
+ # from it with the CLI, into a configuration directory of its own, and
245
+ # the list must show it enabled: the install proof is mechanical.
246
+ # Adding a marketplace, installing and listing need no login (measured
247
+ # with an empty CLAUDE_CONFIG_DIR on the pinned version), so the job
248
+ # fails when any of the three does.
249
+ runs-on: ubuntu-latest
250
+ timeout-minutes: 10
251
+ steps:
252
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
253
+ with:
254
+ persist-credentials: false
255
+
256
+ - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
257
+ with:
258
+ node-version: 22
259
+
260
+ - name: Install the Claude Code CLI
261
+ # A global tool has no lockfile to install from; the version is the
262
+ # one the plugin was validated with locally, bumped on purpose.
263
+ run: npm install -g @anthropic-ai/claude-code@2.1.246 # zizmor: ignore[adhoc-packages]
264
+
265
+ - name: plugin manifest
266
+ run: claude plugin validate .claude-plugin/plugin.json --strict
267
+
268
+ - name: marketplace manifest
269
+ run: claude plugin validate .claude-plugin/marketplace.json --strict
270
+
271
+ - name: skills
272
+ run: claude plugin validate skills --strict
273
+
274
+ - name: the checkout as a marketplace, the plugin installed from it, listed
275
+ env:
276
+ CLAUDE_CONFIG_DIR: ${{ runner.temp }}/claude-config
277
+ run: |
278
+ claude plugin marketplace add ./
279
+ claude plugin install systemap@systemap
280
+ claude plugin list
281
+ claude plugin list --json | jq -e '.[] | select(.id == "systemap@systemap" and .enabled == true)' > /dev/null
@@ -0,0 +1,12 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ .mypy_cache/
5
+ .ruff_cache/
6
+ .pytest_cache/
7
+ dist/
8
+ *.egg-info/
9
+ .DS_Store
10
+ **/.DS_Store
11
+
12
+ bench/scratch/
@@ -0,0 +1 @@
1
+ 3.11