@yyc3/ai-family-kernel 0.0.0-stage → 2.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/index.d.ts +24 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/index.js +24 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-1-foundation/foundation-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-1-foundation/foundation-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-1-foundation/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-1-foundation/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-2-bole/bole-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-2-bole/bole-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-2-bole/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-2-bole/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-3-prophet/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-3-prophet/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-3-prophet/prophet-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-3-prophet/prophet-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-4-thinker/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-4-thinker/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-4-thinker/thinker-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-4-thinker/thinker-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-5-navigator/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-5-navigator/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-5-navigator/navigator-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-5-navigator/navigator-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-6-creative/creative-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-6-creative/creative-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-6-creative/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-6-creative/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-7-master/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-7-master/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-7-master/master-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-7-master/master-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-8-guardian/guardian-capability.d.ts +16 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-8-guardian/guardian-capability.js +29 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-8-guardian/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-8-guardian/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-9-meta-oracle/index.d.ts +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-9-meta-oracle/index.js +4 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-9-meta-oracle/meta-oracle-capability.d.ts +17 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-9-meta-oracle/meta-oracle-capability.js +30 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-registry.d.ts +34 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/layer-registry.js +76 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/types.d.ts +49 -0
- package/dist/src/01-/344/271/235/345/261/202/346/236/266/346/236/204/345/210/206/345/261/202/345/272/225/345/272/247/types.js +33 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/index.d.ts +7 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/index.js +7 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/orchestrator.d.ts +47 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/orchestrator.js +59 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/task-decomposer.d.ts +21 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/task-decomposer.js +72 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/confidence-calibrator.d.ts +31 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/confidence-calibrator.js +39 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/consistency-metrics.d.ts +45 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/consistency-metrics.js +44 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/cross-validator.d.ts +44 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/cross-validator.js +69 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/gateway.d.ts +64 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/gateway.js +96 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/ground-truth-checker.d.ts +33 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/ground-truth-checker.js +74 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/index.d.ts +12 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/index.js +12 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/oracle-registry.d.ts +18 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/cloud-pivot-orchestrator/verification-gateway/oracle-registry.js +26 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/dashu-self-healing/index.d.ts +5 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/dashu-self-healing/index.js +5 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/dashu-self-healing/self-healing-controller.d.ts +33 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/dashu-self-healing/self-healing-controller.js +68 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-communication-bus/event-bus.d.ts +99 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-communication-bus/event-bus.js +178 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-communication-bus/index.d.ts +7 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-communication-bus/index.js +7 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-communication-bus/trajectory-bridge.d.ts +57 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-communication-bus/trajectory-bridge.js +72 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-phone-system/index.d.ts +4 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-phone-system/index.js +4 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-phone-system/phone-system.d.ts +46 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/family-phone-system/phone-system.js +85 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/global-status-center/index.d.ts +4 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/global-status-center/index.js +4 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/global-status-center/status-center.d.ts +27 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/global-status-center/status-center.js +57 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/index.d.ts +21 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/index.js +21 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/bus-mcp-codec.d.ts +29 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/bus-mcp-codec.js +84 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/index.d.ts +31 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/index.js +28 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/server/index.d.ts +5 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/server/index.js +5 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/server/protocol.d.ts +80 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/server/protocol.js +148 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/stdio-transport.d.ts +47 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/stdio-transport.js +178 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/types.d.ts +63 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/mcp-adapter/types.js +7 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/types.d.ts +167 -0
- package/dist/src/02-/344/272/221/346/236/242/346/240/270/345/277/203/345/274/225/346/223/216/types.js +23 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/index.d.ts +7 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/index.js +7 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/outcome-labeler.d.ts +34 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/outcome-labeler.js +38 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/pattern-extractor.d.ts +64 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/pattern-extractor.js +94 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/trajectory-collector.d.ts +39 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/experience-reflow/trajectory-collector.js +36 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/index.d.ts +23 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/index.js +23 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/index.d.ts +7 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/index.js +7 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/preference-tracker.d.ts +32 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/preference-tracker.js +49 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/rule-evolution.d.ts +41 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/rule-evolution.js +60 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/semantic-diff.d.ts +32 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/knowledge-update/semantic-diff.js +69 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-loop.d.ts +146 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-loop.js +171 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-scheduler/budget-allocator.d.ts +29 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-scheduler/budget-allocator.js +58 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-scheduler/index.d.ts +6 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-scheduler/index.js +6 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-scheduler/priority-queue.d.ts +22 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/learning-scheduler/priority-queue.js +34 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/param-adaptation.d.ts +59 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/param-adaptation.js +55 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/index.d.ts +12 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/index.js +12 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-eval.d.ts +77 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-eval.js +110 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-executor.d.ts +51 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-executor.js +63 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-id.d.ts +32 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-id.js +54 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-index.d.ts +29 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-index.js +32 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-merger.d.ts +26 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-merger.js +65 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-pruner.d.ts +31 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-pruner.js +35 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-store-file.d.ts +33 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-store-file.js +76 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-versioner.d.ts +33 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/skill-consolidation/skill-versioner.js +63 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/forgetting-detector.d.ts +31 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/forgetting-detector.js +26 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/index.d.ts +7 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/index.js +7 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/regression-tester.d.ts +30 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/regression-tester.js +48 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/rollback-controller.d.ts +19 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/stability-guard/rollback-controller.js +19 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/types.d.ts +137 -0
- package/dist/src/05-/346/214/201/347/273/255/345/255/246/344/271/240/345/274/225/346/223/216/types.js +22 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/compliance-audit/compliance-audit.d.ts +20 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/compliance-audit/compliance-audit.js +83 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/compliance-audit/index.d.ts +4 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/compliance-audit/index.js +4 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/index.d.ts +18 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/index.js +18 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/index.d.ts +6 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/index.js +6 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/policy-bus.d.ts +39 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/policy-bus.js +73 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/policy-registry.d.ts +19 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/policy-registry.js +44 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/security-policies.d.ts +54 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/policy-registry/security-policies.js +80 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/quality-governance/index.d.ts +4 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/quality-governance/index.js +4 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/quality-governance/quality-governance.d.ts +23 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/quality-governance/quality-governance.js +38 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/security-governance/index.d.ts +4 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/security-governance/index.js +4 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/security-governance/security-governance.d.ts +24 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/security-governance/security-governance.js +29 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/types.d.ts +77 -0
- package/dist/src/06-/346/262/273/347/220/206/344/270/255/345/277/203/types.js +17 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/consistency-repair/consistency-repair.d.ts +25 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/consistency-repair/consistency-repair.js +66 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/consistency-repair/index.d.ts +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/consistency-repair/index.js +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/degradation-controller/degradation-controller.d.ts +50 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/degradation-controller/degradation-controller.js +90 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/degradation-controller/index.d.ts +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/degradation-controller/index.js +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/fault-detector/fault-detector.d.ts +42 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/fault-detector/fault-detector.js +55 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/fault-detector/index.d.ts +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/fault-detector/index.js +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/index.d.ts +19 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/index.js +19 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/rollback-controller/index.d.ts +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/rollback-controller/index.js +4 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/rollback-controller/rollback-controller.d.ts +36 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/rollback-controller/rollback-controller.js +71 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/types.d.ts +73 -0
- package/dist/src/07-/350/207/252/346/204/210/344/270/255/345/277/203/types.js +63 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/index.d.ts +5 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/index.js +5 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/mcp-server-assembly.d.ts +48 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/mcp-server-assembly.js +53 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/runtime-assembly.d.ts +175 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/runtime-assembly.js +249 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/runtime-entry.d.ts +68 -0
- package/dist/src/08-/347/263/273/347/273/237/350/243/205/351/205/215/runtime-entry.js +86 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/capability-instrumentation.d.ts +53 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/capability-instrumentation.js +85 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/collaboration-instrumentation.d.ts +56 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/collaboration-instrumentation.js +100 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/family-metrics.d.ts +172 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/family-metrics.js +314 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/index.d.ts +8 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/index.js +8 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/metrics-registry.d.ts +123 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/metrics-registry.js +270 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/metrics-server.d.ts +45 -0
- package/dist/src/09-/345/217/257/350/247/202/346/265/213/346/200/247/metrics-server.js +86 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/allowlist.d.ts +79 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/allowlist.js +122 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/catalog.d.ts +67 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/catalog.js +71 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/index.d.ts +14 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/index.js +10 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/integrity.d.ts +44 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/integrity.js +99 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/plugin-loader.d.ts +39 -0
- package/dist/src/10-/350/203/275/345/212/233/346/263/250/345/206/214/344/270/255/345/277/203/plugin-loader.js +89 -0
- package/dist/src/a2a-adapter/card-discovery.d.ts +40 -0
- package/dist/src/a2a-adapter/card-discovery.js +47 -0
- package/dist/src/a2a-adapter/index.d.ts +7 -0
- package/dist/src/a2a-adapter/index.js +7 -0
- package/dist/src/a2a-adapter/task-delegate.d.ts +85 -0
- package/dist/src/a2a-adapter/task-delegate.js +94 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.js +10 -0
- package/dist/vendor/memory-framework/episodic-store/episode-indexer.d.ts +30 -0
- package/dist/vendor/memory-framework/episodic-store/episode-indexer.js +45 -0
- package/dist/vendor/memory-framework/episodic-store/index.d.ts +30 -0
- package/dist/vendor/memory-framework/episodic-store/index.js +45 -0
- package/dist/vendor/memory-framework/episodic-store/retrieval-adapter.d.ts +20 -0
- package/dist/vendor/memory-framework/episodic-store/retrieval-adapter.js +29 -0
- package/dist/vendor/memory-framework/episodic-store/trajectory-logger.d.ts +36 -0
- package/dist/vendor/memory-framework/episodic-store/trajectory-logger.js +32 -0
- package/dist/vendor/memory-framework/index.d.ts +19 -0
- package/dist/vendor/memory-framework/index.js +19 -0
- package/dist/vendor/memory-framework/memory-orchestrator/consistency-checker.d.ts +20 -0
- package/dist/vendor/memory-framework/memory-orchestrator/consistency-checker.js +41 -0
- package/dist/vendor/memory-framework/memory-orchestrator/index.d.ts +55 -0
- package/dist/vendor/memory-framework/memory-orchestrator/index.js +185 -0
- package/dist/vendor/memory-framework/memory-orchestrator/retrieval-router.d.ts +21 -0
- package/dist/vendor/memory-framework/memory-orchestrator/retrieval-router.js +37 -0
- package/dist/vendor/memory-framework/procedural-memory/guardrail-registry.d.ts +34 -0
- package/dist/vendor/memory-framework/procedural-memory/guardrail-registry.js +22 -0
- package/dist/vendor/memory-framework/procedural-memory/index.d.ts +31 -0
- package/dist/vendor/memory-framework/procedural-memory/index.js +34 -0
- package/dist/vendor/memory-framework/procedural-memory/prompt-rule-extractor.d.ts +95 -0
- package/dist/vendor/memory-framework/procedural-memory/prompt-rule-extractor.js +160 -0
- package/dist/vendor/memory-framework/procedural-memory/skill-registry.d.ts +115 -0
- package/dist/vendor/memory-framework/procedural-memory/skill-registry.js +165 -0
- package/dist/vendor/memory-framework/procedural-memory/workflow-patterns.d.ts +36 -0
- package/dist/vendor/memory-framework/procedural-memory/workflow-patterns.js +22 -0
- package/dist/vendor/memory-framework/semantic-graph/entity-resolver.d.ts +26 -0
- package/dist/vendor/memory-framework/semantic-graph/entity-resolver.js +61 -0
- package/dist/vendor/memory-framework/semantic-graph/index.d.ts +23 -0
- package/dist/vendor/memory-framework/semantic-graph/index.js +25 -0
- package/dist/vendor/memory-framework/semantic-graph/knowledge-graph.d.ts +50 -0
- package/dist/vendor/memory-framework/semantic-graph/knowledge-graph.js +44 -0
- package/dist/vendor/memory-framework/sensory-buffer/index.d.ts +41 -0
- package/dist/vendor/memory-framework/sensory-buffer/index.js +70 -0
- package/dist/vendor/memory-framework/types.d.ts +192 -0
- package/dist/vendor/memory-framework/types.js +42 -0
- package/dist/vendor/memory-framework/working-context/attention-scorer.d.ts +39 -0
- package/dist/vendor/memory-framework/working-context/attention-scorer.js +45 -0
- package/dist/vendor/memory-framework/working-context/context-window.d.ts +33 -0
- package/dist/vendor/memory-framework/working-context/context-window.js +35 -0
- package/dist/vendor/memory-framework/working-context/index.d.ts +30 -0
- package/dist/vendor/memory-framework/working-context/index.js +44 -0
- package/dist/vendor/memory-framework/write-policy/consolidation.d.ts +37 -0
- package/dist/vendor/memory-framework/write-policy/consolidation.js +50 -0
- package/dist/vendor/memory-framework/write-policy/forgetting-policy.d.ts +28 -0
- package/dist/vendor/memory-framework/write-policy/forgetting-policy.js +31 -0
- package/dist/vendor/memory-framework/write-policy/index.d.ts +40 -0
- package/dist/vendor/memory-framework/write-policy/index.js +50 -0
- package/dist/vendor/memory-framework/write-policy/salience-scorer.d.ts +41 -0
- package/dist/vendor/memory-framework/write-policy/salience-scorer.js +70 -0
- package/dist/vendor/self-judge-kit/assumption-tracker.d.ts +31 -0
- package/dist/vendor/self-judge-kit/assumption-tracker.js +45 -0
- package/dist/vendor/self-judge-kit/confidence-scorer.d.ts +46 -0
- package/dist/vendor/self-judge-kit/confidence-scorer.js +60 -0
- package/dist/vendor/self-judge-kit/deviation-detector.d.ts +23 -0
- package/dist/vendor/self-judge-kit/deviation-detector.js +55 -0
- package/dist/vendor/self-judge-kit/escalation-policy.d.ts +17 -0
- package/dist/vendor/self-judge-kit/escalation-policy.js +45 -0
- package/dist/vendor/self-judge-kit/index.d.ts +46 -0
- package/dist/vendor/self-judge-kit/index.js +79 -0
- package/dist/vendor/self-judge-kit/types.d.ts +87 -0
- package/dist/vendor/self-judge-kit/types.js +18 -0
- package/package.json +41 -4
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 九层能力注册中心(layer-registry)—— P9-a(M29)· A 类骨架首批接线。
|
|
3
|
+
* 职责:L1–L9 能力实例的注册 / 自描述 / 健康聚合(并行探测、单层异常隔离),
|
|
4
|
+
* 供全局态势图消费(装配层把 healthAll 结果经 reportService 对接
|
|
5
|
+
* global-status-center,服务名 `layer-L1..L9`)。
|
|
6
|
+
* 边界:只做注册与聚合;探针实现由部署侧/装配层注入(缺省恒 ok);
|
|
7
|
+
* 不 import 家人实现,不反向依赖 02/07。
|
|
8
|
+
*/
|
|
9
|
+
import type { CapabilityLayerId, LayerCapability, LayerDescriptor, LayerProbe } from './types.js';
|
|
10
|
+
/** 单层健康报告(健康聚合行)。 */
|
|
11
|
+
export interface LayerHealthReport {
|
|
12
|
+
readonly id: CapabilityLayerId;
|
|
13
|
+
readonly status: 'ok' | 'degraded' | 'down';
|
|
14
|
+
readonly detail?: string;
|
|
15
|
+
}
|
|
16
|
+
/** 九层能力注册中心。 */
|
|
17
|
+
export declare class NineLayerRegistry {
|
|
18
|
+
private readonly layers;
|
|
19
|
+
/** 注册层级能力(同 id 重复注册视为装配错误)。 */
|
|
20
|
+
register(capability: LayerCapability): void;
|
|
21
|
+
/** 按层级 ID 取能力实例。 */
|
|
22
|
+
get(id: CapabilityLayerId): LayerCapability | undefined;
|
|
23
|
+
/** 全部层级(按 L1..L9 升序)。 */
|
|
24
|
+
list(): readonly LayerCapability[];
|
|
25
|
+
/** 全部描述符(自描述快照,L1..L9 序)。 */
|
|
26
|
+
describeAll(): readonly LayerDescriptor[];
|
|
27
|
+
/**
|
|
28
|
+
* 健康聚合:并行探测全部层级;单层探针异常降级为 `down`(带 detail),
|
|
29
|
+
* 不拖垮其余层级——聚合结果供全局态势图最坏态推导。
|
|
30
|
+
*/
|
|
31
|
+
healthAll(): Promise<readonly LayerHealthReport[]>;
|
|
32
|
+
/** 静态默认装配:L1–L9 全量默认能力实例(probes 按 id 注入,缺省恒 ok)。 */
|
|
33
|
+
static withDefaults(probes?: Readonly<Partial<Record<CapabilityLayerId, LayerProbe>>>): NineLayerRegistry;
|
|
34
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 九层能力注册中心(layer-registry)—— P9-a(M29)· A 类骨架首批接线。
|
|
3
|
+
* 职责:L1–L9 能力实例的注册 / 自描述 / 健康聚合(并行探测、单层异常隔离),
|
|
4
|
+
* 供全局态势图消费(装配层把 healthAll 结果经 reportService 对接
|
|
5
|
+
* global-status-center,服务名 `layer-L1..L9`)。
|
|
6
|
+
* 边界:只做注册与聚合;探针实现由部署侧/装配层注入(缺省恒 ok);
|
|
7
|
+
* 不 import 家人实现,不反向依赖 02/07。
|
|
8
|
+
*/
|
|
9
|
+
import { FoundationCapability } from './layer-1-foundation/foundation-capability.js';
|
|
10
|
+
import { BoleCapability } from './layer-2-bole/bole-capability.js';
|
|
11
|
+
import { ProphetCapability } from './layer-3-prophet/prophet-capability.js';
|
|
12
|
+
import { ThinkerCapability } from './layer-4-thinker/thinker-capability.js';
|
|
13
|
+
import { NavigatorCapability } from './layer-5-navigator/navigator-capability.js';
|
|
14
|
+
import { CreativeCapability } from './layer-6-creative/creative-capability.js';
|
|
15
|
+
import { MasterCapability } from './layer-7-master/master-capability.js';
|
|
16
|
+
import { GuardianCapability } from './layer-8-guardian/guardian-capability.js';
|
|
17
|
+
import { MetaOracleCapability } from './layer-9-meta-oracle/meta-oracle-capability.js';
|
|
18
|
+
/** 九层能力注册中心。 */
|
|
19
|
+
export class NineLayerRegistry {
|
|
20
|
+
layers = new Map();
|
|
21
|
+
/** 注册层级能力(同 id 重复注册视为装配错误)。 */
|
|
22
|
+
register(capability) {
|
|
23
|
+
if (this.layers.has(capability.id))
|
|
24
|
+
throw new Error(`层级重复注册:${capability.id}`);
|
|
25
|
+
this.layers.set(capability.id, capability);
|
|
26
|
+
}
|
|
27
|
+
/** 按层级 ID 取能力实例。 */
|
|
28
|
+
get(id) {
|
|
29
|
+
return this.layers.get(id);
|
|
30
|
+
}
|
|
31
|
+
/** 全部层级(按 L1..L9 升序)。 */
|
|
32
|
+
list() {
|
|
33
|
+
return [...this.layers.values()].sort((a, b) => a.id.localeCompare(b.id));
|
|
34
|
+
}
|
|
35
|
+
/** 全部描述符(自描述快照,L1..L9 序)。 */
|
|
36
|
+
describeAll() {
|
|
37
|
+
return this.list().map((capability) => capability.describe());
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 健康聚合:并行探测全部层级;单层探针异常降级为 `down`(带 detail),
|
|
41
|
+
* 不拖垮其余层级——聚合结果供全局态势图最坏态推导。
|
|
42
|
+
*/
|
|
43
|
+
async healthAll() {
|
|
44
|
+
return Promise.all(this.list().map(async (capability) => {
|
|
45
|
+
try {
|
|
46
|
+
const health = await capability.health();
|
|
47
|
+
return { id: capability.id, status: health.status, detail: health.detail };
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
return {
|
|
51
|
+
id: capability.id,
|
|
52
|
+
status: 'down',
|
|
53
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
/** 静态默认装配:L1–L9 全量默认能力实例(probes 按 id 注入,缺省恒 ok)。 */
|
|
59
|
+
static withDefaults(probes = {}) {
|
|
60
|
+
const registry = new NineLayerRegistry();
|
|
61
|
+
const defaults = [
|
|
62
|
+
new FoundationCapability(probes.L1),
|
|
63
|
+
new BoleCapability(probes.L2),
|
|
64
|
+
new ProphetCapability(probes.L3),
|
|
65
|
+
new ThinkerCapability(probes.L4),
|
|
66
|
+
new NavigatorCapability(probes.L5),
|
|
67
|
+
new CreativeCapability(probes.L6),
|
|
68
|
+
new MasterCapability(probes.L7),
|
|
69
|
+
new GuardianCapability(probes.L8),
|
|
70
|
+
new MetaOracleCapability(probes.L9),
|
|
71
|
+
];
|
|
72
|
+
for (const capability of defaults)
|
|
73
|
+
registry.register(capability);
|
|
74
|
+
return registry;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ============================================================
|
|
3
|
+
* YYC³ AI Family — 九层架构分层底座 核心类型定义
|
|
4
|
+
* ------------------------------------------------------------
|
|
5
|
+
* 文档依据:YYC3-AI-Family-Agent-架构设计.md §4(目录树)、
|
|
6
|
+
* §4.2(两套"九层"编号桥接)。
|
|
7
|
+
*
|
|
8
|
+
* 边界:这里只放"能力底座"(层级能力的抽象契约与编排入口);
|
|
9
|
+
* 具体家人业务实现位于 `family-agents/`。
|
|
10
|
+
* 底座**不 import 任何家人实现**(不同 root),只暴露通用契约。
|
|
11
|
+
* ============================================================
|
|
12
|
+
*/
|
|
13
|
+
/** 能力分层 ID(L1–L9,家人档案语义;对齐 §4.2 桥接表)。 */
|
|
14
|
+
export type CapabilityLayerId = 'L1' | 'L2' | 'L3' | 'L4' | 'L5' | 'L6' | 'L7' | 'L8' | 'L9';
|
|
15
|
+
/** 层级类别:底座 / 业务执行 / 核心决策 / 核心保障。 */
|
|
16
|
+
export type LayerKind = 'foundation' | 'business' | 'decision' | 'guard';
|
|
17
|
+
/** 层级描述符(describe() 返回值,供注册表与全局态势图消费)。 */
|
|
18
|
+
export interface LayerDescriptor {
|
|
19
|
+
/** 层级 ID。 */
|
|
20
|
+
readonly id: CapabilityLayerId;
|
|
21
|
+
/** 层级主题(如「基础底座」「千里·伯乐」)。 */
|
|
22
|
+
readonly theme: string;
|
|
23
|
+
/** 承载家人(基础底座等无家人层级缺省)。 */
|
|
24
|
+
readonly member?: string;
|
|
25
|
+
/** 能力定位(如「推荐能力底座」)。 */
|
|
26
|
+
readonly capability: string;
|
|
27
|
+
readonly kind: LayerKind;
|
|
28
|
+
}
|
|
29
|
+
/** 层级健康状态。 */
|
|
30
|
+
export interface LayerHealth {
|
|
31
|
+
readonly status: 'ok' | 'degraded' | 'down';
|
|
32
|
+
readonly detail?: string;
|
|
33
|
+
}
|
|
34
|
+
/** 层级健康探针(M29 · 注入式端口):同步/异步返回健康态;抛错判 down。 */
|
|
35
|
+
export type LayerProbe = () => LayerHealth | Promise<LayerHealth>;
|
|
36
|
+
/**
|
|
37
|
+
* 层级能力通用契约。
|
|
38
|
+
* 每个层级底座实现此接口:暴露唯一 id、自描述、健康探针。
|
|
39
|
+
*/
|
|
40
|
+
export interface LayerCapability {
|
|
41
|
+
/** 层级 ID。 */
|
|
42
|
+
readonly id: CapabilityLayerId;
|
|
43
|
+
/** 自描述:返回本层描述符。 */
|
|
44
|
+
describe(): LayerDescriptor;
|
|
45
|
+
/** 健康探针:供全局态势图采集(对接 global-status-center)。 */
|
|
46
|
+
health(): Promise<LayerHealth>;
|
|
47
|
+
}
|
|
48
|
+
/** §4.2 层级静态清单(能力分层 L → 主题 / 承载家人 / 类别)。 */
|
|
49
|
+
export declare const LAYER_DESCRIPTORS: Readonly<Record<CapabilityLayerId, Omit<LayerDescriptor, 'id'>>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ============================================================
|
|
3
|
+
* YYC³ AI Family — 九层架构分层底座 核心类型定义
|
|
4
|
+
* ------------------------------------------------------------
|
|
5
|
+
* 文档依据:YYC3-AI-Family-Agent-架构设计.md §4(目录树)、
|
|
6
|
+
* §4.2(两套"九层"编号桥接)。
|
|
7
|
+
*
|
|
8
|
+
* 边界:这里只放"能力底座"(层级能力的抽象契约与编排入口);
|
|
9
|
+
* 具体家人业务实现位于 `family-agents/`。
|
|
10
|
+
* 底座**不 import 任何家人实现**(不同 root),只暴露通用契约。
|
|
11
|
+
* ============================================================
|
|
12
|
+
*/
|
|
13
|
+
/** §4.2 层级静态清单(能力分层 L → 主题 / 承载家人 / 类别)。 */
|
|
14
|
+
export const LAYER_DESCRIPTORS = {
|
|
15
|
+
// 第 1 层:基础底座——公共基础设施,无承载家人
|
|
16
|
+
L1: { theme: '基础底座', capability: '公共基础设施', kind: 'foundation' },
|
|
17
|
+
// 第 2 层:千里·伯乐——推荐能力底座(业务执行层)
|
|
18
|
+
L2: { theme: '千里·伯乐', member: '千里·伯乐', capability: '推荐能力底座', kind: 'business' },
|
|
19
|
+
// 第 3 层:预见·先知——预测能力底座(业务执行层)
|
|
20
|
+
L3: { theme: '预见·先知', member: '预见·先知', capability: '预测能力底座', kind: 'business' },
|
|
21
|
+
// 第 4 层:语枢·万物——分析能力底座(业务执行层)
|
|
22
|
+
L4: { theme: '语枢·万物', member: '语枢·万物', capability: '分析能力底座', kind: 'business' },
|
|
23
|
+
// 第 5 层:言启·千行——入口网关能力底座(业务执行层)
|
|
24
|
+
L5: { theme: '言启·千行', member: '言启·千行', capability: '入口网关能力底座', kind: 'business' },
|
|
25
|
+
// 第 6 层:创想·灵韵——创意能力底座(核心保障层)
|
|
26
|
+
L6: { theme: '创想·灵韵', member: '创想·灵韵', capability: '创意能力底座', kind: 'guard' },
|
|
27
|
+
// 第 7 层:格物·宗师——质量能力底座(核心保障层)
|
|
28
|
+
L7: { theme: '格物·宗师', member: '格物·宗师', capability: '质量能力底座', kind: 'guard' },
|
|
29
|
+
// 第 8 层:智云·守护——安全能力底座(核心保障层)
|
|
30
|
+
L8: { theme: '智云·守护', member: '智云·守护', capability: '安全能力底座', kind: 'guard' },
|
|
31
|
+
// 第 9 层:元启·天枢——全局调度能力底座(核心决策层)
|
|
32
|
+
L9: { theme: '元启·天枢', member: '元启·天枢', capability: '全局调度能力底座', kind: 'decision' },
|
|
33
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 云枢编排器(cloud-pivot-orchestrator)—— 接收千行意图解析 → 任务分解 → 调度家人执行。
|
|
3
|
+
* 语义(M26 由桩转实):
|
|
4
|
+
* - plan(intent):CAGEERF 分解(归 decomposer,不变);
|
|
5
|
+
* - dispatch(plan):**逐步真实分发**——注入式 `StepDispatcher` 端口按 step.owner
|
|
6
|
+
* 承接(总线适配由装配/部署侧实现该端口,内核不硬接 EventBus);
|
|
7
|
+
* 逐 step 记录成功/失败(失败不中断后续步骤),traceId 贯穿端口入参;
|
|
8
|
+
* - 低置信预检:intent.confidence < threshold 时经注入 `DispatchVerifier` 仲裁
|
|
9
|
+
* (对齐 verification-gateway 语义;缺省不启用)。
|
|
10
|
+
* 边界:只负责编排与调度;业务执行归各家人,策略裁决归治理中心。
|
|
11
|
+
*/
|
|
12
|
+
import { TaskDecomposer } from './task-decomposer.js';
|
|
13
|
+
import type { DispatchResult, Intent, TaskPlan, TaskStep } from '../types.js';
|
|
14
|
+
/** 步骤分发端口(部署侧实现:接 family-communication-bus / 家人运行时)。 */
|
|
15
|
+
export interface StepDispatcher {
|
|
16
|
+
/** 分发单步;resolve = 成功,reject/throw = 失败(编排器记账不中断)。 */
|
|
17
|
+
dispatch(step: TaskStep, plan: TaskPlan): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
/** 分发前仲裁端口(低置信预检;接入 verification-gateway 语义)。 */
|
|
20
|
+
export interface DispatchVerifier {
|
|
21
|
+
/** 返回 false = 仲裁拦截(dispatch 整体拒绝并回 reason)。 */
|
|
22
|
+
allow(plan: TaskPlan, intentConfidence: number): Promise<boolean> | boolean;
|
|
23
|
+
}
|
|
24
|
+
/** 编排器选项(全部注入式,缺省行为与既有消费者兼容)。 */
|
|
25
|
+
export interface OrchestratorOptions {
|
|
26
|
+
/** 分解器(缺省自建)。 */
|
|
27
|
+
readonly decomposer?: TaskDecomposer;
|
|
28
|
+
readonly dispatcher?: StepDispatcher;
|
|
29
|
+
readonly verifier?: DispatchVerifier;
|
|
30
|
+
/** 低置信阈值(缺省 0.6,对齐 self-judge τ_low)。 */
|
|
31
|
+
readonly confidenceFloor?: number;
|
|
32
|
+
}
|
|
33
|
+
/** 云枢编排器。 */
|
|
34
|
+
export declare class CloudPivotOrchestrator {
|
|
35
|
+
private readonly decomposer;
|
|
36
|
+
private readonly dispatcher?;
|
|
37
|
+
private readonly verifier?;
|
|
38
|
+
private readonly confidenceFloor;
|
|
39
|
+
constructor(decomposerOrOptions?: TaskDecomposer | OrchestratorOptions);
|
|
40
|
+
/** 接收千行意图,产出任务计划(CAGEERF 分解)。 */
|
|
41
|
+
plan(intent: Intent): TaskPlan;
|
|
42
|
+
/**
|
|
43
|
+
* 调度家人执行任务计划:低置信仲裁 → 逐步分发(失败记账不中断)。
|
|
44
|
+
* 未注入 dispatcher 时退化为原「仅产出承接清单」语义(dispatched=owners, failed=[])。
|
|
45
|
+
*/
|
|
46
|
+
dispatch(plan: TaskPlan, intentConfidence?: number): Promise<DispatchResult>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 云枢编排器(cloud-pivot-orchestrator)—— 接收千行意图解析 → 任务分解 → 调度家人执行。
|
|
3
|
+
* 语义(M26 由桩转实):
|
|
4
|
+
* - plan(intent):CAGEERF 分解(归 decomposer,不变);
|
|
5
|
+
* - dispatch(plan):**逐步真实分发**——注入式 `StepDispatcher` 端口按 step.owner
|
|
6
|
+
* 承接(总线适配由装配/部署侧实现该端口,内核不硬接 EventBus);
|
|
7
|
+
* 逐 step 记录成功/失败(失败不中断后续步骤),traceId 贯穿端口入参;
|
|
8
|
+
* - 低置信预检:intent.confidence < threshold 时经注入 `DispatchVerifier` 仲裁
|
|
9
|
+
* (对齐 verification-gateway 语义;缺省不启用)。
|
|
10
|
+
* 边界:只负责编排与调度;业务执行归各家人,策略裁决归治理中心。
|
|
11
|
+
*/
|
|
12
|
+
import { TaskDecomposer } from './task-decomposer.js';
|
|
13
|
+
/** 云枢编排器。 */
|
|
14
|
+
export class CloudPivotOrchestrator {
|
|
15
|
+
decomposer;
|
|
16
|
+
dispatcher;
|
|
17
|
+
verifier;
|
|
18
|
+
confidenceFloor;
|
|
19
|
+
constructor(decomposerOrOptions) {
|
|
20
|
+
const options = decomposerOrOptions instanceof TaskDecomposer
|
|
21
|
+
? { decomposer: decomposerOrOptions }
|
|
22
|
+
: decomposerOrOptions ?? {};
|
|
23
|
+
this.decomposer = options.decomposer ?? new TaskDecomposer();
|
|
24
|
+
this.dispatcher = options.dispatcher;
|
|
25
|
+
this.verifier = options.verifier;
|
|
26
|
+
this.confidenceFloor = options.confidenceFloor ?? 0.6;
|
|
27
|
+
}
|
|
28
|
+
/** 接收千行意图,产出任务计划(CAGEERF 分解)。 */
|
|
29
|
+
plan(intent) {
|
|
30
|
+
return this.decomposer.decompose(intent);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 调度家人执行任务计划:低置信仲裁 → 逐步分发(失败记账不中断)。
|
|
34
|
+
* 未注入 dispatcher 时退化为原「仅产出承接清单」语义(dispatched=owners, failed=[])。
|
|
35
|
+
*/
|
|
36
|
+
async dispatch(plan, intentConfidence = 1) {
|
|
37
|
+
if (this.verifier) {
|
|
38
|
+
const allowed = await this.verifier.allow(plan, intentConfidence);
|
|
39
|
+
if (!allowed) {
|
|
40
|
+
return { traceId: plan.traceId, dispatched: [], failed: plan.steps.map((s) => s.owner) };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (!this.dispatcher) {
|
|
44
|
+
return { traceId: plan.traceId, dispatched: plan.steps.map((step) => step.owner), failed: [] };
|
|
45
|
+
}
|
|
46
|
+
const dispatched = [];
|
|
47
|
+
const failed = [];
|
|
48
|
+
for (const step of plan.steps) {
|
|
49
|
+
try {
|
|
50
|
+
await this.dispatcher.dispatch(step, plan);
|
|
51
|
+
dispatched.push(step.owner);
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
failed.push(step.owner);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return { traceId: plan.traceId, dispatched, failed };
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 任务分解器(task-decomposer)—— CAGEERF 七阶段分解骨架。
|
|
3
|
+
* 边界:只做结构分解;具体家人绑定与上下文填充归编排器。
|
|
4
|
+
*
|
|
5
|
+
* 阶段语义依据《docs/YYC3-AI-Family-Agent-架构设计.md》§5.7 建议稿:
|
|
6
|
+
* Clarify / Analyze / Generate / Evaluate / Execute / Review / Finalize。
|
|
7
|
+
* ⚠️ 建议稿待家族权威确权(确权后仅需校对本常量文案,阶段集合不变)。
|
|
8
|
+
*/
|
|
9
|
+
import type { CageerfStage, Intent, TaskPlan } from '../types.js';
|
|
10
|
+
/**
|
|
11
|
+
* CAGEERF 七阶段(C-A-G-E-E-R-F,§5.7 建议稿)。
|
|
12
|
+
*/
|
|
13
|
+
export declare const CAGEERF_STAGES: readonly CageerfStage[];
|
|
14
|
+
/** CAGEERF 任务分解器。 */
|
|
15
|
+
export declare class TaskDecomposer {
|
|
16
|
+
/**
|
|
17
|
+
* 将意图分解为按 CAGEERF 阶段编排的任务步骤。
|
|
18
|
+
* 每步绑定 owner 与前置依赖(线性链),goal 携带意图话语便于审计。
|
|
19
|
+
*/
|
|
20
|
+
decompose(intent: Intent): TaskPlan;
|
|
21
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 任务分解器(task-decomposer)—— CAGEERF 七阶段分解骨架。
|
|
3
|
+
* 边界:只做结构分解;具体家人绑定与上下文填充归编排器。
|
|
4
|
+
*
|
|
5
|
+
* 阶段语义依据《docs/YYC3-AI-Family-Agent-架构设计.md》§5.7 建议稿:
|
|
6
|
+
* Clarify / Analyze / Generate / Evaluate / Execute / Review / Finalize。
|
|
7
|
+
* ⚠️ 建议稿待家族权威确权(确权后仅需校对本常量文案,阶段集合不变)。
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* CAGEERF 七阶段(C-A-G-E-E-R-F,§5.7 建议稿)。
|
|
11
|
+
*/
|
|
12
|
+
export const CAGEERF_STAGES = [
|
|
13
|
+
'clarify', // C —— 澄清:意图澄清与上下文构建(千行)
|
|
14
|
+
'analyze', // A —— 分析:依赖/风险/资源/记忆检索(万物)
|
|
15
|
+
'generate', // G —— 生成:候选计划与家人分工(天枢/灵韵)
|
|
16
|
+
'evaluate', // E —— 评估:风险预测与质量择优(先知/宗师)
|
|
17
|
+
'execute', // E —— 执行:调度家人并贯穿策略护栏(天枢)
|
|
18
|
+
'review', // R —— 复核:自评+外验(verification-gateway)
|
|
19
|
+
'finalize', // F —— 固化:记忆写入/学习回流/交付呈现(伯乐)
|
|
20
|
+
];
|
|
21
|
+
/** CAGEERF 阶段 → 承接家人(编号与家人注册表一致)。 */
|
|
22
|
+
const STAGE_OWNER = {
|
|
23
|
+
clarify: '010301-01', // 言启·千行
|
|
24
|
+
analyze: '010301-02', // 语枢·万物
|
|
25
|
+
generate: '010301-05', // 元启·天枢
|
|
26
|
+
evaluate: '010301-06', // 格物·宗师
|
|
27
|
+
execute: '010301-05', // 元启·天枢
|
|
28
|
+
review: '010301-06', // 格物·宗师(联合 verification-gateway)
|
|
29
|
+
finalize: '010301-04', // 千里·伯乐
|
|
30
|
+
};
|
|
31
|
+
/** 阶段目标文案(含意图话语,便于审计回溯)。 */
|
|
32
|
+
function goalOf(stage, utterance) {
|
|
33
|
+
switch (stage) {
|
|
34
|
+
case 'clarify':
|
|
35
|
+
return `澄清意图与上下文:${utterance}`;
|
|
36
|
+
case 'analyze':
|
|
37
|
+
return '分析依赖/风险/资源,并检索相关记忆';
|
|
38
|
+
case 'generate':
|
|
39
|
+
return '生成候选计划与家人分工';
|
|
40
|
+
case 'evaluate':
|
|
41
|
+
return '评估风险与质量,择优执行方案';
|
|
42
|
+
case 'execute':
|
|
43
|
+
return '按计划调度家人,贯穿策略护栏';
|
|
44
|
+
case 'review':
|
|
45
|
+
return '自评 + 外验复核(verification-gateway)';
|
|
46
|
+
case 'finalize':
|
|
47
|
+
return '固化记忆、回流学习并由伯乐交付呈现';
|
|
48
|
+
default:
|
|
49
|
+
return stage;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** CAGEERF 任务分解器。 */
|
|
53
|
+
export class TaskDecomposer {
|
|
54
|
+
/**
|
|
55
|
+
* 将意图分解为按 CAGEERF 阶段编排的任务步骤。
|
|
56
|
+
* 每步绑定 owner 与前置依赖(线性链),goal 携带意图话语便于审计。
|
|
57
|
+
*/
|
|
58
|
+
decompose(intent) {
|
|
59
|
+
const steps = CAGEERF_STAGES.map((stage, index) => {
|
|
60
|
+
const id = `${intent.id}-s${index}`;
|
|
61
|
+
const prev = index > 0 ? `${intent.id}-s${index - 1}` : undefined;
|
|
62
|
+
return {
|
|
63
|
+
id,
|
|
64
|
+
stage,
|
|
65
|
+
owner: STAGE_OWNER[stage],
|
|
66
|
+
goal: goalOf(stage, intent.utterance),
|
|
67
|
+
...(prev ? { dependsOn: [prev] } : {}),
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
return { traceId: intent.traceId, intentId: intent.id, steps };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* confidence-calibrator(置信度校准器)——verification-gateway 子模块。
|
|
3
|
+
* 职责:基于验证结果校准自评置信度(回填 JudgmentSignal)。
|
|
4
|
+
* 边界:只做校准;裁决归天枢 / 人类。
|
|
5
|
+
*
|
|
6
|
+
* v2.3.0(Phase B 最小闭环)确定性校准公式:
|
|
7
|
+
* - 证实(noisy-OR,两路独立证据合成):
|
|
8
|
+
* calibrated = 1 − (1 − selfConf) × (1 − verifyConf)
|
|
9
|
+
* 外部真值源以 vConf 置信证实 → 剩余不确定性按 (1−vConf) 收缩;
|
|
10
|
+
* - 驳斥(海市蜃楼强衰减):
|
|
11
|
+
* calibrated = selfConf × (1 − verifyConf)
|
|
12
|
+
* 外部以 vConf 置信驳斥 → 自评只剩「裁定可能出错」的残差。
|
|
13
|
+
* 门禁:校准误差(|calibrated − 真实结果| 均值)≤ 0.15(§6.4 Phase B),
|
|
14
|
+
* 误差统计由 ConsistencyTracker 维护。
|
|
15
|
+
* TODO(infra): 累积真实样本后升级为温度缩放 / Platt scaling。
|
|
16
|
+
*/
|
|
17
|
+
import type { JudgmentSignal } from '../../../../vendor/self-judge-kit/index.js';
|
|
18
|
+
import type { VerificationResult } from '../../types.js';
|
|
19
|
+
/** 校准结果。 */
|
|
20
|
+
export interface CalibrationResult {
|
|
21
|
+
readonly agent: string;
|
|
22
|
+
/** 校准后置信度 0–1。 */
|
|
23
|
+
readonly confidence: number;
|
|
24
|
+
/** 校准幅度(校准后 − 校准前)。 */
|
|
25
|
+
readonly delta: number;
|
|
26
|
+
}
|
|
27
|
+
/** 置信度校准器。 */
|
|
28
|
+
export declare class ConfidenceCalibrator {
|
|
29
|
+
/** 用验证结果校准自评信号(确定性公式,可审计)。 */
|
|
30
|
+
calibrate(signal: JudgmentSignal, verification: VerificationResult): CalibrationResult;
|
|
31
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* confidence-calibrator(置信度校准器)——verification-gateway 子模块。
|
|
3
|
+
* 职责:基于验证结果校准自评置信度(回填 JudgmentSignal)。
|
|
4
|
+
* 边界:只做校准;裁决归天枢 / 人类。
|
|
5
|
+
*
|
|
6
|
+
* v2.3.0(Phase B 最小闭环)确定性校准公式:
|
|
7
|
+
* - 证实(noisy-OR,两路独立证据合成):
|
|
8
|
+
* calibrated = 1 − (1 − selfConf) × (1 − verifyConf)
|
|
9
|
+
* 外部真值源以 vConf 置信证实 → 剩余不确定性按 (1−vConf) 收缩;
|
|
10
|
+
* - 驳斥(海市蜃楼强衰减):
|
|
11
|
+
* calibrated = selfConf × (1 − verifyConf)
|
|
12
|
+
* 外部以 vConf 置信驳斥 → 自评只剩「裁定可能出错」的残差。
|
|
13
|
+
* 门禁:校准误差(|calibrated − 真实结果| 均值)≤ 0.15(§6.4 Phase B),
|
|
14
|
+
* 误差统计由 ConsistencyTracker 维护。
|
|
15
|
+
* TODO(infra): 累积真实样本后升级为温度缩放 / Platt scaling。
|
|
16
|
+
*/
|
|
17
|
+
/** 置信度校准器。 */
|
|
18
|
+
export class ConfidenceCalibrator {
|
|
19
|
+
/** 用验证结果校准自评信号(确定性公式,可审计)。 */
|
|
20
|
+
calibrate(signal, verification) {
|
|
21
|
+
const selfConf = clamp01(signal.confidence);
|
|
22
|
+
const vConf = clamp01(verification.confidence);
|
|
23
|
+
const calibrated = verification.verified
|
|
24
|
+
? 1 - (1 - selfConf) * (1 - vConf) // noisy-OR 证实
|
|
25
|
+
: selfConf * (1 - vConf); // 驳斥强衰减
|
|
26
|
+
const rounded = round4(calibrated);
|
|
27
|
+
return {
|
|
28
|
+
agent: signal.agent,
|
|
29
|
+
confidence: rounded,
|
|
30
|
+
delta: round4(rounded - selfConf),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function clamp01(x) {
|
|
35
|
+
return Math.min(1, Math.max(0, x));
|
|
36
|
+
}
|
|
37
|
+
function round4(x) {
|
|
38
|
+
return Math.round(x * 10000) / 10000;
|
|
39
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* consistency-metrics(自评-外验一致性指标)——verification-gateway 子模块。
|
|
3
|
+
* 职责:维护 §6.4 Phase B 两大门禁指标的运行时统计:
|
|
4
|
+
* 1. 自评-外验一致率(consistencyRate):在**自评未升级**(未请求外验)的
|
|
5
|
+
* 判定中,被外部真值证实比例。门禁 > 90%。
|
|
6
|
+
* (自评已主动升级的样本不计入分母——那是"审慎",不是"不一致"。)
|
|
7
|
+
* 2. 校准误差(calibrationError):|校准后置信度 − 真实结果| 的均值。
|
|
8
|
+
* 门禁 ≤ 0.15。
|
|
9
|
+
* 3. 海市蜃楼计数(mirageCount):自评未升级却被外部驳斥的次数。
|
|
10
|
+
* 边界:只做统计;门禁判定与告警归 orchestrator / 观测平台。
|
|
11
|
+
*/
|
|
12
|
+
/** 单次闭环裁定统计输入。 */
|
|
13
|
+
export interface ConsistencySample {
|
|
14
|
+
/** 自评升级决策('none' 表示自评声称可自行负责)。 */
|
|
15
|
+
readonly selfEscalation: 'none' | 'cross-validate' | 'human-confirm';
|
|
16
|
+
/** 自评原始置信度。 */
|
|
17
|
+
readonly selfConfidence: number;
|
|
18
|
+
/** 校准后置信度。 */
|
|
19
|
+
readonly calibratedConfidence: number;
|
|
20
|
+
/** 外验是否证实。 */
|
|
21
|
+
readonly verified: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** 指标快照。 */
|
|
24
|
+
export interface ConsistencySnapshot {
|
|
25
|
+
/** 一致率分母样本数(自评未升级样本)。 */
|
|
26
|
+
readonly selfOkSamples: number;
|
|
27
|
+
/** 自评-外验一致率(无样本时为 undefined)。 */
|
|
28
|
+
readonly consistencyRate: number | undefined;
|
|
29
|
+
/** 校准误差均值(无样本时为 undefined)。 */
|
|
30
|
+
readonly calibrationError: number | undefined;
|
|
31
|
+
/** 海市蜃楼命中数。 */
|
|
32
|
+
readonly mirageCount: number;
|
|
33
|
+
}
|
|
34
|
+
/** 一致性指标追踪器。 */
|
|
35
|
+
export declare class ConsistencyTracker {
|
|
36
|
+
private selfOkTotal;
|
|
37
|
+
private selfOkVerified;
|
|
38
|
+
private calibrationSum;
|
|
39
|
+
private calibrationN;
|
|
40
|
+
private mirages;
|
|
41
|
+
/** 记录一次闭环裁定样本。 */
|
|
42
|
+
record(sample: ConsistencySample): void;
|
|
43
|
+
/** 当前指标快照。 */
|
|
44
|
+
snapshot(): ConsistencySnapshot;
|
|
45
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* consistency-metrics(自评-外验一致性指标)——verification-gateway 子模块。
|
|
3
|
+
* 职责:维护 §6.4 Phase B 两大门禁指标的运行时统计:
|
|
4
|
+
* 1. 自评-外验一致率(consistencyRate):在**自评未升级**(未请求外验)的
|
|
5
|
+
* 判定中,被外部真值证实比例。门禁 > 90%。
|
|
6
|
+
* (自评已主动升级的样本不计入分母——那是"审慎",不是"不一致"。)
|
|
7
|
+
* 2. 校准误差(calibrationError):|校准后置信度 − 真实结果| 的均值。
|
|
8
|
+
* 门禁 ≤ 0.15。
|
|
9
|
+
* 3. 海市蜃楼计数(mirageCount):自评未升级却被外部驳斥的次数。
|
|
10
|
+
* 边界:只做统计;门禁判定与告警归 orchestrator / 观测平台。
|
|
11
|
+
*/
|
|
12
|
+
/** 一致性指标追踪器。 */
|
|
13
|
+
export class ConsistencyTracker {
|
|
14
|
+
selfOkTotal = 0;
|
|
15
|
+
selfOkVerified = 0;
|
|
16
|
+
calibrationSum = 0;
|
|
17
|
+
calibrationN = 0;
|
|
18
|
+
mirages = 0;
|
|
19
|
+
/** 记录一次闭环裁定样本。 */
|
|
20
|
+
record(sample) {
|
|
21
|
+
if (sample.selfEscalation === 'none') {
|
|
22
|
+
this.selfOkTotal += 1;
|
|
23
|
+
if (sample.verified) {
|
|
24
|
+
this.selfOkVerified += 1;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
// 自评声称可自行负责,却被外部驳斥 → 典型海市蜃楼形态
|
|
28
|
+
this.mirages += 1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const outcome = sample.verified ? 1 : 0;
|
|
32
|
+
this.calibrationSum += Math.abs(sample.calibratedConfidence - outcome);
|
|
33
|
+
this.calibrationN += 1;
|
|
34
|
+
}
|
|
35
|
+
/** 当前指标快照。 */
|
|
36
|
+
snapshot() {
|
|
37
|
+
return {
|
|
38
|
+
selfOkSamples: this.selfOkTotal,
|
|
39
|
+
consistencyRate: this.selfOkTotal === 0 ? undefined : this.selfOkVerified / this.selfOkTotal,
|
|
40
|
+
calibrationError: this.calibrationN === 0 ? undefined : this.calibrationSum / this.calibrationN,
|
|
41
|
+
mirageCount: this.mirages,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cross-validator(跨家人交叉验证)——verification-gateway 子模块。
|
|
3
|
+
* 职责:请独立家人(如语枢·万物)复核,按共识率聚合为交叉验证意见。
|
|
4
|
+
* 边界:只产出交叉验证意见(供 escalation 路径 cross-validate);
|
|
5
|
+
* 最终裁决归天枢 / 人类确认。
|
|
6
|
+
*
|
|
7
|
+
* v2.3.0(Phase B 最小闭环):支持注册可插拔复核人——
|
|
8
|
+
* `(signal, request) => ReviewerOpinion`;无复核人时 **fail-safe 不默认成功**。
|
|
9
|
+
* TODO(infra): 复核人函数替换为经 family-communication-bus 的异步独立复核。
|
|
10
|
+
*/
|
|
11
|
+
import type { JudgmentSignal } from '../../../../vendor/self-judge-kit/index.js';
|
|
12
|
+
import type { VerificationRequest, VerificationResult } from '../../types.js';
|
|
13
|
+
/** 复核人意见。 */
|
|
14
|
+
export interface ReviewerOpinion {
|
|
15
|
+
/** 是否同意待验信号的核心主张。 */
|
|
16
|
+
readonly agrees: boolean;
|
|
17
|
+
/** 复核置信度 0–1(对该意见本身)。 */
|
|
18
|
+
readonly confidence: number;
|
|
19
|
+
readonly note?: string;
|
|
20
|
+
}
|
|
21
|
+
/** 复核人函数(独立于被验家人的判断通道)。 */
|
|
22
|
+
export type Reviewer = (signal: JudgmentSignal, request: VerificationRequest) => ReviewerOpinion;
|
|
23
|
+
/** 交叉验证输入(含待复核的自我判断信号)。 */
|
|
24
|
+
export interface CrossValidationInput {
|
|
25
|
+
readonly request: VerificationRequest;
|
|
26
|
+
readonly signal: JudgmentSignal;
|
|
27
|
+
/** 独立复核家人清单(仅作展示;实际路由按已注册复核人)。 */
|
|
28
|
+
readonly reviewers?: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
/** 跨家人交叉验证器。 */
|
|
31
|
+
export declare class CrossValidator {
|
|
32
|
+
private readonly reviewers;
|
|
33
|
+
/** 注册复核人(同 id 重复注册以最后为准)。 */
|
|
34
|
+
registerReviewer(id: string, reviewer: Reviewer): void;
|
|
35
|
+
/** 已注册复核人 id 清单。 */
|
|
36
|
+
reviewerIds(): readonly string[];
|
|
37
|
+
/**
|
|
38
|
+
* 请独立家人复核,按多数共识聚合:
|
|
39
|
+
* - 共识率 ≥ 0.5 且至少 1 票同意 → verified=true;
|
|
40
|
+
* - 多数反对 → verified=false(vConf=多数派平均置信度);
|
|
41
|
+
* - 无复核人 → verified=false(fail-safe,不默认成功)。
|
|
42
|
+
*/
|
|
43
|
+
crossValidate(input: CrossValidationInput): Promise<VerificationResult>;
|
|
44
|
+
}
|