@sreetej510/pi-shipd-checks 0.1.1 → 0.1.2

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/src/tools.ts DELETED
@@ -1,140 +0,0 @@
1
- /**
2
- * Custom tools the review/gap agents call to submit their structured results.
3
- * Each tool just writes into a `capture` object passed in by the caller —
4
- * that's how agents.ts pulls the final result back out of the agent session.
5
- */
6
-
7
- import type { ToolDefinition } from "@earendil-works/pi-coding-agent";
8
- import { Type } from "typebox";
9
- import type { ReviewReport, TestGapCandidate, TestGapFinal } from "./types.js";
10
-
11
- export const REPORT_TOOL_NAME = "submit_review_report";
12
- export const GAP_FINDER_TOOL_NAME = "submit_test_gap_candidates";
13
- export const GAP_VALIDATOR_TOOL_NAME = "submit_filtered_test_gaps";
14
-
15
- // ── Reviewer report tool ─────────────────────────────────────────────
16
-
17
- const reportToolParams = Type.Object({
18
- verdict: Type.Union([Type.Literal("PASS"), Type.Literal("FAIL")], {
19
- description:
20
- "FAIL only for a genuine blocking issue (clear rubric violation, agent-fault-worthy gap, unfair/undiscoverable " +
21
- "test requirement, or a real determinism/regression risk). Optional, minor, or stylistic points are NOT grounds " +
22
- "for FAIL — put those in `notes` instead and use PASS.",
23
- }),
24
- summary: Type.String({ description: "One short sentence summarizing the verdict." }),
25
- reasons: Type.Array(Type.String(), {
26
- description:
27
- "Specific BLOCKING justifications only, citing rubric item IDs and concrete evidence from the files you read. " +
28
- "Required (non-empty) when verdict is FAIL. Use an empty array when verdict is PASS.",
29
- }),
30
- notes: Type.Array(Type.String(), {
31
- description:
32
- "Non-blocking, optional/minor observations or suggested improvements — the kind of feedback a real reviewer " +
33
- "leaves as 'Minor/optional' without failing the task. Include these regardless of verdict; use an empty array " +
34
- "if you truly have none.",
35
- }),
36
- });
37
-
38
- export function createReportTool(capture: { report?: ReviewReport }): ToolDefinition<typeof reportToolParams> {
39
- return {
40
- name: REPORT_TOOL_NAME,
41
- label: "Submit Review Report",
42
- description:
43
- "Submit your final verdict for this review. This is the ONLY way to report your result — " +
44
- "call it exactly once, as your last action, after you have finished reading and analyzing the relevant files. " +
45
- "Do not write a plain-text final answer instead of calling this tool.",
46
- parameters: reportToolParams,
47
- async execute(_toolCallId, params) {
48
- capture.report = {
49
- verdict: params.verdict,
50
- summary: params.summary,
51
- reasons: params.reasons ?? [],
52
- notes: params.notes ?? [],
53
- };
54
- return {
55
- content: [{ type: "text", text: `Report recorded: ${params.verdict}` }],
56
- details: undefined,
57
- };
58
- },
59
- };
60
- }
61
-
62
- // ── Test-gap finder / filter tools ────────────────────────────────────
63
-
64
- const gapFinderToolParams = Type.Object({
65
- gaps: Type.Array(
66
- Type.Object({
67
- description: Type.String({ description: "The specific untested behavior or edge case, in plain terms." }),
68
- risk: Type.String({
69
- description:
70
- "Concretely why a plausible-but-incorrect implementation could still pass every test in test.patch " +
71
- "despite missing or misimplementing this behavior.",
72
- }),
73
- }),
74
- {
75
- description:
76
- "Candidate behavioral test gaps grounded in agent_prompt.md or clear existing repo behavior. Use an empty " +
77
- "array if you found none — do not manufacture gaps just to report something.",
78
- },
79
- ),
80
- });
81
-
82
- export function createGapFinderTool(capture: {
83
- gaps?: TestGapCandidate[];
84
- }): ToolDefinition<typeof gapFinderToolParams> {
85
- return {
86
- name: GAP_FINDER_TOOL_NAME,
87
- label: "Submit Candidate Test Gaps",
88
- description:
89
- "Submit your candidate list of behavioral test gaps. This is the ONLY way to report your result — call it " +
90
- "exactly once, as your last action, after you have finished reading and analyzing the relevant files.",
91
- parameters: gapFinderToolParams,
92
- async execute(_toolCallId, params) {
93
- const gaps = params.gaps ?? [];
94
- capture.gaps = gaps;
95
- return {
96
- content: [{ type: "text", text: `Recorded ${gaps.length} candidate gap(s)` }],
97
- details: undefined,
98
- };
99
- },
100
- };
101
- }
102
-
103
- const gapValidatorToolParams = Type.Object({
104
- gaps: Type.Array(
105
- Type.Object({
106
- description: Type.String({ description: "The confirmed, real, fair test gap (may be reworded for clarity)." }),
107
- justification: Type.String({
108
- description:
109
- "Why this is genuinely grounded in agent_prompt.md or the repo, fair to test per the fairness " +
110
- "methodology, and a real (non-duplicate) coverage hole in test.patch.",
111
- }),
112
- }),
113
- {
114
- description:
115
- "The filtered, final list of confirmed test gaps. Use an empty array if none of the candidates survive " +
116
- "strict scrutiny.",
117
- },
118
- ),
119
- });
120
-
121
- export function createGapValidatorTool(capture: {
122
- gaps?: TestGapFinal[];
123
- }): ToolDefinition<typeof gapValidatorToolParams> {
124
- return {
125
- name: GAP_VALIDATOR_TOOL_NAME,
126
- label: "Submit Filtered Test Gaps",
127
- description:
128
- "Submit your final, strictly filtered list of confirmed test gaps. This is the ONLY way to report your " +
129
- "result — call it exactly once, as your last action, after you have independently verified each candidate.",
130
- parameters: gapValidatorToolParams,
131
- async execute(_toolCallId, params) {
132
- const gaps = params.gaps ?? [];
133
- capture.gaps = gaps;
134
- return {
135
- content: [{ type: "text", text: `Confirmed ${gaps.length} gap(s) after filtering` }],
136
- details: undefined,
137
- };
138
- },
139
- };
140
- }
package/src/types.ts DELETED
@@ -1,56 +0,0 @@
1
- /**
2
- * Shared types for the shipd-checks extension. Kept dependency-free (no
3
- * imports from pi/typebox) so every other module can import from here
4
- * without pulling in extra runtime surface.
5
- */
6
-
7
- export type ThinkingLevel = "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "off";
8
-
9
- export type Verdict = "PASS" | "FAIL";
10
-
11
- export interface ChecksConfig {
12
- provider: string;
13
- modelId: string;
14
- thinkingLevel: ThinkingLevel;
15
- }
16
-
17
- export interface ReviewReport {
18
- verdict: Verdict;
19
- summary: string;
20
- /** Blocking justifications. Required (non-empty) when verdict is FAIL, empty when PASS. */
21
- reasons: string[];
22
- /** Non-blocking, optional/minor suggestions — present regardless of verdict. */
23
- notes: string[];
24
- }
25
-
26
- /** A candidate behavioral test gap proposed by the (unfiltered) gap-finder researcher agent. */
27
- export interface TestGapCandidate {
28
- description: string;
29
- risk: string;
30
- }
31
-
32
- /** A gap that survived the strict fairness-filter agent — goes into the final report. */
33
- export interface TestGapFinal {
34
- description: string;
35
- justification: string;
36
- }
37
-
38
- export type ReviewerRoleKey = "description" | "tests" | "solution";
39
-
40
- export interface ReviewerRole {
41
- key: ReviewerRoleKey;
42
- label: string;
43
- rubricHeading: RegExp;
44
- }
45
-
46
- /** `ok` means the agent actually finished and submitted (possibly an empty list on purpose). */
47
- export interface GapStageResult<T> {
48
- status: "ok" | "timedOut" | "cancelled" | "error" | "noSubmission";
49
- gaps: T[];
50
- }
51
-
52
- export interface CommandOption {
53
- value: string;
54
- label: string;
55
- description: string;
56
- }