@sebastianandreasson/pi-autonomous-agents 0.2.0 → 0.4.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.
@@ -1,6 +1,6 @@
1
1
  import fs from 'node:fs/promises'
2
2
 
3
- const CSV_HEADER = 'timestamp,iteration,phase,kind,status,transport,session_id,timed_out,exit_code,duration_seconds,commit_before,commit_after,repo_changed,changed_files_count,verification_status,retry_count,notes\n'
3
+ const CSV_HEADER = 'timestamp,iteration,phase,kind,status,transport,session_id,timed_out,exit_code,duration_seconds,commit_before,commit_after,repo_changed,changed_files_count,verification_status,retry_count,role,model,tool_calls,tool_errors,message_updates,stop_reason,loop_detected,loop_signature,tester_verdict,commit_plan_found,terminal_reason,risk_warnings,notes\n'
4
4
 
5
5
  function csvEscape(value) {
6
6
  const text = String(value ?? '')
@@ -11,6 +11,8 @@ export async function ensureTelemetryFiles(config) {
11
11
  await fs.writeFile(config.lastAgentOutputFile, '', 'utf8')
12
12
  await fs.writeFile(config.lastVerificationOutputFile, '', 'utf8')
13
13
  await fs.writeFile(config.changedFilesFile, '', 'utf8')
14
+ await fs.writeFile(config.lastPromptFile, '', 'utf8')
15
+ await fs.writeFile(config.lastIterationSummaryFile, '', 'utf8')
14
16
 
15
17
  await fs.appendFile(config.logFile, '', 'utf8')
16
18
  await fs.appendFile(config.telemetryJsonl, '', 'utf8')
@@ -43,6 +45,18 @@ export async function appendTelemetry(config, event) {
43
45
  event.changedFilesCount,
44
46
  event.verificationStatus,
45
47
  event.retryCount,
48
+ event.role,
49
+ event.model,
50
+ event.toolCalls,
51
+ event.toolErrors,
52
+ event.messageUpdates,
53
+ event.stopReason,
54
+ event.loopDetected,
55
+ event.loopSignature,
56
+ event.testerVerdict,
57
+ event.commitPlanFound,
58
+ event.terminalReason,
59
+ event.riskWarnings,
46
60
  event.notes,
47
61
  ].map(csvEscape).join(',')
48
62
 
@@ -20,6 +20,9 @@ Rules:
20
20
  - Use the configured smoke verification path as the fast inner-loop gate. Do not replace it with a long full-flow Playwright spec unless the task explicitly requires it.
21
21
  - If a long Playwright happy-path spec changes, validate with smoke plus one narrow targeted spec or deterministic state hook, not the entire full-flow run.
22
22
  - Reserve long full-flow Playwright specs for an explicit nightly or post-run lane, not the developer turn.
23
+ - Use `read` for source inspection. Use shell only for `git`, tests, and narrow diagnostics.
24
+ - If a snippet seems incomplete, reread a smaller exact window instead of another huge overlapping shell range.
25
+ - Do not build edits from large `sed`/`grep` output or from memory after partial shell reads.
23
26
  - Trust tool output over your own guesses.
24
27
  - Do not repeatedly reread or rewrite the same file when one focused fix will do.
25
28
  - After one failed edit attempt, reread the file before retrying.
@@ -7,7 +7,7 @@ Your job:
7
7
  - review the developer's change from an independent user-facing perspective
8
8
  - add or improve focused verification where needed
9
9
  - verify actual functionality, not just plausibility
10
- - produce a commit plan when the work is truly ready
10
+ - create the final commit only when the work is truly ready
11
11
 
12
12
  Rules:
13
13
 
@@ -16,6 +16,9 @@ Rules:
16
16
  - Run the configured smoke verification command as the default inner-loop gate.
17
17
  - Do not run long full-flow Playwright happy-path specs in the tester turn unless the task explicitly requires them.
18
18
  - If a long spec changed, validate with smoke plus one narrow targeted spec or deterministic state setup instead of replaying the entire run.
19
+ - Use `read` for source inspection. Use shell only for `git`, tests, and narrow diagnostics.
20
+ - If a snippet seems incomplete, reread a smaller exact window instead of another huge overlapping shell range.
21
+ - Do not build edits from large `sed`/`grep` output or from memory after partial shell reads.
19
22
  - Treat player-facing dead ends, missing affordances, broken progression, console/runtime failures, and unusable UI as real failures.
20
23
  - If the task affects menus, unlocks, progression, classes, routes, shops, onboarding, or gating, verify a fresh-save path.
21
24
  - Do not hide product bugs by weakening tests.
@@ -23,7 +26,7 @@ Rules:
23
26
  - After one failed edit attempt, reread the file before retrying.
24
27
  - Do not repeat the same exact oldText-based edit on the same file.
25
28
  - If visual review is enabled, maintain the screenshot capture flow and manifest expected by the harness.
26
- - If the change passes, do not run `git add` or `git commit` yourself. Provide a commit plan for the harness instead.
29
+ - If the change passes, stage only the related files and create the commit yourself.
27
30
  - If the working tree cannot be isolated safely, return `VERDICT: BLOCKED`.
28
31
 
29
32
  Before stopping:
@@ -31,7 +34,7 @@ Before stopping:
31
34
  - include `Observed flow:`
32
35
  - include `Player-facing result:`
33
36
  - include `Regression check:`
37
+ - if passing, include `COMMIT_CREATED: true`
34
38
  - if passing, include `COMMIT_MESSAGE: ...`
35
- - if passing, include `COMMIT_FILES:`
36
- - if passing, include one `- path/to/file` line per file
39
+ - if passing, include `COMMIT_SHA: ...`
37
40
  - end with exactly one verdict line: `VERDICT: PASS`, `VERDICT: FAIL`, or `VERDICT: BLOCKED`
@@ -4,6 +4,10 @@
4
4
  "taskFile": "TODOS.md",
5
5
  "developerInstructionsFile": "pi/DEVELOPER.md",
6
6
  "testerInstructionsFile": "pi/TESTER.md",
7
+ "commitMode": "agent",
8
+ "promptMode": "compact",
9
+ "largeFileWarningLines": 500,
10
+ "largeSpecWarningLines": 300,
7
11
  "piModel": "local/text-model",
8
12
  "models": {
9
13
  "local/text-model": {
@@ -32,7 +36,6 @@
32
36
  "developerFix": "local/text-model",
33
37
  "developerRetry": "local/text-model",
34
38
  "tester": "local/tester-model",
35
- "testerCommit": "local/tester-model",
36
39
  "visualReview": "local/vision-model"
37
40
  },
38
41
  "testCommand": "pnpm test:e2e:smoke",