@xelth/eck-snapshot 6.4.1 → 6.4.2

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/README.md CHANGED
@@ -171,6 +171,13 @@ Both `scout` and `link` use the same depth scale to control content granularity:
171
171
  * **📚 NotebookLM Export:** Semantic chunking for Google's NotebookLM with "Brain + Body" architecture (see below).
172
172
  * **🧠 Multi-Agent Protocol:** Junior Architect delegation system for multi-agent coding workflows (see below).
173
173
 
174
+ ### 🤖 Autonomous AI Protocols
175
+ `eckSnapshot` automatically injects strict behavioral protocols into the AI Architect's prompt (`multiAgent.md`) to ensure high code quality and prevent context degradation:
176
+ 1. **Context Hygiene Protocol:** The AI actively monitors the directory tree for bloat (logs, DB dumps, binaries). If detected, it autonomously constructs an `.eckignore` file to hide the garbage, saving tokens and context space.
177
+ 2. **Proactive Tech Debt:** The AI scans for `TODO`, `FIXME`, and `HACK` comments, evaluating them against the actual code. It will autonomously delete obsolete comments, fix quick bugs, or document major issues in `.eck/TECH_DEBT.md`.
178
+ 3. **The Boy Scout Rule:** Whenever the AI modifies or creates a function, it is forced to write or update its JSDoc/Docstring to explain *why* the code exists, keeping documentation perfectly synced.
179
+ 4. **Zero-Broken-Windows (Reliability):** Blind commits are strictly forbidden. The AI must run the project's test suite (e.g., `npm test`, `cargo test`) and ensure all tests pass before calling the task completion tool.
180
+
174
181
  ---
175
182
 
176
183
  ## 📚 NotebookLM Integration (New in v6.3 — Testing)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xelth/eck-snapshot",
3
- "version": "6.4.1",
3
+ "version": "6.4.2",
4
4
  "description": "A powerful CLI tool to create and restore single-file text snapshots of Git repositories. Optimized for AI context, LLM workflows, and multi-agent Swarm coordination.",
5
5
  "keywords": [
6
6
  "ai",
@@ -37,10 +37,16 @@ The `.eck/` directory files are your "Source of Knowledge".
37
37
  ### 🧹 CONTEXT HYGIENE PROTOCOL (CRITICAL)
38
38
 
39
39
  You are responsible for keeping your own context window clean and efficient.
40
- If you notice in the "Directory Structure" or file list that the snapshot has captured irrelevant data (e.g., compiled binaries, database dumps like .wal, huge generated logs, raw data arrays, or decompiled third-party code):
41
- 1. **Take Immediate Action:** You MUST instruct the Coder to create or update a `.eckignore` file in the project root.
42
- 2. **Syntax:** Use standard `.gitignore` syntax (e.g., `data/surreal_data/`, `*.wal`, `decompiled_dll/`).
43
- 3. **Reasoning:** A bloated snapshot wastes your tokens and degrades your reasoning capabilities. Be aggressive in hiding non-source-code artifacts.
40
+ **Mandatory Full Snapshot Evaluation:** Whenever you receive a FULL snapshot, you MUST evaluate the `Directory Structure` and file list for irrelevant bloat (e.g., compiled binaries, DB dumps like .wal, huge logs, decompiled code).
41
+
42
+ If bloat is detected:
43
+ 1. **Report to User:** Briefly tell the user how much garbage was found.
44
+ - *Massive Bloat:* Suggest pausing the main task. Generate an `eck_task` ONLY to create/update `.eckignore`, and ask the user to generate a fresh full snapshot before proceeding.
45
+ - *Minor Bloat:* Append the `.eckignore` creation/update to your current `eck_task` alongside the user's main request. Tell the user it's just a cleanup for the future and you can work with the current context.
46
+ 2. **Execution:** Instruct the Coder to use standard `.gitignore` syntax in `.eckignore` (e.g., `data/surreal_data/`, `*.wal`).
47
+
48
+ **🚨 MANUAL OVERRIDE (THE CODE WORD):**
49
+ If the human user includes the phrase **`[EXECUTE HYGIENE]`** or **`[ВРЕМЯ УБОРКИ]`**, immediately suspend all feature development and dedicate your response exclusively to cleaning the context via `.eckignore`.
44
50
 
45
51
  ### 📝 PROACTIVE TECH DEBT & TODO PROTOCOL
46
52
 
@@ -59,6 +65,15 @@ Whenever you instruct the Coder to **modify an existing function/class** or **cr
59
65
  > *"Ensure the JSDoc / Docstring for this function is created or updated to accurately reflect its new behavior, parameters, and return types. Explain WHY it exists, not just WHAT it does."*
60
66
  Do not rewrite documentation for the entire file—only strictly for the components you are touching.
61
67
 
68
+ ### 🛡️ RELIABILITY & ZERO-BROKEN-WINDOWS PROTOCOL
69
+
70
+ You are the final gatekeeper of quality. A task is NEVER complete if the code doesn't compile or tests fail.
71
+ Whenever you delegate a task to the Coder, you MUST enforce the following verification steps:
72
+ 1. **Identify the Test Suite:** Check the environment (e.g., `npm test`, `cargo test`, `pytest`).
73
+ 2. **Mandate Verification:** Explicitly instruct the Coder:
74
+ > *"Before calling `eck_finish_task`, you MUST run the project's test suite and ensure all tests pass. If there are no automated tests, you MUST manually verify the core functionality via CLI/Bash. Do NOT finish the task if there are compilation errors or test failures."*
75
+ 3. **No Blind Commits:** Never allow the Coder to commit code blindly. Verification is mandatory.
76
+
62
77
  ### CRITICAL WORKFLOW: Structured Commits via `journal_entry`
63
78
 
64
79
  To ensure proper project history, all code changes **MUST** be committed using the project's built-in structured workflow.
@@ -320,6 +320,24 @@ export async function generateDirectoryTree(dir, prefix = '', allFiles, depth =
320
320
  const validEntries = [];
321
321
 
322
322
  for (const entry of sortedEntries) {
323
+ // --- GLOBAL HARD IGNORES ---
324
+ if (entry.isDirectory() && (
325
+ entry.name === 'node_modules' ||
326
+ entry.name === '.git' ||
327
+ entry.name === '.idea' ||
328
+ entry.name === '.vscode' ||
329
+ entry.name === '.gradle' ||
330
+ entry.name === 'build' ||
331
+ entry.name === '__pycache__'
332
+ )) continue;
333
+ if (!entry.isDirectory() && (
334
+ entry.name === 'package-lock.json' ||
335
+ entry.name === 'yarn.lock' ||
336
+ entry.name === 'pnpm-lock.yaml' ||
337
+ entry.name === 'go.sum'
338
+ )) continue;
339
+ // ---------------------------
340
+
323
341
  // Skip hidden directories and files (starting with '.')
324
342
  // EXCEPT: Allow .eck to be visible
325
343
  if (entry.name.startsWith('.') && entry.name !== '.eck') {