@codeyam/codeyam-cli 0.1.22 → 0.1.23
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/astScopes/methodSemantics.ts +135 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/nodeToSource.ts +19 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/paths.ts +11 -4
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +5 -1
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +1632 -1554
- package/codeyam-cli/src/commands/__tests__/editor.analyzeImportsArgs.test.js +47 -0
- package/codeyam-cli/src/commands/__tests__/editor.analyzeImportsArgs.test.js.map +1 -0
- package/codeyam-cli/src/commands/__tests__/editor.auditNoAutoAnalysis.test.js +17 -9
- package/codeyam-cli/src/commands/__tests__/editor.auditNoAutoAnalysis.test.js.map +1 -1
- package/codeyam-cli/src/commands/editor.js +135 -18
- package/codeyam-cli/src/commands/editor.js.map +1 -1
- package/codeyam-cli/src/commands/editorAnalyzeImportsArgs.js +23 -0
- package/codeyam-cli/src/commands/editorAnalyzeImportsArgs.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +103 -1
- package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +140 -1
- package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +50 -1
- package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -1
- package/codeyam-cli/src/utils/editorAudit.js +38 -2
- package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
- package/codeyam-cli/src/utils/editorScenarios.js +60 -0
- package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
- package/codeyam-cli/src/utils/editorSeedAdapter.js +42 -2
- package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -1
- package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js +30 -11
- package/codeyam-cli/src/webserver/__tests__/editorProxy.test.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{editor.entity.(_sha)-aIHKLB-m.js → editor.entity.(_sha)-DMv5ESGo.js} +18 -18
- package/codeyam-cli/src/webserver/build/client/assets/{manifest-bcbb3d49.js → manifest-1a45e154.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{analysisRunner-DjF-soOH.js → analysisRunner-By5slFjw.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{index-nAvHGWbz.js → index-DXaOwBnm.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{init-XhpIt-OT.js → init-CLG1LjQM.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{server-build-DVwiibFu.js → server-build-NZmUqQv6.js} +155 -111
- 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/editorProxy.js +55 -3
- package/codeyam-cli/src/webserver/editorProxy.js.map +1 -1
- package/codeyam-cli/templates/codeyam-editor-reference.md +8 -6
- package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +42 -34
- package/package.json +1 -1
- package/packages/ai/src/lib/astScopes/methodSemantics.js +99 -0
- package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
- package/packages/ai/src/lib/astScopes/nodeToSource.js +16 -0
- package/packages/ai/src/lib/astScopes/nodeToSource.js.map +1 -1
- package/packages/ai/src/lib/astScopes/paths.js +12 -3
- package/packages/ai/src/lib/astScopes/paths.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +5 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +1330 -1270
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"buildTimestamp": "2026-03-
|
|
3
|
-
"buildTime":
|
|
4
|
-
"gitCommit": "
|
|
2
|
+
"buildTimestamp": "2026-03-25T14:20:38.638Z",
|
|
3
|
+
"buildTime": 1774448438638,
|
|
4
|
+
"gitCommit": "c7c95ab59975fd59b8a33c1299058ba1fca32a62",
|
|
5
5
|
"nodeVersion": "v20.20.1",
|
|
6
|
-
"contentHash": "
|
|
7
|
-
"buildNumber":
|
|
8
|
-
"semanticVersion": "0.1.
|
|
9
|
-
"version": "0.1.
|
|
6
|
+
"contentHash": "1ef6e4857c54ba0e5ddecacacdd26bdc64e7a25cd41e9f154b5ea6e3cd5525dc",
|
|
7
|
+
"buildNumber": 1223,
|
|
8
|
+
"semanticVersion": "0.1.1223",
|
|
9
|
+
"version": "0.1.1223 (2026-03-25T14:20+1ef6e48)"
|
|
10
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
[3/
|
|
3
|
-
[3/
|
|
2
|
+
[3/25/2026, 2:20:38 PM] > codeyam-combo@1.0.0 mergeDependencies
|
|
3
|
+
[3/25/2026, 2:20:38 PM] > node ./scripts/mergePackageJsonFiles.cjs
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
[3/
|
|
6
|
+
[3/25/2026, 2:20:38 PM] Merged dependencies into root package.json
|
|
7
7
|
|
|
@@ -895,6 +895,132 @@ export class UseStateSemantics implements MethodSemantics {
|
|
|
895
895
|
}
|
|
896
896
|
}
|
|
897
897
|
|
|
898
|
+
// ─── Set/Map method semantics ──────────────────────────────────────────
|
|
899
|
+
//
|
|
900
|
+
// Set/Map membership operations (.has, .delete, .add, .get, .set, .clear)
|
|
901
|
+
// don't create data flow equivalencies — they're membership checks or
|
|
902
|
+
// mutations, not transformations that propagate schema structure.
|
|
903
|
+
// Without these semantics, code like `filterRatings.has(articleId)` creates
|
|
904
|
+
// spurious equivalencies (332 entries in the Margo LibraryPage case).
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* Set.has() / Map.has() — membership check, returns boolean
|
|
908
|
+
*/
|
|
909
|
+
export class CollectionHasSemantics implements MethodSemantics {
|
|
910
|
+
getReturnType(): string {
|
|
911
|
+
return 'boolean';
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
addEquivalences(
|
|
915
|
+
methodCallPath: StructuredPath,
|
|
916
|
+
_sourcePath: StructuredPath,
|
|
917
|
+
context: AnalysisContext,
|
|
918
|
+
): void {
|
|
919
|
+
context.addType(methodCallPath, 'boolean');
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
isComplete(): boolean {
|
|
923
|
+
return true;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Set.delete() / Map.delete() — removal, returns boolean
|
|
929
|
+
*/
|
|
930
|
+
export class CollectionDeleteSemantics implements MethodSemantics {
|
|
931
|
+
getReturnType(): string {
|
|
932
|
+
return 'boolean';
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
addEquivalences(
|
|
936
|
+
methodCallPath: StructuredPath,
|
|
937
|
+
_sourcePath: StructuredPath,
|
|
938
|
+
context: AnalysisContext,
|
|
939
|
+
): void {
|
|
940
|
+
context.addType(methodCallPath, 'boolean');
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
isComplete(): boolean {
|
|
944
|
+
return true;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* Set.add() — adds an element, returns the Set (for chaining)
|
|
950
|
+
*/
|
|
951
|
+
export class SetAddSemantics implements MethodSemantics {
|
|
952
|
+
getReturnType(): string {
|
|
953
|
+
return 'object'; // Returns the Set itself
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
addEquivalences(
|
|
957
|
+
_methodCallPath: StructuredPath,
|
|
958
|
+
_sourcePath: StructuredPath,
|
|
959
|
+
_context: AnalysisContext,
|
|
960
|
+
): void {
|
|
961
|
+
// No equivalencies — add() doesn't create data flow
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
isComplete(): boolean {
|
|
965
|
+
return true;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* Set.clear() / Map.clear() — removes all elements, returns void
|
|
971
|
+
*/
|
|
972
|
+
export class CollectionClearSemantics implements MethodSemantics {
|
|
973
|
+
getReturnType(): string {
|
|
974
|
+
return 'void';
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
addEquivalences(): void {
|
|
978
|
+
// No equivalencies
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
isComplete(): boolean {
|
|
982
|
+
return true;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* Map.get() — retrieves a value by key, returns unknown (value type)
|
|
988
|
+
*/
|
|
989
|
+
export class MapGetSemantics implements MethodSemantics {
|
|
990
|
+
getReturnType(): string {
|
|
991
|
+
return 'unknown';
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
addEquivalences(
|
|
995
|
+
_methodCallPath: StructuredPath,
|
|
996
|
+
_sourcePath: StructuredPath,
|
|
997
|
+
_context: AnalysisContext,
|
|
998
|
+
): void {
|
|
999
|
+
// No equivalencies — the return value type depends on the map contents
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
isComplete(): boolean {
|
|
1003
|
+
return true;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* Map.set() — sets a key-value pair, returns the Map (for chaining)
|
|
1009
|
+
*/
|
|
1010
|
+
export class MapSetSemantics implements MethodSemantics {
|
|
1011
|
+
getReturnType(): string {
|
|
1012
|
+
return 'object'; // Returns the Map itself
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
addEquivalences(): void {
|
|
1016
|
+
// No equivalencies
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
isComplete(): boolean {
|
|
1020
|
+
return true;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
|
|
898
1024
|
/**
|
|
899
1025
|
* Create and populate the registry with method semantics
|
|
900
1026
|
*/
|
|
@@ -930,6 +1056,15 @@ export function createMethodRegistry(): MethodSemanticsRegistry {
|
|
|
930
1056
|
registry.register('useState', new UseStateSemantics(), 'React');
|
|
931
1057
|
registry.register('useMemo', new UseMemoSemantics(), 'React');
|
|
932
1058
|
|
|
1059
|
+
// Register Set/Map collection methods.
|
|
1060
|
+
// Only .has() and .delete() are safe to register by method name — they always
|
|
1061
|
+
// return boolean regardless of the collection type (Set, Map, WeakSet, WeakMap,
|
|
1062
|
+
// FormData, URLSearchParams, etc.).
|
|
1063
|
+
// .add(), .clear(), .get(), .set() are too ambiguous across different types
|
|
1064
|
+
// and can't be registered until the lookup code supports class-aware resolution.
|
|
1065
|
+
registry.register('has', new CollectionHasSemantics());
|
|
1066
|
+
registry.register('delete', new CollectionDeleteSemantics());
|
|
1067
|
+
|
|
933
1068
|
return registry;
|
|
934
1069
|
}
|
|
935
1070
|
|
|
@@ -54,6 +54,25 @@ export function nodeToSource(
|
|
|
54
54
|
// return serializeBindingElement(node, sourceFile, options);
|
|
55
55
|
// }
|
|
56
56
|
|
|
57
|
+
// Object/array/function literals should be marked as literal paths.
|
|
58
|
+
// This prevents them from creating sourceEquivalencies when used as
|
|
59
|
+
// function call arguments (e.g., setUndoEntry({ label: '...', undo: ... })).
|
|
60
|
+
// Without this, the full source text of the literal (300-500 chars for complex
|
|
61
|
+
// objects) gets embedded in path strings, creating expensive-to-parse
|
|
62
|
+
// equivalency entries that don't contribute useful schema information.
|
|
63
|
+
if (ts.isObjectLiteralExpression(node)) {
|
|
64
|
+
return StructuredPath.createLiteralPath(node.getText(sourceFile), 'object');
|
|
65
|
+
}
|
|
66
|
+
if (ts.isArrayLiteralExpression(node)) {
|
|
67
|
+
return StructuredPath.createLiteralPath(node.getText(sourceFile), 'array');
|
|
68
|
+
}
|
|
69
|
+
if (ts.isArrowFunction(node) || ts.isFunctionExpression(node)) {
|
|
70
|
+
return StructuredPath.createLiteralPath(
|
|
71
|
+
node.getText(sourceFile),
|
|
72
|
+
'function',
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
57
76
|
// Fallback for unsupported node types
|
|
58
77
|
return StructuredPath.fromBase(node.getText(sourceFile));
|
|
59
78
|
}
|
|
@@ -406,11 +406,18 @@ export class StructuredPath {
|
|
|
406
406
|
} else {
|
|
407
407
|
// Convert each argument to its string representation
|
|
408
408
|
const argsStr = funcSegment.args
|
|
409
|
-
.map((arg) =>
|
|
410
|
-
|
|
409
|
+
.map((arg) => {
|
|
410
|
+
// For literal arguments (object/array/function literals),
|
|
411
|
+
// use a compact placeholder instead of the full source text.
|
|
412
|
+
// This prevents 300-500 char inline objects from being embedded
|
|
413
|
+
// in call signature paths, which creates expensive equivalencies.
|
|
414
|
+
if (arg.isLiteral()) {
|
|
415
|
+
return `{...}`;
|
|
416
|
+
}
|
|
417
|
+
return arg.toStringWithSegments(arg.base, arg.segments, {
|
|
411
418
|
withReturnValues: doRenderNestedFunctionCallReturnValue,
|
|
412
|
-
})
|
|
413
|
-
)
|
|
419
|
+
});
|
|
420
|
+
})
|
|
414
421
|
.join(', ');
|
|
415
422
|
result += `(${argsStr})`;
|
|
416
423
|
}
|
|
@@ -538,9 +538,10 @@ export default function generateDataStructure({
|
|
|
538
538
|
dependencySchemas: isolatedDataStructure?.dependencySchemas || {},
|
|
539
539
|
});
|
|
540
540
|
|
|
541
|
+
const mergeTimedOut = !!(mergedDataStructure as any).timedOut;
|
|
541
542
|
awsLogDebugLevel(
|
|
542
543
|
1,
|
|
543
|
-
`mergeInDependentDataStructure complete for ${entity.name}: ` +
|
|
544
|
+
`mergeInDependentDataStructure ${mergeTimedOut ? 'PARTIAL' : 'complete'} for ${entity.name}: ` +
|
|
544
545
|
`${Object.keys(mergedDataStructure.signatureSchema).length} sig, ` +
|
|
545
546
|
`${Object.keys(mergedDataStructure.returnValueSchema).length} ret, ${Date.now() - mergeStart}ms`,
|
|
546
547
|
);
|
|
@@ -921,6 +922,9 @@ export default function generateDataStructure({
|
|
|
921
922
|
|
|
922
923
|
analysis.metadata ||= {};
|
|
923
924
|
analysis.metadata.mergedDataStructure = mergedDataStructure;
|
|
925
|
+
if (mergeTimedOut) {
|
|
926
|
+
(analysis.metadata as any).mergeTimedOut = true;
|
|
927
|
+
}
|
|
924
928
|
|
|
925
929
|
const checkGenDeadline = (phase: string) => {
|
|
926
930
|
if (Date.now() > genDeadline) {
|