@xelth/eck-snapshot 6.4.0 → 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 +7 -0
- package/package.json +1 -1
- package/setup.json +5 -1
- package/src/templates/multiAgent.md +40 -0
- package/src/utils/fileUtils.js +34 -4
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.
|
|
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",
|
package/setup.json
CHANGED
|
@@ -34,6 +34,46 @@ The `.eck/` directory files are your "Source of Knowledge".
|
|
|
34
34
|
|
|
35
35
|
**Documentation is part of the "Definition of Done". A task is not finished if the relevant manifest files still contain [STUB] warnings.**
|
|
36
36
|
|
|
37
|
+
### 🧹 CONTEXT HYGIENE PROTOCOL (CRITICAL)
|
|
38
|
+
|
|
39
|
+
You are responsible for keeping your own context window clean and efficient.
|
|
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`.
|
|
50
|
+
|
|
51
|
+
### 📝 PROACTIVE TECH DEBT & TODO PROTOCOL
|
|
52
|
+
|
|
53
|
+
As a Senior Architect, you must actively manage code quality. When analyzing files in this snapshot, do not ignore developer comments:
|
|
54
|
+
1. **Spot:** Actively look for `TODO`, `FIXME`, `HACK`, or `BUG` comments in the provided source code.
|
|
55
|
+
2. **Evaluate:** Compare the comment against the actual implementation. Developers often fix things but forget to remove the comment.
|
|
56
|
+
3. **Resolve (The 3 Actions):**
|
|
57
|
+
- **Obsolete:** If the code already does what the TODO asks, instruct the Coder to **delete the comment**.
|
|
58
|
+
- **Quick Fix:** If it's a small missing piece or an obvious bug, instruct the Coder to **implement the fix and remove the comment**.
|
|
59
|
+
- **Real Debt:** If it requires significant architectural work, instruct the Coder to **document it in `.eck/TECH_DEBT.md`** so it is officially tracked, and leave the comment in the code for now.
|
|
60
|
+
|
|
61
|
+
### 🏕️ THE BOY SCOUT RULE (Docstrings & Comments)
|
|
62
|
+
|
|
63
|
+
Leave the codebase better than you found it.
|
|
64
|
+
Whenever you instruct the Coder to **modify an existing function/class** or **create a new one**, you MUST explicitly add this requirement to their task:
|
|
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."*
|
|
66
|
+
Do not rewrite documentation for the entire file—only strictly for the components you are touching.
|
|
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
|
+
|
|
37
77
|
### CRITICAL WORKFLOW: Structured Commits via `journal_entry`
|
|
38
78
|
|
|
39
79
|
To ensure proper project history, all code changes **MUST** be committed using the project's built-in structured workflow.
|
package/src/utils/fileUtils.js
CHANGED
|
@@ -205,7 +205,10 @@ export async function scanDirectoryRecursively(dirPath, config, relativeTo = dir
|
|
|
205
205
|
if (entry.name === 'node_modules' ||
|
|
206
206
|
entry.name === '.git' ||
|
|
207
207
|
entry.name === '.idea' ||
|
|
208
|
-
entry.name === '.vscode'
|
|
208
|
+
entry.name === '.vscode' ||
|
|
209
|
+
entry.name === '.gradle' ||
|
|
210
|
+
entry.name === 'build' ||
|
|
211
|
+
entry.name === '__pycache__') {
|
|
209
212
|
continue;
|
|
210
213
|
}
|
|
211
214
|
} else {
|
|
@@ -270,14 +273,23 @@ export async function scanDirectoryRecursively(dirPath, config, relativeTo = dir
|
|
|
270
273
|
}
|
|
271
274
|
|
|
272
275
|
export async function loadGitignore(repoPath) {
|
|
276
|
+
const ig = ignore();
|
|
277
|
+
|
|
273
278
|
try {
|
|
274
279
|
const gitignoreContent = await fs.readFile(path.join(repoPath, '.gitignore'), 'utf-8');
|
|
275
|
-
|
|
276
|
-
return ig;
|
|
280
|
+
ig.add(gitignoreContent);
|
|
277
281
|
} catch {
|
|
278
282
|
console.log('ℹ️ No .gitignore file found or could not be read');
|
|
279
|
-
return ignore();
|
|
280
283
|
}
|
|
284
|
+
|
|
285
|
+
try {
|
|
286
|
+
const eckignoreContent = await fs.readFile(path.join(repoPath, '.eckignore'), 'utf-8');
|
|
287
|
+
ig.add(eckignoreContent);
|
|
288
|
+
} catch {
|
|
289
|
+
// .eckignore is optional, silently skip if missing
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return ig;
|
|
281
293
|
}
|
|
282
294
|
|
|
283
295
|
export async function readFileWithSizeCheck(filePath, maxFileSize) {
|
|
@@ -308,6 +320,24 @@ export async function generateDirectoryTree(dir, prefix = '', allFiles, depth =
|
|
|
308
320
|
const validEntries = [];
|
|
309
321
|
|
|
310
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
|
+
|
|
311
341
|
// Skip hidden directories and files (starting with '.')
|
|
312
342
|
// EXCEPT: Allow .eck to be visible
|
|
313
343
|
if (entry.name.startsWith('.') && entry.name !== '.eck') {
|