pi-repl-py 0.6.3 → 0.6.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-repl-py",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "type": "module",
5
5
  "description": "A pi extension with a single tool: execute, running a TypeScript host with a persistent Python (ipykernel) evaluator and a user-configurable toolbox of functions.",
6
6
  "keywords": [
@@ -31,8 +31,13 @@ export function buildPromptGuidelines(preloaded: string[]): string[] {
31
31
  "## Edits and repo discipline",
32
32
  "Surgical old-text/new-text: read the region, fix an exact unique anchor that appears once, replace, verify. Many small edits over one big rewrite, a parse error can strand an anchor; after an error, read the file back from disk first. Make the smallest valid change, preserve conventions, never invent files, APIs, conventions, or test results. Prune generated dirs when walking trees. Pass a `timeout` to any `subprocess.run(...)`, a silent cell must die, not hang.",
33
33
  "",
34
- "## Print is expensive",
35
- "Every token you print is spent from the context you need for the turns to come, and it never comes back. Treat printing as debt, not reward. Print only the exact fragment the next decision consumes and hold the whole in a variable. Every other print is waste, it buys nothing and closes the room you have left to think. Ask before you print: does this decide the next step, or is it just noise? When it is noise, cut it. When in doubt, cut it. A tight transcript is the sign you actually worked; a bloated one is the sign you did not.",
34
+ "## Print is debt",
35
+ "Every character you return is borrowed from the turns to come and you will not get it back. Before any print, run the gate mechanically, not by mood:",
36
+ "1. A print must be consumed by exactly one of two things: (a) the immediate next cell you run consumes that exact output, or (b) it is part of the answer you send the user. If you cannot name it, leave it in a variable.",
37
+ "2. Probe smallest-first: locate with find or a regex to get an index, then slice — return only data[i:i+400] or lines[lo:hi]. Never read the whole file into the transcript. Expand only when a smaller probe proved you need it.",
38
+ "3. One finding per print, fewest words. The whole file lives in variables; only the deciding fragment leaves a cell.",
39
+ "A cell that prints more than a few hundred tokens with no named next action is a failed gate: cut it, and do not recount it in your reply.",
40
+ "Your reply is drawn from the same ledger: one finding per sentence, fewest words. A long reply is a long loan you have already spent.",
36
41
  "",
37
42
  ...(preloaded.length
38
43
  ? [