qlix 0.2.0__tar.gz → 0.3.2__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. {qlix-0.2.0 → qlix-0.3.2}/.github/workflows/ci.yml +1 -0
  2. {qlix-0.2.0 → qlix-0.3.2}/.github/workflows/publish.yml +1 -0
  3. qlix-0.3.2/BACKLOG.md +70 -0
  4. {qlix-0.2.0 → qlix-0.3.2}/CAPABILITIES.md +3 -1
  5. qlix-0.3.2/CLI.md +114 -0
  6. {qlix-0.2.0 → qlix-0.3.2}/PKG-INFO +145 -8
  7. {qlix-0.2.0 → qlix-0.3.2}/README.md +144 -7
  8. {qlix-0.2.0 → qlix-0.3.2}/RELEASE.md +1 -1
  9. qlix-0.3.2/examples/BI-AS-CODE.md +46 -0
  10. qlix-0.3.2/examples/EXPORT-FIXTURE.md +29 -0
  11. qlix-0.3.2/examples/Qlikfile.toml +16 -0
  12. qlix-0.3.2/examples/bi-as-code.yaml +23 -0
  13. qlix-0.3.2/examples/policy.example.toml +41 -0
  14. qlix-0.3.2/examples/synthetic-smoke.qvs +8 -0
  15. {qlix-0.2.0 → qlix-0.3.2}/pyproject.toml +1 -1
  16. qlix-0.3.2/scripts/check-export-fixture.py +56 -0
  17. qlix-0.3.2/scripts/check-wheel-skill.sh +27 -0
  18. qlix-0.3.2/src/qlix/SKILL.md +29 -0
  19. qlix-0.3.2/src/qlix/app_adopt.py +107 -0
  20. qlix-0.3.2/src/qlix/app_apply.py +249 -0
  21. qlix-0.3.2/src/qlix/app_create.py +141 -0
  22. qlix-0.3.2/src/qlix/app_export.py +176 -0
  23. qlix-0.3.2/src/qlix/app_frontend.py +265 -0
  24. qlix-0.3.2/src/qlix/app_plan.py +158 -0
  25. qlix-0.3.2/src/qlix/app_reload.py +217 -0
  26. qlix-0.3.2/src/qlix/appcheck.py +463 -0
  27. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/broker.py +64 -12
  28. qlix-0.3.2/src/qlix/cli.py +645 -0
  29. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/direct_config.py +6 -2
  30. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/dsl/runtime.py +4 -1
  31. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/engine/certificate.py +85 -36
  32. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/engine/client.py +29 -0
  33. qlix-0.3.2/src/qlix/exit_codes.py +17 -0
  34. qlix-0.3.2/src/qlix/inventory_cli.py +94 -0
  35. qlix-0.3.2/src/qlix/manifest.py +165 -0
  36. qlix-0.3.2/src/qlix/model.py +485 -0
  37. qlix-0.3.2/src/qlix/policy.py +648 -0
  38. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/script_apply.py +49 -7
  39. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/script_plan.py +46 -1
  40. qlix-0.3.2/tests/test_app_adopt.py +80 -0
  41. qlix-0.3.2/tests/test_app_apply.py +210 -0
  42. qlix-0.3.2/tests/test_app_check.py +663 -0
  43. qlix-0.3.2/tests/test_app_create.py +102 -0
  44. qlix-0.3.2/tests/test_app_name_cli.py +99 -0
  45. qlix-0.3.2/tests/test_app_reload.py +227 -0
  46. {qlix-0.2.0 → qlix-0.3.2}/tests/test_broker.py +50 -0
  47. qlix-0.3.2/tests/test_certificate.py +824 -0
  48. qlix-0.3.2/tests/test_direct_script.py +163 -0
  49. qlix-0.3.2/tests/test_export_fixture.py +56 -0
  50. {qlix-0.2.0 → qlix-0.3.2}/tests/test_frontend_runtime.py +476 -1
  51. qlix-0.3.2/tests/test_inventory_cli.py +94 -0
  52. qlix-0.3.2/tests/test_manifest.py +157 -0
  53. qlix-0.3.2/tests/test_model.py +643 -0
  54. qlix-0.3.2/tests/test_policy.py +470 -0
  55. qlix-0.3.2/tests/test_skill.py +27 -0
  56. {qlix-0.2.0 → qlix-0.3.2}/uv.lock +1 -1
  57. qlix-0.2.0/src/qlix/cli.py +0 -338
  58. qlix-0.2.0/tests/test_certificate.py +0 -230
  59. {qlix-0.2.0 → qlix-0.3.2}/.gitignore +0 -0
  60. {qlix-0.2.0 → qlix-0.3.2}/CUTOVER.md +0 -0
  61. {qlix-0.2.0 → qlix-0.3.2}/LICENSE +0 -0
  62. {qlix-0.2.0 → qlix-0.3.2}/examples/synthetic-smoke-ui.yaml +0 -0
  63. {qlix-0.2.0 → qlix-0.3.2}/examples/synthetic-smoke.yaml +0 -0
  64. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/__init__.py +0 -0
  65. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/artifacts.py +0 -0
  66. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/auth/__init__.py +0 -0
  67. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/auth/browser.py +0 -0
  68. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/checks.py +0 -0
  69. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/dsl/__init__.py +0 -0
  70. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/dsl/bookmark_audit.py +0 -0
  71. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/dsl/compiler.py +0 -0
  72. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/dsl/engine_validation.py +0 -0
  73. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/dsl/expression_audit.py +0 -0
  74. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/dsl/field_audit.py +0 -0
  75. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/dsl/frontend_ui_acceptance.mjs +0 -0
  76. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/dsl/planner.py +0 -0
  77. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/dsl/schema.py +0 -0
  78. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/dsl/spec.py +0 -0
  79. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/dsl/ui_acceptance.py +0 -0
  80. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/dsl/ui_run.mjs +0 -0
  81. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/engine/__init__.py +0 -0
  82. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/engine/inspection.py +0 -0
  83. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/engine/load_script.py +0 -0
  84. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/engine/master_guard.py +0 -0
  85. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/engine/qrs.py +0 -0
  86. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/engine/reload.py +0 -0
  87. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/engine/terminal_page.py +0 -0
  88. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/field_check.py +0 -0
  89. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/frontend_apply.py +0 -0
  90. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/py.typed +0 -0
  91. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/script_diff.py +0 -0
  92. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/script_patch.py +0 -0
  93. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/signin_log.py +0 -0
  94. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/stoppable.py +0 -0
  95. {qlix-0.2.0 → qlix-0.3.2}/src/qlix/ui_run.py +0 -0
  96. {qlix-0.2.0 → qlix-0.3.2}/tests/frontend_ui_acceptance.test.mjs +0 -0
  97. {qlix-0.2.0 → qlix-0.3.2}/tests/test_browser_auth.py +0 -0
  98. {qlix-0.2.0 → qlix-0.3.2}/tests/test_direct_config.py +0 -0
  99. {qlix-0.2.0 → qlix-0.3.2}/tests/test_dsl_cli.py +0 -0
  100. {qlix-0.2.0 → qlix-0.3.2}/tests/test_frontend_apply_cli.py +0 -0
  101. {qlix-0.2.0 → qlix-0.3.2}/tests/test_master_guard.py +0 -0
  102. {qlix-0.2.0 → qlix-0.3.2}/tests/test_persistent_reload.py +0 -0
  103. {qlix-0.2.0 → qlix-0.3.2}/tests/test_qrs.py +0 -0
  104. {qlix-0.2.0 → qlix-0.3.2}/tests/test_script_apply.py +0 -0
  105. {qlix-0.2.0 → qlix-0.3.2}/tests/test_script_diff.py +0 -0
  106. {qlix-0.2.0 → qlix-0.3.2}/tests/test_script_patch.py +0 -0
  107. {qlix-0.2.0 → qlix-0.3.2}/tests/test_script_plan.py +0 -0
  108. {qlix-0.2.0 → qlix-0.3.2}/tests/test_session_attempts.py +0 -0
  109. {qlix-0.2.0 → qlix-0.3.2}/tests/test_session_reuse.py +0 -0
  110. {qlix-0.2.0 → qlix-0.3.2}/tests/test_signin_hygiene.py +0 -0
  111. {qlix-0.2.0 → qlix-0.3.2}/tests/test_terminal_page.py +0 -0
  112. {qlix-0.2.0 → qlix-0.3.2}/tests/test_ui_run.py +0 -0
@@ -21,3 +21,4 @@ jobs:
21
21
  - run: node --test tests/frontend_ui_acceptance.test.mjs
22
22
  - run: uv build
23
23
  - run: uv run twine check --strict dist/*
24
+ - run: bash scripts/check-wheel-skill.sh dist/*.whl
@@ -22,6 +22,7 @@ jobs:
22
22
  - run: node --test tests/frontend_ui_acceptance.test.mjs
23
23
  - run: uv build
24
24
  - run: uv run twine check --strict dist/*
25
+ - run: bash scripts/check-wheel-skill.sh dist/*.whl
25
26
  - uses: actions/upload-artifact@v4
26
27
  with:
27
28
  name: dist
qlix-0.3.2/BACKLOG.md ADDED
@@ -0,0 +1,70 @@
1
+ # qlix backlog: Qlik BI as code
2
+
3
+ The goal is to create or update a native Qlik app from Git-tracked **QVS load scripts and sheet YAML**, using one declarative manifest. Add a read-only way for people and agents to discover the data model and its verified business relationships. Keep deployment identities, permission grants, live snapshots, and recovery artifacts outside the authoring repo.
4
+
5
+ ## Starting point
6
+
7
+ - **Isolated integration, not released:** blank-app creation, first reload, frontend deployment, no-op replan, and read-only export pass in one subprocess CLI test against a loopback mutual-TLS fake Engine. Live evidence remains separate for each slice.
8
+ - **Released in qlix 0.2.0:** browser SSO and session hygiene, read-only direct PEM access, `--connect-ip` with TLS hostname verification, and named direct profiles. Direct app, sheet, and field reads were verified on one client-managed deployment. The published direct CLI implements reads only; this is not a property of the credential.
9
+ - **Local `main`, not released:** inventory ergonomics, [CLI reference](CLI.md), Qlikfile read-only preflight and policy, and model metadata.
10
+ - **Working-tree changes, not released:** separate guarded PEM script save, reload, and sheet apply. The [paired pilot](examples/BI-AS-CODE.md) was run live on one disposable app: script and frontend replay plans were no-ops, the expected fields persisted, and the KPI displayed `3` in Qlik Sense. Combined orchestration remains open.
11
+ - **In Atom `main`:** generic Qlik connection and DSL imports use packaged qlix. The duplicate artifact writer and recovery journal are removed; the lock still selects qlix 0.1.0. Deployment defaults, data contracts, QVS, and domain validation stay in Atom. Remaining command wrappers are not all drop-in replacements.
12
+
13
+ ## Architectural principles
14
+
15
+ - **Intent vs. authority split:** The tracked `Qlikfile.toml` declares what a target wants to check or deploy; trusted local or CI config resolves connection type, endpoint, app UUID scope, and allowed capabilities. A checkout cannot grant itself access.
16
+ - **Unified `target -> policy -> transport` resolver:** Target-aware commands should share one resolver across SSO and PEM. Authorization is independent of transport: trusted policy grants operations on a specific endpoint and app UUID, the adapter separately reports which operations it implements, and Qlik enforces the authenticated identity’s server permissions. Distinguish `denied by policy` from `unsupported by adapter`. Implementing an operation must not grant it, and an unsupported operation must never switch transports automatically.
17
+ - **Paired QVS + YAML preflight:** When `app check` compares the tracked `.qvs` digest against the live app script and finds a script change, missing fields or expression errors on the current model are reported as `not_verified` (pending reload) rather than indistinguishable from hard failures on an unchanged script.
18
+ - **Explicit, resumable write phases:** Because `script save -> reload` mutates the data model before `frontend apply` can be validated, combined updates run as journaled phases (`script` -> `reload` -> `recheck & frontend`) with a post-reload checkpoint rather than one opaque apply.
19
+ - **Locked CLI exit-code and JSON contract:** Lock one convention before new commands ship (`0` pass/no-op, `2` check failure/conflict/drift, `1` runtime/policy/usage error) so `app check`, `model`, `dsl plan`, and `qlix skill` stay consistent.
20
+
21
+ ## Next: prove the read-only workflow
22
+
23
+ | ID | Owner | Deliverable and acceptance |
24
+ | --- | --- | --- |
25
+ | QLX-01 | qlix | **Finish the CLI ergonomics slice.** Review the local changes, preserve default JSON shapes and UUID syntax, and verify exact-name selection refuses ambiguous matches. Check `--help` and examples from an installed wheel. Commit, push, and release only with approval. |
26
+ | QLX-03 | qlix | **Bind connection policy per app target (build with QLX-02).** Implement the unified `target -> policy -> transport` resolver. The tracked file requests a connection name; trusted local or CI config resolves the connection type, endpoint, app UUID scope, and allowed operations. First support read-only preflight with certificate or SSO. Deny missing/unknown policy, unsupported transport capabilities, and target mismatches before connecting. A checkout cannot grant itself access. This policy restricts `qlix`, not the privileges of the underlying credential. |
27
+ | QLX-02 | qlix | **Add `Qlikfile.toml`, unified exit codes, and `qlix app check` (build with QLX-03).** Version the manifest; reference a tracked `.qvs` file and sheet YAML. Offline checks require no local credentials. A target check resolves through QLX-03, validates chart structure and supported live-apply features, and checks fields, variables, bookmarks, and expressions where supported. Report `passed`, `failed`, and `not_verified` separately. Compare the tracked QVS digest to the live script so missing fields/expressions caused by an un-reloaded QVS change are explicitly flagged as `not_verified` (pending reload) rather than hard failures on an unchanged script. Lock the exit-code contract (`0` pass, `2` check failure/drift, `1` runtime/policy error). Do not claim syntax, reload, or render acceptance from offline checks. The command cannot persist changes. |
28
+ | QLX-04 | qlix | **Expose the observed app model (parallel Phase 1 track).** Add a metadata-only `qlix model` view that preserves table membership and the associations Qlik reports, instead of flattening to field names. Include app identity, visibility/scope, and explicit unknowns. Keep identifiers stable within the snapshot, avoid sampling rows, and do not infer keys or data types the Engine has not established. |
29
+ | QLX-05 | Atom | **Explain verified data relationships (parallel Atom track).** Compose existing Atom registry, semantic views, and join catalog with the observed model from QLX-04. Pilot one explicit `(app UUID, model table) → dataset` mapping. Return grain, verified keys, direction/cardinality, required filters, provenance, and sensitivity where known. Distinguish observed associations from verified joins; no verified path means no recommendation. Do not duplicate the registry or expose row values. |
30
+ | QLX-06 | qlix | **Bundle a version-matched agent guide (end of Phase 1).** Ship a small `SKILL.md` as package data, exposed by `qlix skill` (implemented, not released), *after* QLX-01–04 settle so it documents the real manifest, `app check`, `model`, and exit codes on the first pass. Cover connection choice, stable JSON/exit contracts, session reuse, secret handling, and write approval. Do not auto-register it in a harness. Verify it from an installed wheel, offline, without configuration. |
31
+
32
+ ### QLX-05 pilot: lineage is not join equivalence
33
+
34
+ Atom’s `tc-recettes/mart-builder.qvs` illustrates the distinction: `ClearedByDoc`
35
+ reads `DFKKOP`, filters clearing items, and groups by `AUGBL`. It is one row per
36
+ clearing document, not a row-for-row alias of `DFKKOP`. The catalog's reviewed
37
+ `DFKKOP.AUGBL → DFKKKO.OPBEL` edge applies to the source dataset; the aggregate
38
+ must not inherit all the source dataset's joins or cardinalities. This example
39
+ is source-code evidence, not a claim that `ClearedByDoc` exists in any live app.
40
+
41
+ For the first Atom catalog command, consume a saved `qlix model` JSON artifact
42
+ and one explicitly reviewed mapping; no connection or estate reads are needed.
43
+ Scope the mapping by deployment and app UUID, and match the exact model table ID.
44
+ Record whether the mapping is lineage-only or carries a reviewed grain and key
45
+ mapping. Keep Atom edges in source direction and keep traps out of recommendations.
46
+ A missing mapping, ambiguous canonical dataset, lineage-only relationship, or
47
+ unmapped join key must produce **no app-level join recommendation**. Test both a
48
+ synthetic key-preserving mapping and a grouped-source negative case like the one
49
+ above. Any recommendation must retain the Atom catalog's caveat and provenance.
50
+
51
+ ## Then: guarded create and update
52
+
53
+ For headless deployment, first connect PEM to the existing guarded script and frontend workflows without duplicating apply logic or granting writes by default. The explicit approval and live pilot for those separate PEM paths are complete on a disposable app. Use the observed behavior when designing combined orchestration in QLX-07. Browser SSO can be used to verify rendering; it is not a deployment prerequisite. QLX-08 repeats the pilot through the combined workflow.
54
+
55
+ | ID | Owner | Deliverable and acceptance |
56
+ | --- | --- | --- |
57
+ | QLX-07 | qlix | **Plan and apply an update to an existing app.** Read-only `app plan` now combines script and frontend review, deferring sheet review when the script changes. `app apply` executes one explicitly approved phase at a time and resumes only from verified checkpoints; the combined PEM pilot verified all three phases and a no-op replan. The renamed synthetic sheet was also checked in the browser: at a 768 × 540 CSS viewport the chart body had a visible standalone KPI value of `3`, separate from the chart title. This verifies the existing-app pilot, not newly created apps. Combine the existing script and frontend workflows without bypassing their guards, modeled as explicit, journaled resumable phases (`script` → `reload` → `recheck & frontend`) with a post-reload checkpoint. Bind the reviewed plan to endpoint, app UUID, source digests, and observed state. Separate script save, authorized reload, and sheet apply. After reload, recheck fields and reject changes outside the reviewed plan; request a fresh review when the resulting model invalidates the plan. Preserve unmanaged objects and report drift. Journal each phase, including partial or unknown outcomes; do not retry an uncertain write automatically or imply rollback. A verified rerun issues no save or reload. |
58
+ | QLX-08 | qlix | **Prove the paired pilot on a disposable app.** With explicit authorization for that target and those actions, run QLX-07 end to end: validate and save the tracked QVS, reload, verify the expected field inventory, apply the reviewed sheet spec, and verify the KPI renders 3. Reinspect and show a no-op plan. Exercise drift refusal, preservation of unmanaged sheets, and recovery reporting (use a fake Engine for injected failures unless separately approved). No production app or data dependency. |
59
+ | QLX-09 | qlix | **Create and initialize an app explicitly.** First slice: `app create` records the UUID from a one-shot blank-app creation; not live-tested. Receipt-bound first reload is implemented with a separate UUID-scoped update grant; a subprocess CLI test over loopback mutual TLS proves create → script → first reload → frontend → no-op replan against a fake Engine. Live acceptance passed on 2026-12-04 in a personal workspace app (`cbc3742f-…`): create → script save → receipt-bound first reload → sheet apply (3 creations) → no-op replan → read-only export; Qlik Sense rendered the KPI as 3. Live finding: a never-reloaded app omits `qHasData`/`qIsOpenedWithoutData` from its layout, so the blank check now requires an empty `GetTablesAndKeys` inventory instead of explicit `false` flags. Require its own capability and approval; record the new UUID before initialization. A create-only grant can initialize only that new UUID, not update an existing app by name. Detect and report an uncertain creation result rather than creating a second app. No deletion or publication in this slice. Depends on QLX-03 and the guarded execution contract in QLX-07. |
60
+
61
+ The permission model for QLX-07 onward should distinguish read, create/initialize, script save, reload, and frontend update. Enforce it at execution as well as planning. An absent app, typo, authorization failure, or drift is not permission to create or delete anything. Test the same policy decisions for PEM and SSO, including read-only and app-scoped write grants. Test adapter support separately; an allowed but unimplemented operation must fail before attempting a write.
62
+
63
+ ## Later: adopt existing apps and finish the consumer cutover
64
+
65
+ | ID | Owner | Deliverable and acceptance |
66
+ | --- | --- | --- |
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. |
69
+
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**.
@@ -6,13 +6,15 @@
6
6
  | --- | --- | --- |
7
7
  | Shared named browser SSO and app selection — Dotfiles `bin/qlik` | **Ported.** `connect`, `connections`, `use`, `disconnect`; one per-user broker connection, serialized commands, idle teardown. | [CLI contexts](https://qlik.dev/toolkits/qlik-cli/qlik-cli-contexts/) document JWT for client-managed contexts; [Windows context login](https://qlik.dev/toolkits/qlik-cli/context/context-login/) documents username/password. No tested replacement for this deployment's interactive Microsoft/SAML session. A remembered app is not an open Engine document. |
8
8
  | Engine sessions and app handles — Atom `qlik_engine.py`, `_browser_auth.py`; Dotfiles broker | **Ported.** Python transport and client; The broker reuses one same-app Engine connection and handle across serialized reads; handles are not exposed to CLI callers. A separate `qlix direct` path reads apps, sheets, and fields over mutual TLS with an exported PEM client certificate; it is read-only, does not use the broker, and was verified only against a local test Engine. | [QIX API](https://qlik.dev/apis/json-rpc/qix/) and [`@qlik/api/qix`](https://qlik.dev/toolkits/qlik-api/qix/) distinguish app sessions, identity/selection state, and resume/reconnect. This port does not promise SDK-style resumption, Cloud auth, PFX or encrypted-key loading, or certificate-backed writes. [`enigma.js`](https://github.com/qlik-oss/enigma.js) and [`enigma-go`](https://github.com/qlik-oss/enigma-go) are Engine clients, not browser SSO brokers. |
9
- | App, sheet, field, object, and master inspection — Atom `list_apps.py`, `inspect_app.py`, `inspect_frontend.py`, `snapshot_master_library.py`; Dotfiles metadata commands | **Ported with interface changes.** `apps`, `sheets`, `fields`, `inspect`, `masters`; explicit QRS opt-in, dual-plane QIX/QRS master check. Old CSV output and legacy snapshot variants are not drop-in compatible. | [QRS client-managed guide](https://qlik.dev/toolkits/qlik-cli/qlik-cli-qrs-get-started/) and [SDK QIX app sessions and list APIs](https://qlik.dev/toolkits/qlik-api/qix/). QRS visibility is not an attestation of completeness; require matching Engine inventory. |
9
+ | App, sheet, field, object, and master inspection — Atom `list_apps.py`, `inspect_app.py`, `inspect_frontend.py`, `snapshot_master_library.py`; Dotfiles metadata commands | **Ported with interface changes.** `apps`, `sheets`, `fields`, `inspect`, `masters`; explicit QRS opt-in, dual-plane QIX/QRS master check. Old CSV output and legacy snapshot variants are not drop-in compatible. **New:** `model` reports table membership and Engine-reported associations from three metadata methods only, with no row data; unit and fake-Engine tested, not yet run live. | [QRS client-managed guide](https://qlik.dev/toolkits/qlik-cli/qlik-cli-qrs-get-started/) and [SDK QIX app sessions and list APIs](https://qlik.dev/toolkits/qlik-api/qix/). QRS visibility is not an attestation of completeness; require matching Engine inventory. |
10
10
  | Load-script read/syntax — Atom `reload_*.py`, `check_pri_script_syntax.py`, `check_tc_staging_script.py`, and syntax-check wrappers | **Ported for syntax and hashes.** `script-hash` and `script check`; anchor app can route the WebSocket without `OpenDoc`, and optional zero-valued parser variables exist only in the transient app. Raw diagnostics and script export are not CLI parity. | [Official `app validatescript`](https://qlik.dev/toolkits/qlik-cli/app/app-validatescript/) is the reference for script validation. The transient workflow uses `CreateSessionApp`, `CreateVariableEx`, `SetScript`, `CheckScriptSyntax`; no reload or save. A successful syntax check does not validate source data. |
11
11
  | Script preview, preparation, deployment, reload, progress, cancellation — Atom `prepare_comop_m2_script.py`, `reload_pri_*`, `reload_vehicle_evolution.py`, `comop_reload_progress.py` | **Partial.** Offline candidate preparation via `script patch`, private local diff via `script diff`, read-only hash comparison via `script plan`, guarded script-only save/readback via `script apply`, and a monitored transient reload helper are ported. The Python-only persistent reload primitive configures full reload and checks terminal progress without saving, cancelling or retrying. Live verification and consumer integration remain. Keep target mapping, producer/consumer order, QVD readiness and domain-specific failure policy in Atom. | [Official `app build`](https://qlik.dev/toolkits/qlik-cli/app/app-build/) updates, reloads and saves by default, with `--no-reload` and `--no-save`. Do not replace Atom’s exact hash checks, private backups, domain readiness probes or save-after-verification rules with that default. [DoReloadEx](https://help.qlik.com/en-US/sense-developer/May2026/Subsystems/EngineJSONAPI/Content/service-doc-doreloadex.htm) may report success when indexing fails, and [GetProgress(0)](https://help.qlik.com/en-US/sense-developer/May2026/Subsystems/EngineJSONAPI/Content/service-global-getprogress.htm) returns reduced information. The helper treats missing terminal evidence as uncertain. |
12
12
  | Declarative UI compiler, schemas, dependency audits, reviewed apply — Atom `libs/core/qlik_frontend`, `compile_*`, `diff_frontend`, `validate_frontend_*`, `apply_frontend` | **Ported.** `dsl` commands and Python APIs. Apply uses a separate session, requires explicit target and reviewed plan, journals before writes and has no automatic rollback. | [QIX](https://qlik.dev/apis/json-rpc/qix/) provides the actual properties and object APIs. [Official `app build`](https://qlik.dev/toolkits/qlik-cli/app/app-build/) accepts generic object JSON; it is not Atom’s YAML compiler or ownership-aware planner. Engine round-trip and actual rendering remain distinct checks. |
13
13
  | One-off app repair guards — Atom `change_template.py`, `live_master_guard.py`, `dedupe_masters.py` and repair scripts | **Partial.** Snapshot/patch helpers and reusable measure/dimension drift guards are in the package. Generic orphan/inbound-reference checks still need an explicit safe deletion workflow if retained. App-specific patches, branding and destructive target lists stay in Atom. | Use QIX object/master properties and reference inventory for verification. A successful `Destroy*` call is not a proof of zero inbound references. |
14
14
  | Browser UI acceptance — Atom `compile_frontend_ui_acceptance.py`, `frontend_ui_acceptance.mjs` | **Partial.** `dsl ui-schema`, `dsl ui-manifest`, and `dsl ui-run` expose the compiler and packaged runner. A trusted local driver supplies the authenticated tab; actual browser handoff and a live smoke remain. | QIX layout data is not a browser assertion. Keep this layer separate from Engine inspection. |
15
15
 
16
+ | Tracked targets, trusted policy, and read-only preflight — new `qlix` slice | **Implemented and unit/fake-Engine tested.** A versioned `Qlikfile.toml` names a logical connection plus tracked QVS and sheet YAML. Trusted local or CI policy resolves transport (SSO broker or direct PEM), endpoint, app UUID scope, and capabilities; policies inside the manifest directory or its Git worktree are refused. `qlix app check` validates offline without credentials and adds a live preflight with `--target`, reporting `passed`, `failed`, and `not_verified` separately with locked exit codes (0 pass, 2 failure/drift, 1 runtime/policy/usage). | The Engine preflight reads the stored script and metadata only: `GetScript`, field/variable/bookmark existence, and `CheckExpression`. It does not save, reload, or render, and a matching stored-script digest is not treated as proof of reload. Live SSO and certificate transports are covered by fake tests; no live deployment was exercised for this slice. |
17
+
16
18
  ## Reference boundaries
17
19
 
18
20
  - [`qlik-oss/qlik-cli`](https://github.com/qlik-oss/qlik-cli) is a public **release mirror**, not a source-code dependency; [`qlik-api-ts`](https://github.com/qlik-oss/qlik-api-ts) is source for the JS/TS SDK. Its [client-managed examples](https://github.com/qlik-oss/qlik-api-ts/blob/main/docs/examples/qlik-sense-enterprise.md) use JWT or exported certificates. Compare distribution and auth separately.
qlix-0.3.2/CLI.md ADDED
@@ -0,0 +1,114 @@
1
+ # CLI quick reference
2
+
3
+ Use `qlix --version` and `qlix COMMAND --help` to check your installed build. This reference describes the source checkout. `qlix` is not Qlik's official `qlik` CLI.
4
+
5
+ ## Choose a connection
6
+
7
+ | Task | Use |
8
+ | --- | --- |
9
+ | List apps, sheets, or field names without a browser | `qlix direct --profile work …` with a [configured certificate profile](README.md#read-engine-metadata-directly-with-a-client-certificate). Put profile options before the subcommand. |
10
+ | Reuse browser SSO for reads, full snapshots, or live validation | `qlix connect work --url HTTPS_PROXY_URL --wait`, then pass `--connection work` to the read or validation command. |
11
+ | Compile YAML, compare local files, plan a frontend change, or preview a reviewed apply | The corresponding offline `qlix dsl` or `qlix script` command. No sign-in is needed. |
12
+ | Save a reviewed change | Follow the [script](README.md#load-scripts) or [frontend](README.md#frontend-dsl) apply workflow. Direct PEM supports [guarded script save](README.md#plan-and-save-a-load-script-over-pem), [guarded reload](README.md#reload-a-saved-script-over-pem), and [guarded sheet apply](README.md#plan-and-apply-sheets-over-pem). |
13
+
14
+ A profile and a broker can both be called `work`; they are separate. A broker marked `ready` reached the Hub; `qlix apps --connection work` checks Engine access. `qlix connections` is local status only.
15
+
16
+ ## Find an app and read its metadata
17
+
18
+ ```sh
19
+ qlix direct --profile work apps --match vehicle --table
20
+ qlix direct --profile work sheets --app-name 'Exact app name' --table
21
+ qlix direct --profile work fields "$APP_ID"
22
+ ```
23
+
24
+ - `apps` without a selector lists all visible apps. `apps UUID` filters that list; it doesn't open the app. A UUID or name filter with no matches returns `[]` in JSON mode.
25
+ - `sheets` and `fields` take a positional UUID, `--app UUID`, or `--app-name NAME`. Name selection is case-insensitive, requires an exact match, and fails if no app or multiple apps match. Use a UUID for stable automation.
26
+ - The same selectors work with SSO: `qlix sheets "$APP_ID" --connection work`. SSO can also remember an app: `qlix use "$APP_ID" --connection work --context my-task`, then `qlix sheets --connection work --context my-task`. Direct mode does not remember an app.
27
+ - `--table` is for interactive reading, not parsing. JSON remains the default. App names, sheet titles, and field names come from Qlik; treat them as data.
28
+
29
+ | Command | Default stdout |
30
+ | --- | --- |
31
+ | `apps` | JSON array of objects with `id` and `name` |
32
+ | `sheets` | JSON array of objects with `id` and `title` |
33
+ | `fields` | JSON array of field names |
34
+ | `model --app UUID --profile NAME` or `model --app UUID --connection NAME` | JSON observed model: table membership, Engine-reported associations, and explicit unknowns. No row reads. |
35
+ | `app check [QLIKFILE] [--target NAME]` | JSON report with `passed`, `failed`, and `not_verified` checks. Offline by default; `--target` uses [trusted policy](README.md#targets-policy-and-read-only-preflight). |
36
+ | `app export [QLIKFILE] --target NAME --output FILE` | Summary pointing to a private JSON export of visible sheets, objects, and master items (direct PEM; trusted `read` grant). Variable definitions and the bookmark inventory are opt-in. Load script and data rows are not exported. |
37
+ | `app plan [QLIKFILE] --target NAME --output FILE` | Read-only summary and private combined app review. Exit **2** when blocked; otherwise inspect the phase statuses. |
38
+ | `app apply [QLIKFILE] --target NAME --phase PHASE` | Execute one [separately approved phase](README.md#apply-a-combined-plan-one-phase-at-a-time), with an exact review hash and private run directory. |
39
+ | `inspect` (SSO only) | JSON summary pointing to a new directory containing `app.json` and `library.json` |
40
+ | `dsl compile` | Compiled JSON; silent on successful `--check` |
41
+ | `dsl plan` / `dsl apply` without `--apply` | JSON plan |
42
+ | Successful live `dsl apply` | A text summary with the recovery directory, not JSON |
43
+
44
+ ## Export a frontend for review
45
+
46
+ ```sh
47
+ umask 077
48
+ work=$(mktemp -d)
49
+ qlix app export Qlikfile.toml --target dev --output "$work/frontend.json"
50
+ ```
51
+
52
+ This captures the visible persistent frontend, including nested objects and master definitions, through the target's policy-bound PEM connection. The artifact records its visibility limits and does not establish ownership. Definitions can include sensitive literals; keep the file outside Git and review before sharing. This is not a full app backup or an importable YAML project. Add `--include-variables` only if you need variable definitions; it requests no evaluated values and excludes system, reserved, and session variables. Definitions may include credentials or other sensitive literals. `--include-bookmarks` includes the IDs and titles of visible `bookmark` objects only. It does not retrieve saved selections or layout patches, and cannot restore a bookmark. Bookmark and snapshot objects themselves are always left out of the frontend snapshot because they store selection state or captured chart data; the artifact lists them under `omitted`. Titles may also contain sensitive information.
53
+
54
+ ## Bring existing objects under Git management
55
+
56
+ ```sh
57
+ qlix app adopt Qlikfile.toml --target dev --output adopted-baseline.json
58
+ qlix app plan Qlikfile.toml --target dev --baseline adopted-baseline.json --output plan.json
59
+ ```
60
+
61
+ `app adopt` needs only the `read` capability and never changes the app. Write
62
+ the sheet YAML with the **existing** object IDs you want to manage, then run it.
63
+ For each declared ID it reports `matches`, `differs`, `different_parent`, or
64
+ `missing`. Only when every declared object already matches does it write an
65
+ ownership baseline (exit 0). Otherwise it writes nothing and exits 2: edit the
66
+ YAML until it describes the live objects exactly, then adopt again. Objects the
67
+ YAML does not declare stay unmanaged and are never claimed.
68
+
69
+ Pass the baseline to `app plan --baseline` so later YAML edits become reviewed
70
+ updates instead of ownership conflicts. Adoption only claims objects; it does
71
+ not convert an app to YAML for you.
72
+
73
+ ## Create a blank app (direct PEM only)
74
+
75
+ Use a dedicated Qlikfile target with no app UUID, bound to a trusted local policy
76
+ entry with `transport = "direct"`, `capabilities = ["create"]`, `apps = []`, and
77
+ `create_name = "Smoke app"`. Qlik must also grant app creation to that identity.
78
+
79
+ ```sh
80
+ qlix app create Qlikfile.toml --target sandbox --confirm-name 'Smoke app'
81
+ ```
82
+
83
+ This sends one global `CreateApp` request. It does not open, initialize, reload,
84
+ update, or publish the app. Before sending the request, it records an attempt in
85
+ `POLICY_PATH.creation/TARGET.json`. It records the returned UUID there before
86
+ reporting success. The same policy path and target cannot be reused after an
87
+ attempt, even if a response was lost. Keep the receipt; inspect Qlik before any
88
+ new creation attempt. A later update needs a separately approved policy bound to
89
+ the returned UUID. Never repurpose a creation grant as existing-app access.
90
+
91
+ ### Initialize the returned UUID
92
+
93
+ Bind the returned UUID under a separate update target in the **same trusted
94
+ policy file**. Review and apply the script phase normally. For a new app with no
95
+ reload timestamp, make a **fresh** combined plan with
96
+ `qlix app plan --target NEW_TARGET --first-reload-from sandbox --output FIRST_PLAN.json`.
97
+ Here `sandbox` is the creation target that issued the receipt. Review the plan
98
+ and separately approve `app apply --phase reload` with its exact hash and the
99
+ same private run directory. The receipt must still match, a verified script
100
+ phase must precede reload, and Qlik must report no loaded tables, no
101
+ associations, and no prior reload timestamp. A never-reloaded app may omit its
102
+ data flags; an empty table inventory is the required evidence. Reload still requires a
103
+ new timestamp, expected fields, and a successful reopen before it is verified.
104
+ A first-reload attempt consumes a claim beside the creation receipt before the
105
+ Engine call, so a different run directory cannot replay it. Afterward make a
106
+ normal fresh frontend plan; do not reuse the first-reload plan.
107
+
108
+ ## Exit status and automation
109
+
110
+ - Invalid command syntax normally exits **2**. Handled config or connection failures normally exit **1** and report to stderr.
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.
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
+ - 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.2.0
3
+ Version: 0.3.2
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
@@ -31,7 +31,9 @@ A standalone CLI and Python library for the Qlik Sense Engine API (QIX), plus a
31
31
  - **Compare and apply** load scripts and frontend specs against reviewed, hash-bound plans.
32
32
  - **Connect** through browser SSO behind a proxy, or headless with a client certificate.
33
33
 
34
- This is a private alpha. It has not been published to PyPI.
34
+ Start with the [CLI quick reference](CLI.md) for command examples, JSON output, and exit codes. The [backlog](BACKLOG.md) tracks the Qlikfile and data-catalog work. This README describes the source checkout; check `qlix --version` when using an installed release.
35
+
36
+ For agent-assisted work, `qlix skill` prints the `SKILL.md` bundled with that installation. It runs offline and does not register anything in your agent harness.
35
37
 
36
38
  ## Install
37
39
 
@@ -43,7 +45,7 @@ uv tool install 'qlix[browser]' --find-links ./dist
43
45
  uv tool run --from 'qlix[browser]' --find-links ./dist playwright install chromium
44
46
  ```
45
47
 
46
- The `browser` extra is only needed for live commands. Chromium needs its platform libraries and a graphical display for interactive sign-in. The existing browser profile can be reused with `QLIK_HEADLESS=1` if sign-in does not require interaction.
48
+ The `browser` extra is needed for browser SSO; certificate reads use the `direct` extra instead. Chromium needs its platform libraries and a graphical display for interactive sign-in. The existing browser profile can be reused with `QLIK_HEADLESS=1` if sign-in does not require interaction.
47
49
 
48
50
  ## Connect through the proxy with browser SSO
49
51
 
@@ -126,7 +128,45 @@ user_directory = "CORP"
126
128
  user_id = "approved-job"
127
129
  ```
128
130
 
129
- Run `qlix direct --profile work apps`. A profile replaces all the connection flags; app and operation arguments still belong on the command line. The profile stores only the path to the PEM export, never passwords or keys. Protect the config against edits by other users so it cannot redirect your connection.
131
+ Put `--profile work` before the command. List apps first, then copy an `id` from
132
+ the JSON output:
133
+
134
+ ```sh
135
+ qlix direct --profile work apps
136
+ qlix direct --profile work apps "$APP_ID"
137
+ qlix direct --profile work sheets "$APP_ID"
138
+ qlix direct --profile work fields "$APP_ID"
139
+ ```
140
+
141
+ With a UUID, `apps` filters the visible app list; it doesn't open the app or
142
+ fetch its sheets. It still returns a JSON array, empty if the app isn't visible.
143
+ `sheets` and `fields` require an app in direct mode. All three commands also
144
+ accept `--app UUID`, including on the SSO path.
145
+
146
+ To browse instead of scripting, add `--table` to any of these commands. On
147
+ `apps`, `--match TEXT` filters by a case-insensitive literal name substring.
148
+ It works with either connection mode and never selects an app for you.
149
+
150
+ ```sh
151
+ qlix direct --profile work apps --match vehicle --table
152
+ qlix direct --profile work sheets "$APP_ID" --table
153
+ ```
154
+
155
+ If you know the exact title, you can skip copying the UUID:
156
+
157
+ ```sh
158
+ qlix direct --profile work fields --app-name "Vehicle overview" --table
159
+ ```
160
+
161
+ Name lookup is case-insensitive but requires exactly one visible match. It
162
+ works for `sheets` and `fields` in both connection modes. If the title is
163
+ missing or ambiguous, use `apps --match` and pass the UUID. Direct name lookup
164
+ uses a short app-list connection followed by the app connection; a UUID skips
165
+ the first connection. Without `--table`, these commands still emit JSON.
166
+
167
+ A profile replaces all the connection flags; don't mix the two forms.
168
+ It stores only the path to the PEM export, never passwords or keys. Protect the
169
+ config against edits by other users so it cannot redirect your connection.
130
170
 
131
171
  Keep the export out of Git and store the private key in a private directory on the Linux filesystem when using WSL. Direct mode is separate from the SSO broker; the existing `connect` and `--connection` workflow is unchanged. See [Qlik's direct connection documentation](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/EngineAPI/Content/Sense_EngineAPI/GettingStarted/connecting-to-engine-api.htm).
132
172
 
@@ -136,7 +176,7 @@ Keep the export out of Git and store the private key in a private directory on t
136
176
  - `script-hash` returns a SHA-256 digest, not live script contents.
137
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.
138
178
  - Broker requests are capped at 4 MiB including JSON encoding. The broker does not expose arbitrary RPC or export rows.
139
- - Persistent writes are disabled unless a connection is explicitly scoped as described below.
179
+ - Inspection commands never save or reload an app. Writes use separate guarded apply commands. A brokered apply requires a connection explicitly scoped for that write; standalone SSO applies do not use a broker.
140
180
  - The low-level `qlix.engine.client` library exposes Engine session/RPC methods to Python callers; do not assume those methods are read-only.
141
181
 
142
182
  ## Load scripts
@@ -175,6 +215,8 @@ A busy broker rejects new apply requests without queuing them. If a reply is los
175
215
 
176
216
  ## Frontend DSL
177
217
 
218
+ For a Git-tracked app with both a load script and native sheet definitions, see the [BI-as-code pilot](examples/BI-AS-CODE.md).
219
+
178
220
  To reuse one broker sign-in for guarded frontend writes, start it with `qlix connect NAME --url URL --frontend-write-app APP_UUID` (plus browser backend options if needed). Pass `--connection NAME` to `qlix dsl apply` along with all normal live-apply arguments, including `--base-url`, `--confirm-plan`, and `--artifacts-dir`. The broker independently verifies the endpoint, app, and reviewed plan before opening a fresh Engine socket in the existing browser. It then uses the normal live drift check and recovery journal. Reconnect clears the write scope. This option does not authorize script saves or reloads.
179
221
 
180
222
  ```sh
@@ -191,13 +233,108 @@ qlix dsl apply spec.yaml --app "$APP_ID" --snapshot inspection/app.json \
191
233
  --library inspection/library.json --review-plan review.json
192
234
  ```
193
235
 
194
- Compilation, field auditing, UI manifest generation, planning, and apply preview are offline. `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. 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).
195
237
 
196
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.
197
239
 
198
240
  `dsl apply` defaults to an offline rehearsal against the exact reviewed plan. Only `--apply --confirm-plan HASH --base-url URL --artifacts-dir DIR` enables persistent writes. The endpoint must be the one reviewed by the operator: the plan binds the app ID, not the server. Without `--connection`, live apply opens its own browser session and requires the endpoint lease to be free. With `--connection NAME`, it reuses a broker explicitly enabled for frontend writes to that app. Coordinate with other users before ending a shared connection; do not run duplicate sign-ins or concurrent writers. The runtime checks for live drift, journals before mutation, saves and verifies, and writes a new ownership baseline; it does not provide automatic rollback. Start on a disposable app.
199
241
 
200
- Direct certificate/API-key transports and administrative QRS lifecycle commands are not implemented outside the read-only `qlix direct` mode described above. The Python-only `qlix.engine.reload.reload_open_document` configures and monitors a full reload on a caller-owned, dedicated Engine session; it does not save, cancel, or retry. It requires positive Engine success, terminal progress, and no reported reload or indexing errors. Qlik documents that `GetProgress(0)` provides reduced information, so missing terminal evidence fails closed. A reload can already have written shared outputs even if no app save occurs. The caller must handle authorization, backups, domain checks, recovery, and saving. The existing transient-only monitor remains separate and can request cancellation of its owned temporary reload.
242
+ The legacy `dsl apply` command uses browser authentication. For policy-scoped PEM apply, use the target-aware workflow below. API-key transports and administrative QRS lifecycle commands are not implemented. The Python-only `qlix.engine.reload.reload_open_document` configures and monitors a full reload on a caller-owned, dedicated Engine session; it does not save, cancel, or retry. It requires positive Engine success, terminal progress, and no reported reload or indexing errors. Qlik documents that `GetProgress(0)` provides reduced information, so missing terminal evidence fails closed. A reload can already have written shared outputs even if no app save occurs. The caller must handle authorization, backups, domain checks, recovery, and saving. The existing transient-only monitor remains separate and can request cancellation of its owned temporary reload.
243
+
244
+ ## Targets, policy, and read-only preflight
245
+
246
+ A tracked `Qlikfile.toml` pairs one load script with its sheet YAML per target. It carries intent only: a logical connection name and the tracked sources.
247
+
248
+ ```toml
249
+ version = 1
250
+
251
+ [targets.smoke]
252
+ connection = "work"
253
+ script = "synthetic-smoke.qvs"
254
+ sheets = "bi-as-code.yaml"
255
+ ```
256
+
257
+ `qlix app check Qlikfile.toml` validates every target offline and needs no credentials: files must exist inside the Qlikfile directory, the sheet YAML must compile, and each tracked digest is reported. It deliberately does not claim Qlik script syntax, reload, or render acceptance.
258
+
259
+ `qlix app check Qlikfile.toml --target smoke` adds a live, read-only preflight. A trusted policy must first resolve the target: transport, endpoint, app UUID scope, and capabilities. The command refuses before connecting when the target is unknown, the requested connection or app is outside its scope, the read operation is not granted or supported, or the policy could be granted by the checkout.
260
+
261
+ - Policy lives in `$XDG_CONFIG_HOME/qlix/policy.toml`, or at the absolute path in `QLIX_POLICY_FILE` for CI. A policy inside the Qlikfile's directory or Git worktree is refused.
262
+ - SSO targets name an existing broker connection and its exact endpoint. The receiving broker re-checks that endpoint before opening an Engine session, so a reconnect between requests cannot redirect the check.
263
+ - Direct targets name a `[direct.NAME]` profile or carry inline `engine_url`/`cert_dir`/`user_directory`/`user_id`/`connect_ip` settings.
264
+ - Target-aware adapters implement `read`; the direct adapter also implements the guarded `script_save`, `reload`, and `frontend_apply` workflows below. Grants are independent of adapter support. Start with `read` and grant additional operations only where intended. `app check` never saves, reloads, or otherwise mutates the app. Transport identifies how to connect, not what an identity may do: trusted policy limits `qlix`, and Qlik enforces its own permissions. The [backlog](BACKLOG.md#architectural-principles) describes how guarded writes will extend this boundary.
265
+
266
+ See [the example manifest](examples/Qlikfile.toml) and [example policy](examples/policy.example.toml).
267
+
268
+ The JSON report separates three buckets. Read them instead of inferring from the exit code alone:
269
+
270
+ - **passed** — a check that succeeded, such as a compiled sheet structure or a present bookmark.
271
+ - **failed** — a definite problem: tracked versus stored script drift, a missing bookmark, an expression syntax error or dangerous field reference, or an offline file/structure failure.
272
+ - **not_verified** — coverage that cannot be established read-only. Missing fields, variables, and bad-field expression findings land here under any script digest, because a matching stored script does not prove the last reload used it, and a differing script means a reload is pending. Script syntax, reload, and rendering also stay here.
273
+
274
+ Exit codes are locked for target-aware commands: `0` no definite failure or no-op, `2` check failure or drift, `1` runtime, policy, or usage error. `0` with `status: not_verified` means nothing failed but a reload or review is still required; a report is only `passed` when every bucket is empty. Out-of-scope access is therefore a `1`, never a `2`, and a usage error in `qlix app` exits `1` instead of argparse's default `2`. Legacy `script check`, `dsl validate-fields`, and `dsl validate-expressions` keep their current exit behaviour until they migrate to this contract.
275
+
276
+ ### Plan and save a load script over PEM
277
+
278
+ Use a trusted direct target scoped to the intended app. Grant `read` to plan, and add `script_save` only if that app may be changed. Keep the referenced direct profile and PEM files outside the checkout. The script path must match the one in the target manifest.
279
+
280
+ ```sh
281
+ qlix script plan examples/synthetic-smoke.qvs --qlikfile examples/Qlikfile.toml \
282
+ --target smoke --output "$WORK/script-plan.json"
283
+ qlix script apply examples/synthetic-smoke.qvs --review-plan "$WORK/script-plan.json"
284
+ ```
285
+
286
+ Only after reviewing the plan and authorizing the save, repeat the apply command with `--qlikfile examples/Qlikfile.toml --target smoke --apply --confirm-plan HASH --artifacts-dir "$WORK"`. This rechecks the grant, endpoint, app UUID, and live script hash; validates syntax in a transient app; and saves and verifies the reviewed script. It does **not** reload data, modify sheets, or retry an uncertain save. Keep recovery artifacts private. The guarded PEM script save and subsequent no-op script plan were verified on a disposable app using the synthetic fixture.
287
+
288
+ ### Reload a saved script over PEM
289
+
290
+ First generate a fresh `script plan` for the same target. It must report `noop`; review the saved QVS and authorize the reload separately. The `reload` grant allows running that script and saving the resulting data model, not changing the script or sheets. A QVS reload can write external outputs before any app save, so review those effects first. Use an app with no competing writers.
291
+
292
+ ```sh
293
+ qlix app reload examples/Qlikfile.toml --target smoke \
294
+ --review-plan "$WORK/noop-script-plan.json" --confirm-plan HASH --artifacts-dir "$WORK"
295
+ ```
296
+
297
+ This is a live command, not a preview. It checks the current script digest, waits for terminal reload evidence, checks declared fields and a changed reload time before saving, then verifies both after reopening. It journals attempted and acknowledged phases. It cannot roll back or automatically retry an uncertain reload or save. The guarded PEM reload and reopen check were also verified on a disposable app using the synthetic QVS fixture.
298
+
299
+ ### Plan and apply sheets over PEM
300
+
301
+ Use `read` to capture a private frontend review after reload. It binds the app UUID, endpoint, saved-script digest, reload time, snapshots, and compiled plan. Keep the review outside Git: it can contain sensitive object definitions.
302
+
303
+ ```sh
304
+ qlix app frontend-plan examples/Qlikfile.toml --target smoke --output "$WORK/frontend-review.json"
305
+ ```
306
+
307
+ Inspect the `plan` and confirm only the intended actions. After approving that exact review, grant `frontend_apply` and run:
308
+
309
+ ```sh
310
+ qlix app frontend-apply examples/Qlikfile.toml --target smoke \
311
+ --review-plan "$WORK/frontend-review.json" --confirm-plan HASH --artifacts-dir "$WORK"
312
+ ```
313
+
314
+ Use the outer `reviewHash`, not the nested `planHash`. The existing runtime rechecks live state, preserves unmanaged objects, and journals before writes. The command reopens the app and emits `baseline.json` only if a fresh plan is a no-op. Use that file with `frontend-plan --baseline` on the next run. This does not edit the load script, reload, or publish; verify the rendered KPI separately. On the disposable synthetic app, the PEM pilot saved one measure, one sheet, and one KPI; a fresh plan was a no-op, and the Engine returned the KPI value and formatted text `3`. Qlik Sense also displayed `3` in the browser at a usable viewport; a cramped split initially gave the chart body zero height.
315
+
316
+ ### Plan the whole app without writes
317
+
318
+ ```sh
319
+ qlix app plan examples/Qlikfile.toml --target smoke \
320
+ --baseline "$WORK/baseline.json" --output "$WORK/app-plan.json"
321
+ ```
322
+
323
+ Omit `--baseline` for a new managed frontend. The private plan binds the endpoint, app UUID, source digests, and observed state. It contains the script plan and, where possible, a frontend review. If the script differs, sheet review is deferred until the script has been saved and the resulting model inspected after an authorized reload. A matching saved script and reload timestamp do not prove which script produced the model; `no_changes_observed` means the script and frontend compare unchanged, not that reload provenance was verified. Missing declared fields or frontend conflicts are `blocked` (exit 2). The command uses only a read grant; possessing the outer plan hash does not authorize a write.
324
+
325
+ ### Apply a combined plan one phase at a time
326
+
327
+ Create a private empty run directory outside Git (`RUN=$(mktemp -d)` with `umask 077`). For a QVS change, start with the reviewed `script` phase. Each invocation runs **one** phase and requires that phase's policy grant and the exact outer hash of its own `app plan` review:
328
+
329
+ ```sh
330
+ qlix app apply examples/Qlikfile.toml --target smoke --phase script \
331
+ --review-plan "$WORK/app-plan.json" --confirm-plan HASH --run-dir "$RUN"
332
+ ```
333
+
334
+ 1. After the script save is verified, produce a fresh plan. The saved script must compare `noop`. Review and authorize `--phase reload` separately, using the same run directory. QVS can write external outputs during reload.
335
+ 2. After the reload is verified, produce another fresh plan and review its sheet changes. Use `--phase frontend` with that plan and the same run directory. It must reflect the reload recorded by this run. For a sheet-only change to the current model, start with `frontend` in a new run directory; it cannot change the script or reload.
336
+
337
+ Keep `run.json`, phase journals, and reviews private. Resume only from a **verified** phase; a run left `started` requires inspection and manual reconciliation, not a retry. There is no rollback or automatic continuation. The combined execution was also verified live on a disposable app: a comment-only script change, a separately approved reload, and a sheet title update. Replanning found no changes; the Engine still returned the synthetic KPI value `3`.
201
338
 
202
339
  ## Consumer cutover
203
340
 
@@ -208,4 +345,4 @@ Direct certificate/API-key transports and administrative QRS lifecycle commands
208
345
  - Connection broker and lifecycle test patterns: Dotfiles `bin/qlik` and `scripts/tests/qlik-cli.test.py` from the local worktree based on `8a15e10` (including uncommitted broker lifecycle changes).
209
346
  - Engine client, browser auth, frontend DSL and examples: Project Atom `qlik/tools/`, `python/libs/core/qlik_frontend/`, and `qlik/specs/` at `96805840f` (local extraction). Domain-specific operations and production fixtures are not part of this package.
210
347
  - License: [MIT](LICENSE), selected by the owner of the extracted code. `qlix` is an independent project, not an official Qlik product.
211
- - Before a PyPI upload: verify the exact release artifacts, confirm package-name acceptance and branding, and get explicit release approval. Browser SSO and read-only inventory were smoke-tested on one client-managed deployment; live writes were not tested. See [RELEASE.md](RELEASE.md).
348
+ - Before a PyPI upload: verify the exact release artifacts, confirm package-name acceptance and branding, and get explicit release approval. Browser SSO and read-only inventory were smoke-tested on one client-managed deployment. The guarded PEM script save, reload, and frontend apply were also smoke-tested on a disposable synthetic app. See [RELEASE.md](RELEASE.md).