@shanepadgett/tau-agent 0.29.0 → 0.31.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/docs/context.md +14 -9
- package/docs/subagents.md +7 -5
- package/extensions/cache-diagnostics/index.ts +3 -4
- package/extensions/context/README.md +8 -5
- package/extensions/context/definitions.ts +28 -17
- package/extensions/context/evidence.ts +4 -3
- package/extensions/context/index.ts +57 -35
- package/extensions/context/panel.ts +10 -9
- package/extensions/context/projection.ts +141 -0
- package/extensions/context/state.ts +30 -0
- package/extensions/explore/ast/read/hook.ts +3 -1
- package/extensions/ideas/browser.ts +27 -16
- package/extensions/review/README.md +11 -0
- package/extensions/review/index.ts +135 -0
- package/extensions/review/model.ts +144 -0
- package/extensions/review/panel.ts +128 -0
- package/extensions/review/session.ts +106 -0
- package/extensions/script-runner/README.md +7 -0
- package/extensions/script-runner/index.ts +275 -0
- package/extensions/stash/browser.ts +30 -18
- package/extensions/subagent/README.md +17 -4
- package/extensions/subagent/agents/context-sync.md +2 -2
- package/extensions/subagent/agents/scout.md +48 -61
- package/extensions/subagent/agents.ts +0 -1
- package/extensions/subagent/cmux-dashboard.ts +7 -3
- package/extensions/subagent/index.ts +105 -4
- package/extensions/subagent/panel.ts +124 -0
- package/extensions/subagent/render.ts +2 -1
- package/extensions/subagent/run.ts +9 -9
- package/extensions/subagent/runtime.ts +5 -5
- package/extensions/subagent/session-resource.ts +19 -127
- package/extensions/subagent/settings.ts +18 -0
- package/extensions/tau-help/help.md +11 -7
- package/extensions/working-memory/README.md +1 -1
- package/extensions/working-memory/checkpoint.ts +3 -4
- package/extensions/working-memory/index.ts +25 -7
- package/extensions/working-memory/memory.ts +53 -82
- package/package.json +2 -2
- package/schemas/tau.schema.json +9 -23
- package/shared/context-messages.ts +19 -0
- package/shared/injected-context.ts +2 -2
- package/shared/isolated-session.ts +151 -0
- package/extensions/subagent/agents/review.md +0 -75
- package/extensions/turn-budget/README.md +0 -14
- package/extensions/turn-budget/index.ts +0 -116
- package/extensions/turn-budget/settings.ts +0 -35
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: review
|
|
3
|
-
description: Perform a nuclear, architecture-first review for necessity, reuse, ownership, duplication, and simplification; runtime correctness is secondary
|
|
4
|
-
tools:
|
|
5
|
-
- read
|
|
6
|
-
- bash
|
|
7
|
-
- outline
|
|
8
|
-
- show
|
|
9
|
-
- discover
|
|
10
|
-
- ast_search
|
|
11
|
-
- deps
|
|
12
|
-
- reverse_deps
|
|
13
|
-
- callers
|
|
14
|
-
- callees
|
|
15
|
-
- references
|
|
16
|
-
- implementations
|
|
17
|
-
- impact
|
|
18
|
-
- context
|
|
19
|
-
names:
|
|
20
|
-
- Auditor
|
|
21
|
-
- Inspector
|
|
22
|
-
- Skeptic
|
|
23
|
-
- Examiner
|
|
24
|
-
- Sentinel
|
|
25
|
-
model: openai-codex/gpt-5.6-sol
|
|
26
|
-
thinking: high
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
Stay centered on delegated change, but inspect enough surrounding code to find correct ownership and existing reuse. Every review is a nuclear review of codebase health. A caller may narrow changed behavior under review; it cannot reduce review to runtime correctness.
|
|
30
|
-
|
|
31
|
-
Answer in this order:
|
|
32
|
-
|
|
33
|
-
1. Should this code exist? Is every added behavior requested and necessary?
|
|
34
|
-
2. Does repository code, stdlib, platform, or an installed dependency already solve it?
|
|
35
|
-
3. Is logic owned by right layer and fixed at shared root rather than patched at one symptom or caller?
|
|
36
|
-
4. Does change leave codebase smaller and more coherent than other credible implementations?
|
|
37
|
-
5. Is runtime behavior correct?
|
|
38
|
-
|
|
39
|
-
Find concrete architectural damage, missed simplifications, and failures. Report. Stop. No mutations, unrelated repository archaeology, or broad concern inventory.
|
|
40
|
-
|
|
41
|
-
## Evidence ladder
|
|
42
|
-
|
|
43
|
-
Use cheapest evidence that settles each tier. Escalate only when answer could change verdict.
|
|
44
|
-
|
|
45
|
-
1. **Supplied context** — Treat current line-numbered task files as authoritative this turn.
|
|
46
|
-
2. **Paths and literals** — Use read-only `bash` (`ls`, `find`, `rg`/`grep`) for narrow path discovery, exact text, registrations, and unsupported formats. Use ranged `read` when formatting or source context matters.
|
|
47
|
-
3. **Structure, ownership, and reuse** — Default to `outline`. Use `discover` when changed code may duplicate an existing repository API but name or path is unknown. Use `ast_search` for a concrete duplicated shape, parallel concept, misplaced responsibility, or risky source shape.
|
|
48
|
-
4. **Exact declarations** — Use `show` with path + name (+ line when needed). Retrieve only contract, body, imports, or nearby lines needed for verdict.
|
|
49
|
-
5. **Relationships and runtime** — Use `callers`, `callees`, `references`, or `implementations` after selecting a declaration. Use `deps`/`reverse_deps` for file ownership and imports. Use `impact` for full blast radius and `context` for one bounded declaration pack.
|
|
50
|
-
|
|
51
|
-
Keep roots and result limits narrow. Structural evidence proves bounded syntax, not dynamic dispatch. Preserve inferred and ambiguous labels.
|
|
52
|
-
|
|
53
|
-
## Review procedure
|
|
54
|
-
|
|
55
|
-
Run every tier in order, even when caller asks only for runtime review:
|
|
56
|
-
|
|
57
|
-
1. **Necessity and scope** — Extract requested behavior and repository constraints. Identify speculative behavior, bonus surfaces, configuration, or staging that can disappear.
|
|
58
|
-
2. **Reuse** — Search for existing helpers, types, components, patterns, stdlib, platform features, and installed dependencies before accepting new code.
|
|
59
|
-
3. **Ownership and architecture** — Check whether change belongs in current layer, fixes shared root, preserves one source of truth, and avoids parallel concepts. Follow callers and sibling paths when needed to detect a local symptom patch.
|
|
60
|
-
4. **Codebase health** — Look for duplication, fragmented ownership, wrappers, option bags, helpers, files, types, and abstractions whose removal materially reduces concepts. Consider a focused refactor when local patch deepens bad structure.
|
|
61
|
-
5. **Runtime correctness** — Spend remaining effort on shortest realistic path through state transitions, boundaries, error handling, and affected callers. Avoid theoretical branch inventory.
|
|
62
|
-
6. Stop when every tier has enough evidence for verdict.
|
|
63
|
-
|
|
64
|
-
Treat every added concept as guilty until evidence justifies it. Reject speculation, personal style preferences, and architecture complaints without concrete ownership, maintenance, duplication, or change-cost impact. Do not modify files.
|
|
65
|
-
|
|
66
|
-
## Output
|
|
67
|
-
|
|
68
|
-
List architectural findings first, then runtime findings. Order each group by severity. Each finding needs:
|
|
69
|
-
|
|
70
|
-
- severity and direct title;
|
|
71
|
-
- exact file, line range, and declaration when one exists;
|
|
72
|
-
- failure mechanism or concrete architectural cost;
|
|
73
|
-
- smallest credible fix direction.
|
|
74
|
-
|
|
75
|
-
Then list only unresolved questions that materially affect verdict. No findings: say architecture, reuse, and scope look healthy, implementation is simplest credible version, and runtime appears correct. Briefly name inspected scope. No preamble, search log, broad summary, or repeated evidence.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Turn Budget
|
|
2
|
-
|
|
3
|
-
Adds soft turn budget hints for Tau sessions.
|
|
4
|
-
|
|
5
|
-
Turn Budget helps agents spend fewer provider cycles by nudging them to batch related tool work. It counts
|
|
6
|
-
tool-using turns per user prompt, sends visible steering messages at configured intervals, and extends the soft cap
|
|
7
|
-
instead of blocking work.
|
|
8
|
-
|
|
9
|
-
## Settings
|
|
10
|
-
|
|
11
|
-
- `enabled`: defaults to `true`
|
|
12
|
-
- `turnLimit`: defaults to `30`
|
|
13
|
-
- `nudgeEveryTurns`: defaults to `5`
|
|
14
|
-
- `softCapIncrement`: defaults to `10`
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { loadTauExtensionSettings } from "../../shared/settings/load.ts";
|
|
3
|
-
import { Marker } from "@shanepadgett/tau-tui";
|
|
4
|
-
import turnBudgetSettings from "./settings.ts";
|
|
5
|
-
|
|
6
|
-
const MARKER_TYPE = "tau.turn-budget.marker";
|
|
7
|
-
|
|
8
|
-
interface Settings {
|
|
9
|
-
enabled: boolean;
|
|
10
|
-
turnLimit: number;
|
|
11
|
-
nudgeEveryTurns: number;
|
|
12
|
-
softCapIncrement: number;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
type Hint =
|
|
16
|
-
| { kind: "normal"; used: number; cap: number }
|
|
17
|
-
| { kind: "extended"; used: number; previousCap: number; newCap: number };
|
|
18
|
-
|
|
19
|
-
interface MarkerDetails {
|
|
20
|
-
used: number;
|
|
21
|
-
cap: number;
|
|
22
|
-
extended: boolean;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default function turnBudgetExtension(pi: ExtensionAPI): void {
|
|
26
|
-
let settings = normalizeSettings(turnBudgetSettings.defaults);
|
|
27
|
-
let turnCount = 0;
|
|
28
|
-
let softCap = settings.turnLimit;
|
|
29
|
-
|
|
30
|
-
pi.registerMessageRenderer<MarkerDetails>(MARKER_TYPE, (message, _options, theme) => {
|
|
31
|
-
const details = readMarkerDetails(message.details);
|
|
32
|
-
if (!details) return undefined;
|
|
33
|
-
return new Marker({
|
|
34
|
-
theme,
|
|
35
|
-
state: "muted",
|
|
36
|
-
label: "Turn Budget:",
|
|
37
|
-
parts: [`${details.used}/${details.cap}`, ...(details.extended ? ["Soft cap extended."] : [])],
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
pi.on("session_start", async (_event, ctx) => {
|
|
42
|
-
settings = normalizeSettings(await loadTauExtensionSettings(ctx, turnBudgetSettings));
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
pi.on("agent_start", () => {
|
|
46
|
-
turnCount = 0;
|
|
47
|
-
softCap = settings.turnLimit;
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
pi.on("turn_end", (event) => {
|
|
51
|
-
if (!settings.enabled) return undefined;
|
|
52
|
-
if (event.toolResults.length === 0) return undefined;
|
|
53
|
-
turnCount += 1;
|
|
54
|
-
if (turnCount >= softCap) {
|
|
55
|
-
const hint: Hint = {
|
|
56
|
-
kind: "extended",
|
|
57
|
-
used: turnCount,
|
|
58
|
-
previousCap: softCap,
|
|
59
|
-
newCap: turnCount + settings.softCapIncrement,
|
|
60
|
-
};
|
|
61
|
-
sendTurnBudgetMessage(pi, hint);
|
|
62
|
-
softCap = hint.newCap;
|
|
63
|
-
return undefined;
|
|
64
|
-
}
|
|
65
|
-
if (turnCount % settings.nudgeEveryTurns === 0) {
|
|
66
|
-
const hint: Hint = { kind: "normal", used: turnCount, cap: softCap };
|
|
67
|
-
sendTurnBudgetMessage(pi, hint);
|
|
68
|
-
}
|
|
69
|
-
return undefined;
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function sendTurnBudgetMessage(pi: ExtensionAPI, hint: Hint): void {
|
|
74
|
-
pi.sendMessage<MarkerDetails>({
|
|
75
|
-
customType: MARKER_TYPE,
|
|
76
|
-
content: formatSteeringMessage(hint),
|
|
77
|
-
display: true,
|
|
78
|
-
details: markerDetails(hint),
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function formatSteeringMessage(hint: Hint): string {
|
|
83
|
-
const instruction =
|
|
84
|
-
"Internal steering instruction. Work within it silently. Do not mention or acknowledge turn counts, budget messages, or budget summaries.";
|
|
85
|
-
if (hint.kind === "extended") {
|
|
86
|
-
return `${instruction} Turn budget: ${hint.used}/${hint.previousCap} turns used for this user prompt. Soft cap extended to ${hint.newCap}. Batch tools when more tool work remains.`;
|
|
87
|
-
}
|
|
88
|
-
return `${instruction} Turn budget: ${hint.used}/${hint.cap} turns used for this user prompt. Batch tools when more tool work remains.`;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function normalizeSettings(value: typeof turnBudgetSettings.defaults): Settings {
|
|
92
|
-
return {
|
|
93
|
-
enabled: value.enabled ?? true,
|
|
94
|
-
turnLimit: Number.isInteger(value.turnLimit) && value.turnLimit > 0 ? value.turnLimit : 30,
|
|
95
|
-
nudgeEveryTurns: Number.isInteger(value.nudgeEveryTurns) && value.nudgeEveryTurns > 0 ? value.nudgeEveryTurns : 5,
|
|
96
|
-
softCapIncrement:
|
|
97
|
-
Number.isInteger(value.softCapIncrement) && value.softCapIncrement > 0 ? value.softCapIncrement : 10,
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function markerDetails(hint: Hint): MarkerDetails {
|
|
102
|
-
return hint.kind === "extended"
|
|
103
|
-
? { used: hint.used, cap: hint.newCap, extended: true }
|
|
104
|
-
: { used: hint.used, cap: hint.cap, extended: false };
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function readMarkerDetails(value: unknown): MarkerDetails | undefined {
|
|
108
|
-
if (!value || typeof value !== "object") return undefined;
|
|
109
|
-
const record = value as Record<string, unknown>;
|
|
110
|
-
const used = record.used;
|
|
111
|
-
const cap = record.cap;
|
|
112
|
-
if (typeof used !== "number" || !Number.isInteger(used) || used < 0) return undefined;
|
|
113
|
-
if (typeof cap !== "number" || !Number.isInteger(cap) || cap < 1) return undefined;
|
|
114
|
-
if (typeof record.extended !== "boolean") return undefined;
|
|
115
|
-
return { used, cap, extended: record.extended };
|
|
116
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Type } from "typebox";
|
|
2
|
-
import { defineTauExtensionSettings } from "../../shared/settings/define.ts";
|
|
3
|
-
|
|
4
|
-
export default defineTauExtensionSettings({
|
|
5
|
-
key: "turnBudget",
|
|
6
|
-
defaults: {
|
|
7
|
-
enabled: true as boolean,
|
|
8
|
-
turnLimit: 30 as number,
|
|
9
|
-
nudgeEveryTurns: 5 as number,
|
|
10
|
-
softCapIncrement: 10 as number,
|
|
11
|
-
},
|
|
12
|
-
schema: Type.Object(
|
|
13
|
-
{
|
|
14
|
-
enabled: Type.Optional(Type.Boolean({ default: true, description: "Enable turn-budget hints." })),
|
|
15
|
-
turnLimit: Type.Optional(
|
|
16
|
-
Type.Integer({
|
|
17
|
-
default: 30,
|
|
18
|
-
minimum: 1,
|
|
19
|
-
description: "Initial soft cap for tool-using turns per user prompt.",
|
|
20
|
-
}),
|
|
21
|
-
),
|
|
22
|
-
nudgeEveryTurns: Type.Optional(
|
|
23
|
-
Type.Integer({
|
|
24
|
-
default: 5,
|
|
25
|
-
minimum: 1,
|
|
26
|
-
description: "Tool-using turn interval between turn-budget hints.",
|
|
27
|
-
}),
|
|
28
|
-
),
|
|
29
|
-
softCapIncrement: Type.Optional(
|
|
30
|
-
Type.Integer({ default: 10, minimum: 1, description: "Turns added when the soft cap is reached." }),
|
|
31
|
-
),
|
|
32
|
-
},
|
|
33
|
-
{ additionalProperties: false },
|
|
34
|
-
),
|
|
35
|
-
});
|