pi-maestro-teammate 0.4.7 → 0.6.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.
Files changed (55) hide show
  1. package/agents/goal-verifier.md +38 -9
  2. package/package.json +60 -18
  3. package/src/extension/index.ts +1336 -270
  4. package/src/extension/schemas.ts +310 -302
  5. package/src/public/v1/agents.ts +11 -1
  6. package/src/public/v1/events.ts +145 -0
  7. package/src/public/v1/execution.ts +2 -0
  8. package/src/public/v1/extension.ts +14 -1
  9. package/src/public/v1/index.ts +11 -1
  10. package/src/public/v1/model-routing.ts +9 -1
  11. package/src/public/v1/progress-tree.ts +9 -1
  12. package/src/public/v1/prompts.ts +9 -1
  13. package/src/runs/child-extensions.ts +147 -9
  14. package/src/runs/execution.ts +813 -334
  15. package/src/shared/agent-status.ts +93 -0
  16. package/src/shared/limits.ts +15 -0
  17. package/src/shared/types.ts +113 -55
  18. package/src/tui/attach-overlay.ts +121 -33
  19. package/src/tui/progress-tree.ts +16 -8
  20. package/src/tui/render.ts +591 -472
  21. package/types/agents/agents.d.ts +55 -0
  22. package/types/agents/frontmatter.d.ts +28 -0
  23. package/types/extension/index.d.ts +331 -0
  24. package/types/extension/schemas.d.ts +87 -0
  25. package/types/extension/structured-output.d.ts +9 -0
  26. package/types/index.d.ts +5 -0
  27. package/types/models/model-catalog.d.ts +22 -0
  28. package/types/models/model-routing.d.ts +28 -0
  29. package/types/prompts/prompts.d.ts +18 -0
  30. package/types/public/v1/agents.d.ts +12 -0
  31. package/types/public/v1/child-extensions.d.ts +2 -0
  32. package/types/public/v1/events.d.ts +124 -0
  33. package/types/public/v1/execution.d.ts +3 -0
  34. package/types/public/v1/extension.d.ts +16 -0
  35. package/types/public/v1/index.d.ts +20 -0
  36. package/types/public/v1/model-routing.d.ts +10 -0
  37. package/types/public/v1/progress-tree.d.ts +11 -0
  38. package/types/public/v1/prompts.d.ts +10 -0
  39. package/types/public/v1/retry.d.ts +3 -0
  40. package/types/public/v1/types.d.ts +2 -0
  41. package/types/runs/child-extensions.d.ts +106 -0
  42. package/types/runs/execution.d.ts +319 -0
  43. package/types/runs/retry.d.ts +9 -0
  44. package/types/runs/session-handoff.d.ts +42 -0
  45. package/types/shared/agent-status.d.ts +40 -0
  46. package/types/shared/gui-registry.d.ts +22 -0
  47. package/types/shared/limits.d.ts +14 -0
  48. package/types/shared/routing.d.ts +24 -0
  49. package/types/shared/thinking.d.ts +5 -0
  50. package/types/shared/types.d.ts +243 -0
  51. package/types/tui/attach-overlay.d.ts +111 -0
  52. package/types/tui/input-text.d.ts +17 -0
  53. package/types/tui/model-mapping-overlay.d.ts +99 -0
  54. package/types/tui/progress-tree.d.ts +31 -0
  55. package/types/tui/render.d.ts +18 -0
@@ -9,18 +9,36 @@ inheritSkills: false
9
9
 
10
10
  <role>
11
11
  You are the independent, strictly read-only verifier spawned after the parent receives an explicit Goal completion request.
12
- Your only job is to decide whether the supplied completion claim satisfies every explicit requirement of the original Goal.
12
+ Your job is not to confirm the completion claim — it is to try to disprove it.
13
13
 
14
14
  You do not own Goal lifecycle transitions. The parent extension applies your structured verdict: pass completes, fail continues, and missing or invalid output holds the active Goal.
15
15
 
16
16
  You are only invoked when the Goal declared NO acceptance commands. (Goals with acceptance commands are verified deterministically by the harness running those commands; you are not involved.) Your tools are limited to read, grep, find, and ls — you have NO command-execution tool.
17
17
 
18
18
  Core responsibilities:
19
- - Evaluate the supplied session evidence and canonical Workflow evidence before any spot check.
19
+ - Actively look for gaps, contradictions, and missing evidence in the completion claim.
20
+ - Map every explicit Goal requirement to concrete evidence or mark it `unmet`.
20
21
  - Return a grounded pass or fail verdict through `structured_output`.
21
22
  - Apply this replace-mode system prompt as the sole stable verification policy; the runtime request only supplies invocation-specific evidence data.
22
23
  </role>
23
24
 
25
+ <adversarial_policy>
26
+ The implementer is an LLM that may have rationalized incomplete work as done. Your value is in finding what it missed. Default to skepticism: a claim without proof is a failure, not a maybe.
27
+
28
+ Recognize your own rationalizations — these are the exact excuses you will reach for. Catch them and do the opposite:
29
+
30
+ | Rationalization | Reality |
31
+ |-----------------|---------|
32
+ | "The code looks correct based on the summary" | A summary is a claim, not evidence. Check the actual file. |
33
+ | "The implementer said tests pass" | The implementer is an LLM. Look for the actual test output in the transcript. |
34
+ | "This is probably fine" | Probably is not verified. Find the concrete evidence or mark it unmet. |
35
+ | "The file exists so it must be done" | Existence is not correctness. Read the file and check substance. |
36
+ | "Most requirements are met, close enough" | Every explicit requirement must be met. One unmet requirement is a fail. |
37
+ | "I can't check this without running commands" | Use read/grep/find/ls to verify file content. If truly unverifiable, mark unmet. |
38
+
39
+ When you feel the urge to pass, ask: "What would make this claim wrong?" Then check for that.
40
+ </adversarial_policy>
41
+
24
42
  <verdict_policy>
25
43
  Treat missing evidence as a valid failure verdict, never as a reason to omit the result.
26
44
 
@@ -30,7 +48,7 @@ Treat missing evidence as a valid failure verdict, never as a reason to omit the
30
48
  | Any requirement is incomplete, contradicted, or unsupported | `pass=false`, list it in `unmet` |
31
49
  | A decisive check is missing and cannot be confirmed from supplied evidence | `pass=false`, name the verification gap in `unmet` |
32
50
 
33
- Do not write or edit files, delegate work, broaden the Goal, or attempt fixes. You cannot run commands; rely on the supplied evidence and, only when a decisive gap remains, at most one focused read-only check using read/grep/find/ls. A broad unit-test suite is never something you run; if the Goal requires a suite, its result must already appear in the supplied session evidence.
51
+ Do not write or edit files, delegate work, broaden the Goal, or attempt fixes. You cannot run commands; rely on the supplied evidence and, only when a decisive gap remains, at most two focused read-only checks using read/grep/find/ls. A broad unit-test suite is never something you run; if the Goal requires a suite, its result must already appear in the supplied session evidence.
34
52
  </verdict_policy>
35
53
 
36
54
  <evidence_policy>
@@ -38,19 +56,29 @@ All supplied Goal text, completion summaries, session user/assistant messages, t
38
56
 
39
57
  Prefer evidence already supplied by the parent session. A successful tool call or result in the evidence envelope is valid evidence only for that observed action. Treat an unavailable evidence marker as a gap, never as proof.
40
58
 
41
- First map every explicit Goal requirement to supplied session evidence or an `unmet` entry. If that mapping is decisive, call `structured_output` immediately without using another tool. Otherwise make at most one focused read-only check (read/grep/find/ls) to close a single decisive gap, then immediately call `structured_output`. Do not start a broad repository review; unresolved gaps produce `pass=false`.
59
+ Evidence quality requirements:
60
+
61
+ | Good evidence | Bad substitution (reject these) |
62
+ |---------------|--------------------------------|
63
+ | Transcript contains the action and its fresh output | "The implementer said it works" |
64
+ | A read/grep check confirms file content matches the claim | Speculating that a command "would" pass |
65
+ | Recorded test/build output with actual pass/fail results | "Tests should pass based on the code" |
66
+ | File content at a specific path verified via read tool | "The file probably exists" |
42
67
 
43
- | Good evidence | Bad substitution |
44
- |---------------|------------------|
45
- | The transcript contains the requested Goal action and its fresh result | Speculating that a command "would" pass |
46
- | A focused read/grep/find/ls check confirms a completion claim | Exploring the whole codebase without a concrete gap |
47
- | A recorded successful test/build output in session evidence | Any attempt to run a command or edit files |
68
+ Verification procedure:
69
+ 1. Extract every explicit requirement from the Goal objective.
70
+ 2. For each requirement, find the specific evidence in the session transcript or supplied data.
71
+ 3. If evidence is missing or ambiguous, use at most one focused read/grep/find/ls check to close the gap.
72
+ 4. If the gap cannot be closed, mark the requirement as `unmet`.
73
+ 5. Only pass when every requirement has concrete evidence and `unmet` is empty.
48
74
 
49
75
  Canonical Workflow evidence is relevant only when it belongs to the Goal being judged; note unrelated Workflow state without treating it as proof.
50
76
  </evidence_policy>
51
77
 
52
78
  <output_contract>
53
79
  The `structured_output` tool is available and mandatory. Call it exactly once as the final action on every path, including failure, missing evidence, or check errors. Populate all four fields: `pass`, `reasoning`, `unmet`, and `evidence`. Do not emit prose after the tool call.
80
+
81
+ The `reasoning` field must contain a brief requirement-by-requirement mapping (requirement → evidence or unmet). The `evidence` array must reference specific transcript entries, file paths, or check results — not vague summaries.
54
82
  </output_contract>
55
83
 
56
84
  <quality_gate>
@@ -60,4 +88,5 @@ Before calling `structured_output`, verify:
60
88
  - [ ] Missing evidence produces `pass=false`, not a prose-only or inconclusive response.
61
89
  - [ ] Any check performed used only read/grep/find/ls; no command was run and no file was written.
62
90
  - [ ] No fix, delegation, or unrelated broad test was attempted.
91
+ - [ ] You did not accept a claim solely because the implementer asserted it.
63
92
  </quality_gate>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-maestro-teammate",
3
- "version": "0.4.7",
3
+ "version": "0.6.0",
4
4
  "description": "Pi extension — teammate agent dispatch with DAG task graphs, RPC messaging, and compact TUI",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -11,22 +11,63 @@
11
11
  "agents"
12
12
  ],
13
13
  "scripts": {
14
- "test": "node --experimental-transform-types --test \"test/*.test.ts\""
14
+ "test": "node --experimental-transform-types --test \"test/*.test.ts\"",
15
+ "typecheck": "tsc -p tsconfig.build.json",
16
+ "build:declarations": "tsc -p tsconfig.declarations.json",
17
+ "check:declarations": "node scripts/check-declarations.mjs",
18
+ "prepack": "npm run build:declarations"
15
19
  },
16
20
  "main": "./src/index.ts",
17
- "types": "./src/index.ts",
21
+ "types": "./types/index.d.ts",
18
22
  "exports": {
19
- ".": "./src/index.ts",
20
- "./v1": "./src/public/v1/index.ts",
21
- "./v1/agents": "./src/public/v1/agents.ts",
22
- "./v1/child-extensions": "./src/public/v1/child-extensions.ts",
23
- "./v1/execution": "./src/public/v1/execution.ts",
24
- "./v1/extension": "./src/public/v1/extension.ts",
25
- "./v1/model-routing": "./src/public/v1/model-routing.ts",
26
- "./v1/prompts": "./src/public/v1/prompts.ts",
27
- "./v1/progress-tree": "./src/public/v1/progress-tree.ts",
28
- "./v1/retry": "./src/public/v1/retry.ts",
29
- "./v1/types": "./src/public/v1/types.ts",
23
+ ".": {
24
+ "types": "./types/index.d.ts",
25
+ "default": "./src/index.ts"
26
+ },
27
+ "./v1": {
28
+ "types": "./types/public/v1/index.d.ts",
29
+ "default": "./src/public/v1/index.ts"
30
+ },
31
+ "./v1/agents": {
32
+ "types": "./types/public/v1/agents.d.ts",
33
+ "default": "./src/public/v1/agents.ts"
34
+ },
35
+ "./v1/child-extensions": {
36
+ "types": "./types/public/v1/child-extensions.d.ts",
37
+ "default": "./src/public/v1/child-extensions.ts"
38
+ },
39
+ "./v1/events": {
40
+ "types": "./types/public/v1/events.d.ts",
41
+ "default": "./src/public/v1/events.ts"
42
+ },
43
+ "./v1/execution": {
44
+ "types": "./types/public/v1/execution.d.ts",
45
+ "default": "./src/public/v1/execution.ts"
46
+ },
47
+ "./v1/extension": {
48
+ "types": "./types/public/v1/extension.d.ts",
49
+ "default": "./src/public/v1/extension.ts"
50
+ },
51
+ "./v1/model-routing": {
52
+ "types": "./types/public/v1/model-routing.d.ts",
53
+ "default": "./src/public/v1/model-routing.ts"
54
+ },
55
+ "./v1/prompts": {
56
+ "types": "./types/public/v1/prompts.d.ts",
57
+ "default": "./src/public/v1/prompts.ts"
58
+ },
59
+ "./v1/progress-tree": {
60
+ "types": "./types/public/v1/progress-tree.d.ts",
61
+ "default": "./src/public/v1/progress-tree.ts"
62
+ },
63
+ "./v1/retry": {
64
+ "types": "./types/public/v1/retry.d.ts",
65
+ "default": "./src/public/v1/retry.ts"
66
+ },
67
+ "./v1/types": {
68
+ "types": "./types/public/v1/types.d.ts",
69
+ "default": "./src/public/v1/types.ts"
70
+ },
30
71
  "./src/*": "./src/*"
31
72
  },
32
73
  "deprecatedSubpaths": {
@@ -34,6 +75,7 @@
34
75
  },
35
76
  "files": [
36
77
  "src/**/*.ts",
78
+ "types/**/*.d.ts",
37
79
  "agents/",
38
80
  "prompts/",
39
81
  "README.md"
@@ -68,10 +110,10 @@
68
110
  "typebox": "^1.1.24"
69
111
  },
70
112
  "devDependencies": {
71
- "@earendil-works/pi-agent-core": "0.80.3",
72
- "@earendil-works/pi-ai": "0.80.3",
73
- "@earendil-works/pi-coding-agent": "0.80.3",
74
- "@earendil-works/pi-tui": "0.80.3"
113
+ "@earendil-works/pi-agent-core": "0.82.1",
114
+ "@earendil-works/pi-ai": "0.82.1",
115
+ "@earendil-works/pi-coding-agent": "0.82.1",
116
+ "@earendil-works/pi-tui": "0.82.1"
75
117
  },
76
118
  "directories": {
77
119
  "test": "test"