tryassay 0.1.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/LICENSE +21 -0
- package/README.md +553 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +80 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/assess.d.ts +6 -0
- package/dist/commands/assess.js +267 -0
- package/dist/commands/assess.js.map +1 -0
- package/dist/commands/describe.d.ts +3 -0
- package/dist/commands/describe.js +114 -0
- package/dist/commands/describe.js.map +1 -0
- package/dist/commands/extract.d.ts +4 -0
- package/dist/commands/extract.js +144 -0
- package/dist/commands/extract.js.map +1 -0
- package/dist/commands/hallucinate.d.ts +3 -0
- package/dist/commands/hallucinate.js +100 -0
- package/dist/commands/hallucinate.js.map +1 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +39 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/regenerate.d.ts +3 -0
- package/dist/commands/regenerate.js +158 -0
- package/dist/commands/regenerate.js.map +1 -0
- package/dist/commands/remediate.d.ts +5 -0
- package/dist/commands/remediate.js +155 -0
- package/dist/commands/remediate.js.map +1 -0
- package/dist/commands/report.d.ts +3 -0
- package/dist/commands/report.js +84 -0
- package/dist/commands/report.js.map +1 -0
- package/dist/commands/reverse.d.ts +9 -0
- package/dist/commands/reverse.js +115 -0
- package/dist/commands/reverse.js.map +1 -0
- package/dist/commands/verify.d.ts +4 -0
- package/dist/commands/verify.js +112 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/lib/anthropic.d.ts +13 -0
- package/dist/lib/anthropic.js +60 -0
- package/dist/lib/anthropic.js.map +1 -0
- package/dist/lib/assessment-reporter.d.ts +5 -0
- package/dist/lib/assessment-reporter.js +266 -0
- package/dist/lib/assessment-reporter.js.map +1 -0
- package/dist/lib/claim-extractor.d.ts +6 -0
- package/dist/lib/claim-extractor.js +138 -0
- package/dist/lib/claim-extractor.js.map +1 -0
- package/dist/lib/code-verifier.d.ts +7 -0
- package/dist/lib/code-verifier.js +265 -0
- package/dist/lib/code-verifier.js.map +1 -0
- package/dist/lib/codebase-indexer.d.ts +15 -0
- package/dist/lib/codebase-indexer.js +156 -0
- package/dist/lib/codebase-indexer.js.map +1 -0
- package/dist/lib/config.d.ts +7 -0
- package/dist/lib/config.js +38 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/constraint-engine.d.ts +2 -0
- package/dist/lib/constraint-engine.js +337 -0
- package/dist/lib/constraint-engine.js.map +1 -0
- package/dist/lib/fs-utils.d.ts +1 -0
- package/dist/lib/fs-utils.js +11 -0
- package/dist/lib/fs-utils.js.map +1 -0
- package/dist/lib/guided-generator.d.ts +2 -0
- package/dist/lib/guided-generator.js +195 -0
- package/dist/lib/guided-generator.js.map +1 -0
- package/dist/lib/inventory-extractor.d.ts +7 -0
- package/dist/lib/inventory-extractor.js +238 -0
- package/dist/lib/inventory-extractor.js.map +1 -0
- package/dist/lib/prompts.d.ts +3 -0
- package/dist/lib/prompts.js +50 -0
- package/dist/lib/prompts.js.map +1 -0
- package/dist/lib/publisher.d.ts +2 -0
- package/dist/lib/publisher.js +71 -0
- package/dist/lib/publisher.js.map +1 -0
- package/dist/lib/remediation-generator.d.ts +2 -0
- package/dist/lib/remediation-generator.js +136 -0
- package/dist/lib/remediation-generator.js.map +1 -0
- package/dist/lib/remediator.d.ts +7 -0
- package/dist/lib/remediator.js +209 -0
- package/dist/lib/remediator.js.map +1 -0
- package/dist/lib/report-generator.d.ts +8 -0
- package/dist/lib/report-generator.js +190 -0
- package/dist/lib/report-generator.js.map +1 -0
- package/dist/lib/requirements-generator.d.ts +14 -0
- package/dist/lib/requirements-generator.js +311 -0
- package/dist/lib/requirements-generator.js.map +1 -0
- package/dist/lib/spec-synthesizer.d.ts +2 -0
- package/dist/lib/spec-synthesizer.js +136 -0
- package/dist/lib/spec-synthesizer.js.map +1 -0
- package/dist/lib/system-prompts.d.ts +12 -0
- package/dist/lib/system-prompts.js +254 -0
- package/dist/lib/system-prompts.js.map +1 -0
- package/dist/types.d.ts +243 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
export function getSystemPrompt(type, config) {
|
|
2
|
+
switch (type) {
|
|
3
|
+
case 'tos':
|
|
4
|
+
return getTosPrompt(config);
|
|
5
|
+
case 'api-docs':
|
|
6
|
+
return getApiDocsPrompt(config);
|
|
7
|
+
case 'user-manual':
|
|
8
|
+
return getUserManualPrompt(config);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function getUserPrompt(type, config) {
|
|
12
|
+
switch (type) {
|
|
13
|
+
case 'tos':
|
|
14
|
+
return `Write the complete Terms of Service for ${config.projectName}. The application is live in production. Write as if you are the company's legal team publishing this document today.`;
|
|
15
|
+
case 'api-docs':
|
|
16
|
+
return `Write the complete API documentation for ${config.projectName}. The API is live in production. Document every endpoint, request/response format, authentication method, rate limit, and error code.`;
|
|
17
|
+
case 'user-manual':
|
|
18
|
+
return `Write the complete user manual for ${config.projectName}. The application is live in production. Document every feature, workflow, setting, and troubleshooting step.`;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function getTosPrompt(config) {
|
|
22
|
+
return `You are the legal team for a technology company. You are writing the Terms of Service for a production application.
|
|
23
|
+
|
|
24
|
+
APPLICATION CONTEXT:
|
|
25
|
+
- Name: ${config.projectName}
|
|
26
|
+
- Description: ${config.description}
|
|
27
|
+
- Tech Stack: ${config.techStack}
|
|
28
|
+
- Target Audience: ${config.targetAudience}
|
|
29
|
+
|
|
30
|
+
CRITICAL INSTRUCTIONS — READ CAREFULLY:
|
|
31
|
+
|
|
32
|
+
You must write as if this application EXISTS and is LIVE in production. Do not hedge. Do not use "may" or "might" when describing capabilities. Use declarative, authoritative language.
|
|
33
|
+
|
|
34
|
+
LANGUAGE RULES:
|
|
35
|
+
- GOOD: "The Service processes up to 10,000 records per batch"
|
|
36
|
+
- BAD: "The Service may process records"
|
|
37
|
+
- GOOD: "User data is encrypted at rest using AES-256"
|
|
38
|
+
- BAD: "We take reasonable measures to protect data"
|
|
39
|
+
- GOOD: "The API rate limit is 1,000 requests per minute per authenticated user"
|
|
40
|
+
- BAD: "We may impose rate limits"
|
|
41
|
+
- GOOD: "Free tier accounts are limited to 5GB of storage"
|
|
42
|
+
- BAD: "Storage limits may apply"
|
|
43
|
+
|
|
44
|
+
SPECIFICITY REQUIREMENTS:
|
|
45
|
+
- Include specific numbers: storage limits, rate limits, response times, retention periods, pricing tiers
|
|
46
|
+
- Name specific technologies: encryption algorithms, cloud providers, compliance frameworks
|
|
47
|
+
- Define specific timeframes: data retention (e.g., "90 days"), support response times (e.g., "24 hours"), account deletion (e.g., "30 days after request")
|
|
48
|
+
- Describe specific features and capabilities in detail
|
|
49
|
+
|
|
50
|
+
MANDATORY SECTIONS (include ALL of these):
|
|
51
|
+
1. Acceptance of Terms
|
|
52
|
+
2. Service Description (detailed feature list — be specific about what the app does)
|
|
53
|
+
3. User Accounts and Registration
|
|
54
|
+
4. Subscription Plans and Pricing (at least 3 tiers with specific limits)
|
|
55
|
+
5. Payment Terms
|
|
56
|
+
6. Acceptable Use Policy
|
|
57
|
+
7. Content and Data Ownership
|
|
58
|
+
8. Data Handling and Privacy
|
|
59
|
+
9. Data Retention and Deletion
|
|
60
|
+
10. Security Measures (name specific technologies)
|
|
61
|
+
11. API Usage and Rate Limits
|
|
62
|
+
12. Service Level Agreement (specific uptime percentage, response times)
|
|
63
|
+
13. Intellectual Property
|
|
64
|
+
14. Third-Party Integrations (name specific services)
|
|
65
|
+
15. Limitation of Liability
|
|
66
|
+
16. Indemnification
|
|
67
|
+
17. Dispute Resolution
|
|
68
|
+
18. Modification of Terms
|
|
69
|
+
19. Termination
|
|
70
|
+
20. Contact Information
|
|
71
|
+
|
|
72
|
+
TARGET OUTPUT:
|
|
73
|
+
- 400-600 lines of dense, specific legal text
|
|
74
|
+
- 80-150 extractable, testable claims
|
|
75
|
+
- Every section should contain at least 3 specific, measurable claims
|
|
76
|
+
|
|
77
|
+
Write the complete Terms of Service now. Do not include any meta-commentary, notes, or explanations outside the document itself.`;
|
|
78
|
+
}
|
|
79
|
+
function getApiDocsPrompt(config) {
|
|
80
|
+
return `You are the API documentation team for a technology company. You are writing comprehensive API documentation for a production application.
|
|
81
|
+
|
|
82
|
+
APPLICATION CONTEXT:
|
|
83
|
+
- Name: ${config.projectName}
|
|
84
|
+
- Description: ${config.description}
|
|
85
|
+
- Tech Stack: ${config.techStack}
|
|
86
|
+
- Target Audience: ${config.targetAudience}
|
|
87
|
+
|
|
88
|
+
CRITICAL INSTRUCTIONS:
|
|
89
|
+
|
|
90
|
+
Write as if this API EXISTS and is LIVE. Document it fully.
|
|
91
|
+
|
|
92
|
+
SPECIFICITY REQUIREMENTS:
|
|
93
|
+
- Every endpoint: method, path, request body, response format, status codes
|
|
94
|
+
- Authentication: exact mechanism (Bearer token, API key, OAuth2 flow)
|
|
95
|
+
- Rate limits: exact numbers per endpoint or tier
|
|
96
|
+
- Request/response examples: full JSON with realistic data
|
|
97
|
+
- Error codes: every possible error with message and resolution
|
|
98
|
+
- Pagination: exact format (cursor, offset, page)
|
|
99
|
+
- Webhooks: every event type, payload format, retry policy
|
|
100
|
+
|
|
101
|
+
MANDATORY SECTIONS:
|
|
102
|
+
1. Authentication and Authorization
|
|
103
|
+
2. Base URL and Versioning
|
|
104
|
+
3. Rate Limiting
|
|
105
|
+
4. Error Handling (standard error format)
|
|
106
|
+
5. Core Resource Endpoints (CRUD for each resource — minimum 4 resources)
|
|
107
|
+
6. Search and Filtering
|
|
108
|
+
7. Pagination
|
|
109
|
+
8. Webhooks
|
|
110
|
+
9. SDKs and Client Libraries
|
|
111
|
+
10. Changelog
|
|
112
|
+
|
|
113
|
+
Include code examples (curl, JavaScript, Python) for key endpoints.
|
|
114
|
+
Write 400-600 lines of dense, specific API documentation.
|
|
115
|
+
Do not include any meta-commentary outside the document itself.`;
|
|
116
|
+
}
|
|
117
|
+
function getUserManualPrompt(config) {
|
|
118
|
+
return `You are the product documentation team for a technology company. You are writing a comprehensive user manual for a production application.
|
|
119
|
+
|
|
120
|
+
APPLICATION CONTEXT:
|
|
121
|
+
- Name: ${config.projectName}
|
|
122
|
+
- Description: ${config.description}
|
|
123
|
+
- Tech Stack: ${config.techStack}
|
|
124
|
+
- Target Audience: ${config.targetAudience}
|
|
125
|
+
|
|
126
|
+
CRITICAL INSTRUCTIONS:
|
|
127
|
+
|
|
128
|
+
Write as if this application EXISTS and is LIVE. Document it as a real product manual.
|
|
129
|
+
|
|
130
|
+
SPECIFICITY REQUIREMENTS:
|
|
131
|
+
- Every feature: what it does, how to access it, step-by-step usage
|
|
132
|
+
- Screenshots placeholders: [Screenshot: description] markers
|
|
133
|
+
- Keyboard shortcuts: list all
|
|
134
|
+
- Settings: every configurable option with its default value and allowed range
|
|
135
|
+
- Workflows: step-by-step for common tasks (minimum 5 workflows)
|
|
136
|
+
- Troubleshooting: specific error messages with specific solutions
|
|
137
|
+
|
|
138
|
+
MANDATORY SECTIONS:
|
|
139
|
+
1. Getting Started (setup, first-time configuration)
|
|
140
|
+
2. Dashboard Overview
|
|
141
|
+
3. Core Features (detailed walkthrough of each — minimum 5 features)
|
|
142
|
+
4. Settings and Configuration
|
|
143
|
+
5. User Management (roles, permissions, invitations)
|
|
144
|
+
6. Data Import and Export
|
|
145
|
+
7. Integrations
|
|
146
|
+
8. Keyboard Shortcuts
|
|
147
|
+
9. Troubleshooting and FAQ (minimum 10 items)
|
|
148
|
+
10. Glossary
|
|
149
|
+
|
|
150
|
+
Write 400-600 lines of dense, specific user documentation.
|
|
151
|
+
Do not include any meta-commentary outside the document itself.`;
|
|
152
|
+
}
|
|
153
|
+
export function getRegenerationSystemPrompt(ctx) {
|
|
154
|
+
const { config, type } = ctx;
|
|
155
|
+
const { verdicts } = ctx.verification;
|
|
156
|
+
const total = ctx.verification.verifications.length;
|
|
157
|
+
const assessed = total - verdicts.na;
|
|
158
|
+
const score = assessed > 0
|
|
159
|
+
? ((verdicts.pass + verdicts.partial * 0.5) / assessed) * 100
|
|
160
|
+
: 0;
|
|
161
|
+
const docLabel = type === 'tos'
|
|
162
|
+
? 'Terms of Service'
|
|
163
|
+
: type === 'api-docs'
|
|
164
|
+
? 'API documentation'
|
|
165
|
+
: 'user manual';
|
|
166
|
+
return `You are the legal and product team for a technology company. You are writing an UPDATED ${docLabel} for a production application.
|
|
167
|
+
|
|
168
|
+
APPLICATION CONTEXT:
|
|
169
|
+
- Name: ${config.projectName}
|
|
170
|
+
- Description: ${config.description}
|
|
171
|
+
- Tech Stack: ${config.techStack}
|
|
172
|
+
- Target Audience: ${config.targetAudience}
|
|
173
|
+
|
|
174
|
+
SITUATION:
|
|
175
|
+
A prior version of this ${docLabel} was audited against the actual codebase. The audit found:
|
|
176
|
+
- ${verdicts.pass} claims FULLY IMPLEMENTED (verified in code)
|
|
177
|
+
- ${verdicts.partial} claims PARTIALLY IMPLEMENTED
|
|
178
|
+
- ${verdicts.fail} claims NOT IMPLEMENTED (code doesn't support them)
|
|
179
|
+
- ${verdicts.na} claims NOT APPLICABLE (can't be verified from code)
|
|
180
|
+
- Overall compliance: ${score.toFixed(1)}%
|
|
181
|
+
|
|
182
|
+
YOUR TASK:
|
|
183
|
+
Write an updated ${docLabel} that reflects the CURRENT state of the application while also pushing it forward. Follow these rules:
|
|
184
|
+
|
|
185
|
+
RULES FOR EACH CLAIM CATEGORY:
|
|
186
|
+
|
|
187
|
+
1. PASS claims (verified in code): Keep these. They are REAL. Write them accurately — they describe what the application actually does. You may refine the language but do not change the substance.
|
|
188
|
+
|
|
189
|
+
2. PARTIAL claims (partially implemented): Keep these but revise them to more accurately describe what's actually there. If the partial implementation suggests a direction, you may expand on it.
|
|
190
|
+
|
|
191
|
+
3. FAIL claims (not in code): You have three options per claim:
|
|
192
|
+
- DROP it if it was implausible or doesn't fit the application's direction
|
|
193
|
+
- KEEP it if it represents a reasonable aspirational feature
|
|
194
|
+
- REVISE it into something more achievable that serves the same purpose
|
|
195
|
+
|
|
196
|
+
4. N/A claims (legal boilerplate, process claims): Keep reasonable ones. Drop or revise any that feel off.
|
|
197
|
+
|
|
198
|
+
5. NEW HALLUCINATIONS: Based on the verified capabilities, hallucinate NEW features and commitments that extend the application naturally. The app has grown — what does the next version look like?
|
|
199
|
+
|
|
200
|
+
CRITICAL INSTRUCTIONS:
|
|
201
|
+
- Write as if this application EXISTS and is LIVE in production
|
|
202
|
+
- Use declarative, authoritative language — no hedging
|
|
203
|
+
- Include specific numbers, technologies, timeframes
|
|
204
|
+
- The document should be 400-600 lines of dense, specific text
|
|
205
|
+
- Aim for 80-150 extractable, testable claims
|
|
206
|
+
- Do NOT include any meta-commentary, change logs, or notes about what changed
|
|
207
|
+
- Write the complete document fresh — do not mark changes or reference the prior version
|
|
208
|
+
|
|
209
|
+
Write the complete updated ${docLabel} now.`;
|
|
210
|
+
}
|
|
211
|
+
export function getRegenerationUserPrompt(ctx) {
|
|
212
|
+
const { type, priorDocument, extraction, verification } = ctx;
|
|
213
|
+
const docLabel = type === 'tos'
|
|
214
|
+
? 'Terms of Service'
|
|
215
|
+
: type === 'api-docs'
|
|
216
|
+
? 'API documentation'
|
|
217
|
+
: 'user manual';
|
|
218
|
+
// Build a summary of verification results grouped by verdict
|
|
219
|
+
const passed = [];
|
|
220
|
+
const partial = [];
|
|
221
|
+
const failed = [];
|
|
222
|
+
const claimMap = new Map(extraction.claims.map((c) => [c.id, c]));
|
|
223
|
+
for (const v of verification.verifications) {
|
|
224
|
+
const claim = claimMap.get(v.claimId);
|
|
225
|
+
if (!claim)
|
|
226
|
+
continue;
|
|
227
|
+
const line = `${v.claimId} [${claim.severity}]: ${claim.text}`;
|
|
228
|
+
if (v.verdict === 'PASS')
|
|
229
|
+
passed.push(line);
|
|
230
|
+
else if (v.verdict === 'PARTIAL')
|
|
231
|
+
partial.push(`${line}\n Reason: ${v.reasoning}`);
|
|
232
|
+
else if (v.verdict === 'FAIL')
|
|
233
|
+
failed.push(`${line}\n Reason: ${v.reasoning}`);
|
|
234
|
+
}
|
|
235
|
+
return `Here is the prior ${docLabel} that was audited:
|
|
236
|
+
|
|
237
|
+
---BEGIN PRIOR DOCUMENT---
|
|
238
|
+
${priorDocument}
|
|
239
|
+
---END PRIOR DOCUMENT---
|
|
240
|
+
|
|
241
|
+
Here are the audit results:
|
|
242
|
+
|
|
243
|
+
VERIFIED (${passed.length} claims — these are REAL, keep them):
|
|
244
|
+
${passed.join('\n')}
|
|
245
|
+
|
|
246
|
+
PARTIAL (${partial.length} claims — refine these):
|
|
247
|
+
${partial.join('\n')}
|
|
248
|
+
|
|
249
|
+
FAILED (${failed.length} claims — drop, keep, or revise each):
|
|
250
|
+
${failed.join('\n')}
|
|
251
|
+
|
|
252
|
+
Write the complete updated ${docLabel} now. It should reflect the real application while pushing forward with new hallucinated capabilities.`;
|
|
253
|
+
}
|
|
254
|
+
//# sourceMappingURL=system-prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-prompts.js","sourceRoot":"","sources":["../../src/lib/system-prompts.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,eAAe,CAAC,IAAuB,EAAE,MAAmB;IAC1E,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,KAAK;YACR,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;QAC9B,KAAK,UAAU;YACb,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAClC,KAAK,aAAa;YAChB,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAuB,EAAE,MAAmB;IACxE,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,KAAK;YACR,OAAO,2CAA2C,MAAM,CAAC,WAAW,uHAAuH,CAAC;QAC9L,KAAK,UAAU;YACb,OAAO,4CAA4C,MAAM,CAAC,WAAW,uIAAuI,CAAC;QAC/M,KAAK,aAA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AO,CAAC,CAAC;QACtC,IAAI,CAAC,KAAK;YAAE,SAAS;QACrB,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,OAAO,KAAK,KAAK,CAAC,QAAQ,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;QAC/D,IAAI,CAAC,CAAC,OAAO,KAAK,MAAM;YAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACvC,IAAI,CAAC,CAAC,OAAO,KAAK,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,eAAe,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;aAC/E,IAAI,CAAC,CAAC,OAAO,KAAK,MAAM;YAAE,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,eAAe,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,OAAO,qBAAqB,QAAQ;;;EAGpC,aAAa;;;;;YAKH,MAAM,CAAC,MAAM;EACvB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;;WAER,OAAO,CAAC,MAAM;EACvB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;;UAEV,MAAM,CAAC,MAAM;EACrB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;;6BAEU,QAAQ,wGAAwG,CAAC;AAC9I,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
export interface AssayConfig {
|
|
2
|
+
projectName: string;
|
|
3
|
+
description: string;
|
|
4
|
+
techStack: string;
|
|
5
|
+
targetAudience: string;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
}
|
|
8
|
+
export type HallucinationType = 'tos' | 'api-docs' | 'user-manual';
|
|
9
|
+
export interface HallucinationMeta {
|
|
10
|
+
type: HallucinationType;
|
|
11
|
+
iteration: number;
|
|
12
|
+
model: string;
|
|
13
|
+
inputTokens: number;
|
|
14
|
+
outputTokens: number;
|
|
15
|
+
sectionCount: number;
|
|
16
|
+
estimatedClaims: number;
|
|
17
|
+
generatedAt: string;
|
|
18
|
+
durationMs: number;
|
|
19
|
+
}
|
|
20
|
+
export type ClaimCategory = 'data-privacy' | 'security' | 'functionality' | 'operational' | 'legal';
|
|
21
|
+
export type ClaimSeverity = 'critical' | 'high' | 'medium' | 'low';
|
|
22
|
+
export interface Claim {
|
|
23
|
+
id: string;
|
|
24
|
+
section: string;
|
|
25
|
+
category: ClaimCategory;
|
|
26
|
+
severity: ClaimSeverity;
|
|
27
|
+
text: string;
|
|
28
|
+
testable: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface ExtractionResult {
|
|
31
|
+
iteration: number;
|
|
32
|
+
documentType: string;
|
|
33
|
+
claims: Claim[];
|
|
34
|
+
totalClaims: number;
|
|
35
|
+
testableClaims: number;
|
|
36
|
+
extractedAt: string;
|
|
37
|
+
}
|
|
38
|
+
export type Verdict = 'PASS' | 'PARTIAL' | 'FAIL' | 'N/A';
|
|
39
|
+
export interface Evidence {
|
|
40
|
+
file: string;
|
|
41
|
+
lineNumber?: number;
|
|
42
|
+
snippet: string;
|
|
43
|
+
confidence: number;
|
|
44
|
+
}
|
|
45
|
+
export interface ClaimVerification {
|
|
46
|
+
claimId: string;
|
|
47
|
+
claim: string;
|
|
48
|
+
verdict: Verdict;
|
|
49
|
+
evidence: Evidence[];
|
|
50
|
+
reasoning: string;
|
|
51
|
+
}
|
|
52
|
+
export interface VerificationReport {
|
|
53
|
+
iteration: number;
|
|
54
|
+
codebasePath: string;
|
|
55
|
+
verdicts: {
|
|
56
|
+
pass: number;
|
|
57
|
+
partial: number;
|
|
58
|
+
fail: number;
|
|
59
|
+
na: number;
|
|
60
|
+
};
|
|
61
|
+
verifications: ClaimVerification[];
|
|
62
|
+
generatedAt: string;
|
|
63
|
+
}
|
|
64
|
+
export type RemediationAction = 'add' | 'modify' | 'remove' | 'configure';
|
|
65
|
+
export interface RemediationTask {
|
|
66
|
+
id: string;
|
|
67
|
+
claimId: string;
|
|
68
|
+
verdict: 'FAIL' | 'PARTIAL';
|
|
69
|
+
severity: ClaimSeverity;
|
|
70
|
+
category: ClaimCategory;
|
|
71
|
+
title: string;
|
|
72
|
+
description: string;
|
|
73
|
+
action: RemediationAction;
|
|
74
|
+
targetFiles: string[];
|
|
75
|
+
estimatedEffort: 'trivial' | 'small' | 'medium' | 'large';
|
|
76
|
+
codeGuidance: string;
|
|
77
|
+
}
|
|
78
|
+
export interface RemediationPlan {
|
|
79
|
+
iteration: number;
|
|
80
|
+
codebasePath: string;
|
|
81
|
+
currentScore: number;
|
|
82
|
+
targetScore: number;
|
|
83
|
+
totalTasks: number;
|
|
84
|
+
tasksByVerdict: {
|
|
85
|
+
fail: number;
|
|
86
|
+
partial: number;
|
|
87
|
+
};
|
|
88
|
+
tasksBySeverity: {
|
|
89
|
+
critical: number;
|
|
90
|
+
high: number;
|
|
91
|
+
medium: number;
|
|
92
|
+
low: number;
|
|
93
|
+
};
|
|
94
|
+
tasks: RemediationTask[];
|
|
95
|
+
generatedAt: string;
|
|
96
|
+
inputTokens: number;
|
|
97
|
+
outputTokens: number;
|
|
98
|
+
durationMs: number;
|
|
99
|
+
}
|
|
100
|
+
export type SpecCategory = 'correctness' | 'security' | 'performance' | 'error-handling' | 'edge-case' | 'type-safety';
|
|
101
|
+
/** A formal specification that generated code must satisfy */
|
|
102
|
+
export interface CodeSpec {
|
|
103
|
+
id: string;
|
|
104
|
+
category: SpecCategory;
|
|
105
|
+
severity: ClaimSeverity;
|
|
106
|
+
description: string;
|
|
107
|
+
assertion: string;
|
|
108
|
+
rationale: string;
|
|
109
|
+
}
|
|
110
|
+
export interface SpecSynthesisResult {
|
|
111
|
+
task: string;
|
|
112
|
+
language: string;
|
|
113
|
+
specs: CodeSpec[];
|
|
114
|
+
totalSpecs: number;
|
|
115
|
+
synthesizedAt: string;
|
|
116
|
+
inputTokens: number;
|
|
117
|
+
outputTokens: number;
|
|
118
|
+
}
|
|
119
|
+
export type ConstraintType = 'must' | 'must-not' | 'prefer';
|
|
120
|
+
export type ConstraintSource = 'benchmark' | 'spec' | 'domain';
|
|
121
|
+
/** A constraint that guides code generation */
|
|
122
|
+
export interface GenerationConstraint {
|
|
123
|
+
id: string;
|
|
124
|
+
type: ConstraintType;
|
|
125
|
+
description: string;
|
|
126
|
+
pattern?: string;
|
|
127
|
+
source: ConstraintSource;
|
|
128
|
+
}
|
|
129
|
+
export interface ConstraintSet {
|
|
130
|
+
task: string;
|
|
131
|
+
constraints: GenerationConstraint[];
|
|
132
|
+
totalConstraints: number;
|
|
133
|
+
generatedAt: string;
|
|
134
|
+
inputTokens: number;
|
|
135
|
+
outputTokens: number;
|
|
136
|
+
}
|
|
137
|
+
export type SelfVerificationStatus = 'satisfied' | 'partial' | 'unsatisfied' | 'unknown';
|
|
138
|
+
export interface SelfVerificationResult {
|
|
139
|
+
specId: string;
|
|
140
|
+
status: SelfVerificationStatus;
|
|
141
|
+
reasoning: string;
|
|
142
|
+
}
|
|
143
|
+
/** The output of guided generation */
|
|
144
|
+
export interface GeneratedCode {
|
|
145
|
+
task: string;
|
|
146
|
+
code: string;
|
|
147
|
+
language: string;
|
|
148
|
+
specs: CodeSpec[];
|
|
149
|
+
constraints: GenerationConstraint[];
|
|
150
|
+
selfVerification: SelfVerificationResult[];
|
|
151
|
+
satisfiedCount: number;
|
|
152
|
+
totalSpecs: number;
|
|
153
|
+
generatedAt: string;
|
|
154
|
+
inputTokens: number;
|
|
155
|
+
outputTokens: number;
|
|
156
|
+
}
|
|
157
|
+
/** Full reverse pipeline result */
|
|
158
|
+
export interface ReverseAssayResult {
|
|
159
|
+
task: string;
|
|
160
|
+
language: string;
|
|
161
|
+
specSynthesis: SpecSynthesisResult;
|
|
162
|
+
constraintSet: ConstraintSet;
|
|
163
|
+
generatedCode: GeneratedCode;
|
|
164
|
+
totalInputTokens: number;
|
|
165
|
+
totalOutputTokens: number;
|
|
166
|
+
totalDurationMs: number;
|
|
167
|
+
}
|
|
168
|
+
export interface RouteInventoryItem {
|
|
169
|
+
path: string;
|
|
170
|
+
component: string;
|
|
171
|
+
domain: string;
|
|
172
|
+
guard?: string;
|
|
173
|
+
roles?: string[];
|
|
174
|
+
tables?: string[];
|
|
175
|
+
}
|
|
176
|
+
export interface TableInventoryItem {
|
|
177
|
+
name: string;
|
|
178
|
+
domain: string;
|
|
179
|
+
columns: string[];
|
|
180
|
+
relationships: string[];
|
|
181
|
+
}
|
|
182
|
+
export interface PermissionInventoryItem {
|
|
183
|
+
system: string;
|
|
184
|
+
codes: string[];
|
|
185
|
+
roles: string[];
|
|
186
|
+
conflicts?: string[];
|
|
187
|
+
}
|
|
188
|
+
export interface AssessmentInventory {
|
|
189
|
+
routes: RouteInventoryItem[];
|
|
190
|
+
tables: TableInventoryItem[];
|
|
191
|
+
permissions: PermissionInventoryItem[];
|
|
192
|
+
}
|
|
193
|
+
export interface RouteRequirement {
|
|
194
|
+
id: string;
|
|
195
|
+
route: string;
|
|
196
|
+
domain: string;
|
|
197
|
+
component: string;
|
|
198
|
+
guard?: string;
|
|
199
|
+
roles: string[];
|
|
200
|
+
tables: string[];
|
|
201
|
+
behaviors: string[];
|
|
202
|
+
scaffoldingFlags: string[];
|
|
203
|
+
}
|
|
204
|
+
export interface AssessmentConfig {
|
|
205
|
+
targetPath: string;
|
|
206
|
+
publish: boolean;
|
|
207
|
+
apiUrl: string;
|
|
208
|
+
domains?: string[];
|
|
209
|
+
concurrency: number;
|
|
210
|
+
}
|
|
211
|
+
export interface RouteAssessmentResult {
|
|
212
|
+
requirement: RouteRequirement;
|
|
213
|
+
claims: Claim[];
|
|
214
|
+
verifications: ClaimVerification[];
|
|
215
|
+
bugs: ClaimVerification[];
|
|
216
|
+
}
|
|
217
|
+
export interface AssessmentResult {
|
|
218
|
+
id: string;
|
|
219
|
+
repoName: string;
|
|
220
|
+
repoUrl: string;
|
|
221
|
+
frameworks: string[];
|
|
222
|
+
totalRoutes: number;
|
|
223
|
+
totalClaims: number;
|
|
224
|
+
verdicts: {
|
|
225
|
+
pass: number;
|
|
226
|
+
partial: number;
|
|
227
|
+
fail: number;
|
|
228
|
+
na: number;
|
|
229
|
+
};
|
|
230
|
+
bugs: {
|
|
231
|
+
critical: number;
|
|
232
|
+
high: number;
|
|
233
|
+
medium: number;
|
|
234
|
+
low: number;
|
|
235
|
+
};
|
|
236
|
+
score: number;
|
|
237
|
+
executiveSummary: string;
|
|
238
|
+
routeResults: RouteAssessmentResult[];
|
|
239
|
+
createdAt: string;
|
|
240
|
+
completedAt: string;
|
|
241
|
+
inputTokens: number;
|
|
242
|
+
outputTokens: number;
|
|
243
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tryassay",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AI code verification CLI — find bugs that tests miss, linters ignore, and code review overlooks",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"tryassay": "./dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"dev": "tsc --watch"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/",
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
18
|
+
"author": "Ty Wells <tyclaude@snapperland.com>",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/gtsbahamas/hallucination-reversing-system.git"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://tryassay.ai",
|
|
25
|
+
"keywords": [
|
|
26
|
+
"ai",
|
|
27
|
+
"verification",
|
|
28
|
+
"hallucination",
|
|
29
|
+
"code-quality",
|
|
30
|
+
"formal-verification",
|
|
31
|
+
"cli"
|
|
32
|
+
],
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@anthropic-ai/sdk": "^0.39.0",
|
|
35
|
+
"@supabase/supabase-js": "^2.95.3",
|
|
36
|
+
"@upstash/ratelimit": "^2.0.8",
|
|
37
|
+
"@upstash/redis": "^1.36.2",
|
|
38
|
+
"commander": "^13.1.0",
|
|
39
|
+
"openai": "^6.22.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "^22.0.0",
|
|
43
|
+
"@vercel/node": "^5.6.2",
|
|
44
|
+
"typescript": "^5.7.0"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=20"
|
|
48
|
+
}
|
|
49
|
+
}
|