Skip to main content

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-only stop after this phase, and --files-allowlist tightens scope. --explain documents how each extractor works in plain English.
  • Deterministic: outputs are stable for the same repo (sorted lists, pinned schema 0.1). Only the run_id UUID 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:

  1. luciq_swatpack.json – machine-readable snapshot validated against schema_v0.1.
  2. luciq_swatpack_report.md – human-friendly summary (now with “Next steps” sections for optional features).
  3. 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-hints is 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 pytest or python -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-allowlist globs to focus on specific modules without editing the repo.
  • Android flag: --platform android prints “not supported yet” while preserving the CLI contract for future expansion.
  • Clean reruns: Delete or change --output-dir to regenerate fresh artifacts; logs accumulate per run for auditability.
  • Sharing artifacts: Outputs contain only metadata; customers can review luciq_swatpack.json and luciq_swatpack_report.md before 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

luciq_swatpack-0.1.2.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

luciq_swatpack-0.1.2-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file luciq_swatpack-0.1.2.tar.gz.

File metadata

  • Download URL: luciq_swatpack-0.1.2.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

Hashes for luciq_swatpack-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c2d64fb819a781e62ae8422548fa8948457c8af36be3fc3c3426e29409b3755d
MD5 02495e5552ef7a71855afca64d93c07e
BLAKE2b-256 62f03fbe81147a4f0537ca105fc53a0cbc70e409ce2c97983fcb2312aa7936aa

See more details on using hashes here.

File details

Details for the file luciq_swatpack-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: luciq_swatpack-0.1.2-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

Hashes for luciq_swatpack-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f2e486295041b92e52331e8dc117f9d16faad11b3d2ebf4814ecedac129b5422
MD5 cbc7043b951117b6de23697752b687e9
BLAKE2b-256 c555b08e63f06cd30b795c776fce1f9b4bb98790dcaad03f8c3a612a8ca69c55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page