xab 13.0.0 → 14.0.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/dist/index.js +16 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -797,23 +797,8 @@ var init_codex = __esm(() => {
|
|
|
797
797
|
},
|
|
798
798
|
discoveries: {
|
|
799
799
|
type: "array",
|
|
800
|
-
items: {
|
|
801
|
-
|
|
802
|
-
properties: {
|
|
803
|
-
type: {
|
|
804
|
-
type: "string",
|
|
805
|
-
enum: ["path_mapping", "pattern", "codebase", "architecture", "convention", "warning"],
|
|
806
|
-
description: "Category of discovery"
|
|
807
|
-
},
|
|
808
|
-
key: {
|
|
809
|
-
type: "string",
|
|
810
|
-
description: "Short unique key for dedup (e.g. 'frontend_path_prefix', 'pnl_shared_helpers')"
|
|
811
|
-
},
|
|
812
|
-
value: { type: "string", description: "The reusable fact (1-2 sentences max)" }
|
|
813
|
-
},
|
|
814
|
-
required: ["type", "key", "value"]
|
|
815
|
-
},
|
|
816
|
-
description: "Reusable learnings that would help analyze FUTURE commits. Only include genuinely useful, non-obvious facts. Examples: path mappings between source and target ('frontend/' in source = 'apps/frontend/' in target), key shared functions ('betExitValueLocal() is the canonical P&L helper'), architectural patterns ('store exports are at the bottom of the file'), conventions ('pt-BR locale used in all user-facing text'). Leave as [] if nothing non-obvious was discovered."
|
|
800
|
+
items: { type: "string" },
|
|
801
|
+
description: "Reusable learnings for FUTURE commits, formatted as 'type:key:value'. Types: path_mapping, pattern, codebase, architecture, convention, warning. Examples: 'path_mapping:frontend_prefix:frontend/ in source = apps/frontend/ in target', 'codebase:pnl_helpers:betExitValueLocal() is the shared P&L function'. Only non-obvious facts. Leave as [] if nothing new."
|
|
817
802
|
},
|
|
818
803
|
keepMemoryKeys: {
|
|
819
804
|
type: "array",
|
|
@@ -1846,7 +1831,19 @@ async function processOneCommit(o) {
|
|
|
1846
1831
|
audit.writeAnalysis(commit.hash, 1, analysis);
|
|
1847
1832
|
cb.onAnalysis(commit, analysis);
|
|
1848
1833
|
if (analysis.discoveries && analysis.discoveries.length > 0) {
|
|
1849
|
-
const
|
|
1834
|
+
const parsed = analysis.discoveries.map((d) => {
|
|
1835
|
+
const firstColon = d.indexOf(":");
|
|
1836
|
+
const secondColon = firstColon >= 0 ? d.indexOf(":", firstColon + 1) : -1;
|
|
1837
|
+
if (secondColon >= 0) {
|
|
1838
|
+
return {
|
|
1839
|
+
type: d.slice(0, firstColon),
|
|
1840
|
+
key: d.slice(firstColon + 1, secondColon),
|
|
1841
|
+
value: d.slice(secondColon + 1)
|
|
1842
|
+
};
|
|
1843
|
+
}
|
|
1844
|
+
return { type: "pattern", key: d.slice(0, 30), value: d };
|
|
1845
|
+
});
|
|
1846
|
+
const added = o.memory.addDiscoveries(parsed, commit.hash);
|
|
1850
1847
|
if (added > 0) {
|
|
1851
1848
|
cb.onLog(`Memory: +${added} new discoveries (${o.memory.count} total)`, "cyan");
|
|
1852
1849
|
}
|
|
@@ -2297,7 +2294,7 @@ async function runBatch(opts) {
|
|
|
2297
2294
|
}
|
|
2298
2295
|
if (analysis.discoveries && analysis.discoveries.length > 0) {
|
|
2299
2296
|
for (const d of analysis.discoveries) {
|
|
2300
|
-
log(` ${chalk.cyan(` \uD83D\uDCA1
|
|
2297
|
+
log(` ${chalk.cyan(` \uD83D\uDCA1 ${d}`)}`);
|
|
2301
2298
|
}
|
|
2302
2299
|
}
|
|
2303
2300
|
},
|