@jefuriiij/synthra 0.1.17 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1558,7 +1558,7 @@ import { basename as basename2 } from "path";
1558
1558
  // src/hooks/claude-md.ts
1559
1559
  import { readFile as readFile6, writeFile as writeFile2 } from "fs/promises";
1560
1560
  import { basename, dirname as dirname4 } from "path";
1561
- var POLICY_VERSION = 3;
1561
+ var POLICY_VERSION = 4;
1562
1562
  var POLICY_BEGIN = `<!-- synthra-policy v${POLICY_VERSION} BEGIN -->`;
1563
1563
  var POLICY_END = `<!-- synthra-policy v${POLICY_VERSION} END -->`;
1564
1564
  var ANY_BLOCK_RE = /<!--\s*synthra-policy\s+v\d+\s+BEGIN\s*-->[\s\S]*?<!--\s*synthra-policy\s+v\d+\s+END\s*-->\s*/g;
@@ -1627,6 +1627,17 @@ function policyBlock() {
1627
1627
  "- If `graph_continue`'s `Files` list contains a `::` entry, pass it",
1628
1628
  " verbatim to `graph_read`.",
1629
1629
  "",
1630
+ "### Editing a file",
1631
+ "",
1632
+ "Claude Code's `Edit` tool (and `Write` when overwriting) only accepts a",
1633
+ "file that was opened with the **`Read` tool** \u2014 a `graph_read` slice does",
1634
+ 'not count, and editing such a file fails with *"File has not been read',
1635
+ 'yet."* So before editing a file you only know through `graph_read`: take',
1636
+ "the line range from its header (e.g. `\u2026::handler (L120-168)`), `Read` that",
1637
+ "file with a matching `offset`/`limit`, then `Edit`. That satisfies the",
1638
+ "gate while keeping the read small \u2014 don't whole-file `Read` unless the",
1639
+ "edit spans most of the file.",
1640
+ "",
1630
1641
  "### Don'ts",
1631
1642
  "",
1632
1643
  "- Don't Grep / Glob before calling `graph_continue` when required \u2014 the",