@matheuskrumenauer/tanya 0.13.0-beta.0 → 0.14.0-beta.0

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/README.md CHANGED
@@ -361,29 +361,35 @@ Tanya trims model-visible tokens while keeping state reversible and auditable.
361
361
 
362
362
  See [docs/token-economy.md](./docs/token-economy.md) for the full model, cache locations, and tool-definition knobs.
363
363
 
364
- ## Structural repo-map
364
+ ## Edit blocks
365
365
 
366
- Lite prompts can include a generated structural map from
367
- `.tania/index/repo-map.json`. The map lists workspace-relative files, language,
368
- parser provenance, top-level symbols, imports, and exports so cheap providers
369
- can target likely files before spending turns on blind reads.
366
+ `edit_block` applies bounded search/replace edits without falling back to a
367
+ full-file rewrite:
370
368
 
371
- Tanya indexes TypeScript/JavaScript, Python, Go, Swift, and Kotlin with a
372
- lightweight ripgrep-style parser and falls back to path-only entries when file
373
- content cannot be read. Generated, binary, ignored, and oversized files are
374
- skipped. The repo-map is advisory context only: agents must still read files
375
- before editing, and the verifier remains the final authority.
369
+ ```json
370
+ {
371
+ "path": "src/example.ts",
372
+ "search": "const state = \"pending\";",
373
+ "replace": "const state = \"complete\";",
374
+ "expectedCount": 1,
375
+ "matchPolicy": "exact"
376
+ }
377
+ ```
376
378
 
377
- Use `TANYA_LITE_PROMPT=1` to inject a ranked repo-map excerpt. Tune the default
378
- 1000-token section budget with `TANYA_REPO_MAP_PROMPT_BUDGET`; the legacy
379
- `TANIA_*` alias is also accepted. If the prompt budget is tight, the repo-map
380
- drops before skill packs because it is generated and recoverable.
379
+ Exact mode is the default and fails closed when the block is missing, ambiguous,
380
+ or appears a different number of times than expected. Fuzzy mode is opt-in via
381
+ `matchPolicy: "fuzzy"` and requires an explicit M3 permission allow rule. Fuzzy
382
+ recovery only accepts whitespace-normalized or nearby-context candidates with
383
+ confidence >= 0.95; otherwise Tanya returns a structured error and asks the
384
+ model to re-read the file.
381
385
 
382
- Use `inspect_repo_map` when the model needs more structural detail by file,
383
- symbol, or language without burning prompt tokens on the whole map.
386
+ Successful edit blocks emit before/after hashes and a unified diff. Fuzzy
387
+ successes also add candidate metadata to the audit log. The final verifier still
388
+ reads the changed workspace independently; edit-block success is not a verifier
389
+ pass.
384
390
 
385
- See [docs/repo-map.md](./docs/repo-map.md) for schema, parser status, ranking,
386
- budget interaction, and cache invalidation.
391
+ See [docs/edit-blocks.md](./docs/edit-blocks.md) for the full tool reference,
392
+ permission model, confidence threshold, and failure modes.
387
393
 
388
394
  Context files are generic JSON envelopes for caller-supplied task metadata, artifacts, instructions, and verification commands.
389
395
 
@@ -392,7 +398,6 @@ Context files are generic JSON envelopes for caller-supplied task metadata, arti
392
398
  - `list_files`
393
399
  - `read_file`
394
400
  - `search`
395
- - `inspect_repo_map`
396
401
  - `inspect_project_context`
397
402
  - `find_reusable_artifacts`
398
403
  - `build_task_brief`
@@ -400,6 +405,7 @@ Context files are generic JSON envelopes for caller-supplied task metadata, arti
400
405
  - `write_file`
401
406
  - `apply_patch`
402
407
  - `search_replace`
408
+ - `edit_block`
403
409
  - `copy_file`
404
410
  - `copy_dir`
405
411
  - `apply_artifact`