@miller-tech/uap 1.0.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/LICENSE +21 -0
- package/README.md +888 -0
- package/dist/analyzers/index.d.ts +3 -0
- package/dist/analyzers/index.d.ts.map +1 -0
- package/dist/analyzers/index.js +684 -0
- package/dist/analyzers/index.js.map +1 -0
- package/dist/benchmarks/agents/naive-agent.d.ts +60 -0
- package/dist/benchmarks/agents/naive-agent.d.ts.map +1 -0
- package/dist/benchmarks/agents/naive-agent.js +144 -0
- package/dist/benchmarks/agents/naive-agent.js.map +1 -0
- package/dist/benchmarks/agents/uap-agent.d.ts +167 -0
- package/dist/benchmarks/agents/uap-agent.d.ts.map +1 -0
- package/dist/benchmarks/agents/uap-agent.js +437 -0
- package/dist/benchmarks/agents/uap-agent.js.map +1 -0
- package/dist/benchmarks/benchmark.d.ts +328 -0
- package/dist/benchmarks/benchmark.d.ts.map +1 -0
- package/dist/benchmarks/benchmark.js +112 -0
- package/dist/benchmarks/benchmark.js.map +1 -0
- package/dist/benchmarks/execution-verifier.d.ts +41 -0
- package/dist/benchmarks/execution-verifier.d.ts.map +1 -0
- package/dist/benchmarks/execution-verifier.js +340 -0
- package/dist/benchmarks/execution-verifier.js.map +1 -0
- package/dist/benchmarks/hierarchical-prompting.d.ts +37 -0
- package/dist/benchmarks/hierarchical-prompting.d.ts.map +1 -0
- package/dist/benchmarks/hierarchical-prompting.js +246 -0
- package/dist/benchmarks/hierarchical-prompting.js.map +1 -0
- package/dist/benchmarks/improved-benchmark.d.ts +89 -0
- package/dist/benchmarks/improved-benchmark.d.ts.map +1 -0
- package/dist/benchmarks/improved-benchmark.js +585 -0
- package/dist/benchmarks/improved-benchmark.js.map +1 -0
- package/dist/benchmarks/index.d.ts +11 -0
- package/dist/benchmarks/index.d.ts.map +1 -0
- package/dist/benchmarks/index.js +11 -0
- package/dist/benchmarks/index.js.map +1 -0
- package/dist/benchmarks/model-integration.d.ts +111 -0
- package/dist/benchmarks/model-integration.d.ts.map +1 -0
- package/dist/benchmarks/model-integration.js +904 -0
- package/dist/benchmarks/model-integration.js.map +1 -0
- package/dist/benchmarks/multi-turn-agent.d.ts +44 -0
- package/dist/benchmarks/multi-turn-agent.d.ts.map +1 -0
- package/dist/benchmarks/multi-turn-agent.js +254 -0
- package/dist/benchmarks/multi-turn-agent.js.map +1 -0
- package/dist/benchmarks/multi-turn-loop.d.ts +57 -0
- package/dist/benchmarks/multi-turn-loop.d.ts.map +1 -0
- package/dist/benchmarks/multi-turn-loop.js +167 -0
- package/dist/benchmarks/multi-turn-loop.js.map +1 -0
- package/dist/benchmarks/tasks.d.ts +19 -0
- package/dist/benchmarks/tasks.d.ts.map +1 -0
- package/dist/benchmarks/tasks.js +435 -0
- package/dist/benchmarks/tasks.js.map +1 -0
- package/dist/bin/cli.d.ts +3 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +546 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/bin/llama-server-optimize.d.ts +18 -0
- package/dist/bin/llama-server-optimize.d.ts.map +1 -0
- package/dist/bin/llama-server-optimize.js +708 -0
- package/dist/bin/llama-server-optimize.js.map +1 -0
- package/dist/bin/policy.d.ts +3 -0
- package/dist/bin/policy.d.ts.map +1 -0
- package/dist/bin/policy.js +143 -0
- package/dist/bin/policy.js.map +1 -0
- package/dist/bin/tool-calls.d.ts +3 -0
- package/dist/bin/tool-calls.d.ts.map +1 -0
- package/dist/bin/tool-calls.js +4 -0
- package/dist/bin/tool-calls.js.map +1 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +2 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/web-browser.d.ts +30 -0
- package/dist/browser/web-browser.d.ts.map +1 -0
- package/dist/browser/web-browser.js +93 -0
- package/dist/browser/web-browser.js.map +1 -0
- package/dist/cli/agent.d.ts +20 -0
- package/dist/cli/agent.d.ts.map +1 -0
- package/dist/cli/agent.js +474 -0
- package/dist/cli/agent.js.map +1 -0
- package/dist/cli/analyze.d.ts +7 -0
- package/dist/cli/analyze.d.ts.map +1 -0
- package/dist/cli/analyze.js +103 -0
- package/dist/cli/analyze.js.map +1 -0
- package/dist/cli/completion-gates.d.ts +51 -0
- package/dist/cli/completion-gates.d.ts.map +1 -0
- package/dist/cli/completion-gates.js +201 -0
- package/dist/cli/completion-gates.js.map +1 -0
- package/dist/cli/compliance.d.ts +8 -0
- package/dist/cli/compliance.d.ts.map +1 -0
- package/dist/cli/compliance.js +509 -0
- package/dist/cli/compliance.js.map +1 -0
- package/dist/cli/coord.d.ts +7 -0
- package/dist/cli/coord.d.ts.map +1 -0
- package/dist/cli/coord.js +138 -0
- package/dist/cli/coord.js.map +1 -0
- package/dist/cli/dashboard.d.ts +21 -0
- package/dist/cli/dashboard.d.ts.map +1 -0
- package/dist/cli/dashboard.js +1508 -0
- package/dist/cli/dashboard.js.map +1 -0
- package/dist/cli/deploy.d.ts +19 -0
- package/dist/cli/deploy.d.ts.map +1 -0
- package/dist/cli/deploy.js +387 -0
- package/dist/cli/deploy.js.map +1 -0
- package/dist/cli/droids.d.ts +9 -0
- package/dist/cli/droids.d.ts.map +1 -0
- package/dist/cli/droids.js +227 -0
- package/dist/cli/droids.js.map +1 -0
- package/dist/cli/generate.d.ts +17 -0
- package/dist/cli/generate.d.ts.map +1 -0
- package/dist/cli/generate.js +432 -0
- package/dist/cli/generate.js.map +1 -0
- package/dist/cli/hooks.d.ts +9 -0
- package/dist/cli/hooks.d.ts.map +1 -0
- package/dist/cli/hooks.js +464 -0
- package/dist/cli/hooks.js.map +1 -0
- package/dist/cli/init.d.ts +12 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +364 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/mcp-router.d.ts +16 -0
- package/dist/cli/mcp-router.d.ts.map +1 -0
- package/dist/cli/mcp-router.js +143 -0
- package/dist/cli/mcp-router.js.map +1 -0
- package/dist/cli/memory.d.ts +24 -0
- package/dist/cli/memory.d.ts.map +1 -0
- package/dist/cli/memory.js +885 -0
- package/dist/cli/memory.js.map +1 -0
- package/dist/cli/model.d.ts +15 -0
- package/dist/cli/model.d.ts.map +1 -0
- package/dist/cli/model.js +290 -0
- package/dist/cli/model.js.map +1 -0
- package/dist/cli/patterns.d.ts +26 -0
- package/dist/cli/patterns.d.ts.map +1 -0
- package/dist/cli/patterns.js +862 -0
- package/dist/cli/patterns.js.map +1 -0
- package/dist/cli/rtk-validation.d.ts +9 -0
- package/dist/cli/rtk-validation.d.ts.map +1 -0
- package/dist/cli/rtk-validation.js +9 -0
- package/dist/cli/rtk-validation.js.map +1 -0
- package/dist/cli/rtk.d.ts +34 -0
- package/dist/cli/rtk.d.ts.map +1 -0
- package/dist/cli/rtk.js +401 -0
- package/dist/cli/rtk.js.map +1 -0
- package/dist/cli/schema-diff.d.ts +7 -0
- package/dist/cli/schema-diff.d.ts.map +1 -0
- package/dist/cli/schema-diff.js +11 -0
- package/dist/cli/schema-diff.js.map +1 -0
- package/dist/cli/setup-mcp-router.d.ts +8 -0
- package/dist/cli/setup-mcp-router.d.ts.map +1 -0
- package/dist/cli/setup-mcp-router.js +163 -0
- package/dist/cli/setup-mcp-router.js.map +1 -0
- package/dist/cli/setup-wizard.d.ts +2 -0
- package/dist/cli/setup-wizard.d.ts.map +1 -0
- package/dist/cli/setup-wizard.js +806 -0
- package/dist/cli/setup-wizard.js.map +1 -0
- package/dist/cli/setup.d.ts +15 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +154 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli/sync.d.ts +8 -0
- package/dist/cli/sync.d.ts.map +1 -0
- package/dist/cli/sync.js +395 -0
- package/dist/cli/sync.js.map +1 -0
- package/dist/cli/task.d.ts +33 -0
- package/dist/cli/task.d.ts.map +1 -0
- package/dist/cli/task.js +672 -0
- package/dist/cli/task.js.map +1 -0
- package/dist/cli/tool-calls.d.ts +20 -0
- package/dist/cli/tool-calls.d.ts.map +1 -0
- package/dist/cli/tool-calls.js +605 -0
- package/dist/cli/tool-calls.js.map +1 -0
- package/dist/cli/uap.d.ts +10 -0
- package/dist/cli/uap.d.ts.map +1 -0
- package/dist/cli/uap.js +398 -0
- package/dist/cli/uap.js.map +1 -0
- package/dist/cli/update.d.ts +10 -0
- package/dist/cli/update.d.ts.map +1 -0
- package/dist/cli/update.js +300 -0
- package/dist/cli/update.js.map +1 -0
- package/dist/cli/visualize.d.ts +77 -0
- package/dist/cli/visualize.d.ts.map +1 -0
- package/dist/cli/visualize.js +287 -0
- package/dist/cli/visualize.js.map +1 -0
- package/dist/cli/worktree.d.ts +9 -0
- package/dist/cli/worktree.d.ts.map +1 -0
- package/dist/cli/worktree.js +213 -0
- package/dist/cli/worktree.js.map +1 -0
- package/dist/coordination/adaptive-patterns.d.ts +65 -0
- package/dist/coordination/adaptive-patterns.d.ts.map +1 -0
- package/dist/coordination/adaptive-patterns.js +108 -0
- package/dist/coordination/adaptive-patterns.js.map +1 -0
- package/dist/coordination/auto-agent.d.ts +82 -0
- package/dist/coordination/auto-agent.d.ts.map +1 -0
- package/dist/coordination/auto-agent.js +145 -0
- package/dist/coordination/auto-agent.js.map +1 -0
- package/dist/coordination/capability-router.d.ts +79 -0
- package/dist/coordination/capability-router.d.ts.map +1 -0
- package/dist/coordination/capability-router.js +334 -0
- package/dist/coordination/capability-router.js.map +1 -0
- package/dist/coordination/database.d.ts +13 -0
- package/dist/coordination/database.d.ts.map +1 -0
- package/dist/coordination/database.js +136 -0
- package/dist/coordination/database.js.map +1 -0
- package/dist/coordination/deploy-batcher.d.ts +122 -0
- package/dist/coordination/deploy-batcher.d.ts.map +1 -0
- package/dist/coordination/deploy-batcher.js +718 -0
- package/dist/coordination/deploy-batcher.js.map +1 -0
- package/dist/coordination/droid-validator.d.ts +59 -0
- package/dist/coordination/droid-validator.d.ts.map +1 -0
- package/dist/coordination/droid-validator.js +142 -0
- package/dist/coordination/droid-validator.js.map +1 -0
- package/dist/coordination/index.d.ts +10 -0
- package/dist/coordination/index.d.ts.map +1 -0
- package/dist/coordination/index.js +10 -0
- package/dist/coordination/index.js.map +1 -0
- package/dist/coordination/pattern-router.d.ts +50 -0
- package/dist/coordination/pattern-router.d.ts.map +1 -0
- package/dist/coordination/pattern-router.js +118 -0
- package/dist/coordination/pattern-router.js.map +1 -0
- package/dist/coordination/service.d.ts +81 -0
- package/dist/coordination/service.d.ts.map +1 -0
- package/dist/coordination/service.js +619 -0
- package/dist/coordination/service.js.map +1 -0
- package/dist/coordination/worktree-enforcer.d.ts +22 -0
- package/dist/coordination/worktree-enforcer.d.ts.map +1 -0
- package/dist/coordination/worktree-enforcer.js +71 -0
- package/dist/coordination/worktree-enforcer.js.map +1 -0
- package/dist/generators/claude-md.d.ts +3 -0
- package/dist/generators/claude-md.d.ts.map +1 -0
- package/dist/generators/claude-md.js +1020 -0
- package/dist/generators/claude-md.js.map +1 -0
- package/dist/generators/template-loader.d.ts +105 -0
- package/dist/generators/template-loader.d.ts.map +1 -0
- package/dist/generators/template-loader.js +291 -0
- package/dist/generators/template-loader.js.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-router/config/parser.d.ts +9 -0
- package/dist/mcp-router/config/parser.d.ts.map +1 -0
- package/dist/mcp-router/config/parser.js +174 -0
- package/dist/mcp-router/config/parser.js.map +1 -0
- package/dist/mcp-router/executor/client.d.ts +31 -0
- package/dist/mcp-router/executor/client.d.ts.map +1 -0
- package/dist/mcp-router/executor/client.js +189 -0
- package/dist/mcp-router/executor/client.js.map +1 -0
- package/dist/mcp-router/index.d.ts +22 -0
- package/dist/mcp-router/index.d.ts.map +1 -0
- package/dist/mcp-router/index.js +18 -0
- package/dist/mcp-router/index.js.map +1 -0
- package/dist/mcp-router/output-compressor.d.ts +26 -0
- package/dist/mcp-router/output-compressor.d.ts.map +1 -0
- package/dist/mcp-router/output-compressor.js +236 -0
- package/dist/mcp-router/output-compressor.js.map +1 -0
- package/dist/mcp-router/search/fuzzy.d.ts +26 -0
- package/dist/mcp-router/search/fuzzy.d.ts.map +1 -0
- package/dist/mcp-router/search/fuzzy.js +94 -0
- package/dist/mcp-router/search/fuzzy.js.map +1 -0
- package/dist/mcp-router/server.d.ts +50 -0
- package/dist/mcp-router/server.d.ts.map +1 -0
- package/dist/mcp-router/server.js +229 -0
- package/dist/mcp-router/server.js.map +1 -0
- package/dist/mcp-router/session-stats.d.ts +37 -0
- package/dist/mcp-router/session-stats.d.ts.map +1 -0
- package/dist/mcp-router/session-stats.js +56 -0
- package/dist/mcp-router/session-stats.js.map +1 -0
- package/dist/mcp-router/tools/discover.d.ts +37 -0
- package/dist/mcp-router/tools/discover.d.ts.map +1 -0
- package/dist/mcp-router/tools/discover.js +65 -0
- package/dist/mcp-router/tools/discover.js.map +1 -0
- package/dist/mcp-router/tools/execute.d.ts +43 -0
- package/dist/mcp-router/tools/execute.d.ts.map +1 -0
- package/dist/mcp-router/tools/execute.js +144 -0
- package/dist/mcp-router/tools/execute.js.map +1 -0
- package/dist/mcp-router/types.d.ts +62 -0
- package/dist/mcp-router/types.d.ts.map +1 -0
- package/dist/mcp-router/types.js +6 -0
- package/dist/mcp-router/types.js.map +1 -0
- package/dist/memory/adaptive-context.d.ts +149 -0
- package/dist/memory/adaptive-context.d.ts.map +1 -0
- package/dist/memory/adaptive-context.js +1095 -0
- package/dist/memory/adaptive-context.js.map +1 -0
- package/dist/memory/agent-scoped-memory.d.ts +67 -0
- package/dist/memory/agent-scoped-memory.d.ts.map +1 -0
- package/dist/memory/agent-scoped-memory.js +126 -0
- package/dist/memory/agent-scoped-memory.js.map +1 -0
- package/dist/memory/ambiguity-detector.d.ts +54 -0
- package/dist/memory/ambiguity-detector.d.ts.map +1 -0
- package/dist/memory/ambiguity-detector.js +401 -0
- package/dist/memory/ambiguity-detector.js.map +1 -0
- package/dist/memory/backends/base.d.ts +18 -0
- package/dist/memory/backends/base.d.ts.map +1 -0
- package/dist/memory/backends/base.js +2 -0
- package/dist/memory/backends/base.js.map +1 -0
- package/dist/memory/backends/factory.d.ts +4 -0
- package/dist/memory/backends/factory.d.ts.map +1 -0
- package/dist/memory/backends/factory.js +53 -0
- package/dist/memory/backends/factory.js.map +1 -0
- package/dist/memory/backends/github.d.ts +27 -0
- package/dist/memory/backends/github.d.ts.map +1 -0
- package/dist/memory/backends/github.js +134 -0
- package/dist/memory/backends/github.js.map +1 -0
- package/dist/memory/backends/qdrant-cloud.d.ts +32 -0
- package/dist/memory/backends/qdrant-cloud.d.ts.map +1 -0
- package/dist/memory/backends/qdrant-cloud.js +167 -0
- package/dist/memory/backends/qdrant-cloud.js.map +1 -0
- package/dist/memory/context-compressor.d.ts +116 -0
- package/dist/memory/context-compressor.d.ts.map +1 -0
- package/dist/memory/context-compressor.js +430 -0
- package/dist/memory/context-compressor.js.map +1 -0
- package/dist/memory/context-pruner.d.ts +55 -0
- package/dist/memory/context-pruner.d.ts.map +1 -0
- package/dist/memory/context-pruner.js +85 -0
- package/dist/memory/context-pruner.js.map +1 -0
- package/dist/memory/correction-propagator.d.ts +44 -0
- package/dist/memory/correction-propagator.d.ts.map +1 -0
- package/dist/memory/correction-propagator.js +156 -0
- package/dist/memory/correction-propagator.js.map +1 -0
- package/dist/memory/daily-log.d.ts +67 -0
- package/dist/memory/daily-log.d.ts.map +1 -0
- package/dist/memory/daily-log.js +143 -0
- package/dist/memory/daily-log.js.map +1 -0
- package/dist/memory/dynamic-retrieval.d.ts +112 -0
- package/dist/memory/dynamic-retrieval.d.ts.map +1 -0
- package/dist/memory/dynamic-retrieval.js +908 -0
- package/dist/memory/dynamic-retrieval.js.map +1 -0
- package/dist/memory/embeddings.d.ts +172 -0
- package/dist/memory/embeddings.d.ts.map +1 -0
- package/dist/memory/embeddings.js +780 -0
- package/dist/memory/embeddings.js.map +1 -0
- package/dist/memory/generic-uap-patterns.d.ts +7 -0
- package/dist/memory/generic-uap-patterns.d.ts.map +1 -0
- package/dist/memory/generic-uap-patterns.js +43 -0
- package/dist/memory/generic-uap-patterns.js.map +1 -0
- package/dist/memory/hierarchical-memory.d.ts +141 -0
- package/dist/memory/hierarchical-memory.d.ts.map +1 -0
- package/dist/memory/hierarchical-memory.js +485 -0
- package/dist/memory/hierarchical-memory.js.map +1 -0
- package/dist/memory/knowledge-graph.d.ts +98 -0
- package/dist/memory/knowledge-graph.d.ts.map +1 -0
- package/dist/memory/knowledge-graph.js +275 -0
- package/dist/memory/knowledge-graph.js.map +1 -0
- package/dist/memory/memory-consolidator.d.ts +124 -0
- package/dist/memory/memory-consolidator.d.ts.map +1 -0
- package/dist/memory/memory-consolidator.js +514 -0
- package/dist/memory/memory-consolidator.js.map +1 -0
- package/dist/memory/memory-maintenance.d.ts +39 -0
- package/dist/memory/memory-maintenance.d.ts.map +1 -0
- package/dist/memory/memory-maintenance.js +336 -0
- package/dist/memory/memory-maintenance.js.map +1 -0
- package/dist/memory/model-router.d.ts +105 -0
- package/dist/memory/model-router.d.ts.map +1 -0
- package/dist/memory/model-router.js +474 -0
- package/dist/memory/model-router.js.map +1 -0
- package/dist/memory/multi-view-memory.d.ts +134 -0
- package/dist/memory/multi-view-memory.d.ts.map +1 -0
- package/dist/memory/multi-view-memory.js +430 -0
- package/dist/memory/multi-view-memory.js.map +1 -0
- package/dist/memory/predictive-memory.d.ts +79 -0
- package/dist/memory/predictive-memory.d.ts.map +1 -0
- package/dist/memory/predictive-memory.js +294 -0
- package/dist/memory/predictive-memory.js.map +1 -0
- package/dist/memory/prepopulate.d.ts +76 -0
- package/dist/memory/prepopulate.d.ts.map +1 -0
- package/dist/memory/prepopulate.js +832 -0
- package/dist/memory/prepopulate.js.map +1 -0
- package/dist/memory/semantic-compression.d.ts +77 -0
- package/dist/memory/semantic-compression.d.ts.map +1 -0
- package/dist/memory/semantic-compression.js +359 -0
- package/dist/memory/semantic-compression.js.map +1 -0
- package/dist/memory/serverless-qdrant.d.ts +102 -0
- package/dist/memory/serverless-qdrant.d.ts.map +1 -0
- package/dist/memory/serverless-qdrant.js +369 -0
- package/dist/memory/serverless-qdrant.js.map +1 -0
- package/dist/memory/short-term/factory.d.ts +26 -0
- package/dist/memory/short-term/factory.d.ts.map +1 -0
- package/dist/memory/short-term/factory.js +28 -0
- package/dist/memory/short-term/factory.js.map +1 -0
- package/dist/memory/short-term/indexeddb.d.ts +25 -0
- package/dist/memory/short-term/indexeddb.d.ts.map +1 -0
- package/dist/memory/short-term/indexeddb.js +64 -0
- package/dist/memory/short-term/indexeddb.js.map +1 -0
- package/dist/memory/short-term/schema.d.ts +6 -0
- package/dist/memory/short-term/schema.d.ts.map +1 -0
- package/dist/memory/short-term/schema.js +141 -0
- package/dist/memory/short-term/schema.js.map +1 -0
- package/dist/memory/short-term/sqlite.d.ts +64 -0
- package/dist/memory/short-term/sqlite.d.ts.map +1 -0
- package/dist/memory/short-term/sqlite.js +274 -0
- package/dist/memory/short-term/sqlite.js.map +1 -0
- package/dist/memory/speculative-cache.d.ts +111 -0
- package/dist/memory/speculative-cache.d.ts.map +1 -0
- package/dist/memory/speculative-cache.js +457 -0
- package/dist/memory/speculative-cache.js.map +1 -0
- package/dist/memory/task-classifier.d.ts +40 -0
- package/dist/memory/task-classifier.d.ts.map +1 -0
- package/dist/memory/task-classifier.js +342 -0
- package/dist/memory/task-classifier.js.map +1 -0
- package/dist/memory/terminal-bench-knowledge.d.ts +48 -0
- package/dist/memory/terminal-bench-knowledge.d.ts.map +1 -0
- package/dist/memory/terminal-bench-knowledge.js +622 -0
- package/dist/memory/terminal-bench-knowledge.js.map +1 -0
- package/dist/memory/write-gate.d.ts +39 -0
- package/dist/memory/write-gate.d.ts.map +1 -0
- package/dist/memory/write-gate.js +190 -0
- package/dist/memory/write-gate.js.map +1 -0
- package/dist/models/api-client.d.ts +46 -0
- package/dist/models/api-client.d.ts.map +1 -0
- package/dist/models/api-client.js +182 -0
- package/dist/models/api-client.js.map +1 -0
- package/dist/models/execution-profiles.d.ts +64 -0
- package/dist/models/execution-profiles.d.ts.map +1 -0
- package/dist/models/execution-profiles.js +403 -0
- package/dist/models/execution-profiles.js.map +1 -0
- package/dist/models/executor.d.ts +130 -0
- package/dist/models/executor.d.ts.map +1 -0
- package/dist/models/executor.js +382 -0
- package/dist/models/executor.js.map +1 -0
- package/dist/models/index.d.ts +19 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +23 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/plan-validator.d.ts +37 -0
- package/dist/models/plan-validator.d.ts.map +1 -0
- package/dist/models/plan-validator.js +179 -0
- package/dist/models/plan-validator.js.map +1 -0
- package/dist/models/planner.d.ts +73 -0
- package/dist/models/planner.d.ts.map +1 -0
- package/dist/models/planner.js +375 -0
- package/dist/models/planner.js.map +1 -0
- package/dist/models/router.d.ts +96 -0
- package/dist/models/router.d.ts.map +1 -0
- package/dist/models/router.js +523 -0
- package/dist/models/router.js.map +1 -0
- package/dist/models/types.d.ts +370 -0
- package/dist/models/types.d.ts.map +1 -0
- package/dist/models/types.js +232 -0
- package/dist/models/types.js.map +1 -0
- package/dist/models/unified-router.d.ts +152 -0
- package/dist/models/unified-router.d.ts.map +1 -0
- package/dist/models/unified-router.js +313 -0
- package/dist/models/unified-router.js.map +1 -0
- package/dist/policies/convert-policy-to-claude.d.ts +3 -0
- package/dist/policies/convert-policy-to-claude.d.ts.map +1 -0
- package/dist/policies/convert-policy-to-claude.js +87 -0
- package/dist/policies/convert-policy-to-claude.js.map +1 -0
- package/dist/policies/database-manager.d.ts +27 -0
- package/dist/policies/database-manager.d.ts.map +1 -0
- package/dist/policies/database-manager.js +198 -0
- package/dist/policies/database-manager.js.map +1 -0
- package/dist/policies/enforced-tool-router.d.ts +53 -0
- package/dist/policies/enforced-tool-router.d.ts.map +1 -0
- package/dist/policies/enforced-tool-router.js +80 -0
- package/dist/policies/enforced-tool-router.js.map +1 -0
- package/dist/policies/index.d.ts +10 -0
- package/dist/policies/index.d.ts.map +1 -0
- package/dist/policies/index.js +8 -0
- package/dist/policies/index.js.map +1 -0
- package/dist/policies/policy-gate.d.ts +59 -0
- package/dist/policies/policy-gate.d.ts.map +1 -0
- package/dist/policies/policy-gate.js +171 -0
- package/dist/policies/policy-gate.js.map +1 -0
- package/dist/policies/policy-memory.d.ts +18 -0
- package/dist/policies/policy-memory.d.ts.map +1 -0
- package/dist/policies/policy-memory.js +126 -0
- package/dist/policies/policy-memory.js.map +1 -0
- package/dist/policies/policy-tools.d.ts +11 -0
- package/dist/policies/policy-tools.d.ts.map +1 -0
- package/dist/policies/policy-tools.js +66 -0
- package/dist/policies/policy-tools.js.map +1 -0
- package/dist/policies/schemas/policy.d.ts +69 -0
- package/dist/policies/schemas/policy.d.ts.map +1 -0
- package/dist/policies/schemas/policy.js +31 -0
- package/dist/policies/schemas/policy.js.map +1 -0
- package/dist/tasks/coordination.d.ts +83 -0
- package/dist/tasks/coordination.d.ts.map +1 -0
- package/dist/tasks/coordination.js +291 -0
- package/dist/tasks/coordination.js.map +1 -0
- package/dist/tasks/database.d.ts +19 -0
- package/dist/tasks/database.d.ts.map +1 -0
- package/dist/tasks/database.js +149 -0
- package/dist/tasks/database.js.map +1 -0
- package/dist/tasks/decoder-gate.d.ts +64 -0
- package/dist/tasks/decoder-gate.d.ts.map +1 -0
- package/dist/tasks/decoder-gate.js +268 -0
- package/dist/tasks/decoder-gate.js.map +1 -0
- package/dist/tasks/index.d.ts +6 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +6 -0
- package/dist/tasks/index.js.map +1 -0
- package/dist/tasks/service.d.ts +40 -0
- package/dist/tasks/service.d.ts.map +1 -0
- package/dist/tasks/service.js +671 -0
- package/dist/tasks/service.js.map +1 -0
- package/dist/tasks/types.d.ts +238 -0
- package/dist/tasks/types.d.ts.map +1 -0
- package/dist/tasks/types.js +74 -0
- package/dist/tasks/types.js.map +1 -0
- package/dist/telemetry/index.d.ts +2 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +2 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/session-telemetry.d.ts +56 -0
- package/dist/telemetry/session-telemetry.d.ts.map +1 -0
- package/dist/telemetry/session-telemetry.js +807 -0
- package/dist/telemetry/session-telemetry.js.map +1 -0
- package/dist/types/analysis.d.ts +82 -0
- package/dist/types/analysis.d.ts.map +1 -0
- package/dist/types/analysis.js +2 -0
- package/dist/types/analysis.js.map +1 -0
- package/dist/types/config.d.ts +3324 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +418 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/coordination.d.ts +240 -0
- package/dist/types/coordination.d.ts.map +1 -0
- package/dist/types/coordination.js +43 -0
- package/dist/types/coordination.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/uap-droids-strict.d.ts +59 -0
- package/dist/uap-droids-strict.d.ts.map +1 -0
- package/dist/uap-droids-strict.js +200 -0
- package/dist/uap-droids-strict.js.map +1 -0
- package/dist/utils/config-manager.d.ts +30 -0
- package/dist/utils/config-manager.d.ts.map +1 -0
- package/dist/utils/config-manager.js +41 -0
- package/dist/utils/config-manager.js.map +1 -0
- package/dist/utils/fetch-with-retry.d.ts +5 -0
- package/dist/utils/fetch-with-retry.d.ts.map +1 -0
- package/dist/utils/fetch-with-retry.js +61 -0
- package/dist/utils/fetch-with-retry.js.map +1 -0
- package/dist/utils/merge-claude-md.d.ts +28 -0
- package/dist/utils/merge-claude-md.d.ts.map +1 -0
- package/dist/utils/merge-claude-md.js +342 -0
- package/dist/utils/merge-claude-md.js.map +1 -0
- package/dist/utils/rate-limiter.d.ts +58 -0
- package/dist/utils/rate-limiter.d.ts.map +1 -0
- package/dist/utils/rate-limiter.js +100 -0
- package/dist/utils/rate-limiter.js.map +1 -0
- package/dist/utils/string-similarity.d.ts +37 -0
- package/dist/utils/string-similarity.d.ts.map +1 -0
- package/dist/utils/string-similarity.js +114 -0
- package/dist/utils/string-similarity.js.map +1 -0
- package/dist/utils/validate-json.d.ts +51 -0
- package/dist/utils/validate-json.d.ts.map +1 -0
- package/dist/utils/validate-json.js +94 -0
- package/dist/utils/validate-json.js.map +1 -0
- package/docs/INDEX.md +66 -0
- package/docs/architecture/MULTI_MODEL.md +224 -0
- package/docs/architecture/SYSTEM_ANALYSIS.md +1117 -0
- package/docs/architecture/UAP_COMPLIANCE.md +217 -0
- package/docs/architecture/UAP_PROTOCOL.md +339 -0
- package/docs/architecture/UAP_STRICT_DROIDS.md +172 -0
- package/docs/archive/BALLS_MODE_SELF_ANALYSIS.md +260 -0
- package/docs/archive/FAILING_TASKS_SOLUTION_PLAN.md +668 -0
- package/docs/archive/JINJA2-SYSTEM-MESSAGE-FIX.md +209 -0
- package/docs/archive/NPM-PUBLISH-V0.9.1.md +240 -0
- package/docs/archive/OPTIMIZATION_OPTIONS.md +334 -0
- package/docs/archive/SETUP_IMPROVEMENTS.md +213 -0
- package/docs/archive/UAP_GENERIC_OPTIMIZATION_PLAN.md +270 -0
- package/docs/archive/UAP_V103_PATTERN_DESIGN.md +315 -0
- package/docs/archive/UAP_V104_COMPLIANCE_DESIGN.md +223 -0
- package/docs/archive/changelog/2026-03-10_uap-100-compliance.md +77 -0
- package/docs/archive/changelog/2026-03-10_uap-full-system-verification.md +109 -0
- package/docs/benchmarks/ACCURACY_ANALYSIS.md +471 -0
- package/docs/benchmarks/TOKEN_OPTIMIZATION.md +572 -0
- package/docs/benchmarks/VALIDATION_PLAN.md +568 -0
- package/docs/benchmarks/VALIDATION_RESULTS.md +161 -0
- package/docs/deployment/DEPLOYMENT.md +895 -0
- package/docs/deployment/DEPLOYMENT_STRATEGIES.md +518 -0
- package/docs/deployment/DEPLOY_BATCHER_ANALYSIS.md +856 -0
- package/docs/deployment/DEPLOY_BATCHING.md +273 -0
- package/docs/deployment/DEPLOY_BUCKETING_ANALYSIS.md +420 -0
- package/docs/deployment/QWEN35_LLAMA_CPP.md +265 -0
- package/docs/getting-started/INTEGRATION.md +449 -0
- package/docs/getting-started/OVERVIEW.md +344 -0
- package/docs/getting-started/SETUP.md +203 -0
- package/docs/integrations/MCP_ROUTER_SETUP.md +445 -0
- package/docs/integrations/RTK_INTEGRATION.md +468 -0
- package/docs/operations/TROUBLESHOOTING.md +660 -0
- package/docs/reference/API_REFERENCE.md +903 -0
- package/docs/reference/FEATURES.md +472 -0
- package/docs/reference/HARNESS-MATRIX.md +318 -0
- package/docs/reference/UAP_CLI_REFERENCE.md +600 -0
- package/docs/research/BEHAVIORAL_PATTERNS.md +228 -0
- package/docs/research/DOMAIN_STRATEGIES.md +316 -0
- package/docs/research/MEMORY_SYSTEMS_COMPARISON.md +812 -0
- package/docs/research/PATTERN_ANALYSIS_2026-01-18.md +436 -0
- package/docs/research/PERFORMANCE_ANALYSIS_2026-01-18.md +209 -0
- package/docs/research/PERFORMANCE_TEST_PLAN.md +383 -0
- package/docs/research/TERMINAL_BENCH_LEARNINGS.md +217 -0
- package/package.json +113 -0
- package/scripts/README.md +161 -0
- package/templates/CLAUDE.template.md +10 -0
- package/templates/CLAUDE_ARCHITECTURE.template.md +103 -0
- package/templates/CLAUDE_CODING.template.md +127 -0
- package/templates/CLAUDE_DROIDS.template.md +109 -0
- package/templates/CLAUDE_MEMORY.template.md +131 -0
- package/templates/CLAUDE_WORKFLOWS.template.md +139 -0
- package/templates/PROJECT.template.md +209 -0
- package/templates/SCHEMA.md +57 -0
- package/templates/archive/CLAUDE.template.root-v6.md +534 -0
- package/templates/archive/CLAUDE.template.v6.md +534 -0
- package/templates/hooks/forgecode/pre-compact.sh +68 -0
- package/templates/hooks/forgecode/session-start.sh +169 -0
- package/templates/hooks/forgecode.plugin.sh +128 -0
- package/templates/hooks/pre-compact.sh +74 -0
- package/templates/hooks/session-start.sh +366 -0
- package/tools/agents/README.md +224 -0
- package/tools/agents/UAP/README.md +386 -0
- package/tools/agents/UAP/__init__.py +9 -0
- package/tools/agents/UAP/cli.py +901 -0
- package/tools/agents/UAP/compliance_verify.sh +108 -0
- package/tools/agents/UAP/full_verification.sh +126 -0
- package/tools/agents/UAP/version.py +32 -0
- package/tools/agents/benchmarks/benchmark_memory_systems.py +730 -0
- package/tools/agents/benchmarks/results/benchmark_20260106_064817.json +170 -0
- package/tools/agents/benchmarks/results/benchmark_20260106_064817.md +51 -0
- package/tools/agents/config/chat_template.jinja +77 -0
- package/tools/agents/config/tool-call-schema.json +19 -0
- package/tools/agents/config/tool-call.gbnf +58 -0
- package/tools/agents/docker/Dockerfile.python +52 -0
- package/tools/agents/docker/Dockerfile.ubuntu +55 -0
- package/tools/agents/docker-compose.qdrant.yml +24 -0
- package/tools/agents/install-opencode-local.sh.j2 +135 -0
- package/tools/agents/migrations/apply.py +256 -0
- package/tools/agents/opencode_uap_agent.py +1505 -0
- package/tools/agents/plugin/README.md +91 -0
- package/tools/agents/plugin/index.ts +46 -0
- package/tools/agents/plugin/pre-compact.sh +68 -0
- package/tools/agents/plugin/session-start.sh +175 -0
- package/tools/agents/plugin/uap-commands.ts +45 -0
- package/tools/agents/plugin/uap-droids.ts +54 -0
- package/tools/agents/plugin/uap-patterns.ts +54 -0
- package/tools/agents/plugin/uap-skills.ts +52 -0
- package/tools/agents/plugins/uap-enforce.ts +314 -0
- package/tools/agents/scripts/__pycache__/tool_call_wrapper.cpython-313.pyc +0 -0
- package/tools/agents/scripts/chat_template_verifier.py +343 -0
- package/tools/agents/scripts/fix-qwen-template.js +38 -0
- package/tools/agents/scripts/fix_qwen_chat_template.py +316 -0
- package/tools/agents/scripts/generate_lora_training_data.py +412 -0
- package/tools/agents/scripts/init_qdrant.py +151 -0
- package/tools/agents/scripts/memory_migration.py +560 -0
- package/tools/agents/scripts/migrate_memory_to_qdrant.py +110 -0
- package/tools/agents/scripts/prepare_lora.sh +512 -0
- package/tools/agents/scripts/query_memory.py +200 -0
- package/tools/agents/scripts/qwen-tool-call-test.js +38 -0
- package/tools/agents/scripts/qwen-tool-call-wrapper.js +38 -0
- package/tools/agents/scripts/qwen_tool_call_test.py +464 -0
- package/tools/agents/scripts/qwen_tool_call_wrapper.py +686 -0
- package/tools/agents/scripts/start-services.sh +96 -0
- package/tools/agents/scripts/tool-choice-proxy.cjs +296 -0
- package/tools/agents/scripts/tool_call_test.py +656 -0
- package/tools/agents/scripts/tool_call_wrapper.py +799 -0
- package/tools/agents/tests/test_uap_compliance.py +257 -0
- package/tools/agents/uap_agent.py +122 -0
- package/tools/agents/uap_agent_install.sh +12 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# UAP Deviation Fixes - Implementation Plan
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
This document outlines options to fix minor deviations from strict UAP compliance identified in the qwen35-a3b-iq4xs implementation.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Deviation #1: Markdown Frontmatter vs JSON Schema
|
|
9
|
+
|
|
10
|
+
### Current State (Non-Compliant)
|
|
11
|
+
Droids use YAML frontmatter for metadata:
|
|
12
|
+
```yaml
|
|
13
|
+
---
|
|
14
|
+
name: code-quality-guardian
|
|
15
|
+
description: Proactive code quality enforcer...
|
|
16
|
+
model: inherit
|
|
17
|
+
coordination:
|
|
18
|
+
channels: ["review", "broadcast"]
|
|
19
|
+
claims: ["exclusive"]
|
|
20
|
+
---
|
|
21
|
+
# Instructions here...
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Option A: Strict JSON Schema (Recommended) ✅
|
|
25
|
+
**Pros:** Machine-parsable, type-safe, validates against schema
|
|
26
|
+
**Cons:** Less human-readable for quick edits
|
|
27
|
+
|
|
28
|
+
**Implementation:**
|
|
29
|
+
- Convert `.factory/droids/*.md` to use embedded JSON in frontmatter
|
|
30
|
+
- Add schema validation during droid discovery via `discoverDroids()`
|
|
31
|
+
- Example:
|
|
32
|
+
```json
|
|
33
|
+
---
|
|
34
|
+
{
|
|
35
|
+
"name": "code-quality-guardian",
|
|
36
|
+
"description": "...",
|
|
37
|
+
"model": "inherit",
|
|
38
|
+
"coordination": {
|
|
39
|
+
"channels": ["review", "broadcast"],
|
|
40
|
+
"claims": ["exclusive"]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
---
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Files to modify:**
|
|
47
|
+
- `src/cli/droids.ts` - Add JSON validation in `addDroid()`
|
|
48
|
+
- `.opencode/plugin/uap-droids.ts` - Update parser with Zod schema
|
|
49
|
+
- Existing droids: Migrate one at a time as template for others
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### Option B: Hybrid Format (Balanced) ⚠️
|
|
54
|
+
**Pros:** Retains YAML readability, adds JSON validation layer
|
|
55
|
+
**Cons:** Slightly more complex parsing
|
|
56
|
+
|
|
57
|
+
**Implementation:**
|
|
58
|
+
- Keep YAML frontmatter but add required `@schema` directive in body
|
|
59
|
+
- Example:
|
|
60
|
+
```yaml
|
|
61
|
+
---
|
|
62
|
+
name: code-quality-guardian
|
|
63
|
+
description: ...
|
|
64
|
+
model: inherit
|
|
65
|
+
coordination:
|
|
66
|
+
channels: ["review", "broadcast"]
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
@schema {
|
|
70
|
+
"$ref": "#/definitions/DroidSchema"
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
# Instructions here...
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Files to modify:**
|
|
77
|
+
- `.opencode/plugin/uap-droids.ts` - Add schema directive parser
|
|
78
|
+
- `src/types/config.ts` - Define DroidSchema in TypeScript
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Deviation #2: Missing Decoder-First Gate
|
|
83
|
+
|
|
84
|
+
### Current State (Partial Implementation)
|
|
85
|
+
CLAUDE.md mentions "DECODER-FIRST GATE" but no explicit implementation exists. The system relies on implicit validation via memory checks and worktrees.
|
|
86
|
+
|
|
87
|
+
### Option A: Explicit Pre-Execution Validator ✅
|
|
88
|
+
**Pros:** Clear separation of concerns, easy to test
|
|
89
|
+
**Cons:** Adds one extra step before task execution
|
|
90
|
+
|
|
91
|
+
**Implementation:**
|
|
92
|
+
```typescript
|
|
93
|
+
// src/tasks/decoder-gate.ts
|
|
94
|
+
export async function validateDecoderFirst(
|
|
95
|
+
droidName: string,
|
|
96
|
+
taskContext: TaskContext
|
|
97
|
+
): Promise<ValidationResult> {
|
|
98
|
+
// Step 1: Verify model can parse droid instructions
|
|
99
|
+
const schemaValid = await validateSchema(droidMeta);
|
|
100
|
+
|
|
101
|
+
// Step 2: Check required tools are available
|
|
102
|
+
const toolAvailability = checkToolAccess(droidMeta.tools);
|
|
103
|
+
|
|
104
|
+
// Step 3: Validate coordination claims don't conflict
|
|
105
|
+
const conflicts = await detectCoordinationConflicts(
|
|
106
|
+
droidName,
|
|
107
|
+
taskContext.agentId
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
return { valid: schemaValid && toolAvailability && !conflicts };
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Files to modify:**
|
|
115
|
+
- `src/tasks/decoder-gate.ts` (new file)
|
|
116
|
+
- `.opencode/plugin/uap-droids.ts` - Call gate before invocation
|
|
117
|
+
- Add test in `tests/droids-parallel.test.ts`
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
### Option B: Implicit Gate via Memory Pre-check ⚠️
|
|
122
|
+
**Pros:** No new code, leverages existing memory system
|
|
123
|
+
**Cons:** Less explicit, harder to trace failures
|
|
124
|
+
|
|
125
|
+
**Implementation:**
|
|
126
|
+
```typescript
|
|
127
|
+
// Modify uap_droid_invoke in .opencode/plugin/uap-droids.ts
|
|
128
|
+
async execute({ droid, task }) {
|
|
129
|
+
const validation = await validateMemoryContext(droid);
|
|
130
|
+
if (!validation.valid) return validation.error;
|
|
131
|
+
|
|
132
|
+
// Proceed with normal invocation...
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Deviation #3: Optional Worktree Creation ✅ (Already Compliant-ish)
|
|
139
|
+
|
|
140
|
+
### Current State
|
|
141
|
+
Worktrees are recommended but not enforced (`[ ] MANDATORY` in droid instructions).
|
|
142
|
+
|
|
143
|
+
### Option A: Enforce via Pre-Check Hook 🔧
|
|
144
|
+
**Pros:** Ensures consistency, prevents race conditions
|
|
145
|
+
**Cons:** Slightly slower execution
|
|
146
|
+
|
|
147
|
+
**Implementation:**
|
|
148
|
+
```typescript
|
|
149
|
+
// In .opencode/plugin/uap-droids.ts - before invoke
|
|
150
|
+
const worktree = await ensureWorktree(droidName);
|
|
151
|
+
if (!worktree) {
|
|
152
|
+
throw new Error(`Droid ${droid} requires active worktree`);
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Recommended Implementation Path
|
|
159
|
+
|
|
160
|
+
### Phase 1: JSON Schema Enforcement (Week 1)
|
|
161
|
+
1. Update `discoverDroids()` with Zod schema validation
|
|
162
|
+
2. Convert code-quality-guardian to strict format as template
|
|
163
|
+
3. Add migration script for existing droids
|
|
164
|
+
|
|
165
|
+
**Files:**
|
|
166
|
+
- `.opencode/plugin/uap-droids.ts`
|
|
167
|
+
- `src/cli/droids.ts` (add --strict flag)
|
|
168
|
+
|
|
169
|
+
### Phase 2: Decoder Gate Implementation (Week 1-2)
|
|
170
|
+
1. Create `src/tasks/decoder-gate.ts` with validation logic
|
|
171
|
+
2. Integrate into droid invocation flow
|
|
172
|
+
3. Add unit tests for gate scenarios
|
|
173
|
+
|
|
174
|
+
**Files:**
|
|
175
|
+
- New file: `src/tasks/decoder-gate.ts`
|
|
176
|
+
- `.opencode/plugin/uap-droids.ts` (integration)
|
|
177
|
+
|
|
178
|
+
### Phase 3: Worktree Enforcement (Week 2)
|
|
179
|
+
1. Modify `claim()` in coordination to require worktree
|
|
180
|
+
2. Add warning for optional droids without enforcement
|
|
181
|
+
3. Update CLI help text
|
|
182
|
+
|
|
183
|
+
**Files:**
|
|
184
|
+
- `src/tasks/coordination.ts` - update claim() logic
|
|
185
|
+
- `src/cli/droids.ts` - add --require-worktree flag
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Testing Strategy
|
|
190
|
+
|
|
191
|
+
### Parallel Droid Test Enhancement
|
|
192
|
+
```typescript
|
|
193
|
+
// Add to tests/droids-parallel.test.ts
|
|
194
|
+
it('validates decoder-first gate for all droids', async () => {
|
|
195
|
+
const invalidDroid = 'non-existent-droid';
|
|
196
|
+
await expect(validateDecoderFirst(invalidDroid)).rejects.toThrow();
|
|
197
|
+
|
|
198
|
+
const validDroid = 'code-quality-guardian';
|
|
199
|
+
await expect(validateDecoderFirst(validDroid)).resolves.toBe(true);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
it('enforces worktree creation for strict droids', async () => {
|
|
203
|
+
await expect(claimTaskWithoutWorktree()).rejects.toThrow();
|
|
204
|
+
});
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Compliance Score After Fixes
|
|
210
|
+
|
|
211
|
+
| Metric | Current | Target | Gap |
|
|
212
|
+
|--------|---------|--------|-----|
|
|
213
|
+
| Schema validation | YAML frontmatter | JSON + Zod | ✅ Fixable in Phase 1 |
|
|
214
|
+
| Decoder-first gate | Implicit | Explicit validator | ⚠️ Needs implementation |
|
|
215
|
+
| Worktree enforcement | Optional → Recommended | Mandatory (configurable) | 🔧 Easy fix |
|
|
216
|
+
|
|
217
|
+
**Overall: ~85% compliant now, will reach 95-98% after fixes.**
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
# Universal Agent Memory (UAP) Protocol v1.0
|
|
2
|
+
|
|
3
|
+
**Status:** ✅ Production Ready
|
|
4
|
+
**Criticality:** 🚨 LIFE OR DEATH - Payment System
|
|
5
|
+
**Compliance Target:** 100%
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Executive Summary
|
|
10
|
+
|
|
11
|
+
The UAP Protocol provides a standardized framework for agent memory management, ensuring consistency, reliability, and auditability across all autonomous agent sessions. This is **not optional** - it's a critical safety requirement for the Universal Agent Memory platform.
|
|
12
|
+
|
|
13
|
+
### Why 100% Compliance Matters
|
|
14
|
+
|
|
15
|
+
| Risk | Impact | Mitigation |
|
|
16
|
+
| --------------------- | ------------------------------- | ----------------------------------- |
|
|
17
|
+
| Lost context | Failed payments, duplicate work | Memory database with FTS5 search |
|
|
18
|
+
| Race conditions | Data corruption | Coordination DB with agent registry |
|
|
19
|
+
| Stale sessions | Resource leaks | Heartbeat monitoring + auto-cleanup |
|
|
20
|
+
| Non-reproducible work | Debugging nightmares | Worktree isolation + audit trail |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Architecture Overview
|
|
25
|
+
|
|
26
|
+
### Four-Layer Memory System
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
┌─────────────────────────────────────────────────────┐
|
|
30
|
+
│ L4: Knowledge Graph (entities, relationships) │
|
|
31
|
+
│ - Semantic understanding │
|
|
32
|
+
│ - Context preservation │
|
|
33
|
+
├─────────────────────────────────────────────────────┤
|
|
34
|
+
│ L3: Semantic Memory (Qdrant vectors) │
|
|
35
|
+
│ - Vector-based search │
|
|
36
|
+
│ - Similarity matching │
|
|
37
|
+
├─────────────────────────────────────────────────────┤
|
|
38
|
+
│ L2: Session Memories (high-importance decisions) │
|
|
39
|
+
│ - Critical decisions │
|
|
40
|
+
│ - Importance ≥ 7 │
|
|
41
|
+
├─────────────────────────────────────────────────────┤
|
|
42
|
+
│ L1: Working Memory (memories table, FTS5 index) │
|
|
43
|
+
│ - Recent actions, observations, thoughts │
|
|
44
|
+
│ - Full-text search │
|
|
45
|
+
└─────────────────────────────────────────────────────┘
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Core Components
|
|
51
|
+
|
|
52
|
+
### 1. UAP CLI (`tools/agents/uap/cli.py`)
|
|
53
|
+
|
|
54
|
+
The single source of truth for all memory operations.
|
|
55
|
+
|
|
56
|
+
**Mandatory Commands:**
|
|
57
|
+
|
|
58
|
+
- `uap task ready` - Verify system readiness
|
|
59
|
+
- `uap session start` / `end` - Session lifecycle
|
|
60
|
+
- `uap memory query` - Context retrieval
|
|
61
|
+
- `uap worktree create` - Isolated development
|
|
62
|
+
- `uap compliance check` - Protocol verification
|
|
63
|
+
|
|
64
|
+
### 2. Database Schema (`agents/data/memory/short_term.db`)
|
|
65
|
+
|
|
66
|
+
**Tables:**
|
|
67
|
+
|
|
68
|
+
- `memories` - All agent activity
|
|
69
|
+
- `session_memories` - High-importance decisions
|
|
70
|
+
- `entities` - Knowledge graph nodes
|
|
71
|
+
- `relationships` - Knowledge graph edges
|
|
72
|
+
- `memories_fts` - Full-text search index
|
|
73
|
+
|
|
74
|
+
### 3. Coordination Database (`agents/data/coordination/coordination.db`)
|
|
75
|
+
|
|
76
|
+
**Tables:**
|
|
77
|
+
|
|
78
|
+
- `agent_registry` - Active agent tracking
|
|
79
|
+
- `work_claims` - Task ownership
|
|
80
|
+
- `work_announcements` - Cross-agent communication
|
|
81
|
+
- `agent_messages` - Inter-agent messaging
|
|
82
|
+
|
|
83
|
+
### 4. Qdrant Vector Database (Optional)
|
|
84
|
+
|
|
85
|
+
For semantic search and similarity matching.
|
|
86
|
+
|
|
87
|
+
**Collection:** `uap_memory`
|
|
88
|
+
**Vector Size:** 384 (all-MiniLM-L6-v2)
|
|
89
|
+
**Distance:** COSINE
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Protocol Workflow
|
|
94
|
+
|
|
95
|
+
### Session Lifecycle
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
1. uap session start ← Agent initialization
|
|
99
|
+
2. uap task ready ← Verify readiness
|
|
100
|
+
3. uap memory query "<topic>" ← Load context
|
|
101
|
+
4. [WORK PERFORMED] ← Using worktrees
|
|
102
|
+
5. uap task create action ... ← Log actions
|
|
103
|
+
6. uap session end ← Clean up
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Worktree Workflow
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
1. User request received
|
|
110
|
+
2. uap task create goal "Implement feature X"
|
|
111
|
+
3. uap worktree create fix-feature-x
|
|
112
|
+
4. cd .worktrees/NNN-fix-feature-x/
|
|
113
|
+
5. [Make changes]
|
|
114
|
+
6. git add . && git commit -m "..."
|
|
115
|
+
7. git push origin NNN-fix-feature-x
|
|
116
|
+
8. Create PR via: uap worktree ... (manual step)
|
|
117
|
+
9. After merge: uap worktree cleanup NNN
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Memory Storage Pattern
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
# During work
|
|
124
|
+
uap task create action "Analyzed payment flow"
|
|
125
|
+
uap memory store observation "Redis cache hit rate: 95%"
|
|
126
|
+
|
|
127
|
+
# High-importance decisions
|
|
128
|
+
sqlite3 ./agents/data/memory/short_term.db "
|
|
129
|
+
INSERT INTO session_memories
|
|
130
|
+
(session_id, timestamp, type, content, importance)
|
|
131
|
+
VALUES ('current', datetime('now'), 'decision',
|
|
132
|
+
'Chose PgDog over PgCat for connection pooling', 9)
|
|
133
|
+
"
|
|
134
|
+
|
|
135
|
+
# Store lessons learned
|
|
136
|
+
sqlite3 ./agents/data/memory/short_term.db "
|
|
137
|
+
INSERT INTO memories (timestamp, type, content)
|
|
138
|
+
VALUES (datetime('now'), 'lesson',
|
|
139
|
+
'Always check network policies before deploying Redis')
|
|
140
|
+
"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Compliance Checklist
|
|
146
|
+
|
|
147
|
+
### Pre-Session (MANDATORY)
|
|
148
|
+
|
|
149
|
+
- [ ] Run `uap task ready` - All systems operational
|
|
150
|
+
- [ ] Run `uap session start` - Initialize session ID
|
|
151
|
+
- [ ] Verify database exists: `ls agents/data/memory/short_term.db`
|
|
152
|
+
- [ ] Check coordination DB: `ls agents/data/coordination/coordination.db`
|
|
153
|
+
|
|
154
|
+
### During Work (MANDATORY)
|
|
155
|
+
|
|
156
|
+
- [ ] ALL changes in worktree: `uap worktree create <slug>`
|
|
157
|
+
- [ ] Log significant actions: `uap task create action "..."`
|
|
158
|
+
- [ ] Store decisions with importance ≥ 7
|
|
159
|
+
- [ ] Never modify files outside worktree
|
|
160
|
+
|
|
161
|
+
### Pre-Commit (MANDATORY)
|
|
162
|
+
|
|
163
|
+
- [ ] Review changes: `git diff --cached`
|
|
164
|
+
- [ ] Run tests if applicable
|
|
165
|
+
- [ ] Verify compliance: `uap compliance check`
|
|
166
|
+
- [ ] Check for secrets: `git diff --cached | grep -i secret`
|
|
167
|
+
|
|
168
|
+
### Post-Work (MANDATORY)
|
|
169
|
+
|
|
170
|
+
- [ ] End session: `uap session end`
|
|
171
|
+
- [ ] Clean up worktree after PR merge
|
|
172
|
+
- [ ] Store lesson in session_memories
|
|
173
|
+
- [ ] Update documentation if needed
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Critical Failure Modes & Recovery
|
|
178
|
+
|
|
179
|
+
### 1. Missing Memory Database
|
|
180
|
+
|
|
181
|
+
**Symptoms:** "Database not found" error
|
|
182
|
+
**Recovery:**
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
tools/agents/migrations/apply.py
|
|
186
|
+
uap compliance check
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### 2. Stale Agent in Coordination DB
|
|
190
|
+
|
|
191
|
+
**Symptoms:** Race conditions, duplicate work
|
|
192
|
+
**Detection:**
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
sqlite3 agents/data/coordination/coordination.db "
|
|
196
|
+
SELECT * FROM agent_registry
|
|
197
|
+
WHERE status='active' AND last_heartbeat < datetime('now','-24h')
|
|
198
|
+
"
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Recovery:** Session start hook auto-cleans stale agents
|
|
202
|
+
|
|
203
|
+
### 3. FTS Index Corruption
|
|
204
|
+
|
|
205
|
+
**Symptoms:** `uap memory query` returns no results
|
|
206
|
+
**Recovery:**
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
tools/agents/migrations/apply.py # Rebuilds index
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### 4. Worktree Orphaned
|
|
213
|
+
|
|
214
|
+
**Symptoms:** Worktree exists but PR merged elsewhere
|
|
215
|
+
**Detection:** `uap worktree list`
|
|
216
|
+
**Recovery:** `uap worktree cleanup <id>`
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Testing & Verification
|
|
221
|
+
|
|
222
|
+
### Run Compliance Tests
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
python3 tools/agents/tests/test_uap_compliance.py
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Expected output:
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
test_01_memory_database_exists... ✅
|
|
232
|
+
test_02_memories_table_exists... ✅
|
|
233
|
+
...
|
|
234
|
+
✅ ALL COMPLIANCE TESTS PASSED
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Manual Verification
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
# 1. Check database schema
|
|
241
|
+
sqlite3 agents/data/memory/short_term.db ".tables"
|
|
242
|
+
|
|
243
|
+
# 2. Verify FTS index
|
|
244
|
+
sqlite3 agents/data/memory/short_term.db "SELECT name FROM sqlite_master WHERE type='table' AND name='memories_fts'"
|
|
245
|
+
|
|
246
|
+
# 3. Test CLI commands
|
|
247
|
+
uap task ready
|
|
248
|
+
uap compliance check
|
|
249
|
+
|
|
250
|
+
# 4. Check coordination DB
|
|
251
|
+
sqlite3 agents/data/coordination/coordination.db ".tables"
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Security Considerations
|
|
257
|
+
|
|
258
|
+
### Data Protection
|
|
259
|
+
|
|
260
|
+
- **No secrets in memory:** Never store API keys, passwords, or tokens
|
|
261
|
+
- **Session isolation:** Each session has unique ID, no cross-contamination
|
|
262
|
+
- **Audit trail:** All actions logged with timestamps
|
|
263
|
+
|
|
264
|
+
### Access Control
|
|
265
|
+
|
|
266
|
+
- **CLI permissions:** Only authorized agents can execute UAP commands
|
|
267
|
+
- **Database locks:** SQLite WAL mode prevents concurrent writes
|
|
268
|
+
- **Coordination DB:** Agent registry enforces single-writer per task
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Performance Characteristics
|
|
273
|
+
|
|
274
|
+
| Operation | Latency | Notes |
|
|
275
|
+
| ---------------- | ------- | ---------------------- |
|
|
276
|
+
| Memory insert | < 1ms | SQLite in-memory cache |
|
|
277
|
+
| FTS search | < 10ms | Index-based lookup |
|
|
278
|
+
| Session start | < 5ms | UUID generation |
|
|
279
|
+
| Worktree create | ~2s | Git operation |
|
|
280
|
+
| Compliance check | < 50ms | Multiple DB queries |
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Migration Guide
|
|
285
|
+
|
|
286
|
+
### From Legacy System (Pre-UAP)
|
|
287
|
+
|
|
288
|
+
1. **Backup existing data:**
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
cp agents/data/memory/short_term.db agents/data/memory/short_term.db.backup
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
2. **Run migration:**
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
tools/agents/migrations/apply.py
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
3. **Update hooks:**
|
|
301
|
+
- Replace `sqlite3` commands with `uap` CLI
|
|
302
|
+
- Update `.claude/hooks/session-start.sh`
|
|
303
|
+
|
|
304
|
+
4. **Verify compliance:**
|
|
305
|
+
```bash
|
|
306
|
+
uap compliance check
|
|
307
|
+
python3 tools/agents/tests/test_uap_compliance.py
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## FAQ
|
|
313
|
+
|
|
314
|
+
**Q: Can I skip the worktree requirement?**
|
|
315
|
+
A: No. Worktrees provide isolation and audit trail. Skipping them violates critical safety protocols.
|
|
316
|
+
|
|
317
|
+
**Q: What if Qdrant is down?**
|
|
318
|
+
A: FTS5 index provides fallback search. Qdrant is optional for semantic search but recommended.
|
|
319
|
+
|
|
320
|
+
**Q: How do I handle multiple agents working on same task?**
|
|
321
|
+
A: Use coordination DB to claim work: `work_claims` table prevents duplicate efforts.
|
|
322
|
+
|
|
323
|
+
**Q: Can I use external memory systems (e.g., Redis)?**
|
|
324
|
+
A: Yes, as long as they sync with UAP database. Core protocol remains SQLite-based.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## References
|
|
329
|
+
|
|
330
|
+
- [UAP CLI Documentation](../tools/agents/uap/README.md)
|
|
331
|
+
- [Database Schema](../tools/agents/migrations/apply.py)
|
|
332
|
+
- [Compliance Tests](../tools/agents/tests/test_uap_compliance.py)
|
|
333
|
+
- [Session Start Hook](../../.claude/hooks/session-start.sh)
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
**Last Updated:** 2026-03-13
|
|
338
|
+
**Version:** 1.0.0
|
|
339
|
+
**Approved By:** UAP Architecture Review Board
|