simplicio-mapper 0.7.0__tar.gz → 0.7.1__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 (22) hide show
  1. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/CHANGELOG.md +16 -0
  2. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/PKG-INFO +6 -1
  3. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/PYPI.md +5 -0
  4. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/README.md +23 -2
  5. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/README.pt-BR.md +5 -2
  6. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/SIMPLICIO_INTEGRATION.md +8 -1
  7. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/pyproject.toml +1 -1
  8. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/simplicio_mapper/__init__.py +1 -1
  9. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/simplicio_mapper/cli.py +114 -0
  10. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/.catalog/README.md +0 -0
  11. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/.gitignore +0 -0
  12. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/LICENSE +0 -0
  13. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/docs-site/README.md +0 -0
  14. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/rust/README.md +0 -0
  15. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/rust/pyproject.toml +0 -0
  16. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/simplicio_mapper/_native.py +0 -0
  17. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/simplicio_mapper/cache.py +0 -0
  18. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/simplicio_mapper/mapper.py +0 -0
  19. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/simplicio_mapper/models.py +0 -0
  20. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/video/README.md +0 -0
  21. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/vscode-extension/LICENSE +0 -0
  22. {simplicio_mapper-0.7.0 → simplicio_mapper-0.7.1}/vscode-extension/README.md +0 -0
@@ -6,6 +6,22 @@ Format follows [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/) an
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.7.1] - 2026-06-01
10
+
11
+ ### Added
12
+ - `simplicio-mapper index|map|update --background` starts a detached refresh
13
+ and writes `.simplicio/background-index.log`, so long-running inventory
14
+ updates can proceed without blocking the foreground workflow.
15
+ - `simplicio-mapper index|map|update --docs-only` renders the Markdown wiki
16
+ view without emitting the index JSON payload, useful for docs-only refreshes.
17
+ - Compatibility aliases `--json-only` and `--changed-only` for orchestration
18
+ scripts that distinguish JSON-only and changed-file refresh modes.
19
+
20
+ ### Changed
21
+ - `simplicio-mapper index` now uses `.simplicio/index.lock` to avoid overlapping
22
+ foreground/background refreshes and returns a stable `status=skipped,
23
+ skipped_reason=locked` JSON contract when another refresh is active.
24
+
9
25
  ## [0.7.0] - 2026-06-01
10
26
 
11
27
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simplicio-mapper
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: Python-first project mapper that emits .simplicio/project-map.json and precedent-index.json for the Simplicio ecosystem.
5
5
  Project-URL: Homepage, https://github.com/wesleysimplicio/simplicio-mapper
6
6
  Project-URL: Repository, https://github.com/wesleysimplicio/simplicio-mapper
@@ -96,6 +96,7 @@ simplicio-mapper endpoints path/to/web --against path/to/api --json
96
96
  # Render architecture inventory markdown for wiki/docs review
97
97
  simplicio-mapper docs path/to/project --json
98
98
  simplicio-mapper export-docs path/to/project --target ./wiki-export --json
99
+ simplicio-mapper index path/to/project --docs --background
99
100
 
100
101
  # Map another project root, with hints when .starter-meta.json is absent
101
102
  simplicio-mapper map --root path/to/project --stack python --product-name "My App"
@@ -118,6 +119,10 @@ The `llm-project-mapper` console script is provided as an alias.
118
119
  | `--target <dir>` | Local target directory for `export-docs`. |
119
120
  | `--docs` | Render Markdown docs after `map` or `index`. |
120
121
  | `--no-docs` | Keep `map`/`index` JSON-only. |
122
+ | `--docs-only` | Render the Markdown docs without emitting the index JSON payload. |
123
+ | `--json-only` | Compatibility alias for keeping `map`/`index` JSON-only. |
124
+ | `--changed-only` | Compatibility alias for incremental refresh workflows. |
125
+ | `--background` | Start a detached index refresh and write `.simplicio/background-index.log`. |
121
126
  | `--json` | Emit stable `simplicio.mapper-index/v1` output for the `index` command. |
122
127
  | `--update` | Compatibility alias for index refresh workflows. |
123
128
  | `--verbose` | Show progress during `index` refreshes. |
@@ -49,6 +49,7 @@ simplicio-mapper endpoints path/to/web --against path/to/api --json
49
49
  # Render architecture inventory markdown for wiki/docs review
50
50
  simplicio-mapper docs path/to/project --json
51
51
  simplicio-mapper export-docs path/to/project --target ./wiki-export --json
52
+ simplicio-mapper index path/to/project --docs --background
52
53
 
53
54
  # Map another project root, with hints when .starter-meta.json is absent
54
55
  simplicio-mapper map --root path/to/project --stack python --product-name "My App"
@@ -71,6 +72,10 @@ The `llm-project-mapper` console script is provided as an alias.
71
72
  | `--target <dir>` | Local target directory for `export-docs`. |
72
73
  | `--docs` | Render Markdown docs after `map` or `index`. |
73
74
  | `--no-docs` | Keep `map`/`index` JSON-only. |
75
+ | `--docs-only` | Render the Markdown docs without emitting the index JSON payload. |
76
+ | `--json-only` | Compatibility alias for keeping `map`/`index` JSON-only. |
77
+ | `--changed-only` | Compatibility alias for incremental refresh workflows. |
78
+ | `--background` | Start a detached index refresh and write `.simplicio/background-index.log`. |
74
79
  | `--json` | Emit stable `simplicio.mapper-index/v1` output for the `index` command. |
75
80
  | `--update` | Compatibility alias for index refresh workflows. |
76
81
  | `--verbose` | Show progress during `index` refreshes. |
@@ -65,6 +65,7 @@ simplicio-mapper index --update . --json
65
65
  simplicio-mapper endpoints . --against ../api --json
66
66
  simplicio-mapper docs . --json # render .simplicio/docs markdown
67
67
  simplicio-mapper export-docs . --target ./wiki-export --json
68
+ simplicio-mapper index . --docs --background
68
69
  simplicio-mapper map --watch # re-map as files change locally
69
70
  ```
70
71
 
@@ -83,8 +84,10 @@ For architecture/wiki work, `simplicio-mapper map` now also writes
83
84
  `architecture-inventory.json`, `symbol-index.json`, and `call-graph.json`.
84
85
  Run `simplicio-mapper docs <path>` to render `.simplicio/docs/*.md`, or
85
86
  `simplicio-mapper index <path> --docs --json` to refresh JSON and Markdown in
86
- one deterministic pass. `export-docs` copies those Markdown files to a local
87
- target; remote wiki publication remains opt-in.
87
+ one deterministic pass. Use `--background` when the refresh should continue in
88
+ a detached process, and `--docs-only` when only the Markdown view needs to be
89
+ regenerated. `export-docs` copies those Markdown files to a local target; remote
90
+ wiki publication remains opt-in.
88
91
 
89
92
  Use `--watch` during long agent sessions to keep the map fresh. The schema and
90
93
  Python consumption example live in [SIMPLICIO_INTEGRATION.md](SIMPLICIO_INTEGRATION.md).
@@ -243,6 +246,24 @@ npx @wesleysimplicio/llm-project-mapper --dry-run --yes
243
246
  | `-v, --version` | Print version |
244
247
  | `-h, --help` | Show help |
245
248
 
249
+ #### Python mapper flags
250
+
251
+ | Flag | Purpose |
252
+ |---|---|
253
+ | `index <path>` | Scriptable mapper refresh. Returns `0` when updated, already fresh, or locked/skipped; returns `1` on failure |
254
+ | `docs <path>` | Render `.simplicio/docs/*.md` from the architecture inventory |
255
+ | `export-docs <path> --target <dir>` | Copy rendered Markdown docs to a local docs/wiki target |
256
+ | `--docs` | Render Markdown docs after `map` or `index` |
257
+ | `--no-docs` | Keep `map` / `index` JSON-only |
258
+ | `--docs-only` | Render Markdown docs without emitting the index JSON payload |
259
+ | `--json-only` | Compatibility alias for JSON-only refresh workflows |
260
+ | `--changed-only` | Compatibility alias for incremental refresh workflows |
261
+ | `--background` | Start a detached index refresh and log to `.simplicio/background-index.log` |
262
+ | `--json` | Emit stable JSON contracts such as `simplicio.mapper-index/v1` |
263
+ | `--update` | Compatibility alias for index refresh workflows |
264
+ | `--verbose` | Show index refresh progress |
265
+ | `--out <dir>` | Artifact directory, defaulting to `.simplicio` |
266
+
246
267
  ### B. `bootstrap.sh` — Unix shells (macOS / Linux / Git Bash / WSL)
247
268
 
248
269
  Clone the starter and run the script:
@@ -64,6 +64,7 @@ simplicio-mapper index --update . --json
64
64
  simplicio-mapper endpoints . --against ../api --json
65
65
  simplicio-mapper docs . --json # gera markdown em .simplicio/docs
66
66
  simplicio-mapper export-docs . --target ./wiki-export --json
67
+ simplicio-mapper index . --docs --background
67
68
  simplicio-mapper map --watch # remapeia conforme arquivos mudam
68
69
  ```
69
70
 
@@ -74,8 +75,10 @@ Para arquitetura/wiki, `simplicio-mapper map` agora tambem escreve
74
75
  `architecture-inventory.json`, `symbol-index.json` e `call-graph.json`.
75
76
  Rode `simplicio-mapper docs <path>` para gerar `.simplicio/docs/*.md`, ou
76
77
  `simplicio-mapper index <path> --docs --json` para atualizar JSON e Markdown
77
- na mesma passada deterministica. `export-docs` copia esses Markdown para um
78
- alvo local; publicacao remota de wiki continua opt-in.
78
+ na mesma passada deterministica. Use `--background` quando a atualizacao deve
79
+ continuar em processo destacado, e `--docs-only` quando apenas a visao Markdown
80
+ precisa ser regenerada. `export-docs` copia esses Markdown para um alvo local;
81
+ publicacao remota de wiki continua opt-in.
79
82
 
80
83
  Use `--watch` durante sessoes longas de agentes para manter o mapa fresco. O
81
84
  schema e um exemplo de consumo em Python ficam em
@@ -26,11 +26,16 @@ npx @wesleysimplicio/llm-project-mapper update
26
26
  simplicio-mapper index --update . --json
27
27
  simplicio-mapper docs . --json
28
28
  simplicio-mapper export-docs . --target ./wiki-export --json
29
+ simplicio-mapper index . --docs --background
29
30
  ```
30
31
 
31
32
  Use `--watch` for local live updates during longer agent sessions.
32
33
  Use `--docs` with `map` or `index` when the markdown wiki view should be
33
- refreshed in the same run.
34
+ refreshed in the same run. Use `--background` when the refresh should continue
35
+ without blocking the foreground workflow; concurrent refreshes are guarded by
36
+ `.simplicio/index.lock`. Use `--docs-only` for Markdown-only regeneration, and
37
+ the compatibility aliases `--json-only` / `--changed-only` when orchestrators
38
+ need those explicit modes.
34
39
 
35
40
  ## endpoint-inventory.json
36
41
 
@@ -194,6 +199,8 @@ Render human-readable docs from the JSON artifacts:
194
199
  ```bash
195
200
  simplicio-mapper docs . --json
196
201
  simplicio-mapper index . --docs --json
202
+ simplicio-mapper index . --docs --background
203
+ simplicio-mapper index . --docs-only --json
197
204
  simplicio-mapper export-docs . --target ./wiki-export --json
198
205
  ```
199
206
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "simplicio-mapper"
7
- version = "0.7.0"
7
+ version = "0.7.1"
8
8
  description = "Python-first project mapper that emits .simplicio/project-map.json and precedent-index.json for the Simplicio ecosystem."
9
9
  readme = "PYPI.md"
10
10
  requires-python = ">=3.10"
@@ -2,6 +2,6 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- __version__ = "0.7.0"
5
+ __version__ = "0.7.1"
6
6
 
7
7
  __all__ = ["__version__"]
@@ -59,6 +59,10 @@ OPTIONS
59
59
  --target <dir> Local target directory for export-docs.
60
60
  --docs Render markdown docs after map/index.
61
61
  --no-docs Keep map/index JSON-only.
62
+ --docs-only Render markdown docs without refreshing JSON first.
63
+ --json-only Compatibility alias for --no-docs.
64
+ --changed-only Compatibility alias for incremental refresh workflows.
65
+ --background Start an index refresh in a detached background process.
62
66
  --json Emit structured index output.
63
67
  --update Compatibility alias for index refresh workflows.
64
68
  --verbose Show progress during index refreshes.
@@ -94,6 +98,8 @@ def _parse_args(argv: Sequence[str]) -> dict:
94
98
  "json": False,
95
99
  "verbose": False,
96
100
  "docs": False,
101
+ "docs_only": False,
102
+ "background": False,
97
103
  "command": "map",
98
104
  "against": "",
99
105
  "target": "",
@@ -138,6 +144,15 @@ def _parse_args(argv: Sequence[str]) -> dict:
138
144
  opts["docs"] = True
139
145
  elif arg == "--no-docs":
140
146
  opts["docs"] = False
147
+ elif arg == "--json-only":
148
+ opts["docs"] = False
149
+ elif arg == "--docs-only":
150
+ opts["docs"] = True
151
+ opts["docs_only"] = True
152
+ elif arg == "--changed-only":
153
+ opts["incremental"] = True
154
+ elif arg == "--background":
155
+ opts["background"] = True
141
156
  elif arg == "--silent":
142
157
  opts["silent"] = True
143
158
  elif arg == "--json":
@@ -199,6 +214,31 @@ def _state_path(root: str, out: str) -> str:
199
214
  return os.path.join(os.path.abspath(os.path.join(root, out)), "index-state.json")
200
215
 
201
216
 
217
+ def _lock_path(root: str, out: str) -> str:
218
+ return os.path.join(os.path.abspath(os.path.join(root, out)), "index.lock")
219
+
220
+
221
+ def _acquire_index_lock(root: str, out: str) -> str | None:
222
+ path = _lock_path(root, out)
223
+ os.makedirs(os.path.dirname(path), exist_ok=True)
224
+ try:
225
+ fd = os.open(path, os.O_CREAT | os.O_EXCL | os.O_WRONLY)
226
+ except FileExistsError:
227
+ return None
228
+ with os.fdopen(fd, "w", encoding="utf-8") as handle:
229
+ handle.write(f"{os.getpid()}\n")
230
+ return path
231
+
232
+
233
+ def _release_index_lock(path: str | None) -> None:
234
+ if not path:
235
+ return
236
+ try:
237
+ os.unlink(path)
238
+ except OSError:
239
+ pass
240
+
241
+
202
242
  def _artifact_paths(root: str, out: str) -> dict[str, str]:
203
243
  abs_out = os.path.abspath(os.path.join(root, out))
204
244
  return {
@@ -871,9 +911,79 @@ def _run_export_docs(opts: dict) -> int:
871
911
  return 0
872
912
 
873
913
 
914
+ def _run_background(opts: dict) -> int:
915
+ root = os.path.abspath(opts["root"])
916
+ out = opts["out"]
917
+ abs_out = os.path.abspath(os.path.join(root, out))
918
+ os.makedirs(abs_out, exist_ok=True)
919
+ log_path = os.path.join(abs_out, "background-index.log")
920
+ args = [sys.executable, "-m", "simplicio_mapper.cli", "index", root, "--out", out]
921
+ if opts["stack"]:
922
+ args.extend(["--stack", opts["stack"]])
923
+ if opts["product_name"]:
924
+ args.extend(["--product-name", opts["product_name"]])
925
+ if opts["docs"]:
926
+ args.append("--docs")
927
+ if opts["incremental"]:
928
+ args.append("--update")
929
+ if opts["verbose"]:
930
+ args.append("--verbose")
931
+ env = os.environ.copy()
932
+ source_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
933
+ python_path = env.get("PYTHONPATH", "")
934
+ env["PYTHONPATH"] = os.pathsep.join([source_root, python_path]) if python_path else source_root
935
+ with open(log_path, "ab") as log:
936
+ child = subprocess.Popen( # noqa: S603 - self-invocation with fixed argv
937
+ args,
938
+ cwd=root,
939
+ env=env,
940
+ stdout=log,
941
+ stderr=subprocess.STDOUT,
942
+ start_new_session=True,
943
+ )
944
+ payload = {
945
+ "schema": "simplicio.background-index/v1",
946
+ "status": "started",
947
+ "pid": child.pid,
948
+ "log": log_path.replace(os.sep, "/"),
949
+ }
950
+ if opts["json"]:
951
+ print(json.dumps(payload, sort_keys=True))
952
+ else:
953
+ print(f"background index started pid={child.pid} log={log_path}")
954
+ return 0
955
+
956
+
874
957
  def _run_index(opts: dict) -> int:
875
958
  root = os.path.abspath(opts["root"])
876
959
  out = opts["out"]
960
+ lock = _acquire_index_lock(root, out)
961
+ if lock is None:
962
+ _emit_index_json(opts, _index_result(
963
+ root,
964
+ out,
965
+ status="skipped",
966
+ skipped_reason="locked",
967
+ counts={
968
+ "files": 0,
969
+ "precedents": 0,
970
+ "changed_files": 0,
971
+ "modules": 0,
972
+ "layers": 0,
973
+ "symbols": 0,
974
+ "relationships": 0,
975
+ },
976
+ ))
977
+ if not opts["json"]:
978
+ print(f"index skipped: lock already exists at {_lock_path(root, out)}")
979
+ return 0
980
+ try:
981
+ return _run_index_locked(opts, root, out)
982
+ finally:
983
+ _release_index_lock(lock)
984
+
985
+
986
+ def _run_index_locked(opts: dict, root: str, out: str) -> int:
877
987
  paths = _artifact_paths(root, out)
878
988
  state = _read_index_state(root, out)
879
989
  current_signature = _freshness_signature(root, out)
@@ -935,6 +1045,10 @@ def _watch(opts: dict) -> None:
935
1045
  def main(argv: Sequence[str] | None = None) -> int:
936
1046
  argv = list(sys.argv[1:] if argv is None else argv)
937
1047
  opts = _parse_args(argv)
1048
+ if opts["background"] and opts["command"] in ("index", "map", "update"):
1049
+ return _run_background(opts)
1050
+ if opts["docs_only"] and opts["command"] in ("index", "map", "update"):
1051
+ return _run_docs(opts)
938
1052
  if opts["command"] == "endpoints":
939
1053
  return _run_endpoints(opts)
940
1054
  if opts["command"] == "screens":