From 38e2dd58b0f861ac1e0ffe158b280b90da8e2bf2 Mon Sep 17 00:00:00 2001 From: worldmozara Date: Fri, 9 Oct 2026 19:46:02 +0800 Subject: [PATCH] core/config: state the 0-based offsets of skill_read and fetch --- src/plyngent/agent/directive_checkpoint.py | 6 ++++-- src/plyngent/config/models.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/plyngent/agent/directive_checkpoint.py b/src/plyngent/agent/directive_checkpoint.py index f5e482e..5c0ad53 100644 --- a/src/plyngent/agent/directive_checkpoint.py +++ b/src/plyngent/agent/directive_checkpoint.py @@ -21,11 +21,13 @@ Tool playbook still applies (see system). Hard constraints: use `run_argv_batch` for ordered pipelines. - `edit_replace`: fix match / `max_replaces`; `edit_lineno` edits only lines read via \ `read_file(with_lineno=true)`, and line numbers reset after any file write. -- `read_file` results start with `L{begin}-{end}` (1-based lines; offset is 0-based). +- `read_file` results start with `L{begin}-{end}` (1-based lines; offset is 0-based; \ +`skill_read` slices a skill file the same way). - `regex_files`: `pattern` is a Python `re` regex (not a glob, so `*.py` fails) and \ `path` is a literal file/dir (no glob expansion). - Truncated results carry a `truncate_token=...`; continue with `get_truncated`. -- Prefer `fetch` for HTTP(S); private/LAN hosts need human policy allow (not YOLO). +- Prefer `fetch` for HTTP(S); `offset` (0-based) skips leading body characters; \ +private/LAN hosts need human policy allow (not YOLO). - PTY secrets only via `ask_into_pty`; denylists and confirms still apply. - `wait` pauses; pressing Enter disturbs early (optional reason). - Todo stack: open items mean unfinished work; the stack does not auto-clear — \ diff --git a/src/plyngent/config/models.py b/src/plyngent/config/models.py index 6fcfc4a..c47a9cb 100644 --- a/src/plyngent/config/models.py +++ b/src/plyngent/config/models.py @@ -52,7 +52,8 @@ raise `max_replaces` or narrow `old_string`. re-read with line numbers after any `edit_*` / `write_file` / copy/move/delete, \ since line numbers go stale. - `read_file` results start with a 1-based line range `L{begin}-{end}` (`offset` \ -is 0-based); `with_lineno` shows per-line numbers instead. +is 0-based); `with_lineno` shows per-line numbers instead. `skill_read` slices a \ +skill file the same way. - `regex_files` takes a Python `re` regex for `pattern`, not a filename glob \ (`*.py` / `**/*.py` fail with `invalid regex`), and a literal file/dir `path` \ (no glob expansion, so `src/**/*.py` fails with `path does not exist`); there is \ @@ -72,7 +73,8 @@ for ordered pipelines (`pipe_out` / `mix_stderr` as needed). - Prefer `vcs_*` for status/diff/log/branch when enough. ### Network -- Prefer `fetch` (GET/POST/PUT/DELETE) for HTTP(S) docs/APIs over curl/wget via shell. +- Prefer `fetch` (GET/POST/PUT/DELETE) for HTTP(S) docs/APIs over curl/wget via shell; \ +`offset` (0-based) skips leading body characters to page through a large body. - Set `user_agent` (or a User-Agent header) when the remote expects a specific client; \ otherwise a small default is used. Never rely on shell to spoof identity. - Private/loopback/LAN hosts need an explicit human policy allow (not skipped by YOLO).