generated from coulomb/repo-seed
session-memory: Read-before-Edit reflex + curated pattern (WP-0008)
Acts on the #1 friction finding. T01: added a data-cited Read-before-Edit / re-read-on-stale reflex to AGENTS.md (top error: 'File has not been read yet', 12/27 sessions). T02: captured it as a curated SolutionPattern (sp-problem-file_not_read-edit, approved/distribution_ready) with real resolutions + per-flavor hints, so Distribute proposes it across repos/flavors — closing assess->curate->distribute on a real pattern. Suite 126/126. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
12
AGENTS.md
12
AGENTS.md
@@ -34,6 +34,18 @@ green), and for pipeline changes do a live `ingest → detect → curate` pass a
|
||||
the local store. See `session_memory/README.md` for the full layout and the
|
||||
detect → curate → distribute flow.
|
||||
|
||||
### Editing files — Read before you Edit
|
||||
|
||||
**Read a file (or the region you'll touch) before Edit/Write.** The most common
|
||||
error across our own captured coding sessions was *"File has not been read yet.
|
||||
Read it first before writing to it"* — 12 of 27 real sessions, 8 repos
|
||||
(`docs/ASSESSMENT-infra-friction.md`). Two cheap reflexes eliminate it:
|
||||
|
||||
- **Read → then Edit/Write.** Don't blind-write a file you haven't read this
|
||||
session; the edit tools reject it and the retry wastes a turn.
|
||||
- **On `File has been modified since read`, re-Read then re-Edit.** A stale read
|
||||
means the file changed under you — refresh before retrying, don't loop.
|
||||
|
||||
---
|
||||
|
||||
## State Hub Integration
|
||||
|
||||
58
session_memory/catalog/sp-problem-file_not_read-edit.json
Normal file
58
session_memory/catalog/sp-problem-file_not_read-edit.json
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"created_at": "2026-06-07T13:26:25Z",
|
||||
"distribution_ready": true,
|
||||
"id": "sp-problem-file_not_read-edit",
|
||||
"name": "Read before you Edit",
|
||||
"polarity": "problem",
|
||||
"problem": "Agents call Edit/Write on a file they have not read in the current session, or after it changed under them. The edit tools reject this ('File has not been read yet' / 'File has been modified since read'), and the retry burns a turn. Top recurring error in the corpus (12/27 sessions, 8 repos).",
|
||||
"provenance": {
|
||||
"detected_at": null,
|
||||
"evidence": {
|
||||
"frequency": 32,
|
||||
"origin": "AGENTIC-WP-0006 error mining / ASSESSMENT-infra-friction.md",
|
||||
"polarity": "problem",
|
||||
"repos": 8,
|
||||
"sessions": 12
|
||||
},
|
||||
"promoted_at": null,
|
||||
"source_key": "problem:file_not_read:edit"
|
||||
},
|
||||
"rendering_hints": {
|
||||
"claude": {
|
||||
"target": "CLAUDE.md"
|
||||
},
|
||||
"codex": {
|
||||
"target": "AGENTS.md"
|
||||
},
|
||||
"grok": {
|
||||
"target": ".grok/instructions.md"
|
||||
}
|
||||
},
|
||||
"resolutions": [
|
||||
{
|
||||
"detail": "Never blind-write a file you haven't read this session.",
|
||||
"steps": [
|
||||
"Read the target file",
|
||||
"Then Edit/Write"
|
||||
],
|
||||
"summary": "Read the file (or the region you'll touch) before Edit/Write"
|
||||
},
|
||||
{
|
||||
"detail": "A stale read means the file changed under you; refresh, don't loop.",
|
||||
"steps": [
|
||||
"Re-Read the file",
|
||||
"Re-apply the Edit"
|
||||
],
|
||||
"summary": "On 'modified since read', re-Read then re-Edit"
|
||||
}
|
||||
],
|
||||
"schema_version": 1,
|
||||
"scope": {
|
||||
"domains": [],
|
||||
"flavors": [],
|
||||
"repos": []
|
||||
},
|
||||
"status": "approved",
|
||||
"updated_at": "2026-06-07T13:26:25Z",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
@@ -1,4 +1,12 @@
|
||||
[
|
||||
{
|
||||
"flavor": "claude",
|
||||
"pattern_id": "sp-problem-file_not_read-edit",
|
||||
"repo": "agentic-resources",
|
||||
"status": "proposed",
|
||||
"updated_at": "2026-06-07T13:26:26Z",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
{
|
||||
"flavor": "claude",
|
||||
"pattern_id": "sp-problem-schema_thrash-schema_load",
|
||||
@@ -20,7 +28,7 @@
|
||||
"pattern_id": "sp-success-clean_pass-outcome",
|
||||
"repo": "agentic-resources",
|
||||
"status": "proposed",
|
||||
"updated_at": "2026-06-07T13:20:58Z",
|
||||
"updated_at": "2026-06-07T13:26:26Z",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ type: workplan
|
||||
title: "Act on #1 friction — Read-before-Edit reflex"
|
||||
domain: helix_forge
|
||||
repo: agentic-resources
|
||||
status: ready
|
||||
status: finished
|
||||
owner: codex
|
||||
topic_slug: helix-forge
|
||||
created: "2026-06-07"
|
||||
@@ -30,7 +30,7 @@ closing the assess → curate → distribute loop by hand for one real pattern.
|
||||
|
||||
```task
|
||||
id: AGENTIC-WP-0008-T01
|
||||
status: todo
|
||||
status: done
|
||||
priority: high
|
||||
state_hub_task_id: "549c84c1-5bd8-4ff6-b61d-1c72946b8b8e"
|
||||
```
|
||||
@@ -44,7 +44,7 @@ context budgets).
|
||||
|
||||
```task
|
||||
id: AGENTIC-WP-0008-T02
|
||||
status: todo
|
||||
status: done
|
||||
priority: medium
|
||||
state_hub_task_id: "c007baf9-db14-40fa-b944-d1f1a71ea28b"
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user