@nebulacomponents/citable 1.16.0 → 1.18.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/CHANGELOG.md +47 -0
- package/README.md +16 -3
- package/dist/universal/.agents/skills/citable/SKILL.md +66 -1
- package/dist/universal/.agents/skills/citable/VERSION +1 -1
- package/dist/universal/.agents/skills/citable/manifest.json +9 -6
- package/dist/universal/.agents/skills/citable/schemas/cli-output-envelope.schema.json +30 -0
- package/dist/universal/.agents/skills/citable/schemas/finding.schema.json +69 -0
- package/dist/universal/.agents/skills/citable/schemas/remediation-verification.schema.json +98 -0
- package/dist/universal/.agents/skills/citable/schemas/sow.schema.json +92 -0
- package/dist/universal/.claude/agents/citable/manifest.json +2 -2
- package/dist/universal/.claude/skills/citable/SKILL.md +66 -1
- package/dist/universal/.claude/skills/citable/VERSION +1 -1
- package/dist/universal/.claude/skills/citable/manifest.json +9 -6
- package/dist/universal/.claude/skills/citable/schemas/cli-output-envelope.schema.json +30 -0
- package/dist/universal/.claude/skills/citable/schemas/finding.schema.json +69 -0
- package/dist/universal/.claude/skills/citable/schemas/remediation-verification.schema.json +98 -0
- package/dist/universal/.claude/skills/citable/schemas/sow.schema.json +92 -0
- package/dist/universal/.cursor/skills/citable/SKILL.md +66 -1
- package/dist/universal/.cursor/skills/citable/VERSION +1 -1
- package/dist/universal/.cursor/skills/citable/manifest.json +9 -6
- package/dist/universal/.cursor/skills/citable/schemas/cli-output-envelope.schema.json +30 -0
- package/dist/universal/.cursor/skills/citable/schemas/finding.schema.json +69 -0
- package/dist/universal/.cursor/skills/citable/schemas/remediation-verification.schema.json +98 -0
- package/dist/universal/.cursor/skills/citable/schemas/sow.schema.json +92 -0
- package/dist/universal/.gemini/skills/citable/SKILL.md +66 -1
- package/dist/universal/.gemini/skills/citable/VERSION +1 -1
- package/dist/universal/.gemini/skills/citable/manifest.json +9 -6
- package/dist/universal/.gemini/skills/citable/schemas/cli-output-envelope.schema.json +30 -0
- package/dist/universal/.gemini/skills/citable/schemas/finding.schema.json +69 -0
- package/dist/universal/.gemini/skills/citable/schemas/remediation-verification.schema.json +98 -0
- package/dist/universal/.gemini/skills/citable/schemas/sow.schema.json +92 -0
- package/dist/universal/.github/skills/citable/SKILL.md +66 -1
- package/dist/universal/.github/skills/citable/VERSION +1 -1
- package/dist/universal/.github/skills/citable/manifest.json +9 -6
- package/dist/universal/.github/skills/citable/schemas/cli-output-envelope.schema.json +30 -0
- package/dist/universal/.github/skills/citable/schemas/finding.schema.json +69 -0
- package/dist/universal/.github/skills/citable/schemas/remediation-verification.schema.json +98 -0
- package/dist/universal/.github/skills/citable/schemas/sow.schema.json +92 -0
- package/dist/universal/.kiro/skills/citable/SKILL.md +66 -1
- package/dist/universal/.kiro/skills/citable/VERSION +1 -1
- package/dist/universal/.kiro/skills/citable/manifest.json +9 -6
- package/dist/universal/.kiro/skills/citable/schemas/cli-output-envelope.schema.json +30 -0
- package/dist/universal/.kiro/skills/citable/schemas/finding.schema.json +69 -0
- package/dist/universal/.kiro/skills/citable/schemas/remediation-verification.schema.json +98 -0
- package/dist/universal/.kiro/skills/citable/schemas/sow.schema.json +92 -0
- package/dist/universal/.opencode/skills/citable/SKILL.md +66 -1
- package/dist/universal/.opencode/skills/citable/VERSION +1 -1
- package/dist/universal/.opencode/skills/citable/manifest.json +9 -6
- package/dist/universal/.opencode/skills/citable/schemas/cli-output-envelope.schema.json +30 -0
- package/dist/universal/.opencode/skills/citable/schemas/finding.schema.json +69 -0
- package/dist/universal/.opencode/skills/citable/schemas/remediation-verification.schema.json +98 -0
- package/dist/universal/.opencode/skills/citable/schemas/sow.schema.json +92 -0
- package/dist/universal/.pi/agent/skills/citable/SKILL.md +66 -1
- package/dist/universal/.pi/agent/skills/citable/VERSION +1 -1
- package/dist/universal/.pi/agent/skills/citable/manifest.json +9 -6
- package/dist/universal/.pi/agent/skills/citable/schemas/cli-output-envelope.schema.json +30 -0
- package/dist/universal/.pi/agent/skills/citable/schemas/finding.schema.json +69 -0
- package/dist/universal/.pi/agent/skills/citable/schemas/remediation-verification.schema.json +98 -0
- package/dist/universal/.pi/agent/skills/citable/schemas/sow.schema.json +92 -0
- package/dist/universal/.qoder/skills/citable/SKILL.md +66 -1
- package/dist/universal/.qoder/skills/citable/VERSION +1 -1
- package/dist/universal/.qoder/skills/citable/manifest.json +9 -6
- package/dist/universal/.qoder/skills/citable/schemas/cli-output-envelope.schema.json +30 -0
- package/dist/universal/.qoder/skills/citable/schemas/finding.schema.json +69 -0
- package/dist/universal/.qoder/skills/citable/schemas/remediation-verification.schema.json +98 -0
- package/dist/universal/.qoder/skills/citable/schemas/sow.schema.json +92 -0
- package/dist/universal/.rovodev/skills/citable/SKILL.md +66 -1
- package/dist/universal/.rovodev/skills/citable/VERSION +1 -1
- package/dist/universal/.rovodev/skills/citable/manifest.json +9 -6
- package/dist/universal/.rovodev/skills/citable/schemas/cli-output-envelope.schema.json +30 -0
- package/dist/universal/.rovodev/skills/citable/schemas/finding.schema.json +69 -0
- package/dist/universal/.rovodev/skills/citable/schemas/remediation-verification.schema.json +98 -0
- package/dist/universal/.rovodev/skills/citable/schemas/sow.schema.json +92 -0
- package/dist/universal/.trae/skills/citable/SKILL.md +66 -1
- package/dist/universal/.trae/skills/citable/VERSION +1 -1
- package/dist/universal/.trae/skills/citable/manifest.json +9 -6
- package/dist/universal/.trae/skills/citable/schemas/cli-output-envelope.schema.json +30 -0
- package/dist/universal/.trae/skills/citable/schemas/finding.schema.json +69 -0
- package/dist/universal/.trae/skills/citable/schemas/remediation-verification.schema.json +98 -0
- package/dist/universal/.trae/skills/citable/schemas/sow.schema.json +92 -0
- package/dist/universal/.trae-cn/skills/citable/SKILL.md +66 -1
- package/dist/universal/.trae-cn/skills/citable/VERSION +1 -1
- package/dist/universal/.trae-cn/skills/citable/manifest.json +9 -6
- package/dist/universal/.trae-cn/skills/citable/schemas/cli-output-envelope.schema.json +30 -0
- package/dist/universal/.trae-cn/skills/citable/schemas/finding.schema.json +69 -0
- package/dist/universal/.trae-cn/skills/citable/schemas/remediation-verification.schema.json +98 -0
- package/dist/universal/.trae-cn/skills/citable/schemas/sow.schema.json +92 -0
- package/dist/universal/manifest.json +112 -76
- package/package.json +1 -1
- package/schemas/cli-output-envelope.schema.json +30 -0
- package/schemas/finding.schema.json +69 -0
- package/schemas/remediation-verification.schema.json +98 -0
- package/schemas/sow.schema.json +92 -0
- package/skill/SKILL.md +66 -1
- package/src/analysis/behavioral.js +126 -0
- package/src/analysis/croAudit.js +302 -0
- package/src/analysis/croRoadmap.js +121 -0
- package/src/analysis/eeat.js +300 -0
- package/src/analysis/funnelAnalysis.js +171 -0
- package/src/analysis/iceMatrix.js +205 -0
- package/src/analysis/offpage.js +228 -0
- package/src/analysis/readiness.js +253 -0
- package/src/analysis/saliency.js +119 -0
- package/src/analysis/schemaRecommendations.js +173 -0
- package/src/analysis/strategicRoadmap.js +148 -0
- package/src/cli/index.js +418 -9
- package/src/commands/answerEngineReadiness.js +48 -0
- package/src/commands/audit.js +2 -2
- package/src/commands/auditBacklinks.js +79 -0
- package/src/commands/ciWorkflow.js +63 -0
- package/src/commands/compatibility.js +205 -0
- package/src/commands/context.js +2 -1
- package/src/commands/croBacklog.js +182 -0
- package/src/commands/croSuite.js +156 -0
- package/src/commands/edgeRules.js +80 -4
- package/src/commands/edgeSecurity.js +192 -0
- package/src/commands/executive.js +6 -0
- package/src/commands/executiveCro.js +30 -0
- package/src/commands/executiveSearch.js +28 -0
- package/src/commands/experimentGuardrails.js +213 -0
- package/src/commands/goldenCorpus.js +155 -0
- package/src/commands/implementationKit.js +202 -0
- package/src/commands/inspectCro.js +67 -0
- package/src/commands/inspectEeat.js +53 -0
- package/src/commands/planExperiment.js +52 -0
- package/src/commands/previewCro.js +241 -0
- package/src/commands/prioritize.js +42 -6
- package/src/commands/remediate.js +461 -0
- package/src/commands/roadmapCmd.js +69 -0
- package/src/commands/schemaCmd.js +10 -2
- package/src/commands/sowCmd.js +67 -0
- package/src/commands/sweep.js +357 -0
- package/src/commands/verifyRemediation.js +204 -0
- package/src/commands/visualRegression.js +165 -0
- package/src/components/index.js +556 -0
- package/src/detectors/cro.js +48 -0
- package/src/detectors/framework.js +31 -1
- package/src/reporting/executiveCroReport.js +731 -0
- package/src/reporting/executiveExport.js +175 -1
- package/src/reporting/executiveSearchReport.js +704 -0
- package/src/sow/admissibilityGate.js +194 -0
- package/src/sow/generateSow.js +762 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { safePath } from '../detectors/framework.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Enterprise Scope Admissibility Gate
|
|
5
|
+
*
|
|
6
|
+
* Filters raw SEO, AEO, GEO, SERP, and CRO findings into contractually admissible
|
|
7
|
+
* work packages, explicitly refusing findings that are exploratory, unverified,
|
|
8
|
+
* economically unjustified, out of organizational boundary, or lack testable acceptance.
|
|
9
|
+
*/
|
|
10
|
+
export function evaluateScopeAdmissibility(findings = [], {
|
|
11
|
+
inScopeProperties = [],
|
|
12
|
+
minIceScore = 8.0,
|
|
13
|
+
allowedDisciplines = ['seo', 'aeo', 'geo', 'technical', 'schema', 'entity', 'cro'],
|
|
14
|
+
allowExperimental = false,
|
|
15
|
+
excludedDetectors = [],
|
|
16
|
+
} = {}) {
|
|
17
|
+
const admitted = [];
|
|
18
|
+
const refused = [];
|
|
19
|
+
|
|
20
|
+
let reqIndex = 1;
|
|
21
|
+
let testIndex = 1;
|
|
22
|
+
|
|
23
|
+
for (let i = 0; i < findings.length; i++) {
|
|
24
|
+
const f = findings[i];
|
|
25
|
+
const detectorId = f.detector_id || `FINDING-${i + 1}`;
|
|
26
|
+
const subject = f.subject?.identifier || f.subject?.url || '/';
|
|
27
|
+
const severity = f.classification?.severity || 'medium';
|
|
28
|
+
const confidence = f.classification?.confidence || 'observed';
|
|
29
|
+
const evidenceList = f.observation?.evidence || [];
|
|
30
|
+
const remediation = f.remediation?.preferred || '';
|
|
31
|
+
|
|
32
|
+
// Gate 1: Excluded detectors / explicitly blacklisted checks
|
|
33
|
+
if (excludedDetectors.includes(detectorId)) {
|
|
34
|
+
refused.push({
|
|
35
|
+
finding_id: detectorId,
|
|
36
|
+
subject,
|
|
37
|
+
gate_failed: 'excluded_detector',
|
|
38
|
+
refusal_code: 'REFUSE-EXCLUDED',
|
|
39
|
+
refusal_rationale: `Detector ${detectorId} is explicitly excluded from contracted SOW delivery scope.`,
|
|
40
|
+
suggested_handling: 'Track in internal backlog; execute under separate advisory engagement.',
|
|
41
|
+
});
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Gate 2: Evidence Maturity Gate
|
|
46
|
+
if (!allowExperimental && (confidence === 'experimental' || f.classification?.finding_type === 'experimental')) {
|
|
47
|
+
refused.push({
|
|
48
|
+
finding_id: detectorId,
|
|
49
|
+
subject,
|
|
50
|
+
gate_failed: 'evidence_maturity',
|
|
51
|
+
refusal_code: 'REFUSE-EXPERIMENTAL',
|
|
52
|
+
refusal_rationale: 'Finding is experimental and lacks deterministic, reproducible evidence. Enterprise SOW requires established empirical certainty.',
|
|
53
|
+
suggested_handling: 'Run controlled observation probes before considering for contractual obligation.',
|
|
54
|
+
});
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (evidenceList.length === 0) {
|
|
59
|
+
refused.push({
|
|
60
|
+
finding_id: detectorId,
|
|
61
|
+
subject,
|
|
62
|
+
gate_failed: 'evidence_maturity',
|
|
63
|
+
refusal_code: 'REFUSE-NO-EVIDENCE',
|
|
64
|
+
refusal_rationale: 'Finding contains no documented supporting evidence in audit package. Cannot contract work without verifiable evidence.',
|
|
65
|
+
suggested_handling: 'Re-audit target with full evidence collection enabled.',
|
|
66
|
+
});
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Gate 3: Scope Boundary Gate
|
|
71
|
+
if (inScopeProperties.length > 0) {
|
|
72
|
+
const isInScope = inScopeProperties.some((prop) => {
|
|
73
|
+
const pStem = prop.replace(/^https?:\/\//, '').replace(/\/+$/, '').toLowerCase();
|
|
74
|
+
const sStem = subject.replace(/^https?:\/\//, '').replace(/\/+$/, '').toLowerCase();
|
|
75
|
+
return sStem.includes(pStem) || pStem.includes(sStem);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
if (!isInScope) {
|
|
79
|
+
refused.push({
|
|
80
|
+
finding_id: detectorId,
|
|
81
|
+
subject,
|
|
82
|
+
gate_failed: 'scope_boundary',
|
|
83
|
+
refusal_code: 'REFUSE-OUT-OF-SCOPE',
|
|
84
|
+
refusal_rationale: `Subject "${subject}" is outside declared contractual in-scope properties (${inScopeProperties.join(', ')}).`,
|
|
85
|
+
suggested_handling: 'Submit Scope Change Request (SCR) to expand in-scope property boundary.',
|
|
86
|
+
});
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Gate 4: Technical Feasibility & Remediation Safety
|
|
92
|
+
if (!remediation || remediation.toLowerCase().includes('consult external legal') || remediation.toLowerCase().includes('out of scope')) {
|
|
93
|
+
refused.push({
|
|
94
|
+
finding_id: detectorId,
|
|
95
|
+
subject,
|
|
96
|
+
gate_failed: 'technical_feasibility',
|
|
97
|
+
refusal_code: 'REFUSE-UNFEASIBLE-REMEDIATION',
|
|
98
|
+
refusal_rationale: 'Finding requires external legal advice or lacks defined engineering remediation method.',
|
|
99
|
+
suggested_handling: 'Refer to customer legal counsel; exclude from engineering delivery.',
|
|
100
|
+
});
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Gate 5: Commercial Materiality & ICE-BV Gate
|
|
105
|
+
// High & critical severity are automatically material; medium/low must meet ICE threshold or be key conversion/vitals defects
|
|
106
|
+
const isCoreSeverity = ['critical', 'high'].includes(severity);
|
|
107
|
+
const isVitalsOrFunnel = ['TECH-001', 'TECH-002', 'CRO-001', 'CRO-002', 'CRO-005', 'CRO-006', 'CRO-007', 'CRO-013', 'CRO-021', 'SCHEMA-001'].includes(detectorId);
|
|
108
|
+
const iceScore = f.ice_score || (isCoreSeverity ? 12 : 6);
|
|
109
|
+
|
|
110
|
+
if (!isCoreSeverity && !isVitalsOrFunnel && iceScore < minIceScore) {
|
|
111
|
+
refused.push({
|
|
112
|
+
finding_id: detectorId,
|
|
113
|
+
subject,
|
|
114
|
+
gate_failed: 'commercial_materiality',
|
|
115
|
+
refusal_code: 'REFUSE-LOW-MATERIALITY',
|
|
116
|
+
refusal_rationale: `Finding has low severity (${severity}) and ICE score (${iceScore} < ${minIceScore}), failing economic justification threshold for core SOW fee envelope.`,
|
|
117
|
+
suggested_handling: 'Defer to customer internal operations backlog or future optimization phase.',
|
|
118
|
+
});
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Gate 6: Objectively Testable Acceptance Gate
|
|
123
|
+
const rerunDetector = f.verification?.detector_to_rerun || detectorId;
|
|
124
|
+
if (!rerunDetector && !f.verification?.method) {
|
|
125
|
+
refused.push({
|
|
126
|
+
finding_id: detectorId,
|
|
127
|
+
subject,
|
|
128
|
+
gate_failed: 'measurable_acceptance',
|
|
129
|
+
refusal_code: 'REFUSE-UNVERIFIABLE',
|
|
130
|
+
refusal_rationale: 'Finding lacks an automated verification rerun detector or objective pass/fail validation method.',
|
|
131
|
+
suggested_handling: 'Define deterministic verification criteria before adding to contractual scope.',
|
|
132
|
+
});
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Passed All 6 Gates -> Admitted to Contractual SOW Scope
|
|
137
|
+
const discipline = (f.discipline?.[0] || detectorId.split('-')[0] || 'TECH').toUpperCase();
|
|
138
|
+
let wpId = 'WP-TECH-01';
|
|
139
|
+
let wpName = 'Technical Search & Performance Infrastructure';
|
|
140
|
+
let deliverableId = 'DELIV-01';
|
|
141
|
+
let owner = 'Supplier Engineering Lead';
|
|
142
|
+
|
|
143
|
+
if (discipline === 'CRO' || detectorId.startsWith('CRO-')) {
|
|
144
|
+
wpId = 'WP-CRO-02';
|
|
145
|
+
wpName = 'Conversion Funnel & Offer Architecture Optimization';
|
|
146
|
+
deliverableId = 'DELIV-02';
|
|
147
|
+
owner = 'Supplier CRO Architect';
|
|
148
|
+
} else if (discipline === 'AEO' || discipline === 'GEO' || discipline === 'ANS') {
|
|
149
|
+
wpId = 'WP-AEO-03';
|
|
150
|
+
wpName = 'Answer-Engine (AEO) & Generative Search Extraction';
|
|
151
|
+
deliverableId = 'DELIV-03';
|
|
152
|
+
owner = 'Supplier Discovery Specialist';
|
|
153
|
+
} else if (discipline === 'SCHEMA' || discipline === 'ENTITY') {
|
|
154
|
+
wpId = 'WP-SCHEMA-04';
|
|
155
|
+
wpName = 'Structured Data & Entity Knowledge Graph Architecture';
|
|
156
|
+
deliverableId = 'DELIV-04';
|
|
157
|
+
owner = 'Supplier Data Engineer';
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const sowReqId = `REQ-SOW-${String(reqIndex++).padStart(3, '0')}`;
|
|
161
|
+
const accTestId = `ACC-TEST-${String(testIndex++).padStart(3, '0')}`;
|
|
162
|
+
const evidenceId = evidenceList[0] || `EVD-OBS-${detectorId}`;
|
|
163
|
+
|
|
164
|
+
admitted.push({
|
|
165
|
+
finding_id: detectorId,
|
|
166
|
+
sow_requirement_id: sowReqId,
|
|
167
|
+
work_package_id: wpId,
|
|
168
|
+
work_package_name: wpName,
|
|
169
|
+
deliverable_id: deliverableId,
|
|
170
|
+
acceptance_test_id: accTestId,
|
|
171
|
+
subject,
|
|
172
|
+
severity,
|
|
173
|
+
confidence,
|
|
174
|
+
recommendation: remediation,
|
|
175
|
+
acceptance_test: `Execute closed-loop verification: citable verify remediation --finding ${detectorId} --target ${subject} (Expect status: RESOLVED, zero regressions)`,
|
|
176
|
+
owner,
|
|
177
|
+
evidence_id: evidenceId,
|
|
178
|
+
commercial_priority: isCoreSeverity ? 'P1_CRITICAL' : 'P2_HIGH_VALUE',
|
|
179
|
+
ice_bv_score: iceScore,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
fact_status: 'admissibility_gate_evaluated',
|
|
185
|
+
summary: {
|
|
186
|
+
total_evaluated: findings.length,
|
|
187
|
+
admitted_count: admitted.length,
|
|
188
|
+
refused_count: refused.length,
|
|
189
|
+
admissibility_rate_pct: findings.length > 0 ? Math.round((admitted.length / findings.length) * 100) : 0,
|
|
190
|
+
},
|
|
191
|
+
admitted_requirements: admitted,
|
|
192
|
+
refusal_log: refused,
|
|
193
|
+
};
|
|
194
|
+
}
|