claude-dev-env 7.3.0 → 7.4.1
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.
- package/.agents/skills/session-continuity/continuity.mjs +1 -3
- package/.agents/skills/session-continuity/continuity.test.mjs +12 -4
- package/AGENTS.md +12 -2
- package/bin/install.agents-home.test.mjs +1 -0
- package/bin/install.codex-rules.test.mjs +2 -0
- package/bin/install.cursor-rules.test.mjs +1 -0
- package/bin/install.mjs +57 -10
- package/bin/install.prune.test.mjs +1 -0
- package/bin/install.pstack-plugin.test.mjs +1 -0
- package/bin/install.settings-defaults.test.mjs +1 -0
- package/bin/install.test.mjs +118 -4
- package/bin/install.transaction.test.mjs +6 -0
- package/bin/install.uninstall-transaction.test.mjs +2 -0
- package/bin/pstack.mjs +24 -4
- package/bin/pstack.test.mjs +20 -10
- package/hooks/blocking/env_var_table_code_drift_blocker.py +11 -99
- package/hooks/blocking/env_var_table_rows.py +130 -0
- package/hooks/blocking/pii_scanner.py +19 -29
- package/hooks/blocking/test_env_var_table_code_drift_blocker.py +81 -3
- package/hooks/blocking/test_env_var_table_rows.py +100 -0
- package/hooks/blocking/test_pii_scanner.py +34 -24
- package/hooks/hooks_constants/env_var_table_code_drift_constants.py +12 -4
- package/hooks/hooks_constants/hardcoded_user_path_constants.py +12 -10
- package/hooks/hooks_constants/pii_prevention_constants.py +10 -25
- package/package.json +1 -1
- package/scripts/pstack-adapters/common.md +1 -1
- package/scripts/repository_checks/config/constants.py +7 -17
- package/scripts/repository_checks/config/email_exemptions.py +10 -0
- package/scripts/repository_checks/email_exemptions.py +96 -0
- package/scripts/repository_checks/env_var_documentation.py +1 -9
- package/scripts/repository_checks/tracked_secrets.py +10 -4
- package/scripts/tests/test_email_exemptions.py +121 -0
- package/scripts/tests/test_env_var_documentation.py +26 -0
- package/scripts/tests/test_rules.py +25 -0
- package/scripts/tests/test_tracked_secrets.py +13 -0
|
@@ -17,6 +17,9 @@ from repository_checks.config.constants import (
|
|
|
17
17
|
FINDINGS_EXIT_CODE,
|
|
18
18
|
SUCCESS_EXIT_CODE,
|
|
19
19
|
)
|
|
20
|
+
from repository_checks.env_var_documentation import (
|
|
21
|
+
collect_env_var_documentation_findings,
|
|
22
|
+
)
|
|
20
23
|
from repository_policy_test_support import (
|
|
21
24
|
commit_tracked_files,
|
|
22
25
|
initialize_repository,
|
|
@@ -131,3 +134,26 @@ def record_read_paths(monkeypatch: pytest.MonkeyPatch) -> list[Path]:
|
|
|
131
134
|
|
|
132
135
|
monkeypatch.setattr(Path, "read_text", record_read_path)
|
|
133
136
|
return all_read_paths
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
@pytest.mark.parametrize("header", ["Symbol", "Component", "Constant"])
|
|
140
|
+
def test_should_ignore_source_tables_before_reading_named_code(
|
|
141
|
+
tmp_path: Path, monkeypatch: pytest.MonkeyPatch, header: str
|
|
142
|
+
) -> None:
|
|
143
|
+
repository_root = tmp_path / "repo"
|
|
144
|
+
initialize_repository(repository_root)
|
|
145
|
+
write_text(repository_root / "workflow.py", "def run():\n return\n")
|
|
146
|
+
write_text(
|
|
147
|
+
repository_root / "docs" / "source-map.md",
|
|
148
|
+
f"| {header} | Source |\n"
|
|
149
|
+
"| --- | --- |\n"
|
|
150
|
+
"| `PROCESSING_VISIBLE` | `workflow.py` |\n",
|
|
151
|
+
)
|
|
152
|
+
commit_tracked_files(repository_root)
|
|
153
|
+
patch_unreadable_named_file(
|
|
154
|
+
monkeypatch, "workflow.py", "unrelated source unreadable"
|
|
155
|
+
)
|
|
156
|
+
assert (
|
|
157
|
+
collect_env_var_documentation_findings(repository_root, ["docs/source-map.md"])
|
|
158
|
+
== []
|
|
159
|
+
)
|
|
@@ -125,6 +125,31 @@ def _worker_policy_surfaces(package_root: Path) -> tuple[Path, ...]:
|
|
|
125
125
|
)
|
|
126
126
|
|
|
127
127
|
|
|
128
|
+
def _banned_word_real_phrases() -> tuple[str, ...]:
|
|
129
|
+
return (
|
|
130
|
+
"banned word: real",
|
|
131
|
+
"never write real, really, or real-world",
|
|
132
|
+
"this ban has no exception",
|
|
133
|
+
"swapping in actual, actually, genuine, or true is the same move",
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def _banned_word_real_surfaces(package_root: Path) -> tuple[Path, ...]:
|
|
138
|
+
return (
|
|
139
|
+
package_root.parent.parent / "AGENTS.md",
|
|
140
|
+
package_root / "AGENTS.md",
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def test_banned_word_real_reaches_installed_instruction_surfaces() -> None:
|
|
145
|
+
all_expected_phrases = _banned_word_real_phrases()
|
|
146
|
+
|
|
147
|
+
for each_surface_path in _banned_word_real_surfaces(_PACKAGE_ROOT):
|
|
148
|
+
surface_text = each_surface_path.read_text(encoding="utf-8").lower()
|
|
149
|
+
for each_phrase in all_expected_phrases:
|
|
150
|
+
assert each_phrase in surface_text, each_surface_path
|
|
151
|
+
|
|
152
|
+
|
|
128
153
|
def test_comment_guidance_reaches_installed_instruction_surfaces() -> None:
|
|
129
154
|
expected_phrases = _comment_policy_phrases()
|
|
130
155
|
all_surface_paths = _comment_policy_surfaces(_PACKAGE_ROOT)
|
|
@@ -10,6 +10,7 @@ import pytest
|
|
|
10
10
|
from repository_checks.config.constants import (
|
|
11
11
|
ALL_TRACKED_SECRET_EXACT_EXEMPTIONS,
|
|
12
12
|
CHECK_ID_TRACKED_PERSONAL_DATA,
|
|
13
|
+
FAILED_CHECK_EXIT_CODE,
|
|
13
14
|
FINDINGS_EXIT_CODE,
|
|
14
15
|
)
|
|
15
16
|
from repository_checks.hook_modules import load_hooks_module
|
|
@@ -55,6 +56,18 @@ def test_should_flag_a_tracked_secret(tmp_path: Path) -> None:
|
|
|
55
56
|
assert _SYNTHETIC_GITHUB_TOKEN not in stdout_text
|
|
56
57
|
|
|
57
58
|
|
|
59
|
+
def test_should_fail_closed_for_malformed_repository_email_policy(
|
|
60
|
+
tmp_path: Path,
|
|
61
|
+
) -> None:
|
|
62
|
+
repository_root = tmp_path / "repo"
|
|
63
|
+
initialize_repository(repository_root)
|
|
64
|
+
write_text(repository_root / "config" / "repository-policy.json", "{")
|
|
65
|
+
commit_tracked_files(repository_root)
|
|
66
|
+
exit_code, stdout_text, _stderr_text = run_policy(repository_root)
|
|
67
|
+
assert exit_code == FAILED_CHECK_EXIT_CODE
|
|
68
|
+
assert f"error: rule failed: {CHECK_ID_TRACKED_PERSONAL_DATA}" in stdout_text
|
|
69
|
+
|
|
70
|
+
|
|
58
71
|
def test_should_fail_closed_before_reading_a_tracked_symlink_outside_repository(
|
|
59
72
|
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
|
60
73
|
) -> None:
|