@shanepadgett/tau-agent 0.17.0 → 0.18.1

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
@@ -25,6 +25,7 @@ pi -e .
25
25
 
26
26
  ## Docs
27
27
 
28
+ - [Context management](./docs/context.md) — repository context structure and taxonomy
28
29
  - [Extending Tau Agent](./docs/extending-tau-agent.md) — public events and integration
29
30
  - [Subagents](./docs/subagents.md) — custom agent definitions
30
31
  - [TUI](./docs/tui.md) — shared UI components
@@ -0,0 +1,62 @@
1
+ # Context management
2
+
3
+ Tau uses `.pi/contexts` as a reusable map of the repository. A selected context gives an agent the primary files for a work scope and points it toward related files without loading everything.
4
+
5
+ ## Structure
6
+
7
+ The catalog has three levels:
8
+
9
+ ```text
10
+ .pi/contexts/<domain>/<concept>.toml
11
+ └── [entry]
12
+ ```
13
+
14
+ - **Domain**: a stable top-level area of the repository, such as `commerce`, `platform`, or `documentation`. Domains become tabs in `/context`.
15
+ - **Concept**: a coherent subsystem or capability inside a domain. Each concept is one TOML file.
16
+ - **Entry**: a selectable work scope inside that concept. Each TOML section defines one entry.
17
+
18
+ Domain folders, concept filenames, and entry section names use lowercase kebab-case.
19
+
20
+ ```toml
21
+ name = "Checkout"
22
+ description = "Checkout calculation and order submission"
23
+
24
+ [orchestration]
25
+ description = "Building and submitting a checkout order"
26
+ files = ["src/checkout/order.ts", "src/checkout/service.ts"]
27
+ anchors = ["test/checkout/service.test.ts", "src/payments/client.ts"]
28
+
29
+ [discounts]
30
+ description = "Applying coupons and account discounts"
31
+ files = ["src/checkout/discounts.ts"]
32
+ anchors = ["test/checkout/discounts.test.ts"]
33
+ ```
34
+
35
+ Saved as `.pi/contexts/commerce/checkout.toml`, these entries have the IDs `commerce/checkout/orchestration` and `commerce/checkout/discounts`.
36
+
37
+ ## Build a useful taxonomy
38
+
39
+ A good entry gives the agent enough primary code to start one recurring kind of work without flooding its context window. Classify each scope from the top down:
40
+
41
+ 1. **Domain:** Which stable product or technical area owns this work?
42
+ 2. **Concept:** Which subsystem inside that area has a clear shared purpose?
43
+ 3. **Entry:** Which files are commonly needed together for one task?
44
+
45
+ Reuse existing terms when they still describe the code honestly. Create, move, split, or merge taxonomy when ownership or subsystem boundaries change. Directory layout can inform the decision, though domains and concepts should describe responsibility rather than copy the source tree.
46
+
47
+ Keep entries focused. Names such as `misc`, `shared`, and `other` hide missing boundaries. A broad `all` entry can support deliberate subsystem-wide work, but focused entries should remain available for normal tasks. If an entry keeps collecting unrelated paths, split it by work scope. If several tiny entries are always selected together, merge them.
48
+
49
+ Catalog durable code, configuration, tests, standards, and long-lived documentation. Leave scratch files, working plans, interviews, generated output, and rough ideas out of the catalog.
50
+
51
+ ## Choose files and anchors
52
+
53
+ - `files` are eagerly read when the entry is selected. Include primary files that are usually required for that scope.
54
+ - `anchors` are shown to the agent as unloaded navigation paths. Use them for related tests, callers, shared dependencies, or documentation that is useful only for some tasks.
55
+
56
+ Keep the eager set small enough to read on every selection. Keep each path's loading class consistent across the catalog. If selected entries classify the same path differently, eager loading wins.
57
+
58
+ ## Maintain the map
59
+
60
+ Inspect the existing catalog before placing new paths. Re-evaluate domain, concept, and entry boundaries after moves, ownership changes, or a coherent batch of new work; avoid stuffing paths into the nearest existing bucket.
61
+
62
+ Run `/context-sync` to update the catalog from uncommitted repository changes. Tau can also delegate to the `context-sync` subagent when automation is enabled. Context sync checks every eligible changed file for membership, removes stale paths, and re-evaluates the taxonomy before editing `.pi/contexts`.
@@ -2,9 +2,11 @@
2
2
 
3
3
  Context stores reusable repository work scopes in `.pi/contexts`. Folder names become selector tabs, TOML files become concepts, and TOML sections become selectable entries.
4
4
 
5
+ See [Context management](../../docs/context.md) for catalog structure and taxonomy guidance.
6
+
5
7
  Use `/context` to select entries. Entry `files` are injected through Tau autoread. Entry `anchors` supply lazy navigation paths that the agent can grep or read in ranges when needed.
6
8
 
7
- After meaningful uncommitted work (new/moved ownership, not trivial already-covered polish), the coding agent should run the `context-sync` subagent so `.pi/contexts` stays aligned. Humans can also run `/context-sync` or `/context-sync <nudge>` and press Escape to cancel a running sync. It walks domain → concept → entry → membership, edits only `.pi/contexts` with `patch`, and the harness verifies write scope plus catalog invariants afterward. Out-of-scope writes are restored and the run fails. Optional nudge text soft-steers judgment without skipping evidence.
9
+ After meaningful uncommitted work (new/moved ownership, not trivial already-covered polish), the coding agent should run the `context-sync` subagent so `.pi/contexts` stays aligned. Context sync catalogs durable code and long-lived documentation. Scratch pads, working plans, interviews, rough ideas, and other temporary artifacts should stay out; add recurring transient paths to `validation.ignoreGlobs`. Humans can also run `/context-sync` or `/context-sync <nudge>` and press Escape to cancel a running sync. It walks domain → concept → entry → membership, edits only `.pi/contexts` with `patch`, and the harness verifies write scope plus catalog invariants afterward. Out-of-scope writes are restored and the run fails. Optional nudge text soft-steers judgment without skipping evidence.
8
10
 
9
11
  Sync surface is configurable:
10
12
 
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  name: context-sync
3
3
  description: >-
4
- Map meaningful uncommitted work into `.pi/contexts` (domains/concepts/entries).
4
+ Map durable uncommitted code and long-lived documentation into `.pi/contexts` (domains/concepts/entries).
5
+ Skip scratch pads, working plans, interviews, rough ideas, and other temporary artifacts; ensure recurring transient paths are excluded by `extensions.context.validation.ignoreGlobs` before calling.
5
6
  Call after a coherent batch that adds, moves, renames, or changes ownership of code/docs—not after every trivial edit to paths already correctly filed.
6
7
  Prefer once per batch or before commit; skip pure refactors that keep the same membership, typos, and already-covered single-file polish.
7
8
  Task may include a short human/steer note. Harness may also auto-run this when context validation is enabled.
@@ -54,6 +55,12 @@ Forbidden with bash:
54
55
 
55
56
  Catalog file mutations go through `patch` under `.pi/contexts` only. The harness restores out-of-scope writes and fails the run.
56
57
 
58
+ ## Durability gate
59
+
60
+ Catalog durable repository material: code, configuration, tests, standards, and documentation expected to remain useful after the current work finishes.
61
+
62
+ Do not catalog scratch pads, working plans, interview notes, rough ideas, or other temporary artifacts. Recurring transient paths belong in the parent project's `extensions.context.validation.ignoreGlobs`. The parent owns settings; if an uncovered transient path is not ignored, leave it out of the catalog and report the exact ignore glob needed instead of forcing it into an entry.
63
+
57
64
  ## Forced ladder
58
65
 
59
66
  Before placing any path, answer out loud in order:
@@ -28,7 +28,7 @@ Adds `/commit` for semantic commit grouping, review, and committing selected rep
28
28
 
29
29
  ## context
30
30
 
31
- Adds `/context` to select reusable repository work scopes from `.pi/contexts`, and `/context-sync` or `/context-sync <nudge>` for human-driven catalog sync (optional nudge). Escape cancels a running manual sync. When `sync.automation` is on, the coding agent can also run the `context-sync` subagent after meaningful uncommitted work. `sync.enabled` is the master switch for command, automation, and validation auto-run. Entry `files` are autoread; entry `anchors` are unloaded navigation paths. Context validation is off by default; when on (and sync enabled), Tau auto-runs context-sync on failure. Folder names are tabs, TOML files are concepts, and TOML sections are selectable entries.
31
+ Adds `/context` to select reusable repository work scopes from `.pi/contexts`, and `/context-sync` or `/context-sync <nudge>` for human-driven catalog sync (optional nudge). Escape cancels a running manual sync. When `sync.automation` is on, the coding agent can also run the `context-sync` subagent after meaningful uncommitted work. Sync catalogs durable code and long-lived documentation; recurring scratch, planning, interview, and rough-idea paths belong in `validation.ignoreGlobs`. `sync.enabled` is the master switch for command, automation, and validation auto-run. Entry `files` are autoread; entry `anchors` are unloaded navigation paths. Context validation is off by default; when on (and sync enabled), Tau auto-runs context-sync on failure. Folder names are tabs, TOML files are concepts, and TOML sections are selectable entries.
32
32
 
33
33
  ## context-pruning
34
34
 
@@ -7,7 +7,7 @@ import { Markdown, type Component, visibleWidth } from "@earendil-works/pi-tui";
7
7
  const TAU_DOCS_PATH = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "docs");
8
8
  const TAU_DOCS_GUIDANCE = `Tau Agent documentation (read only when the user asks about Tau Agent, Rok, Tau extensions, Tau event APIs, harness behavior, or extending Tau Agent):
9
9
  - Tau Agent docs: ${TAU_DOCS_PATH}
10
- - When asked about: public events / external integration (docs/extending-tau-agent.md), custom subagents (docs/subagents.md), Tau TUI components (docs/tui.md)
10
+ - When asked about: context management / .pi/contexts taxonomy (docs/context.md), public events / external integration (docs/extending-tau-agent.md), custom subagents (docs/subagents.md), Tau TUI components (docs/tui.md)
11
11
  - Resolve Tau docs/... under Tau Agent docs, not the current working directory
12
12
  - When working on Tau topics, read the docs and follow .md cross-references before implementing
13
13
  - Do not read Tau Agent docs for normal coding tasks`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shanepadgett/tau-agent",
3
- "version": "0.17.0",
3
+ "version": "0.18.1",
4
4
  "description": "Tau is a custom agentic harness built with pi extensions",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,7 +28,7 @@
28
28
  "README.md"
29
29
  ],
30
30
  "dependencies": {
31
- "@shanepadgett/tau-tui": "0.17.0",
31
+ "@shanepadgett/tau-tui": "0.18.1",
32
32
  "@toon-format/toon": "2.3.0",
33
33
  "smol-toml": "1.7.0"
34
34
  },