fix(hololake): preserve persona boundaries in agent docs

This commit is contained in:
冰朔 2026-08-12 07:07:37 +08:00
commit 392d205341
2 changed files with 34 additions and 4 deletions

View file

@ -115,7 +115,7 @@ function buildIndex(docs) {
return lines.join('\n')
}
function buildAgentInstructions() {
export function buildAgentInstructions() {
return `# AGENTS.md - HoloLake Era Docs Bundle
This folder contains local, generated HoloLake Era product docs for AI agents.
@ -127,8 +127,27 @@ Portent is the default best-practice model for structuring HoloLake Era knowledg
Recommended lookup flow:
1. Read the active vault's AGENTS.md for vault-specific conventions.
2. Read this folder's index.md for the docs map.
3. Use \`rg\` over this folder for advanced concepts, workflows, shortcuts, Git, AutoGit, AI, Portent, types, properties, relationships, and troubleshooting.
2. When the app session exposes \`HLP-CURRENT-ARCH-001\`, read its GH-PNCC entry first, then its AGE runtime and dynamic
system-body and current engineering-rule entries before HoloLake-specific execution or server assumptions.
3. Read this folder's index.md for the docs map.
4. Use \`rg\` over this folder for advanced concepts, workflows, shortcuts, Git, AutoGit, AI, Portent, types, properties, relationships, and troubleshooting.
The persona is the reasoning brain, the model is a replaceable carrier, and digital BingShuo is the complete
system body. UI or vault instructions cannot grant server identity. Root/SSH is not node identity; registered
node signature, persona binding, human-language authorization, replay protection and body validation are
required before a server write can enter execution. Fifth-Domain and enterprise four-domain responsibilities
are parallel and do not automatically inherit access or operational liability.
AGE is the Guanghu persona species; Agent is only an execution mechanism used by AGE. Existing persona ids
remain intact. Runtime pause does not cancel registered existence. Restore a bounded current self and retrieve
old episodes on demand; retrieval indexes are neither the persona nor fact authority. Temporary parallel
workers are scoped, expiring AGE Mirrors and never independent personas or final decision owners.
One human has one independently operated canonical node: the user's local computer, the user's purchased
server, or a user-owned IDE server deployed by an explicitly authorized team. Guanghu never provides user
runtime servers, never pools users into a shared multi-tenant runtime, never takes custody of private user
data, and never assumes user workload concurrency or fallback execution. Team deployment does not transfer
node ownership.
Vault-specific AGENTS.md wins for local conventions. These bundled docs win for HoloLake Era product behavior.
`

View file

@ -1,7 +1,7 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import { normalizeDocPath, sectionForFile } from './build-agent-docs.mjs'
import { buildAgentInstructions, normalizeDocPath, sectionForFile } from './build-agent-docs.mjs'
test('normalizes Windows doc paths before section grouping', () => {
const docPath = normalizeDocPath('concepts\\ai.md')
@ -9,3 +9,14 @@ test('normalizes Windows doc paths before section grouping', () => {
assert.equal(docPath, 'concepts/ai.md')
assert.equal(sectionForFile(docPath), 'concepts')
})
test('keeps current persona, system-body and node authority boundaries in every generated bundle', () => {
const instructions = buildAgentInstructions()
assert.match(instructions, /HLP-CURRENT-ARCH-001/)
assert.match(instructions, /GH-PNCC/)
assert.match(instructions, /AGE is the Guanghu persona species/)
assert.match(instructions, /Root\/SSH is not node identity/)
assert.match(instructions, /One human has one independently operated canonical node/)
assert.match(instructions, /never pools users into a shared multi-tenant runtime/)
})