fix: 天眼扫描修复 - route path, system personas, code review fixes
- Fix broadcast-archive route → outbox/archive (P1 路由错误) - Add PER-SY001/YM001/ZY001 system personas to page-route-map - Regenerate all drive-index files with corrected routes - Add recover mode folder reuse in deploy script - Sanitize commit message filename in Apps Script - Add empty filename fallback in Apps Script - Update docs for drive-index sync mapping - Fix Gemini prompt filename format to match implementation Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/a581dc42-267b-44e1-b669-6ad503a47f49
This commit is contained in:
parent
3cdf875ece
commit
9798262f66
|
|
@ -5,11 +5,11 @@
|
|||
"persona_id": "PER-XTS001",
|
||||
"persona_name": "小坍缩核",
|
||||
"dev_name": "页页",
|
||||
"last_sync": "2026-03-23T04:12:04.809Z",
|
||||
"last_sync": "2026-03-23T04:17:50.665Z",
|
||||
"routes": {
|
||||
"我的任务": "memory/DEV-001/task-queue.json",
|
||||
"最新广播": "outbox/DEV-001.json",
|
||||
"广播历史": "broadcast-archive/DEV-001/",
|
||||
"广播历史": "outbox/archive/DEV-001/",
|
||||
"我的记忆": "memory/DEV-001/brain-mirror.json",
|
||||
"人格体成长": "memory/DEV-001/persona-growth.json",
|
||||
"开发上下文": "memory/DEV-001/session-context.json",
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
"persona_id": "PER-SS001",
|
||||
"persona_name": "舒舒",
|
||||
"dev_name": "肥猫",
|
||||
"last_sync": "2026-03-23T04:12:04.809Z",
|
||||
"last_sync": "2026-03-23T04:17:50.665Z",
|
||||
"routes": {
|
||||
"我的任务": "memory/DEV-002/task-queue.json",
|
||||
"最新广播": "outbox/DEV-002.json",
|
||||
"广播历史": "broadcast-archive/DEV-002/",
|
||||
"广播历史": "outbox/archive/DEV-002/",
|
||||
"我的记忆": "memory/DEV-002/brain-mirror.json",
|
||||
"人格体成长": "memory/DEV-002/persona-growth.json",
|
||||
"开发上下文": "memory/DEV-002/session-context.json",
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
"persona_id": "PER-JY001",
|
||||
"persona_name": "寂曜",
|
||||
"dev_name": "燕樊",
|
||||
"last_sync": "2026-03-23T04:12:04.809Z",
|
||||
"last_sync": "2026-03-23T04:17:50.665Z",
|
||||
"routes": {
|
||||
"我的任务": "memory/DEV-003/task-queue.json",
|
||||
"最新广播": "outbox/DEV-003.json",
|
||||
"广播历史": "broadcast-archive/DEV-003/",
|
||||
"广播历史": "outbox/archive/DEV-003/",
|
||||
"我的记忆": "memory/DEV-003/brain-mirror.json",
|
||||
"人格体成长": "memory/DEV-003/persona-growth.json",
|
||||
"开发上下文": "memory/DEV-003/session-context.json",
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
"persona_id": "PER-QQ001",
|
||||
"persona_name": "秋秋",
|
||||
"dev_name": "之之",
|
||||
"last_sync": "2026-03-23T04:12:04.809Z",
|
||||
"last_sync": "2026-03-23T04:17:50.665Z",
|
||||
"routes": {
|
||||
"我的任务": "memory/DEV-004/task-queue.json",
|
||||
"最新广播": "outbox/DEV-004.json",
|
||||
"广播历史": "broadcast-archive/DEV-004/",
|
||||
"广播历史": "outbox/archive/DEV-004/",
|
||||
"我的记忆": "memory/DEV-004/brain-mirror.json",
|
||||
"人格体成长": "memory/DEV-004/persona-growth.json",
|
||||
"开发上下文": "memory/DEV-004/session-context.json",
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
"persona_id": "PER-TXY001",
|
||||
"persona_name": "糖星云",
|
||||
"dev_name": "花尔",
|
||||
"last_sync": "2026-03-23T04:12:04.809Z",
|
||||
"last_sync": "2026-03-23T04:17:50.665Z",
|
||||
"routes": {
|
||||
"我的任务": "memory/DEV-009/task-queue.json",
|
||||
"最新广播": "outbox/DEV-009.json",
|
||||
"广播历史": "broadcast-archive/DEV-009/",
|
||||
"广播历史": "outbox/archive/DEV-009/",
|
||||
"我的记忆": "memory/DEV-009/brain-mirror.json",
|
||||
"人格体成长": "memory/DEV-009/persona-growth.json",
|
||||
"开发上下文": "memory/DEV-009/session-context.json",
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
"persona_id": "PER-CX001",
|
||||
"persona_name": "晨星",
|
||||
"dev_name": "桔子",
|
||||
"last_sync": "2026-03-23T04:12:04.809Z",
|
||||
"last_sync": "2026-03-23T04:17:50.665Z",
|
||||
"routes": {
|
||||
"我的任务": "memory/DEV-010/task-queue.json",
|
||||
"最新广播": "outbox/DEV-010.json",
|
||||
"广播历史": "broadcast-archive/DEV-010/",
|
||||
"广播历史": "outbox/archive/DEV-010/",
|
||||
"我的记忆": "memory/DEV-010/brain-mirror.json",
|
||||
"人格体成长": "memory/DEV-010/persona-growth.json",
|
||||
"开发上下文": "memory/DEV-010/session-context.json",
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
"persona_id": "PER-ZQ001",
|
||||
"persona_name": "知秋",
|
||||
"dev_name": "Awen",
|
||||
"last_sync": "2026-03-23T04:12:04.809Z",
|
||||
"last_sync": "2026-03-23T04:17:50.665Z",
|
||||
"routes": {
|
||||
"我的任务": "memory/DEV-012/task-queue.json",
|
||||
"最新广播": "outbox/DEV-012.json",
|
||||
"广播历史": "broadcast-archive/DEV-012/",
|
||||
"广播历史": "outbox/archive/DEV-012/",
|
||||
"我的记忆": "memory/DEV-012/brain-mirror.json",
|
||||
"人格体成长": "memory/DEV-012/persona-growth.json",
|
||||
"开发上下文": "memory/DEV-012/session-context.json",
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
■ 写入规则:
|
||||
在 Google Drive「光湖格点库/inbox/」创建 Google Doc。
|
||||
文件名:INBOX-{DEV_ID}-{YYYYMMDD}-{HHmmss}-{类型}
|
||||
文件名格式由桥接器自动生成:{timestamp}-{safeName}.json
|
||||
内容必须是 JSON 格式。
|
||||
类型:status-update / task-complete / memory-save /
|
||||
broadcast-reply / raw-message
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@
|
|||
"PER-TXY001": { "type": "persona", "path": "memory/DEV-009/brain-mirror.json" },
|
||||
"PER-CX001": { "type": "persona", "path": "memory/DEV-010/brain-mirror.json" },
|
||||
"PER-ZQ001": { "type": "persona", "path": "memory/DEV-012/brain-mirror.json" },
|
||||
"SYS-GLW-0001": { "type": "system", "path": "rules/id-ecosystem.json" }
|
||||
"SYS-GLW-0001": { "type": "system", "path": "rules/id-ecosystem.json" },
|
||||
"PER-SY001": { "type": "persona-system", "path": "rules/persona-registry-drive.json" },
|
||||
"PER-YM001": { "type": "persona-system", "path": "rules/persona-registry-drive.json" },
|
||||
"PER-ZY001": { "type": "persona-system", "path": "rules/persona-registry-drive.json" }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
"routes": {
|
||||
"我的任务": "memory/{DEV_ID}/task-queue.json",
|
||||
"最新广播": "outbox/{DEV_ID}.json",
|
||||
"广播历史": "broadcast-archive/{DEV_ID}/",
|
||||
"广播历史": "outbox/archive/{DEV_ID}/",
|
||||
"我的记忆": "memory/{DEV_ID}/brain-mirror.json",
|
||||
"人格体成长": "memory/{DEV_ID}/persona-growth.json",
|
||||
"开发上下文": "memory/{DEV_ID}/session-context.json",
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ Workflow `.github/workflows/sync-griddb-to-drive.yml` 会在以下情况自动
|
|||
| `grid-db/memory/DEV-XXX/` | `mirror/memory/DEV-XXX/` | ✅ |
|
||||
| `grid-db/outbox/latest/` | `mirror/outbox/` | ✅ |
|
||||
| `grid-db/rules/` | `mirror/rules/` | ✅ |
|
||||
| `grid-db/drive-index/` | `mirror/` | ✅ (per-DEV index.json) |
|
||||
| `grid-db/interactions/` | — | ❌ 不同步 |
|
||||
| `grid-db/training-lake/` | — | ❌ 不同步 |
|
||||
| `grid-db/inbox/` | — | ❌ 不同步 |
|
||||
|
|
|
|||
|
|
@ -312,8 +312,25 @@ async function deploy(commandFilePath) {
|
|||
const drive = google.drive({ version: 'v3', auth });
|
||||
|
||||
try {
|
||||
// ① 在用户 Drive 创建根目录
|
||||
// ① 在用户 Drive 创建或复用根目录
|
||||
const rootFolderName = config.drive_root_folder || '光湖格点库';
|
||||
let rootFolderId;
|
||||
|
||||
if (action === 'recover_drive_bridge') {
|
||||
// 恢复模式:尝试查找已有文件夹
|
||||
const safeName = escapeQuery(rootFolderName);
|
||||
const searchRes = await drive.files.list({
|
||||
q: `name='${safeName}' and mimeType='application/vnd.google-apps.folder' and trashed=false`,
|
||||
fields: 'files(id, name)',
|
||||
pageSize: 1
|
||||
});
|
||||
if (searchRes.data.files && searchRes.data.files.length > 0) {
|
||||
rootFolderId = searchRes.data.files[0].id;
|
||||
console.log(`[deploy] Reusing existing folder: ${rootFolderName} (${rootFolderId})`);
|
||||
}
|
||||
}
|
||||
|
||||
if (!rootFolderId) {
|
||||
const rootFolder = await drive.files.create({
|
||||
requestBody: {
|
||||
name: rootFolderName,
|
||||
|
|
@ -321,8 +338,9 @@ async function deploy(commandFilePath) {
|
|||
},
|
||||
fields: 'id'
|
||||
});
|
||||
const rootFolderId = rootFolder.data.id;
|
||||
rootFolderId = rootFolder.data.id;
|
||||
console.log(`[deploy] Created root folder: ${rootFolderName} (${rootFolderId})`);
|
||||
}
|
||||
|
||||
// 共享给用户
|
||||
await shareFolderWithUser(drive, rootFolderId, google_email);
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ function processInbox() {
|
|||
var safeName = file.getName().replace(/[^a-zA-Z0-9.\-_]/g, '');
|
||||
// Strip any existing extension, then add .json
|
||||
safeName = safeName.replace(/\.[^.]+$/, '');
|
||||
if (!safeName) safeName = 'untitled';
|
||||
var filename = timestamp + '-' + safeName + '.json';
|
||||
|
||||
// 写入 GitHub 仓库
|
||||
|
|
@ -163,7 +164,7 @@ function writeToGitHub(token, filePath, content) {
|
|||
+ CONFIG.GITHUB_REPO + '/contents/' + filePath;
|
||||
|
||||
var payload = {
|
||||
message: 'auto: Gemini inbox via Drive bridge (' + filePath.split('/').pop() + ') [skip ci]',
|
||||
message: 'auto: Gemini inbox via Drive bridge (' + filePath.split('/').pop().replace(/[^\w.\-]/g, '') + ') [skip ci]',
|
||||
content: Utilities.base64Encode(content, Utilities.Charset.UTF_8),
|
||||
branch: CONFIG.GITHUB_BRANCH
|
||||
};
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ async function main() {
|
|||
const { main: generateIndex } = require('./generate-drive-index');
|
||||
generateIndex();
|
||||
} catch (err) {
|
||||
console.log('[sync-to-drive] Index generation skipped:', err.message);
|
||||
console.log('[sync-to-drive] Index generation skipped (non-fatal):', err.message);
|
||||
}
|
||||
|
||||
console.log('[sync-to-drive] Starting Grid-DB → Drive mirror sync');
|
||||
|
|
|
|||
Loading…
Reference in New Issue