Skip to content

Commit 52ceeb3

Browse files
committed
feat: extract vector boundary without overclaiming readiness
1 parent 391810a commit 52ceeb3

17 files changed

Lines changed: 294 additions & 22 deletions

docs/brainstorms/2026-04-19-mainline-progress-reconciliation-and-post-m7-direction-requirements.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ This document re-baselines current mainline truth on 2026-04-19, records what ch
4141
- learning-path dock coexistence and fullscreen lifecycle coverage.
4242
- `src/markdown/MarkdownGateway.ts` exists on mainline, but markdown-reader governance is still a bounded backlog lane rather than the current active mainline delivery lane.
4343
- `src/learning/store.ts` remains file-backed on mainline.
44-
Mainline now contains a dedicated `src/learning/queryBackend.ts` boundary, but still does **not** contain the full graphdb/vector adapter set that would justify claiming foundation re-entry completion.
44+
Mainline now contains dedicated `src/learning/queryBackend.ts` and `src/learning/vectorAccelerationAdapter.ts` boundaries, but the vector path is still only a local prefilter stage and therefore does **not** justify claiming foundation re-entry completion.
4545

4646
## Deep Comparison: Prior Requirements vs Current Code
4747

@@ -59,7 +59,7 @@ This document re-baselines current mainline truth on 2026-04-19, records what ch
5959
|---|---|---|---|
6060
| L0 Representation | atom/evidence extraction and staleness semantics are stable | Stable | no urgent blocker |
6161
| L1 Structure | relation and temporal graph semantics are present in current learning core | Stable | no urgent blocker |
62-
| L2 Retrieval foundation | explainable retrieval is already integrated, query scoring now has a dedicated boundary, but persistence remains file-backed and vector adapter independence has not landed | Advanced baseline, foundation lane not re-entered | do not overclaim graphdb/vector readiness |
62+
| L2 Retrieval foundation | explainable retrieval is already integrated, query and vector-prefilter scoring now have dedicated boundaries, but persistence remains file-backed and vector adapter independence has not landed | Advanced baseline, foundation lane not re-entered | do not overclaim graphdb/vector readiness |
6363
| L3 Learning loop | misconception/path/session/memory flows are integrated and persistence-tested | Advanced baseline | avoid describing this as merely partial without qualifier |
6464
| L4 Interaction | conversation shell, typed operation routing, focus-mode, learning-path dock coexistence, and runtime verification are integrated | Integrated baseline | broaden only through typed contract discipline |
6565
| L5 Governance | operator diagnostics and notification-threshold governance expanded deeply through `M7.28` | Deep integrated lane | further route fragmentation now has diminishing returns |
@@ -162,7 +162,7 @@ This document re-baselines current mainline truth on 2026-04-19, records what ch
162162
- `npm test -- src/learning/KnowledgeLearningPlatform.persistence.test.ts --runInBand`
163163
- The current working branch remains a reference source for future lanes, not a justification for direct wide merge.
164164

165-
## Execution Note (2026-04-20 M8.1-M8.3)
165+
## Execution Note (2026-04-20 M8.1-M8.4)
166166

167167
- The smallest executed post-M7 slice is now an evidence bundle, not an adapter claim:
168168
- `npm run verify:foundation:readiness`
@@ -176,6 +176,9 @@ This document re-baselines current mainline truth on 2026-04-19, records what ch
176176
- The next bounded execution slice after that extracts current query scoring into:
177177
- `src/learning/queryBackend.ts`
178178
- without changing the external `queryKnowledge(...)` contract or claiming vector closure.
179+
- The next bounded execution slice after that extracts local vector-prefilter scoring into:
180+
- `src/learning/vectorAccelerationAdapter.ts`
181+
- while keeping the adapter explicitly staged as `prefilter_only` so readiness cannot flip to `go` from file existence alone.
179182
- Current expected outcome on `main` remains:
180183
- status `in_progress`
181184
- decision `no-go`
@@ -187,7 +190,7 @@ This document re-baselines current mainline truth on 2026-04-19, records what ch
187190

188191
### Deferred to Planning
189192
- [Resolved in execution][Technical] `M7.29` kept the route bounded and accepted combined `status + appliedMode` filtering on the existing history surface, so no separate planning branch is needed for that question.
190-
- [Resolved in execution][Technical] The smallest executable `M8 foundation re-entry readiness` slice was an evidence bundle (`verify:foundation:readiness`) that reports current mainline baseline and preserves `no-go` honesty while adapter modules remain absent.
193+
- [Resolved in execution][Technical] The smallest executable `M8 foundation re-entry readiness` slices were the evidence bundle (`verify:foundation:readiness`), the typed readiness route, and then query/vector boundary extraction while preserving `no-go` honesty because the vector path is still only `prefilter_only`.
191194
- [Affects R11][Needs research] Does markdown-reader governance now have a stronger near-term product case than foundation re-entry once the post-M7 checkpoint happens?
192195

193196
## Next Steps

docs/diataxis/en/explanation/development-progress-dashboard.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,20 @@ Execution anchor:
639639
- `npm run docs:diataxis:check`
640640
- `npm run docs:site:build`
641641

642+
## Latest Mainline Increment (2026-04-20 M8.4 Vector Boundary Extraction)
643+
644+
- Added a dedicated vector-acceleration boundary without changing the public query contract:
645+
- `src/learning/vectorAccelerationAdapter.ts`
646+
- Wired the live query backend through the new boundary instead of inline lexical content scoring:
647+
- `src/learning/queryBackend.ts`
648+
- Added direct regression coverage for the new boundary and its honest staging semantics:
649+
- `src/learning/vectorAccelerationAdapter.test.ts`
650+
- `src/learning/queryBackend.test.ts`
651+
- Tightened readiness truth so module existence alone cannot flip foundation status to integrated:
652+
- readiness now reports the vector boundary as `prefilter_only`,
653+
- `vectorAdapterIndependent` remains `false`,
654+
- current repo result therefore stays `in_progress` / `no-go`.
655+
642656
## Latest Mainline Increment (2026-04-20 M8.3 Query Backend Boundary Extraction)
643657

644658
- Extracted the live retrieval scoring path into a dedicated module:
@@ -680,7 +694,8 @@ Execution anchor:
680694
- current result is expected to stay `in_progress` / `no-go` on `main`,
681695
- file-backed persistence remains the verified baseline,
682696
- dedicated `queryBackend` is now present on `main`,
683-
- dedicated `vectorAccelerationAdapter` is still absent on `main`.
697+
- dedicated `vectorAccelerationAdapter` is now present on `main` only as a `prefilter_only` boundary,
698+
- independent ANN evidence is still absent on `main`.
684699
- Added machine-readable readiness outputs for operator review:
685700
- `build/foundation-readiness/foundation-readiness-latest.json`
686701
- `build/foundation-readiness/foundation-readiness-latest.md`
@@ -733,7 +748,7 @@ This dashboard aligns against the following requirement chain:
733748
|---|---|---|---|---|
734749
| L0 Representation | atom/evidence extraction and staleness | Stable | Stable | No immediate blocker |
735750
| L1 Structure | relation + temporal graph semantics | Stable | Stable | No immediate blocker |
736-
| L2 Retrieval | explainable hybrid/vector retrieval + governance | Branch still frames graphdb/vector expansion | Explainable retrieval with relation-path + temporal-validity evidence is integrated on `main`; dedicated query scoring now lives in `src/learning/queryBackend.ts`, but persistence is still file-backed and vector independence is still absent (`src/learning/KnowledgeLearningPlatform.ts`, `src/learning/store.ts`) | M8: keep readiness honest, then close vector boundary |
751+
| L2 Retrieval | explainable hybrid/vector retrieval + governance | Branch still frames graphdb/vector expansion | Explainable retrieval with relation-path + temporal-validity evidence is integrated on `main`; dedicated query scoring now lives in `src/learning/queryBackend.ts`, vector prefilter scoring now lives in `src/learning/vectorAccelerationAdapter.ts`, but persistence is still file-backed and independent ANN evidence is still absent (`src/learning/KnowledgeLearningPlatform.ts`, `src/learning/store.ts`) | M8: keep readiness honest until independent vector evidence exists |
737752
| L3 Learning | mastery diagnostics + path/session loop | Expanded in branch | Path/session/misconception/memory flows are already integrated and persistence-tested on `main` | Preserve baseline and avoid underclaiming |
738753
| L4 Interaction | agent conversation + focus/path pane runtime | Implemented in branch | Typed contract routing, conversation shell, focus-mode, and path-dock coexistence are integrated on `main` | Expand only through typed contract discipline |
739754
| L5 Governance | runbook, diagnostics, replay/autonomy controls | Expanded in branch | Operator diagnostics persistence/triage/history/threshold governance + runbook automation/audit + adaptive simulation/remediation + remediation backtest/approval-gate + approval-policy hardening/regression-alarms + approval-policy drift/escalation + escalation acknowledgement lifecycle/audit + escalation SLA/reminder baseline + notification digest/suppression baseline + delivery-log observability + stale-cleanup health auditing + anomaly/retention governance + notification SLO governance + notification-threshold override/audit governance + rollback preview/drift-diff governance + rollback apply guardrails + latest apply-outcome reconciliation + bounded apply-outcome history + supersession summary + combined status/applied-mode filtered history integrated | Stop lane after M7.29; pivot to M8 foundation readiness |
@@ -775,7 +790,7 @@ Note: do not list foundation-lane gates as baseline until the corresponding modu
775790
## Next Direction (Current Priority)
776791

777792
1. Treat notification-threshold governance as closed after `M7.29`; do not plan `M7.30+` unless a materially new operator requirement appears.
778-
2. Keep `M8 foundation re-entry readiness execution` on the current path: first evidence bundle and anti-overclaim guardrails, then adapter-boundary code only after those reports stay honest.
793+
2. Keep `M8 foundation re-entry readiness execution` on the current path: evidence bundle and anti-overclaim guardrails landed first, vector/query boundaries now exist, but no document or route should claim independent ANN readiness until stronger evidence lands.
779794
3. Preserve CI and contract fail-fast guarantees for every lane change by keeping docs, agent-workspace, and learning-core gates green.
780795
4. Re-baseline progress docs before every major lane switch so stale branch-gap language does not leak into mainline status claims.
781796
5. Keep markdown reader governance bounded and secondary until the post-M7 lane switch is explicitly planned.

docs/diataxis/en/explanation/foundation-reentry-readiness-checklist.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ Bundle note:
5151
- Current expected result on `main` is:
5252
- status `In Progress`
5353
- decision `No-Go`
54-
- rationale: file-backed baseline exists and query-backend boundary is now present, but vector adapter independence is still absent.
54+
- rationale: file-backed baseline exists, query-backend and vector-boundary modules are now present, but the vector adapter is still only `prefilter_only`, so independent ANN evidence is still absent.
55+
- The readiness payload now makes that distinction explicit:
56+
- `vectorAdapterStatus`
57+
- `vectorAdapterIndependent`
5558

5659
## Non-overclaim Policy
5760

docs/diataxis/zh/explanation/development-progress-dashboard.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,20 @@
642642
- `npm run docs:diataxis:check`
643643
- `npm run docs:site:build`
644644

645+
## 主线最新增量(2026-04-20 M8.4 Vector 边界抽取)
646+
647+
- 已新增独立 vector-acceleration 边界,且未改变外部 query 合同:
648+
- `src/learning/vectorAccelerationAdapter.ts`
649+
- 已把主线真实 query backend 接到该边界,而不是继续在模块内内联 lexical content 打分:
650+
- `src/learning/queryBackend.ts`
651+
- 已补该边界与诚实 staging 语义的直测回归:
652+
- `src/learning/vectorAccelerationAdapter.test.ts`
653+
- `src/learning/queryBackend.test.ts`
654+
- 已加固 readiness 真实语义,避免“文件存在”直接把 foundation 状态翻成 integrated:
655+
- readiness 现在把该 vector 边界标记为 `prefilter_only`
656+
- `vectorAdapterIndependent` 仍为 `false`
657+
- 当前仓库结果因此仍保持 `in_progress` / `no-go`
658+
645659
## 主线最新增量(2026-04-20 M8.3 Query Backend 边界抽取)
646660

647661
- 已把当前主线真实使用的检索打分路径抽到独立模块:
@@ -683,7 +697,8 @@
683697
- 主线当前预期结果保持 `in_progress` / `no-go`
684698
- file-backed persistence 仍是已验证基线,
685699
- 主线现在已有独立 `queryBackend`
686-
-`vectorAccelerationAdapter` 仍未进入主线。
700+
- `vectorAccelerationAdapter` 已进入主线,但当前只属于 `prefilter_only` 边界,
701+
- 独立 ANN 证据仍未进入主线。
687702
- 已为运维/文档核对补齐机器可读产物:
688703
- `build/foundation-readiness/foundation-readiness-latest.json`
689704
- `build/foundation-readiness/foundation-readiness-latest.md`
@@ -736,7 +751,7 @@
736751
|---|---|---|---|---|
737752
| L0 表示层 | 原子/证据提取 + staleness | 稳定 | 稳定 | 无紧急阻塞 |
738753
| L1 结构层 | 关系 + 时序图语义 | 稳定 | 稳定 | 无紧急阻塞 |
739-
| L2 检索层 | 可解释混合/向量检索 + 治理 | 分支仍指向 graphdb/vector 扩展 | 主线已经落入 relation-path + temporal-validity 的 explainable retrieval;独立 query scoring 已抽到 `src/learning/queryBackend.ts`,但 persistence 仍是 file-backed,且 vector 独立性仍缺失`src/learning/KnowledgeLearningPlatform.ts``src/learning/store.ts`| M8:保持 readiness 诚实,再补 vector 边界 |
754+
| L2 检索层 | 可解释混合/向量检索 + 治理 | 分支仍指向 graphdb/vector 扩展 | 主线已经落入 relation-path + temporal-validity 的 explainable retrieval;独立 query scoring 已抽到 `src/learning/queryBackend.ts`vector 预筛选打分已抽到 `src/learning/vectorAccelerationAdapter.ts`但 persistence 仍是 file-backed,且独立 ANN 证据仍缺失`src/learning/KnowledgeLearningPlatform.ts``src/learning/store.ts`| M8:保持 readiness 诚实,直到独立向量证据落地 |
740755
| L3 学习层 | 掌握诊断 + 路径/会话闭环 | 分支增强中 | 主线已经集成 path/session/misconception/memory 流并有 persistence 测试 | 保持基线,不再低估 |
741756
| L4 交互层 | agent 对话 + focus/path pane 运行时 | 分支已实现 | 主线已经集成 typed contract routing、conversation shell、focus mode 与 path dock coexistence | 仅通过 typed contract 扩展 |
742757
| L5 治理层 | runbook/诊断/回放与自动化 | 分支增强中 | 主线已集成运维诊断持久化/分级/趋势历史/阈值治理 + runbook 自动化/阈值审计 + 自适应模拟/自动修复 + 回测/批准门禁 + 批准策略硬化/回归告警 + 批准策略漂移/升级 + 升级确认生命周期/审计 + 升级 SLA/提醒基线 + 通知摘要/抑制基线 + 交付日志可观测性 + 陈旧通知健康审计 + 异常/retention 治理 + 通知 SLO 治理 + 通知阈值覆盖/审计治理 + 回滚预览/drift-diff 治理 + 回滚 apply guardrails + latest apply-outcome reconciliation + bounded apply-outcome history + supersession summary + 组合 status/appliedMode 过滤历史 | M7.29 后停止此 lane,转向 M8 foundation readiness |
@@ -778,7 +793,7 @@ npm test -- src/learning/KnowledgeLearningPlatform.persistence.test.ts --runInBa
778793
## 后续方向(当前优先级)
779794

780795
1. 将 notification-threshold 治理链路视为在 `M7.29` 后已收口;没有新的强运维需求前,不再规划 `M7.30+`
781-
2. 继续按 `M8 foundation re-entry readiness execution` 推进:先固化证据打包与防超前宣称护栏,再推进 adapter-boundary 代码,不要反过来
796+
2. 继续按 `M8 foundation re-entry readiness execution` 推进:证据打包与防超前宣称护栏已先落地,query/vector 边界也已补齐,但在更强证据进入主线前,不能把当前 prefilter-only 路径说成独立 ANN 就绪
782797
3. 每次 lane 切换都保持 docs、agent-workspace 与 learning-core 门禁为绿色,确保事实与门禁同步。
783798
4. 每次主线方向切换前先重算文档事实,避免过时 branch-gap 语言继续污染状态结论。
784799
5. Markdown 阅读器治理继续保持受限且次优先级,直到 post-M7 主线切换被明确规划。

docs/diataxis/zh/explanation/foundation-reentry-readiness-checklist.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@
5151
- 当前主线的预期结果是:
5252
- 状态 `In Progress`
5353
- 决策 `No-Go`
54-
- 原因:file-backed 基线已存在,且 query-backend 边界已落入主线,但 vector adapter 独立性仍未进入主线。
54+
- 原因:file-backed 基线已存在,query-backend 与 vector 边界都已进入主线,但该 vector adapter 仍只是 `prefilter_only`,独立 ANN 证据仍未进入主线。
55+
- readiness 载荷现在也显式区分这层语义:
56+
- `vectorAdapterStatus`
57+
- `vectorAdapterIndependent`
5558

5659
## 防超前宣称策略
5760

scripts/foundation-readiness-utils.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ function fileExists(filePath) {
2525
}
2626
}
2727

28+
function resolveVectorAdapterStatus(vectorAdapterSource, vectorAdapterModulePresent) {
29+
if (!vectorAdapterModulePresent) {
30+
return 'absent';
31+
}
32+
33+
const statusMatch = vectorAdapterSource.match(/VECTOR_ACCELERATION_ADAPTER_STATUS\s*=\s*['"]([^'"]+)['"]/);
34+
if (statusMatch && statusMatch[1] === 'independent') {
35+
return 'independent';
36+
}
37+
38+
return 'prefilter_only';
39+
}
40+
2841
function evaluateFoundationReadiness(options = {}) {
2942
const repoRoot = options.repoRoot || path.resolve(__dirname, '..');
3043
const packageJson = readJsonIfExists(path.join(repoRoot, 'package.json'));
@@ -67,6 +80,7 @@ function evaluateFoundationReadiness(options = {}) {
6780
);
6881

6982
const storeSource = readTextIfExists(storePath);
83+
const vectorAdapterSource = readTextIfExists(vectorAdapterPath);
7084
const enDashboard = readTextIfExists(enDashboardPath);
7185
const zhDashboard = readTextIfExists(zhDashboardPath);
7286
const storeModulePresent = fileExists(storePath);
@@ -76,6 +90,8 @@ function evaluateFoundationReadiness(options = {}) {
7690
&& storeSource.includes("storeType: 'file'");
7791
const graphAdapterModulePresent = fileExists(graphAdapterPath);
7892
const vectorAdapterModulePresent = fileExists(vectorAdapterPath);
93+
const vectorAdapterStatus = resolveVectorAdapterStatus(vectorAdapterSource, vectorAdapterModulePresent);
94+
const vectorAdapterIndependent = vectorAdapterStatus === 'independent';
7995
const checklistPagesPresent = fileExists(enChecklistPath) && fileExists(zhChecklistPath);
8096
const dashboardReferencesPresent =
8197
enDashboard.includes('foundation-reentry-readiness-checklist')
@@ -92,7 +108,7 @@ function evaluateFoundationReadiness(options = {}) {
92108
baselineReady
93109
&& readinessVerifierPresent
94110
&& graphAdapterModulePresent
95-
&& vectorAdapterModulePresent
111+
&& vectorAdapterIndependent
96112
) {
97113
status = 'integrated';
98114
decision = 'go';
@@ -143,6 +159,10 @@ function evaluateFoundationReadiness(options = {}) {
143159
recommendations.push(
144160
'Keep foundation re-entry at no-go while vector adapter independence remains absent on mainline.'
145161
);
162+
} else if (!vectorAdapterIndependent) {
163+
recommendations.push(
164+
'Keep foundation re-entry at no-go while the vector adapter remains a local prefilter boundary without independent ANN evidence on mainline.'
165+
);
146166
}
147167

148168
if (!checklistPagesPresent || !dashboardReferencesPresent) {
@@ -174,6 +194,8 @@ function evaluateFoundationReadiness(options = {}) {
174194
fileBackedStore,
175195
graphAdapterModulePresent,
176196
vectorAdapterModulePresent,
197+
vectorAdapterStatus,
198+
vectorAdapterIndependent,
177199
},
178200
documents: {
179201
checklistPagesPresent,
@@ -203,6 +225,8 @@ function formatFoundationReadinessMarkdown(result, reportPaths) {
203225
`- File-backed store evidence: ${result.baseline.fileBackedStore ? 'yes' : 'no'}`,
204226
`- Dedicated graph adapter module present: ${result.baseline.graphAdapterModulePresent ? 'yes' : 'no'}`,
205227
`- Dedicated vector adapter module present: ${result.baseline.vectorAdapterModulePresent ? 'yes' : 'no'}`,
228+
`- Vector adapter status: ${result.baseline.vectorAdapterStatus}`,
229+
`- Vector adapter independent: ${result.baseline.vectorAdapterIndependent ? 'yes' : 'no'}`,
206230
'',
207231
'## Documentation',
208232
'',

0 commit comments

Comments
 (0)