Skip to content

Commit 24166b4

Browse files
committed
feat(learning): complete Program F export substrate
Implement the durable resource/workspace/index/session/memory/export substrate through Program F, add the workspace export bundle route, and sync the bilingual docs to the new verified HEAD state.
1 parent c3a9f51 commit 24166b4

44 files changed

Lines changed: 7239 additions & 132 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/brainstorms/2026-05-25-multiplatform-lightweight-rag-agent-architecture-plan.md

Lines changed: 1308 additions & 0 deletions
Large diffs are not rendered by default.

docs/brainstorms/2026-05-26-deep-student-comparison-next-phase-plan.md

Lines changed: 1087 additions & 0 deletions
Large diffs are not rendered by default.

docs/brainstorms/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ This page tracks active and archived brainstorming outputs used before implement
77

88
| English | 中文 | Date |
99
|---|---|---|
10+
| [Deep Student Comparison Next-Phase Plan](2026-05-26-deep-student-comparison-next-phase-plan.md) | 基于 Deep Student 对照的下一阶段推进计划 | 2026-05-26 |
11+
| [Multiplatform Lightweight RAG and Agent Architecture Plan](2026-05-25-multiplatform-lightweight-rag-agent-architecture-plan.md) | 多平台轻量级 RAG 与 Agent 架构推进计划 | 2026-05-25 |
1012
| [Agent Workspace Contract Closure Next Direction](2026-04-14-agent-workspace-contract-closure-next-direction-requirements.md) | Agent 工作区合约闭合下一步方向 | 2026-04-14 |
1113
| [Markdown Reader Upgrade Alignment](2026-04-13-markdown-reader-upgrade-alignment-requirements.md) | Markdown 阅读器升级对齐 | 2026-04-13 |
1214
| [Agent Workspace Architecture Progress](2026-04-13-agent-workspace-architecture-progress-and-next-direction-requirements.md) | Agent 工作区架构进展 | 2026-04-13 |
@@ -18,6 +20,8 @@ This page tracks active and archived brainstorming outputs used before implement
1820

1921
- Use brainstorm documents to align problem framing, requirements, and scope boundaries.
2022
- 使用头脑风暴文档对齐问题框架、需求和范围边界。
23+
- The 2026-05-26 deep-student comparison plan now includes the implemented Program A-F closure state at current HEAD.
24+
- 2026-05-26 的 deep-student 对照方案文档现已补入当前 HEAD 上 Program A-F 的实际完成状态。
2125
- Align unresolved-goal state with [Open Goal Audit (2026-05-10)](../open_goal_audit_2026-05-10.md) before finalizing implementation plans.
2226
- 在定稿实施计划前,请先用 [Open Goal Audit (2026-05-10)](../open_goal_audit_2026-05-10.md) 对齐未完成目标状态。
2327
- Track implementation execution in:

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,32 @@
33
This page is the implementation-facing dashboard for the Knowledge Mastery evolution plan.
44
It tracks what is already implemented, where the hard gaps remain, and how to verify progress from code and runtime behavior.
55

6+
## 2026-05-26 Program F Closure
7+
8+
- The deep-student-derived next-phase program is now implemented through Program F at current HEAD.
9+
- The new durable substrate is no longer only a plan artifact. It now exists in code:
10+
- canonical resources and projections: `src/resources/`,
11+
- unit/segment indexing lifecycle: `src/indexing/`,
12+
- durable workspace/corpus entities: `src/workspace/`,
13+
- session/workflow durability: `src/session/`, `src/workflows/`,
14+
- typed memory governance and audits: `src/memory/MemoryGovernance.ts`,
15+
- deterministic workspace export bundles: `src/export/WorkspaceExportBundle.ts`.
16+
- `KnowledgeLearningPlatform.ts` now persists and restores those substrate layers alongside graph, mastery, conversation, and telemetry state.
17+
- `POST /api/knowledge/export/workspace` now exposes the Program F bundle path.
18+
- Platform export semantics are now explicit rather than inferred:
19+
- `src/platform/PlatformCapabilities.ts` describes bundle packaging mode (`full` vs `slim`) and indexed-readiness requirements,
20+
- `src/platform/RenderMaterializer.ts` continues to enforce PNG-first materialization where SVG is unsafe.
21+
22+
Fresh verification evidence for this closure:
23+
24+
- `npm.cmd run build:mini`
25+
- `npm.cmd test -- --runInBand src/resources/ResourceRegistry.test.ts src/workspace/WorkspaceRegistry.test.ts src/indexing/IndexLifecycle.test.ts src/session/SessionStateStore.test.ts src/workflows/WorkflowArtifactStore.test.ts src/memory/MemoryGovernance.test.ts src/export/WorkspaceExportBundle.test.ts src/platform/PlatformCapabilities.test.ts src/platform/RenderMaterializer.test.ts src/routes/registry.contract.test.ts src/learning/store.test.ts src/learning/KnowledgeLearningPlatform.test.ts src/learning/KnowledgeLearningPlatform.persistence.test.ts src/learning/KnowledgeLearningPlatform.program-f.test.ts`
26+
27+
Operational implication:
28+
29+
- mobile slim export and desktop export now converge on the same workspace/resource/index/session/memory substrate,
30+
- lightweight local RAG and multi-platform export now share one durable scope model instead of parallel ad hoc state paths.
31+
632
## 2026-05-10 Open-Goal Sync
733

834
- This page is aligned with the repository-wide audit in [Open Goal Audit (2026-05-10)](../../../open_goal_audit_2026-05-10.md).

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,32 @@
33
本页是“知识彻底掌握演进方案”的实现侧进度看板。
44
它用于回答三件事:哪些能力已落地、哪些关键缺口仍在、如何用代码与运行时证据验证推进结果。
55

6+
## 2026-05-26 Program F 收口状态
7+
8+
- 基于 deep-student 对照得出的下一阶段计划,当前 HEAD 已经实现到 Program F。
9+
- 这套 durable substrate 不再只是规划项,而已经真实落入代码:
10+
- canonical resource 与 projection:`src/resources/`
11+
- unit / segment indexing lifecycle:`src/indexing/`
12+
- durable workspace / corpus entity:`src/workspace/`
13+
- session / workflow durability:`src/session/``src/workflows/`
14+
- typed memory governance 与 audit:`src/memory/MemoryGovernance.ts`
15+
- deterministic workspace export bundle:`src/export/WorkspaceExportBundle.ts`
16+
- `KnowledgeLearningPlatform.ts` 现在会把这些 substrate 层与 graph、mastery、conversation、telemetry 状态一起持久化与恢复。
17+
- `POST /api/knowledge/export/workspace` 现已作为 Program F 的 bundle 导出入口暴露出来。
18+
- 平台导出语义也已经显式化,而不再依赖隐式推断:
19+
- `src/platform/PlatformCapabilities.ts` 已描述 bundle packaging mode(`full` / `slim`)与 indexed-readiness 要求,
20+
- `src/platform/RenderMaterializer.ts` 继续负责在 SVG 不安全的平台上强制 PNG-first materialization。
21+
22+
这次收口的最新验证证据:
23+
24+
- `npm.cmd run build:mini`
25+
- `npm.cmd test -- --runInBand src/resources/ResourceRegistry.test.ts src/workspace/WorkspaceRegistry.test.ts src/indexing/IndexLifecycle.test.ts src/session/SessionStateStore.test.ts src/workflows/WorkflowArtifactStore.test.ts src/memory/MemoryGovernance.test.ts src/export/WorkspaceExportBundle.test.ts src/platform/PlatformCapabilities.test.ts src/platform/RenderMaterializer.test.ts src/routes/registry.contract.test.ts src/learning/store.test.ts src/learning/KnowledgeLearningPlatform.test.ts src/learning/KnowledgeLearningPlatform.persistence.test.ts src/learning/KnowledgeLearningPlatform.program-f.test.ts`
26+
27+
工程含义:
28+
29+
- mobile slim export 与 desktop export 现在已经收敛到同一套 workspace / resource / index / session / memory substrate,
30+
- lightweight local RAG 与多平台导出现在共享同一份 durable scope model,而不是各自维护一套 ad hoc 状态路径。
31+
632
## 2026-05-12 HEAD 现实校准
733

834
- 先前“Phase-1 已收口”的表述对当前 HEAD 过于乐观,现以本节为准。

docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ This site adopts the Diataxis framework to make documentation easier to navigate
99
- Use `npm run docs:site:serve` for local browsing during iterative doc updates.
1010
- Use [Working Docs / Brainstorms](brainstorms/index.md) and [Working Docs / Solutions](solutions/index.md) for in-progress alignment artifacts and durable solution notes.
1111
- Use [Open Goal Audit (2026-05-10)](open_goal_audit_2026-05-10.md) as the all-docs unresolved-goal snapshot.
12+
- Track the Program A-F substrate/export closure in [Development Progress Dashboard](diataxis/en/explanation/development-progress-dashboard.md) and [Deep Student Comparison Next-Phase Plan](brainstorms/2026-05-26-deep-student-comparison-next-phase-plan.md).
13+
- Program A-F 的 substrate / export 收口状态请查看 [Development Progress Dashboard](diataxis/en/explanation/development-progress-dashboard.md)[Deep Student Comparison Next-Phase Plan](brainstorms/2026-05-26-deep-student-comparison-next-phase-plan.md)
1214

1315
## English
1416

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import { buildWorkspaceExportBundle } from './WorkspaceExportBundle';
2+
3+
describe('WorkspaceExportBundle', () => {
4+
test('builds deterministic slim bundles with readiness failures when projections lack indexed units', () => {
5+
const bundle = buildWorkspaceExportBundle({
6+
request: {
7+
workspaceId: 'optics',
8+
exportProfileId: 'mobile-slim',
9+
},
10+
workspace: {
11+
workspaceId: 'optics',
12+
corpusId: 'optics',
13+
name: 'optics',
14+
sourcePathPrefix: 'knowledge_base/optics',
15+
languages: ['zh', 'en'],
16+
exportProfileId: 'mobile-slim',
17+
status: 'active',
18+
createdAt: '2026-05-26T00:00:00.000Z',
19+
updatedAt: '2026-05-26T00:00:00.000Z',
20+
},
21+
bindings: [],
22+
resources: [],
23+
projections: [
24+
{
25+
projectionId: 'projection_1',
26+
resourceId: 'resource_1',
27+
projectionKind: 'knowledge_document',
28+
stableKey: 'knowledge_document:doc_a',
29+
status: 'active',
30+
documentId: 'doc_a',
31+
sourcePath: 'Knowledge_Base/optics/doc_a.md',
32+
workspaceId: 'optics',
33+
corpusId: 'optics',
34+
metadata: {},
35+
createdAt: '2026-05-26T00:00:00.000Z',
36+
updatedAt: '2026-05-26T00:00:00.000Z',
37+
deletedAt: null,
38+
},
39+
],
40+
indexSummary: {
41+
totalUnits: 0,
42+
totalSegments: 0,
43+
states: {
44+
pending: 0,
45+
indexing: 0,
46+
indexed: 0,
47+
failed: 0,
48+
disabled: 0,
49+
},
50+
activeDocuments: 0,
51+
activeAtomUnits: 0,
52+
},
53+
units: [],
54+
segments: [],
55+
atoms: [],
56+
evidenceSpans: [],
57+
relationEdges: [],
58+
temporalEdges: [],
59+
sessionStates: [],
60+
conversationSessions: [],
61+
conversationTurns: [],
62+
conversationInvocations: [],
63+
workflowArtifacts: [],
64+
memoryEntries: [],
65+
memoryAuditRecords: [],
66+
generatedAt: '2026-05-26T00:00:00.000Z',
67+
});
68+
69+
const secondBundle = buildWorkspaceExportBundle({
70+
request: {
71+
workspaceId: 'optics',
72+
exportProfileId: 'mobile-slim',
73+
},
74+
workspace: bundle.workspace,
75+
bindings: bundle.bindings,
76+
resources: bundle.resources,
77+
projections: bundle.projections,
78+
indexSummary: bundle.index.summary,
79+
units: bundle.index.units,
80+
segments: bundle.index.segments,
81+
atoms: bundle.graph.atoms,
82+
evidenceSpans: bundle.graph.evidenceSpans,
83+
relationEdges: bundle.graph.relationEdges,
84+
temporalEdges: bundle.graph.temporalEdges,
85+
sessionStates: bundle.runtime.sessionStates,
86+
conversationSessions: bundle.runtime.conversationSessions,
87+
conversationTurns: bundle.runtime.conversationTurns,
88+
conversationInvocations: bundle.runtime.conversationInvocations,
89+
workflowArtifacts: bundle.runtime.workflowArtifacts,
90+
memoryEntries: bundle.memory.entries,
91+
memoryAuditRecords: bundle.memory.auditRecords,
92+
generatedAt: '2026-05-26T00:00:00.000Z',
93+
});
94+
95+
expect(bundle.manifest.packagingMode).toBe('slim');
96+
expect(bundle.readiness.ready).toBe(false);
97+
expect(bundle.readiness.missingIndexedProjectionIds).toEqual(['projection_1']);
98+
expect(bundle.manifest.deterministicHash).toBe(secondBundle.manifest.deterministicHash);
99+
});
100+
});

0 commit comments

Comments
 (0)