@grifhinz/logics-manager 2.1.2 → 2.3.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.
Files changed (49) hide show
  1. package/README.md +106 -4
  2. package/VERSION +1 -1
  3. package/clients/README.md +9 -0
  4. package/clients/shared-web/media/css/board.css +658 -0
  5. package/clients/shared-web/media/css/details.css +457 -0
  6. package/clients/shared-web/media/css/layout.css +123 -0
  7. package/clients/shared-web/media/css/toolbar.css +576 -0
  8. package/clients/shared-web/media/harnessApi.js +324 -0
  9. package/clients/shared-web/media/hostApi.js +213 -0
  10. package/clients/shared-web/media/hostApiContract.js +55 -0
  11. package/clients/shared-web/media/icon.png +0 -0
  12. package/clients/shared-web/media/layoutController.js +246 -0
  13. package/clients/shared-web/media/logics.svg +7 -0
  14. package/clients/shared-web/media/logicsModel.js +910 -0
  15. package/clients/shared-web/media/main.css +112 -0
  16. package/clients/shared-web/media/main.js +3 -0
  17. package/clients/shared-web/media/mainApp.js +1005 -0
  18. package/clients/shared-web/media/mainCore.js +604 -0
  19. package/clients/shared-web/media/mainInteractionHandlers.js +324 -0
  20. package/clients/shared-web/media/mainInteractions.js +378 -0
  21. package/clients/shared-web/media/renderBoard.js +3 -0
  22. package/clients/shared-web/media/renderBoardApp.js +1339 -0
  23. package/clients/shared-web/media/renderDetails.js +685 -0
  24. package/clients/shared-web/media/renderMarkdown.js +449 -0
  25. package/clients/shared-web/media/toolsPanelLayout.js +172 -0
  26. package/clients/shared-web/media/uiStatus.js +54 -0
  27. package/clients/shared-web/media/webviewChrome.js +405 -0
  28. package/clients/shared-web/media/webviewPersistence.js +116 -0
  29. package/clients/shared-web/media/webviewSelectors.js +491 -0
  30. package/clients/viewer/README.md +5 -0
  31. package/clients/viewer/browser-host.js +847 -0
  32. package/clients/viewer/index.html +237 -0
  33. package/clients/viewer/viewer.css +433 -0
  34. package/logics_manager/assist.py +94 -63
  35. package/logics_manager/assist_handoff.py +132 -0
  36. package/logics_manager/assist_surface.py +38 -0
  37. package/logics_manager/cli.py +152 -12
  38. package/logics_manager/cli_output.py +18 -0
  39. package/logics_manager/flow.py +1360 -84
  40. package/logics_manager/flow_evidence.py +63 -0
  41. package/logics_manager/index.py +3 -7
  42. package/logics_manager/insights.py +418 -0
  43. package/logics_manager/mcp.py +50 -0
  44. package/logics_manager/path_utils.py +31 -0
  45. package/logics_manager/sync.py +24 -12
  46. package/logics_manager/update_check.py +138 -0
  47. package/logics_manager/viewer.py +533 -0
  48. package/package.json +12 -6
  49. package/pyproject.toml +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![CI](https://github.com/AlexAgo83/logics-manager/actions/workflows/ci.yml/badge.svg)](https://github.com/AlexAgo83/logics-manager/actions/workflows/ci.yml)
4
4
  [![License](https://img.shields.io/github/license/AlexAgo83/logics-manager)](LICENSE)
5
- ![Version](https://img.shields.io/badge/version-v2.1.2-4C8BF5)
5
+ ![Version](https://img.shields.io/badge/version-v2.3.0-4C8BF5)
6
6
  ![VS Code](https://img.shields.io/badge/VS%20Code-1.86.0-007ACC?logo=visualstudiocode&logoColor=white)
7
7
  ![TypeScript](https://img.shields.io/badge/TypeScript-5.3.3-3178C6?logo=typescript&logoColor=white)
8
8
  ![Vitest](https://img.shields.io/badge/Vitest-2.1.8-6E9F18?logo=vitest&logoColor=white)
@@ -95,18 +95,102 @@ The CLI is the stable contract for Logics. It supports:
95
95
  - closing tasks, backlog items, and requests with consistency checks;
96
96
  - linting and auditing workflow traceability;
97
97
  - exporting indexes, context packs, and graph data;
98
+ - serving a read-only local browser viewer for the Logics corpus;
98
99
  - serving the bounded MCP tool surface.
99
100
 
100
101
  Useful commands:
101
102
 
102
103
  ```bash
103
104
  logics-manager flow list
104
- logics-manager flow promote request-to-backlog logics/request/req_001_example.md
105
- logics-manager flow promote backlog-to-task logics/backlog/item_001_example.md
106
- logics-manager flow finish task logics/tasks/task_001_example.md
105
+ logics-manager flow promote request-to-backlog req_001_example
106
+ logics-manager flow promote backlog-to-task item_001_example
107
+ logics-manager flow finish task task_001_example
107
108
  logics-manager sync context-pack req_001_example --format json
109
+ logics-manager view --open
110
+ logics-manager view --focus req_001_example --read --open
108
111
  ```
109
112
 
113
+ ### Local Browser Viewer
114
+
115
+ Use the CLI viewer when you want to inspect the Logics corpus outside VS Code:
116
+
117
+ ```bash
118
+ logics-manager view --open
119
+ ```
120
+
121
+ The viewer starts a localhost-only, read-only browser UI on `127.0.0.1:8765` by default. It shows the same workflow board/list experience as the extension, with search, filters, document previews, corpus insights, lint/audit health, Mermaid rendering, auto-refresh, and an edit shortcut that opens the selected Markdown file in the system editor.
122
+
123
+ Useful options:
124
+
125
+ ```bash
126
+ logics-manager view --port 0 --open
127
+ logics-manager view --host 127.0.0.1 --port 9876
128
+ logics-manager view --focus req_001_example --open
129
+ logics-manager view --focus logics/tasks/task_001_example.md --read --open
130
+ logics-manager view --no-open
131
+ ```
132
+
133
+ Use `--port 0` when the default port is already taken. The viewer is intentionally read-only; use the canonical CLI commands such as `flow promote`, `flow finish`, `lint`, and `audit` for workflow mutations.
134
+
135
+ Focused viewer links can point directly at a corpus item:
136
+
137
+ ```text
138
+ http://127.0.0.1:8765/?focus=logics/request/req_001_example.md
139
+ http://127.0.0.1:8765/?focus=logics/request/req_001_example.md&read=1
140
+ ```
141
+
142
+ If the viewer server is not already running, start it with the equivalent fallback command:
143
+
144
+ ```bash
145
+ logics-manager view --focus logics/request/req_001_example.md --open
146
+ logics-manager view --focus req_001_example --read --open
147
+ ```
148
+
149
+ This is the recommended assistant handoff pattern: provide the local viewer link for an already-running viewer and the CLI fallback command for a stopped server. Focus targets accept workflow refs such as `req_001_example`, `item_001_example`, or `task_001_example`, plus repo-relative Logics Markdown paths. Traversal and non-Logics paths are rejected.
150
+
151
+ ### CLI Contracts
152
+
153
+ Workflow target arguments accept these forms:
154
+
155
+ - a workflow ref, such as `req_001_example`, `item_001_example`, or `task_001_example`;
156
+ - a repo-relative Markdown path under the matching Logics directory, such as `logics/request/req_001_example.md`;
157
+ - an absolute path only when it resolves inside the current repository.
158
+
159
+ Mutation commands reject `..` traversal and files outside the repository before writing. Output paths passed with `--out` must also be repo-relative and remain inside the repository after resolution. Configured log/cache paths in `logics.yaml` may be repo-relative or absolute, but absolute paths must still resolve inside the current repository.
160
+
161
+ When a command supports `--format json`, stdout is a machine-readable JSON payload. Human-oriented status, diagnostics, and progress text should not be mixed into stdout for JSON mode. This makes JSON-mode commands safe to pipe into tools such as `jq` or consume from scripts.
162
+
163
+ `--json` is a shorthand for `--format json` on commands that support JSON output.
164
+
165
+ JSON-capable operator commands:
166
+
167
+ | Command | Purpose | JSON output |
168
+ | --- | --- | --- |
169
+ | `logics-manager status` | Summarize open workflow docs and next actions. | `--format json` or `--json` |
170
+ | `logics-manager health` | Show workflow health counts and issue signals. | `--format json` or `--json` |
171
+ | `logics-manager followups` | List follow-up areas with request creation commands. | `--format json` or `--json` |
172
+ | `logics-manager product-consistency` | Check product brief lineage links. | `--format json` or `--json` |
173
+ | `logics-manager search <query>` | Search workflow docs directly. | `--format json` or `--json` |
174
+ | `logics-manager index` | Regenerate `logics/INDEX.md`. | `--format json` or `--json` |
175
+ | `logics-manager lint` | Validate doc shape and changed-doc hygiene. | `--format json` or `--json` |
176
+ | `logics-manager audit` | Validate workflow traceability and governance. | `--format json` or `--json` |
177
+ | `logics-manager sync ...` | Read, list, search, repair, and export workflow state. | `--format json` or `--json` on supported subcommands |
178
+ | `logics-manager assist ...` | Build review, validation, context, and runtime summaries. | `--format json` or `--json` on supported subcommands |
179
+ | `logics-manager flow ...` | Create, promote, split, close, finish, and list docs. | `--format json` or `--json` on supported subcommands |
180
+
181
+ Operator triage flow:
182
+
183
+ ```bash
184
+ logics-manager status --json
185
+ logics-manager health --json
186
+ logics-manager product-consistency --json
187
+ logics-manager followups --source-kind product --json
188
+ ```
189
+
190
+ Use `status` first when you need the next work signal. Use `health` for corpus-level anomalies. Use `product-consistency --strict` in release checks when active product briefs must have valid lineage. Use `followups` for open actionable follow-up areas; add `--include-closed` only when auditing historical docs.
191
+
192
+ Multi-file workflow mutations such as `flow promote`, `flow split`, and `flow finish` validate their direct inputs before writing. New workflow docs are created with exclusive filesystem writes, so an ID collision fails instead of overwriting an existing file; rerun the command to allocate a fresh ID after reviewing `git status`/`git diff`. They still operate on Markdown files in the working tree rather than through a database or transaction service; if the filesystem fails mid-write, recover with git status/diff and rerun after cleanup.
193
+
110
194
  To update the installed CLI later:
111
195
 
112
196
  ```bash
@@ -304,6 +388,7 @@ Windows notes:
304
388
  - Create a fixture request with `logics-manager flow new request --title "Smoke test"` and confirm the compact synthetic request shape is generated.
305
389
  - Create a backlog item and a task from the UI and confirm markdown is generated.
306
390
  - Open `Read` on a Mermaid-bearing doc and confirm the graph is rendered.
391
+ - Run `logics-manager view --port 0 --open`, confirm the browser viewer loads repository docs, then stop it with `Ctrl+C`.
307
392
  - Promote request -> backlog and confirm links are updated.
308
393
  - Confirm request/backlog/task generation fails fast if a Mermaid signature or traceability block is stale instead of waiting for audit to find it later.
309
394
  - Promote backlog -> task and confirm task document is generated.
@@ -348,6 +433,22 @@ npm run dev
348
433
 
349
434
  `npm run dev` requires the `code` CLI on PATH, so the F5 path above remains the safest cross-platform dev entrypoint.
350
435
 
436
+ ### Browser UI Debugging
437
+
438
+ Use the real local viewer for repository data:
439
+
440
+ ```bash
441
+ logics-manager view --open
442
+ ```
443
+
444
+ Use the mock webview harness only when developing the shared browser/webview UI without VS Code:
445
+
446
+ ```bash
447
+ npm run debug:webview
448
+ ```
449
+
450
+ The harness runs at `http://localhost:4173/` and supports mock scenarios such as `/?scenario=empty` and `/?scenario=error`. It does not execute real VS Code commands or workflow writes.
451
+
351
452
  ## Deploy / Release (VSIX)
352
453
 
353
454
  1. Bump the version in `package.json`, `pyproject.toml`, and root `VERSION` when preparing a release manually.
@@ -403,6 +504,7 @@ If the current plugin version is already published, `logics-manager assist next-
403
504
  - Logics docs lint: `npm run lint:logics`
404
505
  - Logics workflow audit + docs lint: `npm run audit:logics`
405
506
  - Strict Logics governance audit: `npm run audit:logics:strict`
507
+ - Local browser viewer smoke: `logics-manager view --port 0 --open`
406
508
  - Fast extension-focused local check: `npm run ci:fast`
407
509
  - Full CI-equivalent local check: `npm run ci:check`
408
510
  - Security audit policy gate: `npm run audit:ci`
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.2
1
+ 2.3.0
@@ -0,0 +1,9 @@
1
+ # Logics Clients
2
+
3
+ This directory separates user-facing clients from the shared Logics runtime.
4
+
5
+ - `vscode/` contains the VS Code extension host implementation.
6
+ - `shared-web/` contains browser/webview assets that can be reused by the VS Code extension and the future local viewer.
7
+ - `viewer/` is reserved for the CLI-launched local browser viewer.
8
+
9
+ The Python CLI/runtime remains in `logics_manager/`.