runtime zaloha
This commit is contained in:
@@ -25,24 +25,26 @@ The line threshold is only a proactive trigger. When the user invokes the skill
|
||||
|
||||
1. Read `memory/MEMORY.md`, and — for duplicate detection — also `USER.md`, `SOUL.md`, and `keep.md` (all three in the workspace root).
|
||||
2. Count total lines (`wc -l memory/MEMORY.md`). If the skill was **not** invoked explicitly by the user, the file is ≤ 250 lines, and there is no obvious staleness, report "nothing to clean up" and stop. When invoked explicitly, always continue to the audit.
|
||||
3. Identify candidates:
|
||||
- **superseded** — replaced by newer facts or no longer relevant.
|
||||
- **detail** — concrete commands, flags, paths, or measurements that belong in a skill or `results/` file.
|
||||
3. **Audit the WHOLE file in a single pass.** Walk every `##` section and every `###` subsection in order, top to bottom, and evaluate every bullet. Do not stop after the first few findings — the proposal in step 5 must cover the entire file at once. Re-running the skill should find nothing left, not "the next batch".
|
||||
4. Identify candidates:
|
||||
- **superseded** — replaced by newer facts, completed work, or no longer relevant.
|
||||
- **detail** — concrete commands, flags, paths, measurements, or **code references** (e.g. `telegram.py:384`, script paths, DB paths) that belong in a skill, in code, or in a `results/` file.
|
||||
- **duplicate** — same fact already present in `USER.md`, `SOUL.md`, or `keep.md`.
|
||||
- **ephemeral** — one-off debugging, temporary state, or resolved incident details.
|
||||
4. Identify merge candidates within the same `###` subsection — related bullets that can be combined into one concise bullet.
|
||||
5. Present a numbered proposal in chat:
|
||||
- list each delete with reason and original text;
|
||||
- **ephemeral** — one-off debugging, temporary state, resolved incidents, or transient build/run progress (counts, task-failure notes, in-flight status).
|
||||
- **stale section** — an entire `##`/`###` section whose contents are all superseded or ephemeral (e.g. a finished project, a one-off task log, transient system state). Propose removing the whole block at once, not bullet by bullet.
|
||||
5. Identify merge candidates within the same `###` subsection — related bullets that can be combined into one concise bullet.
|
||||
6. Present a single numbered proposal in chat that covers the entire file:
|
||||
- list each delete with reason and original text (use `[stale section]` and cite the heading for whole-section removals);
|
||||
- list each merge with merged text.
|
||||
- Kept items are not listed.
|
||||
6. Wait for user approval. Accept commands like:
|
||||
7. Wait for user approval. Accept commands like:
|
||||
- `apply` / `ok` / `yes` — apply all proposed changes.
|
||||
- `keep 3, 7, 12` — keep listed items, apply the rest.
|
||||
- `delete 2, 5` — delete only listed items.
|
||||
- `cancel` — abort.
|
||||
7. Apply approved changes to `memory/MEMORY.md`.
|
||||
8. Append deleted items to `log/memory-clean.log` with timestamp `YYYY-MM-DD HH:MM` (create the file if it does not exist).
|
||||
9. Report summary.
|
||||
8. Apply approved changes to `memory/MEMORY.md`.
|
||||
9. Append deleted items to `log/memory-clean.log` with timestamp `YYYY-MM-DD HH:MM` (create the file if it does not exist).
|
||||
10. Report summary.
|
||||
|
||||
### Auto mode
|
||||
|
||||
@@ -60,8 +62,9 @@ Triggered by the user saying "memory-compact auto" or an equivalent with explici
|
||||
- Do not touch `SOUL.md`, `USER.md`, or `keep.md`.
|
||||
- In interactive mode do not create backups of `MEMORY.md`; rely on `log/memory-clean.log` for traceability. Auto mode always writes a full snapshot to `backup/` before deleting.
|
||||
- Merge only within the same `###` subsection (never across `##` sections or across different `###` subsections).
|
||||
- Preserve active project context, user preferences, and infrastructure facts.
|
||||
- When in doubt, keep it and mention the uncertainty in the report.
|
||||
- Preserve active project context, user preferences, and durable infrastructure facts.
|
||||
- Be exhaustive: propose every qualifying candidate in one pass, not a handful. The user prunes via `keep`/`delete`, so in interactive mode propose generously and flag borderline items rather than silently keeping them.
|
||||
- In **auto mode** only, when in doubt keep it (no user is there to prune); list the borderline items you kept in the report.
|
||||
|
||||
## Output format
|
||||
|
||||
@@ -73,6 +76,7 @@ Found X candidates to change in MEMORY.md:
|
||||
Delete:
|
||||
1. [superseded] <text>
|
||||
2. [detail] <text>
|
||||
3. [stale section] ## <heading> (N bullets) — <reason>
|
||||
...
|
||||
|
||||
Merge:
|
||||
|
||||
Reference in New Issue
Block a user