airgen-cli 0.20.0 → 0.20.1
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/commands/lint.js +7 -30
- package/package.json +1 -1
package/dist/commands/lint.js
CHANGED
|
@@ -693,7 +693,7 @@ export function registerLintCommands(program, client) {
|
|
|
693
693
|
.option("--threshold <n>", "Jaccard similarity threshold (0.0-1.0)", "0.6")
|
|
694
694
|
.option("--spray-threshold <n>", "Outgoing trace link count for spray pattern detection", "8")
|
|
695
695
|
.option("--min-severity <level>", "Only show findings at this severity or above: low, medium, high", "low")
|
|
696
|
-
.option("--substrate-namespace <ns>", "
|
|
696
|
+
.option("--substrate-namespace <ns>", "Substrate namespace for entity lookups (default: SE)", "SE")
|
|
697
697
|
.action(async (tenant, project, opts) => {
|
|
698
698
|
const uht = new UhtClient();
|
|
699
699
|
if (!uht.isConfigured) {
|
|
@@ -722,14 +722,13 @@ export function registerLintCommands(program, client) {
|
|
|
722
722
|
const conceptRefs = extractConcepts(requirements);
|
|
723
723
|
const top = topConcepts(conceptRefs, maxConcepts);
|
|
724
724
|
console.error(` ${conceptRefs.size} unique concepts found, classifying top ${top.length}.`);
|
|
725
|
-
// Step 3: Classify concepts — use Substrate namespace
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
: "Classifying concepts via UHT...");
|
|
725
|
+
// Step 3: Classify concepts — use Substrate namespace (default: SE) for pre-classified entities
|
|
726
|
+
// Only falls back to fresh POST /classify for concepts not found in the namespace
|
|
727
|
+
const ns = opts.substrateNamespace ?? "SE";
|
|
728
|
+
console.error(`Looking up concepts in Substrate namespace "${ns}"...`);
|
|
730
729
|
const concepts = [];
|
|
731
|
-
|
|
732
|
-
// Namespace mode: look up pre-classified entities
|
|
730
|
+
{
|
|
731
|
+
// Namespace mode: look up pre-classified entities, fall back to fresh classify
|
|
733
732
|
const lookupResults = await parallelMap(top, async ([name]) => uht.lookupEntity(name, ns), 5);
|
|
734
733
|
for (let i = 0; i < lookupResults.length; i++) {
|
|
735
734
|
const [name, refs] = top[i];
|
|
@@ -765,28 +764,6 @@ export function registerLintCommands(program, client) {
|
|
|
765
764
|
}
|
|
766
765
|
}
|
|
767
766
|
}
|
|
768
|
-
else {
|
|
769
|
-
// Fresh classification mode (original behavior)
|
|
770
|
-
const classifyResults = await parallelMap(top, async ([name]) => uht.classify(name), 5);
|
|
771
|
-
for (let i = 0; i < classifyResults.length; i++) {
|
|
772
|
-
const entry = classifyResults[i];
|
|
773
|
-
const [name, refs] = top[i];
|
|
774
|
-
if (entry.result) {
|
|
775
|
-
const traitNames = entry.result.traits.map(t => t.name).filter(Boolean);
|
|
776
|
-
concepts.push({
|
|
777
|
-
name,
|
|
778
|
-
hexCode: entry.result.hex_code,
|
|
779
|
-
traits: traitNames,
|
|
780
|
-
traitSet: new Set(traitNames),
|
|
781
|
-
reqs: refs,
|
|
782
|
-
});
|
|
783
|
-
console.error(` ✓ ${name} → ${entry.result.hex_code} (${traitNames.length} traits)`);
|
|
784
|
-
}
|
|
785
|
-
else if (entry.error) {
|
|
786
|
-
console.error(` ✗ ${name}: ${entry.error.message}`);
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
767
|
// Step 4: Cross-compare concepts in batches
|
|
791
768
|
console.error("Cross-comparing concepts...");
|
|
792
769
|
const comparisons = [];
|