Files
saherelm a2acb3b055 Update xAiApi Submodule (Chat With Documents) and Add ChangeLog / Plan Documents ...
- Update xAiApi Submodule Pointer to Chat With Documents (In-Memory RAG) Implementation;
- Add Documents/Docs/ChangeLogs/1405-08-03.html (ChangeLog of Pushed Commits);
- Add Documents/Docs/ChangeLogs/1405-08-03-uncommitted.html (ChangeLog of this Commit);
- Add Documents/Docs/ChangeLogs/CommitMessage-1405-08-03.txt;
- Add Documents/Markdown/plan1.md and plan1.html (Chat With Documents Implementation Plan);
- ...
2026-10-25 22:25:20 +03:30

230 lines
18 KiB
HTML

<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>گزارش تغییرات ۱۴۰۵/۰۸/۰۳ - xSaherelmWorkspace</title>
<style>
:root {
--primary: #1e3a8a;
--secondary: #3b82f6;
--accent: #f59e0b;
--success: #10b981;
--danger: #ef4444;
--warning: #f97316;
--bg-light: #f8fafc;
--bg-code: #1e293b;
--text-dark: #0f172a;
--text-muted: #64748b;
--border: #e2e8f0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Tahoma', 'Segoe UI', sans-serif; background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%); color: var(--text-dark); line-height: 1.8; padding: 20px; }
.container { max-width: 1200px; margin: 0 auto; background: white; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.1); overflow: hidden; }
.header { background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); color: white; padding: 40px; text-align: center; }
.header h1 { font-size: 2.1em; margin-bottom: 10px; }
.header .subtitle { font-size: 1.1em; opacity: 0.95; }
.meta-bar { display: flex; justify-content: space-between; background: var(--bg-light); padding: 15px 30px; border-bottom: 2px solid var(--border); flex-wrap: wrap; gap: 15px; }
.meta-item { display: flex; align-items: center; gap: 8px; font-size: 0.9em; color: var(--text-muted); }
.meta-item strong { color: var(--primary); }
.content { padding: 40px; }
.section { margin-bottom: 35px; padding: 25px; background: var(--bg-light); border-radius: 12px; border-right: 5px solid var(--secondary); }
.section h2 { color: var(--primary); font-size: 1.5em; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }
.section h3 { color: var(--secondary); font-size: 1.15em; margin: 22px 0 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 15px; margin-bottom: 10px; }
.stat-card { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 18px; text-align: center; }
.stat-card .value { font-size: 1.9em; font-weight: bold; color: var(--primary); }
.stat-card .label { font-size: 0.85em; color: var(--text-muted); }
.stat-card.add .value { color: var(--success); }
.stat-card.del .value { color: var(--danger); }
table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; margin: 12px 0; font-size: 0.93em; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: top; }
th { background: var(--primary); color: white; font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f1f5f9; }
code { font-family: 'Consolas', 'Courier New', monospace; background: #e2e8f0; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; direction: ltr; display: inline-block; }
pre { background: var(--bg-code); color: #e2e8f0; padding: 16px; border-radius: 8px; direction: ltr; text-align: left; overflow-x: auto; font-family: 'Consolas', 'Courier New', monospace; font-size: 0.88em; line-height: 1.6; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78em; font-weight: bold; color: white; }
.badge.new { background: var(--success); }
.badge.mod { background: var(--warning); }
.badge.sub { background: var(--secondary); }
.commit { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.commit-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.commit-head .msg { font-weight: bold; color: var(--primary); font-size: 1.05em; }
.commit-head .info { color: var(--text-muted); font-size: 0.85em; }
.diffstat { color: var(--text-muted); font-size: 0.85em; }
.diffstat .plus { color: var(--success); font-weight: bold; }
.diffstat .minus { color: var(--danger); font-weight: bold; }
ul { padding-right: 22px; margin: 8px 0; }
li { margin-bottom: 6px; }
.note { background: #fffbeb; border-right: 4px solid var(--accent); padding: 12px 16px; border-radius: 8px; margin-top: 12px; font-size: 0.92em; }
.footer { background: var(--bg-light); border-top: 2px solid var(--border); padding: 18px 30px; text-align: center; color: var(--text-muted); font-size: 0.85em; }
a { color: var(--secondary); text-decoration: none; }
a:hover { text-decoration: underline; }
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>گزارش تغییرات (ChangeLog)</h1>
<div class="subtitle">یکشنبه ۳ آبان ۱۴۰۵ &nbsp;|&nbsp; 2026-10-25 &nbsp;|&nbsp; xSaherelmWorkspace</div>
</div>
<div class="meta-bar">
<div class="meta-item"><strong>نویسنده:</strong> Hadi Khazaee Asl</div>
<div class="meta-item"><strong>برنچ:</strong> <code>master</code></div>
<div class="meta-item"><strong>وضعیت:</strong> همه کامیت‌ها به <code>origin/master</code> پوش شده‌اند</div>
<div class="meta-item"><strong>بازه زمانی:</strong> 17:23 تا 17:58 (+03:30)</div>
</div>
<div class="content">
<!-- خلاصه -->
<div class="section">
<h2>خلاصه</h2>
<div class="stats">
<div class="stat-card"><div class="value">2</div><div class="label">مخزن تغییریافته</div></div>
<div class="stat-card"><div class="value">4</div><div class="label">کامیت پوش‌شده</div></div>
<div class="stat-card"><div class="value">7</div><div class="label">فایل جدید</div></div>
<div class="stat-card"><div class="value">16</div><div class="label">فایل تغییریافته (کل)</div></div>
<div class="stat-card add"><div class="value">+1,454</div><div class="label">خط اضافه‌شده</div></div>
<div class="stat-card del"><div class="value">-9</div><div class="label">خط حذف‌شده</div></div>
</div>
<p>
محور اصلی کارهای امروز، پیاده‌سازی زیرساخت <strong>Chat With Documents</strong> در پروژه
<code>xAiApi</code> بود: افزودن سرویس <strong>تکه‌بندی متن (TextChunker)</strong> و
<strong>مخزن برداری درون‌حافظه‌ای (In-Memory Vector Store)</strong> به‌همراه ریفکتور ثبت سرویس‌ها در DI.
در مخزن اصلی ورک‌اسپیس نیز یادداشت طرح (<code>tmp.md</code> / <code>tmp.html</code>) و پوینتر ساب‌ماژول <code>xAiApi</code> به‌روزرسانی شد.
</p>
</div>
<!-- مخزن اصلی -->
<div class="section">
<h2>۱. مخزن اصلی: xSaherelmWorkspace</h2>
<p>ریموت: <a href="https://git.saherelm.ir/saherelm/xSaherelmWorkspace.git">git.saherelm.ir/saherelm/xSaherelmWorkspace.git</a></p>
<div class="commit">
<div class="commit-head">
<span class="msg">last works ...</span>
<span class="info"><code>2c991e7</code> &nbsp;|&nbsp; 2026-10-25 17:23:25</span>
</div>
<div class="diffstat">3 فایل &nbsp;|&nbsp; <span class="plus">+419</span> / <span class="minus">-1</span></div>
<table>
<thead><tr><th>نوع</th><th>فایل</th><th>تغییر</th><th>توضیح</th></tr></thead>
<tbody>
<tr><td><span class="badge new">جدید</span></td><td><code>Documents/Markdown/tmp.md</code></td><td>+24</td><td>طرح نهایی «Chat With Documents» (SessionId به‌صورت Guid، جریان Ingest → Ask، TTL، TopK/MinScore)</td></tr>
<tr><td><span class="badge new">جدید</span></td><td><code>Documents/Markdown/tmp.html</code></td><td>+394</td><td>نسخه HTML همان طرح</td></tr>
<tr><td><span class="badge sub">ساب‌ماژول</span></td><td><code>xAiApi</code></td><td>+1 / -1</td><td>پوینتر از <code>4b857de</code> به <code>429b97c</code></td></tr>
</tbody>
</table>
</div>
<div class="commit">
<div class="commit-head">
<span class="msg">last ...</span>
<span class="info"><code>43f5cc0</code> &nbsp;|&nbsp; 2026-10-25 17:58:14</span>
</div>
<div class="diffstat">1 فایل &nbsp;|&nbsp; <span class="plus">+1</span> / <span class="minus">-1</span></div>
<table>
<thead><tr><th>نوع</th><th>فایل</th><th>تغییر</th><th>توضیح</th></tr></thead>
<tbody>
<tr><td><span class="badge sub">ساب‌ماژول</span></td><td><code>xAiApi</code></td><td>+1 / -1</td><td>پوینتر از <code>429b97c</code> به <code>47d8a19</code></td></tr>
</tbody>
</table>
</div>
</div>
<!-- xAiApi -->
<div class="section">
<h2>۲. ساب‌ماژول: xAiApi</h2>
<p>ریموت: <a href="https://git.saherelm.ir/saherelm/xSaherElmAiApi.git">git.saherelm.ir/saherelm/xSaherElmAiApi.git</a></p>
<div class="commit">
<div class="commit-head">
<span class="msg">add TextChunker Service for AI Project ...</span>
<span class="info"><code>429b97c</code> &nbsp;|&nbsp; 2026-10-25 17:23:03</span>
</div>
<div class="diffstat">9 فایل &nbsp;|&nbsp; <span class="plus">+760</span> / <span class="minus">-6</span></div>
<table>
<thead><tr><th>نوع</th><th>فایل</th><th>تغییر</th><th>توضیح</th></tr></thead>
<tbody>
<tr><td><span class="badge new">جدید</span></td><td><code>Interfaces/IXTextChunker.cs</code></td><td>+32</td><td>قرارداد سرویس تکه‌بندی: <code>ChunkText(text, source)</code> و <code>ChunkTexts(text)</code></td></tr>
<tr><td><span class="badge new">جدید</span></td><td><code>Providers/XTextChunker.cs</code></td><td>+588</td><td>پیاده‌سازی تکه‌بندی متن با ChunkSize/Overlap، نرمال‌سازی فاصله‌ها و ادغام تکه‌های کوچک</td></tr>
<tr><td><span class="badge new">جدید</span></td><td><code>Models/XTextChunk.cs</code></td><td>+38</td><td>مدل خروجی تکه: <code>Index</code>, <code>Text</code>, <code>Source</code>, <code>Identifier</code> (مثل <code>file.pdf#3</code>), <code>StartOffset</code>, <code>Length</code></td></tr>
<tr><td><span class="badge new">جدید</span></td><td><code>Models/XTextChunkerDescriptor.cs</code></td><td>+33</td><td>تنظیمات: <code>ChunkSize=800</code>, <code>ChunkOverlap=150</code>, <code>MinChunkSize=50</code>, <code>ChunkIdentifierSeparator="#"</code>, <code>NormalizeWhitespace=true</code></td></tr>
<tr><td><span class="badge mod">تغییر</span></td><td><code>Configurations/XAiApiConfiguration.cs</code></td><td>+5</td><td>افزودن پراپرتی <code>TextChunker</code> از نوع <code>XTextChunkerDescriptor</code></td></tr>
<tr><td><span class="badge mod">تغییر</span></td><td><code>DI/XDIHelperExtension.cs</code></td><td>+29</td><td>افزودن <code>AddXAiServices()</code> (انتقال ثبت سرویس‌های AI از Startup) و <code>AddXAiTextChunker()</code> (Singleton)</td></tr>
<tr><td><span class="badge mod">تغییر</span></td><td><code>Extensions/XModelsExtensions.cs</code></td><td>+21 / -1</td><td>افزودن <code>IsValid(this XTextChunkerDescriptor)</code> برای اعتبارسنجی تنظیمات</td></tr>
<tr><td><span class="badge mod">تغییر</span></td><td><code>Startup.cs</code></td><td>+6 / -4</td><td>جایگزینی ثبت مستقیم سرویس‌ها با <code>AddXAiTextChunker()</code> و <code>AddXAiServices()</code></td></tr>
<tr><td><span class="badge mod">تغییر</span></td><td><code>appsettings.Development.json</code></td><td>+8 / -1</td><td>افزودن بخش <code>TextChunker</code> به پیکربندی</td></tr>
</tbody>
</table>
<pre>"TextChunker": {
"ChunkSize": 800,
"ChunkOverlap": 150,
"MinChunkSize": 50,
"NormalizeWhitespace": true,
"ChunkIdentifierSeparator": "#"
}</pre>
</div>
<div class="commit">
<div class="commit-head">
<span class="msg">last ...</span>
<span class="info"><code>47d8a19</code> &nbsp;|&nbsp; 2026-10-25 17:58:05</span>
</div>
<div class="diffstat">5 فایل &nbsp;|&nbsp; <span class="plus">+275</span> / <span class="minus">-2</span></div>
<table>
<thead><tr><th>نوع</th><th>فایل</th><th>تغییر</th><th>توضیح</th></tr></thead>
<tbody>
<tr><td><span class="badge new">جدید</span></td><td><code>Interfaces/IXInMemoryVectorStore.cs</code></td><td>+48</td><td>قرارداد مخزن برداری: <code>CreateSession</code>, <code>Replace</code>, <code>Add</code>, <code>Search(sessionId, queryEmbedding, topK, minScore)</code>, <code>TryGet</code>, <code>Remove</code>, <code>RemoveExpired</code>, <code>Count</code></td></tr>
<tr><td><span class="badge new">جدید</span></td><td><code>Providers/XInMemoryVectorStore.cs</code></td><td>+197</td><td>پیاده‌سازی Singleton درون‌حافظه‌ای مبتنی بر Session (Guid)، پشتیبانی از TTL و بررسی <code>OwnerId</code></td></tr>
<tr><td><span class="badge new">جدید</span></td><td><code>Models/XAiDocumentSession.cs</code></td><td>+18</td><td>مدل Session: <code>Id</code>, <code>Ttl</code>, <code>OwnerId</code>, <code>CreatedAtUtc</code>, <code>LastAccessAtUtc</code>, <code>Vectors</code>, <code>IsExpired()</code></td></tr>
<tr><td><span class="badge mod">تغییر</span></td><td><code>DI/XDIHelperExtension.cs</code></td><td>+8</td><td>افزودن <code>AddXAiInMemoryVectorStore()</code></td></tr>
<tr><td><span class="badge mod">تغییر</span></td><td><code>Startup.cs</code></td><td>+4 / -2</td><td>فراخوانی <code>AddXAiInMemoryVectorStore()</code> و حذف usingهای بلااستفاده</td></tr>
</tbody>
</table>
</div>
<h3>نکات فنی</h3>
<ul>
<li>هر دو سرویس <code>XTextChunker</code> و <code>XInMemoryVectorStore</code> به‌صورت <strong>Singleton</strong> ثبت شده‌اند (Stateless / حافظه مشترک).</li>
<li>داده‌های Vector Store فقط در حافظه نگه‌داری می‌شوند و با انقضای TTL یا حذف Session پاک می‌شوند؛ چیزی در دیتابیس یا دیسک نوشته نمی‌شود.</li>
<li>ثبت سرویس‌های <code>IXDefaultAiService</code>, <code>IXDefaultEmbeddingService</code>, <code>IXDefaultThinkingAiService</code> از <code>Startup.cs</code> به متد <code>AddXAiServices()</code> منتقل شد.</li>
</ul>
<div class="note">
<strong>کارهای باقی‌مانده طبق طرح (tmp.md):</strong> افزودن <code>AskWithContextAsync</code> به <code>IXAiServiceBase</code>،
بازنویسی <code>ChatWithDocumentsController</code> (Endpointهای Ingest / Ask / AskStream / Session)،
ثوابت پرامپت در <code>XAiApiConstants</code>، و یونیت‌تست‌های <code>XTextChunker</code> و <code>XInMemoryVectorStore.Search</code> در <code>xFrameworkTest</code>.
</div>
</div>
<!-- بدون تغییر -->
<div class="section">
<h2>۳. مخازن بدون تغییر</h2>
<p>در ۳۲ ساب‌ماژول زیر امروز هیچ کامیتی ثبت نشده است:</p>
<ul>
<li><strong>Modules (۲۸ مورد):</strong> xAiModels, xAiService, xApiSDKHolder, xCategoryService, xCommons, xContentService, xDataService, xEventService, xExceptions, xFileService, xFrameworkComponentsHolder, xFrameworkCoreHolder, xFrameworkIdentitySDKHolder, xFrameworkPushServiceHolder, xFrameworkServicesHolder, xHttpService, xIdentityHelper, xIdentityModels, xIdentityService, xMessageService, xModels, xPushService, xServices, xStorageService, xStringService, xTagService, xTermsAndConditionsService, xWebinarService</li>
<li><strong>Applications (۴ مورد):</strong> xApi, xClient, xIds, xFrameworkTest</li>
</ul>
</div>
<!-- دستورات -->
<div class="section">
<h2>۴. دستورات استفاده‌شده برای استخراج لاگ</h2>
<pre>git log --since="2026-10-25 00:00" --until="2026-10-26 00:00" --stat --date=iso
git -C xAiApi log --since="2026-10-25 00:00" --stat --date=iso
git status -sb # master...origin/master (in sync)</pre>
</div>
</div>
<div class="footer">
تولیدشده در تاریخ ۱۴۰۵/۰۸/۰۳ (2026-10-25) &nbsp;|&nbsp; فن آوران ساحر علم
</div>
</div>
</body>
</html>