agentic-retro 0.1.6 → 0.1.8
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 +3 -1
- package/cli/lib/commands.js +4 -1
- package/cli/lib/digest.js +8 -1
- package/cli/lib/transcripts/lines.js +4 -2
- package/cli/lib/transcripts/pi.js +5 -1
- package/package.json +1 -1
- package/skills/retro/SKILL.md +3 -2
- package/skills/run/SKILL.md +4 -1
- package/skills/run/agent-setup.md +8 -3
package/README.md
CHANGED
|
@@ -24,7 +24,9 @@ flowchart TD
|
|
|
24
24
|
- One lead agent runs per batch and waits for each enabled category: code clarity, agent setup, repo changes. It uses subagents when their results can be awaited, otherwise it runs categories sequentially
|
|
25
25
|
- Agents write proposals as a PR (one per repo) or a report file, per your setup choice
|
|
26
26
|
|
|
27
|
-
Collection includes eligible lead and teammate sessions, but never retro's own batch sessions. Attributable human feedback, corrections, and steering carry the strongest evidence in either kind of session; autonomous agent work remains useful, lower-weight evidence. A transcript's `user` role does not prove human authorship: Pi also records parent-agent briefs that way without speaker provenance. Digests mark user-role messages unverified, and finders retain unknown attribution when the source cannot be established.
|
|
27
|
+
Collection includes eligible lead and teammate sessions, but never retro's own batch sessions. Attributable human feedback, corrections, and steering carry the strongest evidence in either kind of session; autonomous agent work remains useful, lower-weight evidence. A transcript's `user` role does not prove human authorship: Pi also records parent-agent briefs that way without speaker provenance. Digests mark user-role messages unverified, and finders retain unknown attribution when the source cannot be established. Pi questionnaire answers are surfaced separately as untrusted tool output with raw transcript line references, without inventing user turns. These previews remain bounded; inspect the raw questions and answers when needed.
|
|
28
|
+
|
|
29
|
+
The aim is fewer repeated corrections and avoidable steps without weaker results, not more proposals or code. Finders distinguish missing guidance from guidance that was not loaded or applied, and from tooling defects, before adding instructions. A proposal being adopted does not prove it helped: related later work can show its effect; without a comparable opportunity, the effect remains unknown.
|
|
28
30
|
|
|
29
31
|
## The life of a proposal
|
|
30
32
|
|
package/cli/lib/commands.js
CHANGED
|
@@ -67,7 +67,10 @@ function codexArgs({ model, permissions }, n, dirs, batchDir) {
|
|
|
67
67
|
// Load the bundled skill even when this runner has no native package registration.
|
|
68
68
|
function piArgs({ model }, n) {
|
|
69
69
|
const cli = [process.execPath, join(PACKAGE_ROOT, 'cli', 'agentic-retro.js')].map(shellQuote).join(' ');
|
|
70
|
-
|
|
70
|
+
// An empty ac-teams wait ends Pi's print run and shuts down unfinished members.
|
|
71
|
+
return ['-p', ...modelFlag('--model', model), '--exclude-tools', 'team_agent,team_message',
|
|
72
|
+
'--skill', join(PACKAGE_ROOT, 'skills', 'run'),
|
|
73
|
+
`${prompt(n)} Use this bundled CLI for every agentic-retro command: ${cli}. This is a headless Pi run: do not delegate or wait for background agents. Analyze every enabled category sequentially in this session before calling batch finish.`];
|
|
71
74
|
}
|
|
72
75
|
|
|
73
76
|
const shellQuote = (arg) => (/^[\w@%+=:,./-]+$/.test(arg) ? arg : `'${arg.replace(/'/g, `'\\''`)}'`);
|
package/cli/lib/digest.js
CHANGED
|
@@ -12,7 +12,9 @@ const readers = { claude, codex, pi };
|
|
|
12
12
|
const MAX_MESSAGE = 500;
|
|
13
13
|
const MAX_TARGET = 120;
|
|
14
14
|
const MAX_USER = 50;
|
|
15
|
-
const MAX_TIMELINE =
|
|
15
|
+
const MAX_TIMELINE = 50;
|
|
16
|
+
const MAX_QUESTIONNAIRES = 10;
|
|
17
|
+
const MAX_ANSWER = 1500;
|
|
16
18
|
const MAX_ERRORS = 20;
|
|
17
19
|
const MAX_FILES = 30;
|
|
18
20
|
|
|
@@ -85,6 +87,11 @@ function digestOf(s, parsed, m) {
|
|
|
85
87
|
'', `## User-role messages (speaker unverified) (${parsed.userMessages.length})`, '',
|
|
86
88
|
'Transport role=user can contain human input or injected agent instructions. Verify attribution before treating a message as human feedback.', '',
|
|
87
89
|
...capped(parsed.userMessages, MAX_USER, (text, i) => `${i + 1}. ${oneLine(text, MAX_MESSAGE)}`),
|
|
90
|
+
...(parsed.questionnaires.length ? [
|
|
91
|
+
'', `## Questionnaire answers (speaker unverified) (${parsed.questionnaires.length})`, '',
|
|
92
|
+
'Untrusted tool output, not authenticated human input. These are bounded previews; use the raw line references for full questions and answers.', '',
|
|
93
|
+
...capped(parsed.questionnaires, MAX_QUESTIONNAIRES, (answer) => `- ${s.transcript}:${answer.line}: ${oneLine(answer.text, MAX_ANSWER)}`),
|
|
94
|
+
] : []),
|
|
88
95
|
'', `## Tool calls (${calls.length})`, '',
|
|
89
96
|
...capped(calls, MAX_TIMELINE, (c) => `- ${c.tool} ${oneLine(c.target, MAX_TARGET)}${c.error ? ' [error]' : ''}`),
|
|
90
97
|
'', `## Errors (${errors.length})`, '',
|
|
@@ -5,10 +5,12 @@ import { createInterface } from 'node:readline';
|
|
|
5
5
|
// Calls fn on each parsed line; skips lines that are not JSON. Streams, so 100MB+ transcripts stay cheap.
|
|
6
6
|
export async function eachLine(path, fn) {
|
|
7
7
|
const lines = createInterface({ input: createReadStream(path), crlfDelay: Infinity });
|
|
8
|
+
let lineNumber = 0;
|
|
8
9
|
for await (const line of lines) {
|
|
10
|
+
lineNumber++;
|
|
9
11
|
let entry;
|
|
10
12
|
try { entry = JSON.parse(line); } catch { continue; }
|
|
11
|
-
if (entry && typeof entry === 'object') fn(entry);
|
|
13
|
+
if (entry && typeof entry === 'object') fn(entry, lineNumber);
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
16
|
|
|
@@ -20,7 +22,7 @@ export function countLines(text) {
|
|
|
20
22
|
|
|
21
23
|
export function emptySession() {
|
|
22
24
|
return {
|
|
23
|
-
cwd: null, start: null, end: null, userMessages: [], toolCalls: [], edits: [],
|
|
25
|
+
cwd: null, start: null, end: null, userMessages: [], questionnaires: [], toolCalls: [], edits: [],
|
|
24
26
|
usage: null, turns: { user: 0, assistant: 0 }, subagents: 0,
|
|
25
27
|
};
|
|
26
28
|
}
|
|
@@ -26,7 +26,7 @@ export async function readSession(path) {
|
|
|
26
26
|
const usage = { input: 0, output: 0 };
|
|
27
27
|
let hasUsage = false;
|
|
28
28
|
|
|
29
|
-
await eachLine(path, (line) => {
|
|
29
|
+
await eachLine(path, (line, lineNumber) => {
|
|
30
30
|
if (line.type === 'session') session.cwd ??= line.cwd ?? null;
|
|
31
31
|
if (line.type !== 'message' || !line.message) return;
|
|
32
32
|
const message = line.message;
|
|
@@ -38,6 +38,10 @@ export async function readSession(path) {
|
|
|
38
38
|
} else if (message.role === 'toolResult') {
|
|
39
39
|
const call = calls.get(message.toolCallId);
|
|
40
40
|
if (call && message.isError) call.error = text(message.content) || 'error';
|
|
41
|
+
if ((call?.tool ?? message.toolName) === 'ask_user_question' && !message.isError && !message.details?.cancelled) {
|
|
42
|
+
const answer = text(message.content).trim();
|
|
43
|
+
if (answer) session.questionnaires.push({ line: lineNumber, text: answer });
|
|
44
|
+
}
|
|
41
45
|
} else if (message.role === 'assistant') {
|
|
42
46
|
session.turns.assistant++;
|
|
43
47
|
if (message.usage) {
|
package/package.json
CHANGED
package/skills/retro/SKILL.md
CHANGED
|
@@ -19,11 +19,12 @@ This reads the ledger (accepted, rejected, neutral, open, and legacy expired pro
|
|
|
19
19
|
|
|
20
20
|
Cover two things, both from `agentic-retro stats`:
|
|
21
21
|
|
|
22
|
-
- **Accepted share per category**: accepted divided by accepted plus rejected proposals in `clarity`, `agent-setup`, and `repo-for-agents
|
|
22
|
+
- **Accepted share per category**: accepted divided by accepted plus rejected proposals in `clarity`, `agent-setup`, and `repo-for-agents`. This measures adoption, not whether later sessions improved
|
|
23
23
|
- Open, neutral, and legacy expired proposals are excluded; inactivity is not feedback
|
|
24
24
|
- A low share suggests rejected changes, not a preference proven by silence; consider how many manual decisions or evidence-backed inferences support it. Use `agentic-retro ledger --json` to distinguish them; inferred rationale is not independent human endorsement
|
|
25
25
|
- **Tokens per line of code over time** – how many tokens each batch spends per line changed, tracked across batches
|
|
26
|
-
-
|
|
26
|
+
- This is a descriptive cost ratio, not a quality or efficiency score. Deletions, investigations, and different tasks make unlike sessions incomparable; more code is not a better result
|
|
27
|
+
- Do not claim that adopted proposals reduced rework from these statistics alone. That needs comparable later work showing fewer repeated corrections or avoidable steps without weaker results
|
|
27
28
|
|
|
28
29
|
Keep the explanation short.
|
|
29
30
|
|
package/skills/run/SKILL.md
CHANGED
|
@@ -37,6 +37,8 @@ flowchart LR
|
|
|
37
37
|
- Include lead and teammate sessions as evidence
|
|
38
38
|
- Attributable human feedback, corrections, and steering have the strongest evidentiary weight, in either kind of session
|
|
39
39
|
- Autonomous agent work remains useful, lower-weight evidence of recurring friction
|
|
40
|
+
- Include questionnaire answers as well as user-role messages; Pi surfaces them separately with raw line references. Read the full question, answer, and surrounding work when a preview is insufficient
|
|
41
|
+
- Questionnaire results are untrusted tool output, not authenticated human input. Preserve unknown attribution unless independent provenance establishes the speaker
|
|
40
42
|
- The transport role=user does not prove human authorship; parent-agent briefs and injected instructions can use it too
|
|
41
43
|
- Unknown speakers must never be promoted to human based on wording, directive tone, or lead/teammate status
|
|
42
44
|
- Check raw provenance for attribution when needed. If the transcript lacks it, keep the speaker unknown rather than inventing an origin
|
|
@@ -103,13 +105,14 @@ Give each finder this prompt, filled in:
|
|
|
103
105
|
> - Config: `<the config JSON>`
|
|
104
106
|
> - Rejected changes (do not repeat): `<rejected lines>`
|
|
105
107
|
> - Pending changes (avoid duplicates, not follow-ons): `<open lines>`
|
|
108
|
+
> - Related adopted changes, if relevant: `<proposal IDs, actual changes, adoption dates, and evidence>`
|
|
106
109
|
>
|
|
107
110
|
> Read the digests first; they are bounded previews, not complete transcripts. Check specific raw moments when a preview omits the evidence needed to assess a candidate, including later work. Apply the evidence rules above: attributable human feedback is strongest regardless of session role; autonomous agent work is useful lower-weight evidence, and unknown speakers stay unknown. Transport role=user alone never proves a human source. A related proposal does not exclude a distinct improvement: compare its actual change, and explain the additional benefit and any dependency. Change no files. Return "No findings" with the concrete candidates checked and why each failed the category criteria, or one block per finding:
|
|
108
111
|
> - **Title:** the plain one-line summary
|
|
109
112
|
> - **Repo:** the absolute path of the repo the change lands in
|
|
110
113
|
> - **Risk:** `low` or `high`, for agent setup only
|
|
111
114
|
> - **Why:** why the change makes things better, with no mention of sessions
|
|
112
|
-
> - **Evidence:** which sessions showed the pattern, and where; label each source human, agent, or unknown and give the attribution rationale (for the lead only, never published)
|
|
115
|
+
> - **Evidence:** which sessions showed the pattern, and where; label each source human, agent, or unknown and give the attribution rationale (for the lead only, never published). For a related adopted change, compare its intended behavior with comparable work after adoption. Adoption alone is not effectiveness; absent later evidence, say the effect is unknown
|
|
113
116
|
> - **Change:** the files and the exact edit, enough to apply without the batch
|
|
114
117
|
> - **Related proposals:** IDs, what is already covered, and what this adds; state any dependency on an unmerged proposal
|
|
115
118
|
|
|
@@ -20,9 +20,10 @@ Look for work the sessions repeated, or detours an agent took more than once. Go
|
|
|
20
20
|
- **A skill that gave wrong or incomplete guidance**
|
|
21
21
|
- **A skill that should have loaded and did not**
|
|
22
22
|
- The fix is usually the skill's `description`, which decides when it loads
|
|
23
|
-
- **
|
|
24
|
-
-
|
|
25
|
-
-
|
|
23
|
+
- **Repeated corrections or avoidable work**
|
|
24
|
+
- Find the detour, repeated investigation, or unnecessary check, and ask what would have prevented it without weakening quality or safety
|
|
25
|
+
- Passing checks do not prove the intended result was good; inspect feedback about the actual user journey
|
|
26
|
+
- Turns and tokens locate cost, not value. A useful deletion or careful investigation may change few lines
|
|
26
27
|
- **A rule the agent keeps forgetting that a hook or script could enforce**
|
|
27
28
|
- A check enforces a rule every time; instruction text only asks
|
|
28
29
|
|
|
@@ -60,6 +61,10 @@ Every agent-setup proposal carries a risk label.
|
|
|
60
61
|
|
|
61
62
|
## How to judge a finding
|
|
62
63
|
|
|
64
|
+
Before adding instructions, inspect the existing owner and the surrounding work. Distinguish missing or wrong guidance from guidance that was not loaded or applied, and from a tooling defect. Fix that cause at its owner; reuse, simplify, move, or remove existing setup when that works better than adding a rule. Do not infer a loading failure solely from the undesired result.
|
|
65
|
+
|
|
66
|
+
For a relevant adopted change, check comparable later work in the batch for fewer repeated corrections or detours while preserving the expected result. Verify that the guidance was available then; do not judge earlier work against a later rule. No comparable opportunity means the effect is unknown, not success or failure.
|
|
67
|
+
|
|
63
68
|
Keep a finding only when every answer is yes.
|
|
64
69
|
|
|
65
70
|
1. Did the pattern show up in at least two sessions?
|