attention-manifest-protocol 0.0.0-stage → 0.4.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/.editorconfig +12 -0
- package/.prettierignore +17 -0
- package/CHANGELOG.md +269 -0
- package/CHANGELOG.zh-CN.md +222 -0
- package/LICENSE +202 -0
- package/MCP-Token/347/250/216/344/270/216/344/270/213/344/270/200/344/273/243/345/267/245/345/205/267/345/215/217/350/256/256.html +1763 -0
- package/NOTICE +6 -0
- package/README.md +149 -2
- package/README.zh-CN.md +150 -0
- package/docs/annotation-campaign-A.csv +54 -0
- package/docs/annotation-campaign-B.csv +54 -0
- package/docs/annotation-campaign.csv +54 -0
- package/docs/eval/annotations-A.jsonl +16 -0
- package/docs/eval/annotations.json +122 -0
- package/docs/eval/recorded-labels.json +12 -0
- package/docs/eval/replay-cases.json +14 -0
- package/docs/eval/replay-labels-b.json +14 -0
- package/docs/examples/attention-request.json +16 -0
- package/docs/examples/checkpoint.json +15 -0
- package/docs/examples/claim.json +66 -0
- package/docs/examples/collaboration.json +66 -0
- package/docs/examples/concept-checkpoint.json +15 -0
- package/docs/examples/concept-prune-plan.json +45 -0
- package/docs/examples/federation.json +126 -0
- package/docs/examples/frame-chain.json +77 -0
- package/docs/examples/ledger-snapshot.json +108 -0
- package/docs/examples/manifest.json +77 -0
- package/docs/examples/message.json +19 -0
- package/docs/examples/other-model.json +45 -0
- package/docs/examples/plan.json +50 -0
- package/docs/examples/prune-plan.json +48 -0
- package/docs/examples/receipt.json +22 -0
- package/docs/examples/runtime-run.json +573 -0
- package/docs/examples/team.json +66 -0
- package/docs/examples/verb-note.json +11 -0
- package/docs/probes/bayes-scores.json +1452 -0
- package/docs/probes/calibration-imported.json +141 -0
- package/docs/probes/context-ast-deepseek.json +1577 -0
- package/docs/probes/deepseek-probe.json +917 -0
- package/docs/probes/eval-recorded-replay.json +597 -0
- package/docs/probes/eval-replay.json +124 -0
- package/docs/probes/eval-summary.json +42 -0
- package/docs/probes/runtime-eval.json +4230 -0
- package/docs/schemas/collaboration.schema.json +73 -0
- package/docs/schemas/common.schema.json +125 -0
- package/docs/schemas/compaction.schema.json +121 -0
- package/docs/schemas/concept-compaction.schema.json +73 -0
- package/docs/schemas/concept.schema.json +97 -0
- package/docs/schemas/epistemic.schema.json +178 -0
- package/docs/schemas/federation.schema.json +66 -0
- package/docs/schemas/frame.schema.json +86 -0
- package/docs/schemas/ledger-snapshot.schema.json +30 -0
- package/docs/schemas/manifest.schema.json +169 -0
- package/docs/schemas/message.schema.json +41 -0
- package/docs/schemas/plan.schema.json +189 -0
- package/docs/schemas/receipt.schema.json +45 -0
- package/docs/schemas/social.schema.json +153 -0
- package/docs/schemas/team.schema.json +56 -0
- package/docs/schemas/verb.schema.json +120 -0
- package/eslint.config.mts +96 -0
- package/index.html +13 -0
- package/package.json +172 -6
- package/prettier.config.mts +37 -0
- package/public/favicon.svg +1 -0
- package/public/icons.svg +24 -0
- package/src/attention/attention.ts +347 -0
- package/src/attention/budget.ts +72 -0
- package/src/attention/cognition.ts +519 -0
- package/src/attention/index.ts +8 -0
- package/src/attention/interrupts.ts +228 -0
- package/src/attention/resource.ts +316 -0
- package/src/attention/social.ts +217 -0
- package/src/attention/socialTypes.ts +115 -0
- package/src/authz/authz.ts +305 -0
- package/src/bayes/calibration.ts +204 -0
- package/src/bayes/calibrationRegistry.ts +111 -0
- package/src/bayes/calibrationSelection.ts +154 -0
- package/src/bayes/engine.ts +532 -0
- package/src/bayes/index.ts +6 -0
- package/src/bayes/reliability.ts +62 -0
- package/src/bayes/scopedPriors.ts +88 -0
- package/src/boundary/frame.ts +322 -0
- package/src/boundary/ids.ts +14 -0
- package/src/boundary/index.ts +12 -0
- package/src/boundary/refTable.ts +125 -0
- package/src/boundary/toolCall.ts +212 -0
- package/src/concept/concept.ts +75 -0
- package/src/concept/conceptBudget.ts +346 -0
- package/src/concept/conceptBudgetTypes.ts +79 -0
- package/src/concurrency/idempotency.ts +41 -0
- package/src/concurrency/mutex.ts +26 -0
- package/src/concurrency/namedLocks.ts +35 -0
- package/src/concurrency/retry.ts +50 -0
- package/src/concurrency/worker.ts +128 -0
- package/src/context/agentContext.ts +308 -0
- package/src/context/ast.ts +499 -0
- package/src/context/contentStore.ts +75 -0
- package/src/context/context.ts +65 -0
- package/src/context/contextIndex.ts +85 -0
- package/src/context/document.ts +137 -0
- package/src/context/fileStorePath.ts +14 -0
- package/src/context/index.ts +43 -0
- package/src/context/lifecycle.ts +221 -0
- package/src/context/projections.ts +151 -0
- package/src/context/workspace.ts +422 -0
- package/src/context/workspaceProtocol.ts +112 -0
- package/src/context/workspaceService.ts +423 -0
- package/src/cooperation/board.ts +104 -0
- package/src/cooperation/collaboration.ts +60 -0
- package/src/cooperation/merge.ts +190 -0
- package/src/cooperation/metrics.ts +57 -0
- package/src/cooperation/session.ts +131 -0
- package/src/cooperation/unified.ts +56 -0
- package/src/counter.ts +9 -0
- package/src/database/adapter/adapters.ts +35 -0
- package/src/database/adapter/index.ts +4 -0
- package/src/database/adapter/runtimeSink.ts +74 -0
- package/src/database/adapter/sessionStore.ts +32 -0
- package/src/database/adapter/turnStore.ts +23 -0
- package/src/database/entity/agent.ts +199 -0
- package/src/database/entity/entity.ts +1046 -0
- package/src/database/entity/handle.ts +79 -0
- package/src/database/entity/index.ts +32 -0
- package/src/database/entity/message.ts +74 -0
- package/src/database/entity/meta.ts +11 -0
- package/src/database/entity/object.ts +42 -0
- package/src/database/entity/outbox.ts +15 -0
- package/src/database/entity/process.ts +65 -0
- package/src/database/entity/registry.ts +155 -0
- package/src/database/entity/runtimeApproval.ts +30 -0
- package/src/database/entity/runtimeSession.ts +13 -0
- package/src/database/entity/runtimeTurn.ts +15 -0
- package/src/database/entity/thread.ts +85 -0
- package/src/database/entity/window.ts +85 -0
- package/src/database/entity/worker.ts +90 -0
- package/src/database/index.ts +6 -0
- package/src/database/repository/addressSpaceRepository.ts +72 -0
- package/src/database/repository/agentRepository.ts +460 -0
- package/src/database/repository/base.ts +41 -0
- package/src/database/repository/executionRepository.ts +477 -0
- package/src/database/repository/handleRepository.ts +64 -0
- package/src/database/repository/index.ts +20 -0
- package/src/database/repository/messageRepository.ts +52 -0
- package/src/database/repository/objectRepository.ts +69 -0
- package/src/database/repository/outboxRepository.ts +63 -0
- package/src/database/repository/processRepository.ts +58 -0
- package/src/database/repository/registryRepository.ts +119 -0
- package/src/database/repository/repository.ts +491 -0
- package/src/database/repository/runtimeApprovalRepository.ts +44 -0
- package/src/database/repository/runtimeSessionRepository.ts +27 -0
- package/src/database/repository/runtimeTurnRepository.ts +39 -0
- package/src/database/repository/socialRepository.ts +185 -0
- package/src/database/repository/threadRepository.ts +57 -0
- package/src/database/repository/windowRepository.ts +88 -0
- package/src/database/repository/workerRepository.ts +69 -0
- package/src/database/service/database.ts +90 -0
- package/src/database/service/handleService.ts +48 -0
- package/src/database/service/index.ts +16 -0
- package/src/database/service/messageService.ts +61 -0
- package/src/database/service/objectService.ts +59 -0
- package/src/database/service/processService.ts +61 -0
- package/src/database/service/registryServices.ts +88 -0
- package/src/database/service/service.ts +183 -0
- package/src/database/service/stepService.ts +53 -0
- package/src/database/service/threadService.ts +65 -0
- package/src/database/service/windowService.ts +30 -0
- package/src/database/service/workerService.ts +57 -0
- package/src/database/sql/index.ts +3 -0
- package/src/database/sql/schema.ts +418 -0
- package/src/database/sql/sql.ts +543 -0
- package/src/database/store/database.ts +210 -0
- package/src/database/store/index.ts +3 -0
- package/src/database/store/store.ts +266 -0
- package/src/delegate/team.ts +268 -0
- package/src/delegate/teamTypes.ts +47 -0
- package/src/diagnosis/checklist.ts +74 -0
- package/src/diagnosis/context.ts +93 -0
- package/src/diagnosis/frame.ts +256 -0
- package/src/diagnosis/index.ts +5 -0
- package/src/diagnosis/router.ts +72 -0
- package/src/diagnosis/types.ts +89 -0
- package/src/error/agentError.ts +16 -0
- package/src/error/ampError.ts +20 -0
- package/src/error/authzError.ts +14 -0
- package/src/error/boundaryRejection.ts +20 -0
- package/src/error/kernelError.ts +27 -0
- package/src/error/mailboxError.ts +9 -0
- package/src/error/windowError.ts +12 -0
- package/src/evaluation/agreement.ts +96 -0
- package/src/evaluation/labels.ts +241 -0
- package/src/evidence/evidenceGraph.ts +205 -0
- package/src/evidence/index.ts +4 -0
- package/src/evidence/revalidation.ts +191 -0
- package/src/execution/exec.ts +408 -0
- package/src/execution/handles.ts +65 -0
- package/src/execution/pin.ts +154 -0
- package/src/frame/frame.ts +70 -0
- package/src/goal/goal.ts +43 -0
- package/src/goal/index.ts +2 -0
- package/src/goal/plan.ts +196 -0
- package/src/governance/attentionManifest.ts +802 -0
- package/src/governance/audit.ts +362 -0
- package/src/governance/budget.ts +628 -0
- package/src/governance/context.ts +356 -0
- package/src/governance/control.ts +159 -0
- package/src/governance/cooperation.ts +479 -0
- package/src/governance/credential.ts +359 -0
- package/src/governance/httpServer.ts +99 -0
- package/src/governance/index.ts +32 -0
- package/src/governance/legal.ts +574 -0
- package/src/governance/matrix.ts +460 -0
- package/src/governance/perspectives.ts +406 -0
- package/src/governance/signing.ts +407 -0
- package/src/governance/store.ts +125 -0
- package/src/governance/switching.ts +459 -0
- package/src/governance/toolPolicy.ts +80 -0
- package/src/governance/transport.ts +204 -0
- package/src/governance/types.ts +380 -0
- package/src/governance/workflow.ts +743 -0
- package/src/interaction/index.ts +1 -0
- package/src/interaction/interaction.ts +391 -0
- package/src/ipc/index.ts +4 -0
- package/src/ipc/mailbox.ts +132 -0
- package/src/ipc/memorySocialStore.ts +93 -0
- package/src/ipc/social.ts +93 -0
- package/src/kernel/index.ts +14 -0
- package/src/kernel/scheduler.ts +498 -0
- package/src/ledger/checkpoint.ts +304 -0
- package/src/ledger/ledger.ts +31 -0
- package/src/ledger/persistence.ts +159 -0
- package/src/ledger/share.ts +80 -0
- package/src/lock/index.ts +2 -0
- package/src/lock/lease.ts +74 -0
- package/src/main.ts +199 -0
- package/src/manifest/agentCard.ts +72 -0
- package/src/manifest/cardSign.ts +87 -0
- package/src/manifest/federation.ts +237 -0
- package/src/manifest/federationTypes.ts +55 -0
- package/src/manifest/keys.ts +643 -0
- package/src/manifest/manifest.ts +114 -0
- package/src/manifest/sign.ts +134 -0
- package/src/manifest/trust.ts +146 -0
- package/src/mission/index.ts +2 -0
- package/src/mission/missionQueue.ts +75 -0
- package/src/module/index.ts +9 -0
- package/src/module/llm/deepseek.ts +214 -0
- package/src/module/llm/llm.ts +84 -0
- package/src/module/mcp/client.ts +110 -0
- package/src/module/mcp/http.ts +102 -0
- package/src/module/mcp/protocol.ts +77 -0
- package/src/module/mcp/server.ts +148 -0
- package/src/module/mcp/transport.ts +30 -0
- package/src/module/mcp/workspaceServer.ts +111 -0
- package/src/module/sandbox/sandbox.ts +29 -0
- package/src/module/tool/mcpExecutor.ts +54 -0
- package/src/module/tool/policy.ts +52 -0
- package/src/module/tool/redact.ts +29 -0
- package/src/module/tool/tool.ts +53 -0
- package/src/module/tool/workspaceExecutor.ts +35 -0
- package/src/policy/guard.ts +240 -0
- package/src/policy/policy.ts +561 -0
- package/src/process/agent.ts +341 -0
- package/src/process/agentService.ts +236 -0
- package/src/process/agentStore.ts +378 -0
- package/src/process/executionStore.ts +151 -0
- package/src/process/index.ts +5 -0
- package/src/process/process.ts +240 -0
- package/src/process/transitions.ts +19 -0
- package/src/progress/index.ts +2 -0
- package/src/progress/progress.ts +85 -0
- package/src/protocol/a2a.ts +120 -0
- package/src/protocol/channel.ts +44 -0
- package/src/protocol/envelope.ts +655 -0
- package/src/protocol/httpChannel.ts +87 -0
- package/src/protocol/protocol.ts +138 -0
- package/src/protocol/wire.ts +60 -0
- package/src/receipt/receipt.ts +47 -0
- package/src/registry/content.ts +69 -0
- package/src/registry/index.ts +23 -0
- package/src/registry/registry.ts +599 -0
- package/src/runtime/action.ts +87 -0
- package/src/runtime/behavior.ts +330 -0
- package/src/runtime/behaviorTuning.ts +163 -0
- package/src/runtime/cognitiveRuntime.ts +703 -0
- package/src/runtime/escalation.ts +35 -0
- package/src/runtime/governedTask.ts +233 -0
- package/src/runtime/index.ts +15 -0
- package/src/runtime/kernelRuntime.ts +144 -0
- package/src/runtime/operation.ts +35 -0
- package/src/runtime/replay.ts +71 -0
- package/src/runtime/routing.ts +58 -0
- package/src/runtime/safety.ts +48 -0
- package/src/runtime/session.ts +341 -0
- package/src/runtime/sessionStore.ts +43 -0
- package/src/runtime/telemetry.ts +55 -0
- package/src/runtime/turnStore.ts +30 -0
- package/src/scenario/index.ts +1 -0
- package/src/scenario/scenario.ts +299 -0
- package/src/semantic/canonical.ts +24 -0
- package/src/semantic/sha256.ts +82 -0
- package/src/storage/appendLog.ts +372 -0
- package/src/storage/fileAppendSink.ts +40 -0
- package/src/store/bindCache.ts +22 -0
- package/src/store/cache.ts +191 -0
- package/src/store/context.ts +31 -0
- package/src/store/handleStore.ts +31 -0
- package/src/store/index.ts +9 -0
- package/src/store/messageStore.ts +31 -0
- package/src/store/objectStore.ts +31 -0
- package/src/store/processStore.ts +31 -0
- package/src/store/threadStore.ts +31 -0
- package/src/store/windowStore.ts +31 -0
- package/src/structure/abstractSyntaxTree.ts +493 -0
- package/src/structure/avlTree.ts +408 -0
- package/src/structure/binarySearchTree.ts +352 -0
- package/src/structure/binaryTree.ts +525 -0
- package/src/structure/bloomFilter.ts +231 -0
- package/src/structure/compare.ts +110 -0
- package/src/structure/cuckooFilter.ts +337 -0
- package/src/structure/deque.ts +223 -0
- package/src/structure/filterKey.ts +36 -0
- package/src/structure/hash.ts +279 -0
- package/src/structure/heap.ts +268 -0
- package/src/structure/iterator.ts +22 -0
- package/src/structure/lru.ts +619 -0
- package/src/structure/ordered.ts +399 -0
- package/src/structure/priority.ts +915 -0
- package/src/structure/queue.ts +168 -0
- package/src/structure/redBlackTree.ts +680 -0
- package/src/structure/segmentTree.ts +248 -0
- package/src/structure/stack.ts +118 -0
- package/src/structure/unordered.ts +407 -0
- package/src/style.css +278 -0
- package/src/thread/thread.ts +176 -0
- package/src/thread/transitions.ts +17 -0
- package/src/types/common.ts +119 -0
- package/src/types/index.ts +23 -0
- package/src/warrant/epistemic.ts +154 -0
- package/src/warrant/inquiry.ts +166 -0
- package/src/warrant/warrant.ts +179 -0
- package/src/window/compaction.ts +403 -0
- package/src/window/compactionTypes.ts +119 -0
- package/src/window/index.ts +4 -0
- package/src/window/page.ts +18 -0
- package/src/window/window.ts +244 -0
- package/tools/_helpers.ts +34 -0
- package/tools/a2a-check.ts +110 -0
- package/tools/a2a-flow-check.ts +78 -0
- package/tools/agent-card-check.ts +76 -0
- package/tools/agent-check.ts +236 -0
- package/tools/agent-store-check.ts +153 -0
- package/tools/agreement-check.ts +27 -0
- package/tools/annotation-server-check.ts +48 -0
- package/tools/annotation-server.ts +230 -0
- package/tools/annotation-status.ts +65 -0
- package/tools/approval-access-check.ts +66 -0
- package/tools/arch-check.ts +72 -0
- package/tools/attention-core-check.ts +48 -0
- package/tools/attention-resource-check.ts +169 -0
- package/tools/audit-check.ts +207 -0
- package/tools/authority-check.ts +124 -0
- package/tools/authz-check.ts +138 -0
- package/tools/bayes-check.ts +162 -0
- package/tools/bayes-probe.ts +154 -0
- package/tools/behavior-tuning-check.ts +53 -0
- package/tools/board-check.ts +87 -0
- package/tools/boundary-check.ts +199 -0
- package/tools/bundle-trust-check.ts +96 -0
- package/tools/calibrate-imported.ts +108 -0
- package/tools/calibration-check.ts +44 -0
- package/tools/calibration-registry-check.ts +40 -0
- package/tools/calibration-sim.ts +40 -0
- package/tools/card-sign-check.ts +71 -0
- package/tools/card-trust-check.ts +78 -0
- package/tools/channel-check.ts +86 -0
- package/tools/checkpoint-check.ts +620 -0
- package/tools/cleanup-style-configs.ts +29 -0
- package/tools/cognition-check.ts +648 -0
- package/tools/cognitive-runtime-check.ts +609 -0
- package/tools/collaboration-demo.ts +78 -0
- package/tools/compaction-check.ts +266 -0
- package/tools/concept-check.ts +260 -0
- package/tools/concurrency-check.ts +242 -0
- package/tools/conformance-runtime.ts +389 -0
- package/tools/conformance.ts +651 -0
- package/tools/context-ast-check.ts +90 -0
- package/tools/context-ast-deepseek.ts +242 -0
- package/tools/context-graph-bench.ts +50 -0
- package/tools/context-graph-check.ts +229 -0
- package/tools/context-index-check.ts +48 -0
- package/tools/context-lifecycle-check.ts +69 -0
- package/tools/context-projection-check.ts +73 -0
- package/tools/context-scope-check.ts +134 -0
- package/tools/context-storage-check.ts +113 -0
- package/tools/cooperation-check.ts +517 -0
- package/tools/cooperation-http-check.ts +125 -0
- package/tools/deepseek-llm-check.ts +147 -0
- package/tools/deepseek-probe.ts +494 -0
- package/tools/diagnosis-check.ts +109 -0
- package/tools/diagnosis-router-check.ts +50 -0
- package/tools/document-context-check.ts +237 -0
- package/tools/envelope-check.ts +659 -0
- package/tools/eslint-rules/index.ts +26 -0
- package/tools/eslint-rules/rules/jsdoc-comment-format.ts +105 -0
- package/tools/eslint-rules/rules/no-function-keyword.ts +60 -0
- package/tools/eslint-rules/rules/no-multiline-parameters.ts +71 -0
- package/tools/eslint-rules/rules/no-multiline-type-parameters.ts +57 -0
- package/tools/eslint-rules/rules/no-undefined-comparison.ts +115 -0
- package/tools/eslint-rules/rules/prefer-template-for-string-conversion.ts +97 -0
- package/tools/eslint-rules/rules/require-typeof-parentheses.ts +49 -0
- package/tools/eslint-rules/rules/require-variable-type.ts +36 -0
- package/tools/eslint-rules/rules/variable-naming.ts +175 -0
- package/tools/eval-recorded-replay.ts +215 -0
- package/tools/eval-replay.ts +139 -0
- package/tools/eval-summary.ts +136 -0
- package/tools/evidence-revalidation-check.ts +235 -0
- package/tools/exec-check.ts +217 -0
- package/tools/federation-check.ts +166 -0
- package/tools/federation-demo.ts +45 -0
- package/tools/filter-check.ts +243 -0
- package/tools/governance-check.ts +680 -0
- package/tools/governance-store-check.ts +131 -0
- package/tools/governed-task-check.ts +227 -0
- package/tools/guard-check.ts +122 -0
- package/tools/http-channel-check.ts +125 -0
- package/tools/import-campaign.ts +28 -0
- package/tools/inquiry-check.ts +126 -0
- package/tools/interaction-check.ts +171 -0
- package/tools/interrupts-check.ts +173 -0
- package/tools/ipc-check.ts +170 -0
- package/tools/kernel-async-check.ts +136 -0
- package/tools/kernel-check.ts +369 -0
- package/tools/kernel-runtime-check.ts +276 -0
- package/tools/keys-check.ts +559 -0
- package/tools/label-audit.ts +70 -0
- package/tools/labels-workflow-check.ts +49 -0
- package/tools/linear-structure-check.ts +524 -0
- package/tools/live-exec.ts +62 -0
- package/tools/live-governance-eval.ts +813 -0
- package/tools/live-legacy.ts +50 -0
- package/tools/lru-check.ts +182 -0
- package/tools/make-annotation-campaign.ts +57 -0
- package/tools/mcp-executor-check.ts +33 -0
- package/tools/merge-annotations.ts +32 -0
- package/tools/merge-check.ts +98 -0
- package/tools/metrics-check.ts +84 -0
- package/tools/net-probe.ts +107 -0
- package/tools/oauth-probe.ts +117 -0
- package/tools/outbox-check.ts +50 -0
- package/tools/persistence-check.ts +144 -0
- package/tools/pin-check.ts +116 -0
- package/tools/platform-check.ts +281 -0
- package/tools/policy-check.ts +514 -0
- package/tools/prettier-plugin/index.mts +84 -0
- package/tools/priority-check.ts +627 -0
- package/tools/probe-context7.ts +63 -0
- package/tools/registry-check.ts +252 -0
- package/tools/reliability-check.ts +25 -0
- package/tools/retry-check.ts +85 -0
- package/tools/runtime-check.ts +165 -0
- package/tools/runtime-deepseek-check.ts +85 -0
- package/tools/runtime-eval.ts +358 -0
- package/tools/scenario-check.ts +161 -0
- package/tools/scenario-incident.ts +162 -0
- package/tools/scoped-priors-check.ts +35 -0
- package/tools/scoped-priors-pooling.ts +34 -0
- package/tools/segment-ast-check.ts +649 -0
- package/tools/session-check.ts +196 -0
- package/tools/session-store-check.ts +73 -0
- package/tools/share-check.ts +88 -0
- package/tools/sign-check.ts +95 -0
- package/tools/signing-check.ts +275 -0
- package/tools/snapshot-demo.ts +65 -0
- package/tools/social-check.ts +146 -0
- package/tools/structure-compare-check.ts +95 -0
- package/tools/support/documentScanner.ts +577 -0
- package/tools/support/texScanner.ts +631 -0
- package/tools/support/workspaceScanner.ts +476 -0
- package/tools/team-check.ts +163 -0
- package/tools/team-demo.ts +36 -0
- package/tools/telemetry-check.ts +44 -0
- package/tools/tex-context-check.ts +263 -0
- package/tools/tool-gate-check.ts +98 -0
- package/tools/tree-structure-check.ts +786 -0
- package/tools/trust-flow-check.ts +158 -0
- package/tools/turn-store-check.ts +57 -0
- package/tools/unified-check.ts +83 -0
- package/tools/validate.ts +309 -0
- package/tools/wire-check.ts +96 -0
- package/tools/workspace-agent-check.ts +486 -0
- package/tools/workspace-agent-demo.ts +62 -0
- package/tools/workspace-agent-server.ts +101 -0
- package/tools/workspace-context-check.ts +331 -0
- package/tools/workspace-context.ts +131 -0
- package/tsconfig.json +24 -0
- package/tsconfig.tools.json +31 -0
- package/viz/context-ast.json +1577 -0
package/.editorconfig
ADDED
package/.prettierignore
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
node_modules
|
|
2
|
+
dist
|
|
3
|
+
dist-ssr
|
|
4
|
+
docs
|
|
5
|
+
public
|
|
6
|
+
package-lock.json
|
|
7
|
+
*.css
|
|
8
|
+
*.html
|
|
9
|
+
*.json
|
|
10
|
+
*.md
|
|
11
|
+
|
|
12
|
+
# Legacy JS/MJS files kept only as transitional shims; delete them.
|
|
13
|
+
eslint.config.js
|
|
14
|
+
prettier.config.mjs
|
|
15
|
+
tools/eslint-rules/**/*.js
|
|
16
|
+
tools/prettier-plugin/*.mjs
|
|
17
|
+
.delete-probe
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this
|
|
6
|
+
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Consolidated project guidance into the English and Chinese READMEs; evaluation summaries now remain JSON-only.
|
|
13
|
+
|
|
14
|
+
## [0.4.0] - 2026-10-29
|
|
15
|
+
|
|
16
|
+
Governance v0.4: persistence, key rotation and real HTTP interoperability.
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- A real HTTP server (`src/governance/httpServer.ts`): localhost, method/path/body limits,
|
|
21
|
+
end-to-end authentication with `HttpCooperationTransport`; `cooperation-http-check` has 3 checks.
|
|
22
|
+
- Key rotation (`GovernanceKeyring.rotate/revokeKid/prune`): signatures made before rotation remain
|
|
23
|
+
valid during the overlap window and an old kid can be revoked; `signing-check` is now 5 checks.
|
|
24
|
+
- Audit checkpoints (`checkpoint/verifyCheckpoint/entriesAfter`): a retained segment verifies
|
|
25
|
+
independently; `audit-check` is now 4 checks.
|
|
26
|
+
- Governance object store (`src/governance/store.ts`): manifests, credentials and receipts are
|
|
27
|
+
appended to a JSONL event log and the latest state is replayed on reopen;
|
|
28
|
+
`governance-store-check` has 1 check.
|
|
29
|
+
- DeepSeek paired samples expanded to 20: rubric 20/20, judge 4.85/5, paired token delta +6.9%,
|
|
30
|
+
about $0.007547, boundaries 20/20.
|
|
31
|
+
|
|
32
|
+
## [0.3.0] - 2026-10-28
|
|
33
|
+
|
|
34
|
+
Governance v0.3: Ed25519 signing, durable audit, authenticated transport and a pre-execution tool gate.
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
|
|
38
|
+
- Ed25519 signing adapter (`src/governance/signing.ts`): `GovernanceSignatureBundle` binds
|
|
39
|
+
signer/subject/id/version/digest and `GovernanceKeyring` supports revocation; `signing-check`
|
|
40
|
+
covers transplant, missing, duplicate and revoked signatures.
|
|
41
|
+
- Durable audit: `src/storage/fileAppendSink.ts` provides a JSONL file sink; `audit-check` now
|
|
42
|
+
reopens the chain across processes and rejects on-disk tampering (3 checks).
|
|
43
|
+
- HTTP transport authentication: Ed25519 signatures, clock skew and nonce replay protection;
|
|
44
|
+
`cooperation-check` is now 14 checks.
|
|
45
|
+
- Pre-execution tool gate (`src/governance/toolPolicy.ts`): `GovernedToolPolicy` checks
|
|
46
|
+
high-risk approval, freeze/breaker and the evidence floor before the executor runs;
|
|
47
|
+
`tool-gate-check` has 4 checks.
|
|
48
|
+
- DeepSeek evaluation expanded to 20 quality and 20 boundary cases: rubric 20/20, judge
|
|
49
|
+
4.85/5, paired token delta +6.2%, about $0.004095; the report is
|
|
50
|
+
`docs/probes/governance-live.json`.
|
|
51
|
+
\n## [0.2.0] - 2026-10-28
|
|
52
|
+
|
|
53
|
+
Governance v0.2: auditable, transportable and measurable, with a green verification chain.
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
|
|
57
|
+
- The attention-governance layer (`src/governance/`). It implements the nine constructs of the
|
|
58
|
+
Attention Manifest Protocol description: the scenario × mode matrix (all tables from
|
|
59
|
+
9.1–9.8), the perspective registry, signed attention manifests, the three-layer context,
|
|
60
|
+
triple-signed switch credentials, the Bayesian control layer, the legal behaviour layer
|
|
61
|
+
(freeze, downgrade, breaker), the three-ledger budget and the seven-phase approval
|
|
62
|
+
workflow. It reconciles the description's T1/T2/T3 strictness order with AMP's existing
|
|
63
|
+
T0–T4 strength order (`F1→T3`, `F2→T2`, `F3→T1`) and keeps explicit bridges from the eight
|
|
64
|
+
legacy scenarios to the five canonical ones and from `inspire` to `diverge`.
|
|
65
|
+
- `docs/governance.md`, `governance.schema.json` (manifest and credential) and two validatable
|
|
66
|
+
examples (`attention-manifest.json`, `switch-credential.json`).
|
|
67
|
+
- `tools/governance-check.ts` (19 assertions) and `tools/governed-task-check.ts` (5
|
|
68
|
+
assertions), both wired into `npm run verify`.
|
|
69
|
+
- `src/runtime/governedTask.ts`: manifest verification, credential validation, legal audit,
|
|
70
|
+
ledger charge, board receipt and control decision wrapped around `CognitiveRuntime`.
|
|
71
|
+
Refusal paths return before the model call. A live `deepseek-chat` governed turn has been
|
|
72
|
+
run end to end.
|
|
73
|
+
- Agent budget ledgers and `reallocate()`: budgets now support `scope: "agent"`; a sub-agent's
|
|
74
|
+
quota is transferred from its parent with the total conserved. Negative/NaN/Infinity amounts
|
|
75
|
+
are rejected, reserve charges require finance approval, and a draw above 50% also needs the board.
|
|
76
|
+
- Perspective-switch orchestration (`src/governance/switching.ts`): peer switch, downgrade,
|
|
77
|
+
mode switch, scenario re-derivation and the escalation plan. A scenario switch calls
|
|
78
|
+
`rederiveAttentionManifest()`, increments the version and records the parent digest.
|
|
79
|
+
- Multi-agent cooperation (`src/governance/cooperation.ts`): structured messages (manifest
|
|
80
|
+
summary, refs, credential, receipt), receiver-side credential verification, an independent
|
|
81
|
+
supervisory audit path, and communication pruning by reliability × information value.
|
|
82
|
+
- Multi-agent transport seam (`src/governance/transport.ts`): `LoopbackTransport`,
|
|
83
|
+
`HttpCooperationTransport` and `createCooperationHandler()`. The receiver always re-runs the
|
|
84
|
+
digest/manifest/credential/receipt checks; malformed envelopes are 400, policy rejections 422
|
|
85
|
+
and success 200. `cooperation-check` is now 13 checks.
|
|
86
|
+
- Governance audit chain (`src/governance/audit.ts`): manifests, credentials, receipts, charges,
|
|
87
|
+
legal orders, workflow transitions, switches and runtime turns can be appended to a hash-linked
|
|
88
|
+
append-only log; `verify()` detects edits, reordering and truncation, and `open({ sink })`
|
|
89
|
+
verifies the whole chain on reopen. `GovernedTask` accepts an `audit` and appends a
|
|
90
|
+
`runtime.turn` record after settlement.
|
|
91
|
+
- `tools/audit-check.ts` (2 checks) covers cross-object records, reopen, tampering and corruption;
|
|
92
|
+
wired into `npm run verify`.
|
|
93
|
+
- `tools/cooperation-check.ts` (13 checks) wired into `npm run verify`; `governance-check` is
|
|
94
|
+
now 21 checks, including regressions for forged signatures, negative amounts, freeze
|
|
95
|
+
revocation, the archive gate, control NaN, unknown effects and private-context leakage.
|
|
96
|
+
- `tools/live-governance-eval.ts` (`npm run governance-live`) with DeepSeek quality, token and
|
|
97
|
+
boundary evaluation. Quality uses a deterministic rubric plus a strict judge; tokens record
|
|
98
|
+
input/output/cache/cost, ledger charge and cap; boundaries cover crisis escalation, expired
|
|
99
|
+
manifest, stale credential, legal freeze, budget exhaustion, prompt-injection leakage and
|
|
100
|
+
multi-agent scope/size limits. The report lands in `docs/probes/governance-live.json`; the
|
|
101
|
+
key is read from the environment only. First run: 6/6 rubric, judge 4.83/5, matched token
|
|
102
|
+
delta +3.8%, boundaries 9/9.
|
|
103
|
+
- `GovernedTask` now maps the manifest's scenario and modes into the runtime's
|
|
104
|
+
scenario/interaction budgets, injects the manifest summary, evidence floor and forbidden
|
|
105
|
+
behaviours as a `systemNote`, charges the manifest's `perspective`/`agent` ledger, and checks
|
|
106
|
+
for a frozen ledger before generation.
|
|
107
|
+
- Construction boundary (`src/boundary/`). `frameFrom()` validates the id grammar, reference
|
|
108
|
+
closure, the 9-slot ceiling, the exclusion cap (default 50, overflow returned as `deferred`)
|
|
109
|
+
and budget consistency before a frame exists; `parseToolCall()` validates arguments against a
|
|
110
|
+
JSON Schema subset and returns a digest of exactly what was accepted; `RefTable` gives `tool`
|
|
111
|
+
and `capability` one namespace and resolves `self`. 19 assertions run as
|
|
112
|
+
`npm run boundary-check` and inside `npm run verify`.
|
|
113
|
+
- `ExecProfile` parses call arguments through `parseToolCall()` before policy evaluation and
|
|
114
|
+
dispatch. A rejected argument set records a blocked receipt and never reaches a server;
|
|
115
|
+
approvals bind to the parsed digest.
|
|
116
|
+
- Context economy. `planPrune()` builds an explicit view of a verified ledger: superseded
|
|
117
|
+
claims, closed hypotheses and resolved non-blocking unknowns leave it, every omission
|
|
118
|
+
carries a `reason` and a `revisit_if`, and citations are closed over so that nothing
|
|
119
|
+
dangles. `supersedes` is deliberately not treated as a dependency.
|
|
120
|
+
- `compactLedger()` replaces a cold prefix with a checkpoint that commits to the digest of
|
|
121
|
+
the removed entries. `verifyCompaction()` re-derives that commitment and checks that the
|
|
122
|
+
tail continues the same chain. Compaction refuses to bury an entry the retained tail still
|
|
123
|
+
cites, and raises `CompactionRefused` with the pinned references.
|
|
124
|
+
- `compaction.schema.json` covering checkpoints and prune plans, two worked examples
|
|
125
|
+
(`checkpoint.json`, `prune-plan.json`), and `docs/compaction.md` with invariants P-1 to P-7.
|
|
126
|
+
- `tools/compaction-check.ts` with 15 assertions, wired into `npm run verify`.
|
|
127
|
+
- Concept economy. `pruneConcept()` bounds one concept's content: duplicate examples collapse
|
|
128
|
+
to the more typical one, examples beyond `maxExamples` go from the least typical end, and
|
|
129
|
+
the floor (`minExamples`) keeps the concept grounded. Relations are de-duplicated, dangling
|
|
130
|
+
targets are dropped when a resolver is supplied, and the extension is de-duplicated. The
|
|
131
|
+
definition, intension, counterexamples and `grounded_in` are never trimmed, and a view never
|
|
132
|
+
bumps `version`.
|
|
133
|
+
- `compactConceptHistory()` keeps the head plus `keepVersions` and commits the rest into a
|
|
134
|
+
`concept-checkpoint`. It refuses a broken version lineage or a window that covers every
|
|
135
|
+
version. Invariants C-1 to C-4 are documented in `docs/compaction.md` §6.
|
|
136
|
+
- `concept-compaction.schema.json`, two worked examples, and `tools/concept-check.ts`
|
|
137
|
+
(14 assertions) wired into `npm run verify`.
|
|
138
|
+
- `src/structure/priority.ts`: a stable `PriorityQueue` over a comparison heap, an
|
|
139
|
+
`IndexedPriorityQueue` that re-prioritises and deletes by key in O(log n), a `BucketQueue`
|
|
140
|
+
for integer priorities with one FIFO bucket per priority, and `TopK` for bounded
|
|
141
|
+
selection. `tools/priority-check.ts` runs 27 cases, including randomised differential
|
|
142
|
+
checks against stable-sort models, as `npm run priority-check` and inside `npm run verify`.
|
|
143
|
+
|
|
144
|
+
### Changed
|
|
145
|
+
|
|
146
|
+
- Counts moved with the new layer: schemas 14 → 16, validated example objects 33 → 37,
|
|
147
|
+
verification entries 29 → 31, TypeScript scripts under `tools/` 38 → 40.
|
|
148
|
+
- All 38 scripts under `tools/` migrated from JavaScript to TypeScript. They run directly
|
|
149
|
+
under Node's type stripping and are covered by `tsconfig.tools.json`; no `.mjs` file
|
|
150
|
+
remains.
|
|
151
|
+
- `npm run verify` now runs both type checks — `tsc --noEmit` for `src/` and
|
|
152
|
+
`tsc -p tsconfig.tools.json` for `tools/` — so a type error in the tests fails the suite.
|
|
153
|
+
- Test fixtures declare the protocol types they build (`Claim`, `EvidenceItem`,
|
|
154
|
+
`Hypothesis`, `Candidate`, `MergeClaim`, `TeamManifest`, `AttentionRequest` and an
|
|
155
|
+
unsigned `Manifest`) instead of widening string literals.
|
|
156
|
+
- HTTP suites use the shared `listen()` and `portOf()` helpers rather than untyped calls
|
|
157
|
+
to `server.address()`.
|
|
158
|
+
- Documentation, the script paths in `package.json` and the README were updated for the
|
|
159
|
+
rename.
|
|
160
|
+
- Licence changed from `UNLICENSED` to Apache-2.0. A verbatim copy of the licence is at the
|
|
161
|
+
repository root, `package.json` and `package-lock.json` declare `Apache-2.0`, and both
|
|
162
|
+
READMEs state the grant and the conditions a redistribution has to meet.
|
|
163
|
+
- Attribution: a `NOTICE` file records the copyright holder (Eloy Kim, 2026) and must be
|
|
164
|
+
kept by redistributions, `package.json` names the author, and both READMEs link the
|
|
165
|
+
licence and the notices.
|
|
166
|
+
|
|
167
|
+
### Fixed
|
|
168
|
+
|
|
169
|
+
- The audit gate was unsatisfiable: `audit.behavior` and `audit.budget` had no approving
|
|
170
|
+
department. Legal now owns `audit.behavior` and finance owns `audit.budget`, so the audit
|
|
171
|
+
phase can advance to escalation or archive.
|
|
172
|
+
- `src/bayes/calibration.ts` left unused `item` parameters in the `filter` callbacks of the
|
|
173
|
+
cross-validation split, which made `tsc --noEmit` fail; the parameters were renamed with no
|
|
174
|
+
behavioural change.
|
|
175
|
+
- `package.json` had a corrupted UTF-8 fragment in `description` (`T0閳ユ彑4`), now `T0-T4`; the
|
|
176
|
+
`demo` script pointed at the long-deleted `src/cycle/demo.ts` and was removed, with the
|
|
177
|
+
README pointing at the runnable governance checks instead.
|
|
178
|
+
- `a2a-check` compared the digest of a runtime `Delegation` with the digest of the same
|
|
179
|
+
object passed where a `DelegationDoc` was expected, so both sides hashed the camelCase
|
|
180
|
+
object and the assertion could never fail. It now converts with `toDelegationDoc()` and
|
|
181
|
+
compares the digest of the document with the digest of the document.
|
|
182
|
+
- `persistence-check` spread a hash-chain payload typed `unknown`; the payload is now
|
|
183
|
+
narrowed explicitly at the test boundary.
|
|
184
|
+
- `sign-check` imported a type in the middle of a multi-line import statement after the
|
|
185
|
+
automated rewrite; the import order is now correct.
|
|
186
|
+
|
|
187
|
+
## [0.1.0] - 2026-10-24
|
|
188
|
+
|
|
189
|
+
First public reference implementation.
|
|
190
|
+
|
|
191
|
+
### Added
|
|
192
|
+
|
|
193
|
+
#### Protocol and types
|
|
194
|
+
|
|
195
|
+
- 14 JSON Schemas under `docs/schemas/`, with TypeScript types in one-to-one
|
|
196
|
+
correspondence.
|
|
197
|
+
- A message envelope and seven speech acts: `attend`, `plan`, `act`, `ask`, `note`,
|
|
198
|
+
`reflect` and `read`.
|
|
199
|
+
- Twelve invariants: W-1 to W-5 (warrant), A-1 to A-5 (attention), M-1 (manifest) and
|
|
200
|
+
X-1 (log).
|
|
201
|
+
|
|
202
|
+
#### Attention
|
|
203
|
+
|
|
204
|
+
- A salience contract with a monotonicity rule, plus focus and ignore sets.
|
|
205
|
+
- An immutable frame chain; `Frame.ignored` records exclusions with `reason` and
|
|
206
|
+
`revisit_if`.
|
|
207
|
+
- Impasse classification, and interrupt classes with attention debt.
|
|
208
|
+
- Hard budget enforcement at the dispatcher: allocation may degrade to handles,
|
|
209
|
+
pagination or refusal, but never truncates silently.
|
|
210
|
+
- Handle-based overflow, so that large results stay addressable.
|
|
211
|
+
|
|
212
|
+
#### Warrant
|
|
213
|
+
|
|
214
|
+
- T0–T4 epistemic tiers, confidence derivation and tier validation.
|
|
215
|
+
- Minimal revision with a `supersedes` chain.
|
|
216
|
+
- Explicit unknowns and stopping rules, with preregistration and reproduction checks.
|
|
217
|
+
|
|
218
|
+
#### Execution
|
|
219
|
+
|
|
220
|
+
- An MCP 2026-07-28 client: stateless `_meta`, `server/discover`, `ttlMs` and `cacheScope`,
|
|
221
|
+
HTTP binding headers, and a fallback to the legacy `initialize` handshake.
|
|
222
|
+
- A budget dispatcher as the single metering point, with approval gating and TTL caching.
|
|
223
|
+
|
|
224
|
+
#### Federation and trust
|
|
225
|
+
|
|
226
|
+
- `ManifestBundle` and `Attestation`, digest pinning, revocation, and import that fails
|
|
227
|
+
closed.
|
|
228
|
+
- Agent Card discovery and JWS/EdDSA card signatures.
|
|
229
|
+
- Bundle keys, endorsement and scope policy; an A2A `message/send` binding that surfaces
|
|
230
|
+
JSON-RPC errors.
|
|
231
|
+
|
|
232
|
+
#### Collaboration
|
|
233
|
+
|
|
234
|
+
- Delegation with tier decay, ten invariants, lease fencing and depth limits.
|
|
235
|
+
- A task board, result merging with contested-value handling, and authority adjudication.
|
|
236
|
+
- A unified ledger, metrics (duplicate-task rate, alignment-token share, cost per success
|
|
237
|
+
and contested rate) and an end-to-end session.
|
|
238
|
+
|
|
239
|
+
#### Persistence and sharing
|
|
240
|
+
|
|
241
|
+
- An append-only hash chain over events, frames, receipts, claims, hypotheses, unknowns,
|
|
242
|
+
goals and plans.
|
|
243
|
+
- Snapshot verification by count, tip, hash and chain order; restore refuses a broken
|
|
244
|
+
snapshot.
|
|
245
|
+
- Three sharing granularities.
|
|
246
|
+
|
|
247
|
+
#### Documentation and tooling
|
|
248
|
+
|
|
249
|
+
- `docs/architecture.md`: the normative specification.
|
|
250
|
+
- `docs/rationale.md`: twelve ADRs, each with its evidence, its cost and the options that
|
|
251
|
+
were rejected.
|
|
252
|
+
- Multi-agent, trust-chain and federation documents, and nine research briefs.
|
|
253
|
+
- 29 verification entries (166 counted assertions), 4 example generators and 5 endpoint
|
|
254
|
+
probes, plus 33 example objects validated against the schemas.
|
|
255
|
+
|
|
256
|
+
### Security
|
|
257
|
+
|
|
258
|
+
- Budgets are enforced at one point, in response to the class of failure represented by
|
|
259
|
+
CVE-2026-114386, where nested tool calls bypassed a per-run quota.
|
|
260
|
+
- External content cannot raise its own salience; promotion requires a trusted signal.
|
|
261
|
+
- Delegation, federation import and channel operations fail closed, each recording a
|
|
262
|
+
reason.
|
|
263
|
+
|
|
264
|
+
### Known limitations
|
|
265
|
+
|
|
266
|
+
- Sandbox isolation, multi-tenancy and interactive OAuth authorisation are not implemented.
|
|
267
|
+
- Cross-domain tests run locally; interoperability with external agents has not been
|
|
268
|
+
demonstrated.
|
|
269
|
+
- The specification and the research briefs are written in Simplified Chinese.
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# 更新日志
|
|
2
|
+
|
|
3
|
+
本文件记录本项目的所有重要变更。
|
|
4
|
+
|
|
5
|
+
格式遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循
|
|
6
|
+
[语义化版本](https://semver.org/lang/zh-CN/)。
|
|
7
|
+
|
|
8
|
+
## [未发布]
|
|
9
|
+
|
|
10
|
+
### 变更
|
|
11
|
+
|
|
12
|
+
- 将项目说明收敛到中英文 README;评测汇总只保留 JSON 格式。
|
|
13
|
+
|
|
14
|
+
## [0.4.0] - 2026-10-29
|
|
15
|
+
|
|
16
|
+
治理层 v0.4:持久化、轮换与真实 HTTP 互操作。
|
|
17
|
+
|
|
18
|
+
### 新增
|
|
19
|
+
|
|
20
|
+
- 真实 HTTP 服务端(`src/governance/httpServer.ts`):localhost、方法/路径/体积限制,
|
|
21
|
+
配合 `HttpCooperationTransport` 端到端认证;`cooperation-http-check` 3 项。
|
|
22
|
+
- 密钥轮换(`GovernanceKeyring.rotate/revokeKid/prune`):重叠窗口内旧签名继续有效,
|
|
23
|
+
旧 kid 可单独吊销;`signing-check` 增至 5 项。
|
|
24
|
+
- 审计检查点(`checkpoint/verifyCheckpoint/entriesAfter`):留存分段可独立校验;
|
|
25
|
+
`audit-check` 增至 4 项。
|
|
26
|
+
- 治理对象持久化(`src/governance/store.ts`):清单/凭据/回执写入 JSONL 事件日志,
|
|
27
|
+
重开恢复最新状态;`governance-store-check` 1 项。
|
|
28
|
+
- DeepSeek 配对样本扩到 20 组:质量 rubric 20/20、judge 4.85/5、配对 token 增量 +6.9%、
|
|
29
|
+
成本约 $0.007547、边界 20/20。
|
|
30
|
+
|
|
31
|
+
## [0.3.0] - 2026-10-28
|
|
32
|
+
|
|
33
|
+
治理层 v0.3:Ed25519 签署、持久审计、认证传输与工具前门控。
|
|
34
|
+
|
|
35
|
+
### 新增
|
|
36
|
+
|
|
37
|
+
- Ed25519 签署适配层(`src/governance/signing.ts`):`GovernanceSignatureBundle` 绑定
|
|
38
|
+
signer/subject/id/version/digest,`GovernanceKeyring` 支持吊销;`signing-check` 4 项覆盖
|
|
39
|
+
防移植、缺签、重复签与吊销。
|
|
40
|
+
- 审计持久化:`src/storage/fileAppendSink.ts` 提供 JSONL 文件 sink;`audit-check` 新增
|
|
41
|
+
跨进程重开与磁盘篡改拒绝(共 3 项)。
|
|
42
|
+
- HTTP 传输认证:Ed25519 签名、时间窗与 nonce 重放防护;`cooperation-check` 增至 14 项。
|
|
43
|
+
- 工具前置门控(`src/governance/toolPolicy.ts`):`GovernedToolPolicy` 在工具执行前检查
|
|
44
|
+
高风险审批、冻结/熔断与证据下限;`tool-gate-check` 4 项。
|
|
45
|
+
- DeepSeek 评测扩到 20 个质量用例与 20 个边界用例:rubric 20/20、judge 4.85/5、
|
|
46
|
+
配对 token 增量 +6.2%、成本约 $0.004095;报告见 `docs/probes/governance-live.json`。
|
|
47
|
+
\n## [0.2.0] - 2026-10-28
|
|
48
|
+
|
|
49
|
+
治理层 v0.2:可审计、可传输、可度量,校验链全绿。
|
|
50
|
+
|
|
51
|
+
### 新增
|
|
52
|
+
|
|
53
|
+
- 注意力治理层(`src/governance/`)。按「Attention Manifest Protocol 完整说明」实现九个构件:
|
|
54
|
+
情景×模式矩阵(9.1–9.8 全部表)、13+1 个视角的注册表、签名注意力清单、三层上下文、
|
|
55
|
+
三联签切换凭据、贝叶斯控制层、法务行为规范层(冻结/降级/熔断)、预算三账本与七阶段审批
|
|
56
|
+
工作流。统一了说明中 T1/T2/T3 的严格度与既有 T0–T4 强度序(F1→T3、F2→T2、F3→T1),
|
|
57
|
+
并保留八种旧场景到五种规范场景、`inspire` 到 `diverge` 的显式桥接。
|
|
58
|
+
- `docs/governance.md`、`governance.schema.json`(清单与凭据)、两个可校验示例
|
|
59
|
+
(`attention-manifest.json`、`switch-credential.json`)。
|
|
60
|
+
- `tools/governance-check.ts`(19 项)与 `tools/governed-task-check.ts`(5 项),
|
|
61
|
+
已接入 `npm run verify`。
|
|
62
|
+
- `src/runtime/governedTask.ts`:把清单验签、凭据校验、法务审计、账本扣款、黑板回执与
|
|
63
|
+
控制决策套在 `CognitiveRuntime` 外面;拒绝路径在模型调用之前返回。已用真实 DeepSeek
|
|
64
|
+
(`deepseek-chat`)跑通一次治理回合。
|
|
65
|
+
- Agent 预算账本与 `reallocate()`:预算现在支持 `scope: "agent"`,子 Agent 的额度从父账本转移,
|
|
66
|
+
总量守恒;负数/NaN/Infinity 额度直接拒绝,储备扣款必须带财务审批,超过 50% 另需董事会。
|
|
67
|
+
- 视角切换编排(`src/governance/switching.ts`):平级切换、降级、模式切换、情景重派生与升级计划;
|
|
68
|
+
情景切换走 `rederiveAttentionManifest()`,版本递增并记录 parent 摘要。
|
|
69
|
+
- 多 Agent 合作(`src/governance/cooperation.ts`):结构化消息(清单摘要、refs、凭据、回执)、
|
|
70
|
+
接收端凭据复验、监事会独立审计路径、按可靠度 × 信息价值剪枝通信图。
|
|
71
|
+
- 多 Agent 传输接缝(`src/governance/transport.ts`):`LoopbackTransport`、`HttpCooperationTransport`
|
|
72
|
+
与 `createCooperationHandler()`;接收端始终重跑摘要/清单/凭据/回执校验,格式错误 400、
|
|
73
|
+
策略拒绝 422、成功 200。`cooperation-check` 增至 13 项。
|
|
74
|
+
- 治理审计链(`src/governance/audit.ts`):清单、凭据、回执、扣款、法务、工作流、切换与
|
|
75
|
+
runtime 回合均可追加到只追加哈希链;`verify()` 检测改写/重排/截断,`open({ sink })` 重开时
|
|
76
|
+
先验链。`GovernedTask` 可注入 `audit`,结算后自动写 `runtime.turn`。
|
|
77
|
+
- `tools/audit-check.ts`(2 项)验证跨对象记录、重开、篡改与损坏拒绝,已接入 `npm run verify`。
|
|
78
|
+
- `tools/cooperation-check.ts`(13 项)已接入 `npm run verify`;`governance-check` 增至 21 项,
|
|
79
|
+
新增对伪造签名、负额度、冻结撤销、归档门禁、控制 NaN、未知 effect、私域引用泄漏的回归断言。
|
|
80
|
+
- `tools/live-governance-eval.ts`(`npm run governance-live`):接入 DeepSeek 做质量、token 与边界评测。
|
|
81
|
+
质量用确定性 rubric + 严格 judge;token 记录 input/output/cache/cost、账本扣款与预算上限;
|
|
82
|
+
边界覆盖危机升级、过期清单、过期凭据、法务冻结、预算耗尽、提示注入泄漏、多 Agent 越界与超限。
|
|
83
|
+
报告写入 `docs/probes/governance-live.json`,key 只从环境变量读取。
|
|
84
|
+
首次完整运行:10 个质量用例 rubric 全满分、judge 4.90/5;配对 token 增量 +5.4%;边界 10/10。
|
|
85
|
+
- `GovernedTask` 现在把清单情景/模式映射进 runtime 的 scenario/interaction 预算,并把清单摘要、
|
|
86
|
+
证据下限与禁止项作为 `systemNote` 注入系统提示;扣款按清单的 `perspective`/`agent` 账本绑定执行,
|
|
87
|
+
模型调用前先检查账本是否冻结。
|
|
88
|
+
- 构造边界(`src/boundary/`)。`frameFrom()` 在对象存在之前校验 id 文法、引用闭包、9 个槽位
|
|
89
|
+
上限、忽略上限(默认 50,溢出的部分作为 `deferred` 返回)与预算一致性;`parseToolCall()`
|
|
90
|
+
按 `inputSchema` 的子集解析参数,并给出被接受内容的摘要;`RefTable` 让 `tool` 与
|
|
91
|
+
`capability` 共用一个命名空间,并解析 `self`。19 项断言以 `npm run boundary-check` 运行,
|
|
92
|
+
同时接入 `npm run verify`。
|
|
93
|
+
- `ExecProfile` 在策略判断与派发之前用 `parseToolCall()` 解析参数。被拒绝的参数不会到达服务端,
|
|
94
|
+
只留下一条 blocked 回执;审批绑定的是解析后的摘要。
|
|
95
|
+
- 上下文经济。`planPrune()` 在已验证的账本上生成显式视图:被取代的主张、已关闭的假设、
|
|
96
|
+
已解决且非阻塞的未知会离开视图;每一条丢弃都带 `reason` 与 `revisit_if`;引用闭包保证
|
|
97
|
+
不会出现悬空引用。`supersedes` 有意**不**被视为依赖。
|
|
98
|
+
- `compactLedger()` 用检查点替换冷前缀,检查点承诺被移除条目的摘要;`verifyCompaction()`
|
|
99
|
+
重算该承诺,并检查 tail 是否接续同一条链。若保留的 tail 仍引用前缀条目,压缩会被拒绝,
|
|
100
|
+
并抛出带 `pinned` 列表的 `CompactionRefused`。
|
|
101
|
+
- 新增 `compaction.schema.json`(检查点与剪枝计划)、两个可校验示例
|
|
102
|
+
(`checkpoint.json`、`prune-plan.json`),以及含 P-1 至 P-7 不变量的
|
|
103
|
+
`docs/compaction.md`。
|
|
104
|
+
- 新增 `tools/compaction-check.ts`(15 项断言),已接入 `npm run verify`。
|
|
105
|
+
- 概念经济。`pruneConcept()` 为一个概念的体量设上限:重复示例折叠为更典型的那条;超过
|
|
106
|
+
`maxExamples` 的示例从最不典型的一端裁掉;`minExamples` 作为下限,保证概念仍有实例。
|
|
107
|
+
关系先去重,提供解析器时删除悬空目标,外延只折叠完全重复项。定义、内涵、反例与
|
|
108
|
+
`grounded_in` 永不裁剪;视图不提升 `version`。
|
|
109
|
+
- `compactConceptHistory()` 保留 head 与 `keepVersions`,其余版本压缩为
|
|
110
|
+
`concept-checkpoint`。版本号不连续或保留窗口覆盖全部版本时拒绝压缩。不变量 C-1 至 C-4
|
|
111
|
+
记录在 `docs/compaction.md` §6。
|
|
112
|
+
- 新增 `concept-compaction.schema.json`、两个可校验示例,以及 `tools/concept-check.ts`
|
|
113
|
+
(14 项断言),已接入 `npm run verify`。
|
|
114
|
+
- `src/structure/priority.ts`:基于比较堆的稳定 `PriorityQueue`;可按 key 以 O(log n)
|
|
115
|
+
重新定级与删除的 `IndexedPriorityQueue`;按整数优先级分桶、桶内 FIFO 的 `BucketQueue`;
|
|
116
|
+
以及有界选取的 `TopK`。`tools/priority-check.ts` 含 27 个用例(包括与稳定排序模型对拍的
|
|
117
|
+
随机差分检查),以 `npm run priority-check` 运行,并接入 `npm run verify`。
|
|
118
|
+
|
|
119
|
+
### 变更
|
|
120
|
+
|
|
121
|
+
- 数量随新层更新:schema 14 → 16、可校验示例对象 33 → 37、校验入口 29 → 31、
|
|
122
|
+
`tools/` 下的 TypeScript 脚本 38 → 40。
|
|
123
|
+
- `tools/` 下的 38 个脚本全部由 JavaScript 迁移为 TypeScript。它们由 Node 直接做类型剥离后
|
|
124
|
+
运行,并纳入 `tsconfig.tools.json` 的检查范围;仓库中已不存在 `.mjs` 文件。
|
|
125
|
+
- `npm run verify` 现在连续执行两份类型检查——`src/` 的 `tsc --noEmit` 与 `tools/` 的
|
|
126
|
+
`tsc -p tsconfig.tools.json`——测试代码中的类型错误会直接使整个校验失败。
|
|
127
|
+
- 测试夹具改为声明它真正构造的协议类型(`Claim`、`EvidenceItem`、`Hypothesis`、
|
|
128
|
+
`Candidate`、`MergeClaim`、`TeamManifest`、`AttentionRequest` 以及未签名的 `Manifest`),
|
|
129
|
+
不再把字面量拓宽成 `string`。
|
|
130
|
+
- HTTP 套件改用共享的 `listen()` 与 `portOf()`,不再无类型地调用 `server.address()`。
|
|
131
|
+
- 随改名同步更新了文档、`package.json` 中的脚本路径与 README。
|
|
132
|
+
- 许可证由 `UNLICENSED` 改为 Apache-2.0:仓库根目录新增许可证原文,`package.json` 与
|
|
133
|
+
`package-lock.json` 声明为 `Apache-2.0`,中英文 README 说明了授权内容与再分发须满足的
|
|
134
|
+
条件。
|
|
135
|
+
- 署名:新增 `NOTICE` 记录版权所有者(Eloy Kim,2026),再分发须保留该文件;
|
|
136
|
+
`package.json` 补充 author 字段;中英文 README 均链接许可证与署名声明。
|
|
137
|
+
|
|
138
|
+
### 修复
|
|
139
|
+
|
|
140
|
+
- 审计门禁曾不可满足:`audit.behavior` / `audit.budget` 没有审批部门。现在分别由法务与财务拥有,
|
|
141
|
+
审计阶段可以推进到升级或归档。
|
|
142
|
+
- `src/bayes/calibration.ts` 的交叉验证把未使用的 `item` 形参留在 `filter` 回调里,导致
|
|
143
|
+
`tsc --noEmit` 失败;现在形参改名并保持行为不变。
|
|
144
|
+
- `package.json` 的 `description` 含损坏的 UTF-8 片段(`T0閳ユ彑4`),已改为 `T0-T4`;
|
|
145
|
+
`demo` 脚本指向早已删除的 `src/cycle/demo.ts`,已移除,README 改为指向真实可运行的
|
|
146
|
+
治理校验命令。
|
|
147
|
+
- `a2a-check` 曾把运行时 `Delegation` 的摘要与同一个对象(本该是 `DelegationDoc`)的摘要
|
|
148
|
+
相比较,两侧哈希的都是 camelCase 对象,因此该断言永远不可能失败。现在先用
|
|
149
|
+
`toDelegationDoc()` 转换,再比较文档与文档的摘要。
|
|
150
|
+
- `persistence-check` 展开了类型为 `unknown` 的哈希链载荷;现在在测试边界处显式收窄。
|
|
151
|
+
- `sign-check` 在自动改写后把类型导入插进了多行 import 语句中间;导入顺序已修正。
|
|
152
|
+
|
|
153
|
+
## [0.1.0] - 2026-10-24
|
|
154
|
+
|
|
155
|
+
首个公开的参考实现。
|
|
156
|
+
|
|
157
|
+
### 新增
|
|
158
|
+
|
|
159
|
+
#### 协议与类型
|
|
160
|
+
|
|
161
|
+
- `docs/schemas/` 下的 14 个 JSON Schema,以及与之一一对应的 TypeScript 类型。
|
|
162
|
+
- 消息信封与七种言语行为:`attend`、`plan`、`act`、`ask`、`note`、`reflect`、`read`。
|
|
163
|
+
- 12 条不变量:W-1 至 W-5(凭据)、A-1 至 A-5(注意力)、M-1(自述)、X-1(日志)。
|
|
164
|
+
|
|
165
|
+
#### 注意力
|
|
166
|
+
|
|
167
|
+
- 带单调性规则的显著性契约,以及焦点集与忽略集。
|
|
168
|
+
- 不可变的帧链;`Frame.ignored` 记录被排除的对象,并给出 `reason` 与 `revisit_if`。
|
|
169
|
+
- 僵局分类,以及带注意力债务的打断分级。
|
|
170
|
+
- 在调度器处强制预算:分配可以降级为句柄、分页或拒绝,但绝不静默截断。
|
|
171
|
+
- 基于句柄的溢出机制,使大结果始终可寻址。
|
|
172
|
+
|
|
173
|
+
#### 凭据
|
|
174
|
+
|
|
175
|
+
- T0–T4 认知投入等级、置信度派生与等级校验。
|
|
176
|
+
- 带 `supersedes` 链的最小修订。
|
|
177
|
+
- 显式的未知与停止规则,以及预注册与复现检查。
|
|
178
|
+
|
|
179
|
+
#### 执行
|
|
180
|
+
|
|
181
|
+
- MCP 2026-07-28 客户端:无状态 `_meta`、`server/discover`、`ttlMs` 与 `cacheScope`、
|
|
182
|
+
HTTP 绑定头,以及回退到旧式 `initialize` 握手。
|
|
183
|
+
- 作为唯一计费点的预算调度器,配合审批门控与 TTL 缓存。
|
|
184
|
+
|
|
185
|
+
#### 联邦与信任
|
|
186
|
+
|
|
187
|
+
- `ManifestBundle` 与 `Attestation`、摘要固定、撤销,以及失败关闭的导入。
|
|
188
|
+
- Agent Card 发现与 JWS/EdDSA 卡片签名。
|
|
189
|
+
- bundle 密钥、背书与 scope 策略;A2A `message/send` 绑定会将 JSON-RPC 错误如实上报。
|
|
190
|
+
|
|
191
|
+
#### 协作
|
|
192
|
+
|
|
193
|
+
- 带等级衰减的委派、10 条不变量、租约 fencing 与深度限制。
|
|
194
|
+
- 任务板、含冲突值处理的结果合并,以及权威裁决。
|
|
195
|
+
- 统一账本、指标(重复任务率、对齐 token 占比、单次成功成本、争议率)与端到端会话。
|
|
196
|
+
|
|
197
|
+
#### 持久化与共享
|
|
198
|
+
|
|
199
|
+
- 覆盖事件、帧、回执、主张、假设、未知、目标与计划的只追加哈希链。
|
|
200
|
+
- 按数量、链尾、哈希与链序校验快照;恢复时拒收损坏的快照。
|
|
201
|
+
- 三种共享粒度。
|
|
202
|
+
|
|
203
|
+
#### 文档与工具
|
|
204
|
+
|
|
205
|
+
- `docs/architecture.md`:规范性架构文档。
|
|
206
|
+
- `docs/rationale.md`:12 条 ADR,每条都给出证据、代价与被否决的方案。
|
|
207
|
+
- 多 Agent、信任链与联邦三份专题文档,以及九份研究简报。
|
|
208
|
+
- 29 个校验入口(166 项带计数的断言)、4 个示例生成器、5 个端点探针,另有 33 个示例对象
|
|
209
|
+
通过 schema 校验。
|
|
210
|
+
|
|
211
|
+
### 安全
|
|
212
|
+
|
|
213
|
+
- 预算只在一点强制执行,针对的是 CVE-2026-114386 所代表的那类失效:嵌套工具调用绕过了
|
|
214
|
+
单次运行的配额。
|
|
215
|
+
- 外部内容不能提高自身显著性;提升只能来自可信信号。
|
|
216
|
+
- 委派、联邦导入与通道操作均失败关闭,并各自记录原因。
|
|
217
|
+
|
|
218
|
+
### 已知限制
|
|
219
|
+
|
|
220
|
+
- 尚未实现沙箱隔离、多租户与 OAuth 交互授权。
|
|
221
|
+
- 跨域测试均在本机运行;尚未演示与外部 Agent 的真实互通。
|
|
222
|
+
- 规范文档与研究简报以简体中文撰写。
|