qlix 0.3.2__tar.gz → 0.3.3__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 (110) hide show
  1. {qlix-0.3.2 → qlix-0.3.3}/BACKLOG.md +1 -1
  2. {qlix-0.3.2 → qlix-0.3.3}/CLI.md +1 -1
  3. {qlix-0.3.2 → qlix-0.3.3}/PKG-INFO +3 -3
  4. {qlix-0.3.2 → qlix-0.3.3}/README.md +2 -2
  5. {qlix-0.3.2 → qlix-0.3.3}/pyproject.toml +1 -1
  6. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/SKILL.md +1 -1
  7. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/broker.py +1 -1
  8. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/cli.py +5 -1
  9. {qlix-0.3.2 → qlix-0.3.3}/tests/test_broker.py +3 -0
  10. {qlix-0.3.2 → qlix-0.3.3}/tests/test_dsl_cli.py +27 -0
  11. {qlix-0.3.2 → qlix-0.3.3}/uv.lock +1 -1
  12. {qlix-0.3.2 → qlix-0.3.3}/.github/workflows/ci.yml +0 -0
  13. {qlix-0.3.2 → qlix-0.3.3}/.github/workflows/publish.yml +0 -0
  14. {qlix-0.3.2 → qlix-0.3.3}/.gitignore +0 -0
  15. {qlix-0.3.2 → qlix-0.3.3}/CAPABILITIES.md +0 -0
  16. {qlix-0.3.2 → qlix-0.3.3}/CUTOVER.md +0 -0
  17. {qlix-0.3.2 → qlix-0.3.3}/LICENSE +0 -0
  18. {qlix-0.3.2 → qlix-0.3.3}/RELEASE.md +0 -0
  19. {qlix-0.3.2 → qlix-0.3.3}/examples/BI-AS-CODE.md +0 -0
  20. {qlix-0.3.2 → qlix-0.3.3}/examples/EXPORT-FIXTURE.md +0 -0
  21. {qlix-0.3.2 → qlix-0.3.3}/examples/Qlikfile.toml +0 -0
  22. {qlix-0.3.2 → qlix-0.3.3}/examples/bi-as-code.yaml +0 -0
  23. {qlix-0.3.2 → qlix-0.3.3}/examples/policy.example.toml +0 -0
  24. {qlix-0.3.2 → qlix-0.3.3}/examples/synthetic-smoke-ui.yaml +0 -0
  25. {qlix-0.3.2 → qlix-0.3.3}/examples/synthetic-smoke.qvs +0 -0
  26. {qlix-0.3.2 → qlix-0.3.3}/examples/synthetic-smoke.yaml +0 -0
  27. {qlix-0.3.2 → qlix-0.3.3}/scripts/check-export-fixture.py +0 -0
  28. {qlix-0.3.2 → qlix-0.3.3}/scripts/check-wheel-skill.sh +0 -0
  29. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/__init__.py +0 -0
  30. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/app_adopt.py +0 -0
  31. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/app_apply.py +0 -0
  32. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/app_create.py +0 -0
  33. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/app_export.py +0 -0
  34. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/app_frontend.py +0 -0
  35. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/app_plan.py +0 -0
  36. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/app_reload.py +0 -0
  37. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/appcheck.py +0 -0
  38. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/artifacts.py +0 -0
  39. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/auth/__init__.py +0 -0
  40. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/auth/browser.py +0 -0
  41. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/checks.py +0 -0
  42. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/direct_config.py +0 -0
  43. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/dsl/__init__.py +0 -0
  44. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/dsl/bookmark_audit.py +0 -0
  45. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/dsl/compiler.py +0 -0
  46. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/dsl/engine_validation.py +0 -0
  47. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/dsl/expression_audit.py +0 -0
  48. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/dsl/field_audit.py +0 -0
  49. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/dsl/frontend_ui_acceptance.mjs +0 -0
  50. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/dsl/planner.py +0 -0
  51. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/dsl/runtime.py +0 -0
  52. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/dsl/schema.py +0 -0
  53. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/dsl/spec.py +0 -0
  54. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/dsl/ui_acceptance.py +0 -0
  55. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/dsl/ui_run.mjs +0 -0
  56. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/engine/__init__.py +0 -0
  57. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/engine/certificate.py +0 -0
  58. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/engine/client.py +0 -0
  59. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/engine/inspection.py +0 -0
  60. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/engine/load_script.py +0 -0
  61. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/engine/master_guard.py +0 -0
  62. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/engine/qrs.py +0 -0
  63. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/engine/reload.py +0 -0
  64. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/engine/terminal_page.py +0 -0
  65. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/exit_codes.py +0 -0
  66. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/field_check.py +0 -0
  67. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/frontend_apply.py +0 -0
  68. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/inventory_cli.py +0 -0
  69. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/manifest.py +0 -0
  70. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/model.py +0 -0
  71. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/policy.py +0 -0
  72. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/py.typed +0 -0
  73. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/script_apply.py +0 -0
  74. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/script_diff.py +0 -0
  75. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/script_patch.py +0 -0
  76. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/script_plan.py +0 -0
  77. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/signin_log.py +0 -0
  78. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/stoppable.py +0 -0
  79. {qlix-0.3.2 → qlix-0.3.3}/src/qlix/ui_run.py +0 -0
  80. {qlix-0.3.2 → qlix-0.3.3}/tests/frontend_ui_acceptance.test.mjs +0 -0
  81. {qlix-0.3.2 → qlix-0.3.3}/tests/test_app_adopt.py +0 -0
  82. {qlix-0.3.2 → qlix-0.3.3}/tests/test_app_apply.py +0 -0
  83. {qlix-0.3.2 → qlix-0.3.3}/tests/test_app_check.py +0 -0
  84. {qlix-0.3.2 → qlix-0.3.3}/tests/test_app_create.py +0 -0
  85. {qlix-0.3.2 → qlix-0.3.3}/tests/test_app_name_cli.py +0 -0
  86. {qlix-0.3.2 → qlix-0.3.3}/tests/test_app_reload.py +0 -0
  87. {qlix-0.3.2 → qlix-0.3.3}/tests/test_browser_auth.py +0 -0
  88. {qlix-0.3.2 → qlix-0.3.3}/tests/test_certificate.py +0 -0
  89. {qlix-0.3.2 → qlix-0.3.3}/tests/test_direct_config.py +0 -0
  90. {qlix-0.3.2 → qlix-0.3.3}/tests/test_direct_script.py +0 -0
  91. {qlix-0.3.2 → qlix-0.3.3}/tests/test_export_fixture.py +0 -0
  92. {qlix-0.3.2 → qlix-0.3.3}/tests/test_frontend_apply_cli.py +0 -0
  93. {qlix-0.3.2 → qlix-0.3.3}/tests/test_frontend_runtime.py +0 -0
  94. {qlix-0.3.2 → qlix-0.3.3}/tests/test_inventory_cli.py +0 -0
  95. {qlix-0.3.2 → qlix-0.3.3}/tests/test_manifest.py +0 -0
  96. {qlix-0.3.2 → qlix-0.3.3}/tests/test_master_guard.py +0 -0
  97. {qlix-0.3.2 → qlix-0.3.3}/tests/test_model.py +0 -0
  98. {qlix-0.3.2 → qlix-0.3.3}/tests/test_persistent_reload.py +0 -0
  99. {qlix-0.3.2 → qlix-0.3.3}/tests/test_policy.py +0 -0
  100. {qlix-0.3.2 → qlix-0.3.3}/tests/test_qrs.py +0 -0
  101. {qlix-0.3.2 → qlix-0.3.3}/tests/test_script_apply.py +0 -0
  102. {qlix-0.3.2 → qlix-0.3.3}/tests/test_script_diff.py +0 -0
  103. {qlix-0.3.2 → qlix-0.3.3}/tests/test_script_patch.py +0 -0
  104. {qlix-0.3.2 → qlix-0.3.3}/tests/test_script_plan.py +0 -0
  105. {qlix-0.3.2 → qlix-0.3.3}/tests/test_session_attempts.py +0 -0
  106. {qlix-0.3.2 → qlix-0.3.3}/tests/test_session_reuse.py +0 -0
  107. {qlix-0.3.2 → qlix-0.3.3}/tests/test_signin_hygiene.py +0 -0
  108. {qlix-0.3.2 → qlix-0.3.3}/tests/test_skill.py +0 -0
  109. {qlix-0.3.2 → qlix-0.3.3}/tests/test_terminal_page.py +0 -0
  110. {qlix-0.3.2 → qlix-0.3.3}/tests/test_ui_run.py +0 -0
@@ -65,6 +65,6 @@ The permission model for QLX-07 onward should distinguish read, create/initializ
65
65
  | ID | Owner | Deliverable and acceptance |
66
66
  | --- | --- | --- |
67
67
  | QLX-10 | qlix | **Export before adoption.** First slice: `qlix app export` captures the visible frontend through a policy-bound PEM target, with opt-in variable definitions and bookmark IDs/titles, excluding saved bookmark selections. Default and opt-in exports passed a live read-only PEM smoke on a disposable app (one sheet, one master item, two fields, no variables or bookmarks reported). Live non-empty check passed on the 2026-12-04 acceptance app (one script-created variable, one bookmark; no selection state exported); live Qlik requires `qType: "variable"` in `GetVariables`, which the first slice omitted. `qlix app adopt` (read-only) now writes an ownership baseline only when every declared object already matches; verified live: matching spec adopted to the same baseline as the deploy, an edited spec was refused, and the adopted baseline turned conflicts into reviewed updates. Still to do: check known published/community sheets using the [acceptance fixture](examples/EXPORT-FIXTURE.md). A passing fixture does not establish global coverage. Record visibility and omissions, including whether base/published and community visibility can be verified. No data rows. Do not claim a complete backup or lossless YAML conversion. Keep ownership adoption separate: establish the mapping and review it before an existing object can be changed. |
68
- | QLX-11 | Atom | **Finish wrapper migration.** Bring the offline compile/schema runbook change through Atom's gate. Keep wrappers with distinct outputs or safety behavior until callers migrate. In particular, Atom's planner exits 2 on conflicts while the pinned qlix plan can exit 0 with JSON `status: conflicts`; inspection formats and apply recovery also need parity review. Upgrade the Atom lock from an approved published artifact only after consumer checks; never lock to a developer checkout or machine-local profile. |
68
+ | QLX-11 | Atom | **Finish wrapper migration.** qlix 0.3.3 closes the two parity gaps: `dsl plan` exits 2 on conflicts, and `inspect` also writes `state.json`. Bring the offline compile/schema runbook change through Atom's gate. Keep wrappers with distinct outputs or safety behavior until callers migrate. In particular, Atom's planner exits 2 on conflicts while the pinned qlix plan can exit 0 with JSON `status: conflicts`; inspection formats and apply recovery also need parity review. Upgrade the Atom lock from an approved published artifact only after consumer checks; never lock to a developer checkout or machine-local profile. |
69
69
 
70
70
  **Not in scope for the first release:** a catalog service, continuous reconciliation, arbitrary JSON-to-DSL conversion, app deletion, automatic publication, or automatic rollback. Start with **QLX-03 + QLX-02** (policy resolver, manifest, unified exit codes, and read-only preflight) in parallel with **QLX-04** (`qlix model` metadata discovery); ship **QLX-06** (`qlix skill`) once those settle, and prove the guarded PEM path on a disposable app before finalizing **QLX-07**.
@@ -109,6 +109,6 @@ normal fresh frontend plan; do not reuse the first-reload plan.
109
109
 
110
110
  - Invalid command syntax normally exits **2**. Handled config or connection failures normally exit **1** and report to stderr.
111
111
  - `app check` reserves **2** for a definite check failure or drift and uses **1** for runtime, policy, or usage errors. **0** means no definite failure, not that every check passed: always inspect `status` and `not_verified`.
112
- - `dsl plan` can exit **0** with `"status": "conflicts"`. Require `status == "reviewable"` in the JSON before considering apply. `dsl apply` in preview mode exits **2** for a matching but conflicting plan and **1** for a handled failure such as a changed reviewed plan.
112
+ - `dsl plan` prints the plan and exits **2** when its JSON `status` is `"conflicts"`, **0** when it is `"reviewable"`. Still require `status == "reviewable"` before considering apply. `dsl apply` in preview mode exits **2** for a matching but conflicting plan and **1** for a handled failure such as a changed reviewed plan.
113
113
  - `dsl validate-fields`, `dsl validate-expressions`, and `script check` can print a JSON report and still exit **1** when validation fails. `dsl ui-run` exits **1** for a failing report.
114
114
  - A lost reply from a write is not a rollback. Inspect recovery artifacts and live state before retrying. Do not retry session-limit refusals in a loop.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: qlix
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: CLI-centric Qlik Sense Engine API client, script manager, and declarative frontend DSL
5
5
  Project-URL: Homepage, https://github.com/huaxel/qlix
6
6
  Project-URL: Repository, https://github.com/huaxel/qlix
@@ -172,7 +172,7 @@ Keep the export out of Git and store the private key in a private directory on t
172
172
 
173
173
  ## Inspect apps without writes
174
174
 
175
- - `inspect` captures app structure and master definitions, not data pages, in a new private directory. Treat definitions, field names, and embedded literals as sensitive.
175
+ - `inspect` captures app structure and master definitions, not data pages, in a new private directory: `app.json` (sheet snapshot), `library.json` (masters), and `state.json` (full generic-object inventory for repair tools). Treat definitions, field names, and embedded literals as sensitive.
176
176
  - `script-hash` returns a SHA-256 digest, not live script contents.
177
177
  - `qlix script check candidate.qvs` uses a transient Engine app; it does not reload, save, or open a persistent app. Use `--anchor-app UUID` if the proxy needs an app route and repeat `--seed-zero NAME` for parser defaults that a reload would otherwise assign. It reports a digest and error count, not raw Engine diagnostics.
178
178
  - Broker requests are capped at 4 MiB including JSON encoding. The broker does not expose arbitrary RPC or export rows.
@@ -233,7 +233,7 @@ qlix dsl apply spec.yaml --app "$APP_ID" --snapshot inspection/app.json \
233
233
  --library inspection/library.json --review-plan review.json
234
234
  ```
235
235
 
236
- Compilation, field auditing, UI manifest generation, planning, and apply preview are offline. A successful `dsl plan` invocation can still return `"status": "conflicts"`; scripts must check that the JSON status is `reviewable` before passing the plan to apply. `validate-expressions` uses the named broker for metadata-only checks of expressions, fields, variables, and bookmarks. Use `qlix dsl ui-schema` to export the acceptance suite schema. To run a compiled manifest, use `qlix dsl ui-run manifest.json --driver /path/to/trusted-driver.mjs --output report.json` (requires Node.js).
236
+ Compilation, field auditing, UI manifest generation, planning, and apply preview are offline. `dsl plan` exits 2 when the plan has conflicts (the JSON is still printed); scripts should also check that the JSON status is `reviewable` before passing the plan to apply. `validate-expressions` uses the named broker for metadata-only checks of expressions, fields, variables, and bookmarks. Use `qlix dsl ui-schema` to export the acceptance suite schema. To run a compiled manifest, use `qlix dsl ui-run manifest.json --driver /path/to/trusted-driver.mjs --output report.json` (requires Node.js).
237
237
 
238
238
  The driver is executable local code, not a downloaded manifest dependency. It exports `async withTab({baseUrl, appId}, run)`, supplies an authenticated tab on the intended disposable app's sheet, awaits `run(tab)` once, and owns cleanup. The tab must expose `playwright`, `goto`, `reload`, `getAXState`, and `dev.logs` as used by the packaged runner. Keep driver stdout clear. The CLI writes a new private report and exits nonzero on assertion failure. It does not open a browser, start SSO, or manage Qlik slots on the driver's behalf; use a driver that reuses the authorized browser session. This integration is tested offline, not live.
239
239
 
@@ -147,7 +147,7 @@ Keep the export out of Git and store the private key in a private directory on t
147
147
 
148
148
  ## Inspect apps without writes
149
149
 
150
- - `inspect` captures app structure and master definitions, not data pages, in a new private directory. Treat definitions, field names, and embedded literals as sensitive.
150
+ - `inspect` captures app structure and master definitions, not data pages, in a new private directory: `app.json` (sheet snapshot), `library.json` (masters), and `state.json` (full generic-object inventory for repair tools). Treat definitions, field names, and embedded literals as sensitive.
151
151
  - `script-hash` returns a SHA-256 digest, not live script contents.
152
152
  - `qlix script check candidate.qvs` uses a transient Engine app; it does not reload, save, or open a persistent app. Use `--anchor-app UUID` if the proxy needs an app route and repeat `--seed-zero NAME` for parser defaults that a reload would otherwise assign. It reports a digest and error count, not raw Engine diagnostics.
153
153
  - Broker requests are capped at 4 MiB including JSON encoding. The broker does not expose arbitrary RPC or export rows.
@@ -208,7 +208,7 @@ qlix dsl apply spec.yaml --app "$APP_ID" --snapshot inspection/app.json \
208
208
  --library inspection/library.json --review-plan review.json
209
209
  ```
210
210
 
211
- Compilation, field auditing, UI manifest generation, planning, and apply preview are offline. A successful `dsl plan` invocation can still return `"status": "conflicts"`; scripts must check that the JSON status is `reviewable` before passing the plan to apply. `validate-expressions` uses the named broker for metadata-only checks of expressions, fields, variables, and bookmarks. Use `qlix dsl ui-schema` to export the acceptance suite schema. To run a compiled manifest, use `qlix dsl ui-run manifest.json --driver /path/to/trusted-driver.mjs --output report.json` (requires Node.js).
211
+ Compilation, field auditing, UI manifest generation, planning, and apply preview are offline. `dsl plan` exits 2 when the plan has conflicts (the JSON is still printed); scripts should also check that the JSON status is `reviewable` before passing the plan to apply. `validate-expressions` uses the named broker for metadata-only checks of expressions, fields, variables, and bookmarks. Use `qlix dsl ui-schema` to export the acceptance suite schema. To run a compiled manifest, use `qlix dsl ui-run manifest.json --driver /path/to/trusted-driver.mjs --output report.json` (requires Node.js).
212
212
 
213
213
  The driver is executable local code, not a downloaded manifest dependency. It exports `async withTab({baseUrl, appId}, run)`, supplies an authenticated tab on the intended disposable app's sheet, awaits `run(tab)` once, and owns cleanup. The tab must expose `playwright`, `goto`, `reload`, `getAXState`, and `dev.logs` as used by the packaged runner. Keep driver stdout clear. The CLI writes a new private report and exits nonzero on assertion failure. It does not open a browser, start SSO, or manage Qlik slots on the driver's behalf; use a driver that reuses the authorized browser session. This integration is tested offline, not live.
214
214
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "qlix"
7
- version = "0.3.2"
7
+ version = "0.3.3"
8
8
  description = "CLI-centric Qlik Sense Engine API client, script manager, and declarative frontend DSL"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -26,4 +26,4 @@ Use UUIDs and default JSON for automation; `--table` is for interactive reading.
26
26
  ## Read statuses, not just exit codes
27
27
 
28
28
  - Target-aware `app` commands use exit `1` for runtime, policy, or configuration errors and `2` for check failures, conflicts, or drift. A `0` from `app check` can still mean `not_verified`; a `0` from `app plan` can still need review.
29
- - Legacy `dsl plan` can exit `0` with `status: conflicts`; require `status: reviewable` before considering apply. Read the actual phase and JSON status before reporting success.
29
+ - `dsl plan` exits `2` with `status: conflicts` and `0` with `status: reviewable`; still require `status: reviewable` before considering apply. Read the actual phase and JSON status before reporting success.
@@ -795,7 +795,7 @@ async def serve(
795
795
 
796
796
  state = await capture_live(doc)
797
797
  snapshot, library = inspection_documents(state, app)
798
- return {"snapshot": snapshot, "library": library}
798
+ return {"snapshot": snapshot, "library": library, "state": state}
799
799
  if op == "model":
800
800
  from qlix.model import read_model
801
801
 
@@ -14,7 +14,7 @@ from typing import Any
14
14
  from uuid import UUID
15
15
 
16
16
  from . import broker
17
- from .exit_codes import EXIT_ERROR
17
+ from .exit_codes import EXIT_CHECK_FAILED, EXIT_ERROR
18
18
  from .inventory_cli import (
19
19
  INVENTORY_HELP,
20
20
  add_app_selector,
@@ -569,6 +569,8 @@ def _run(args: argparse.Namespace) -> Any:
569
569
  directory.mkdir(mode=0o700)
570
570
  write_private_json(directory / "app.json", result["snapshot"])
571
571
  write_private_json(directory / "library.json", result["library"])
572
+ # Full Engine inventory, for repair tools that compare against live state.
573
+ write_private_json(directory / "state.json", result["state"])
572
574
  return {"appId": str(args.app), "outputDir": str(directory)}
573
575
  return broker.run_command(args)
574
576
 
@@ -630,6 +632,8 @@ def main(argv: list[str] | None = None) -> int:
630
632
  print(json.dumps(result, indent=2, ensure_ascii=False, allow_nan=False))
631
633
  if args.op == "dsl" and args.dsl_op == "ui-run" and result["passed"] is not True:
632
634
  return 1
635
+ if args.op == "dsl" and args.dsl_op == "plan" and result["status"] == "conflicts":
636
+ return EXIT_CHECK_FAILED
633
637
  if (
634
638
  (args.op == "script" and args.script_op == "check")
635
639
  or (args.op == "dsl" and args.dsl_op in {"validate-fields", "validate-expressions"})
@@ -334,6 +334,9 @@ class Lifecycle(unittest.TestCase):
334
334
  self.assertEqual(json.loads(snapshot.read_text())["modelFields"], ["demo"])
335
335
  self.assertEqual(snapshot.stat().st_mode & 0o777, 0o600)
336
336
  self.assertEqual(output.stat().st_mode & 0o777, 0o700)
337
+ state = json.loads((output / "state.json").read_text())
338
+ self.assertEqual(set(state) >= {"objects", "masters", "modelFields"}, True)
339
+ self.assertEqual((output / "state.json").stat().st_mode & 0o777, 0o600)
337
340
  self._call(env, "inspect", "--app", app, "--output-dir", str(output), ok=False)
338
341
  spec = str(PACKAGE.parents[1] / "examples/synthetic-smoke.yaml")
339
342
  self.assertTrue(
@@ -159,3 +159,30 @@ def test_audits_include_container_show_conditions_and_mini_chart_dimension_field
159
159
  assert {"vTabFlag", "vItemFlag", "vMin", "vMax"} <= variables
160
160
  fields = {use.location: use.name for use in collect_fields(spec)}
161
161
  assert fields["sheets.s1.objects.t1.columns.m.mini_chart.dimension_field"] == "F_MINI"
162
+
163
+
164
+ def test_plan_exits_two_on_conflicts_and_still_prints_the_plan(tmp_path, capsys):
165
+ import asyncio
166
+
167
+ from test_frontend_runtime import FakeDocument
168
+
169
+ from qlix.dsl.runtime import capture_live, inspection_documents
170
+
171
+ doc = FakeDocument()
172
+ # An existing, unowned object that reuses the spec's sheet ID.
173
+ doc.props["frontend_smoke__sheet__pilot"] = {
174
+ "qInfo": {"qId": "frontend_smoke__sheet__pilot", "qType": "sheet"},
175
+ "qMetaDef": {"title": "Created by hand"},
176
+ "cells": [],
177
+ }
178
+ snapshot, _ = inspection_documents(asyncio.run(capture_live(doc)), APP)
179
+ path = tmp_path / "app.json"
180
+ path.write_text(json.dumps(snapshot), encoding="utf-8")
181
+ args = ["dsl", "plan", str(SPEC), "--app", APP, "--snapshot", str(path)]
182
+ assert main(args) == 2
183
+ assert json.loads(capsys.readouterr().out)["status"] == "conflicts"
184
+ empty, library = inspection_documents(asyncio.run(capture_live(FakeDocument())), APP)
185
+ path.write_text(json.dumps(empty), encoding="utf-8")
186
+ (tmp_path / "library.json").write_text(json.dumps(library), encoding="utf-8")
187
+ assert main([*args, "--library", str(tmp_path / "library.json")]) == 0
188
+ assert json.loads(capsys.readouterr().out)["status"] == "reviewable"
@@ -1095,7 +1095,7 @@ wheels = [
1095
1095
 
1096
1096
  [[package]]
1097
1097
  name = "qlix"
1098
- version = "0.3.2"
1098
+ version = "0.3.3"
1099
1099
  source = { editable = "." }
1100
1100
  dependencies = [
1101
1101
  { name = "pydantic" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes