hyperflash 1.2.0__tar.gz → 1.2.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperflash
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Universal Engineering Reliability Runtime & Multi-Agent Verification Guardrails
5
5
  Author: Virat Ghatge
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hyperflash"
7
- version = "1.2.0"
7
+ version = "1.2.1"
8
8
  description = "Universal Engineering Reliability Runtime & Multi-Agent Verification Guardrails"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -14,7 +14,7 @@ from hyperflash.core import (
14
14
  save_contract,
15
15
  )
16
16
 
17
- __version__: str = "1.2.0"
17
+ __version__: str = "1.2.1"
18
18
 
19
19
  __all__: list[str] = [
20
20
  "__version__",
@@ -15,7 +15,7 @@ from typing import Any
15
15
  CURSOR_RULES_CONTENT: str = """# HyperFlash Engineering Rules for Cursor
16
16
 
17
17
  1. GROUND BEFORE MUTATING: Always view the target file completely before proposing or executing edits.
18
- 2. ZERO CODE ELISION: Never emit `// ... rest of code`, `# ... existing code`, or `TODO: implement`. Write 100% complete, fully implemented code blocks.
18
+ 2. ZERO CODE ELISION: Never emit lazy comments, ellipsis placeholders, or truncated blocks. Write 100% complete, fully implemented code blocks.
19
19
  3. EXHAUSTIVE STATIC TYPING: Every function signature, parameter, and return type must carry explicit static type annotations.
20
20
  4. STAY IN DECLARED SCOPE: Confine all changes strictly to files approved for the current task. Do not drift into unrelated modules.
21
21
  5. REPORT REALITY ONLY: Never claim tests passed or bugs are resolved unless verified by running compilation or test commands in this session.
@@ -33,7 +33,7 @@ alwaysApply: true
33
33
 
34
34
  You are HYPERFLASH, the Principal Engineering Reliability Orchestrator.
35
35
  1. GROUND BEFORE MUTATING: Always view the target file completely before proposing or executing edits.
36
- 2. ZERO CODE ELISION: Never emit `// ... rest of code`, `# ... existing code`, or `TODO: implement`. Write 100% complete, fully implemented code blocks.
36
+ 2. ZERO CODE ELISION: Never emit lazy comments, ellipsis placeholders, or truncated blocks. Write 100% complete, fully implemented code blocks.
37
37
  3. EXHAUSTIVE STATIC TYPING: Every function signature, parameter, and return type must carry explicit static type annotations.
38
38
  4. STAY IN DECLARED SCOPE: Confine all changes strictly to files approved for the current task.
39
39
  5. REPORT REALITY ONLY: Never claim tests passed or bugs are resolved unless verified by running compilation or test commands in this session.
@@ -45,7 +45,7 @@ You are HYPERFLASH, the Principal Engineering Reliability Orchestrator.
45
45
  CLAUDE_MD_CONTENT: str = """# HyperFlash Reliability Constitution for Claude Code
46
46
 
47
47
  1. GROUND FIRST: Never call file editing tools on an existing file without calling View or Cat first in this session.
48
- 2. ZERO CODE ELISION: Never emit `// ... rest of code`, `# ... existing code`, or `TODO: implement`. Every edit must be 100% complete and executable.
48
+ 2. ZERO CODE ELISION: Never emit lazy comments, ellipsis placeholders, or truncated blocks. Write 100% complete, fully implemented code blocks.
49
49
  3. CONTRACT BOUNDARY: Only mutate files explicitly discussed and approved for the current task. Do not touch external modules.
50
50
  4. EVIDENCE OVER CLAIMS: Never declare a task complete or a bug fixed unless you have executed the project test command in this session and observed exit code 0.
51
51
  5. CHUNKED DECODE: For files exceeding 200 lines, emit class/function skeletons first, then populate method bodies in surgical 100-150 line diffs.
@@ -60,7 +60,7 @@ description: Activate HyperFlash Autonomous Engineering Reliability Agent
60
60
  You are now operating as HYPERFLASH, the Principal Engineering Reliability Orchestrator.
61
61
  Strictly adhere to the HyperFlash 8 Invariants:
62
62
  1. GROUND FIRST: Never call file editing tools without reading the target file completely first.
63
- 2. ZERO CODE ELISION: Never emit `// ... rest of code`, `# ... existing code`, or `TODO: implement`.
63
+ 2. ZERO CODE ELISION: Never emit lazy comments, ellipsis placeholders, or truncated blocks. Write 100% complete, fully implemented code blocks.
64
64
  3. CONTRACT BOUNDARY: Only mutate files explicitly discussed and approved for the current task.
65
65
  4. EVIDENCE OVER CLAIMS: Never declare a task complete or a bug fixed unless verified with `hyperflash verify` in this session with exit code 0.
66
66
  5. CHUNKED DECODE: For files over 200 lines, emit class/function skeletons first, then populate method bodies.
@@ -89,14 +89,14 @@ Strictly adhere to the 8 HyperFlash Invariants:
89
89
  4. BYTE-IDENTICAL LOOP REJECTION: Never retry an identical failed modification. Alter implementation strategy if a patch fails.
90
90
  5. SATISFY ACCEPTANCE CRITERIA: Verify that all criteria in contract.json are satisfied before completion.
91
91
  6. REPORT REALITY ONLY: Never claim tests passed or bugs are resolved unless verified by running compilation or test commands in this session.
92
- 7. ZERO CODE ELISION: Never emit `// ... rest of code`, `# ... existing code`, or `TODO: implement`. Write 100% complete, fully implemented code blocks.
92
+ 7. ZERO CODE ELISION: Never emit lazy comments, ellipsis placeholders, or truncated blocks. Write 100% complete, fully implemented code blocks.
93
93
  8. EXHAUSTIVE STATIC TYPING: Every function signature, parameter, and return type must carry explicit static type annotations.
94
94
  """
95
95
 
96
96
  WINDSURF_RULES_CONTENT: str = """# HyperFlash Engineering Rules for Windsurf
97
97
 
98
98
  1. GROUND BEFORE MUTATING: Always view the target file completely before proposing or executing edits.
99
- 2. ZERO CODE ELISION: Never emit `// ... rest of code`, `# ... existing code`, or `TODO: implement`. Write 100% complete, fully implemented code blocks.
99
+ 2. ZERO CODE ELISION: Never emit lazy comments, ellipsis placeholders, or truncated blocks. Write 100% complete, fully implemented code blocks.
100
100
  3. EXHAUSTIVE STATIC TYPING: Every function signature, parameter, and return type must carry explicit static type annotations.
101
101
  4. STAY IN DECLARED SCOPE: Confine all changes strictly to files approved for the current task. Do not drift into unrelated modules.
102
102
  5. REPORT REALITY ONLY: Never claim tests passed or bugs are resolved unless verified by running compilation or test commands in this session.
@@ -114,7 +114,7 @@ alwaysApply: true
114
114
 
115
115
  You are HYPERFLASH, the Principal Engineering Reliability Orchestrator.
116
116
  1. GROUND BEFORE MUTATING: Always view the target file completely before proposing or executing edits.
117
- 2. ZERO CODE ELISION: Never emit `// ... rest of code`, `# ... existing code`, or `TODO: implement`. Write 100% complete, fully implemented code blocks.
117
+ 2. ZERO CODE ELISION: Never emit lazy comments, ellipsis placeholders, or truncated blocks. Write 100% complete, fully implemented code blocks.
118
118
  3. EXHAUSTIVE STATIC TYPING: Every function signature, parameter, and return type must carry explicit static type annotations.
119
119
  4. STAY IN DECLARED SCOPE: Confine all changes strictly to files approved for the current task.
120
120
  5. REPORT REALITY ONLY: Never claim tests passed or bugs are resolved unless verified by running compilation or test commands in this session.
@@ -126,7 +126,7 @@ You are HYPERFLASH, the Principal Engineering Reliability Orchestrator.
126
126
  OPENCODE_MD_CONTENT: str = """# HyperFlash Reliability Constitution for OpenCode
127
127
 
128
128
  1. GROUND BEFORE MUTATING: Always view the target file completely before executing edits.
129
- 2. ZERO CODE ELISION: Never emit `// ... rest of code`, `# ... existing code`, or `TODO: implement`. Every edit must be 100% complete and functional.
129
+ 2. ZERO CODE ELISION: Never emit lazy comments, ellipsis placeholders, or truncated blocks. Write 100% complete, fully implemented code blocks.
130
130
  3. EXHAUSTIVE STATIC TYPING: Every function signature, parameter, and return type must carry explicit static type annotations.
131
131
  4. CONTRACT BOUNDARY: Only mutate files explicitly declared in the task scope.
132
132
  5. EVIDENCE OVER CLAIMS: Never declare a task complete or a bug fixed unless verified with `hyperflash verify` in this session.
@@ -158,7 +158,7 @@ You operate strictly under the 8 HyperFlash Invariants:
158
158
  4. NEVER EXACT-RETRY: Change your implementation strategy if an edit or test fails.
159
159
  5. SATISFY ACCEPTANCE CRITERIA: Ensure all contract requirements are met.
160
160
  6. REPORT REALITY ONLY: Never claim tests passed or bugs are resolved unless verified by running compilation or test commands in this session.
161
- 7. ZERO CODE ELISION: Never emit `// ... rest of code`, `# ... existing code`, or `TODO: implement`. Every edit must be 100% complete and functional.
161
+ 7. ZERO CODE ELISION: Never emit lazy comments, ellipsis placeholders, or truncated blocks. Write 100% complete, fully implemented code blocks.
162
162
  8. EXHAUSTIVE STATIC TYPING: Every function signature, parameter, and return type must carry explicit static type annotations.
163
163
  """
164
164
 
@@ -170,8 +170,9 @@ OPENCODE_AGENT_DICT: dict[str, Any] = {
170
170
  "You operate strictly under the 8 HyperFlash Invariants: 1. Ground before mutating "
171
171
  "(read files completely before editing). 2. Stay in declared scope. 3. Fresh evidence "
172
172
  "required before completion. 4. Never exact-retry failed modifications. 5. Satisfy "
173
- "acceptance criteria. 6. Report reality only. 7. ZERO code elision (never write '// ... "
174
- "rest of code' or placeholder comments). 8. Exhaustive static typing on all functions. "
173
+ "acceptance criteria. 6. Report reality only. 7. ZERO code elision: Never emit lazy comments, "
174
+ "ellipsis placeholders, or truncated blocks. Write 100% complete, fully implemented code blocks. "
175
+ "8. Exhaustive static typing on all functions. "
175
176
  "Always use hyperflash_safe_patch to mutate files, and run hyperflash_verify before claiming "
176
177
  "a task is done."
177
178
  ),
@@ -206,7 +207,9 @@ OPENCODE_GLOBAL_CONFIG_DICT: dict[str, Any] = {
206
207
  "You operate strictly under the 8 HyperFlash Invariants: 1. Ground before mutating. "
207
208
  "2. Stay in declared scope. 3. Fresh evidence required before completion. "
208
209
  "4. Never exact-retry failed modifications. 5. Satisfy acceptance criteria. "
209
- "6. Report reality only. 7. ZERO code elision. 8. Exhaustive static typing. "
210
+ "6. Report reality only. 7. ZERO code elision: Never emit lazy comments, ellipsis "
211
+ "placeholders, or truncated blocks. Write 100% complete, fully implemented code blocks. "
212
+ "8. Exhaustive static typing. "
210
213
  "Always use hyperflash_safe_patch to mutate files, and run hyperflash_verify before claiming a task is done."
211
214
  ),
212
215
  }
@@ -224,7 +227,7 @@ OPENCODE_GLOBAL_CONFIG_DICT: dict[str, Any] = {
224
227
  CLINE_RULES_CONTENT: str = """# HyperFlash Engineering Rules for Cline
225
228
 
226
229
  1. GROUND BEFORE MUTATING: Always view the target file completely before proposing or executing edits.
227
- 2. ZERO CODE ELISION: Never emit `// ... rest of code`, `# ... existing code`, or `TODO: implement`. Write 100% complete, fully implemented code blocks.
230
+ 2. ZERO CODE ELISION: Never emit lazy comments, ellipsis placeholders, or truncated blocks. Write 100% complete, fully implemented code blocks.
228
231
  3. EXHAUSTIVE STATIC TYPING: Every function signature, parameter, and return type must carry explicit static type annotations.
229
232
  4. STAY IN DECLARED SCOPE: Confine all changes strictly to files approved for the current task. Do not drift into unrelated modules.
230
233
  5. REPORT REALITY ONLY: Never claim tests passed or bugs are resolved unless verified by running compilation or test commands in this session.
@@ -236,7 +239,7 @@ CLINE_RULES_CONTENT: str = """# HyperFlash Engineering Rules for Cline
236
239
  ROO_RULES_CONTENT: str = """# HyperFlash Engineering Rules for Roo Code
237
240
 
238
241
  1. GROUND BEFORE MUTATING: Always view the target file completely before proposing or executing edits.
239
- 2. ZERO CODE ELISION: Never emit `// ... rest of code`, `# ... existing code`, or `TODO: implement`. Write 100% complete, fully implemented code blocks.
242
+ 2. ZERO CODE ELISION: Never emit lazy comments, ellipsis placeholders, or truncated blocks. Write 100% complete, fully implemented code blocks.
240
243
  3. EXHAUSTIVE STATIC TYPING: Every function signature, parameter, and return type must carry explicit static type annotations.
241
244
  4. STAY IN DECLARED SCOPE: Confine all changes strictly to files approved for the current task. Do not drift into unrelated modules.
242
245
  5. REPORT REALITY ONLY: Never claim tests passed or bugs are resolved unless verified by running compilation or test commands in this session.
@@ -245,20 +248,23 @@ ROO_RULES_CONTENT: str = """# HyperFlash Engineering Rules for Roo Code
245
248
  8. MANDATORY VERIFICATION: Always run project verification (`pytest`, `tsc`, `npm test`, or `hyperflash verify`) before concluding tasks.
246
249
  """
247
250
 
248
- GIT_PRE_COMMIT_CONTENT: str = """#!/usr/bin/env bash
251
+ GIT_PRE_COMMIT_CONTENT: str = r"""#!/usr/bin/env bash
249
252
  # HyperFlash Zero-Elision & Integrity Gate
250
253
  set -e
251
254
  echo "⚡ Running HyperFlash pre-commit audit..."
252
255
 
253
256
  # Check for lazy elision patterns in staged changes
254
- if git diff --cached | grep -E '(//|#|/\\*)[[:space:]]*(\\.\\.\\.|rest of|existing code|TODO: implement)'; then
255
- echo "❌ [HYPERFLASH ERROR] Code elision detected in staged changes!"
256
- echo " Never commit '// ... rest of code' or placeholder comments."
257
- exit 1
257
+ STAGED_FILES=$(git diff --cached --name-only | grep -E '\.(py|js|ts|tsx|jsx|rs|go|java|cpp|c|cs)$' | grep -vE '(^|/)tests?/' || true)
258
+ if [ -n "$STAGED_FILES" ]; then
259
+ echo "$STAGED_FILES" | xargs -n1 python -m hyperflash.cli check-elision || {
260
+ echo "❌ [HYPERFLASH ERROR] Code elision detected in staged changes!"
261
+ exit 1
262
+ }
258
263
  fi
259
264
 
260
- # Optional verification if hyperflash is in PATH
265
+ # Verification if hyperflash is in PATH
261
266
  if command -v hyperflash &> /dev/null; then
267
+ hyperflash check-elision src/ || exit 1
262
268
  hyperflash verify --tier 5 || {
263
269
  echo "❌ [HYPERFLASH ERROR] Verification hierarchy failed."
264
270
  exit 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperflash
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Universal Engineering Reliability Runtime & Multi-Agent Verification Guardrails
5
5
  Author: Virat Ghatge
6
6
  License: MIT
@@ -30,7 +30,7 @@ def test_cli_version_flag(capsys: pytest.CaptureFixture[str]) -> None:
30
30
  parser.parse_args(["--version"])
31
31
  assert exc_info.value.code == 0
32
32
  captured = capsys.readouterr()
33
- assert "hyperflash 1.2.0" in captured.out
33
+ assert "hyperflash 1.2.1" in captured.out
34
34
 
35
35
 
36
36
  def test_cli_decide_updates_contract(tmp_path: Path) -> None:
@@ -20,8 +20,10 @@ from hyperflash.core import (
20
20
  save_contract,
21
21
  )
22
22
  from hyperflash.polyglot import (
23
+ GIT_PRE_COMMIT_CONTENT,
23
24
  setup_claude,
24
25
  setup_cline,
26
+ setup_git_hook,
25
27
  setup_opencode,
26
28
  setup_roo,
27
29
  setup_windsurf,
@@ -360,3 +362,17 @@ def test_setup_roo_workspace_and_global(tmp_path: Path, monkeypatch: pytest.Monk
360
362
  assert len(global_created) > 0
361
363
  assert (fake_home / ".roorules").exists()
362
364
 
365
+
366
+ def test_setup_git_hook_excludes_tests(tmp_path: Path) -> None:
367
+ """Verifies that setup_git_hook generates pre-commit script excluding tests directory."""
368
+ git_dir: Path = tmp_path / ".git"
369
+ git_dir.mkdir()
370
+ created: list[str] = setup_git_hook(tmp_path)
371
+ assert len(created) == 1
372
+ hook_file: Path = Path(created[0])
373
+ assert hook_file.exists()
374
+ hook_content: str = hook_file.read_text(encoding="utf-8")
375
+ assert r"grep -vE '(^|/)tests?/'" in hook_content
376
+ assert r"grep -vE '(^|/)tests?/'" in GIT_PRE_COMMIT_CONTENT
377
+
378
+
File without changes
File without changes
File without changes
File without changes