Skip to content

Commit 00ab398

Browse files
committed
New contracts
1 parent 2580108 commit 00ab398

6 files changed

Lines changed: 252 additions & 18 deletions

File tree

‎AGENTS.md‎

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ Task state must never be inferred.
4141

4242
The following require no mode declaration:
4343
* Query memory (`memory_query`, `memory_recent`)
44-
* Read health/diagnostics (`memory_health`, `memory_doctor`, `memory_stats`)
44+
* Check task authority (`memory_check_task_authority`)
45+
* Read health/diagnostics (`memory_health`, `memory_doctor`, `memory_stats`, `memory_run_metadata`)
4546
* Read files
4647
* Analyze code
4748
* Provide guidance
4849
* Ask questions
4950

5051
Memory recall is **strongly recommended** for all repository-related conversations, and **mandatory** before any durable mutation.
5152

53+
**NOTE:** In GUARDED and STRICT modes, memory recall is **enforced** — `memory_write` will fail if `memory_query` or `memory_recent` was not called first. In PASSIVE mode, violations are logged but not blocked.
54+
5255
---
5356

5457
## 3. Mutation (Requires Explicit Intent)
@@ -63,9 +66,11 @@ Before performing any durable mutation, you MUST:
6366
- The system will enforce the appropriate clearance for the requested mutation
6467

6568
3. **Check task authority** by reading `tinyTasks.md` (or confirming it doesn't exist)
69+
- **Recommended:** Use `memory_check_task_authority` to get explicit authorization status
70+
- Alternative: Read `tinyTasks.md` directly via file system tools
6671
- If unchecked tasks exist, resume from the first unchecked subtask
6772
- If tasks exist but none are unchecked, refuse execution and request user input
68-
- If file doesn't exist, you may create it for multi-step work
73+
- If file doesn't exist, you may create it for multi-step work (or the system may auto-create it)
6974

7075
---
7176

@@ -181,7 +186,41 @@ When performing multi-step work, validate:
181186

182187
---
183188

184-
## 9. Summary
189+
## 9. Enforcement & Tracking
190+
191+
### MCP Boundary Enforcement
192+
193+
The following contract requirements are **enforced at the MCP boundary** (not just recommended):
194+
195+
**Recall Before Mutation (GUARDED/STRICT):**
196+
- `memory_write` will **fail** if `memory_query` or `memory_recent` was not called first
197+
- Error returned: "Memory recall required: Call memory_query or memory_recent before memory_write"
198+
- In PASSIVE mode: Logged as violation but not blocked
199+
200+
**Violation Tracking:**
201+
- All contract violations are tracked in `memory_run_metadata`
202+
- Fields: `violations_count`, `blocked_actions_count`, `enforcement_events[]`
203+
- Violations include: recall not performed, unauthorized task execution attempts
204+
- Use this data to audit agent compliance and identify enforcement gaps
205+
206+
### Helper Tools
207+
208+
**memory_check_task_authority()**
209+
- Returns task file status: `{exists, unchecked_tasks, authorization, task_count, next_task}`
210+
- Authorization values:
211+
- `"create_allowed"` - file absent, agent may create
212+
- `"authorized"` - unchecked tasks present, agent may proceed
213+
- `"unauthorized"` - no unchecked tasks, agent must request user input
214+
- Use this instead of manually parsing `tinyTasks.md` for clearer contract compliance
215+
216+
**memory_run_metadata()**
217+
- Returns enforcement metadata for the current session
218+
- Includes: execution mode, enforcement events, violation counts, success counts
219+
- Use to verify your own contract compliance during execution
220+
221+
---
222+
223+
## 10. Summary
185224

186225
**Simple rules:**
187226

‎CLAUDE.md‎

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ Task state must never be inferred.
4141

4242
The following require no mode declaration:
4343
* Query memory (`memory_query`, `memory_recent`)
44-
* Read health/diagnostics (`memory_health`, `memory_doctor`, `memory_stats`)
44+
* Check task authority (`memory_check_task_authority`)
45+
* Read health/diagnostics (`memory_health`, `memory_doctor`, `memory_stats`, `memory_run_metadata`)
4546
* Read files
4647
* Analyze code
4748
* Provide guidance
4849
* Ask questions
4950

5051
Memory recall is **strongly recommended** for all repository-related conversations, and **mandatory** before any durable mutation.
5152

53+
**NOTE:** In GUARDED and STRICT modes, memory recall is **enforced** — `memory_write` will fail if `memory_query` or `memory_recent` was not called first. In PASSIVE mode, violations are logged but not blocked.
54+
5255
---
5356

5457
## 3. Mutation (Requires Explicit Intent)
@@ -63,9 +66,11 @@ Before performing any durable mutation, you MUST:
6366
- The system will enforce the appropriate clearance for the requested mutation
6467

6568
3. **Check task authority** by reading `tinyTasks.md` (or confirming it doesn't exist)
69+
- **Recommended:** Use `memory_check_task_authority` to get explicit authorization status
70+
- Alternative: Read `tinyTasks.md` directly via file system tools
6671
- If unchecked tasks exist, resume from the first unchecked subtask
6772
- If tasks exist but none are unchecked, refuse execution and request user input
68-
- If file doesn't exist, you may create it for multi-step work
73+
- If file doesn't exist, you may create it for multi-step work (or the system may auto-create it)
6974

7075
---
7176

@@ -181,7 +186,41 @@ When performing multi-step work, validate:
181186

182187
---
183188

184-
## 9. Summary
189+
## 9. Enforcement & Tracking
190+
191+
### MCP Boundary Enforcement
192+
193+
The following contract requirements are **enforced at the MCP boundary** (not just recommended):
194+
195+
**Recall Before Mutation (GUARDED/STRICT):**
196+
- `memory_write` will **fail** if `memory_query` or `memory_recent` was not called first
197+
- Error returned: "Memory recall required: Call memory_query or memory_recent before memory_write"
198+
- In PASSIVE mode: Logged as violation but not blocked
199+
200+
**Violation Tracking:**
201+
- All contract violations are tracked in `memory_run_metadata`
202+
- Fields: `violations_count`, `blocked_actions_count`, `enforcement_events[]`
203+
- Violations include: recall not performed, unauthorized task execution attempts
204+
- Use this data to audit agent compliance and identify enforcement gaps
205+
206+
### Helper Tools
207+
208+
**memory_check_task_authority()**
209+
- Returns task file status: `{exists, unchecked_tasks, authorization, task_count, next_task}`
210+
- Authorization values:
211+
- `"create_allowed"` - file absent, agent may create
212+
- `"authorized"` - unchecked tasks present, agent may proceed
213+
- `"unauthorized"` - no unchecked tasks, agent must request user input
214+
- Use this instead of manually parsing `tinyTasks.md` for clearer contract compliance
215+
216+
**memory_run_metadata()**
217+
- Returns enforcement metadata for the current session
218+
- Includes: execution mode, enforcement events, violation counts, success counts
219+
- Use to verify your own contract compliance during execution
220+
221+
---
222+
223+
## 10. Summary
185224

186225
**Simple rules:**
187226

‎CRUSH.md‎

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ Task state must never be inferred.
4141

4242
The following require no mode declaration:
4343
* Query memory (`memory_query`, `memory_recent`)
44-
* Read health/diagnostics (`memory_health`, `memory_doctor`, `memory_stats`)
44+
* Check task authority (`memory_check_task_authority`)
45+
* Read health/diagnostics (`memory_health`, `memory_doctor`, `memory_stats`, `memory_run_metadata`)
4546
* Read files
4647
* Analyze code
4748
* Provide guidance
4849
* Ask questions
4950

5051
Memory recall is **strongly recommended** for all repository-related conversations, and **mandatory** before any durable mutation.
5152

53+
**NOTE:** In GUARDED and STRICT modes, memory recall is **enforced** — `memory_write` will fail if `memory_query` or `memory_recent` was not called first. In PASSIVE mode, violations are logged but not blocked.
54+
5255
---
5356

5457
## 3. Mutation (Requires Explicit Intent)
@@ -63,9 +66,11 @@ Before performing any durable mutation, you MUST:
6366
- The system will enforce the appropriate clearance for the requested mutation
6467

6568
3. **Check task authority** by reading `tinyTasks.md` (or confirming it doesn't exist)
69+
- **Recommended:** Use `memory_check_task_authority` to get explicit authorization status
70+
- Alternative: Read `tinyTasks.md` directly via file system tools
6671
- If unchecked tasks exist, resume from the first unchecked subtask
6772
- If tasks exist but none are unchecked, refuse execution and request user input
68-
- If file doesn't exist, you may create it for multi-step work
73+
- If file doesn't exist, you may create it for multi-step work (or the system may auto-create it)
6974

7075
---
7176

@@ -181,7 +186,41 @@ When performing multi-step work, validate:
181186

182187
---
183188

184-
## 9. Summary
189+
## 9. Enforcement & Tracking
190+
191+
### MCP Boundary Enforcement
192+
193+
The following contract requirements are **enforced at the MCP boundary** (not just recommended):
194+
195+
**Recall Before Mutation (GUARDED/STRICT):**
196+
- `memory_write` will **fail** if `memory_query` or `memory_recent` was not called first
197+
- Error returned: "Memory recall required: Call memory_query or memory_recent before memory_write"
198+
- In PASSIVE mode: Logged as violation but not blocked
199+
200+
**Violation Tracking:**
201+
- All contract violations are tracked in `memory_run_metadata`
202+
- Fields: `violations_count`, `blocked_actions_count`, `enforcement_events[]`
203+
- Violations include: recall not performed, unauthorized task execution attempts
204+
- Use this data to audit agent compliance and identify enforcement gaps
205+
206+
### Helper Tools
207+
208+
**memory_check_task_authority()**
209+
- Returns task file status: `{exists, unchecked_tasks, authorization, task_count, next_task}`
210+
- Authorization values:
211+
- `"create_allowed"` - file absent, agent may create
212+
- `"authorized"` - unchecked tasks present, agent may proceed
213+
- `"unauthorized"` - no unchecked tasks, agent must request user input
214+
- Use this instead of manually parsing `tinyTasks.md` for clearer contract compliance
215+
216+
**memory_run_metadata()**
217+
- Returns enforcement metadata for the current session
218+
- Includes: execution mode, enforcement events, violation counts, success counts
219+
- Use to verify your own contract compliance during execution
220+
221+
---
222+
223+
## 10. Summary
185224

186225
**Simple rules:**
187226

‎GEMINI.md‎

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ Task state must never be inferred.
4141

4242
The following require no mode declaration:
4343
* Query memory (`memory_query`, `memory_recent`)
44-
* Read health/diagnostics (`memory_health`, `memory_doctor`, `memory_stats`)
44+
* Check task authority (`memory_check_task_authority`)
45+
* Read health/diagnostics (`memory_health`, `memory_doctor`, `memory_stats`, `memory_run_metadata`)
4546
* Read files
4647
* Analyze code
4748
* Provide guidance
4849
* Ask questions
4950

5051
Memory recall is **strongly recommended** for all repository-related conversations, and **mandatory** before any durable mutation.
5152

53+
**NOTE:** In GUARDED and STRICT modes, memory recall is **enforced** — `memory_write` will fail if `memory_query` or `memory_recent` was not called first. In PASSIVE mode, violations are logged but not blocked.
54+
5255
---
5356

5457
## 3. Mutation (Requires Explicit Intent)
@@ -63,9 +66,11 @@ Before performing any durable mutation, you MUST:
6366
- The system will enforce the appropriate clearance for the requested mutation
6467

6568
3. **Check task authority** by reading `tinyTasks.md` (or confirming it doesn't exist)
69+
- **Recommended:** Use `memory_check_task_authority` to get explicit authorization status
70+
- Alternative: Read `tinyTasks.md` directly via file system tools
6671
- If unchecked tasks exist, resume from the first unchecked subtask
6772
- If tasks exist but none are unchecked, refuse execution and request user input
68-
- If file doesn't exist, you may create it for multi-step work
73+
- If file doesn't exist, you may create it for multi-step work (or the system may auto-create it)
6974

7075
---
7176

@@ -181,7 +186,41 @@ When performing multi-step work, validate:
181186

182187
---
183188

184-
## 9. Summary
189+
## 9. Enforcement & Tracking
190+
191+
### MCP Boundary Enforcement
192+
193+
The following contract requirements are **enforced at the MCP boundary** (not just recommended):
194+
195+
**Recall Before Mutation (GUARDED/STRICT):**
196+
- `memory_write` will **fail** if `memory_query` or `memory_recent` was not called first
197+
- Error returned: "Memory recall required: Call memory_query or memory_recent before memory_write"
198+
- In PASSIVE mode: Logged as violation but not blocked
199+
200+
**Violation Tracking:**
201+
- All contract violations are tracked in `memory_run_metadata`
202+
- Fields: `violations_count`, `blocked_actions_count`, `enforcement_events[]`
203+
- Violations include: recall not performed, unauthorized task execution attempts
204+
- Use this data to audit agent compliance and identify enforcement gaps
205+
206+
### Helper Tools
207+
208+
**memory_check_task_authority()**
209+
- Returns task file status: `{exists, unchecked_tasks, authorization, task_count, next_task}`
210+
- Authorization values:
211+
- `"create_allowed"` - file absent, agent may create
212+
- `"authorized"` - unchecked tasks present, agent may proceed
213+
- `"unauthorized"` - no unchecked tasks, agent must request user input
214+
- Use this instead of manually parsing `tinyTasks.md` for clearer contract compliance
215+
216+
**memory_run_metadata()**
217+
- Returns enforcement metadata for the current session
218+
- Includes: execution mode, enforcement events, violation counts, success counts
219+
- Use to verify your own contract compliance during execution
220+
221+
---
222+
223+
## 10. Summary
185224

186225
**Simple rules:**
187226

‎QWEN.md‎

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ Task state must never be inferred.
4141

4242
The following require no mode declaration:
4343
* Query memory (`memory_query`, `memory_recent`)
44-
* Read health/diagnostics (`memory_health`, `memory_doctor`, `memory_stats`)
44+
* Check task authority (`memory_check_task_authority`)
45+
* Read health/diagnostics (`memory_health`, `memory_doctor`, `memory_stats`, `memory_run_metadata`)
4546
* Read files
4647
* Analyze code
4748
* Provide guidance
4849
* Ask questions
4950

5051
Memory recall is **strongly recommended** for all repository-related conversations, and **mandatory** before any durable mutation.
5152

53+
**NOTE:** In GUARDED and STRICT modes, memory recall is **enforced** — `memory_write` will fail if `memory_query` or `memory_recent` was not called first. In PASSIVE mode, violations are logged but not blocked.
54+
5255
---
5356

5457
## 3. Mutation (Requires Explicit Intent)
@@ -63,9 +66,11 @@ Before performing any durable mutation, you MUST:
6366
- The system will enforce the appropriate clearance for the requested mutation
6467

6568
3. **Check task authority** by reading `tinyTasks.md` (or confirming it doesn't exist)
69+
- **Recommended:** Use `memory_check_task_authority` to get explicit authorization status
70+
- Alternative: Read `tinyTasks.md` directly via file system tools
6671
- If unchecked tasks exist, resume from the first unchecked subtask
6772
- If tasks exist but none are unchecked, refuse execution and request user input
68-
- If file doesn't exist, you may create it for multi-step work
73+
- If file doesn't exist, you may create it for multi-step work (or the system may auto-create it)
6974

7075
---
7176

@@ -181,7 +186,41 @@ When performing multi-step work, validate:
181186

182187
---
183188

184-
## 9. Summary
189+
## 9. Enforcement & Tracking
190+
191+
### MCP Boundary Enforcement
192+
193+
The following contract requirements are **enforced at the MCP boundary** (not just recommended):
194+
195+
**Recall Before Mutation (GUARDED/STRICT):**
196+
- `memory_write` will **fail** if `memory_query` or `memory_recent` was not called first
197+
- Error returned: "Memory recall required: Call memory_query or memory_recent before memory_write"
198+
- In PASSIVE mode: Logged as violation but not blocked
199+
200+
**Violation Tracking:**
201+
- All contract violations are tracked in `memory_run_metadata`
202+
- Fields: `violations_count`, `blocked_actions_count`, `enforcement_events[]`
203+
- Violations include: recall not performed, unauthorized task execution attempts
204+
- Use this data to audit agent compliance and identify enforcement gaps
205+
206+
### Helper Tools
207+
208+
**memory_check_task_authority()**
209+
- Returns task file status: `{exists, unchecked_tasks, authorization, task_count, next_task}`
210+
- Authorization values:
211+
- `"create_allowed"` - file absent, agent may create
212+
- `"authorized"` - unchecked tasks present, agent may proceed
213+
- `"unauthorized"` - no unchecked tasks, agent must request user input
214+
- Use this instead of manually parsing `tinyTasks.md` for clearer contract compliance
215+
216+
**memory_run_metadata()**
217+
- Returns enforcement metadata for the current session
218+
- Includes: execution mode, enforcement events, violation counts, success counts
219+
- Use to verify your own contract compliance during execution
220+
221+
---
222+
223+
## 10. Summary
185224

186225
**Simple rules:**
187226

0 commit comments

Comments
 (0)