@alan512/experienceengine 0.3.5 → 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/.claude-plugin/marketplace.json +0 -0
- package/.claude-plugin/plugin.json +0 -0
- package/.env.example +0 -0
- package/.mcp.json +0 -0
- package/LICENSE +0 -0
- package/README.md +17 -3
- package/README.zh-CN.md +15 -2
- package/dist/adapters/claude-code/event-store.d.ts +0 -0
- package/dist/adapters/claude-code/event-store.js +0 -0
- package/dist/adapters/claude-code/event-store.js.map +0 -0
- package/dist/adapters/claude-code/hook-normalizer.d.ts +0 -0
- package/dist/adapters/claude-code/hook-normalizer.js +0 -0
- package/dist/adapters/claude-code/hook-normalizer.js.map +0 -0
- package/dist/adapters/claude-code/runtime-projection.d.ts +0 -0
- package/dist/adapters/claude-code/runtime-projection.js +0 -0
- package/dist/adapters/claude-code/runtime-projection.js.map +0 -0
- package/dist/adapters/claude-code/session-store.d.ts +0 -0
- package/dist/adapters/claude-code/session-store.js +0 -0
- package/dist/adapters/claude-code/session-store.js.map +0 -0
- package/dist/adapters/codex/action-registry.d.ts +11 -0
- package/dist/adapters/codex/action-registry.js +62 -0
- package/dist/adapters/codex/action-registry.js.map +1 -1
- package/dist/adapters/codex/behavior-loop.d.ts +10 -0
- package/dist/adapters/codex/behavior-loop.js +30 -1
- package/dist/adapters/codex/behavior-loop.js.map +1 -1
- package/dist/adapters/codex/broker-tools.d.ts +0 -0
- package/dist/adapters/codex/broker-tools.js +0 -0
- package/dist/adapters/codex/broker-tools.js.map +0 -0
- package/dist/adapters/codex/instruction-template.d.ts +0 -0
- package/dist/adapters/codex/instruction-template.js +5 -4
- package/dist/adapters/codex/instruction-template.js.map +1 -1
- package/dist/adapters/codex/mcp-server.d.ts +36 -0
- package/dist/adapters/codex/mcp-server.js +51 -16
- package/dist/adapters/codex/mcp-server.js.map +1 -1
- package/dist/analyzer/candidate-signals.d.ts +0 -0
- package/dist/analyzer/candidate-signals.js +0 -0
- package/dist/analyzer/candidate-signals.js.map +0 -0
- package/dist/analyzer/experience-analyzer.d.ts +0 -0
- package/dist/analyzer/experience-analyzer.js +0 -0
- package/dist/analyzer/experience-analyzer.js.map +0 -0
- package/dist/analyzer/extraction-evidence.d.ts +0 -0
- package/dist/analyzer/extraction-evidence.js +0 -0
- package/dist/analyzer/extraction-evidence.js.map +0 -0
- package/dist/analyzer/llm-learning-gate.d.ts +0 -0
- package/dist/analyzer/llm-learning-gate.js +0 -0
- package/dist/analyzer/llm-learning-gate.js.map +0 -0
- package/dist/analyzer/node-deduper.d.ts +0 -0
- package/dist/analyzer/node-deduper.js +0 -0
- package/dist/analyzer/node-deduper.js.map +0 -0
- package/dist/analyzer/node-normalizer.d.ts +0 -0
- package/dist/analyzer/node-normalizer.js +0 -0
- package/dist/analyzer/node-normalizer.js.map +0 -0
- package/dist/analyzer/storage-gate.d.ts +0 -0
- package/dist/analyzer/storage-gate.js +0 -0
- package/dist/analyzer/storage-gate.js.map +0 -0
- package/dist/analyzer/strategy-extractor.d.ts +0 -0
- package/dist/analyzer/strategy-extractor.js +0 -0
- package/dist/analyzer/strategy-extractor.js.map +0 -0
- package/dist/analyzer/warning-extractor.d.ts +0 -0
- package/dist/analyzer/warning-extractor.js +0 -0
- package/dist/analyzer/warning-extractor.js.map +0 -0
- package/dist/cli/commands/backup.d.ts +0 -0
- package/dist/cli/commands/backup.js +0 -0
- package/dist/cli/commands/backup.js.map +0 -0
- package/dist/cli/commands/claude-hook.d.ts +0 -0
- package/dist/cli/commands/claude-hook.js +5 -1
- package/dist/cli/commands/claude-hook.js.map +1 -1
- package/dist/cli/commands/codex-hook.d.ts +0 -0
- package/dist/cli/commands/codex-hook.js +10 -0
- package/dist/cli/commands/codex-hook.js.map +1 -1
- package/dist/cli/commands/codex-mcp-server.d.ts +0 -0
- package/dist/cli/commands/codex-mcp-server.js +0 -0
- package/dist/cli/commands/codex-mcp-server.js.map +0 -0
- package/dist/cli/commands/codex.d.ts +0 -0
- package/dist/cli/commands/codex.js +0 -0
- package/dist/cli/commands/codex.js.map +0 -0
- package/dist/cli/commands/config.d.ts +0 -0
- package/dist/cli/commands/config.js +0 -0
- package/dist/cli/commands/config.js.map +0 -0
- package/dist/cli/commands/cool.d.ts +0 -0
- package/dist/cli/commands/cool.js +0 -0
- package/dist/cli/commands/cool.js.map +0 -0
- package/dist/cli/commands/disable.d.ts +0 -0
- package/dist/cli/commands/disable.js +0 -0
- package/dist/cli/commands/disable.js.map +0 -0
- package/dist/cli/commands/doctor.d.ts +0 -0
- package/dist/cli/commands/doctor.js +56 -0
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/enable.d.ts +0 -0
- package/dist/cli/commands/enable.js +0 -0
- package/dist/cli/commands/enable.js.map +0 -0
- package/dist/cli/commands/evaluate.d.ts +0 -0
- package/dist/cli/commands/evaluate.js +0 -0
- package/dist/cli/commands/evaluate.js.map +0 -0
- package/dist/cli/commands/export.d.ts +0 -0
- package/dist/cli/commands/export.js +0 -0
- package/dist/cli/commands/export.js.map +0 -0
- package/dist/cli/commands/feedback.d.ts +0 -0
- package/dist/cli/commands/feedback.js +0 -0
- package/dist/cli/commands/feedback.js.map +0 -0
- package/dist/cli/commands/import.d.ts +0 -0
- package/dist/cli/commands/import.js +0 -0
- package/dist/cli/commands/import.js.map +0 -0
- package/dist/cli/commands/init.d.ts +0 -0
- package/dist/cli/commands/init.js +0 -0
- package/dist/cli/commands/init.js.map +0 -0
- package/dist/cli/commands/inspect.d.ts +0 -0
- package/dist/cli/commands/inspect.js +180 -1
- package/dist/cli/commands/inspect.js.map +1 -1
- package/dist/cli/commands/install.d.ts +0 -0
- package/dist/cli/commands/install.js +0 -0
- package/dist/cli/commands/install.js.map +0 -0
- package/dist/cli/commands/maintenance.d.ts +0 -0
- package/dist/cli/commands/maintenance.js +138 -3
- package/dist/cli/commands/maintenance.js.map +1 -1
- package/dist/cli/commands/mcp-server.d.ts +0 -0
- package/dist/cli/commands/mcp-server.js +0 -0
- package/dist/cli/commands/mcp-server.js.map +0 -0
- package/dist/cli/commands/models.d.ts +0 -0
- package/dist/cli/commands/models.js +0 -0
- package/dist/cli/commands/models.js.map +0 -0
- package/dist/cli/commands/repair.d.ts +0 -0
- package/dist/cli/commands/repair.js +0 -0
- package/dist/cli/commands/repair.js.map +0 -0
- package/dist/cli/commands/retire.d.ts +0 -0
- package/dist/cli/commands/retire.js +0 -0
- package/dist/cli/commands/retire.js.map +0 -0
- package/dist/cli/commands/rollback.d.ts +0 -0
- package/dist/cli/commands/rollback.js +0 -0
- package/dist/cli/commands/rollback.js.map +0 -0
- package/dist/cli/commands/stats.d.ts +0 -0
- package/dist/cli/commands/stats.js +0 -0
- package/dist/cli/commands/stats.js.map +0 -0
- package/dist/cli/commands/status.d.ts +0 -0
- package/dist/cli/commands/status.js +0 -0
- package/dist/cli/commands/status.js.map +0 -0
- package/dist/cli/commands/upgrade.d.ts +0 -0
- package/dist/cli/commands/upgrade.js +0 -0
- package/dist/cli/commands/upgrade.js.map +0 -0
- package/dist/cli/dispatch.d.ts +0 -0
- package/dist/cli/dispatch.js +1 -1
- package/dist/cli/dispatch.js.map +1 -1
- package/dist/cli/index.d.ts +0 -0
- package/dist/cli/index.js +0 -0
- package/dist/cli/index.js.map +0 -0
- package/dist/cli/state-model.d.ts +0 -0
- package/dist/cli/state-model.js +0 -0
- package/dist/cli/state-model.js.map +0 -0
- package/dist/compiler/command-normalizer.d.ts +27 -0
- package/dist/compiler/command-normalizer.js +263 -0
- package/dist/compiler/command-normalizer.js.map +1 -0
- package/dist/compiler/trajectory-compiler.d.ts +12 -0
- package/dist/compiler/trajectory-compiler.js +179 -0
- package/dist/compiler/trajectory-compiler.js.map +1 -0
- package/dist/compiler/trajectory-matcher.d.ts +18 -0
- package/dist/compiler/trajectory-matcher.js +419 -0
- package/dist/compiler/trajectory-matcher.js.map +1 -0
- package/dist/config/config-schema.d.ts +11 -0
- package/dist/config/config-schema.js +9 -0
- package/dist/config/config-schema.js.map +1 -1
- package/dist/config/default-config.d.ts +0 -0
- package/dist/config/default-config.js +1 -0
- package/dist/config/default-config.js.map +1 -1
- package/dist/config/load-config.d.ts +0 -0
- package/dist/config/load-config.js +0 -0
- package/dist/config/load-config.js.map +0 -0
- package/dist/config/path-resolver.d.ts +0 -0
- package/dist/config/path-resolver.js +0 -0
- package/dist/config/path-resolver.js.map +0 -0
- package/dist/config/runtime-env.d.ts +0 -0
- package/dist/config/runtime-env.js +0 -0
- package/dist/config/runtime-env.js.map +0 -0
- package/dist/config/secrets-store.d.ts +0 -0
- package/dist/config/secrets-store.js +0 -0
- package/dist/config/secrets-store.js.map +0 -0
- package/dist/config/settings-store.d.ts +0 -0
- package/dist/config/settings-store.js +0 -0
- package/dist/config/settings-store.js.map +0 -0
- package/dist/controller/candidate-retriever.d.ts +3 -1
- package/dist/controller/candidate-retriever.js +247 -7
- package/dist/controller/candidate-retriever.js.map +1 -1
- package/dist/controller/injection-renderer.d.ts +0 -0
- package/dist/controller/injection-renderer.js +0 -0
- package/dist/controller/injection-renderer.js.map +0 -0
- package/dist/controller/injection-scorecard.d.ts +0 -0
- package/dist/controller/injection-scorecard.js +0 -0
- package/dist/controller/injection-scorecard.js.map +0 -0
- package/dist/controller/inline-notice.d.ts +0 -0
- package/dist/controller/inline-notice.js +0 -0
- package/dist/controller/inline-notice.js.map +0 -0
- package/dist/controller/intervention-controller.d.ts +0 -0
- package/dist/controller/intervention-controller.js +48 -21
- package/dist/controller/intervention-controller.js.map +1 -1
- package/dist/controller/lexical-retriever.d.ts +0 -0
- package/dist/controller/lexical-retriever.js +0 -0
- package/dist/controller/lexical-retriever.js.map +0 -0
- package/dist/controller/model-reranker-mode.d.ts +0 -0
- package/dist/controller/model-reranker-mode.js +0 -0
- package/dist/controller/model-reranker-mode.js.map +0 -0
- package/dist/controller/model-reranker.d.ts +0 -0
- package/dist/controller/model-reranker.js +0 -0
- package/dist/controller/model-reranker.js.map +0 -0
- package/dist/controller/node-ranker.d.ts +0 -0
- package/dist/controller/node-ranker.js +0 -0
- package/dist/controller/node-ranker.js.map +0 -0
- package/dist/controller/policy-enricher.d.ts +0 -0
- package/dist/controller/policy-enricher.js +0 -0
- package/dist/controller/policy-enricher.js.map +0 -0
- package/dist/controller/query-rewrite.d.ts +0 -0
- package/dist/controller/query-rewrite.js +0 -0
- package/dist/controller/query-rewrite.js.map +0 -0
- package/dist/controller/retrieval-context.d.ts +0 -0
- package/dist/controller/retrieval-context.js +0 -0
- package/dist/controller/retrieval-context.js.map +0 -0
- package/dist/controller/second-opinion-gate.d.ts +0 -0
- package/dist/controller/second-opinion-gate.js +0 -0
- package/dist/controller/second-opinion-gate.js.map +0 -0
- package/dist/controller/skip-reason.d.ts +0 -0
- package/dist/controller/skip-reason.js +0 -0
- package/dist/controller/skip-reason.js.map +0 -0
- package/dist/controller/skip-scorecard.d.ts +0 -0
- package/dist/controller/skip-scorecard.js +0 -0
- package/dist/controller/skip-scorecard.js.map +0 -0
- package/dist/controller/trigger-evaluator.d.ts +2 -1
- package/dist/controller/trigger-evaluator.js +10 -4
- package/dist/controller/trigger-evaluator.js.map +1 -1
- package/dist/distillation/errors.d.ts +0 -0
- package/dist/distillation/errors.js +0 -0
- package/dist/distillation/errors.js.map +0 -0
- package/dist/distillation/experience-family.d.ts +0 -0
- package/dist/distillation/experience-family.js +0 -0
- package/dist/distillation/experience-family.js.map +0 -0
- package/dist/distillation/host-llm.d.ts +0 -0
- package/dist/distillation/host-llm.js +0 -0
- package/dist/distillation/host-llm.js.map +0 -0
- package/dist/distillation/llm-distiller.d.ts +0 -0
- package/dist/distillation/llm-distiller.js +0 -0
- package/dist/distillation/llm-distiller.js.map +0 -0
- package/dist/distillation/merge-decider.d.ts +0 -0
- package/dist/distillation/merge-decider.js +0 -0
- package/dist/distillation/merge-decider.js.map +0 -0
- package/dist/distillation/model-catalog.d.ts +0 -0
- package/dist/distillation/model-catalog.js +0 -0
- package/dist/distillation/model-catalog.js.map +0 -0
- package/dist/distillation/prompt-contract.d.ts +0 -0
- package/dist/distillation/prompt-contract.js +0 -0
- package/dist/distillation/prompt-contract.js.map +0 -0
- package/dist/distillation/providers/anthropic.d.ts +0 -0
- package/dist/distillation/providers/anthropic.js +0 -0
- package/dist/distillation/providers/anthropic.js.map +0 -0
- package/dist/distillation/providers/azure-openai.d.ts +0 -0
- package/dist/distillation/providers/azure-openai.js +0 -0
- package/dist/distillation/providers/azure-openai.js.map +0 -0
- package/dist/distillation/providers/baidu-qianfan.d.ts +0 -0
- package/dist/distillation/providers/baidu-qianfan.js +0 -0
- package/dist/distillation/providers/baidu-qianfan.js.map +0 -0
- package/dist/distillation/providers/bedrock.d.ts +0 -0
- package/dist/distillation/providers/bedrock.js +0 -0
- package/dist/distillation/providers/bedrock.js.map +0 -0
- package/dist/distillation/providers/dashscope.d.ts +0 -0
- package/dist/distillation/providers/dashscope.js +0 -0
- package/dist/distillation/providers/dashscope.js.map +0 -0
- package/dist/distillation/providers/deepseek.d.ts +0 -0
- package/dist/distillation/providers/deepseek.js +0 -0
- package/dist/distillation/providers/deepseek.js.map +0 -0
- package/dist/distillation/providers/gemini.d.ts +0 -0
- package/dist/distillation/providers/gemini.js +0 -0
- package/dist/distillation/providers/gemini.js.map +0 -0
- package/dist/distillation/providers/google-adc.d.ts +0 -0
- package/dist/distillation/providers/google-adc.js +0 -0
- package/dist/distillation/providers/google-adc.js.map +0 -0
- package/dist/distillation/providers/minimax.d.ts +0 -0
- package/dist/distillation/providers/minimax.js +0 -0
- package/dist/distillation/providers/minimax.js.map +0 -0
- package/dist/distillation/providers/moonshot.d.ts +0 -0
- package/dist/distillation/providers/moonshot.js +0 -0
- package/dist/distillation/providers/moonshot.js.map +0 -0
- package/dist/distillation/providers/openai-compatible-factory.d.ts +0 -0
- package/dist/distillation/providers/openai-compatible-factory.js +0 -0
- package/dist/distillation/providers/openai-compatible-factory.js.map +0 -0
- package/dist/distillation/providers/openai-compatible.d.ts +0 -0
- package/dist/distillation/providers/openai-compatible.js +0 -0
- package/dist/distillation/providers/openai-compatible.js.map +0 -0
- package/dist/distillation/providers/openai.d.ts +0 -0
- package/dist/distillation/providers/openai.js +0 -0
- package/dist/distillation/providers/openai.js.map +0 -0
- package/dist/distillation/providers/openrouter.d.ts +0 -0
- package/dist/distillation/providers/openrouter.js +0 -0
- package/dist/distillation/providers/openrouter.js.map +0 -0
- package/dist/distillation/providers/registry.d.ts +0 -0
- package/dist/distillation/providers/registry.js +0 -0
- package/dist/distillation/providers/registry.js.map +0 -0
- package/dist/distillation/providers/siliconflow.d.ts +0 -0
- package/dist/distillation/providers/siliconflow.js +0 -0
- package/dist/distillation/providers/siliconflow.js.map +0 -0
- package/dist/distillation/providers/tencent-hunyuan.d.ts +0 -0
- package/dist/distillation/providers/tencent-hunyuan.js +0 -0
- package/dist/distillation/providers/tencent-hunyuan.js.map +0 -0
- package/dist/distillation/providers/types.d.ts +0 -0
- package/dist/distillation/providers/types.js +0 -0
- package/dist/distillation/providers/types.js.map +0 -0
- package/dist/distillation/providers/volcengine-ark.d.ts +0 -0
- package/dist/distillation/providers/volcengine-ark.js +0 -0
- package/dist/distillation/providers/volcengine-ark.js.map +0 -0
- package/dist/distillation/providers/zhipu.d.ts +0 -0
- package/dist/distillation/providers/zhipu.js +0 -0
- package/dist/distillation/providers/zhipu.js.map +0 -0
- package/dist/distillation/queue-worker.d.ts +0 -0
- package/dist/distillation/queue-worker.js +0 -0
- package/dist/distillation/queue-worker.js.map +0 -0
- package/dist/distillation/types.d.ts +0 -0
- package/dist/distillation/types.js +0 -0
- package/dist/distillation/types.js.map +0 -0
- package/dist/evaluation/benchmark-report.d.ts +0 -0
- package/dist/evaluation/benchmark-report.js +0 -0
- package/dist/evaluation/benchmark-report.js.map +0 -0
- package/dist/evaluation/benchmark-summary.d.ts +0 -0
- package/dist/evaluation/benchmark-summary.js +0 -0
- package/dist/evaluation/benchmark-summary.js.map +0 -0
- package/dist/evaluation/codex-lifecycle-validation.d.ts +0 -0
- package/dist/evaluation/codex-lifecycle-validation.js +0 -0
- package/dist/evaluation/codex-lifecycle-validation.js.map +0 -0
- package/dist/evaluation/hybrid-phase1-rollout-summary.d.ts +0 -0
- package/dist/evaluation/hybrid-phase1-rollout-summary.js +0 -0
- package/dist/evaluation/hybrid-phase1-rollout-summary.js.map +0 -0
- package/dist/evaluation/hybrid-phase3-gate-metrics.d.ts +0 -0
- package/dist/evaluation/hybrid-phase3-gate-metrics.js +0 -0
- package/dist/evaluation/hybrid-phase3-gate-metrics.js.map +0 -0
- package/dist/evaluation/openclaw-baseline.d.ts +0 -0
- package/dist/evaluation/openclaw-baseline.js +0 -0
- package/dist/evaluation/openclaw-baseline.js.map +0 -0
- package/dist/evaluation/openclaw-scenarios.d.ts +0 -0
- package/dist/evaluation/openclaw-scenarios.js +0 -0
- package/dist/evaluation/openclaw-scenarios.js.map +0 -0
- package/dist/experience-management/governance-observability.d.ts +0 -0
- package/dist/experience-management/governance-observability.js +0 -0
- package/dist/experience-management/governance-observability.js.map +0 -0
- package/dist/experience-management/node-lifecycle-governance.d.ts +0 -0
- package/dist/experience-management/node-lifecycle-governance.js +25 -6
- package/dist/experience-management/node-lifecycle-governance.js.map +1 -1
- package/dist/experience-management/repo-policy.d.ts +0 -0
- package/dist/experience-management/repo-policy.js +0 -0
- package/dist/experience-management/repo-policy.js.map +0 -0
- package/dist/experience-management/task-management-signals.d.ts +0 -0
- package/dist/experience-management/task-management-signals.js +0 -0
- package/dist/experience-management/task-management-signals.js.map +0 -0
- package/dist/feedback/automatic-attribution.d.ts +0 -0
- package/dist/feedback/automatic-attribution.js +0 -0
- package/dist/feedback/automatic-attribution.js.map +0 -0
- package/dist/feedback/feedback-manager.d.ts +0 -0
- package/dist/feedback/feedback-manager.js +0 -0
- package/dist/feedback/feedback-manager.js.map +0 -0
- package/dist/feedback/harm-detector.d.ts +0 -0
- package/dist/feedback/harm-detector.js +0 -0
- package/dist/feedback/harm-detector.js.map +0 -0
- package/dist/feedback/state-transition.d.ts +0 -0
- package/dist/feedback/state-transition.js +0 -0
- package/dist/feedback/state-transition.js.map +0 -0
- package/dist/feedback/stats-updater.d.ts +0 -0
- package/dist/feedback/stats-updater.js +0 -0
- package/dist/feedback/stats-updater.js.map +0 -0
- package/dist/hybrid/capsule-builder.d.ts +0 -0
- package/dist/hybrid/capsule-builder.js +0 -0
- package/dist/hybrid/capsule-builder.js.map +0 -0
- package/dist/hybrid/explain-provider-client.d.ts +0 -0
- package/dist/hybrid/explain-provider-client.js +0 -0
- package/dist/hybrid/explain-provider-client.js.map +0 -0
- package/dist/hybrid/postmortem-provider-client.d.ts +0 -0
- package/dist/hybrid/postmortem-provider-client.js +0 -0
- package/dist/hybrid/postmortem-provider-client.js.map +0 -0
- package/dist/hybrid/rollout.d.ts +0 -0
- package/dist/hybrid/rollout.js +0 -0
- package/dist/hybrid/rollout.js.map +0 -0
- package/dist/hybrid/router.d.ts +0 -0
- package/dist/hybrid/router.js +0 -0
- package/dist/hybrid/router.js.map +0 -0
- package/dist/hybrid/types.d.ts +0 -0
- package/dist/hybrid/types.js +0 -0
- package/dist/hybrid/types.js.map +0 -0
- package/dist/hybrid/validators.d.ts +0 -0
- package/dist/hybrid/validators.js +0 -0
- package/dist/hybrid/validators.js.map +0 -0
- package/dist/hybrid/worker-client.d.ts +0 -0
- package/dist/hybrid/worker-client.js +0 -0
- package/dist/hybrid/worker-client.js.map +0 -0
- package/dist/hybrid/workers/explain-decision-llm.d.ts +0 -0
- package/dist/hybrid/workers/explain-decision-llm.js +0 -0
- package/dist/hybrid/workers/explain-decision-llm.js.map +0 -0
- package/dist/hybrid/workers/explain-decision.d.ts +0 -0
- package/dist/hybrid/workers/explain-decision.js +0 -0
- package/dist/hybrid/workers/explain-decision.js.map +0 -0
- package/dist/hybrid/workers/postmortem-review-llm.d.ts +0 -0
- package/dist/hybrid/workers/postmortem-review-llm.js +0 -0
- package/dist/hybrid/workers/postmortem-review-llm.js.map +0 -0
- package/dist/hybrid/workers/postmortem-review.d.ts +0 -0
- package/dist/hybrid/workers/postmortem-review.js +0 -0
- package/dist/hybrid/workers/postmortem-review.js.map +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/index.js.map +0 -0
- package/dist/input/context-summary-adapter.d.ts +0 -0
- package/dist/input/context-summary-adapter.js +0 -0
- package/dist/input/context-summary-adapter.js.map +0 -0
- package/dist/input/fingerprint-extractor.d.ts +53 -0
- package/dist/input/fingerprint-extractor.js +620 -0
- package/dist/input/fingerprint-extractor.js.map +1 -0
- package/dist/input/input-adapter.d.ts +0 -0
- package/dist/input/input-adapter.js +2 -2
- package/dist/input/input-adapter.js.map +1 -1
- package/dist/input/outcome-resolver.d.ts +0 -0
- package/dist/input/outcome-resolver.js +2 -2
- package/dist/input/outcome-resolver.js.map +1 -1
- package/dist/input/scope-resolver.d.ts +0 -0
- package/dist/input/scope-resolver.js +0 -0
- package/dist/input/scope-resolver.js.map +0 -0
- package/dist/input/tasktype-resolver.d.ts +0 -0
- package/dist/input/tasktype-resolver.js +0 -0
- package/dist/input/tasktype-resolver.js.map +0 -0
- package/dist/input/tool-event-significance.d.ts +0 -0
- package/dist/input/tool-event-significance.js +0 -0
- package/dist/input/tool-event-significance.js.map +0 -0
- package/dist/install/claude-cli.d.ts +0 -0
- package/dist/install/claude-cli.js +0 -0
- package/dist/install/claude-cli.js.map +0 -0
- package/dist/install/claude-code-doctor.d.ts +0 -0
- package/dist/install/claude-code-doctor.js +0 -0
- package/dist/install/claude-code-doctor.js.map +0 -0
- package/dist/install/claude-code-installer.d.ts +0 -0
- package/dist/install/claude-code-installer.js +0 -0
- package/dist/install/claude-code-installer.js.map +0 -0
- package/dist/install/claude-marketplace-state.d.ts +0 -0
- package/dist/install/claude-marketplace-state.js +0 -0
- package/dist/install/claude-marketplace-state.js.map +0 -0
- package/dist/install/claude-runtime-target.d.ts +0 -0
- package/dist/install/claude-runtime-target.js +0 -0
- package/dist/install/claude-runtime-target.js.map +0 -0
- package/dist/install/codex-cli.d.ts +0 -0
- package/dist/install/codex-cli.js +0 -0
- package/dist/install/codex-cli.js.map +0 -0
- package/dist/install/codex-hooks.d.ts +0 -0
- package/dist/install/codex-hooks.js +0 -0
- package/dist/install/codex-hooks.js.map +0 -0
- package/dist/install/codex-installer.d.ts +0 -0
- package/dist/install/codex-installer.js +0 -0
- package/dist/install/codex-installer.js.map +0 -0
- package/dist/install/codex-runtime-target.d.ts +0 -0
- package/dist/install/codex-runtime-target.js +0 -0
- package/dist/install/codex-runtime-target.js.map +0 -0
- package/dist/install/host-detection.d.ts +0 -0
- package/dist/install/host-detection.js +0 -0
- package/dist/install/host-detection.js.map +0 -0
- package/dist/install/openclaw-cli.d.ts +0 -0
- package/dist/install/openclaw-cli.js +0 -0
- package/dist/install/openclaw-cli.js.map +0 -0
- package/dist/install/openclaw-installer.d.ts +0 -0
- package/dist/install/openclaw-installer.js +0 -0
- package/dist/install/openclaw-installer.js.map +0 -0
- package/dist/install/public-install.d.ts +0 -0
- package/dist/install/public-install.js +0 -0
- package/dist/install/public-install.js.map +0 -0
- package/dist/install/registry-health.d.ts +0 -0
- package/dist/install/registry-health.js +0 -0
- package/dist/install/registry-health.js.map +0 -0
- package/dist/interaction/operational-actions-service.d.ts +0 -0
- package/dist/interaction/operational-actions-service.js +0 -0
- package/dist/interaction/operational-actions-service.js.map +0 -0
- package/dist/interaction/operational-service.d.ts +0 -0
- package/dist/interaction/operational-service.js +0 -0
- package/dist/interaction/operational-service.js.map +0 -0
- package/dist/interaction/quality-band.d.ts +0 -0
- package/dist/interaction/quality-band.js +0 -0
- package/dist/interaction/quality-band.js.map +0 -0
- package/dist/interaction/repo-summary.d.ts +0 -0
- package/dist/interaction/repo-summary.js +0 -0
- package/dist/interaction/repo-summary.js.map +0 -0
- package/dist/interaction/retrieval-policy-inspection.d.ts +0 -0
- package/dist/interaction/retrieval-policy-inspection.js +0 -0
- package/dist/interaction/retrieval-policy-inspection.js.map +0 -0
- package/dist/interaction/service.d.ts +49 -1
- package/dist/interaction/service.js +125 -3
- package/dist/interaction/service.js.map +1 -1
- package/dist/interaction/state-artifact-service.d.ts +0 -0
- package/dist/interaction/state-artifact-service.js +0 -0
- package/dist/interaction/state-artifact-service.js.map +0 -0
- package/dist/interaction/surface-tiers.d.ts +0 -0
- package/dist/interaction/surface-tiers.js +1 -1
- package/dist/interaction/surface-tiers.js.map +1 -1
- package/dist/maintenance/claude-validate-print.d.ts +0 -0
- package/dist/maintenance/claude-validate-print.js +0 -0
- package/dist/maintenance/claude-validate-print.js.map +0 -0
- package/dist/maintenance/embedding-smoke.d.ts +0 -0
- package/dist/maintenance/embedding-smoke.js +0 -0
- package/dist/maintenance/embedding-smoke.js.map +0 -0
- package/dist/maintenance/experience-export-drafts.d.ts +0 -0
- package/dist/maintenance/experience-export-drafts.js +0 -0
- package/dist/maintenance/experience-export-drafts.js.map +0 -0
- package/dist/maintenance/experience-hygiene.d.ts +0 -0
- package/dist/maintenance/experience-hygiene.js +0 -0
- package/dist/maintenance/experience-hygiene.js.map +0 -0
- package/dist/maintenance/hygiene-governance-applicator.d.ts +21 -0
- package/dist/maintenance/hygiene-governance-applicator.js +246 -0
- package/dist/maintenance/hygiene-governance-applicator.js.map +1 -0
- package/dist/maintenance/hygiene-governance-approvals.d.ts +41 -0
- package/dist/maintenance/hygiene-governance-approvals.js +143 -0
- package/dist/maintenance/hygiene-governance-approvals.js.map +1 -0
- package/dist/maintenance/hygiene-governance-llm-planner.d.ts +26 -0
- package/dist/maintenance/hygiene-governance-llm-planner.js +169 -0
- package/dist/maintenance/hygiene-governance-llm-planner.js.map +1 -0
- package/dist/maintenance/hygiene-governance-planner.d.ts +113 -0
- package/dist/maintenance/hygiene-governance-planner.js +302 -0
- package/dist/maintenance/hygiene-governance-planner.js.map +1 -0
- package/dist/maintenance/hygiene-governance-scheduler.d.ts +72 -0
- package/dist/maintenance/hygiene-governance-scheduler.js +206 -0
- package/dist/maintenance/hygiene-governance-scheduler.js.map +1 -0
- package/dist/maintenance/hygiene-governance-validator.d.ts +14 -0
- package/dist/maintenance/hygiene-governance-validator.js +212 -0
- package/dist/maintenance/hygiene-governance-validator.js.map +1 -0
- package/dist/maintenance/operator-review-flow.d.ts +12 -1
- package/dist/maintenance/operator-review-flow.js +18 -2
- package/dist/maintenance/operator-review-flow.js.map +1 -1
- package/dist/maintenance/redistill-rule-nodes.d.ts +0 -0
- package/dist/maintenance/redistill-rule-nodes.js +0 -0
- package/dist/maintenance/redistill-rule-nodes.js.map +0 -0
- package/dist/maintenance/scope-merge.d.ts +0 -0
- package/dist/maintenance/scope-merge.js +0 -0
- package/dist/maintenance/scope-merge.js.map +0 -0
- package/dist/maintenance/vector-migrator.d.ts +37 -0
- package/dist/maintenance/vector-migrator.js +170 -0
- package/dist/maintenance/vector-migrator.js.map +1 -0
- package/dist/maintenance/warning-variant-cleanup.d.ts +0 -0
- package/dist/maintenance/warning-variant-cleanup.js +0 -0
- package/dist/maintenance/warning-variant-cleanup.js.map +0 -0
- package/dist/plugin/fixture-sanitizer.d.ts +0 -0
- package/dist/plugin/fixture-sanitizer.js +0 -0
- package/dist/plugin/fixture-sanitizer.js.map +0 -0
- package/dist/plugin/hooks/before-prompt-build.d.ts +0 -0
- package/dist/plugin/hooks/before-prompt-build.js +0 -0
- package/dist/plugin/hooks/before-prompt-build.js.map +0 -0
- package/dist/plugin/hooks/message-sent.d.ts +0 -0
- package/dist/plugin/hooks/message-sent.js +0 -0
- package/dist/plugin/hooks/message-sent.js.map +0 -0
- package/dist/plugin/hooks/tool-result-persist.d.ts +0 -0
- package/dist/plugin/hooks/tool-result-persist.js +0 -0
- package/dist/plugin/hooks/tool-result-persist.js.map +0 -0
- package/dist/plugin/openclaw-install-state.d.ts +0 -0
- package/dist/plugin/openclaw-install-state.js +0 -0
- package/dist/plugin/openclaw-install-state.js.map +0 -0
- package/dist/plugin/openclaw-plugin.d.ts +8 -0
- package/dist/plugin/openclaw-plugin.js +5 -1
- package/dist/plugin/openclaw-plugin.js.map +1 -1
- package/dist/plugin/openclaw-routine-interaction.d.ts +0 -0
- package/dist/plugin/openclaw-routine-interaction.js +0 -0
- package/dist/plugin/openclaw-routine-interaction.js.map +0 -0
- package/dist/plugin/openclaw-runtime-defaults.d.ts +0 -0
- package/dist/plugin/openclaw-runtime-defaults.js +0 -0
- package/dist/plugin/openclaw-runtime-defaults.js.map +0 -0
- package/dist/plugin/runtime-capture.d.ts +0 -0
- package/dist/plugin/runtime-capture.js +0 -0
- package/dist/plugin/runtime-capture.js.map +0 -0
- package/dist/plugin/runtime-helpers.d.ts +0 -0
- package/dist/plugin/runtime-helpers.js +0 -0
- package/dist/plugin/runtime-helpers.js.map +0 -0
- package/dist/runtime/learning-candidate-factory.d.ts +0 -0
- package/dist/runtime/learning-candidate-factory.js +0 -0
- package/dist/runtime/learning-candidate-factory.js.map +0 -0
- package/dist/runtime/learning-pipeline-service.d.ts +0 -0
- package/dist/runtime/learning-pipeline-service.js +0 -0
- package/dist/runtime/learning-pipeline-service.js.map +0 -0
- package/dist/runtime/prompt-service.d.ts +0 -0
- package/dist/runtime/prompt-service.js +10 -0
- package/dist/runtime/prompt-service.js.map +1 -1
- package/dist/runtime/service.d.ts +16 -0
- package/dist/runtime/service.js +189 -3
- package/dist/runtime/service.js.map +1 -1
- package/dist/runtime/task-finalization-service.d.ts +0 -0
- package/dist/runtime/task-finalization-service.js +0 -0
- package/dist/runtime/task-finalization-service.js.map +0 -0
- package/dist/store/logs/jsonl-logger.d.ts +0 -0
- package/dist/store/logs/jsonl-logger.js +0 -0
- package/dist/store/logs/jsonl-logger.js.map +0 -0
- package/dist/store/sqlite/db.d.ts +0 -0
- package/dist/store/sqlite/db.js +24 -1
- package/dist/store/sqlite/db.js.map +1 -1
- package/dist/store/sqlite/migrations.d.ts +0 -0
- package/dist/store/sqlite/migrations.js +0 -0
- package/dist/store/sqlite/migrations.js.map +0 -0
- package/dist/store/sqlite/repositories/attribution-record-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/attribution-record-repo.js +12 -0
- package/dist/store/sqlite/repositories/attribution-record-repo.js.map +1 -1
- package/dist/store/sqlite/repositories/candidate-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/candidate-repo.js +0 -0
- package/dist/store/sqlite/repositories/candidate-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/distillation-job-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/distillation-job-repo.js +0 -0
- package/dist/store/sqlite/repositories/distillation-job-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/episode-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/episode-repo.js +0 -0
- package/dist/store/sqlite/repositories/episode-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/hybrid-invocation-trace-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/hybrid-invocation-trace-repo.js +0 -0
- package/dist/store/sqlite/repositories/hybrid-invocation-trace-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/hybrid-review-artifact-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/hybrid-review-artifact-repo.js +0 -0
- package/dist/store/sqlite/repositories/hybrid-review-artifact-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/hygiene-governance-repo.d.ts +187 -0
- package/dist/store/sqlite/repositories/hygiene-governance-repo.js +513 -0
- package/dist/store/sqlite/repositories/hygiene-governance-repo.js.map +1 -0
- package/dist/store/sqlite/repositories/injection-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/injection-repo.js +0 -0
- package/dist/store/sqlite/repositories/injection-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/input-record-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/input-record-repo.js +0 -0
- package/dist/store/sqlite/repositories/input-record-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/node-repo.d.ts +1 -0
- package/dist/store/sqlite/repositories/node-repo.js +47 -2
- package/dist/store/sqlite/repositories/node-repo.js.map +1 -1
- package/dist/store/sqlite/repositories/outcome-record-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/outcome-record-repo.js +0 -0
- package/dist/store/sqlite/repositories/outcome-record-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/repo-policy-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/repo-policy-repo.js +0 -0
- package/dist/store/sqlite/repositories/repo-policy-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/review-event-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/review-event-repo.js +0 -0
- package/dist/store/sqlite/repositories/review-event-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/scope-fingerprint-repo.d.ts +8 -0
- package/dist/store/sqlite/repositories/scope-fingerprint-repo.js +23 -0
- package/dist/store/sqlite/repositories/scope-fingerprint-repo.js.map +1 -0
- package/dist/store/sqlite/repositories/scope-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/scope-repo.js +0 -0
- package/dist/store/sqlite/repositories/scope-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/stats-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/stats-repo.js +0 -0
- package/dist/store/sqlite/repositories/stats-repo.js.map +0 -0
- package/dist/store/sqlite/repositories/task-run-repo.d.ts +0 -0
- package/dist/store/sqlite/repositories/task-run-repo.js +0 -0
- package/dist/store/sqlite/repositories/task-run-repo.js.map +0 -0
- package/dist/store/sqlite/schema.sql +124 -0
- package/dist/store/vector/api-embedding-provider.d.ts +0 -0
- package/dist/store/vector/api-embedding-provider.js +0 -0
- package/dist/store/vector/api-embedding-provider.js.map +0 -0
- package/dist/store/vector/embeddings.d.ts +4 -2
- package/dist/store/vector/embeddings.js +19 -6
- package/dist/store/vector/embeddings.js.map +1 -1
- package/dist/store/vector/lancedb.d.ts +0 -0
- package/dist/store/vector/lancedb.js +0 -0
- package/dist/store/vector/lancedb.js.map +0 -0
- package/dist/store/vector/local-provider.d.ts +1 -1
- package/dist/store/vector/local-provider.js +40 -8
- package/dist/store/vector/local-provider.js.map +1 -1
- package/dist/store/vector/node-index.d.ts +0 -0
- package/dist/store/vector/node-index.js +0 -0
- package/dist/store/vector/node-index.js.map +0 -0
- package/dist/store/vector/offline-manifest.d.ts +7 -0
- package/dist/store/vector/offline-manifest.js +162 -0
- package/dist/store/vector/offline-manifest.js.map +1 -0
- package/dist/store/vector/provider-types.d.ts +1 -0
- package/dist/store/vector/provider-types.js +0 -0
- package/dist/store/vector/provider-types.js.map +0 -0
- package/dist/types/analyzer.d.ts +0 -0
- package/dist/types/analyzer.js +0 -0
- package/dist/types/analyzer.js.map +0 -0
- package/dist/types/domain.d.ts +111 -1
- package/dist/types/domain.js +0 -0
- package/dist/types/domain.js.map +0 -0
- package/dist/types/plugin.d.ts +1 -0
- package/dist/types/plugin.js +0 -0
- package/dist/types/plugin.js.map +0 -0
- package/dist/types/storage.d.ts +0 -0
- package/dist/types/storage.js +0 -0
- package/dist/types/storage.js.map +0 -0
- package/dist/utils/clock.d.ts +0 -0
- package/dist/utils/clock.js +0 -0
- package/dist/utils/clock.js.map +0 -0
- package/dist/utils/errors.d.ts +0 -0
- package/dist/utils/errors.js +0 -0
- package/dist/utils/errors.js.map +0 -0
- package/dist/utils/hashing.d.ts +0 -0
- package/dist/utils/hashing.js +0 -0
- package/dist/utils/hashing.js.map +0 -0
- package/dist/utils/ids.d.ts +0 -0
- package/dist/utils/ids.js +0 -0
- package/dist/utils/ids.js.map +0 -0
- package/dist/utils/text.d.ts +0 -0
- package/dist/utils/text.js +0 -0
- package/dist/utils/text.js.map +0 -0
- package/dist/version/package-version.d.ts +0 -0
- package/dist/version/package-version.js +0 -0
- package/dist/version/package-version.js.map +0 -0
- package/dist/version/remote-release.d.ts +0 -0
- package/dist/version/remote-release.js +0 -0
- package/dist/version/remote-release.js.map +0 -0
- package/docs/assets/readme/inspect-last-example.svg +0 -0
- package/docs/releases/v0.1.0.md +0 -0
- package/docs/releases/v0.1.1.md +0 -0
- package/docs/releases/v0.1.2.md +0 -0
- package/docs/releases/v0.1.3.md +0 -0
- package/docs/releases/v0.2.0.md +0 -0
- package/docs/releases/v0.2.1.md +0 -0
- package/docs/releases/v0.3.0.md +0 -0
- package/docs/releases/v0.3.1.md +0 -0
- package/docs/releases/v0.3.2.md +0 -0
- package/docs/releases/v0.3.3.md +0 -0
- package/docs/releases/v0.3.4.md +0 -0
- package/docs/releases/v0.3.5.md +0 -0
- package/docs/releases/v0.3.6.md +28 -0
- package/docs/releases/v0.4.0.md +39 -0
- package/docs/user-guide.md +86 -2
- package/hooks/hooks.json +0 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/plugins/claude-code-experienceengine/.claude-plugin/plugin.json +0 -0
- package/plugins/claude-code-experienceengine/.mcp.json +0 -0
- package/plugins/claude-code-experienceengine/hooks/hooks.json +0 -0
- package/plugins/claude-code-experienceengine/scripts/claude-hook.sh +0 -0
- package/plugins/claude-code-experienceengine/scripts/install-deps.sh +0 -0
- package/plugins/claude-code-experienceengine/scripts/mcp-server.sh +0 -0
- package/scripts/claude-plugin/claude-hook.sh +0 -0
- package/scripts/claude-plugin/install-deps.sh +0 -0
- package/scripts/claude-plugin/mcp-server.sh +0 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { readFileSync, existsSync, mkdirSync, copyFileSync } from "node:fs";
|
|
2
|
+
import { join, dirname, isAbsolute } from "node:path";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
4
|
+
export const isSafeRelativePath = (p) => {
|
|
5
|
+
if (typeof p !== "string" || !p)
|
|
6
|
+
return false;
|
|
7
|
+
if (isAbsolute(p))
|
|
8
|
+
return false;
|
|
9
|
+
if (/^[a-zA-Z]:/.test(p))
|
|
10
|
+
return false;
|
|
11
|
+
const parts = p.split(/[/\\]/);
|
|
12
|
+
for (const part of parts) {
|
|
13
|
+
if (part === ".." || part === ".") {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return true;
|
|
18
|
+
};
|
|
19
|
+
export const calculateFileSha256 = (filePath) => {
|
|
20
|
+
const content = readFileSync(filePath);
|
|
21
|
+
return createHash("sha256").update(content).digest("hex");
|
|
22
|
+
};
|
|
23
|
+
export const validateOfflineManifest = (manifest, baseDir) => {
|
|
24
|
+
if (!manifest || typeof manifest !== "object") {
|
|
25
|
+
throw new Error("Invalid manifest format: not an object.");
|
|
26
|
+
}
|
|
27
|
+
const m = manifest;
|
|
28
|
+
if (typeof m.manifestVersion !== "string" || !m.manifestVersion) {
|
|
29
|
+
throw new Error("Missing or invalid manifestVersion.");
|
|
30
|
+
}
|
|
31
|
+
if (m.providerId !== "local") {
|
|
32
|
+
throw new Error(`Unsupported providerId: ${m.providerId}. Only 'local' is supported.`);
|
|
33
|
+
}
|
|
34
|
+
if (typeof m.modelId !== "string" || !m.modelId) {
|
|
35
|
+
throw new Error("Missing or invalid modelId.");
|
|
36
|
+
}
|
|
37
|
+
if (typeof m.dimensions !== "number" || m.dimensions <= 0) {
|
|
38
|
+
throw new Error("Missing or invalid dimensions.");
|
|
39
|
+
}
|
|
40
|
+
if (typeof m.preprocessingVersion !== "string" || !m.preprocessingVersion) {
|
|
41
|
+
throw new Error("Missing or invalid preprocessingVersion.");
|
|
42
|
+
}
|
|
43
|
+
if (!m.assets || typeof m.assets !== "object") {
|
|
44
|
+
throw new Error("Missing or invalid assets object.");
|
|
45
|
+
}
|
|
46
|
+
const validatedAssets = {};
|
|
47
|
+
const assetsObj = m.assets;
|
|
48
|
+
for (const [key, value] of Object.entries(assetsObj)) {
|
|
49
|
+
if (!value || typeof value !== "object") {
|
|
50
|
+
throw new Error(`Invalid asset entry for key: ${key}.`);
|
|
51
|
+
}
|
|
52
|
+
const val = value;
|
|
53
|
+
if (typeof val.path !== "string" || !val.path || !isSafeRelativePath(val.path)) {
|
|
54
|
+
throw new Error(`Missing, invalid, or unsafe path for asset: ${key}. Path traversal detected or suspected.`);
|
|
55
|
+
}
|
|
56
|
+
if (typeof val.sha256 !== "string" || !val.sha256) {
|
|
57
|
+
throw new Error(`Missing or invalid sha256 checksum for asset: ${key}.`);
|
|
58
|
+
}
|
|
59
|
+
// Validate file presence and sha256
|
|
60
|
+
const absolutePath = join(baseDir, val.path);
|
|
61
|
+
if (!existsSync(absolutePath)) {
|
|
62
|
+
throw new Error(`Asset file missing: ${absolutePath}`);
|
|
63
|
+
}
|
|
64
|
+
const actualSha256 = calculateFileSha256(absolutePath);
|
|
65
|
+
if (actualSha256 !== val.sha256) {
|
|
66
|
+
throw new Error(`Asset checksum mismatch for file ${val.path}. Expected: ${val.sha256}, Actual: ${actualSha256}`);
|
|
67
|
+
}
|
|
68
|
+
validatedAssets[key] = {
|
|
69
|
+
path: val.path,
|
|
70
|
+
sha256: val.sha256
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
let manifestId = typeof m.id === "string" ? m.id : undefined;
|
|
74
|
+
if (!manifestId) {
|
|
75
|
+
const assetKeysSorted = Object.keys(validatedAssets).sort();
|
|
76
|
+
const assetsString = assetKeysSorted
|
|
77
|
+
.map((key) => `${key}:${validatedAssets[key].sha256}`)
|
|
78
|
+
.join(";");
|
|
79
|
+
const idSource = `${m.modelId}|${m.dimensions}|${m.preprocessingVersion}|${assetsString}`;
|
|
80
|
+
manifestId = `derived-${createHash("sha256").update(idSource).digest("hex").slice(0, 16)}`;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
id: manifestId,
|
|
84
|
+
manifestVersion: m.manifestVersion,
|
|
85
|
+
providerId: m.providerId,
|
|
86
|
+
modelId: m.modelId,
|
|
87
|
+
dimensions: m.dimensions,
|
|
88
|
+
preprocessingVersion: m.preprocessingVersion,
|
|
89
|
+
assets: validatedAssets,
|
|
90
|
+
license: typeof m.license === "string" ? m.license : undefined,
|
|
91
|
+
sourceMetadata: typeof m.sourceMetadata === "object" && m.sourceMetadata !== null ? m.sourceMetadata : undefined
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
export const loadOfflineManifestForModel = (cacheDir, model) => {
|
|
95
|
+
const modelCacheDir = join(cacheDir, ...model.split("/"));
|
|
96
|
+
const manifestPath = join(modelCacheDir, "manifest.json");
|
|
97
|
+
if (!existsSync(manifestPath)) {
|
|
98
|
+
throw new Error(`Manifest file not found: ${manifestPath}`);
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
const rawContent = readFileSync(manifestPath, "utf8");
|
|
102
|
+
const manifestJson = JSON.parse(rawContent);
|
|
103
|
+
return validateOfflineManifest(manifestJson, modelCacheDir);
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
107
|
+
throw new Error(`Failed to load or validate manifest at ${manifestPath}: ${msg}`);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
export const importOfflineAssetPack = async (packDir, cacheDir) => {
|
|
111
|
+
const manifestPath = join(packDir, "manifest.json");
|
|
112
|
+
if (!existsSync(manifestPath)) {
|
|
113
|
+
throw new Error(`Asset pack missing manifest.json at ${packDir}`);
|
|
114
|
+
}
|
|
115
|
+
// Read and validate the manifest in the staging/pack directory
|
|
116
|
+
let manifest;
|
|
117
|
+
try {
|
|
118
|
+
const rawContent = readFileSync(manifestPath, "utf8");
|
|
119
|
+
const manifestJson = JSON.parse(rawContent);
|
|
120
|
+
manifest = validateOfflineManifest(manifestJson, packDir);
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
124
|
+
throw new Error(`Import failed during manifest validation: ${msg}`);
|
|
125
|
+
}
|
|
126
|
+
const targetModelDir = join(cacheDir, ...manifest.modelId.split("/"));
|
|
127
|
+
mkdirSync(targetModelDir, { recursive: true });
|
|
128
|
+
// Copy manifest.json
|
|
129
|
+
copyFileSync(manifestPath, join(targetModelDir, "manifest.json"));
|
|
130
|
+
// Copy all assets
|
|
131
|
+
for (const asset of Object.values(manifest.assets)) {
|
|
132
|
+
const sourcePath = join(packDir, asset.path);
|
|
133
|
+
const targetPath = join(targetModelDir, asset.path);
|
|
134
|
+
mkdirSync(dirname(targetPath), { recursive: true });
|
|
135
|
+
copyFileSync(sourcePath, targetPath);
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
const { clearLocalEmbeddingProviderCache } = await import("./local-provider.js");
|
|
139
|
+
const { clearEmbeddingRuntimeCaches } = await import("./embeddings.js");
|
|
140
|
+
clearLocalEmbeddingProviderCache();
|
|
141
|
+
clearEmbeddingRuntimeCaches();
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
// Gracefully handle dynamic import edge cases
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
export const exportOfflineAssetPack = async (cacheDir, model, targetPackDir) => {
|
|
148
|
+
// Load and validate from cache
|
|
149
|
+
const manifest = loadOfflineManifestForModel(cacheDir, model);
|
|
150
|
+
const modelCacheDir = join(cacheDir, ...model.split("/"));
|
|
151
|
+
mkdirSync(targetPackDir, { recursive: true });
|
|
152
|
+
// Copy manifest.json
|
|
153
|
+
copyFileSync(join(modelCacheDir, "manifest.json"), join(targetPackDir, "manifest.json"));
|
|
154
|
+
// Copy all assets
|
|
155
|
+
for (const asset of Object.values(manifest.assets)) {
|
|
156
|
+
const sourcePath = join(modelCacheDir, asset.path);
|
|
157
|
+
const targetPath = join(targetPackDir, asset.path);
|
|
158
|
+
mkdirSync(dirname(targetPath), { recursive: true });
|
|
159
|
+
copyFileSync(sourcePath, targetPath);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
//# sourceMappingURL=offline-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offline-manifest.js","sourceRoot":"","sources":["../../../src/store/vector/offline-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiB,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,CAAC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,QAAQ,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAE1D,SAAS,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE9C,qBAAqB;IACrB,YAAY,CACV,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,EACpC,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,CACrC,CAAC;IAEF,kBAAkB;IAClB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACnD,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAEnD,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACpD,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACvC,CAAC;AACH,CAAC,CAAC"}
|
|
File without changes
|
|
File without changes
|
package/dist/types/analyzer.d.ts
CHANGED
|
File without changes
|
package/dist/types/analyzer.js
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/types/domain.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type TaskType = "bug_fix" | "build_debug" | "config_debug" | "test_debug" | "integration_fix" | "feature_add" | "refactor" | "performance" | "general";
|
|
2
2
|
export type ResolvedTaskType = TaskType | "unknown";
|
|
3
3
|
export type ExperienceState = "candidate" | "priority_candidate" | "active" | "cooling" | "retired";
|
|
4
|
-
export type DeliveryState = "shadow_only" | "conservative_only" | "eligible" | "quarantined";
|
|
4
|
+
export type DeliveryState = "shadow_only" | "conservative_only" | "eligible" | "quarantined" | "shadow_probe" | "retired";
|
|
5
5
|
export type ExperienceNodeType = "strategy" | "warning";
|
|
6
6
|
export type PromotionSignal = "normal" | "high_value";
|
|
7
7
|
export type MergeAction = "ADD" | "UPDATE" | "NONE";
|
|
@@ -88,6 +88,7 @@ export type RetrievalContext = {
|
|
|
88
88
|
isReadOnly?: boolean;
|
|
89
89
|
modulePaths?: string[];
|
|
90
90
|
expectationCorrectionIntent?: boolean;
|
|
91
|
+
db?: any;
|
|
91
92
|
};
|
|
92
93
|
export type RetrievalPolicyStageName = "retrieval_context" | "hard_filter" | "shortlist" | "semantic_rerank_backfill" | "policy_enrichment" | "decision_assembly";
|
|
93
94
|
export type RetrievalPolicyStageDiagnostic = {
|
|
@@ -245,6 +246,24 @@ export type ExperienceNode = {
|
|
|
245
246
|
last_harmed_at?: string;
|
|
246
247
|
quarantined_at?: string;
|
|
247
248
|
quarantine_reason?: string;
|
|
249
|
+
embedding_manifest_id?: string;
|
|
250
|
+
migration_status?: 'current' | 'pending' | 'migrating' | 'failed';
|
|
251
|
+
migration_last_error?: string;
|
|
252
|
+
migration_updated_at?: string;
|
|
253
|
+
source_fingerprint_hash?: string;
|
|
254
|
+
portable_validation_evidence?: {
|
|
255
|
+
compatibilityClasses: Record<string, {
|
|
256
|
+
successReuseCount: number;
|
|
257
|
+
harmCount: number;
|
|
258
|
+
lastUsedAt: number;
|
|
259
|
+
}>;
|
|
260
|
+
};
|
|
261
|
+
quarantine_lease_expires_at?: string;
|
|
262
|
+
quarantine_original_delivery_state?: DeliveryState;
|
|
263
|
+
quarantine_release_attempt_count?: number;
|
|
264
|
+
quarantine_last_release_attempt_at?: string;
|
|
265
|
+
quarantine_release_reason?: string;
|
|
266
|
+
quarantine_no_harm_pass_count?: number;
|
|
248
267
|
created_at: string;
|
|
249
268
|
updated_at: string;
|
|
250
269
|
};
|
|
@@ -283,6 +302,11 @@ export type AttributionRecord = {
|
|
|
283
302
|
user_override?: "helped" | "harmed" | "neutral";
|
|
284
303
|
source: AttributionSource;
|
|
285
304
|
attribution_reason?: FeedbackAttributionReason | "manual_override" | "diagnostic_record";
|
|
305
|
+
trajectory_verdict?: string;
|
|
306
|
+
trajectory_confidence?: string;
|
|
307
|
+
trajectory_matched_expectations?: string[];
|
|
308
|
+
trajectory_violated_expectations?: string[];
|
|
309
|
+
trajectory_evidence_refs?: string[];
|
|
286
310
|
created_at: string;
|
|
287
311
|
resolved_at?: string;
|
|
288
312
|
};
|
|
@@ -336,6 +360,7 @@ export type InjectionScorecardNode = {
|
|
|
336
360
|
export type InjectionScorecardCandidate = {
|
|
337
361
|
id: string;
|
|
338
362
|
matchScorecard?: MatchScorecard;
|
|
363
|
+
portabilityScorecard?: PortabilityScorecard;
|
|
339
364
|
semanticScore?: number;
|
|
340
365
|
lexicalScore?: number;
|
|
341
366
|
fusedScore?: number;
|
|
@@ -514,3 +539,88 @@ export type DistillationJob = {
|
|
|
514
539
|
finished_at?: string;
|
|
515
540
|
discarded_at?: string;
|
|
516
541
|
};
|
|
542
|
+
export type ProjectFingerprint = {
|
|
543
|
+
schemaVersion: string;
|
|
544
|
+
fingerprintHash: string;
|
|
545
|
+
timestamp: number;
|
|
546
|
+
primaryLanguage: string;
|
|
547
|
+
packageManager: string;
|
|
548
|
+
lockfileFamily: string;
|
|
549
|
+
frameworks: Record<string, number>;
|
|
550
|
+
databaseOrORM: Record<string, number>;
|
|
551
|
+
testBuildTools: Record<string, number>;
|
|
552
|
+
hostRuntimeAdapters: Record<string, number>;
|
|
553
|
+
configMarkers: string[];
|
|
554
|
+
workspaceRootPath?: string;
|
|
555
|
+
projectRootScopeId?: string;
|
|
556
|
+
};
|
|
557
|
+
export type ScopeFingerprint = {
|
|
558
|
+
scope_id: string;
|
|
559
|
+
schema_version: string;
|
|
560
|
+
fingerprint_hash: string;
|
|
561
|
+
fingerprint_json: string;
|
|
562
|
+
created_at: string;
|
|
563
|
+
updated_at: string;
|
|
564
|
+
};
|
|
565
|
+
export type OfflineAssetManifest = {
|
|
566
|
+
id?: string;
|
|
567
|
+
manifestVersion: string;
|
|
568
|
+
providerId: string;
|
|
569
|
+
modelId: string;
|
|
570
|
+
dimensions: number;
|
|
571
|
+
preprocessingVersion: string;
|
|
572
|
+
assets: Record<string, {
|
|
573
|
+
path: string;
|
|
574
|
+
sha256: string;
|
|
575
|
+
}>;
|
|
576
|
+
license?: string;
|
|
577
|
+
sourceMetadata?: Record<string, unknown>;
|
|
578
|
+
};
|
|
579
|
+
export type PortabilityBand = "incompatible" | "weakly_related" | "same_family" | "validated_portable";
|
|
580
|
+
export type PortabilityScorecard = {
|
|
581
|
+
portabilityBand: PortabilityBand;
|
|
582
|
+
score: number;
|
|
583
|
+
matchedLanguage: boolean;
|
|
584
|
+
sharedDependencies: string[];
|
|
585
|
+
penalties: Array<{
|
|
586
|
+
dependency: string;
|
|
587
|
+
category: string;
|
|
588
|
+
penalty: number;
|
|
589
|
+
reason: string;
|
|
590
|
+
}>;
|
|
591
|
+
negativeEvidence: string[];
|
|
592
|
+
whyScore: string;
|
|
593
|
+
successReuseCount?: number;
|
|
594
|
+
harmCount?: number;
|
|
595
|
+
};
|
|
596
|
+
export type TrajectoryExpectationType = "recommend" | "avoid";
|
|
597
|
+
export type ExpectationActionType = "command" | "artifact" | "generic";
|
|
598
|
+
export type TrajectoryExpectation = {
|
|
599
|
+
id: string;
|
|
600
|
+
type: TrajectoryExpectationType;
|
|
601
|
+
actionType: ExpectationActionType;
|
|
602
|
+
toolNamePattern?: string;
|
|
603
|
+
commandPattern?: string;
|
|
604
|
+
artifactPattern?: string;
|
|
605
|
+
artifactAction?: "read" | "write" | "any";
|
|
606
|
+
originalStep: string;
|
|
607
|
+
ordered: boolean;
|
|
608
|
+
sourceField?: "recommended_steps" | "avoid_steps" | "success_signal" | "stop_condition" | "escalation_condition";
|
|
609
|
+
requiredForAdoption?: boolean;
|
|
610
|
+
};
|
|
611
|
+
export type CompiledTrajectoryExpectations = {
|
|
612
|
+
orderedExpectations: TrajectoryExpectation[];
|
|
613
|
+
unorderedExpectations: TrajectoryExpectation[];
|
|
614
|
+
};
|
|
615
|
+
export type NormalizedToolEvent = {
|
|
616
|
+
toolName: string;
|
|
617
|
+
commandFamily?: string;
|
|
618
|
+
subcommand?: string;
|
|
619
|
+
normalizedInput?: string;
|
|
620
|
+
normalizedOutput?: string;
|
|
621
|
+
artifactExtension?: string;
|
|
622
|
+
artifactName?: string;
|
|
623
|
+
artifactPath?: string;
|
|
624
|
+
artifactPaths?: string[];
|
|
625
|
+
status: "success" | "failure" | "unknown";
|
|
626
|
+
};
|
package/dist/types/domain.js
CHANGED
|
File without changes
|
package/dist/types/domain.js.map
CHANGED
|
File without changes
|
package/dist/types/plugin.d.ts
CHANGED
package/dist/types/plugin.js
CHANGED
|
File without changes
|
package/dist/types/plugin.js.map
CHANGED
|
File without changes
|
package/dist/types/storage.d.ts
CHANGED
|
File without changes
|
package/dist/types/storage.js
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/utils/clock.d.ts
CHANGED
|
File without changes
|
package/dist/utils/clock.js
CHANGED
|
File without changes
|
package/dist/utils/clock.js.map
CHANGED
|
File without changes
|
package/dist/utils/errors.d.ts
CHANGED
|
File without changes
|
package/dist/utils/errors.js
CHANGED
|
File without changes
|
package/dist/utils/errors.js.map
CHANGED
|
File without changes
|
package/dist/utils/hashing.d.ts
CHANGED
|
File without changes
|
package/dist/utils/hashing.js
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/utils/ids.d.ts
CHANGED
|
File without changes
|
package/dist/utils/ids.js
CHANGED
|
File without changes
|
package/dist/utils/ids.js.map
CHANGED
|
File without changes
|
package/dist/utils/text.d.ts
CHANGED
|
File without changes
|
package/dist/utils/text.js
CHANGED
|
File without changes
|
package/dist/utils/text.js.map
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/docs/releases/v0.1.0.md
CHANGED
|
File without changes
|
package/docs/releases/v0.1.1.md
CHANGED
|
File without changes
|
package/docs/releases/v0.1.2.md
CHANGED
|
File without changes
|
package/docs/releases/v0.1.3.md
CHANGED
|
File without changes
|
package/docs/releases/v0.2.0.md
CHANGED
|
File without changes
|
package/docs/releases/v0.2.1.md
CHANGED
|
File without changes
|
package/docs/releases/v0.3.0.md
CHANGED
|
File without changes
|
package/docs/releases/v0.3.1.md
CHANGED
|
File without changes
|
package/docs/releases/v0.3.2.md
CHANGED
|
File without changes
|
package/docs/releases/v0.3.3.md
CHANGED
|
File without changes
|
package/docs/releases/v0.3.4.md
CHANGED
|
File without changes
|
package/docs/releases/v0.3.5.md
CHANGED
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# v0.3.6
|
|
2
|
+
|
|
3
|
+
`v0.3.6` adds autonomous hygiene governance. ExperienceEngine can now periodically govern duplicated, stale, or risky local experience without requiring users to run routine hygiene commands by hand.
|
|
4
|
+
|
|
5
|
+
## Added
|
|
6
|
+
|
|
7
|
+
- Added persisted per-scope governance schedules, leases, runs, plans, actions, legacy approval records, and rollback snapshots.
|
|
8
|
+
- Added host-attached governance wakeups from startup, prompt lookup, posttask finalization, and stop paths.
|
|
9
|
+
- Added bounded LLM-assisted governance planning, deterministic validation, safe automatic application, and guarded automatic execution for high-impact experience-node actions.
|
|
10
|
+
- Added MCP resources for `experienceengine://governance` and `experienceengine://governance/approvals`.
|
|
11
|
+
- Kept brokered governance approval actions as a compatibility surface for existing approval records.
|
|
12
|
+
- Added CLI fallback surfaces:
|
|
13
|
+
- `ee inspect governance`
|
|
14
|
+
- `ee maintenance governance drain`
|
|
15
|
+
|
|
16
|
+
## Behavior Notes
|
|
17
|
+
|
|
18
|
+
- Hygiene inspection and operator review remain read-only.
|
|
19
|
+
- Routine governance is automatic and host-attached; CLI drain is an operator fallback for troubleshooting or catch-up.
|
|
20
|
+
- Frequent host open/close cycles do not define governance cadence. The persisted schedule, lease, backoff, finding hash, and action budget do.
|
|
21
|
+
- Safe automatic actions include exact duplicate merge, stale shadow-only retirement, delivery downgrade, and quarantine.
|
|
22
|
+
- High-impact experience-node actions are applied as guarded soft changes: semantic/conflicted merges preserve evidence and downgrade live eligibility, promotion lands at conservative delivery, and deletion is a soft-retire with rollback snapshots. Broad rewrites, export writing, repo policy changes, and restore actions are rejected by automatic experience governance.
|
|
23
|
+
|
|
24
|
+
## Validation
|
|
25
|
+
|
|
26
|
+
- Targeted unit coverage for scheduler, LLM planner, validator, applicator, guarded execution, CLI, MCP, runtime, and operator review paths.
|
|
27
|
+
- `pnpm tsc --noEmit --pretty false`
|
|
28
|
+
- `openspec validate add-autonomous-hygiene-governance --strict`
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# ExperienceEngine v0.4.0
|
|
2
|
+
|
|
3
|
+
`v0.4.0` introduces the **Governed Portable Experience** layer, enabling safe cross-repository experience sharing, stack-aware compatibility fingerprinting, causal trajectory-based attribution, and a lease-based quarantine and shadow-probe lifecycle.
|
|
4
|
+
|
|
5
|
+
## What Changed
|
|
6
|
+
|
|
7
|
+
- **Offline Embedding Profiles**: Added support for `standard`, `local-download`, and `strict-offline` embedding profile configurations, backed by a strict offline asset manifest registry that validates checksums and licenses.
|
|
8
|
+
- **Compatibility Fingerprints**: Implemented deterministic fingerprint extraction for repository scopes, capturing primary languages, frameworks, ORMs, and lockfile-resolved (npm, pnpm, yarn) dependency major versions, with monorepo workspace package support.
|
|
9
|
+
- **Portability Scoring and Bands**: Created a scorecard combining fingerprint, path, and task family similarity with prior reuse evidence. Classifies cross-repo candidates into portability bands (`validated_portable`, `same_family`, `weakly_related`, `incompatible`) with strict framework SemVer major-version penalties.
|
|
10
|
+
- **Cross-Repository Intervention Governance**: Enabled progressive delivery where `same_family` candidates are limited to conservative prompt delivery, `weakly_related` remain record-only, and `incompatible` are skipped.
|
|
11
|
+
- **Causal Trajectory Attribution**: Built a compiler that normalizes tool names/arguments and redacts volatile tokens (temp paths, UUIDs, branch names) to check timelines against compiled expectations (`recommended_steps` and `avoid_steps`). Yields detailed verdicts (`adoption_detected`, `non_adoption_detected`, `contra_adoption_detected`, etc.).
|
|
12
|
+
- **Quarantine Shadow-Probe Lifecycle**: Expired quarantine leases now transition candidates to a `shadow_probe` state. These are withheld from live prompt injection but evaluated as diagnostic candidates, restoring to `conservative` only after accumulating bounded no-harm passes in matching tasks, or retiring/re-quarantining on repeated harm.
|
|
13
|
+
- **Enhanced Diagnostics and Operator Surfaces**:
|
|
14
|
+
- Extended `ee doctor` to report embedding profile type, manifest checksum health, and offline asset readiness.
|
|
15
|
+
- Extended `ee inspect` with verbose output showing compatibility fingerprint summaries, SemVer penalties, causal trajectory verdicts with matched/violated expectations, and quarantine lease/shadow-probe histories.
|
|
16
|
+
- Updated README, README.zh-CN, and `docs/user-guide.md` with complete architecture and operator documentation.
|
|
17
|
+
|
|
18
|
+
## Boundaries
|
|
19
|
+
|
|
20
|
+
- **No Blind Cross-Repo Injection**: Tech-stack similarity alone never unlocks direct eligible prompt injection for cross-repo candidates.
|
|
21
|
+
- **Strict Shadow-Probe Isolation**: Shadow-probe nodes remain completely excluded from live prompt injection; they accumulate no-harm passes solely via record-only diagnostic evaluations.
|
|
22
|
+
- **Avoid-Step Defaults**: Avoid-step violations default to non-adoption (`non_adoption_detected` or `contra_adoption_detected`) rather than automatically triggering a causal harm verdict, unless causal failure is explicitly observed.
|
|
23
|
+
- **Offline Integrity**: Strict offline profiles fail loudly on missing or corrupt assets, preventing silent online fallbacks unless explicitly allowed.
|
|
24
|
+
|
|
25
|
+
## Validation
|
|
26
|
+
|
|
27
|
+
- Comprehensive unit and integration test coverage for embedding profiles, vector migration, fingerprinting, portability scoring, trajectory compilation, causal matches, quarantine leases, shadow-probes, and CLI diagnostics.
|
|
28
|
+
- Validation checks completed successfully:
|
|
29
|
+
- `pnpm exec tsc --noEmit`
|
|
30
|
+
- `pnpm exec vitest run`
|
|
31
|
+
- `pnpm exec openspec validate add-governed-portable-experience --strict`
|
|
32
|
+
- `pnpm check`
|
|
33
|
+
- `npm pack --dry-run`
|
|
34
|
+
- Real-host validation completed for:
|
|
35
|
+
- WSL Codex CLI lifecycle wrapper and persistence.
|
|
36
|
+
- Claude Code MCP wiring and `experienceengine_get_capabilities` tool invocation with `nvidia/nemotron-3-super-120b-a12b:free`.
|
|
37
|
+
- WSL OpenClaw plugin wiring after `ee repair openclaw`, with live high-confidence scenario writeback using `openrouter/nvidia/nemotron-3-super-120b-a12b:free`.
|
|
38
|
+
- Known host boundary:
|
|
39
|
+
- Windows Codex App validation was blocked by the local WindowsApps `codex.exe` shim returning `EPERM` / `Access is denied`; WSL Codex CLI validation passed.
|