Deterministic Luciq SWAT Pack collector
Project description
luciq-swatpack
luciq-swatpack is a deterministic, privacy-conscious CLI that generates SWAT Pack diagnostics snapshots for Luciq Support/SE workflows. It runs entirely on the customer’s machine, never uploads data, and only records approved metadata (paths, versions, line numbers) so customers can confidently share the outputs with Luciq. The codebase is intentionally boring, dependency-light, and ready to extend to Android or other platforms without breaking today’s contract.
Guarantees
- Privacy first: no source code, UI text, screenshots, tokens, or PII are ever persisted.
- Transparency: every run prints a capture manifest + privacy FAQ describing exactly which files will be read, which metadata fields are extracted, and what is explicitly excluded.
--dry-run/--manifest-onlystop after this phase, and--files-allowlisttightens scope.--explaindocuments how each extractor works in plain English. - Deterministic: outputs are stable for the same repo (sorted lists, pinned schema
0.1). Only therun_idUUID changes. - Local only: zero network requests, no uploads—customers decide when/if to send the artifacts.
Installation
The project uses a standard pyproject.toml. From the repo root:
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
This installs the luciq-swatpack console script. You can also run python -m luciq_swatpack scan … or, once published, install globally via pipx install .. Use luciq-swatpack --version to confirm which build you are running.
Usage
luciq-swatpack scan # scan current directory
luciq-swatpack scan /path/to/repo # explicit scan root
luciq-swatpack scan --dry-run # manifest + privacy FAQ only
luciq-swatpack scan --manifest-only # alias for --dry-run
luciq-swatpack scan --platform ios # explicit platform flag
luciq-swatpack scan --platform android # prints "not supported yet"
luciq-swatpack scan --include-ci-hints # include CI metadata
luciq-swatpack scan --output-dir ./out # customize output path
luciq-swatpack scan --explain # describe each extractor
luciq-swatpack scan --files-allowlist \"**/*.swift\" # restrict scanned files
luciq-swatpack scan --files-allowlist \"**/Info.plist\" # combine allowlists
python -m luciq_swatpack scan … # module entry point
luciq-swatpack --version # show CLI version
Guard rails ensure the tool fails fast (with remediation tips) if it cannot find an Info.plist or Swift sources, which usually means the wrong path or an overly restrictive --files-allowlist. The capture planner auto-detects multiple .xcodeproj files, bundled xcframeworks, deterministic assets (MockPost.json, MockLargePayload.json), and other high-signal files so customers rarely have to curate paths manually.
Outputs are written to ./luciq_swatpack_out/ by default:
luciq_swatpack.json– machine-readable snapshot validated againstschema_v0.1.luciq_swatpack_report.md– human-friendly summary (now with “Next steps” sections for optional features).luciq_swatpack.log– timestamped runtime log for transparency/auditing.
Manifest, Privacy FAQ, and Transparency
Each run begins with a Capture Manifest that lists every file to be read, grouped by role (Info.plists, Swift sources, lockfiles, deterministic assets, CI configs, etc.). A Privacy FAQ immediately follows, explaining why the extraction is safe, what data is explicitly excluded, and how to further restrict scope. Use --dry-run/--manifest-only to stop after this phase, and --explain to print a plain-English description of each extractor.
Captured Signals
luciq_swatpack.json adheres to schema_v0.1 (see schema_v0_1.json) and currently includes:
- Run metadata: tool version, schema version, deterministic timestamp, CLI arguments, Typer version, platform detection, and a single UUID
run_id. - Project identity: bundle/app names, detected build systems (SPM, CocoaPods, Carthage, manual), deployment targets, Swift versions, project/workspace paths.
- Luciq SDK inventory: integration method, version sources, manual xcframework detection, and module toggles (Bug/Crash Reporting, Session Replay, APM, ANR capture, global disablement, debug logging, RN/Flutter/NDK bridges, Instabug legacy remnants).
- Privacy posture: screenshot masking presets, private view APIs or SwiftUI modifiers, network obfuscation handlers, repro-step configuration, consent prompts, crash callbacks, log capture toggles.
- Token analysis: masked tokens, placeholder detection, multiple-token warnings—raw tokens never leave the machine.
- Usage locations: file + line references for Luciq.start, NetworkLogger, identify/logOut anchors, masking calls, etc.
- Symbol pipeline: iOS dSYM script references, endpoints, masked tokens, dSYM bundle paths; Android mapping scripts/obfuscators/endpoints; React Native sourcemap hints, dependency versions, CodePush/Expo presence.
- CI hints (optional): Fastlane, Bitrise, GitHub Actions, Jenkins, and other pipeline files when
--include-ci-hintsis set. - Environment: outputs from
sw_vers,xcodebuild -version,swift --version,pod --version,carthage version, captured as plain strings. - Extra findings: heuristic notes flagging placeholder tokens, missing deterministic assets, absent network obfuscation handlers, missing symbol upload scripts, or other high-signal gaps.
All lists/maps are sorted to keep diffs stable; only run_id changes between identical inputs.
Markdown Report
luciq_swatpack_report.md mirrors the JSON but is optimized for Support/SE responders. It surfaces key detections (init locations, module toggles, privacy posture, symbol pipeline status), highlights risks from extra_findings, and adds Next steps recommendations for every optional feature (network logging hardening, screenshot masking, repro steps, CI uploads, etc.). The report is safe to attach directly to Luciq tickets or share with customers.
Development
- Python 3.10+
- Dependencies: Typer, Rich, jsonschema, PyYAML, pytest (see
pyproject.toml). - Run tests with
pytestorpython -m pytest.
Fixtures & Tests
fixtures/ contains deterministic mini-repos (spm_only, pods_only, mixed_spm_pods, luciq_not_installed). Tests cover deterministic ordering, schema validation, manifest-only behavior, guard-rail messaging, and that --dry-run leaves no artefacts on disk.
Example Output
The examples/ directory contains freshly generated snapshots from the deterministic SwatSampleApp template (JSON + Markdown + log) so customers can preview exactly what gets captured before running the CLI themselves.
Troubleshooting & Tips
- Missing files: If the scan errors with “No Info.plist” or “No Swift sources,” double-check the root path or relax
--files-allowlist. - Restricting scope: Combine multiple
--files-allowlistglobs to focus on specific modules without editing the repo. - Android flag:
--platform androidprints “not supported yet” while preserving the CLI contract for future expansion. - Clean reruns: Delete or change
--output-dirto regenerate fresh artifacts; logs accumulate per run for auditability. - Sharing artifacts: Outputs contain only metadata; customers can review
luciq_swatpack.jsonandluciq_swatpack_report.mdbefore sharing to verify privacy guarantees.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file luciq_swatpack-0.1.1.tar.gz.
File metadata
- Download URL: luciq_swatpack-0.1.1.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11ff1d1ee12c74b2540c9c4fd19c46aacba423942f462f69378ba9172bc20647
|
|
| MD5 |
3855949256c5e270fd64c884534071c3
|
|
| BLAKE2b-256 |
fd5bbe71a93ec2b7e20d500f816e7a35ca6bdbb54316c10e1f7758abad0969d3
|
File details
Details for the file luciq_swatpack-0.1.1-py3-none-any.whl.
File metadata
- Download URL: luciq_swatpack-0.1.1-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a30342ff0fcc8c84af37051df9245a395f039e11bfbdc38cf0a6ae326f97ab0b
|
|
| MD5 |
af09d7fe2ef75e3aac175aba4f81347b
|
|
| BLAKE2b-256 |
a4ab3c0c50ef8ab9390a9b0376af6877efb6055d3e7f2475390d9d08bbc90fbd
|