@codeyam/codeyam-cli 0.1.0-staging.1 → 0.1.0-staging.8aea589
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/analyzer-template/.build-info.json +7 -7
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/packages/ai/src/lib/generateChangesEntityKeyAttributes.ts +51 -107
- package/analyzer-template/packages/ai/src/lib/generateEntityKeyAttributes.ts +36 -183
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +34 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.ts +238 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.ts +25 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/index.ts +2 -0
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.js +3 -2
- package/analyzer-template/packages/github/dist/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.js +3 -2
- package/analyzer-template/packages/utils/dist/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
- package/analyzer-template/packages/utils/src/lib/frameworks/getNextRoutePath.ts +6 -2
- package/analyzer-template/project/writeUniversalMocks.ts +6 -2
- package/background/src/lib/virtualized/project/writeUniversalMocks.js +3 -2
- package/background/src/lib/virtualized/project/writeUniversalMocks.js.map +1 -1
- package/codeyam-cli/scripts/apply-setup.js +288 -0
- package/codeyam-cli/scripts/apply-setup.js.map +1 -0
- package/codeyam-cli/scripts/extract-setup.js +130 -0
- package/codeyam-cli/scripts/extract-setup.js.map +1 -0
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js +238 -0
- package/codeyam-cli/scripts/fixtures/cal.com/universal-mocks/packages/prisma/index.js.map +1 -0
- package/codeyam-cli/src/utils/analysisRunner.js +4 -3
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/backgroundServer.js +25 -5
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/fileWatcher.js +75 -5
- package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +3 -2
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/database.js +13 -0
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/backgroundServer.js +15 -35
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-rqv54FUY.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-Dh-FldQK.js → InteractivePreview-B0oiPem-.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-DqXXjAJ7.js +3 -0
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-Dp6DC845.js → LogViewer-BKKG1s2B.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-xwuhwsZH.js → SafeScreenshot-DU_jxCPD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-5DY-YIxu.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-M2QuSHKC.js → ScenarioViewer-DmjXUj6m.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/_index-DvSrcxsk.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CsaMd9mb.js +10 -0
- package/codeyam-cli/src/webserver/build/client/assets/chart-column-VXBS6qOn.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/circle-alert-n5GUC2AS.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/clock-DKqtX8js.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{components-CAx5ONX_.js → components-Dj-Ggnl2.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-DGy3zrli.js → dev.empty-BbR3FwNc.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-1Z6D0fLM.js → entity._sha._-BHiWkb_W.js} +7 -7
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-ChAdTrrU.js → entity._sha_.create-scenario-L7M9Vr5z.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-D9L7267w.js → entity._sha_.edit._scenarioId-C9w-q7P3.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entityVersioning-DO2gCvXv.js → entityVersioning-Bk_YB1jM.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-C6FRgjPr.js → entry.client-CdGoUs8A.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/file-text-B6Er7j5k.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/files-KcDVw1FY.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/git-B9uZ8eSJ.js +12 -0
- package/codeyam-cli/src/webserver/build/client/assets/globals-B0f88RTV.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/loader-circle-v3c6DFp4.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/manifest-fca08d7e.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-Cf8VBqIb.js +16 -0
- package/codeyam-cli/src/webserver/build/client/assets/search-DA14wXpu.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/settings-COJUrwGu.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{settings-Hbf8b7J_.js → settings-NU_ZquhK.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-CNaMJ-nR.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BBlyqxij.js → useLastLogLine-Lumm1t01.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/useToast-BRShB17p.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/zap-BvukH0eN.js +1 -0
- package/codeyam-cli/src/webserver/build/client/favicon.svg +13 -0
- package/codeyam-cli/src/webserver/build/server/assets/{index-eAULANMV.js → index-DHr4rT4u.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-Bi1mj14J.js +166 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/src/webserver/public/favicon.svg +13 -0
- package/codeyam-cli/templates/codeyam-setup-skill.md +24 -18
- package/package.json +1 -1
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js +51 -107
- package/packages/ai/src/lib/generateChangesEntityKeyAttributes.js.map +1 -1
- package/packages/ai/src/lib/generateEntityKeyAttributes.js +36 -183
- package/packages/ai/src/lib/generateEntityKeyAttributes.js.map +1 -1
- package/packages/analyze/src/lib/FileAnalyzer.js +28 -0
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js +191 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js.map +1 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.js +16 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getDeclaredEntityNode.js.map +1 -0
- package/packages/analyze/src/lib/asts/sourceFiles/index.js +2 -0
- package/packages/analyze/src/lib/asts/sourceFiles/index.js.map +1 -1
- package/packages/utils/src/lib/frameworks/getNextRoutePath.js +3 -2
- package/packages/utils/src/lib/frameworks/getNextRoutePath.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityTypeIcon-GqWwt5wG.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/LibraryFunctionPreview-p0fuyqGQ.js +0 -3
- package/codeyam-cli/src/webserver/build/client/assets/ScenarioPreview-Bl2IRh55.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/_index-CAVtep9Q.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CLmzsLsT.js +0 -10
- package/codeyam-cli/src/webserver/build/client/assets/chart-column-B2I7jQx2.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/circle-alert-GwwOAbhw.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/createLucideIcon-CgyOwWip.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-C3-cQjgv.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/git-Dp4EB9nv.js +0 -12
- package/codeyam-cli/src/webserver/build/client/assets/globals-Da3jt49-.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/loader-circle-DN7Vr40D.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-172a4629.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-COyVTsPq.js +0 -16
- package/codeyam-cli/src/webserver/build/client/assets/search-CvyP_1Lo.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-MZc4XdmE.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/simulations-BMBi0VzO.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/useToast-C_VxoXTh.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/zap-B4gsLUZQ.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-lutv16q5.js +0 -161
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as I,N as J,O as K,U as L,Q as X,R as Y,M as Z,T as _,V as $}from"./assets/server-build-
|
|
1
|
+
import{W as I,N as J,O as K,U as L,Q as X,R as Y,M as Z,T as _,V as $}from"./assets/server-build-Bi1mj14J.js";import"react/jsx-runtime";import"node:stream";import"@remix-run/node";import"@remix-run/react";import"isbot";import"react-dom/server";import"react";import"lucide-react";import"fetch-retry";import"better-sqlite3";import"pg";import"fs";import"path";import"kysely";import"kysely/helpers/sqlite";import"kysely/helpers/postgres";import"typescript";import"fs/promises";import"os";import"prompts";import"chalk";import"crypto";import"react-resizable";import"openai";import"p-queue";import"p-retry";import"child_process";import"util";import"@aws-sdk/client-dynamodb";import"json5";import"lru-cache";import"pluralize";import"piscina";import"@aws-sdk/util-dynamodb";import"dotenv";import"events";import"uuid";import"url";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"v8";import"react-diff-viewer-continued";export{I as assets,J as assetsBuildDirectory,K as basename,L as entry,X as future,Y as isSpaMode,Z as mode,_ as publicPath,$ as routes};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"buildTimestamp": "2025-12-
|
|
3
|
-
"buildTime":
|
|
4
|
-
"buildNumber":
|
|
5
|
-
"semanticVersion": "0.1.
|
|
6
|
-
"version": "0.1.
|
|
2
|
+
"buildTimestamp": "2025-12-09T21:27:31.883Z",
|
|
3
|
+
"buildTime": 1765315651883,
|
|
4
|
+
"buildNumber": 48,
|
|
5
|
+
"semanticVersion": "0.1.48",
|
|
6
|
+
"version": "0.1.48 (2025-12-09T21:27)"
|
|
7
7
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<!-- Green background -->
|
|
3
|
+
<rect width="40" height="40" rx="8" fill="#90EE90"/>
|
|
4
|
+
<!-- Yellow/Lime accent bar on right -->
|
|
5
|
+
<rect x="28" y="0" width="12" height="40" rx="8" fill="#CDDC39"/>
|
|
6
|
+
<!-- Code brackets in dark color -->
|
|
7
|
+
<g transform="translate(8, 10)">
|
|
8
|
+
<!-- Left bracket < -->
|
|
9
|
+
<path d="M4 2L2 6L4 10" stroke="#232323" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
|
|
10
|
+
<!-- Right bracket > -->
|
|
11
|
+
<path d="M14 2L16 6L14 10" stroke="#232323" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
@@ -170,18 +170,6 @@ codeyam update-config
|
|
|
170
170
|
|
|
171
171
|
### Step 2: Test Startup for Selected Webapps
|
|
172
172
|
|
|
173
|
-
Ask user how they want to handle environment setup:
|
|
174
|
-
|
|
175
|
-
```
|
|
176
|
-
CodeYam needs to start your dev server safely without connecting to real services.
|
|
177
|
-
This won't affect your normal development.
|
|
178
|
-
|
|
179
|
-
Options:
|
|
180
|
-
1. "My environment is already safe" - Test as-is
|
|
181
|
-
2. "I'll configure it myself" - You guide, user creates mocks
|
|
182
|
-
3. "Claude handles it" - You create mocks automatically
|
|
183
|
-
```
|
|
184
|
-
|
|
185
173
|
**IMPORTANT: You must test EVERY webapp selected in Step 1**
|
|
186
174
|
|
|
187
175
|
**ACTION 1:** Get the selected webapps from config:
|
|
@@ -214,13 +202,13 @@ codeyam test-startup --webappPath . --debug
|
|
|
214
202
|
|
|
215
203
|
- Keep a checklist of all webapps
|
|
216
204
|
- Mark each as passing or failing
|
|
217
|
-
- ALL webapps must pass before proceeding to Step 4
|
|
205
|
+
- ALL selected webapps must pass before proceeding to Step 4
|
|
218
206
|
|
|
219
207
|
**Flow for each webapp:**
|
|
220
208
|
|
|
221
209
|
- If success → Move to next webapp
|
|
222
210
|
- If error → Go to Step 3, create mocks, re-test THIS webapp until it passes
|
|
223
|
-
- Only after ALL webapps pass → Go to Step 4
|
|
211
|
+
- Only after ALL selected webapps pass → Go to Step 4
|
|
224
212
|
|
|
225
213
|
### Step 3: Fix Errors (Environment Variables or Mocks)
|
|
226
214
|
|
|
@@ -307,7 +295,7 @@ Repeat until the webapp passes, then continue testing remaining webapps.
|
|
|
307
295
|
|
|
308
296
|
### Step 4: Success
|
|
309
297
|
|
|
310
|
-
Once `test-startup` passes for ALL webapps:
|
|
298
|
+
Once `test-startup` passes for ALL selected webapps:
|
|
311
299
|
|
|
312
300
|
1. Run `codeyam suggest --limit 1 --verbose` (timeout: 5 minutes)
|
|
313
301
|
2. Tell user CodeYam is ready
|
|
@@ -444,7 +432,7 @@ export const prisma = {
|
|
|
444
432
|
|
|
445
433
|
3. **Validate before retry** - Use `codeyam validate-mock` to catch issues before running test-startup again.
|
|
446
434
|
|
|
447
|
-
4. **Keep mocks minimal** - Empty methods and null returns are usually enough.
|
|
435
|
+
4. **Keep mocks minimal** - Empty methods and null returns are usually enough. The goal is to provide a simple mock with a structurally accurate return value. Do not import anything for mocks. Keep the mock simple.
|
|
448
436
|
|
|
449
437
|
5. **Match exports exactly** - Export names are case-sensitive and must match the original.
|
|
450
438
|
|
|
@@ -455,8 +443,26 @@ export const prisma = {
|
|
|
455
443
|
Setup is complete when:
|
|
456
444
|
|
|
457
445
|
- ✅ Selected `webapps` configured in `.codeyam/config.json` with startCommand **including `$PORT` placeholder**
|
|
458
|
-
- ✅ `environmentVariables` added to config (if
|
|
446
|
+
- ✅ `environmentVariables` added to config (if required for startup)
|
|
459
447
|
- ✅ `codeyam test-startup --webappPath <path> --debug` passes for all SELECTED webapps
|
|
460
|
-
- ✅ User knows how to use CodeYam (
|
|
448
|
+
- ✅ User knows how to use CodeYam (analyze, test)
|
|
461
449
|
|
|
462
450
|
**CRITICAL:** The startCommand must include `$PORT` in the args (e.g., `["dev", "--port", "$PORT"]`) or env (e.g., `{"PORT": "$PORT"}`). Without this, CodeYam cannot start the server on the required port for capture.
|
|
451
|
+
|
|
452
|
+
## Wrap It Up
|
|
453
|
+
|
|
454
|
+
- Always end by presenting the user with a basic overview of CodeYam
|
|
455
|
+
|
|
456
|
+
```
|
|
457
|
+
CodeYam is set up!
|
|
458
|
+
|
|
459
|
+
You can now:
|
|
460
|
+
|
|
461
|
+
- Open the CodeYam dashboard: run `codeyam` or ask me to open it for you
|
|
462
|
+
- Simulate any function or method in your project. Just ask me to `simulate [NAME OF FUNCTION OR METHOD]`
|
|
463
|
+
- Ask me to test any function or method and I will be able to write tests more easily using the generated data structure CodeYam provides.
|
|
464
|
+
|
|
465
|
+
To start how about simulating [FILE PATH AND ENTITY NAME OF SUGGESTED COMPONENT]?
|
|
466
|
+
|
|
467
|
+
Do you want me to simulate that now?
|
|
468
|
+
```
|
package/package.json
CHANGED
|
@@ -93,154 +93,98 @@ export default async function generateChangesEntityKeyAttributes({ entity, exist
|
|
|
93
93
|
llmCall,
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
const FRONTEND_SYSTEM_MESSAGE = `
|
|
96
|
+
const FRONTEND_SYSTEM_MESSAGE = `You are updating the key attributes for a frontend component that was recently changed.
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
This is an INCREMENTAL update. Existing key attributes should be preserved unless the code change clearly invalidates them. Removing and re-adding attributes across changes causes unnecessary churn.
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
## Stability Rules
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
- REMOVE only if the attribute is clearly no longer used (variable deleted, conditional removed, no longer referenced)
|
|
103
|
+
- KEEP marginal attributes—if unsure, preserve rather than remove
|
|
104
|
+
- ADD new attributes freely when warranted
|
|
103
105
|
|
|
104
|
-
|
|
106
|
+
## What Makes a Key Attribute
|
|
105
107
|
|
|
106
|
-
|
|
108
|
+
A key attribute is a data path from "Attributes and Value Types" that dramatically changes how the component renders:
|
|
107
109
|
|
|
108
|
-
|
|
110
|
+
- Controls a conditional that shows/hides significant UI sections
|
|
111
|
+
- Changes the component's primary visual state (not just minor text differences)
|
|
112
|
+
- Determines which branch of rendering logic executes
|
|
109
113
|
|
|
110
|
-
|
|
114
|
+
NOT key attributes:
|
|
115
|
+
- Values that only affect non-visible behavior (hrefs, image srcs)
|
|
116
|
+
- Fallback values that won't be used if primary values exist
|
|
117
|
+
- Values that would cause errors if changed
|
|
111
118
|
|
|
112
|
-
|
|
119
|
+
Note: A conditional that shows a different UI state (e.g., loading screen, redirect message) IS significant—include it. Only exclude guard clauses that render literally nothing.
|
|
113
120
|
|
|
114
|
-
|
|
121
|
+
## Path Format
|
|
115
122
|
|
|
116
|
-
|
|
123
|
+
Only return attributes from the "Attributes and Value Types" list—these are the only values we can control. Use the exact path provided. Use \`functionCallReturnValue\` for function return values. Use \`[]\` for array items (e.g., \`items[]\`).
|
|
117
124
|
|
|
118
|
-
|
|
125
|
+
## Response Format
|
|
119
126
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
- Changing the value of this variable will cause a guard clause to be triggered that results in nothing being displayed.
|
|
123
|
-
|
|
124
|
-
- Changing the value of this variable will cause a minor change in display that is not significant (e.g. slightly different text).
|
|
125
|
-
|
|
126
|
-
- The value is used as a fallback or alternative for another value and won't even be used if the other value is present.
|
|
127
|
-
|
|
128
|
-
- The value changes non-visible behavior (e.g. the href in a link or src in an image - all images sources are mocked out).
|
|
129
|
-
|
|
130
|
-
## Instructions
|
|
131
|
-
|
|
132
|
-
- Read each line of code. Pay particular attention to the return value of the function and how this frontend component will be displayed. What will cause it display distinctly different but functional and robust results to the user?
|
|
133
|
-
- Find the most impactful key attributes that will change how the frontend component is displayed. This should be a limited subset of the "Attributes and Value Types" provided.
|
|
134
|
-
- Reference the list of existing key attributes to determine if any of them are no longer valid or if any new key attributes should be added.
|
|
135
|
-
- Return each key attribute with the following information:
|
|
136
|
-
- \`path\`: The path to the data attribute in the code
|
|
137
|
-
- \`description\`: A short description of the data attribute and how it is used in the code.
|
|
138
|
-
- \`validValueOptions\`: A list of possible values for the data attribute that should be tested. This should include extreme values that could cause different behavior in the code but these values should not cause an error.
|
|
139
|
-
- Each attribute should reference exactly the path of a data attribute provided in the "Attributes and Value Types" section.
|
|
140
|
-
|
|
141
|
-
## Response
|
|
142
|
-
|
|
143
|
-
Please respond by specifying which attributes need to be added or removed. For removed attributes just specify the path that is no longer valid.
|
|
127
|
+
For \`validValueOptions\`, include boundary/extreme values that trigger different behavior—but NOT values that would cause errors.
|
|
144
128
|
|
|
145
129
|
\`\`\`json
|
|
146
130
|
{
|
|
147
131
|
"addedKeyAttributes": [
|
|
148
132
|
{
|
|
149
|
-
"path": "
|
|
150
|
-
|
|
151
|
-
"
|
|
152
|
-
|
|
153
|
-
"true",
|
|
154
|
-
"false"
|
|
155
|
-
],
|
|
156
|
-
"errorValueOptions": []
|
|
157
|
-
},
|
|
133
|
+
"path": "user",
|
|
134
|
+
"description": "Controls whether the main form or redirect screen displays",
|
|
135
|
+
"validValueOptions": ["truthy user object", "null/undefined"]
|
|
136
|
+
}
|
|
158
137
|
],
|
|
159
|
-
"removedKeyAttributes": [
|
|
160
|
-
"notification.message"
|
|
161
|
-
]
|
|
138
|
+
"removedKeyAttributes": ["oldAttribute.path"]
|
|
162
139
|
}
|
|
163
140
|
\`\`\`
|
|
164
141
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
- A key attribute must be an exact attribute path from the "Attributes and Value Types" provided. Do not return any other attribute paths. The only data we can provide to the function comes from these attributes so any other attribute is useless. For internally computed variables trace them back to one of the higher level variables that we can actually impact. Be sure to match the text from the attribute list exactly including spaces, commas, etc.
|
|
142
|
+
Return empty arrays if no changes needed.
|
|
168
143
|
`;
|
|
169
|
-
const BACKEND_SYSTEM_MESSAGE = `
|
|
170
|
-
|
|
171
|
-
Can you help us identify if any of the key data attributes in the function are no longer valid or if any new key data attributes should be added to the list?
|
|
172
|
-
|
|
173
|
-
We've provided a list of the existing key data attributes, the commit diff, a list of all data attributes that are now valid, and the function code.
|
|
144
|
+
const BACKEND_SYSTEM_MESSAGE = `You are updating the key attributes for a backend function that was recently changed.
|
|
174
145
|
|
|
175
|
-
|
|
146
|
+
This is an INCREMENTAL update. Existing key attributes should be preserved unless the code change clearly invalidates them. Removing and re-adding attributes across changes causes unnecessary churn.
|
|
176
147
|
|
|
177
|
-
|
|
148
|
+
## Stability Rules
|
|
178
149
|
|
|
179
|
-
|
|
150
|
+
- REMOVE only if the attribute is clearly no longer used (variable deleted, conditional removed, no longer referenced)
|
|
151
|
+
- KEEP marginal attributes—if unsure, preserve rather than remove
|
|
152
|
+
- ADD new attributes freely when warranted
|
|
180
153
|
|
|
181
|
-
|
|
154
|
+
## What Makes a Key Attribute
|
|
182
155
|
|
|
183
|
-
|
|
156
|
+
A key attribute is a data path from "Attributes and Value Types" that dramatically changes the function's behavior:
|
|
184
157
|
|
|
185
|
-
|
|
158
|
+
- Controls a conditional that significantly alters execution flow or return value
|
|
159
|
+
- Determines which branch of logic executes
|
|
160
|
+
- For side-effect functions: changes how external systems are called (database, email, etc.)
|
|
186
161
|
|
|
187
|
-
|
|
162
|
+
NOT key attributes:
|
|
163
|
+
- Fallback values that won't be used if primary values exist
|
|
164
|
+
- Values that would cause errors if changed
|
|
165
|
+
- Guard clauses that return nothing/minimal data
|
|
188
166
|
|
|
189
|
-
|
|
167
|
+
## Path Format
|
|
190
168
|
|
|
191
|
-
|
|
169
|
+
Only return attributes from the "Attributes and Value Types" list—these are the only values we can control. Use the exact path provided. Use \`functionCallReturnValue\` for function return values. Use \`[]\` for array items (e.g., \`items[]\`).
|
|
192
170
|
|
|
193
|
-
|
|
171
|
+
## Response Format
|
|
194
172
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
- Note: some functions do not return anything but instead call out to other systems (e.g. send an email, write to a database, etc). In those cases, the key attributes should be those that dramatically change how the function interacts with those other systems.
|
|
198
|
-
|
|
199
|
-
### Should NOT be a key attribute
|
|
200
|
-
|
|
201
|
-
- Changing the value of this variable will cause an error or exception to be thrown.
|
|
202
|
-
|
|
203
|
-
- Changing the value of this variable will cause a guard clause to be triggered that results in nothing or very little being returned.
|
|
204
|
-
|
|
205
|
-
- The value is used as a fallback or alternative for another value and won't even be used if the other value is present.
|
|
206
|
-
|
|
207
|
-
## Instructions
|
|
208
|
-
|
|
209
|
-
- Read each line of code. Pay particular attention to the return value of the function. What data attributes will cause it to return distinctly different but functional and robust results?
|
|
210
|
-
- Find the most impactful key attributes that will impact the return value of the function. This should be a limited subset of the "Attributes and Value Types" provided.
|
|
211
|
-
- Reference the list of existing key attributes to determine if any of them are no longer valid or if any new key attributes should be added.
|
|
212
|
-
- Return each key attribute with the following information:
|
|
213
|
-
- \`path\`: The path to the data attribute in the code
|
|
214
|
-
- \`description\`: A short description of the data attribute and how it is used in the code.
|
|
215
|
-
- \`validValueOptions\`: A list of possible values for the data attribute that should be tested. This should include extreme values that could cause different behavior in the code but these values should not cause an error.
|
|
216
|
-
- Each attribute should reference exactly the path of a data attribute provided in the "Attributes and Value Types" section.
|
|
217
|
-
|
|
218
|
-
## Response
|
|
219
|
-
|
|
220
|
-
Please respond by specifying which attributes need to be added or removed. For removed attributes just specify the path that is no longer valid.
|
|
173
|
+
For \`validValueOptions\`, include boundary/extreme values that trigger different behavior—but NOT values that would cause errors.
|
|
221
174
|
|
|
222
175
|
\`\`\`json
|
|
223
176
|
{
|
|
224
177
|
"addedKeyAttributes": [
|
|
225
178
|
{
|
|
226
|
-
"path": "
|
|
227
|
-
|
|
228
|
-
"
|
|
229
|
-
|
|
230
|
-
"true",
|
|
231
|
-
"false"
|
|
232
|
-
],
|
|
233
|
-
"errorValueOptions": []
|
|
234
|
-
},
|
|
179
|
+
"path": "config.enabled",
|
|
180
|
+
"description": "Controls whether the main processing logic runs",
|
|
181
|
+
"validValueOptions": ["true", "false"]
|
|
182
|
+
}
|
|
235
183
|
],
|
|
236
|
-
"removedKeyAttributes": [
|
|
237
|
-
"notification.message"
|
|
238
|
-
]
|
|
184
|
+
"removedKeyAttributes": ["oldAttribute.path"]
|
|
239
185
|
}
|
|
240
186
|
\`\`\`
|
|
241
187
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
- A key attribute must be an exact attribute path from the "Attributes and Value Types" provided. Do not return any other attribute paths. The only data we can provide to the function comes from these attributes so any other attribute is useless. For internally computed variables trace them back to one of the higher level variables that we can actually impact. Be sure to match the text from the attribute list exactly including spaces, commas, etc.
|
|
188
|
+
Return empty arrays if no changes needed.
|
|
245
189
|
`;
|
|
246
190
|
//# sourceMappingURL=generateChangesEntityKeyAttributes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateChangesEntityKeyAttributes.js","sourceRoot":"","sources":["../../../../../../packages/ai/src/lib/generateChangesEntityKeyAttributes.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,oCAAoC,MAAM,yDAAyD,CAAC;AAC3G,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAM,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAU7E,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,kCAAkC,CAAC,EAC/D,MAAM,EACN,qBAAqB,EACrB,QAAQ,EACR,UAAU,EACV,KAAK,GACkC;IACvC,MAAM,CAAC,2CAA2C,EAAE;QAClD,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,UAAU,EAAE,MAAM,CAAC,IAAI;QACvB,UAAU,EAAE,QAAQ,CAAC,EAAE;QACvB,qBAAqB,EAAE,qBAAqB,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;KACzE,CAAC,CAAC;IAEH,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,oBAAoB,EAAE,GAC3D,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAEpC,MAAM,MAAM,GAAG,oCAAoC,CAAC;QAClD,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,aAAa;QACb,qBAAqB;QACrB,UAAU;KACX,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC;QACpC,IAAI,EAAE,oC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;SAC5C,MAAM,CACL,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAC5B,IAAI,CAAC,SAAS,CACZ,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,KAAK,YAAY,CAAC,YAAY,CACtD,KAAK,KAAK,CACd;SACA,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,aAAa,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC;IAEtE,OAAO;QACL,aAAa,EAAE,yBAAyB;QACxC,OAAO;KACR,CAAC;AACJ,CAAC;AAED,MAAM,uBAAuB,GAAG
|
|
1
|
+
{"version":3,"file":"generateChangesEntityKeyAttributes.js","sourceRoot":"","sources":["../../../../../../packages/ai/src/lib/generateChangesEntityKeyAttributes.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,oCAAoC,MAAM,yDAAyD,CAAC;AAC3G,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAM,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAU7E,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,kCAAkC,CAAC,EAC/D,MAAM,EACN,qBAAqB,EACrB,QAAQ,EACR,UAAU,EACV,KAAK,GACkC;IACvC,MAAM,CAAC,2CAA2C,EAAE;QAClD,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,UAAU,EAAE,MAAM,CAAC,IAAI;QACvB,UAAU,EAAE,QAAQ,CAAC,EAAE;QACvB,qBAAqB,EAAE,qBAAqB,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;KACzE,CAAC,CAAC;IAEH,MAAM,E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,CAAC;QAC/B,MAAM,KAAK,GAAG,aAAa,CAAC,SAAS,CACnC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,YAAY,CACvC,CAAC;QACF,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACjB,aAAa,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IAED,MAAM,yBAAyB,GAAG,aAAa;SAC5C,MAAM,CACL,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAC5B,IAAI,CAAC,SAAS,CACZ,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,KAAK,YAAY,CAAC,YAAY,CACtD,KAAK,KAAK,CACd;SACA,MAAM,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,aAAa,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC;IAEtE,OAAO;QACL,aAAa,EAAE,yBAAyB;QACxC,OAAO;KACR,CAAC;AACJ,CAAC;AAED,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+C/B,CAAC;AAEF,MAAM,sBAAsB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6C9B,CAAC"}
|
|
@@ -106,224 +106,77 @@ export default async function generateEntityKeyAttributes({ entity, model, }) {
|
|
|
106
106
|
llmCall,
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
const FRONTEND_SYSTEM_MESSAGE = `
|
|
109
|
+
const FRONTEND_SYSTEM_MESSAGE = `You analyze frontend components to identify key data attributes that significantly impact rendering.
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
## What Makes a Key Attribute
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
A key attribute is a data path from "Attributes and Value Types" that dramatically changes how the component renders:
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
- Controls a conditional that shows/hides significant UI sections
|
|
116
|
+
- Changes the component's primary visual state (not just minor text differences)
|
|
117
|
+
- Determines which branch of rendering logic executes
|
|
116
118
|
|
|
117
|
-
|
|
119
|
+
NOT key attributes:
|
|
120
|
+
- Values that only affect non-visible behavior (hrefs, image srcs)
|
|
121
|
+
- Fallback values that won't be used if primary values exist
|
|
122
|
+
- Values that would cause errors if changed
|
|
123
|
+
- Guard clauses that render literally nothing
|
|
118
124
|
|
|
119
|
-
|
|
125
|
+
Note: A conditional that shows a different UI state (e.g., loading screen, redirect message) IS significant—include it.
|
|
120
126
|
|
|
121
|
-
|
|
127
|
+
## Path Format
|
|
122
128
|
|
|
123
|
-
|
|
129
|
+
Only return attributes from the "Attributes and Value Types" list—these are the only values we can control. Use the exact \`fullPath\` provided. Use \`functionCallReturnValue\` for function return values. Use \`[]\` for array items (e.g., \`items[]\`).
|
|
124
130
|
|
|
125
|
-
|
|
131
|
+
## Response Format
|
|
126
132
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
- Changing the presence, value, length (e.g. for strings or arrays), etc of this variable will dramatically change how the component displays (the return value of the function).
|
|
130
|
-
|
|
131
|
-
- Is used in a conditional (especially conditionals in the JSX such as \`{varName1 && varName2 && ([JSX])}\` where the absence or presence of both \`varName1\` and \`varName2\` directly impact what the user sees) that alters how the component displays. Capture how the conditional uses the variable. Does it require the variable to be true/false, defined/not defined (e.g. undefined), greater than/less than a certain value, compared with another variable, etc. Really any attribute that is used in a conditional should be a key attribute.
|
|
132
|
-
|
|
133
|
-
### Should NOT be a key attribute
|
|
134
|
-
|
|
135
|
-
- Changing the value of this variable will cause an error or exception to be thrown.
|
|
136
|
-
|
|
137
|
-
- Changing the value of this variable will cause a guard clause around the whole method or function to be triggered that results in nothing at all being displayed.
|
|
138
|
-
|
|
139
|
-
- Changing the value of this variable will cause a minor change in display that is not significant (e.g. slightly different text).
|
|
140
|
-
|
|
141
|
-
- The value is used as a fallback or alternative for another value and won't even be used if the other value is present.
|
|
142
|
-
|
|
143
|
-
- The value changes non-visible behavior (e.g. the href in a link or src in an image - all images sources are mocked out).
|
|
144
|
-
|
|
145
|
-
## Instructions
|
|
146
|
-
|
|
147
|
-
- Read each line of code. Pay particular attention to the return value of the function and how this frontend component will be displayed. What will cause it display distinctly different but functional and robust results to the user?
|
|
148
|
-
- Find the most impactful key attributes that will change how the frontend component is displayed. This should be a limited subset of the "Attributes and Value Types" provided.
|
|
149
|
-
- Return each key attribute with the following information:
|
|
150
|
-
- \`fullPath\`: The fullPath to the data attribute in the code
|
|
151
|
-
- \`description\`: A short description of the data attribute and how it is used in the code.
|
|
152
|
-
- \`validValueOptions\`: A list of possible values for the data attribute that should be tested. This list should be minimal and only include values that the code will handle properly and will clearly make a difference in how the component is displayed. Do not make up arbitrary values without clear evidence that each different value will cause a different display behavior.
|
|
153
|
-
- List the key attributes in the order of importance (most important first, with importance determined by how much changing the attribute will impact how the component is displayed).
|
|
154
|
-
- Each attribute should reference exactly the full fullPath of a data attribute provided in the "Attributes and Value Types" section.
|
|
155
|
-
|
|
156
|
-
## Example
|
|
157
|
-
|
|
158
|
-
Given the following "Attributes and Value Types":
|
|
159
|
-
\`\`\`
|
|
160
|
-
'notification.read': { fullPath: 'signature[0].notification.read', type: 'boolean' }
|
|
161
|
-
'notification.message': { fullPath: 'signature[0].notification.message', type: 'string' }
|
|
162
|
-
\`\`\`
|
|
163
|
-
|
|
164
|
-
and code:
|
|
165
|
-
|
|
166
|
-
\`\`\`typescript
|
|
167
|
-
const NotificationText = (notification) => {
|
|
168
|
-
if (notification.read) {
|
|
169
|
-
return (
|
|
170
|
-
<span onClick={markAsRead(notification.id)}>
|
|
171
|
-
<img src={notification.icon} alt="Notification Icon" />
|
|
172
|
-
{notification.message}
|
|
173
|
-
</span>
|
|
174
|
-
);
|
|
175
|
-
} else {
|
|
176
|
-
return <strong>{notification.message}</strong>;
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
\`\`\`
|
|
180
|
-
|
|
181
|
-
The response might be:
|
|
133
|
+
For \`validValueOptions\`, include boundary/extreme values that trigger different behavior—but NOT values that would cause errors.
|
|
182
134
|
|
|
183
135
|
\`\`\`json
|
|
184
136
|
{
|
|
185
137
|
"keyAttributes": [
|
|
186
138
|
{
|
|
187
|
-
"fullPath": "signature[0].
|
|
188
|
-
"description": "
|
|
189
|
-
"validValueOptions": [
|
|
190
|
-
"true",
|
|
191
|
-
"false"
|
|
192
|
-
]
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
"fullPath": "signature[0].notification.message",
|
|
196
|
-
"description": "The message text is displayed and should be tested for various lengths.",
|
|
197
|
-
"validValueOptions": [
|
|
198
|
-
"An empty message (no characters)",
|
|
199
|
-
"A medium message (around 100 characters)",
|
|
200
|
-
"A long message (longer than 200 characters)"
|
|
201
|
-
]
|
|
139
|
+
"fullPath": "signature[0].user",
|
|
140
|
+
"description": "Controls whether the main form or redirect screen displays",
|
|
141
|
+
"validValueOptions": ["truthy user object", "null/undefined"]
|
|
202
142
|
}
|
|
203
143
|
]
|
|
204
144
|
}
|
|
205
145
|
\`\`\`
|
|
206
|
-
|
|
207
|
-
## Important
|
|
208
|
-
|
|
209
|
-
- A key attribute must be an exact attribute fullPath from the "Attributes and Value Types" provided. Do not return any other attribute fullPaths. The only data we can provide to the function comes from these attributes so any other attribute is useless. For internally computed variables trace them back to one of the higher level variables that we can actually impact. Be sure to match the text from the attribute list exactly including spaces, commas, etc.
|
|
210
146
|
`;
|
|
211
|
-
const BACKEND_SYSTEM_MESSAGE = `
|
|
212
|
-
|
|
213
|
-
Can you help us identify the key data attributes in the code that will cause the function to return distinctly different but functional and robust results?
|
|
214
|
-
|
|
215
|
-
We're not interested in causing errors or in high-level guard clauses that result in nothing being returned. We're interested in always returning a robust result that demonstrates the core intent of the function.
|
|
147
|
+
const BACKEND_SYSTEM_MESSAGE = `You analyze backend functions to identify key data attributes that significantly impact behavior.
|
|
216
148
|
|
|
217
|
-
|
|
149
|
+
## What Makes a Key Attribute
|
|
218
150
|
|
|
219
|
-
|
|
151
|
+
A key attribute is a data path from "Attributes and Value Types" that dramatically changes the function's behavior:
|
|
220
152
|
|
|
221
|
-
|
|
153
|
+
- Controls a conditional that significantly alters execution flow or return value
|
|
154
|
+
- Determines which branch of logic executes
|
|
155
|
+
- For side-effect functions: changes how external systems are called (database, email, etc.)
|
|
222
156
|
|
|
223
|
-
|
|
157
|
+
NOT key attributes:
|
|
158
|
+
- Fallback values that won't be used if primary values exist
|
|
159
|
+
- Values that would cause errors if changed
|
|
160
|
+
- Guard clauses that return nothing/minimal data
|
|
224
161
|
|
|
225
|
-
|
|
162
|
+
## Path Format
|
|
226
163
|
|
|
227
|
-
|
|
164
|
+
Only return attributes from the "Attributes and Value Types" list—these are the only values we can control. Use the exact \`fullPath\` provided. Use \`functionCallReturnValue\` for function return values. Use \`[]\` for array items (e.g., \`items[]\`).
|
|
228
165
|
|
|
229
|
-
|
|
166
|
+
## Response Format
|
|
230
167
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
- Changing the value, length (e.g. for strings or arrays), etc of this variable will dramatically impact the return value of the function.
|
|
234
|
-
|
|
235
|
-
- Is used in a conditional that dramatically the execution flow of the function and as a result the return value of the function (note: if the conditional compares two or more variables, note which variables are involved and how they must be set to cause different behavior).
|
|
236
|
-
|
|
237
|
-
- Note: some functions do not return anything but instead call out to other systems (e.g. send an email, write to a database, etc). In those cases, the key attributes should be those that dramatically change how the function interacts with those other systems.
|
|
238
|
-
|
|
239
|
-
### Should NOT be a key attribute
|
|
240
|
-
|
|
241
|
-
- Changing the value of this variable will cause an error or exception to be thrown.
|
|
242
|
-
|
|
243
|
-
- Changing the value of this variable will cause a guard clause to be triggered that results in nothing or very little being returned.
|
|
244
|
-
|
|
245
|
-
- The value is used as a fallback or alternative for another value and won't even be used if the other value is present.
|
|
246
|
-
|
|
247
|
-
## Instructions
|
|
248
|
-
|
|
249
|
-
- Read each line of code. Pay particular attention to the return value of the function. What data attributes will cause it to return distinctly different but functional and robust results?
|
|
250
|
-
- Find the most impactful key attributes that will impact the return value of the function. This should be a limited subset of the "Attributes and Value Types" provided.
|
|
251
|
-
- Return each key attribute with the following information:
|
|
252
|
-
- \`fullPath\`: The fullPath to the data attribute in the code
|
|
253
|
-
- \`description\`: A short description of the data attribute and how it is used in the code.
|
|
254
|
-
- \`validValueOptions\`: A list of possible values for the data attribute that should be tested. This list should be minimal and only include values that the code will handle properly and will clearly make a difference in the functions's behavior. Do not make up arbitrary values without clear evidence that each different value will clearly result in a different function behavior.
|
|
255
|
-
- List the key attributes in the order of importance (most important first, with importance determined by how much changing the attribute will change the return value of the function).
|
|
256
|
-
- Each attribute should reference exactly the fullPath of a data attribute provided in the "Attributes and Value Types" section.
|
|
257
|
-
|
|
258
|
-
## Example
|
|
259
|
-
|
|
260
|
-
Given the following "Attributes and Value Types":
|
|
261
|
-
\`\`\`
|
|
262
|
-
[
|
|
263
|
-
items[].quantity: { fullPath: 'signature[0][].quantity', type: 'number' },
|
|
264
|
-
items[].price: { fullPath: 'signature[0][].price', type: 'number' },
|
|
265
|
-
discount: { fullPath: 'signature[1]', type: 'number' },
|
|
266
|
-
taxRate: { fullPath: 'signature[2]', type: 'number' },
|
|
267
|
-
]
|
|
268
|
-
\`\`\`
|
|
269
|
-
|
|
270
|
-
and code:
|
|
271
|
-
|
|
272
|
-
\`\`\`typescript
|
|
273
|
-
const calculateTotal = (items, discount, taxRate) => {
|
|
274
|
-
const subtotal = items.reduce((sum, item) => sum + item.quantity * item.price, 0);
|
|
275
|
-
const discountedTotal = subtotal - discount;
|
|
276
|
-
const tax = discountedTotal * taxRate;
|
|
277
|
-
return discountedTotal + tax;
|
|
278
|
-
}
|
|
279
|
-
\`\`\`
|
|
280
|
-
|
|
281
|
-
The response might be:
|
|
168
|
+
For \`validValueOptions\`, include boundary/extreme values that trigger different behavior—but NOT values that would cause errors.
|
|
282
169
|
|
|
283
170
|
\`\`\`json
|
|
284
171
|
{
|
|
285
172
|
"keyAttributes": [
|
|
286
173
|
{
|
|
287
|
-
"fullPath": "signature[0]
|
|
288
|
-
"description": "
|
|
289
|
-
"validValueOptions": [
|
|
290
|
-
"0 (no items)",
|
|
291
|
-
"1 (single item)",
|
|
292
|
-
"5 (multiple items)",
|
|
293
|
-
"100 (large quantity)"
|
|
294
|
-
]
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
"fullPath": "signature[0][].price",
|
|
298
|
-
"description": "The price of each item affects the subtotal calculation.",
|
|
299
|
-
"validValueOptions": [
|
|
300
|
-
"0.00 (free item)",
|
|
301
|
-
"19.99 (average price)",
|
|
302
|
-
"999.99 (high price)"
|
|
303
|
-
]
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
"fullPath": "signature[1]",
|
|
307
|
-
"description": "The discount amount directly reduces the subtotal.",
|
|
308
|
-
"validValueOptions": [
|
|
309
|
-
"0 (no discount)",
|
|
310
|
-
"20.00 (discount)"
|
|
311
|
-
]
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
"fullPath": "signature[2]",
|
|
315
|
-
"description": "The tax rate affects the final total calculation.",
|
|
316
|
-
"validValueOptions": [
|
|
317
|
-
"0 (no tax)",
|
|
318
|
-
"0.20 (20% tax)"
|
|
319
|
-
]
|
|
174
|
+
"fullPath": "signature[0].config.enabled",
|
|
175
|
+
"description": "Controls whether the main processing logic runs",
|
|
176
|
+
"validValueOptions": ["true", "false"]
|
|
320
177
|
}
|
|
321
178
|
]
|
|
322
179
|
}
|
|
323
180
|
\`\`\`
|
|
324
|
-
|
|
325
|
-
## Important
|
|
326
|
-
|
|
327
|
-
- A key attribute must be an exact attribute fullPath from the "Attributes and Value Types" provided. Do not return any other attribute fullPaths. The only data we can provide to the function comes from these attributes so any other attribute is useless. For internally computed variables trace them back to one of the higher level variables that we can actually impact. Be sure to match the text from the attribute list exactly including spaces, commas, etc.
|
|
328
181
|
`;
|
|
329
182
|
//# sourceMappingURL=generateEntityKeyAttributes.js.map
|