| @@ -1,12 +1,13 @@ |
| 1 | # Managed by IssueSpec. Hand edits are welcome; keep the schema valid. | 1 | # Managed by IssueSpec. Hand edits are welcome; keep the schema valid. |
| 2 | id: 261 | 2 | id: 261 |
| 3 | title: "Dynamic system instructions: inject the relevant rules at each turn (study pk's directives)" | 3 | title: "Dynamic system instructions: inject the relevant rules at each turn (study pk's directives)" |
| 4 | -state: open | 4 | +state: closed |
| 5 | author: | 5 | author: |
| 6 | name: k33g | 6 | name: k33g |
| 7 | email: ph.charriere@gmail.com | 7 | email: ph.charriere@gmail.com |
| 8 | createdAt: 2026-11-25T05:15:39.000Z | 8 | createdAt: 2026-11-25T05:15:39.000Z |
| 9 | -updatedAt: 2026-11-25T05:15:39.000Z | 9 | +updatedAt: 2026-11-27T12:00:00.000Z |
| | 10 | +closedAt: 2026-11-27T12:00:00.000Z |
| 10 | labels: | 11 | labels: |
| 11 | - question | 12 | - question |
| 12 | - enhancement | 13 | - enhancement |
| @@ -77,34 +78,85 @@ body: | |
| 77 | tasks: | 78 | tasks: |
| 78 | - id: 1 | 79 | - id: 1 |
| 79 | title: Read pk's implementation (pkg/directives, internal/agent/directives.go) and its dynamic-golo demo | 80 | title: Read pk's implementation (pkg/directives, internal/agent/directives.go) and its dynamic-golo demo |
| 80 | - state: open | 81 | + state: closed |
| 81 | priority: high | 82 | priority: high |
| 82 | author: | 83 | author: |
| 83 | name: k33g | 84 | name: k33g |
| 84 | email: ph.charriere@gmail.com | 85 | email: ph.charriere@gmail.com |
| 85 | createdAt: 2026-11-25T05:15:39.000Z | 86 | createdAt: 2026-11-25T05:15:39.000Z |
| | 87 | + updatedAt: 2026-11-27T12:00:00.000Z |
| | 88 | + closedAt: 2026-11-27T12:00:00.000Z |
| 86 | - id: 2 | 89 | - id: 2 |
| 87 | title: Choose a selection method (BM25, embeddings, decider, keywords) and the injection point (system vs next to the question) | 90 | title: Choose a selection method (BM25, embeddings, decider, keywords) and the injection point (system vs next to the question) |
| 88 | - state: open | 91 | + state: closed |
| 89 | priority: high | 92 | priority: high |
| 90 | author: | 93 | author: |
| 91 | name: k33g | 94 | name: k33g |
| 92 | email: ph.charriere@gmail.com | 95 | email: ph.charriere@gmail.com |
| 93 | createdAt: 2026-11-25T05:15:39.000Z | 96 | createdAt: 2026-11-25T05:15:39.000Z |
| | 97 | + updatedAt: 2026-11-27T12:00:00.000Z |
| | 98 | + closedAt: 2026-11-27T12:00:00.000Z |
| 94 | - id: 3 | 99 | - id: 3 |
| 95 | title: Measure on a demo agent with many rules - static vs dynamic, prompt cache cost | 100 | title: Measure on a demo agent with many rules - static vs dynamic, prompt cache cost |
| 96 | - state: open | 101 | + state: closed |
| 97 | priority: medium | 102 | priority: medium |
| 98 | author: | 103 | author: |
| 99 | name: k33g | 104 | name: k33g |
| 100 | email: ph.charriere@gmail.com | 105 | email: ph.charriere@gmail.com |
| 101 | createdAt: 2026-11-25T05:15:39.000Z | 106 | createdAt: 2026-11-25T05:15:39.000Z |
| | 107 | + updatedAt: 2026-11-27T12:00:00.000Z |
| | 108 | + closedAt: 2026-11-27T12:00:00.000Z |
| 102 | - id: 4 | 109 | - id: 4 |
| 103 | title: Decide and write implementation tickets | 110 | title: Decide and write implementation tickets |
| 104 | - state: open | 111 | + state: closed |
| 105 | priority: medium | 112 | priority: medium |
| 106 | author: | 113 | author: |
| 107 | name: k33g | 114 | name: k33g |
| 108 | email: ph.charriere@gmail.com | 115 | email: ph.charriere@gmail.com |
| 109 | createdAt: 2026-11-25T05:15:39.000Z | 116 | createdAt: 2026-11-25T05:15:39.000Z |
| 110 | -comments: [] | 117 | + updatedAt: 2026-11-27T12:00:00.000Z |
| | 118 | + closedAt: 2026-11-27T12:00:00.000Z |
| | 119 | +comments: |
| | 120 | + - id: 1 |
| | 121 | + author: |
| | 122 | + name: k33g |
| | 123 | + email: ph.charriere@gmail.com |
| | 124 | + createdAt: 2026-11-27T12:00:00.000Z |
| | 125 | + body: | |
| | 126 | + Closed (user's decision, 2026-11-27): no new mechanism — what pk's |
| | 127 | + directives give is already reachable with what mm has, and in the |
| | 128 | + place the questions of this ticket pointed to (next to the question, |
| | 129 | + the system prompt left alone, so the server's prompt cache holds). |
| | 130 | + The tasks are void. |
| | 131 | + |
| | 132 | + ## How to get "dynamic rules" with mm today |
| | 133 | + - **One rule (or a theme of rules) = one skill.** `.mm/skills/<rule>/ |
| | 134 | + SKILL.md` with a `name`, a `description` and `keywords` (the front |
| | 135 | + matter pk's rules would need anyway); the model loads the one a |
| | 136 | + request needs with `read_skill`. Measured on 4B models this week: |
| | 137 | + demos/how-to-use-mini-me 25/25 right skills over 16, demos/ |
| | 138 | + memory-skills and memory-skills-2 8/8. Lesson from those demos: |
| | 139 | + keep an index skill for what no rule covers — otherwise the model |
| | 140 | + grabs the nearest one and invents (demos/how-to-use-mini-me). |
| | 141 | + - **Chosen before the turn, without the model:** `skillRouting` — a |
| | 142 | + decider picks the skill and appends the `$skill` line to the |
| | 143 | + question (`minConfidence`, `timeout`), i.e. pk's selection step, |
| | 144 | + with a decision model instead of embeddings. |
| | 145 | + - **Any selection you want (BM25, grep, keywords, embeddings):** a |
| | 146 | + `preGeneration` hook reads the question (`prompt` on stdin) and |
| | 147 | + answers `{"context": "…the rules that apply…"}`, appended to the |
| | 148 | + question — exactly the "injection next to the question" this |
| | 149 | + ticket wanted to measure; `displayHooks: true` shows each run (the |
| | 150 | + `/dyn-directives` of pk). No embedding model in mm itself. |
| | 151 | + - **The rules that always apply:** `turnReminder` (#230), next to |
| | 152 | + every question — measured 3/3 against 0/5 from the system prompt |
| | 153 | + (demos/lfm-coder). |
| | 154 | + - **The model searches the rules itself:** `docSearch` over a rules |
| | 155 | + folder (BM25, `search_docs`), `"@agent/rules"` to ship them with |
| | 156 | + the agent (#156). |
| | 157 | + - **The static part:** `system` with variables (#253) and AGENTS.md |
| | 158 | + (`agentsMd`, its `path` can point at any file — used for a memory |
| | 159 | + file in demos/memory-skills-2). |
| | 160 | + |
| | 161 | + If a measured case shows these are not enough (a long rule set where |
| | 162 | + skills and a hook both fail), reopen with that demo. |