Skip to content

Commit 8d747fa

Browse files
committed
Better agent text (Release v0.8.4)
1 parent e7b4d38 commit 8d747fa

13 files changed

Lines changed: 156 additions & 155 deletions

File tree

AGENTS.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
**Start of tinyMem Protocol**
2-
You operate under TinyMem governance.
2+
You operate under TinyMem governance. This protocol is MANDATORY.
33

4-
If a request would create files, change files, tasks, or memory:
5-
- use TinyMem MCP tools when available; otherwise use standard file tools
6-
- do not assume state
7-
- do not claim changes unless a tool call succeeds
4+
### 1. The Workflow
5+
1. **Observe:** Call `memory_query` or `memory_recent` before any mutation to avoid duplicates or conflict.
6+
2. **Sequence:** If a task has 2+ steps, externalize them to `tinyTasks.md` (use `task_add`).
7+
3. **Mutate:** Use standard tools to edit files. Never assume state.
8+
4. **Persist:** Call `memory_write` immediately after a successful mutation. **NEVER** claim a change until this tool succeeds.
89

9-
If a tool call is blocked or rejected, adapt and retry.
10-
Otherwise, respond normally.
10+
### 2. Guardrails
11+
- **Fail Closed:** If a tool fails or state is ambiguous, STOP and ask the user.
12+
- **Tool Authority:** Prefer MCP tools (`memory_*`) over CLI commands when available.
13+
- **Evidence:** Facts require evidence; decisions require rationale.
1114

12-
**TinyMem tool reference**
13-
- `tinymem health` — verify the database, schema, and connectivity before any mutation.
14-
- `tinymem doctor` — run a deeper diagnostic that reports configuration or health issues with storage, recall, or authorities.
15-
- `tinymem stats` — check current memory/task counts and pass/fail rates to decide whether to update or run additional tooling.
16-
- `tinymem dashboard` — view or refresh the visual task/memory status when you need awareness of progress or blockers.
17-
- `tinymem query "<term>"` — search the existing memory store for a term that might affect your next edit.
18-
- `tinymem recent` — fetch the latest entries so you can reference what tinyMem just learned.
19-
- `tinymem write --type <type>` — persist a decision, note, or claim once you have collated the facts.
20-
- `tinymem mcp` — start the stdio server that accepts the `memory_*` tool calls described below.
15+
### 3. Tool Reference (MCP)
16+
- `memory_query`: Search contextual memory. **Required** before mutations.
17+
- `memory_recent`: Fetch latest entries for immediate context.
18+
- `memory_write`: Persist facts/decisions. **Required** after mutations.
19+
- `task_add`: Add/Update `tinyTasks.md` entries. **Required** for multi-step work.
2120

22-
- `memory_query` — search contextual memory; required before mutations only in GUARDED/STRICT modes. In PASSIVE mode, mutations proceed without prior recall.
23-
- `memory_recent` — fetch the most recent memories if you need to reference immediately preceding work.
24-
- `memory_write` — persist a fact/decision/note; never claim a repository change without this tool concluding successfully.
25-
- `task_add` — create tinyTasks.md if missing and append a task in one call; use this instead of creating the file manually.
21+
### 4. Tool Reference (CLI)
22+
- `tinymem health/doctor`: Verify DB/Config before starting work.
23+
- `tinymem stats/dashboard`: Check progress and health metrics.
24+
- `tinymem write/query/recent`: CLI equivalents of MCP tools.
2625

27-
**End of tinyMem Protocol**
26+
**End of tinyMem Protocol**

CRUSH.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
You operate under TinyMem governance.
33

44
If a request would change files, tasks, or memory:
5-
- use TinyMem MCP tools
5+
- use TinyMem MCP tools when available; otherwise use standard file tools
66
- do not assume state
77
- do not claim changes unless a tool call succeeds
88

9-
Tool calls are the only way to affect reality.
109
If a tool call is blocked or rejected, adapt and retry.
1110
Otherwise, respond normally.
1211
**End of tinyMem Protocol**

GEMINI.md

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -130,25 +130,18 @@ If **Task Identification** occurs:
130130

131131
If `tinyTasks.md` does NOT exist:
132132

133-
* Create the inert template
134-
* Populate it with a proposed task list
135-
* STOP
136-
* Request the human to review, edit, reorder, or approve the proposed tasks
137-
138-
Creation or population of `tinyTasks.md` does NOT authorize work.
133+
* Create it and populate it with a proposed task list via `task_add` (or standard file tools if MCP is unavailable)
134+
* Optionally ask the user to verify the proposed tasks before proceeding
135+
* If the user requests verification, wait for review
136+
* If the user declines or does not respond, proceed immediately
139137

140138
Planning in the response body is prohibited once this rule triggers.
141139

142140
#### Task Proposal Allowance
143141

144-
The agent MAY populate `tinyTasks.md` with a proposed task list.
145-
146-
Proposed tasks are NOT authorized until a human:
147-
- confirms them explicitly, or
148-
- edits or reorders them, or
149-
- states approval in plain language
150-
151-
The agent MUST stop after proposing tasks and wait for human authorization.
142+
The agent MAY populate `tinyTasks.md` with a proposed task list and ask the
143+
user to verify before proceeding. Verification is optional — the agent must
144+
not block waiting for a response that may not come.
152145

153146
---
154147

@@ -201,16 +194,17 @@ Never guess. Never proceed optimistically.
201194

202195
## 6. tinyTasks.md Templates
203196

204-
### Inert Auto-Creation Template
197+
### Auto-Creation Template
198+
199+
The agent creates and populates this file in one step. If verification was
200+
requested, the file appears with proposed tasks and the agent waits. Otherwise
201+
the agent proceeds immediately.
205202

206203
```md
207-
# Tasks — PROPOSED
208-
>
209-
> These tasks were proposed by the agent.
210-
> No work is authorised until a human reviews and confirms them.
211-
>
212-
## Tasks
213-
<!-- No tasks defined yet -->
204+
# Tasks — <Goal>
205+
206+
- [ ] First task
207+
- [ ] Second task
214208
```
215209

216210
### Active Task Structure

QWEN.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
You operate under TinyMem governance.
33

44
If a request would change files, tasks, or memory:
5-
- use TinyMem MCP tools
5+
- use TinyMem MCP tools when available; otherwise use standard file tools
66
- do not assume state
77
- do not claim changes unless a tool call succeeds
88

9-
Tool calls are the only way to affect reality.
109
If a tool call is blocked or rejected, adapt and retry.
1110
Otherwise, respond normally.
1211
**End of tinyMem Protocol**

docs/MCP_RESOURCES.md

Lines changed: 47 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,60 @@
1-
# Ensuring `list_mcp_resources` finds tinyMem
1+
# Exposing tinyMem MCP tools to Codex
22

3-
The `list_mcp_resources` lookup that the Codex agent runs before mutating a repository pulls from the shared automation registry (`$CODEX_HOME/automations/*`). In this workspace we only ship the tinyMem code itself, so the registry is empty and the agent cannot find the MCP tool that knows how to validate mutations.
3+
Codex discovers MCP servers from config files — there is no separate automation
4+
registry or resource-listing step. Two scopes are supported:
45

5-
To keep agents honest when they act in this repo, add a tinyMem automation definition that registers the `tinymem mcp` server (and any helper commands) so `list_mcp_resources` returns a non-empty list.
6+
| File | Scope |
7+
|---|---|
8+
| `~/.codex/config.toml` | global (all projects) |
9+
| `.codex/config.toml` | project-scoped (can be checked into the repo) |
610

7-
## How to register tinyMem in the automation registry
11+
## Adding tinymem to the config
812

9-
1. Locate your Codex automation directory. By default it’s `$CODEX_HOME/automations/`; if that directory does not exist yet, create it.
10-
2. Inside `automations/`, add a folder for this repo (for example, `tinymem`). Place a `automation.toml` file there.
11-
3. Populate `automation.toml` with metadata that exposes the MCP entry point. A minimal example:
13+
Add the following block to whichever config file applies:
1214

13-
```toml
14-
title = "tinyMem MCP"
15-
description = "Exposes the tinyMem MCP server and diagnostics helpers for repository work."
15+
```toml
16+
[mcp_servers.tinymem]
17+
command = "tinymem"
18+
args = ["mcp"]
19+
enabled = true
20+
startup_timeout_sec = 15
21+
```
1622

17-
[server]
18-
command = "tinymem"
19-
args = ["mcp"]
20-
timeout = 60000
21-
trust = false
23+
That is the complete entry. Codex starts the server on session launch and
24+
exposes every tool the server advertises (`memory_query`, `memory_recent`,
25+
`memory_write`, `task_add`, `artifact_create`, etc.) alongside its built-in
26+
tools.
2227

23-
[[tools]]
24-
name = "tinyMem health"
25-
description = "Verify the database before editing."
26-
command = "tinymem"
27-
args = ["health"]
28-
timeout = 15000
28+
## Project-scoped setup (recommended for this repo)
2929

30-
[[tools]]
31-
name = "tinyMem doctor"
32-
description = "Run the doctor diagnostic from MCP context."
33-
command = "tinymem"
34-
args = ["doctor"]
35-
timeout = 30000
36-
```
30+
Check a `.codex/config.toml` into the repo root with the block above. Any
31+
Codex session opened inside the repo will pick it up automatically — no
32+
per-machine global config needed.
3733

38-
Adjust the snippet as needed for your environment; the registry that backs `list_mcp_resources` may support additional fields such as `env`, `cwd`, or `trust`.
34+
## CLI alternative
3935

40-
4. After the automation file is saved, restart the Codex agent (if necessary) so it notices the new resource. Running `list_mcp_resources` again should now show your tinyMem MCP server and any helper tools.
36+
If you prefer not to hand-edit the file:
4137

42-
## Why this matters
38+
```bash
39+
codex mcp add tinymem -- tinymem mcp
40+
```
4341

44-
- The root `docs/agents/AGENTS.md` contract mandates that repository mutations happen via the MCP tools; registering `tinymem` here keeps codex obeying that contract.
45-
- Once `list_mcp_resources` returns our entry, we can use the MCP server to call `memory_query`, `memory_recent`, `memory_write`, etc., without manually editing `tinyTasks.md`.
46-
- The automation can bundle other useful wrappers (`health`, `doctor`, `query`) so agents have quick diagnostics at hand before mutating files.
42+
This appends the equivalent entry to `~/.codex/config.toml`.
4743

48-
If you need a hand generating the TOML for your automation tool, look for other Codex automation directories on this machine (e.g., `~/.codex/automations/`) for examples, or copy the snippet above and adjust the tool metadata to match.
44+
## Filtering tools (optional)
45+
46+
If you only want a subset of the tools exposed, use `enabled_tools`:
47+
48+
```toml
49+
[mcp_servers.tinymem]
50+
command = "tinymem"
51+
args = ["mcp"]
52+
enabled = true
53+
enabled_tools = ["memory_query", "memory_recent", "memory_write", "task_add"]
54+
```
55+
56+
## Why the tools weren't showing up
57+
58+
The server was already running, but no config entry existed — Codex had no
59+
way to know about it. Once the config block above is in place, the tools
60+
appear in the next session without any restart.

docs/agents/AGENTS.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
**Start of tinyMem Protocol**
2-
You operate under TinyMem governance.
2+
You operate under TinyMem governance. This protocol is MANDATORY.
33

4-
If a request would create files, change files, tasks, or memory:
5-
- use TinyMem MCP tools when available; otherwise use standard file tools
6-
- do not assume state
7-
- do not claim changes unless a tool call succeeds
4+
### 1. The Workflow
5+
1. **Observe:** Call `memory_query` or `memory_recent` before any mutation to avoid duplicates or conflict.
6+
2. **Sequence:** If a task has 2+ steps, externalize them to `tinyTasks.md` (use `task_add`).
7+
3. **Mutate:** Use standard tools to edit files. Never assume state.
8+
4. **Persist:** Call `memory_write` immediately after a successful mutation. **NEVER** claim a change until this tool succeeds.
89

9-
If a tool call is blocked or rejected, adapt and retry.
10-
Otherwise, respond normally.
10+
### 2. Guardrails
11+
- **Fail Closed:** If a tool fails or state is ambiguous, STOP and ask the user.
12+
- **Tool Authority:** Prefer MCP tools (`memory_*`) over CLI commands when available.
13+
- **Evidence:** Facts require evidence; decisions require rationale.
1114

12-
**TinyMem tool reference**
13-
- `tinymem health` — verify the database, schema, and connectivity before any mutation.
14-
- `tinymem doctor` — run a deeper diagnostic that reports configuration or health issues with storage, recall, or authorities.
15-
- `tinymem stats` — check current memory/task counts and pass/fail rates to decide whether to update or run additional tooling.
16-
- `tinymem dashboard` — view or refresh the visual task/memory status when you need awareness of progress or blockers.
17-
- `tinymem query "<term>"` — search the existing memory store for a term that might affect your next edit.
18-
- `tinymem recent` — fetch the latest entries so you can reference what tinyMem just learned.
19-
- `tinymem write --type <type>` — persist a decision, note, or claim once you have collated the facts.
20-
- `tinymem mcp` — start the stdio server that accepts the `memory_*` tool calls described below.
15+
### 3. Tool Reference (MCP)
16+
- `memory_query`: Search contextual memory. **Required** before mutations.
17+
- `memory_recent`: Fetch latest entries for immediate context.
18+
- `memory_write`: Persist facts/decisions. **Required** after mutations.
19+
- `task_add`: Add/Update `tinyTasks.md` entries. **Required** for multi-step work.
2120

22-
- `memory_query` — search contextual memory; required before mutations only in GUARDED/STRICT modes. In PASSIVE mode, mutations proceed without prior recall.
23-
- `memory_recent` — fetch the most recent memories if you need to reference immediately preceding work.
24-
- `memory_write` — persist a fact/decision/note; never claim a repository change without this tool concluding successfully.
25-
- `task_add` — create tinyTasks.md if missing and append a task in one call; use this instead of creating the file manually.
21+
### 4. Tool Reference (CLI)
22+
- `tinymem health/doctor`: Verify DB/Config before starting work.
23+
- `tinymem stats/dashboard`: Check progress and health metrics.
24+
- `tinymem write/query/recent`: CLI equivalents of MCP tools.
2625

27-
**End of tinyMem Protocol**
26+
**End of tinyMem Protocol**

docs/agents/AGENT_CONTRACT.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
**Start of tinyMem Protocol**
2-
You operate under TinyMem governance.
2+
You operate under TinyMem governance. This protocol is MANDATORY.
33

4-
If a request would create files, change files, tasks, or memory:
5-
- use TinyMem MCP tools when available; otherwise use standard file tools
6-
- do not assume state
7-
- do not claim changes unless a tool call succeeds
4+
### 1. The Workflow
5+
1. **Observe:** Call `memory_query` or `memory_recent` before any mutation to avoid duplicates or conflict.
6+
2. **Sequence:** If a task has 2+ steps, externalize them to `tinyTasks.md` (use `task_add`).
7+
3. **Mutate:** Use standard tools to edit files. Never assume state.
8+
4. **Persist:** Call `memory_write` immediately after a successful mutation. **NEVER** claim a change until this tool succeeds.
89

9-
If a tool call is blocked or rejected, adapt and retry.
10-
Otherwise, respond normally.
10+
### 2. Guardrails
11+
- **Fail Closed:** If a tool fails or state is ambiguous, STOP and ask the user.
12+
- **Tool Authority:** Prefer MCP tools (`memory_*`) over CLI commands when available.
13+
- **Evidence:** Facts require evidence; decisions require rationale.
1114

12-
**TinyMem tool reference**
13-
- `tinymem health` — verify the database, schema, and connectivity before any mutation.
14-
- `tinymem doctor` — run a deeper diagnostic that reports configuration or health issues with storage, recall, or authorities.
15-
- `tinymem stats` — check current memory/task counts and pass/fail rates to decide whether to update or run additional tooling.
16-
- `tinymem dashboard` — view or refresh the visual task/memory status when you need awareness of progress or blockers.
17-
- `tinymem query "<term>"` — search the existing memory store for a term that might affect your next edit.
18-
- `tinymem recent` — fetch the latest entries so you can reference what tinyMem just learned.
19-
- `tinymem write --type <type>` — persist a decision, note, or claim once you have collated the facts.
20-
- `tinymem mcp` — start the stdio server that accepts the `memory_*` tool calls described below.
15+
### 3. Tool Reference (MCP)
16+
- `memory_query`: Search contextual memory. **Required** before mutations.
17+
- `memory_recent`: Fetch latest entries for immediate context.
18+
- `memory_write`: Persist facts/decisions. **Required** after mutations.
19+
- `task_add`: Add/Update `tinyTasks.md` entries. **Required** for multi-step work.
2120

22-
- `memory_query` — search contextual memory; required before mutations only in GUARDED/STRICT modes. In PASSIVE mode, mutations proceed without prior recall.
23-
- `memory_recent` — fetch the most recent memories if you need to reference immediately preceding work.
24-
- `memory_write` — persist a fact/decision/note; never claim a repository change without this tool concluding successfully.
25-
- `task_add` — create tinyTasks.md if missing and append a task in one call; use this instead of creating the file manually.
21+
### 4. Tool Reference (CLI)
22+
- `tinymem health/doctor`: Verify DB/Config before starting work.
23+
- `tinymem stats/dashboard`: Check progress and health metrics.
24+
- `tinymem write/query/recent`: CLI equivalents of MCP tools.
2625

27-
**End of tinyMem Protocol**
26+
**End of tinyMem Protocol**
Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
**Start of tinyMem Protocol**
2-
You operate under TinyMem governance.
2+
You operate under TinyMem governance. This protocol is MANDATORY.
33

4-
If a request would create files, change files, tasks, or memory:
5-
- use TinyMem MCP tools when available; otherwise use standard file tools
6-
- do not assume state
7-
- do not claim changes unless a tool call succeeds
4+
### 1. The Workflow
5+
1. **Observe:** Call `memory_query` or `memory_recent` before any mutation to avoid duplicates or conflict.
6+
2. **Sequence:** If a task has 2+ steps, externalize them to `tinyTasks.md` (use `task_add`).
7+
3. **Mutate:** Use standard tools to edit files. Never assume state.
8+
4. **Persist:** Call `memory_write` immediately after a successful mutation. **NEVER** claim a change until this tool succeeds.
89

9-
If a tool call is blocked or rejected, adapt and retry.
10-
Otherwise, respond normally.
10+
### 2. Guardrails
11+
- **Fail Closed:** If a tool fails or state is ambiguous, STOP and ask the user.
12+
- **Tool Authority:** Prefer MCP tools (`memory_*`) over CLI commands when available.
13+
- **Evidence:** Facts require evidence; decisions require rationale.
1114

12-
**TinyMem tool reference**
13-
- `tinymem health` — verify the database, schema, and connectivity before any mutation.
14-
- `tinymem doctor` — run a deeper diagnostic that reports configuration or health issues with storage, recall, or authorities.
15-
- `tinymem stats` — check current memory/task counts and pass/fail rates to decide whether to update or run additional tooling.
16-
- `tinymem dashboard` — view or refresh the visual task/memory status when you need awareness of progress or blockers.
17-
- `tinymem query "<term>"` — search the existing memory store for a term that might affect your next edit.
18-
- `tinymem recent` — fetch the latest entries so you can reference what tinyMem just learned.
19-
- `tinymem write --type <type>` — persist a decision, note, or claim once you have collated the facts.
20-
- `tinymem mcp` — start the stdio server that accepts the `memory_*` tool calls described below.
15+
### 3. Tool Reference (MCP)
16+
- `memory_query`: Search contextual memory. **Required** before mutations.
17+
- `memory_recent`: Fetch latest entries for immediate context.
18+
- `memory_write`: Persist facts/decisions. **Required** after mutations.
19+
- `task_add`: Add/Update `tinyTasks.md` entries. **Required** for multi-step work.
2120

22-
- `memory_query` — search contextual memory; required before mutations only in GUARDED/STRICT modes. In PASSIVE mode, mutations proceed without prior recall.
23-
- `memory_recent` — fetch the most recent memories if you need to reference immediately preceding work.
24-
- `memory_write` — persist a fact/decision/note; never claim a repository change without this tool concluding successfully.
25-
- `task_add` — create tinyTasks.md if missing and append a task in one call; use this instead of creating the file manually.
21+
### 4. Tool Reference (CLI)
22+
- `tinymem health/doctor`: Verify DB/Config before starting work.
23+
- `tinymem stats/dashboard`: Check progress and health metrics.
24+
- `tinymem write/query/recent`: CLI equivalents of MCP tools.
2625

27-
**End of tinyMem Protocol**
26+
**End of tinyMem Protocol**

0 commit comments

Comments
 (0)