isolation-check 0.3.0a2__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 (130) hide show
  1. isolation_check-0.3.0a2/CHANGELOG.md +75 -0
  2. isolation_check-0.3.0a2/CODE_OF_CONDUCT.md +110 -0
  3. isolation_check-0.3.0a2/CONTRIBUTING.md +93 -0
  4. isolation_check-0.3.0a2/LICENSE +190 -0
  5. isolation_check-0.3.0a2/MANIFEST.in +7 -0
  6. isolation_check-0.3.0a2/PKG-INFO +333 -0
  7. isolation_check-0.3.0a2/README.md +303 -0
  8. isolation_check-0.3.0a2/SECURITY.md +34 -0
  9. isolation_check-0.3.0a2/SUPPORT.md +29 -0
  10. isolation_check-0.3.0a2/examples/postgres-app/README.md +80 -0
  11. isolation_check-0.3.0a2/examples/postgres-app/docker-compose.yaml +22 -0
  12. isolation_check-0.3.0a2/examples/postgres-app/isolation-check.toml +8 -0
  13. isolation_check-0.3.0a2/pyproject.toml +57 -0
  14. isolation_check-0.3.0a2/setup.cfg +4 -0
  15. isolation_check-0.3.0a2/src/isolation_check/__init__.py +4 -0
  16. isolation_check-0.3.0a2/src/isolation_check/__main__.py +6 -0
  17. isolation_check-0.3.0a2/src/isolation_check/cli.py +422 -0
  18. isolation_check-0.3.0a2/src/isolation_check/collect/__init__.py +1 -0
  19. isolation_check-0.3.0a2/src/isolation_check/collect/compose.py +251 -0
  20. isolation_check-0.3.0a2/src/isolation_check/create/__init__.py +1 -0
  21. isolation_check-0.3.0a2/src/isolation_check/create/generator.py +216 -0
  22. isolation_check-0.3.0a2/src/isolation_check/create/manager.py +322 -0
  23. isolation_check-0.3.0a2/src/isolation_check/create/spec.py +219 -0
  24. isolation_check-0.3.0a2/src/isolation_check/create/validate.py +314 -0
  25. isolation_check-0.3.0a2/src/isolation_check/create/verify.py +132 -0
  26. isolation_check-0.3.0a2/src/isolation_check/create/worktree.py +158 -0
  27. isolation_check-0.3.0a2/src/isolation_check/models.py +179 -0
  28. isolation_check-0.3.0a2/src/isolation_check/normalize/__init__.py +1 -0
  29. isolation_check-0.3.0a2/src/isolation_check/normalize/compose.py +283 -0
  30. isolation_check-0.3.0a2/src/isolation_check/py.typed +1 -0
  31. isolation_check-0.3.0a2/src/isolation_check/report.py +110 -0
  32. isolation_check-0.3.0a2/src/isolation_check/rules/__init__.py +1 -0
  33. isolation_check-0.3.0a2/src/isolation_check/rules/ports.py +247 -0
  34. isolation_check-0.3.0a2/src/isolation_check/rules/volumes.py +195 -0
  35. isolation_check-0.3.0a2/src/isolation_check/runtime/__init__.py +1 -0
  36. isolation_check-0.3.0a2/src/isolation_check/runtime/capabilities.py +78 -0
  37. isolation_check-0.3.0a2/src/isolation_check/runtime/concurrency.py +313 -0
  38. isolation_check-0.3.0a2/src/isolation_check/runtime/lifecycle.py +858 -0
  39. isolation_check-0.3.0a2/src/isolation_check/runtime/port_allocator.py +189 -0
  40. isolation_check-0.3.0a2/src/isolation_check/runtime/validation.py +240 -0
  41. isolation_check-0.3.0a2/src/isolation_check/version.py +21 -0
  42. isolation_check-0.3.0a2/src/isolation_check.egg-info/PKG-INFO +333 -0
  43. isolation_check-0.3.0a2/src/isolation_check.egg-info/SOURCES.txt +128 -0
  44. isolation_check-0.3.0a2/src/isolation_check.egg-info/dependency_links.txt +1 -0
  45. isolation_check-0.3.0a2/src/isolation_check.egg-info/entry_points.txt +2 -0
  46. isolation_check-0.3.0a2/src/isolation_check.egg-info/requires.txt +4 -0
  47. isolation_check-0.3.0a2/src/isolation_check.egg-info/top_level.txt +1 -0
  48. isolation_check-0.3.0a2/tests/__init__.py +8 -0
  49. isolation_check-0.3.0a2/tests/fixtures/compose/1_shared_custom_volume/env_a/compose.yaml +9 -0
  50. isolation_check-0.3.0a2/tests/fixtures/compose/1_shared_custom_volume/env_b/compose.yaml +9 -0
  51. isolation_check-0.3.0a2/tests/fixtures/compose/2_distinct_project_volumes/env_a/compose.yaml +8 -0
  52. isolation_check-0.3.0a2/tests/fixtures/compose/2_distinct_project_volumes/env_b/compose.yaml +8 -0
  53. isolation_check-0.3.0a2/tests/fixtures/compose/3_shared_readonly_volume/env_a/compose.yaml +9 -0
  54. isolation_check-0.3.0a2/tests/fixtures/compose/3_shared_readonly_volume/env_b/compose.yaml +9 -0
  55. isolation_check-0.3.0a2/tests/fixtures/compose/4_missing_identity/env_a/compose.yaml +6 -0
  56. isolation_check-0.3.0a2/tests/fixtures/compose/4_missing_identity/env_b/compose.yaml +6 -0
  57. isolation_check-0.3.0a2/tests/fixtures/compose/5_unmounted_toplevel_volume/env_a/compose.yaml +9 -0
  58. isolation_check-0.3.0a2/tests/fixtures/compose/5_unmounted_toplevel_volume/env_b/compose.yaml +10 -0
  59. isolation_check-0.3.0a2/tests/fixtures/compose/ports/conflict_exact_ip/env_a/compose.yaml +6 -0
  60. isolation_check-0.3.0a2/tests/fixtures/compose/ports/conflict_exact_ip/env_b/compose.yaml +6 -0
  61. isolation_check-0.3.0a2/tests/fixtures/compose/ports/conflict_wildcard_ip/env_a/compose.yaml +6 -0
  62. isolation_check-0.3.0a2/tests/fixtures/compose/ports/conflict_wildcard_ip/env_b/compose.yaml +6 -0
  63. isolation_check-0.3.0a2/tests/fixtures/compose/ports/different_protocols/env_a/compose.yaml +6 -0
  64. isolation_check-0.3.0a2/tests/fixtures/compose/ports/different_protocols/env_b/compose.yaml +6 -0
  65. isolation_check-0.3.0a2/tests/fixtures/compose/ports/distinct_ports/env_a/compose.yaml +6 -0
  66. isolation_check-0.3.0a2/tests/fixtures/compose/ports/distinct_ports/env_b/compose.yaml +6 -0
  67. isolation_check-0.3.0a2/tests/fixtures/compose/ports/dynamic_port/env_a/compose.yaml +6 -0
  68. isolation_check-0.3.0a2/tests/fixtures/compose/ports/dynamic_port/env_b/compose.yaml +6 -0
  69. isolation_check-0.3.0a2/tests/fixtures/compose/ports/expose_only/env_a/compose.yaml +6 -0
  70. isolation_check-0.3.0a2/tests/fixtures/compose/ports/expose_only/env_b/compose.yaml +6 -0
  71. isolation_check-0.3.0a2/tests/fixtures/compose/ports/host_network/env_a/compose.yaml +5 -0
  72. isolation_check-0.3.0a2/tests/fixtures/compose/ports/host_network/env_b/compose.yaml +6 -0
  73. isolation_check-0.3.0a2/tests/fixtures/compose/ports/ipv6_binding/env_a/compose.yaml +6 -0
  74. isolation_check-0.3.0a2/tests/fixtures/compose/ports/ipv6_binding/env_b/compose.yaml +6 -0
  75. isolation_check-0.3.0a2/tests/fixtures/compose/ports/port_range/env_a/compose.yaml +6 -0
  76. isolation_check-0.3.0a2/tests/fixtures/compose/ports/port_range/env_b/compose.yaml +6 -0
  77. isolation_check-0.3.0a2/tests/fixtures/compose/ports/same_internal_different_published/env_a/compose.yaml +6 -0
  78. isolation_check-0.3.0a2/tests/fixtures/compose/ports/same_internal_different_published/env_b/compose.yaml +6 -0
  79. isolation_check-0.3.0a2/tests/fixtures/json/1_shared_custom_volume_a.json +21 -0
  80. isolation_check-0.3.0a2/tests/fixtures/json/1_shared_custom_volume_b.json +21 -0
  81. isolation_check-0.3.0a2/tests/fixtures/json/2_distinct_project_volumes_a.json +21 -0
  82. isolation_check-0.3.0a2/tests/fixtures/json/2_distinct_project_volumes_b.json +21 -0
  83. isolation_check-0.3.0a2/tests/fixtures/json/3_shared_readonly_volume_a.json +21 -0
  84. isolation_check-0.3.0a2/tests/fixtures/json/3_shared_readonly_volume_b.json +21 -0
  85. isolation_check-0.3.0a2/tests/fixtures/json/4_missing_identity_a.json +16 -0
  86. isolation_check-0.3.0a2/tests/fixtures/json/4_missing_identity_b.json +16 -0
  87. isolation_check-0.3.0a2/tests/fixtures/json/5_unmounted_toplevel_volume_a.json +21 -0
  88. isolation_check-0.3.0a2/tests/fixtures/json/5_unmounted_toplevel_volume_b.json +24 -0
  89. isolation_check-0.3.0a2/tests/fixtures/json/multi_conflict_a.json +33 -0
  90. isolation_check-0.3.0a2/tests/fixtures/json/multi_conflict_b.json +33 -0
  91. isolation_check-0.3.0a2/tests/fixtures/json/ports/conflict_exact_ip_a.json +17 -0
  92. isolation_check-0.3.0a2/tests/fixtures/json/ports/conflict_exact_ip_b.json +17 -0
  93. isolation_check-0.3.0a2/tests/fixtures/json/ports/conflict_wildcard_ip_a.json +16 -0
  94. isolation_check-0.3.0a2/tests/fixtures/json/ports/conflict_wildcard_ip_b.json +17 -0
  95. isolation_check-0.3.0a2/tests/fixtures/json/ports/different_protocols_a.json +16 -0
  96. isolation_check-0.3.0a2/tests/fixtures/json/ports/different_protocols_b.json +16 -0
  97. isolation_check-0.3.0a2/tests/fixtures/json/ports/distinct_ports_a.json +16 -0
  98. isolation_check-0.3.0a2/tests/fixtures/json/ports/distinct_ports_b.json +16 -0
  99. isolation_check-0.3.0a2/tests/fixtures/json/ports/dynamic_port_a.json +15 -0
  100. isolation_check-0.3.0a2/tests/fixtures/json/ports/dynamic_port_b.json +16 -0
  101. isolation_check-0.3.0a2/tests/fixtures/json/ports/expose_only_a.json +11 -0
  102. isolation_check-0.3.0a2/tests/fixtures/json/ports/expose_only_b.json +11 -0
  103. isolation_check-0.3.0a2/tests/fixtures/json/ports/host_network_a.json +9 -0
  104. isolation_check-0.3.0a2/tests/fixtures/json/ports/host_network_b.json +16 -0
  105. isolation_check-0.3.0a2/tests/fixtures/json/ports/ipv6_binding_a.json +17 -0
  106. isolation_check-0.3.0a2/tests/fixtures/json/ports/ipv6_binding_b.json +17 -0
  107. isolation_check-0.3.0a2/tests/fixtures/json/ports/port_range_a.json +16 -0
  108. isolation_check-0.3.0a2/tests/fixtures/json/ports/port_range_b.json +16 -0
  109. isolation_check-0.3.0a2/tests/fixtures/json/ports/same_internal_different_published_a.json +16 -0
  110. isolation_check-0.3.0a2/tests/fixtures/json/ports/same_internal_different_published_b.json +16 -0
  111. isolation_check-0.3.0a2/tests/integration/__init__.py +1 -0
  112. isolation_check-0.3.0a2/tests/integration/test_create_git_worktree.py +284 -0
  113. isolation_check-0.3.0a2/tests/integration/test_docker_compose_collection.py +175 -0
  114. isolation_check-0.3.0a2/tests/integration/test_runtime_docker_smoke.py +239 -0
  115. isolation_check-0.3.0a2/tests/integration/test_runtime_lifecycle_git.py +164 -0
  116. isolation_check-0.3.0a2/tests/unit/__init__.py +1 -0
  117. isolation_check-0.3.0a2/tests/unit/test_app_port.py +206 -0
  118. isolation_check-0.3.0a2/tests/unit/test_cli.py +290 -0
  119. isolation_check-0.3.0a2/tests/unit/test_concurrency.py +224 -0
  120. isolation_check-0.3.0a2/tests/unit/test_create_generator.py +101 -0
  121. isolation_check-0.3.0a2/tests/unit/test_create_spec.py +105 -0
  122. isolation_check-0.3.0a2/tests/unit/test_create_validate.py +152 -0
  123. isolation_check-0.3.0a2/tests/unit/test_models.py +92 -0
  124. isolation_check-0.3.0a2/tests/unit/test_normalize.py +197 -0
  125. isolation_check-0.3.0a2/tests/unit/test_report.py +81 -0
  126. isolation_check-0.3.0a2/tests/unit/test_rules_ports.py +210 -0
  127. isolation_check-0.3.0a2/tests/unit/test_rules_volumes.py +180 -0
  128. isolation_check-0.3.0a2/tests/unit/test_runtime_lifecycle.py +375 -0
  129. isolation_check-0.3.0a2/tests/unit/test_runtime_ownership.py +183 -0
  130. isolation_check-0.3.0a2/tests/unit/test_security_redaction.py +105 -0
@@ -0,0 +1,75 @@
1
+ # Changelog
2
+
3
+ All notable changes to `isolation-check` will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
+
7
+ ## [0.3.0a2] - Unreleased (Public Alpha Release Hardening)
8
+
9
+ Supersedes `v0.3.0a1` with critical concurrency, process-identity, port allocation, and permission hardening:
10
+
11
+ ### Fixed & Hardened
12
+ - **Active-Lock Safety**: Lock files are never reclaimed based on elapsed time while verified owner processes remain alive. Separated caller wait timeout from lock abandonment criteria.
13
+ - **Lock-Owner Tokens & PID-Reuse Protection**: Lock records now store unique owner tokens, host identity, command name, and process start-time identity (`/proc/[pid]/stat` on Linux, `GetProcessTimes` on Windows) to detect PID reuse and prevent one process from deleting another's lock.
14
+ - **Cross-Environment Port Synchronization**: Resolved port allocation races between concurrent environments using atomic reservation files (`.isolation-check/ports/<port>.json`) and a repository-scoped port-allocation lock during Docker Compose startup.
15
+ - **Atomic State Writes**: All generated configuration, environment records, manifest files, and runtime-state files use temporary files with `os.fsync` and `os.replace` to prevent partial or corrupted reads.
16
+ - **Private-File Permission Preservation**: Private files such as `isolation.env` and runtime state are created with restrictive permissions (`0600`) at initial file creation time on POSIX, eliminating any broad-permission window.
17
+ - **Exit-Code Contract Enforcement**: Strictly enforces exit codes across text and JSON output: `0` for no failures (warnings/unknown permitted in normal mode), `1` for one or more failures (`VOL001`, `PORT001`, etc.), and `2` for invalid inputs, arguments, or strict-mode unresolved results.
18
+ - **Removal of Destructive Down Flags**: Completely removed `-v` and `--volumes` from `down` argument parser; passing either is rejected with exit code 2 to guarantee database volumes are never accidentally removed.
19
+
20
+ ## [0.3.0a1] - Unreleased (Public Alpha Release Readiness)
21
+
22
+ ### Added
23
+ - Standard `--version` (`-V`) CLI flag displaying authoritative package version.
24
+ - Python packaging infrastructure in `pyproject.toml` adhering to PEP 621 / PEP 517 / PEP 440 with build backend setuptools.
25
+ - `MANIFEST.in` and `py.typed` marker for PEP 561 compliance.
26
+ - Complete open-source project documents:
27
+ - `LICENSE` (Apache-2.0)
28
+ - `CONTRIBUTING.md` with development setup, coding guidelines, and PR workflow
29
+ - `SECURITY.md` with private vulnerability reporting and secret-redaction requirements
30
+ - `CODE_OF_CONDUCT.md` (Contributor Covenant v2.1)
31
+ - `SUPPORT.md` with issue guidance and links
32
+ - Verified minimal working example under `examples/postgres-app/`.
33
+ - GitHub Actions CI workflow (`.github/workflows/ci.yml`) testing Linux builds, matrix tests, and clean wheel installation.
34
+ - GitHub Actions release workflow (`.github/workflows/release.yml`) with PyPI Trusted Publishing preparation.
35
+ - Issue and PR templates (`.github/ISSUE_TEMPLATE/bug_report.yml`, `feature_request.yml`, `pull_request_template.md`).
36
+ - Coding agent integration guide (`docs/agent-integration.md`).
37
+ - Comprehensive support matrix and troubleshooting guide in `README.md`.
38
+
39
+ ## [0.2.0a1] - Previous Development Milestone (Managed Runtime Lifecycle)
40
+
41
+ ### Added
42
+ - Managed runtime lifecycle CLI subcommands:
43
+ - `isolation-check up <environment>` (`--json`, `--repo`)
44
+ - `isolation-check status <environment>` (`--json`, `--repo`)
45
+ - `isolation-check down <environment>` (`--json`, `--repo`, strictly non-destructive)
46
+ - Explicit application container target port contract (`app_port` / `--app-port`):
47
+ - Inferred when exactly one unambiguous container port is published or exposed.
48
+ - Refuses zero candidate container ports with requirement for explicit configuration.
49
+ - Refuses multiple candidate container ports with requirement for explicit configuration.
50
+ - Validates integer range between 1 and 65535.
51
+ - Dynamic loopback host-port allocation on `127.0.0.1` at `up` time without permanent pre-allocation during `create`.
52
+ - Docker Compose override tag capability detection (`!override`, `!reset`).
53
+ - Strict ownership, worktree registration, and path boundary validation on all runtime commands.
54
+ - Foreign Compose project container detection and refusal via container labels.
55
+ - Read-only status inspection distinguishing `RUNNING` from `HEALTHY` (`UNKNOWN` health when no healthcheck exists).
56
+ - Detection of stale `runtime-state.json` when containers are stopped externally.
57
+ - Volume-preserving teardown in `down` (refusal of `-v`/`--volumes` flags).
58
+ - Authoritative package version helper in `src/isolation_check/version.py` decoupled from manifest schema version (`1`).
59
+
60
+ ### Changed
61
+ - Compose override generation unpublishes PostgreSQL (`ports: !reset []`) unless `publish_db: true` is explicitly enabled.
62
+ - Application port is published only to `127.0.0.1` using `ports: !override`.
63
+
64
+ ## [0.1.0a3] - Previous Development Milestone (Worktree Creation)
65
+
66
+ ### Added
67
+ - Environment creation via `isolation-check create <environment>` (`--dry-run`).
68
+ - Dedicated PostgreSQL volumes and connection URL generation.
69
+ - Ownership manifest recording tool intent in worktree.
70
+
71
+ ## [0.1.0a1] - Initial Proof-of-Concept
72
+
73
+ ### Added
74
+ - Compose named volume collision detection (`VOL001`).
75
+ - Fixed IPv4 host port collision detection (`PORT001`).
@@ -0,0 +1,110 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ `sairamanladi2007@gmail.com`.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+ **Community Impact**: Use of inappropriate language or other behavior deemed
76
+ unprofessional or unwelcome in the community.
77
+ **Consequence**: A private, written warning from community leaders, providing
78
+ clarity around the nature of the violation and an explanation of why the
79
+ behavior was inappropriate. A public apology may be requested.
80
+
81
+ ### 2. Warning
82
+ **Community Impact**: A violation through a single incident or series of actions.
83
+ **Consequence**: A warning with consequences for continued behavior. No
84
+ interaction with the people involved, including unsolicited interaction with
85
+ those enforcing the Code of Conduct, for a specified period of time. This
86
+ includes avoiding interactions in community spaces as well as external channels
87
+ like social media. Violating these terms may lead to a temporary or permanent
88
+ ban.
89
+
90
+ ### 3. Temporary Ban
91
+ **Community Impact**: A serious violation of community standards, including
92
+ sustained inappropriate behavior.
93
+ **Consequence**: A temporary ban from any sort of interaction or public
94
+ communication with the community for a specified period of time. No public or
95
+ private interaction with the people involved, including unsolicited interaction
96
+ with those enforcing the Code of Conduct, is allowed during this period.
97
+ Violating these terms may lead to a permanent ban.
98
+
99
+ ### 4. Permanent Ban
100
+ **Community Impact**: Demonstrating a pattern of violation of community
101
+ standards, including sustained inappropriate behavior, harassment of an
102
+ individual, or aggression toward or disparagement of classes of individuals.
103
+ **Consequence**: A permanent ban from any sort of public interaction within the
104
+ community.
105
+
106
+ ## Attribution
107
+
108
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
109
+ version 2.1, available at
110
+ https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
@@ -0,0 +1,93 @@
1
+ # Contributing to isolation-check
2
+
3
+ Thank you for your interest in contributing to `isolation-check`!
4
+
5
+ `isolation-check` is an open-source command-line tool that creates and verifies supported isolation boundaries for local Git worktree environments.
6
+
7
+ ---
8
+
9
+ ## Code of Conduct
10
+
11
+ All contributors and participants agree to abide by our [Code of Conduct](CODE_OF_CONDUCT.md).
12
+
13
+ ---
14
+
15
+ ## Development Setup
16
+
17
+ ### Prerequisites
18
+ - Python 3.11 or higher
19
+ - Git 2.30 or higher
20
+ - Docker Compose v2.20+ (optional for unit tests, required for Compose rendering and integration tests)
21
+
22
+ ### Local Environment
23
+ 1. Clone the repository:
24
+ ```bash
25
+ git clone https://github.com/rxmna8502/isolation-check.git
26
+ cd isolation-check
27
+ ```
28
+
29
+ 2. Create and activate a virtual environment:
30
+ ```bash
31
+ python -m venv .venv
32
+ # On Linux/macOS:
33
+ source .venv/bin/activate
34
+ # On Windows (PowerShell):
35
+ .venv\Scripts\Activate.ps1
36
+ ```
37
+
38
+ 3. Install the package in editable mode with development dependencies:
39
+ ```bash
40
+ pip install -e ".[dev]"
41
+ ```
42
+
43
+ 4. Run the test suite:
44
+ ```bash
45
+ python -m unittest discover -s tests -v
46
+ ```
47
+
48
+ 5. Build the source distribution and wheel:
49
+ ```bash
50
+ python -m build
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Coding Guidelines & Safety Rules
56
+
57
+ 1. **Maintain Minimal Dependencies:**
58
+ `isolation-check` core CLI has zero third-party runtime dependencies. Do not add runtime dependencies without prior discussion.
59
+
60
+ 2. **Security & Subprocess Safety:**
61
+ - Never use `shell=True` in `subprocess` calls.
62
+ - Always use argument arrays (`["docker", "compose", ...]`).
63
+ - Run subprocesses with sanitized environment variables (via `_build_safe_env()`) and explicit timeouts.
64
+ - Bounded stdout/stderr capture is mandatory (default 1MB limit).
65
+ - Never print or leak passwords, credentials, or private environment files. Use `[REDACTED]` in reports.
66
+
67
+ 3. **File Permissions & Boundaries:**
68
+ - Restrict permissions on sensitive generated files (e.g. `mode 0600` on credentials and runtime state).
69
+ - Strictly validate paths against directory boundaries to prevent path traversal (`..`) or symlink escapes.
70
+
71
+ 4. **Non-Destructive Operations:**
72
+ - Never execute arbitrary commands or migrations inside user containers.
73
+ - Never pass destructive flags (`-v`, `--volumes`) to `docker compose down`. Preserve database data.
74
+
75
+ ---
76
+
77
+ ## Submitting Pull Requests
78
+
79
+ 1. Fork the repository and create a branch from `main`.
80
+ 2. Ensure all tests pass (`python -m unittest discover tests`).
81
+ 3. Add deterministic unit tests covering any new logic or bug fixes.
82
+ 4. Keep commits focused and provide descriptive commit messages following Conventional Commits (`feat: ...`, `fix: ...`, `docs: ...`, `test: ...`).
83
+ 5. Open a Pull Request referencing the PR template.
84
+
85
+ ---
86
+
87
+ ## Beginner-Friendly Contribution Opportunities
88
+
89
+ Good starting points for contributors:
90
+ - Expanding test fixtures in `tests/fixtures/` for various Docker Compose service declarations.
91
+ - Adding Compose rendering test cases for multi-file merge sequences.
92
+ - Improving error diagnostic messages when Docker Compose or Git encounters host permission errors.
93
+ - Documentation clarity improvements in `examples/` and README.
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 isolation-check contributors
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,7 @@
1
+ include README.md LICENSE CHANGELOG.md CONTRIBUTING.md SECURITY.md CODE_OF_CONDUCT.md SUPPORT.md pyproject.toml
2
+ recursive-include src/isolation_check *.py py.typed
3
+ recursive-include examples *
4
+ recursive-include tests *.py *.json *.yaml *.yml
5
+ global-exclude *.py[cod] __pycache__ *.so *.dylib *.zip
6
+ global-exclude .isolation-check*
7
+ global-exclude *.env