runtime zaloha

This commit is contained in:
lachtan
2026-06-25 05:22:57 +02:00
parent 177ea3dfbd
commit 11190b4931
4 changed files with 192 additions and 67 deletions

View File

@@ -25,6 +25,8 @@ Jsem [nanobot](https://github.com/HKUDS/nanobot) — lehký osobní asistent. Ml
- Chybějící info dohledej tooly. Uživatele se ptej, jen když to tooly nezvládnou - Chybějící info dohledej tooly. Uživatele se ptej, jen když to tooly nezvládnou
- Po vícekrokových změnách ověř výsledek (re-read, test, kontrola výstupu) - Po vícekrokových změnách ověř výsledek (re-read, test, kontrola výstupu)
- Když existuje víc cest, vynes tradeoff nahlas místo tichého výběru jedné - Když existuje víc cest, vynes tradeoff nahlas místo tichého výběru jedné
- Víc otázek pokládej **postupně, jednu po druhé** — u každé musí být prostor odpovědět
- Pravidla do `USER.md`/`SOUL.md`/`AGENTS.md` apod. piš **stručně a jasně** — krátké imperativní bullety, klíčové slovo tučně, bez vaty
## Faktografická pravidla ## Faktografická pravidla
- Když nevím / nejsem si jistý, **řeknu to nahlas**. Netipuji, nevymýšlím, neimprovizuji fakta jen aby odpověď zněla úplně. - Když nevím / nejsem si jistý, **řeknu to nahlas**. Netipuji, nevymýšlím, neimprovizuji fakta jen aby odpověď zněla úplně.

View File

@@ -70,8 +70,8 @@
"originMetadata": {} "originMetadata": {}
}, },
"state": { "state": {
"nextRunAtMs": 1782317405444, "nextRunAtMs": 1782360633599,
"lastRunAtMs": 1782310204160, "lastRunAtMs": 1782353432294,
"lastStatus": "ok", "lastStatus": "ok",
"lastError": null, "lastError": null,
"runHistory": [ "runHistory": [
@@ -98,11 +98,47 @@
"status": "ok", "status": "ok",
"durationMs": 1284, "durationMs": 1284,
"error": null "error": null
},
{
"runAtMs": 1782317405445,
"status": "ok",
"durationMs": 21520,
"error": null
},
{
"runAtMs": 1782324626966,
"status": "ok",
"durationMs": 1320,
"error": null
},
{
"runAtMs": 1782331828288,
"status": "ok",
"durationMs": 1321,
"error": null
},
{
"runAtMs": 1782339029610,
"status": "ok",
"durationMs": 1331,
"error": null
},
{
"runAtMs": 1782346230943,
"status": "ok",
"durationMs": 1348,
"error": null
},
{
"runAtMs": 1782353432294,
"status": "ok",
"durationMs": 1305,
"error": null
} }
] ]
}, },
"createdAtMs": 1782281400007, "createdAtMs": 1782281400007,
"updatedAtMs": 1782310205444, "updatedAtMs": 1782353433599,
"deleteAfterRun": false "deleteAfterRun": false
}, },
{ {
@@ -129,123 +165,188 @@
"originMetadata": {} "originMetadata": {}
}, },
"state": { "state": {
"nextRunAtMs": 1782315605451, "nextRunAtMs": 1782358833607,
"lastRunAtMs": 1782313805451, "lastRunAtMs": 1782357033606,
"lastStatus": "ok", "lastStatus": "ok",
"lastError": null, "lastError": null,
"runHistory": [ "runHistory": [
{ {
"runAtMs": 1782283200017, "runAtMs": 1782322826973,
"status": "ok",
"durationMs": 0,
"error": null
},
{
"runAtMs": 1782324628288,
"status": "ok",
"durationMs": 0,
"error": null
},
{
"runAtMs": 1782326428289,
"status": "ok", "status": "ok",
"durationMs": 1, "durationMs": 1,
"error": null "error": null
}, },
{ {
"runAtMs": 1782285000019, "runAtMs": 1782328228292,
"status": "ok",
"durationMs": 0,
"error": null
},
{
"runAtMs": 1782286800020,
"status": "ok", "status": "ok",
"durationMs": 1, "durationMs": 1,
"error": null "error": null
}, },
{ {
"runAtMs": 1782288601407, "runAtMs": 1782330028295,
"status": "ok", "status": "ok",
"durationMs": 0, "durationMs": 0,
"error": null "error": null
}, },
{ {
"runAtMs": 1782290401408, "runAtMs": 1782331829614,
"status": "ok",
"durationMs": 0,
"error": null
},
{
"runAtMs": 1782333629615,
"status": "ok", "status": "ok",
"durationMs": 1, "durationMs": 1,
"error": null "error": null
}, },
{ {
"runAtMs": 1782292201411, "runAtMs": 1782335429618,
"status": "ok", "status": "ok",
"durationMs": 0, "durationMs": 0,
"error": null "error": null
}, },
{ {
"runAtMs": 1782294001413, "runAtMs": 1782337229620,
"status": "ok", "status": "ok",
"durationMs": 0, "durationMs": 0,
"error": null "error": null
}, },
{ {
"runAtMs": 1782295802844, "runAtMs": 1782339030946,
"status": "ok", "status": "ok",
"durationMs": 0, "durationMs": 0,
"error": null "error": null
}, },
{ {
"runAtMs": 1782297602845, "runAtMs": 1782340830948,
"status": "ok",
"durationMs": 0,
"error": null
},
{
"runAtMs": 1782299402847,
"status": "ok",
"durationMs": 0,
"error": null
},
{
"runAtMs": 1782301202848,
"status": "ok",
"durationMs": 0,
"error": null
},
{
"runAtMs": 1782303004162,
"status": "ok",
"durationMs": 0,
"error": null
},
{
"runAtMs": 1782304804163,
"status": "ok",
"durationMs": 0,
"error": null
},
{
"runAtMs": 1782306604164,
"status": "ok", "status": "ok",
"durationMs": 1, "durationMs": 1,
"error": null "error": null
}, },
{ {
"runAtMs": 1782308404166, "runAtMs": 1782342630951,
"status": "ok", "status": "ok",
"durationMs": 0, "durationMs": 0,
"error": null "error": null
}, },
{ {
"runAtMs": 1782310205445, "runAtMs": 1782344430952,
"status": "ok", "status": "ok",
"durationMs": 1, "durationMs": 1,
"error": null "error": null
}, },
{ {
"runAtMs": 1782312005448, "runAtMs": 1782346232294,
"status": "ok", "status": "ok",
"durationMs": 0, "durationMs": 0,
"error": null "error": null
}, },
{ {
"runAtMs": 1782313805451, "runAtMs": 1782348032296,
"status": "ok", "status": "ok",
"durationMs": 0, "durationMs": 0,
"error": null "error": null
},
{
"runAtMs": 1782349832297,
"status": "ok",
"durationMs": 1,
"error": null
},
{
"runAtMs": 1782351632300,
"status": "ok",
"durationMs": 0,
"error": null
},
{
"runAtMs": 1782353433603,
"status": "ok",
"durationMs": 0,
"error": null
},
{
"runAtMs": 1782355233605,
"status": "ok",
"durationMs": 0,
"error": null
},
{
"runAtMs": 1782357033606,
"status": "ok",
"durationMs": 1,
"error": null
} }
] ]
}, },
"createdAtMs": 1782281400014, "createdAtMs": 1782281400014,
"updatedAtMs": 1782313805451, "updatedAtMs": 1782357033607,
"deleteAfterRun": false
},
{
"id": "439f7f4d",
"name": "compact-memory-auto-daily",
"enabled": true,
"schedule": {
"kind": "cron",
"atMs": null,
"everyMs": null,
"expr": "0 2 * * *",
"tz": "Europe/Prague"
},
"payload": {
"kind": "agent_turn",
"message": "Run /compact-memory auto skill to clean up memory/MEMORY.md",
"deliver": true,
"channel": "telegram",
"to": "8826147089",
"channelMeta": {},
"sessionKey": "websocket:89051535-7544-4a44-90db-5c2630f52c6d",
"originChannel": "websocket",
"originChatId": "89051535-7544-4a44-90db-5c2630f52c6d",
"originMetadata": {
"remote": [
"192.168.40.104",
51922
],
"webui": true,
"webui_turn_id": "9a9a78bd-a85b-4420-a9be-60b74a75bd1a",
"workspace_scope": {
"project_path": "/home/nanobot/.nanobot/workspace",
"access_mode": "restricted"
},
"_wants_stream": true
}
},
"state": {
"nextRunAtMs": 1782432000000,
"lastRunAtMs": 1782345600003,
"lastStatus": "ok",
"lastError": null,
"runHistory": [
{
"runAtMs": 1782345600003,
"status": "ok",
"durationMs": 77839,
"error": null
}
]
},
"createdAtMs": 1782319267399,
"updatedAtMs": 1782345677842,
"deleteAfterRun": false "deleteAfterRun": false
} }
] ]

View File

@@ -0,0 +1,18 @@
{
"job_id": "439f7f4d",
"job_name": "compact-memory-auto-daily",
"session_key": "websocket:89051535-7544-4a44-90db-5c2630f52c6d",
"prompt_ref": {
"id": "cron.agent_turn.reminder",
"version": 1,
"sha256": "c9210a44f126470f0f01e39d90098351037c821206ba2e98347ff1676fd77b55"
},
"prompt_vars": {
"message": "Run /compact-memory auto skill to clean up memory/MEMORY.md"
},
"rendered_prompt": "The scheduled time has arrived. Execute this scheduled cron job now and report the result to the user in the same session.\n\nRules:\n- Speak directly to the user in their language.\n- Do not narrate internal progress.\n- Do not include user IDs.\n- Do not add status reports like \"Done\" or \"Reminded\" unless they are the natural response.\n\nCron job: Run /compact-memory auto skill to clean up memory/MEMORY.md",
"status": "ok",
"response": "Auto kompaktování MEMORY.md: žádné změny nebyly potřeba, soubor je už čistý (66 řádků). Záloha do `backup/` se vytvořila před kontrolou.",
"run_id": "439f7f4d:1782345600010:62e0ad11",
"updated_at_ms": 1782345677840
}

View File

@@ -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). 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. 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: 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".
- **superseded** — replaced by newer facts or no longer relevant. 4. Identify candidates:
- **detail** — concrete commands, flags, paths, or measurements that belong in a skill or `results/` file. - **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`. - **duplicate** — same fact already present in `USER.md`, `SOUL.md`, or `keep.md`.
- **ephemeral** — one-off debugging, temporary state, or resolved incident details. - **ephemeral** — one-off debugging, temporary state, resolved incidents, or transient build/run progress (counts, task-failure notes, in-flight status).
4. Identify merge candidates within the same `###` subsection — related bullets that can be combined into one concise bullet. - **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. Present a numbered proposal in chat: 5. Identify merge candidates within the same `###` subsection — related bullets that can be combined into one concise bullet.
- list each delete with reason and original text; 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. - list each merge with merged text.
- Kept items are not listed. - 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. - `apply` / `ok` / `yes` — apply all proposed changes.
- `keep 3, 7, 12` — keep listed items, apply the rest. - `keep 3, 7, 12` — keep listed items, apply the rest.
- `delete 2, 5` — delete only listed items. - `delete 2, 5` — delete only listed items.
- `cancel` — abort. - `cancel` — abort.
7. Apply approved changes to `memory/MEMORY.md`. 8. 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. 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. 10. Report summary.
### Auto mode ### 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`. - 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. - 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). - Merge only within the same `###` subsection (never across `##` sections or across different `###` subsections).
- Preserve active project context, user preferences, and infrastructure facts. - Preserve active project context, user preferences, and durable infrastructure facts.
- When in doubt, keep it and mention the uncertainty in the report. - 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 ## Output format
@@ -73,6 +76,7 @@ Found X candidates to change in MEMORY.md:
Delete: Delete:
1. [superseded] <text> 1. [superseded] <text>
2. [detail] <text> 2. [detail] <text>
3. [stale section] ## <heading> (N bullets) — <reason>
... ...
Merge: Merge: