limen-ai 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/CHANGELOG.md +47 -0
- package/LICENSE +190 -0
- package/README.md +546 -0
- package/dist/api/agents/agent_api.d.ts +126 -0
- package/dist/api/agents/agent_api.d.ts.map +1 -0
- package/dist/api/agents/agent_api.js +467 -0
- package/dist/api/agents/agent_api.js.map +1 -0
- package/dist/api/agents/trust_progression.d.ts +78 -0
- package/dist/api/agents/trust_progression.d.ts.map +1 -0
- package/dist/api/agents/trust_progression.js +124 -0
- package/dist/api/agents/trust_progression.js.map +1 -0
- package/dist/api/chat/chat_pipeline.d.ts +91 -0
- package/dist/api/chat/chat_pipeline.d.ts.map +1 -0
- package/dist/api/chat/chat_pipeline.js +630 -0
- package/dist/api/chat/chat_pipeline.js.map +1 -0
- package/dist/api/chat/technique_injector.d.ts +86 -0
- package/dist/api/chat/technique_injector.d.ts.map +1 -0
- package/dist/api/chat/technique_injector.js +125 -0
- package/dist/api/chat/technique_injector.js.map +1 -0
- package/dist/api/data/data_api.d.ts +91 -0
- package/dist/api/data/data_api.d.ts.map +1 -0
- package/dist/api/data/data_api.js +306 -0
- package/dist/api/data/data_api.js.map +1 -0
- package/dist/api/enforcement/cost_tracker.d.ts +105 -0
- package/dist/api/enforcement/cost_tracker.d.ts.map +1 -0
- package/dist/api/enforcement/cost_tracker.js +227 -0
- package/dist/api/enforcement/cost_tracker.js.map +1 -0
- package/dist/api/enforcement/latency_harness.d.ts +94 -0
- package/dist/api/enforcement/latency_harness.d.ts.map +1 -0
- package/dist/api/enforcement/latency_harness.js +120 -0
- package/dist/api/enforcement/latency_harness.js.map +1 -0
- package/dist/api/enforcement/rate_guard.d.ts +52 -0
- package/dist/api/enforcement/rate_guard.d.ts.map +1 -0
- package/dist/api/enforcement/rate_guard.js +79 -0
- package/dist/api/enforcement/rate_guard.js.map +1 -0
- package/dist/api/enforcement/rbac_guard.d.ts +55 -0
- package/dist/api/enforcement/rbac_guard.d.ts.map +1 -0
- package/dist/api/enforcement/rbac_guard.js +77 -0
- package/dist/api/enforcement/rbac_guard.js.map +1 -0
- package/dist/api/errors/limen_error.d.ts +81 -0
- package/dist/api/errors/limen_error.d.ts.map +1 -0
- package/dist/api/errors/limen_error.js +324 -0
- package/dist/api/errors/limen_error.js.map +1 -0
- package/dist/api/facades/claim_facade.d.ts +47 -0
- package/dist/api/facades/claim_facade.d.ts.map +1 -0
- package/dist/api/facades/claim_facade.js +67 -0
- package/dist/api/facades/claim_facade.js.map +1 -0
- package/dist/api/facades/working_memory_facade.d.ts +47 -0
- package/dist/api/facades/working_memory_facade.d.ts.map +1 -0
- package/dist/api/facades/working_memory_facade.js +74 -0
- package/dist/api/facades/working_memory_facade.js.map +1 -0
- package/dist/api/governance/governed_orchestration.d.ts +76 -0
- package/dist/api/governance/governed_orchestration.d.ts.map +1 -0
- package/dist/api/governance/governed_orchestration.js +413 -0
- package/dist/api/governance/governed_orchestration.js.map +1 -0
- package/dist/api/index.d.ts +84 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +847 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/infer/infer_pipeline.d.ts +51 -0
- package/dist/api/infer/infer_pipeline.d.ts.map +1 -0
- package/dist/api/infer/infer_pipeline.js +291 -0
- package/dist/api/infer/infer_pipeline.js.map +1 -0
- package/dist/api/interfaces/api.d.ts +940 -0
- package/dist/api/interfaces/api.d.ts.map +1 -0
- package/dist/api/interfaces/api.js +21 -0
- package/dist/api/interfaces/api.js.map +1 -0
- package/dist/api/knowledge/knowledge_api.d.ts +55 -0
- package/dist/api/knowledge/knowledge_api.d.ts.map +1 -0
- package/dist/api/knowledge/knowledge_api.js +89 -0
- package/dist/api/knowledge/knowledge_api.js.map +1 -0
- package/dist/api/migration/023_agent_persistence.d.ts +32 -0
- package/dist/api/migration/023_agent_persistence.d.ts.map +1 -0
- package/dist/api/migration/023_agent_persistence.js +158 -0
- package/dist/api/migration/023_agent_persistence.js.map +1 -0
- package/dist/api/migration/024_trust_learning.d.ts +36 -0
- package/dist/api/migration/024_trust_learning.d.ts.map +1 -0
- package/dist/api/migration/024_trust_learning.js +194 -0
- package/dist/api/migration/024_trust_learning.js.map +1 -0
- package/dist/api/migration/025_knowledge_graph.d.ts +29 -0
- package/dist/api/migration/025_knowledge_graph.d.ts.map +1 -0
- package/dist/api/migration/025_knowledge_graph.js +97 -0
- package/dist/api/migration/025_knowledge_graph.js.map +1 -0
- package/dist/api/migration/026_replay_pipeline.d.ts +30 -0
- package/dist/api/migration/026_replay_pipeline.d.ts.map +1 -0
- package/dist/api/migration/026_replay_pipeline.js +118 -0
- package/dist/api/migration/026_replay_pipeline.js.map +1 -0
- package/dist/api/missions/mission_api.d.ts +74 -0
- package/dist/api/missions/mission_api.d.ts.map +1 -0
- package/dist/api/missions/mission_api.js +408 -0
- package/dist/api/missions/mission_api.js.map +1 -0
- package/dist/api/observability/health.d.ts +36 -0
- package/dist/api/observability/health.d.ts.map +1 -0
- package/dist/api/observability/health.js +92 -0
- package/dist/api/observability/health.js.map +1 -0
- package/dist/api/observability/metrics.d.ts +95 -0
- package/dist/api/observability/metrics.d.ts.map +1 -0
- package/dist/api/observability/metrics.js +260 -0
- package/dist/api/observability/metrics.js.map +1 -0
- package/dist/api/roles/roles_api.d.ts +45 -0
- package/dist/api/roles/roles_api.d.ts.map +1 -0
- package/dist/api/roles/roles_api.js +77 -0
- package/dist/api/roles/roles_api.js.map +1 -0
- package/dist/api/sessions/session_manager.d.ts +110 -0
- package/dist/api/sessions/session_manager.d.ts.map +1 -0
- package/dist/api/sessions/session_manager.js +278 -0
- package/dist/api/sessions/session_manager.js.map +1 -0
- package/dist/budget/harness/dba_harness.d.ts +36 -0
- package/dist/budget/harness/dba_harness.d.ts.map +1 -0
- package/dist/budget/harness/dba_harness.js +58 -0
- package/dist/budget/harness/dba_harness.js.map +1 -0
- package/dist/budget/impl/dba_impl.d.ts +47 -0
- package/dist/budget/impl/dba_impl.d.ts.map +1 -0
- package/dist/budget/impl/dba_impl.js +402 -0
- package/dist/budget/impl/dba_impl.js.map +1 -0
- package/dist/budget/interfaces/dba_types.d.ts +708 -0
- package/dist/budget/interfaces/dba_types.d.ts.map +1 -0
- package/dist/budget/interfaces/dba_types.js +124 -0
- package/dist/budget/interfaces/dba_types.js.map +1 -0
- package/dist/claims/evidence/capability_scope_validator.d.ts +32 -0
- package/dist/claims/evidence/capability_scope_validator.d.ts.map +1 -0
- package/dist/claims/evidence/capability_scope_validator.js +72 -0
- package/dist/claims/evidence/capability_scope_validator.js.map +1 -0
- package/dist/claims/evidence/evidence_validator.d.ts +35 -0
- package/dist/claims/evidence/evidence_validator.d.ts.map +1 -0
- package/dist/claims/evidence/evidence_validator.js +118 -0
- package/dist/claims/evidence/evidence_validator.js.map +1 -0
- package/dist/claims/harness/claim_harness.d.ts +22 -0
- package/dist/claims/harness/claim_harness.d.ts.map +1 -0
- package/dist/claims/harness/claim_harness.js +26 -0
- package/dist/claims/harness/claim_harness.js.map +1 -0
- package/dist/claims/interfaces/claim_types.d.ts +858 -0
- package/dist/claims/interfaces/claim_types.d.ts.map +1 -0
- package/dist/claims/interfaces/claim_types.js +201 -0
- package/dist/claims/interfaces/claim_types.js.map +1 -0
- package/dist/claims/migration/019_ccp_claims.d.ts +23 -0
- package/dist/claims/migration/019_ccp_claims.d.ts.map +1 -0
- package/dist/claims/migration/019_ccp_claims.js +196 -0
- package/dist/claims/migration/019_ccp_claims.js.map +1 -0
- package/dist/claims/store/claim_stores.d.ts +27 -0
- package/dist/claims/store/claim_stores.d.ts.map +1 -0
- package/dist/claims/store/claim_stores.js +1352 -0
- package/dist/claims/store/claim_stores.js.map +1 -0
- package/dist/context/harness/cgp_harness.d.ts +32 -0
- package/dist/context/harness/cgp_harness.d.ts.map +1 -0
- package/dist/context/harness/cgp_harness.js +295 -0
- package/dist/context/harness/cgp_harness.js.map +1 -0
- package/dist/context/interfaces/cgp_types.d.ts +905 -0
- package/dist/context/interfaces/cgp_types.d.ts.map +1 -0
- package/dist/context/interfaces/cgp_types.js +112 -0
- package/dist/context/interfaces/cgp_types.js.map +1 -0
- package/dist/context/stores/cgp_stores.d.ts +42 -0
- package/dist/context/stores/cgp_stores.d.ts.map +1 -0
- package/dist/context/stores/cgp_stores.js +856 -0
- package/dist/context/stores/cgp_stores.js.map +1 -0
- package/dist/execution/harness/egp_harness.d.ts +43 -0
- package/dist/execution/harness/egp_harness.d.ts.map +1 -0
- package/dist/execution/harness/egp_harness.js +54 -0
- package/dist/execution/harness/egp_harness.js.map +1 -0
- package/dist/execution/interfaces/egp_types.d.ts +1042 -0
- package/dist/execution/interfaces/egp_types.d.ts.map +1 -0
- package/dist/execution/interfaces/egp_types.js +195 -0
- package/dist/execution/interfaces/egp_types.js.map +1 -0
- package/dist/execution/stores/egp_stores.d.ts +29 -0
- package/dist/execution/stores/egp_stores.d.ts.map +1 -0
- package/dist/execution/stores/egp_stores.js +1250 -0
- package/dist/execution/stores/egp_stores.js.map +1 -0
- package/dist/execution/wiring/execution_gate.d.ts +56 -0
- package/dist/execution/wiring/execution_gate.d.ts.map +1 -0
- package/dist/execution/wiring/execution_gate.js +77 -0
- package/dist/execution/wiring/execution_gate.js.map +1 -0
- package/dist/execution/wiring/floor_enforcer.d.ts +68 -0
- package/dist/execution/wiring/floor_enforcer.d.ts.map +1 -0
- package/dist/execution/wiring/floor_enforcer.js +96 -0
- package/dist/execution/wiring/floor_enforcer.js.map +1 -0
- package/dist/execution/wiring/invocation_gate.d.ts +58 -0
- package/dist/execution/wiring/invocation_gate.d.ts.map +1 -0
- package/dist/execution/wiring/invocation_gate.js +69 -0
- package/dist/execution/wiring/invocation_gate.js.map +1 -0
- package/dist/execution/wiring/terminal_release.d.ts +56 -0
- package/dist/execution/wiring/terminal_release.d.ts.map +1 -0
- package/dist/execution/wiring/terminal_release.js +85 -0
- package/dist/execution/wiring/terminal_release.js.map +1 -0
- package/dist/governance/harness/governance_harness.d.ts +54 -0
- package/dist/governance/harness/governance_harness.d.ts.map +1 -0
- package/dist/governance/harness/governance_harness.js +60 -0
- package/dist/governance/harness/governance_harness.js.map +1 -0
- package/dist/governance/migration/012_governance_runs_traces.d.ts +21 -0
- package/dist/governance/migration/012_governance_runs_traces.d.ts.map +1 -0
- package/dist/governance/migration/012_governance_runs_traces.js +115 -0
- package/dist/governance/migration/012_governance_runs_traces.js.map +1 -0
- package/dist/governance/migration/013_governance_contracts.d.ts +18 -0
- package/dist/governance/migration/013_governance_contracts.d.ts.map +1 -0
- package/dist/governance/migration/013_governance_contracts.js +59 -0
- package/dist/governance/migration/013_governance_contracts.js.map +1 -0
- package/dist/governance/migration/014_governance_supervisor.d.ts +16 -0
- package/dist/governance/migration/014_governance_supervisor.d.ts.map +1 -0
- package/dist/governance/migration/014_governance_supervisor.js +75 -0
- package/dist/governance/migration/014_governance_supervisor.js.map +1 -0
- package/dist/governance/migration/015_governance_eval.d.ts +18 -0
- package/dist/governance/migration/015_governance_eval.d.ts.map +1 -0
- package/dist/governance/migration/015_governance_eval.js +65 -0
- package/dist/governance/migration/015_governance_eval.js.map +1 -0
- package/dist/governance/migration/016_governance_capabilities.d.ts +16 -0
- package/dist/governance/migration/016_governance_capabilities.d.ts.map +1 -0
- package/dist/governance/migration/016_governance_capabilities.js +60 -0
- package/dist/governance/migration/016_governance_capabilities.js.map +1 -0
- package/dist/governance/migration/017_governance_handoffs_idempotency.d.ts +20 -0
- package/dist/governance/migration/017_governance_handoffs_idempotency.d.ts.map +1 -0
- package/dist/governance/migration/017_governance_handoffs_idempotency.js +103 -0
- package/dist/governance/migration/017_governance_handoffs_idempotency.js.map +1 -0
- package/dist/governance/migration/018_supervisor_decision_delete_trigger.d.ts +17 -0
- package/dist/governance/migration/018_supervisor_decision_delete_trigger.d.ts.map +1 -0
- package/dist/governance/migration/018_supervisor_decision_delete_trigger.js +37 -0
- package/dist/governance/migration/018_supervisor_decision_delete_trigger.js.map +1 -0
- package/dist/governance/stores/governance_stores.d.ts +78 -0
- package/dist/governance/stores/governance_stores.d.ts.map +1 -0
- package/dist/governance/stores/governance_stores.js +1117 -0
- package/dist/governance/stores/governance_stores.js.map +1 -0
- package/dist/kernel/audit/audit_trail.d.ts +24 -0
- package/dist/kernel/audit/audit_trail.d.ts.map +1 -0
- package/dist/kernel/audit/audit_trail.js +569 -0
- package/dist/kernel/audit/audit_trail.js.map +1 -0
- package/dist/kernel/crypto/crypto_engine.d.ts +49 -0
- package/dist/kernel/crypto/crypto_engine.d.ts.map +1 -0
- package/dist/kernel/crypto/crypto_engine.js +350 -0
- package/dist/kernel/crypto/crypto_engine.js.map +1 -0
- package/dist/kernel/database/database_lifecycle.d.ts +24 -0
- package/dist/kernel/database/database_lifecycle.d.ts.map +1 -0
- package/dist/kernel/database/database_lifecycle.js +404 -0
- package/dist/kernel/database/database_lifecycle.js.map +1 -0
- package/dist/kernel/database/migrations.d.ts +21 -0
- package/dist/kernel/database/migrations.d.ts.map +1 -0
- package/dist/kernel/database/migrations.js +407 -0
- package/dist/kernel/database/migrations.js.map +1 -0
- package/dist/kernel/events/event_bus.d.ts +25 -0
- package/dist/kernel/events/event_bus.d.ts.map +1 -0
- package/dist/kernel/events/event_bus.js +302 -0
- package/dist/kernel/events/event_bus.js.map +1 -0
- package/dist/kernel/events/webhook_delivery.d.ts +90 -0
- package/dist/kernel/events/webhook_delivery.d.ts.map +1 -0
- package/dist/kernel/events/webhook_delivery.js +324 -0
- package/dist/kernel/events/webhook_delivery.js.map +1 -0
- package/dist/kernel/index.d.ts +39 -0
- package/dist/kernel/index.d.ts.map +1 -0
- package/dist/kernel/index.js +263 -0
- package/dist/kernel/index.js.map +1 -0
- package/dist/kernel/interfaces/audit.d.ts +146 -0
- package/dist/kernel/interfaces/audit.d.ts.map +1 -0
- package/dist/kernel/interfaces/audit.js +15 -0
- package/dist/kernel/interfaces/audit.js.map +1 -0
- package/dist/kernel/interfaces/capability_manifest.d.ts +104 -0
- package/dist/kernel/interfaces/capability_manifest.d.ts.map +1 -0
- package/dist/kernel/interfaces/capability_manifest.js +44 -0
- package/dist/kernel/interfaces/capability_manifest.js.map +1 -0
- package/dist/kernel/interfaces/common.d.ts +91 -0
- package/dist/kernel/interfaces/common.d.ts.map +1 -0
- package/dist/kernel/interfaces/common.js +10 -0
- package/dist/kernel/interfaces/common.js.map +1 -0
- package/dist/kernel/interfaces/crypto.d.ts +95 -0
- package/dist/kernel/interfaces/crypto.d.ts.map +1 -0
- package/dist/kernel/interfaces/crypto.js +14 -0
- package/dist/kernel/interfaces/crypto.js.map +1 -0
- package/dist/kernel/interfaces/database.d.ts +157 -0
- package/dist/kernel/interfaces/database.d.ts.map +1 -0
- package/dist/kernel/interfaces/database.js +10 -0
- package/dist/kernel/interfaces/database.js.map +1 -0
- package/dist/kernel/interfaces/eval.d.ts +93 -0
- package/dist/kernel/interfaces/eval.d.ts.map +1 -0
- package/dist/kernel/interfaces/eval.js +17 -0
- package/dist/kernel/interfaces/eval.js.map +1 -0
- package/dist/kernel/interfaces/events.d.ts +73 -0
- package/dist/kernel/interfaces/events.d.ts.map +1 -0
- package/dist/kernel/interfaces/events.js +13 -0
- package/dist/kernel/interfaces/events.js.map +1 -0
- package/dist/kernel/interfaces/governance_ids.d.ts +93 -0
- package/dist/kernel/interfaces/governance_ids.d.ts.map +1 -0
- package/dist/kernel/interfaces/governance_ids.js +18 -0
- package/dist/kernel/interfaces/governance_ids.js.map +1 -0
- package/dist/kernel/interfaces/idempotency.d.ts +143 -0
- package/dist/kernel/interfaces/idempotency.d.ts.map +1 -0
- package/dist/kernel/interfaces/idempotency.js +22 -0
- package/dist/kernel/interfaces/idempotency.js.map +1 -0
- package/dist/kernel/interfaces/index.d.ts +29 -0
- package/dist/kernel/interfaces/index.d.ts.map +1 -0
- package/dist/kernel/interfaces/index.js +9 -0
- package/dist/kernel/interfaces/index.js.map +1 -0
- package/dist/kernel/interfaces/kernel.d.ts +79 -0
- package/dist/kernel/interfaces/kernel.d.ts.map +1 -0
- package/dist/kernel/interfaces/kernel.js +13 -0
- package/dist/kernel/interfaces/kernel.js.map +1 -0
- package/dist/kernel/interfaces/lifecycle.d.ts +115 -0
- package/dist/kernel/interfaces/lifecycle.d.ts.map +1 -0
- package/dist/kernel/interfaces/lifecycle.js +53 -0
- package/dist/kernel/interfaces/lifecycle.js.map +1 -0
- package/dist/kernel/interfaces/mission_contract.d.ts +106 -0
- package/dist/kernel/interfaces/mission_contract.d.ts.map +1 -0
- package/dist/kernel/interfaces/mission_contract.js +20 -0
- package/dist/kernel/interfaces/mission_contract.js.map +1 -0
- package/dist/kernel/interfaces/namespace.d.ts +30 -0
- package/dist/kernel/interfaces/namespace.d.ts.map +1 -0
- package/dist/kernel/interfaces/namespace.js +12 -0
- package/dist/kernel/interfaces/namespace.js.map +1 -0
- package/dist/kernel/interfaces/rate_limiter.d.ts +42 -0
- package/dist/kernel/interfaces/rate_limiter.d.ts.map +1 -0
- package/dist/kernel/interfaces/rate_limiter.js +12 -0
- package/dist/kernel/interfaces/rate_limiter.js.map +1 -0
- package/dist/kernel/interfaces/rbac.d.ts +58 -0
- package/dist/kernel/interfaces/rbac.d.ts.map +1 -0
- package/dist/kernel/interfaces/rbac.js +13 -0
- package/dist/kernel/interfaces/rbac.js.map +1 -0
- package/dist/kernel/interfaces/retention.d.ts +58 -0
- package/dist/kernel/interfaces/retention.d.ts.map +1 -0
- package/dist/kernel/interfaces/retention.js +13 -0
- package/dist/kernel/interfaces/retention.js.map +1 -0
- package/dist/kernel/interfaces/run_identity.d.ts +132 -0
- package/dist/kernel/interfaces/run_identity.d.ts.map +1 -0
- package/dist/kernel/interfaces/run_identity.js +16 -0
- package/dist/kernel/interfaces/run_identity.js.map +1 -0
- package/dist/kernel/interfaces/supervisor.d.ts +175 -0
- package/dist/kernel/interfaces/supervisor.d.ts.map +1 -0
- package/dist/kernel/interfaces/supervisor.js +25 -0
- package/dist/kernel/interfaces/supervisor.js.map +1 -0
- package/dist/kernel/interfaces/tenant.d.ts +34 -0
- package/dist/kernel/interfaces/tenant.d.ts.map +1 -0
- package/dist/kernel/interfaces/tenant.js +12 -0
- package/dist/kernel/interfaces/tenant.js.map +1 -0
- package/dist/kernel/interfaces/time.d.ts +29 -0
- package/dist/kernel/interfaces/time.d.ts.map +1 -0
- package/dist/kernel/interfaces/time.js +13 -0
- package/dist/kernel/interfaces/time.js.map +1 -0
- package/dist/kernel/interfaces/trace.d.ts +264 -0
- package/dist/kernel/interfaces/trace.d.ts.map +1 -0
- package/dist/kernel/interfaces/trace.js +17 -0
- package/dist/kernel/interfaces/trace.js.map +1 -0
- package/dist/kernel/namespace/namespace_enforcer.d.ts +20 -0
- package/dist/kernel/namespace/namespace_enforcer.d.ts.map +1 -0
- package/dist/kernel/namespace/namespace_enforcer.js +91 -0
- package/dist/kernel/namespace/namespace_enforcer.js.map +1 -0
- package/dist/kernel/rate_limiter/rate_limiter.d.ts +23 -0
- package/dist/kernel/rate_limiter/rate_limiter.d.ts.map +1 -0
- package/dist/kernel/rate_limiter/rate_limiter.js +146 -0
- package/dist/kernel/rate_limiter/rate_limiter.js.map +1 -0
- package/dist/kernel/rbac/rbac_engine.d.ts +20 -0
- package/dist/kernel/rbac/rbac_engine.d.ts.map +1 -0
- package/dist/kernel/rbac/rbac_engine.js +257 -0
- package/dist/kernel/rbac/rbac_engine.js.map +1 -0
- package/dist/kernel/retention/retention_scheduler.d.ts +41 -0
- package/dist/kernel/retention/retention_scheduler.d.ts.map +1 -0
- package/dist/kernel/retention/retention_scheduler.js +218 -0
- package/dist/kernel/retention/retention_scheduler.js.map +1 -0
- package/dist/kernel/tenant/tenant_context.d.ts +22 -0
- package/dist/kernel/tenant/tenant_context.d.ts.map +1 -0
- package/dist/kernel/tenant/tenant_context.js +107 -0
- package/dist/kernel/tenant/tenant_context.js.map +1 -0
- package/dist/kernel/tenant/tenant_scope.d.ts +81 -0
- package/dist/kernel/tenant/tenant_scope.d.ts.map +1 -0
- package/dist/kernel/tenant/tenant_scope.js +168 -0
- package/dist/kernel/tenant/tenant_scope.js.map +1 -0
- package/dist/kernel/time/time_provider.d.ts +39 -0
- package/dist/kernel/time/time_provider.d.ts.map +1 -0
- package/dist/kernel/time/time_provider.js +58 -0
- package/dist/kernel/time/time_provider.js.map +1 -0
- package/dist/learning/applicator/technique_applicator.d.ts +41 -0
- package/dist/learning/applicator/technique_applicator.d.ts.map +1 -0
- package/dist/learning/applicator/technique_applicator.js +200 -0
- package/dist/learning/applicator/technique_applicator.js.map +1 -0
- package/dist/learning/cold_start/cold_start_manager.d.ts +35 -0
- package/dist/learning/cold_start/cold_start_manager.d.ts.map +1 -0
- package/dist/learning/cold_start/cold_start_manager.js +146 -0
- package/dist/learning/cold_start/cold_start_manager.js.map +1 -0
- package/dist/learning/cycle/learning_cycle_orchestrator.d.ts +45 -0
- package/dist/learning/cycle/learning_cycle_orchestrator.d.ts.map +1 -0
- package/dist/learning/cycle/learning_cycle_orchestrator.js +165 -0
- package/dist/learning/cycle/learning_cycle_orchestrator.js.map +1 -0
- package/dist/learning/extractor/technique_extractor.d.ts +48 -0
- package/dist/learning/extractor/technique_extractor.d.ts.map +1 -0
- package/dist/learning/extractor/technique_extractor.js +357 -0
- package/dist/learning/extractor/technique_extractor.js.map +1 -0
- package/dist/learning/harness/learning_harness.d.ts +26 -0
- package/dist/learning/harness/learning_harness.d.ts.map +1 -0
- package/dist/learning/harness/learning_harness.js +58 -0
- package/dist/learning/harness/learning_harness.js.map +1 -0
- package/dist/learning/interfaces/index.d.ts +7 -0
- package/dist/learning/interfaces/index.d.ts.map +1 -0
- package/dist/learning/interfaces/index.js +10 -0
- package/dist/learning/interfaces/index.js.map +1 -0
- package/dist/learning/interfaces/learning_types.d.ts +398 -0
- package/dist/learning/interfaces/learning_types.d.ts.map +1 -0
- package/dist/learning/interfaces/learning_types.js +69 -0
- package/dist/learning/interfaces/learning_types.js.map +1 -0
- package/dist/learning/migration/007_learning_techniques.d.ts +23 -0
- package/dist/learning/migration/007_learning_techniques.d.ts.map +1 -0
- package/dist/learning/migration/007_learning_techniques.js +86 -0
- package/dist/learning/migration/007_learning_techniques.js.map +1 -0
- package/dist/learning/migration/008_learning_outcomes.d.ts +23 -0
- package/dist/learning/migration/008_learning_outcomes.d.ts.map +1 -0
- package/dist/learning/migration/008_learning_outcomes.js +79 -0
- package/dist/learning/migration/008_learning_outcomes.js.map +1 -0
- package/dist/learning/migration/009_learning_applications.d.ts +25 -0
- package/dist/learning/migration/009_learning_applications.d.ts.map +1 -0
- package/dist/learning/migration/009_learning_applications.js +82 -0
- package/dist/learning/migration/009_learning_applications.js.map +1 -0
- package/dist/learning/migration/010_learning_quarantine.d.ts +22 -0
- package/dist/learning/migration/010_learning_quarantine.d.ts.map +1 -0
- package/dist/learning/migration/010_learning_quarantine.js +78 -0
- package/dist/learning/migration/010_learning_quarantine.js.map +1 -0
- package/dist/learning/migration/011_learning_transfers.d.ts +22 -0
- package/dist/learning/migration/011_learning_transfers.d.ts.map +1 -0
- package/dist/learning/migration/011_learning_transfers.js +77 -0
- package/dist/learning/migration/011_learning_transfers.js.map +1 -0
- package/dist/learning/quarantine/quarantine_manager.d.ts +34 -0
- package/dist/learning/quarantine/quarantine_manager.d.ts.map +1 -0
- package/dist/learning/quarantine/quarantine_manager.js +200 -0
- package/dist/learning/quarantine/quarantine_manager.js.map +1 -0
- package/dist/learning/retirement/retirement_evaluator.d.ts +35 -0
- package/dist/learning/retirement/retirement_evaluator.d.ts.map +1 -0
- package/dist/learning/retirement/retirement_evaluator.js +131 -0
- package/dist/learning/retirement/retirement_evaluator.js.map +1 -0
- package/dist/learning/specialization/over_specialization_detector.d.ts +32 -0
- package/dist/learning/specialization/over_specialization_detector.d.ts.map +1 -0
- package/dist/learning/specialization/over_specialization_detector.js +105 -0
- package/dist/learning/specialization/over_specialization_detector.js.map +1 -0
- package/dist/learning/store/technique_store.d.ts +22 -0
- package/dist/learning/store/technique_store.d.ts.map +1 -0
- package/dist/learning/store/technique_store.js +369 -0
- package/dist/learning/store/technique_store.js.map +1 -0
- package/dist/learning/tracker/effectiveness_tracker.d.ts +26 -0
- package/dist/learning/tracker/effectiveness_tracker.d.ts.map +1 -0
- package/dist/learning/tracker/effectiveness_tracker.js +158 -0
- package/dist/learning/tracker/effectiveness_tracker.js.map +1 -0
- package/dist/learning/transfer/cross_agent_transfer.d.ts +35 -0
- package/dist/learning/transfer/cross_agent_transfer.d.ts.map +1 -0
- package/dist/learning/transfer/cross_agent_transfer.js +245 -0
- package/dist/learning/transfer/cross_agent_transfer.js.map +1 -0
- package/dist/orchestration/artifacts/artifact_store.d.ts +19 -0
- package/dist/orchestration/artifacts/artifact_store.d.ts.map +1 -0
- package/dist/orchestration/artifacts/artifact_store.js +213 -0
- package/dist/orchestration/artifacts/artifact_store.js.map +1 -0
- package/dist/orchestration/artifacts/cascade_walker.d.ts +39 -0
- package/dist/orchestration/artifacts/cascade_walker.d.ts.map +1 -0
- package/dist/orchestration/artifacts/cascade_walker.js +107 -0
- package/dist/orchestration/artifacts/cascade_walker.js.map +1 -0
- package/dist/orchestration/budget/budget_governance.d.ts +20 -0
- package/dist/orchestration/budget/budget_governance.d.ts.map +1 -0
- package/dist/orchestration/budget/budget_governance.js +182 -0
- package/dist/orchestration/budget/budget_governance.js.map +1 -0
- package/dist/orchestration/checkpoints/checkpoint_coordinator.d.ts +22 -0
- package/dist/orchestration/checkpoints/checkpoint_coordinator.d.ts.map +1 -0
- package/dist/orchestration/checkpoints/checkpoint_coordinator.js +252 -0
- package/dist/orchestration/checkpoints/checkpoint_coordinator.js.map +1 -0
- package/dist/orchestration/checkpoints/drift_engine.d.ts +52 -0
- package/dist/orchestration/checkpoints/drift_engine.d.ts.map +1 -0
- package/dist/orchestration/checkpoints/drift_engine.js +126 -0
- package/dist/orchestration/checkpoints/drift_engine.js.map +1 -0
- package/dist/orchestration/compaction/bounded_cognition.d.ts +22 -0
- package/dist/orchestration/compaction/bounded_cognition.d.ts.map +1 -0
- package/dist/orchestration/compaction/bounded_cognition.js +124 -0
- package/dist/orchestration/compaction/bounded_cognition.js.map +1 -0
- package/dist/orchestration/conversation/conversation_manager.d.ts +25 -0
- package/dist/orchestration/conversation/conversation_manager.d.ts.map +1 -0
- package/dist/orchestration/conversation/conversation_manager.js +260 -0
- package/dist/orchestration/conversation/conversation_manager.js.map +1 -0
- package/dist/orchestration/events/event_propagation.d.ts +20 -0
- package/dist/orchestration/events/event_propagation.d.ts.map +1 -0
- package/dist/orchestration/events/event_propagation.js +160 -0
- package/dist/orchestration/events/event_propagation.js.map +1 -0
- package/dist/orchestration/index.d.ts +28 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +147 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/interfaces/orchestration.d.ts +494 -0
- package/dist/orchestration/interfaces/orchestration.d.ts.map +1 -0
- package/dist/orchestration/interfaces/orchestration.js +64 -0
- package/dist/orchestration/interfaces/orchestration.js.map +1 -0
- package/dist/orchestration/migration/003_orchestration.d.ts +27 -0
- package/dist/orchestration/migration/003_orchestration.d.ts.map +1 -0
- package/dist/orchestration/migration/003_orchestration.js +336 -0
- package/dist/orchestration/migration/003_orchestration.js.map +1 -0
- package/dist/orchestration/migration/004_tenant_isolation.d.ts +22 -0
- package/dist/orchestration/migration/004_tenant_isolation.d.ts.map +1 -0
- package/dist/orchestration/migration/004_tenant_isolation.js +179 -0
- package/dist/orchestration/migration/004_tenant_isolation.js.map +1 -0
- package/dist/orchestration/migration/005_immutability_triggers.d.ts +30 -0
- package/dist/orchestration/migration/005_immutability_triggers.d.ts.map +1 -0
- package/dist/orchestration/migration/005_immutability_triggers.js +93 -0
- package/dist/orchestration/migration/005_immutability_triggers.js.map +1 -0
- package/dist/orchestration/migration/006_audit_tombstone.d.ts +26 -0
- package/dist/orchestration/migration/006_audit_tombstone.d.ts.map +1 -0
- package/dist/orchestration/migration/006_audit_tombstone.js +71 -0
- package/dist/orchestration/migration/006_audit_tombstone.js.map +1 -0
- package/dist/orchestration/missions/mission_recovery.d.ts +60 -0
- package/dist/orchestration/missions/mission_recovery.d.ts.map +1 -0
- package/dist/orchestration/missions/mission_recovery.js +251 -0
- package/dist/orchestration/missions/mission_recovery.js.map +1 -0
- package/dist/orchestration/missions/mission_store.d.ts +16 -0
- package/dist/orchestration/missions/mission_store.d.ts.map +1 -0
- package/dist/orchestration/missions/mission_store.js +280 -0
- package/dist/orchestration/missions/mission_store.js.map +1 -0
- package/dist/orchestration/syscalls/create_artifact.d.ts +13 -0
- package/dist/orchestration/syscalls/create_artifact.d.ts.map +1 -0
- package/dist/orchestration/syscalls/create_artifact.js +23 -0
- package/dist/orchestration/syscalls/create_artifact.js.map +1 -0
- package/dist/orchestration/syscalls/emit_event.d.ts +13 -0
- package/dist/orchestration/syscalls/emit_event.d.ts.map +1 -0
- package/dist/orchestration/syscalls/emit_event.js +13 -0
- package/dist/orchestration/syscalls/emit_event.js.map +1 -0
- package/dist/orchestration/syscalls/propose_mission.d.ts +14 -0
- package/dist/orchestration/syscalls/propose_mission.d.ts.map +1 -0
- package/dist/orchestration/syscalls/propose_mission.js +27 -0
- package/dist/orchestration/syscalls/propose_mission.js.map +1 -0
- package/dist/orchestration/syscalls/propose_task_execution.d.ts +13 -0
- package/dist/orchestration/syscalls/propose_task_execution.d.ts.map +1 -0
- package/dist/orchestration/syscalls/propose_task_execution.js +84 -0
- package/dist/orchestration/syscalls/propose_task_execution.js.map +1 -0
- package/dist/orchestration/syscalls/propose_task_graph.d.ts +13 -0
- package/dist/orchestration/syscalls/propose_task_graph.d.ts.map +1 -0
- package/dist/orchestration/syscalls/propose_task_graph.js +22 -0
- package/dist/orchestration/syscalls/propose_task_graph.js.map +1 -0
- package/dist/orchestration/syscalls/read_artifact.d.ts +14 -0
- package/dist/orchestration/syscalls/read_artifact.d.ts.map +1 -0
- package/dist/orchestration/syscalls/read_artifact.js +31 -0
- package/dist/orchestration/syscalls/read_artifact.js.map +1 -0
- package/dist/orchestration/syscalls/request_budget.d.ts +14 -0
- package/dist/orchestration/syscalls/request_budget.d.ts.map +1 -0
- package/dist/orchestration/syscalls/request_budget.js +46 -0
- package/dist/orchestration/syscalls/request_budget.js.map +1 -0
- package/dist/orchestration/syscalls/request_capability.d.ts +13 -0
- package/dist/orchestration/syscalls/request_capability.d.ts.map +1 -0
- package/dist/orchestration/syscalls/request_capability.js +136 -0
- package/dist/orchestration/syscalls/request_capability.js.map +1 -0
- package/dist/orchestration/syscalls/respond_checkpoint.d.ts +12 -0
- package/dist/orchestration/syscalls/respond_checkpoint.d.ts.map +1 -0
- package/dist/orchestration/syscalls/respond_checkpoint.js +12 -0
- package/dist/orchestration/syscalls/respond_checkpoint.js.map +1 -0
- package/dist/orchestration/syscalls/submit_result.d.ts +15 -0
- package/dist/orchestration/syscalls/submit_result.d.ts.map +1 -0
- package/dist/orchestration/syscalls/submit_result.js +97 -0
- package/dist/orchestration/syscalls/submit_result.js.map +1 -0
- package/dist/orchestration/tasks/task_graph.d.ts +26 -0
- package/dist/orchestration/tasks/task_graph.d.ts.map +1 -0
- package/dist/orchestration/tasks/task_graph.js +204 -0
- package/dist/orchestration/tasks/task_graph.js.map +1 -0
- package/dist/orchestration/tasks/task_store.d.ts +18 -0
- package/dist/orchestration/tasks/task_store.d.ts.map +1 -0
- package/dist/orchestration/tasks/task_store.js +99 -0
- package/dist/orchestration/tasks/task_store.js.map +1 -0
- package/dist/reference-agent/artifact_manager.d.ts +119 -0
- package/dist/reference-agent/artifact_manager.d.ts.map +1 -0
- package/dist/reference-agent/artifact_manager.js +149 -0
- package/dist/reference-agent/artifact_manager.js.map +1 -0
- package/dist/reference-agent/checkpoint_handler.d.ts +186 -0
- package/dist/reference-agent/checkpoint_handler.d.ts.map +1 -0
- package/dist/reference-agent/checkpoint_handler.js +423 -0
- package/dist/reference-agent/checkpoint_handler.js.map +1 -0
- package/dist/reference-agent/index.d.ts +43 -0
- package/dist/reference-agent/index.d.ts.map +1 -0
- package/dist/reference-agent/index.js +53 -0
- package/dist/reference-agent/index.js.map +1 -0
- package/dist/reference-agent/mission_planner.d.ts +163 -0
- package/dist/reference-agent/mission_planner.d.ts.map +1 -0
- package/dist/reference-agent/mission_planner.js +375 -0
- package/dist/reference-agent/mission_planner.js.map +1 -0
- package/dist/reference-agent/reference_agent.d.ts +130 -0
- package/dist/reference-agent/reference_agent.d.ts.map +1 -0
- package/dist/reference-agent/reference_agent.js +360 -0
- package/dist/reference-agent/reference_agent.js.map +1 -0
- package/dist/reference-agent/reference_agent.types.d.ts +199 -0
- package/dist/reference-agent/reference_agent.types.d.ts.map +1 -0
- package/dist/reference-agent/reference_agent.types.js +59 -0
- package/dist/reference-agent/reference_agent.types.js.map +1 -0
- package/dist/reference-agent/result_aggregator.d.ts +107 -0
- package/dist/reference-agent/result_aggregator.d.ts.map +1 -0
- package/dist/reference-agent/result_aggregator.js +219 -0
- package/dist/reference-agent/result_aggregator.js.map +1 -0
- package/dist/reference-agent/system_call_client.d.ts +106 -0
- package/dist/reference-agent/system_call_client.d.ts.map +1 -0
- package/dist/reference-agent/system_call_client.js +231 -0
- package/dist/reference-agent/system_call_client.js.map +1 -0
- package/dist/reference-agent/task_executor.d.ts +108 -0
- package/dist/reference-agent/task_executor.d.ts.map +1 -0
- package/dist/reference-agent/task_executor.js +249 -0
- package/dist/reference-agent/task_executor.js.map +1 -0
- package/dist/substrate/accounting/resource_accounting.d.ts +52 -0
- package/dist/substrate/accounting/resource_accounting.d.ts.map +1 -0
- package/dist/substrate/accounting/resource_accounting.js +200 -0
- package/dist/substrate/accounting/resource_accounting.js.map +1 -0
- package/dist/substrate/adapters/capability_registry.d.ts +28 -0
- package/dist/substrate/adapters/capability_registry.d.ts.map +1 -0
- package/dist/substrate/adapters/capability_registry.js +196 -0
- package/dist/substrate/adapters/capability_registry.js.map +1 -0
- package/dist/substrate/gateway/llm_gateway.d.ts +68 -0
- package/dist/substrate/gateway/llm_gateway.d.ts.map +1 -0
- package/dist/substrate/gateway/llm_gateway.js +442 -0
- package/dist/substrate/gateway/llm_gateway.js.map +1 -0
- package/dist/substrate/heartbeat/heartbeat_monitor.d.ts +40 -0
- package/dist/substrate/heartbeat/heartbeat_monitor.d.ts.map +1 -0
- package/dist/substrate/heartbeat/heartbeat_monitor.js +170 -0
- package/dist/substrate/heartbeat/heartbeat_monitor.js.map +1 -0
- package/dist/substrate/index.d.ts +59 -0
- package/dist/substrate/index.d.ts.map +1 -0
- package/dist/substrate/index.js +143 -0
- package/dist/substrate/index.js.map +1 -0
- package/dist/substrate/interfaces/substrate.d.ts +486 -0
- package/dist/substrate/interfaces/substrate.d.ts.map +1 -0
- package/dist/substrate/interfaces/substrate.js +14 -0
- package/dist/substrate/interfaces/substrate.js.map +1 -0
- package/dist/substrate/migration/002_substrate.d.ts +24 -0
- package/dist/substrate/migration/002_substrate.d.ts.map +1 -0
- package/dist/substrate/migration/002_substrate.js +188 -0
- package/dist/substrate/migration/002_substrate.js.map +1 -0
- package/dist/substrate/migration/022_transport_deliberation.d.ts +31 -0
- package/dist/substrate/migration/022_transport_deliberation.d.ts.map +1 -0
- package/dist/substrate/migration/022_transport_deliberation.js +77 -0
- package/dist/substrate/migration/022_transport_deliberation.js.map +1 -0
- package/dist/substrate/replay/replay_engine.d.ts +65 -0
- package/dist/substrate/replay/replay_engine.d.ts.map +1 -0
- package/dist/substrate/replay/replay_engine.js +316 -0
- package/dist/substrate/replay/replay_engine.js.map +1 -0
- package/dist/substrate/scheduler/task_scheduler.d.ts +38 -0
- package/dist/substrate/scheduler/task_scheduler.d.ts.map +1 -0
- package/dist/substrate/scheduler/task_scheduler.js +486 -0
- package/dist/substrate/scheduler/task_scheduler.js.map +1 -0
- package/dist/substrate/transport/adapters/anthropic_adapter.d.ts +57 -0
- package/dist/substrate/transport/adapters/anthropic_adapter.d.ts.map +1 -0
- package/dist/substrate/transport/adapters/anthropic_adapter.js +455 -0
- package/dist/substrate/transport/adapters/anthropic_adapter.js.map +1 -0
- package/dist/substrate/transport/adapters/gemini_adapter.d.ts +86 -0
- package/dist/substrate/transport/adapters/gemini_adapter.d.ts.map +1 -0
- package/dist/substrate/transport/adapters/gemini_adapter.js +456 -0
- package/dist/substrate/transport/adapters/gemini_adapter.js.map +1 -0
- package/dist/substrate/transport/adapters/groq_adapter.d.ts +50 -0
- package/dist/substrate/transport/adapters/groq_adapter.d.ts.map +1 -0
- package/dist/substrate/transport/adapters/groq_adapter.js +179 -0
- package/dist/substrate/transport/adapters/groq_adapter.js.map +1 -0
- package/dist/substrate/transport/adapters/mistral_adapter.d.ts +50 -0
- package/dist/substrate/transport/adapters/mistral_adapter.d.ts.map +1 -0
- package/dist/substrate/transport/adapters/mistral_adapter.js +179 -0
- package/dist/substrate/transport/adapters/mistral_adapter.js.map +1 -0
- package/dist/substrate/transport/adapters/ollama_adapter.d.ts +66 -0
- package/dist/substrate/transport/adapters/ollama_adapter.d.ts.map +1 -0
- package/dist/substrate/transport/adapters/ollama_adapter.js +347 -0
- package/dist/substrate/transport/adapters/ollama_adapter.js.map +1 -0
- package/dist/substrate/transport/adapters/openai_adapter.d.ts +68 -0
- package/dist/substrate/transport/adapters/openai_adapter.d.ts.map +1 -0
- package/dist/substrate/transport/adapters/openai_adapter.js +439 -0
- package/dist/substrate/transport/adapters/openai_adapter.js.map +1 -0
- package/dist/substrate/transport/adapters/openai_compat.d.ts +64 -0
- package/dist/substrate/transport/adapters/openai_compat.d.ts.map +1 -0
- package/dist/substrate/transport/adapters/openai_compat.js +326 -0
- package/dist/substrate/transport/adapters/openai_compat.js.map +1 -0
- package/dist/substrate/transport/index.d.ts +17 -0
- package/dist/substrate/transport/index.d.ts.map +1 -0
- package/dist/substrate/transport/index.js +25 -0
- package/dist/substrate/transport/index.js.map +1 -0
- package/dist/substrate/transport/stream_parser.d.ts +69 -0
- package/dist/substrate/transport/stream_parser.d.ts.map +1 -0
- package/dist/substrate/transport/stream_parser.js +280 -0
- package/dist/substrate/transport/stream_parser.js.map +1 -0
- package/dist/substrate/transport/transport_engine.d.ts +53 -0
- package/dist/substrate/transport/transport_engine.d.ts.map +1 -0
- package/dist/substrate/transport/transport_engine.js +444 -0
- package/dist/substrate/transport/transport_engine.js.map +1 -0
- package/dist/substrate/transport/transport_types.d.ts +207 -0
- package/dist/substrate/transport/transport_types.d.ts.map +1 -0
- package/dist/substrate/transport/transport_types.js +13 -0
- package/dist/substrate/transport/transport_types.js.map +1 -0
- package/dist/substrate/workers/worker_runtime.d.ts +40 -0
- package/dist/substrate/workers/worker_runtime.d.ts.map +1 -0
- package/dist/substrate/workers/worker_runtime.js +294 -0
- package/dist/substrate/workers/worker_runtime.js.map +1 -0
- package/dist/techniques/harness/tgp_harness.d.ts +39 -0
- package/dist/techniques/harness/tgp_harness.d.ts.map +1 -0
- package/dist/techniques/harness/tgp_harness.js +49 -0
- package/dist/techniques/harness/tgp_harness.js.map +1 -0
- package/dist/techniques/interfaces/tgp_types.d.ts +646 -0
- package/dist/techniques/interfaces/tgp_types.d.ts.map +1 -0
- package/dist/techniques/interfaces/tgp_types.js +160 -0
- package/dist/techniques/interfaces/tgp_types.js.map +1 -0
- package/dist/techniques/migration/020_tgp_governance.d.ts +36 -0
- package/dist/techniques/migration/020_tgp_governance.d.ts.map +1 -0
- package/dist/techniques/migration/020_tgp_governance.js +249 -0
- package/dist/techniques/migration/020_tgp_governance.js.map +1 -0
- package/dist/techniques/store/tgp_stores.d.ts +36 -0
- package/dist/techniques/store/tgp_stores.d.ts.map +1 -0
- package/dist/techniques/store/tgp_stores.js +854 -0
- package/dist/techniques/store/tgp_stores.js.map +1 -0
- package/dist/working-memory/harness/wmp_harness.d.ts +43 -0
- package/dist/working-memory/harness/wmp_harness.d.ts.map +1 -0
- package/dist/working-memory/harness/wmp_harness.js +81 -0
- package/dist/working-memory/harness/wmp_harness.js.map +1 -0
- package/dist/working-memory/interfaces/wmp_types.d.ts +635 -0
- package/dist/working-memory/interfaces/wmp_types.d.ts.map +1 -0
- package/dist/working-memory/interfaces/wmp_types.js +144 -0
- package/dist/working-memory/interfaces/wmp_types.js.map +1 -0
- package/dist/working-memory/migration/021_wmp.d.ts +21 -0
- package/dist/working-memory/migration/021_wmp.d.ts.map +1 -0
- package/dist/working-memory/migration/021_wmp.js +139 -0
- package/dist/working-memory/migration/021_wmp.js.map +1 -0
- package/dist/working-memory/stores/wmp_stores.d.ts +28 -0
- package/dist/working-memory/stores/wmp_stores.d.ts.map +1 -0
- package/dist/working-memory/stores/wmp_stores.js +754 -0
- package/dist/working-memory/stores/wmp_stores.js.map +1 -0
- package/package.json +84 -0
|
@@ -0,0 +1,708 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DBA (Deliberation & Context Budget Amendment) interface types.
|
|
3
|
+
* Spec ref: DBA v1.0 Design Source (FINAL DRAFT), Architecture Freeze CF-06/CF-07/CF-10
|
|
4
|
+
*
|
|
5
|
+
* Phase: v3.3.0 — Budget Governance Truth Model
|
|
6
|
+
* Status: FROZEN — interfaces defined before implementation.
|
|
7
|
+
*
|
|
8
|
+
* Implements: All TypeScript types for the DBA subsystem:
|
|
9
|
+
* §3 (16 Constitutional Invariants DBA-I1..DBA-I16),
|
|
10
|
+
* §4 (14 Pre-Schema Decisions PSD-1..PSD-14),
|
|
11
|
+
* §6 (Deliberation Accounting — Resource Extension, Accounting Modes, Estimator Contract),
|
|
12
|
+
* §7 (Context Budget Model — contextPolicy, ECB Computation, Substrate/Overhead Contracts),
|
|
13
|
+
* §8 (SC-8 Interaction),
|
|
14
|
+
* §10 (6 Failure Modes FM-DBA-01..FM-DBA-06),
|
|
15
|
+
* §12 (Schema Extension — Resource Object + InvocationAccounting 34-field record)
|
|
16
|
+
*
|
|
17
|
+
* Key architectural properties:
|
|
18
|
+
* - PART A (consumptive): deliberationBudget — depletes, reserves, inherits, threshold-fires
|
|
19
|
+
* - PART B (non-consumptive): contextPolicy/ECB — computed fresh per invocation, never depletes
|
|
20
|
+
* - These two surfaces MUST NEVER be collapsed. Generic resource processing loops MUST NOT
|
|
21
|
+
* apply consumptive semantics (allocated/consumed/remaining/reservation) to contextPolicy.
|
|
22
|
+
* - tokenBudget semantics NARROWED: prompt/completion only after DBA integration (DBA-I1)
|
|
23
|
+
* - Dual-source provenance with ASYMMETRIC resolution:
|
|
24
|
+
* prompt/completion → provider authoritative (DBA-I2)
|
|
25
|
+
* context window → more restrictive value wins (§7.4, PSD-12)
|
|
26
|
+
* - InvocationAccounting: 34 fields across 4 nested groups — most complex record in v3.3.0
|
|
27
|
+
*
|
|
28
|
+
* CROSS-SUBSYSTEM CONTRACTS:
|
|
29
|
+
* - EGP imports: DeliberationBudget (as reservable dimension via EGP-I4)
|
|
30
|
+
* - CGP imports: effectiveContextBudget (as admission ceiling via CGP-I2, Step 1)
|
|
31
|
+
* - v3.2 tokenBudget: semantics narrowed, overage field added
|
|
32
|
+
*
|
|
33
|
+
* Freeze items: CF-06 (Deliberation Resource), CF-07 (Context Budget Model), CF-10 (Eviction Determinism)
|
|
34
|
+
*/
|
|
35
|
+
import type { TaskId, MissionId, CorrelationId } from '../../kernel/interfaces/index.js';
|
|
36
|
+
/** Unique identifier for a single model invocation within a task */
|
|
37
|
+
export type BudgetInvocationId = string & {
|
|
38
|
+
readonly __brand: 'BudgetInvocationId';
|
|
39
|
+
};
|
|
40
|
+
/** Unique identifier for a deliberation estimator version */
|
|
41
|
+
export type EstimatorVersionId = string & {
|
|
42
|
+
readonly __brand: 'EstimatorVersionId';
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* §12.1: Consumptive budget dimension with standard lifecycle semantics.
|
|
46
|
+
* Used by both tokenBudget (existing, narrowed) and deliberationBudget (new).
|
|
47
|
+
*
|
|
48
|
+
* DBA-I13: remaining is NEVER negative. Overage is recorded separately.
|
|
49
|
+
* DBA-I1: tokenBudget and deliberationBudget are INDEPENDENT dimensions.
|
|
50
|
+
*/
|
|
51
|
+
export interface ConsumptiveBudgetDimension {
|
|
52
|
+
/** Tokens allocated to this mission for this dimension */
|
|
53
|
+
readonly allocated: number;
|
|
54
|
+
/** Tokens consumed so far in this dimension */
|
|
55
|
+
readonly consumed: number;
|
|
56
|
+
/** allocated - consumed, clamped to zero (DBA-I13: never negative) */
|
|
57
|
+
readonly remaining: number;
|
|
58
|
+
/** Consumption beyond allocated, recorded explicitly (DBA-I13) */
|
|
59
|
+
readonly overage: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* §6.1: deliberationBudget — NEW consumptive governed dimension [FREEZE: CF-06].
|
|
63
|
+
*
|
|
64
|
+
* Tracks model reasoning effort (thinking tokens, chain-of-thought) independently
|
|
65
|
+
* from prompt/completion consumption. Participates in inheritance, reservation,
|
|
66
|
+
* enforcement, threshold triggers, and checkpoint participation.
|
|
67
|
+
*
|
|
68
|
+
* Same structural shape as tokenBudget but semantically independent (DBA-I1).
|
|
69
|
+
*/
|
|
70
|
+
export type DeliberationBudget = ConsumptiveBudgetDimension;
|
|
71
|
+
/**
|
|
72
|
+
* §12.1: tokenBudget — EXISTING dimension, semantics NARROWED by DBA-I1.
|
|
73
|
+
*
|
|
74
|
+
* After DBA integration, tokenBudget governs canonical provider-facing
|
|
75
|
+
* prompt/completion token consumption ONLY. No longer a proxy for total
|
|
76
|
+
* model cost. Gains overage field (DBA-I13).
|
|
77
|
+
*
|
|
78
|
+
* Legacy harmonization flag (DBA-I1): All existing code treating tokenBudget
|
|
79
|
+
* as total model cost must be updated.
|
|
80
|
+
*/
|
|
81
|
+
export type TokenBudget = ConsumptiveBudgetDimension;
|
|
82
|
+
/**
|
|
83
|
+
* §7.1: contextPolicy — NEW non-consumptive governance configuration [FREEZE: CF-07].
|
|
84
|
+
*
|
|
85
|
+
* Constrains context admission per invocation but is NOT consumptive, reservable,
|
|
86
|
+
* reclaimable, or depletable. Does NOT participate in allocated/consumed/remaining
|
|
87
|
+
* semantics. No code path may apply consumption, reservation, or depletion logic
|
|
88
|
+
* to contextPolicy (DBA-I6).
|
|
89
|
+
*
|
|
90
|
+
* DBA-I7: Frozen terminology. contextPolicy = governing configuration surface.
|
|
91
|
+
* DBA-I8: Monotonic inheritance — child ceiling ≤ parent ceiling.
|
|
92
|
+
* PSD-8: ceiling = null means "no additional local ceiling beyond inherited governance."
|
|
93
|
+
*/
|
|
94
|
+
export interface ContextPolicy {
|
|
95
|
+
/**
|
|
96
|
+
* Maximum context-admission tokens per invocation.
|
|
97
|
+
* null = no local ceiling (inherited or unbounded per PSD-8).
|
|
98
|
+
* Must be non-negative integer when present. Zero is valid (means
|
|
99
|
+
* "no context beyond control state and overhead").
|
|
100
|
+
* Negative values MUST be rejected at policy-setting time.
|
|
101
|
+
*/
|
|
102
|
+
readonly ceiling: number | null;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* §12.1: DBA extension fields added to the v3.2 Resource object.
|
|
106
|
+
*
|
|
107
|
+
* These fields are co-located on the Resource object but have fundamentally
|
|
108
|
+
* different semantics:
|
|
109
|
+
* - deliberationBudget: consumptive (depletes, reserves, inherits with decayFactor)
|
|
110
|
+
* - contextPolicy: non-consumptive (computed fresh per invocation, inherits as ceiling)
|
|
111
|
+
*
|
|
112
|
+
* Implementation MUST ensure generic resource processing code does NOT apply
|
|
113
|
+
* allocated/consumed/remaining/reservation logic to contextPolicy (DBA-I6).
|
|
114
|
+
*/
|
|
115
|
+
export interface DBAResourceExtension {
|
|
116
|
+
/** NEW [FREEZE: CF-06]: Consumptive reasoning budget dimension */
|
|
117
|
+
readonly deliberationBudget: DeliberationBudget;
|
|
118
|
+
/** NEW [FREEZE: CF-07]: Non-consumptive context admission governance */
|
|
119
|
+
readonly contextPolicy: ContextPolicy;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* DBA-I2: Provenance of prompt/completion accounting.
|
|
123
|
+
* Provider-reported is authoritative when available.
|
|
124
|
+
* Kernel-counted is fallback from canonical serialized payload.
|
|
125
|
+
*/
|
|
126
|
+
export type PromptCompletionProvenance = 'provider_reported' | 'kernel_counted';
|
|
127
|
+
/**
|
|
128
|
+
* §6.2: Deliberation accounting mode — per invocation, not per model (DBA-I4).
|
|
129
|
+
* Determined at invocation time based on what the provider actually returns.
|
|
130
|
+
*/
|
|
131
|
+
export type DeliberationAccountingMode = 'provider_authoritative' | 'estimated';
|
|
132
|
+
/**
|
|
133
|
+
* §7.4: Derivation mode for availableInputWindow.
|
|
134
|
+
* Provider-authoritative: provider reports usable input limit directly.
|
|
135
|
+
* Kernel-derived: computed from model raw limit minus reserved completion minus deductions.
|
|
136
|
+
*/
|
|
137
|
+
export type WindowDerivationMode = 'provider_authoritative' | 'kernel_derived';
|
|
138
|
+
/**
|
|
139
|
+
* DBA-I2: Kernel counting basis — tokenizer identity + version.
|
|
140
|
+
* Sufficient to reproduce identical counts from same serialized payloads.
|
|
141
|
+
*/
|
|
142
|
+
export interface KernelCountingBasis {
|
|
143
|
+
readonly tokenizer: string;
|
|
144
|
+
readonly version: string;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* §6.3: Estimator input basis — recorded for audit/replay.
|
|
148
|
+
* Only replay-stable recorded invocation inputs and governed configuration.
|
|
149
|
+
*
|
|
150
|
+
* DBA-I3 FORBIDDEN inputs: wall-clock time, response latency, queue delay,
|
|
151
|
+
* retry history outside recorded transcript, hidden provider state,
|
|
152
|
+
* mutable unrecorded implementation state.
|
|
153
|
+
*/
|
|
154
|
+
export interface EstimatorInputBasis {
|
|
155
|
+
/** Model/provider identifier */
|
|
156
|
+
readonly modelId: string;
|
|
157
|
+
/** Governed reasoning mode/effort setting if applicable */
|
|
158
|
+
readonly reasoningEffort: string | null;
|
|
159
|
+
/** Provider-reported prompt token count */
|
|
160
|
+
readonly promptTokens: number;
|
|
161
|
+
/** Provider-reported completion token count */
|
|
162
|
+
readonly completionTokens: number;
|
|
163
|
+
/** Provider-reported total/billable tokens if available */
|
|
164
|
+
readonly totalBilledTokens: number | null;
|
|
165
|
+
/** Any additional replay-stable response payload fields */
|
|
166
|
+
readonly additionalFields: Readonly<Record<string, unknown>> | null;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* §6.3: Deliberation estimator contract [FREEZE: CF-06].
|
|
170
|
+
*
|
|
171
|
+
* The design source specifies the CONTRACT, not the algorithm.
|
|
172
|
+
* The specific algorithm is implementation freedom provided:
|
|
173
|
+
* 1. Determinism: identical inputs + identical version → identical charge (DBA-I3)
|
|
174
|
+
* 2. Versioning: governed identity + version, changes are auditable events
|
|
175
|
+
* 3. Input restriction: only replay-stable recorded inputs (DBA-I3 forbidden list)
|
|
176
|
+
* 4. Audit binding: each charge records estimator ID, version, inputs, result
|
|
177
|
+
* 5. Transparency: never presented as provider-authoritative (DBA-I4)
|
|
178
|
+
*/
|
|
179
|
+
export interface DeliberationEstimator {
|
|
180
|
+
/** Estimator identity — unique, governed */
|
|
181
|
+
readonly estimatorId: string;
|
|
182
|
+
/** Estimator version — versioned, auditable changes */
|
|
183
|
+
readonly estimatorVersion: EstimatorVersionId;
|
|
184
|
+
/**
|
|
185
|
+
* Compute deliberation token charge from invocation inputs.
|
|
186
|
+
*
|
|
187
|
+
* DBA-I3: MUST be deterministic — same inputs, same version → same charge.
|
|
188
|
+
* DBA-I3: MUST NOT use wall-clock time, latency, queue delay, hidden state.
|
|
189
|
+
*
|
|
190
|
+
* @param basis - Replay-stable invocation inputs (recorded for audit)
|
|
191
|
+
* @returns Non-negative integer deliberation token charge
|
|
192
|
+
*/
|
|
193
|
+
estimate(basis: EstimatorInputBasis): number;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* §12.2: Prompt/completion accounting — dual-source provenance [PSD-12].
|
|
197
|
+
* 11 fields.
|
|
198
|
+
*
|
|
199
|
+
* ASYMMETRIC RESOLUTION (Note 5):
|
|
200
|
+
* - Enforcement: provider-reported is authoritative (DBA-I2)
|
|
201
|
+
* - Recording: both sources recorded for verification
|
|
202
|
+
* - Discrepancy: logged when both exist and differ beyond tolerance
|
|
203
|
+
*/
|
|
204
|
+
export interface PromptCompletionAccounting {
|
|
205
|
+
/** Value used for budget enforcement */
|
|
206
|
+
readonly chosenPromptTokens: number;
|
|
207
|
+
/** Value used for budget enforcement */
|
|
208
|
+
readonly chosenCompletionTokens: number;
|
|
209
|
+
/** Which source was authoritative for enforcement */
|
|
210
|
+
readonly provenance: PromptCompletionProvenance;
|
|
211
|
+
/** Provider-reported prompt tokens, null if unavailable */
|
|
212
|
+
readonly providerReportedPrompt: number | null;
|
|
213
|
+
/** Provider-reported completion tokens, null if unavailable */
|
|
214
|
+
readonly providerReportedCompletion: number | null;
|
|
215
|
+
/** Kernel-counted prompt tokens, null if unavailable */
|
|
216
|
+
readonly kernelCountedPrompt: number | null;
|
|
217
|
+
/** Kernel-counted completion tokens, null if unavailable */
|
|
218
|
+
readonly kernelCountedCompletion: number | null;
|
|
219
|
+
/** Counting basis when kernel_counted, null when provider_reported */
|
|
220
|
+
readonly kernelCountingBasis: KernelCountingBasis | null;
|
|
221
|
+
/** True when both provider and kernel values exist and differ */
|
|
222
|
+
readonly discrepancyDetected: boolean;
|
|
223
|
+
/** |provider - kernel| for prompt, when discrepancy detected */
|
|
224
|
+
readonly promptDiscrepancyAmount: number | null;
|
|
225
|
+
/** |provider - kernel| for completion, when discrepancy detected */
|
|
226
|
+
readonly completionDiscrepancyAmount: number | null;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* §12.2: Deliberation accounting.
|
|
230
|
+
* 5 fields.
|
|
231
|
+
*
|
|
232
|
+
* Per-invocation accounting mode (DBA-I4): determined by what the provider
|
|
233
|
+
* actually returns, not inferred from model name or global config.
|
|
234
|
+
*/
|
|
235
|
+
export interface DeliberationAccounting {
|
|
236
|
+
/** Deliberation tokens charged (provider-authoritative or estimated) */
|
|
237
|
+
readonly deliberationTokens: number;
|
|
238
|
+
/** Per-invocation accounting mode */
|
|
239
|
+
readonly accountingMode: DeliberationAccountingMode;
|
|
240
|
+
/** Estimator identity when estimated, null when provider_authoritative */
|
|
241
|
+
readonly estimatorId: string | null;
|
|
242
|
+
/** Estimator version when estimated, null when provider_authoritative */
|
|
243
|
+
readonly estimatorVersion: string | null;
|
|
244
|
+
/** Input values used for estimate, null when provider_authoritative */
|
|
245
|
+
readonly estimatorInputBasis: EstimatorInputBasis | null;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* §12.2: Context budget computation — dual-source provenance [PSD-12].
|
|
249
|
+
* 10 fields.
|
|
250
|
+
*
|
|
251
|
+
* ASYMMETRIC RESOLUTION (Note 5):
|
|
252
|
+
* - Context window: more restrictive value wins (§7.4)
|
|
253
|
+
* - Both values recorded for verification
|
|
254
|
+
* - Discrepancy logged when both exist and differ
|
|
255
|
+
*
|
|
256
|
+
* NOTE 2: systemOverhead = infrastructure only (system prompt, safety preamble,
|
|
257
|
+
* tool definitions, pipeline metadata). NOT application control state (mission
|
|
258
|
+
* objective, task definition, budgets, policies — those are CGP Position 1).
|
|
259
|
+
*/
|
|
260
|
+
export interface ContextBudgetComputation {
|
|
261
|
+
/** Value used for admission — more restrictive when dual-source (§7.4) */
|
|
262
|
+
readonly chosenAvailableInputWindow: number;
|
|
263
|
+
/** Which source was used */
|
|
264
|
+
readonly windowProvenance: WindowDerivationMode;
|
|
265
|
+
/** Provider-reported window, null if unavailable */
|
|
266
|
+
readonly providerReportedWindow: number | null;
|
|
267
|
+
/** Kernel-derived window, null if unavailable */
|
|
268
|
+
readonly kernelDerivedWindow: number | null;
|
|
269
|
+
/** Kernel derivation method/version, null when provider_authoritative */
|
|
270
|
+
readonly kernelDerivationVersion: string | null;
|
|
271
|
+
/** True when both provider and kernel values exist and differ */
|
|
272
|
+
readonly windowDiscrepancyDetected: boolean;
|
|
273
|
+
/** Measured token cost of required system content (DBA-I15) */
|
|
274
|
+
readonly systemOverhead: number;
|
|
275
|
+
/** Computation basis/version identifier for overhead (DBA-I15) */
|
|
276
|
+
readonly overheadComputationBasis: string;
|
|
277
|
+
/** Effective ceiling after inheritance/merge (DBA-I12), null if no ceiling applies */
|
|
278
|
+
readonly effectivePolicyCeiling: number | null;
|
|
279
|
+
/** Computed result — non-negative (DBA-I14) */
|
|
280
|
+
readonly effectiveContextBudget: number;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* §12.2: Invocation admissibility envelope — pre-invocation (PSD-7, PSD-13).
|
|
284
|
+
* 3 fields.
|
|
285
|
+
*
|
|
286
|
+
* PSD-13: Envelope is finalized AFTER context compilation and canonical
|
|
287
|
+
* serialization, BEFORE provider call. Token component uses actual serialized
|
|
288
|
+
* prompt size, not pre-compilation estimate.
|
|
289
|
+
*
|
|
290
|
+
* PSD-11: Per-dimension vector — prompt/completion and deliberation are NEVER
|
|
291
|
+
* combined into one synthetic scalar for admissibility comparison.
|
|
292
|
+
*/
|
|
293
|
+
export interface AdmissibilityEnvelope {
|
|
294
|
+
/** Prompt (actual serialized) + completion allowance — post-serialization (PSD-13) */
|
|
295
|
+
readonly tokenEnvelope: number;
|
|
296
|
+
/** Deliberation allowance */
|
|
297
|
+
readonly deliberationEnvelope: number;
|
|
298
|
+
/** Admissibility result */
|
|
299
|
+
readonly result: AdmissibilityResult;
|
|
300
|
+
}
|
|
301
|
+
/** Admissibility outcome — identifies failing dimension(s) */
|
|
302
|
+
export type AdmissibilityResult = 'admitted' | 'rejected_token' | 'rejected_deliberation' | 'rejected_both';
|
|
303
|
+
/**
|
|
304
|
+
* §12.2: InvocationAccounting — the complete per-invocation accounting record.
|
|
305
|
+
* 34 fields across 4 nested groups + 5 top-level fields.
|
|
306
|
+
*
|
|
307
|
+
* This is the most complex record in v3.3.0. Each field is typed precisely.
|
|
308
|
+
* Each must be populated correctly. Each must be recorded for replay (CF-10).
|
|
309
|
+
*/
|
|
310
|
+
export interface InvocationAccounting {
|
|
311
|
+
/** Unique invocation identifier */
|
|
312
|
+
readonly invocationId: BudgetInvocationId;
|
|
313
|
+
/** Task this invocation belongs to */
|
|
314
|
+
readonly taskId: TaskId;
|
|
315
|
+
/** Mission this invocation belongs to */
|
|
316
|
+
readonly missionId: MissionId;
|
|
317
|
+
/** Non-constitutional provider billing if reported, null otherwise */
|
|
318
|
+
readonly providerBilledTokens: number | null;
|
|
319
|
+
/** Invocation timestamp (epoch ms) */
|
|
320
|
+
readonly timestamp: number;
|
|
321
|
+
/** Prompt/completion accounting — 11 fields */
|
|
322
|
+
readonly promptCompletionAccounting: PromptCompletionAccounting;
|
|
323
|
+
/** Deliberation accounting — 5 fields */
|
|
324
|
+
readonly deliberationAccounting: DeliberationAccounting;
|
|
325
|
+
/** Context budget computation — 10 fields */
|
|
326
|
+
readonly contextBudgetComputation: ContextBudgetComputation;
|
|
327
|
+
/** Admissibility envelope — 3 fields */
|
|
328
|
+
readonly admissibilityEnvelope: AdmissibilityEnvelope;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* §7.3: Inputs to effectiveContextBudget computation.
|
|
332
|
+
* All values must be recorded per invocation (DBA-I9) for replay.
|
|
333
|
+
*/
|
|
334
|
+
export interface ECBComputationInput {
|
|
335
|
+
/** Substrate-reported context tokens available (PSD-4) */
|
|
336
|
+
readonly availableInputWindow: number;
|
|
337
|
+
/** How the window value was derived */
|
|
338
|
+
readonly windowDerivationMode: WindowDerivationMode;
|
|
339
|
+
/** Kernel derivation method/version when kernel_derived, null when provider */
|
|
340
|
+
readonly kernelDerivationVersion: string | null;
|
|
341
|
+
/** Token cost of required system content (DBA-I15) — infrastructure only (Note 2) */
|
|
342
|
+
readonly systemOverhead: number;
|
|
343
|
+
/** Overhead computation basis/version (DBA-I15) */
|
|
344
|
+
readonly overheadComputationBasis: string;
|
|
345
|
+
/** Most restrictive ceiling after inheritance/merge (DBA-I12), null if none */
|
|
346
|
+
readonly effectivePolicyCeiling: number | null;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* §7.3: Result of ECB computation.
|
|
350
|
+
* DBA-I14: always non-negative.
|
|
351
|
+
*/
|
|
352
|
+
export interface ECBComputationResult {
|
|
353
|
+
/** The computed effective context budget — non-negative (DBA-I14) */
|
|
354
|
+
readonly effectiveContextBudget: number;
|
|
355
|
+
/** True if negative-normalization was applied */
|
|
356
|
+
readonly wasNormalized: boolean;
|
|
357
|
+
/** The raw value before normalization (may be negative) */
|
|
358
|
+
readonly rawValue: number;
|
|
359
|
+
}
|
|
360
|
+
/** Budget dimension identifier for threshold events (DBA-I1: independent) */
|
|
361
|
+
export type ThresholdDimension = 'token' | 'deliberation';
|
|
362
|
+
/** Default threshold percentages — v1 design choice, not freeze-derived law (PSD-10) */
|
|
363
|
+
export declare const DEFAULT_THRESHOLD_PERCENTAGES: readonly [25, 50, 75, 90];
|
|
364
|
+
export type ThresholdPercentage = typeof DEFAULT_THRESHOLD_PERCENTAGES[number];
|
|
365
|
+
/**
|
|
366
|
+
* §6.1: Dimension-specific budget threshold event payload.
|
|
367
|
+
*
|
|
368
|
+
* DBA-I1: Events identify the triggering dimension. Neither dimension's
|
|
369
|
+
* threshold logic references the other's state. Independent evaluation.
|
|
370
|
+
*
|
|
371
|
+
* DBA-I4: Events derived from estimated deliberation carry estimate marking.
|
|
372
|
+
*/
|
|
373
|
+
export interface BudgetThresholdEvent {
|
|
374
|
+
/** Which dimension triggered this event */
|
|
375
|
+
readonly dimension: ThresholdDimension;
|
|
376
|
+
/** Threshold percentage crossed */
|
|
377
|
+
readonly thresholdPercent: ThresholdPercentage;
|
|
378
|
+
/** Allocated budget for this dimension */
|
|
379
|
+
readonly allocated: number;
|
|
380
|
+
/** Consumed at time of event */
|
|
381
|
+
readonly consumed: number;
|
|
382
|
+
/** Remaining at time of event */
|
|
383
|
+
readonly remaining: number;
|
|
384
|
+
/** For deliberation: accounting mode at time of triggering invocation */
|
|
385
|
+
readonly accountingMode: DeliberationAccountingMode | null;
|
|
386
|
+
/** For deliberation when estimated: estimator version */
|
|
387
|
+
readonly estimatorVersion: string | null;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* §6.1: Dimension-specific budget exceeded event payload.
|
|
391
|
+
* Emitted when remaining hits zero and overage is recorded (DBA-I13).
|
|
392
|
+
*/
|
|
393
|
+
export interface BudgetExceededEvent {
|
|
394
|
+
/** Which dimension was exceeded */
|
|
395
|
+
readonly dimension: ThresholdDimension;
|
|
396
|
+
/** Allocated budget */
|
|
397
|
+
readonly allocated: number;
|
|
398
|
+
/** Total consumed (including overage-causing invocation) */
|
|
399
|
+
readonly consumed: number;
|
|
400
|
+
/** Overage amount (consumed - allocated) */
|
|
401
|
+
readonly overage: number;
|
|
402
|
+
/** Accounting mode for the triggering invocation */
|
|
403
|
+
readonly accountingMode: DeliberationAccountingMode | null;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* §5.1 Phase 1: Pre-invocation admissibility check input.
|
|
407
|
+
*
|
|
408
|
+
* PSD-14: Evaluates actual invocation envelope against task's currently
|
|
409
|
+
* available headroom (reserved-or-remaining), not planning-time estimates.
|
|
410
|
+
*/
|
|
411
|
+
export interface PreInvocationCheckInput {
|
|
412
|
+
/** Task requesting the invocation */
|
|
413
|
+
readonly taskId: TaskId;
|
|
414
|
+
/** Mission owning the task */
|
|
415
|
+
readonly missionId: MissionId;
|
|
416
|
+
/** Token envelope: actual serialized prompt + completion allowance (PSD-13) */
|
|
417
|
+
readonly tokenEnvelope: number;
|
|
418
|
+
/** Deliberation envelope: deliberation allowance */
|
|
419
|
+
readonly deliberationEnvelope: number;
|
|
420
|
+
/** Binding 12: Correlation identifier for trace event linking (Phase 0A governance) */
|
|
421
|
+
readonly correlationId: CorrelationId;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* §5.1 Phase 1: Pre-invocation admissibility check result.
|
|
425
|
+
* DBA-I10: Joint feasibility — ALL dimensions must pass.
|
|
426
|
+
*/
|
|
427
|
+
export interface PreInvocationCheckResult {
|
|
428
|
+
/** Whether the invocation is admissible */
|
|
429
|
+
readonly admissible: boolean;
|
|
430
|
+
/** Available token headroom (reserved-or-remaining) */
|
|
431
|
+
readonly tokenHeadroom: number;
|
|
432
|
+
/** Available deliberation headroom (reserved-or-remaining) */
|
|
433
|
+
readonly deliberationHeadroom: number;
|
|
434
|
+
/** Per-dimension pass/fail detail */
|
|
435
|
+
readonly tokenPass: boolean;
|
|
436
|
+
/** Per-dimension pass/fail detail */
|
|
437
|
+
readonly deliberationPass: boolean;
|
|
438
|
+
/** When rejected: which dimension(s) failed */
|
|
439
|
+
readonly rejectionDimension: AdmissibilityResult;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* §5.1 Phase 2: Post-invocation reconciliation input.
|
|
443
|
+
*
|
|
444
|
+
* DBA-I16: Usage recorded when actually incurred at provider boundary,
|
|
445
|
+
* even if invocation fails semantically.
|
|
446
|
+
*/
|
|
447
|
+
export interface PostInvocationReconciliationInput {
|
|
448
|
+
readonly invocationId: BudgetInvocationId;
|
|
449
|
+
readonly taskId: TaskId;
|
|
450
|
+
readonly missionId: MissionId;
|
|
451
|
+
/** Actual prompt/completion from provider or kernel counting */
|
|
452
|
+
readonly promptCompletionAccounting: PromptCompletionAccounting;
|
|
453
|
+
/** Actual or estimated deliberation */
|
|
454
|
+
readonly deliberationAccounting: DeliberationAccounting;
|
|
455
|
+
/** Whether the provider call was emitted (DBA-I16) */
|
|
456
|
+
readonly providerCallEmitted: boolean;
|
|
457
|
+
/** Whether the provider processed tokens before error (DBA-I16) */
|
|
458
|
+
readonly providerProcessedTokens: boolean;
|
|
459
|
+
/** Binding 12: Correlation identifier for trace event linking (Phase 0A governance) */
|
|
460
|
+
readonly correlationId: CorrelationId;
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* §5.1 Phase 2: Post-invocation reconciliation result.
|
|
464
|
+
* DBA-I13: Remaining clamped to zero, overage recorded explicitly.
|
|
465
|
+
*/
|
|
466
|
+
export interface PostInvocationReconciliationResult {
|
|
467
|
+
/** Updated token budget state after reconciliation */
|
|
468
|
+
readonly tokenBudgetAfter: ConsumptiveBudgetDimension;
|
|
469
|
+
/** Updated deliberation budget state after reconciliation */
|
|
470
|
+
readonly deliberationBudgetAfter: ConsumptiveBudgetDimension;
|
|
471
|
+
/** Token threshold events that fired */
|
|
472
|
+
readonly tokenThresholdEvents: readonly BudgetThresholdEvent[];
|
|
473
|
+
/** Deliberation threshold events that fired */
|
|
474
|
+
readonly deliberationThresholdEvents: readonly BudgetThresholdEvent[];
|
|
475
|
+
/** Token exceeded event if applicable */
|
|
476
|
+
readonly tokenExceededEvent: BudgetExceededEvent | null;
|
|
477
|
+
/** Deliberation exceeded event if applicable */
|
|
478
|
+
readonly deliberationExceededEvent: BudgetExceededEvent | null;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* §8: SC-8 extended amount — gains deliberation dimension.
|
|
482
|
+
* contextPolicy is NOT requestable through SC-8 (DBA-I6, §8).
|
|
483
|
+
*/
|
|
484
|
+
export interface SC8BudgetAmount {
|
|
485
|
+
readonly tokens?: number;
|
|
486
|
+
readonly deliberation?: number;
|
|
487
|
+
readonly time?: number;
|
|
488
|
+
readonly compute?: number;
|
|
489
|
+
readonly storage?: number;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* PSD-12: Discrepancy event payload — logged when provider and kernel values differ.
|
|
493
|
+
*
|
|
494
|
+
* Asymmetric resolution:
|
|
495
|
+
* - Prompt/completion: provider authoritative for enforcement
|
|
496
|
+
* - Context window: more restrictive value used for admission
|
|
497
|
+
*/
|
|
498
|
+
export interface DiscrepancyEvent {
|
|
499
|
+
/** Which surface has the discrepancy */
|
|
500
|
+
readonly surface: 'prompt_completion' | 'context_window';
|
|
501
|
+
/** Provider-reported value */
|
|
502
|
+
readonly providerValue: number;
|
|
503
|
+
/** Kernel-counted/derived value */
|
|
504
|
+
readonly kernelValue: number;
|
|
505
|
+
/** Absolute difference */
|
|
506
|
+
readonly discrepancyAmount: number;
|
|
507
|
+
/** Which value was used for enforcement/admission */
|
|
508
|
+
readonly chosenValue: number;
|
|
509
|
+
/** Why this value was chosen */
|
|
510
|
+
readonly resolutionRule: 'provider_authoritative' | 'more_restrictive';
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* §7.5: System overhead computation basis.
|
|
514
|
+
*
|
|
515
|
+
* DBA-I15: Must be governed, replay-stable, versioned.
|
|
516
|
+
* Not a hardcoded constant. Not dependent on hidden mutable logic.
|
|
517
|
+
* Deterministic: identical system content + identical version → identical overhead.
|
|
518
|
+
*
|
|
519
|
+
* NOTE 2: systemOverhead = infrastructure only. NOT application control state.
|
|
520
|
+
* System prompt, safety preamble, tool definitions, pipeline metadata.
|
|
521
|
+
* Mission objective, task definition, budgets, policies → CGP Position 1.
|
|
522
|
+
*/
|
|
523
|
+
export interface SystemOverheadBasis {
|
|
524
|
+
/** Computation method/version identifier */
|
|
525
|
+
readonly computationVersion: string;
|
|
526
|
+
/** Tokenizer used for measurement (if tokenizer-based) */
|
|
527
|
+
readonly tokenizer: string | null;
|
|
528
|
+
/** Tokenizer version */
|
|
529
|
+
readonly tokenizerVersion: string | null;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* ECB computation service — §7.3.
|
|
533
|
+
* Computes effectiveContextBudget per invocation from substrate-reported
|
|
534
|
+
* window, kernel-determined overhead, and governance-configured ceiling.
|
|
535
|
+
*
|
|
536
|
+
* DBA-I5: Fresh per invocation. No cross-invocation depletion.
|
|
537
|
+
* DBA-I14: Result always non-negative.
|
|
538
|
+
*/
|
|
539
|
+
export interface ECBComputationService {
|
|
540
|
+
/**
|
|
541
|
+
* Compute effectiveContextBudget for a single invocation.
|
|
542
|
+
*
|
|
543
|
+
* Formula (§7.3):
|
|
544
|
+
* if effectivePolicyCeiling present:
|
|
545
|
+
* ECB = min(availableInputWindow - systemOverhead, effectivePolicyCeiling)
|
|
546
|
+
* else:
|
|
547
|
+
* ECB = availableInputWindow - systemOverhead
|
|
548
|
+
* if ECB < 0: ECB = 0 (DBA-I14)
|
|
549
|
+
*/
|
|
550
|
+
compute(input: ECBComputationInput): ECBComputationResult;
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Context policy governance — §7.1, §7.2.
|
|
554
|
+
* Validates and merges context policy ceilings across mission/task hierarchy.
|
|
555
|
+
*/
|
|
556
|
+
export interface ContextPolicyGovernor {
|
|
557
|
+
/**
|
|
558
|
+
* DBA-I8: Validate child ceiling against parent.
|
|
559
|
+
* Child ceiling ≤ parent ceiling. Widening is non-conforming.
|
|
560
|
+
*/
|
|
561
|
+
validateInheritance(parentCeiling: number | null, childCeiling: number | null): {
|
|
562
|
+
readonly valid: boolean;
|
|
563
|
+
readonly reason: string | null;
|
|
564
|
+
};
|
|
565
|
+
/**
|
|
566
|
+
* DBA-I12: Merge applicable ceilings to find effective ceiling.
|
|
567
|
+
* Returns the most restrictive ceiling from all applicable scopes.
|
|
568
|
+
*/
|
|
569
|
+
mergeEffectiveCeiling(missionCeiling: number | null, taskCeiling: number | null): number | null;
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Pre-invocation admissibility service — §5.1, DBA-I10.
|
|
573
|
+
* Evaluates whether a model invocation should proceed.
|
|
574
|
+
*
|
|
575
|
+
* DBA-I10: Joint feasibility — ALL dimensions must pass.
|
|
576
|
+
* PSD-14: Evaluates against task's available headroom (reserved-or-remaining).
|
|
577
|
+
*/
|
|
578
|
+
export interface InvocationAdmissibilityService {
|
|
579
|
+
/**
|
|
580
|
+
* Phase 1: Pre-invocation check.
|
|
581
|
+
* Evaluates token and deliberation envelope against available headroom.
|
|
582
|
+
*/
|
|
583
|
+
checkAdmissibility(input: PreInvocationCheckInput): PreInvocationCheckResult;
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Post-invocation reconciliation service — §5.1 Phase 2.
|
|
587
|
+
* Records actual consumption, evaluates thresholds, handles overage.
|
|
588
|
+
*
|
|
589
|
+
* DBA-I16: Charges usage actually incurred at provider boundary.
|
|
590
|
+
* DBA-I13: Clamps remaining to zero, records overage explicitly.
|
|
591
|
+
*/
|
|
592
|
+
export interface InvocationReconciliationService {
|
|
593
|
+
/**
|
|
594
|
+
* Phase 2: Post-invocation reconciliation.
|
|
595
|
+
* Records consumption, evaluates thresholds, handles overage.
|
|
596
|
+
*/
|
|
597
|
+
reconcile(input: PostInvocationReconciliationInput): PostInvocationReconciliationResult;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* System overhead computation service — §7.5, DBA-I15.
|
|
601
|
+
* Computes token cost of required system content.
|
|
602
|
+
*/
|
|
603
|
+
export interface SystemOverheadService {
|
|
604
|
+
/**
|
|
605
|
+
* Compute system overhead for the given system content.
|
|
606
|
+
* DBA-I15: governed, replay-stable, versioned, deterministic.
|
|
607
|
+
*/
|
|
608
|
+
computeOverhead(systemContent: string, basis: SystemOverheadBasis): number;
|
|
609
|
+
/** Get the current computation basis */
|
|
610
|
+
getBasis(): SystemOverheadBasis;
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Substrate window service — §7.4, PSD-4.
|
|
614
|
+
* Provides per-invocation availableInputWindow.
|
|
615
|
+
*/
|
|
616
|
+
export interface SubstrateWindowService {
|
|
617
|
+
/**
|
|
618
|
+
* Get available input window for a specific model invocation.
|
|
619
|
+
* PSD-4: Accounts for model raw limit, reserved completion, provider constraints.
|
|
620
|
+
* PSD-12: When both provider and kernel values exist, returns both with derivation modes.
|
|
621
|
+
*/
|
|
622
|
+
getAvailableInputWindow(modelId: string): {
|
|
623
|
+
readonly chosenValue: number;
|
|
624
|
+
readonly derivationMode: WindowDerivationMode;
|
|
625
|
+
readonly providerReportedWindow: number | null;
|
|
626
|
+
readonly kernelDerivedWindow: number | null;
|
|
627
|
+
readonly kernelDerivationVersion: string | null;
|
|
628
|
+
readonly discrepancyDetected: boolean;
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* DBA Facade — the top-level interface that subsystems import from DBA.
|
|
633
|
+
*
|
|
634
|
+
* DBA is upstream of EGP and CGP:
|
|
635
|
+
* EGP → imports deliberationBudget as reservable dimension
|
|
636
|
+
* CGP → imports effectiveContextBudget as admission ceiling
|
|
637
|
+
*/
|
|
638
|
+
export interface BudgetGovernanceAmendment {
|
|
639
|
+
readonly ecb: ECBComputationService;
|
|
640
|
+
readonly policyGovernor: ContextPolicyGovernor;
|
|
641
|
+
readonly admissibility: InvocationAdmissibilityService;
|
|
642
|
+
readonly reconciliation: InvocationReconciliationService;
|
|
643
|
+
readonly overhead: SystemOverheadService;
|
|
644
|
+
readonly window: SubstrateWindowService;
|
|
645
|
+
readonly estimator: DeliberationEstimator;
|
|
646
|
+
}
|
|
647
|
+
export declare const DBA_ERROR_CODES: Readonly<{
|
|
648
|
+
readonly TOKEN_HEADROOM_INSUFFICIENT: "DBA_TOKEN_HEADROOM_INSUFFICIENT";
|
|
649
|
+
readonly DELIBERATION_HEADROOM_INSUFFICIENT: "DBA_DELIBERATION_HEADROOM_INSUFFICIENT";
|
|
650
|
+
readonly JOINT_FEASIBILITY_FAILED: "DBA_JOINT_FEASIBILITY_FAILED";
|
|
651
|
+
readonly CEILING_EXCEEDS_PARENT: "DBA_CEILING_EXCEEDS_PARENT";
|
|
652
|
+
readonly CEILING_NEGATIVE: "DBA_CEILING_NEGATIVE";
|
|
653
|
+
readonly CONTEXT_POLICY_NOT_REQUESTABLE: "DBA_CONTEXT_POLICY_NOT_REQUESTABLE";
|
|
654
|
+
readonly ECB_NEGATIVE_NORMALIZED: "DBA_ECB_NEGATIVE_NORMALIZED";
|
|
655
|
+
readonly CONTROL_STATE_OVERFLOW: "DBA_CONTROL_STATE_OVERFLOW";
|
|
656
|
+
readonly ESTIMATOR_VERSION_MISMATCH: "DBA_ESTIMATOR_VERSION_MISMATCH";
|
|
657
|
+
readonly FORBIDDEN_ESTIMATOR_INPUT: "DBA_FORBIDDEN_ESTIMATOR_INPUT";
|
|
658
|
+
readonly PROMPT_COMPLETION_DISCREPANCY: "DBA_PROMPT_COMPLETION_DISCREPANCY";
|
|
659
|
+
readonly CONTEXT_WINDOW_DISCREPANCY: "DBA_CONTEXT_WINDOW_DISCREPANCY";
|
|
660
|
+
readonly SILENT_TRUNCATION_ATTEMPTED: "DBA_SILENT_TRUNCATION_ATTEMPTED";
|
|
661
|
+
/** DC-DBA-811: Both provider and kernel measurement failed — no conforming accounting source */
|
|
662
|
+
readonly MEASUREMENT_FAILURE: "DBA_MEASUREMENT_FAILURE";
|
|
663
|
+
/** DC-DBA-403: Negative ceiling value rejected at policy-setting time */
|
|
664
|
+
readonly NEGATIVE_CEILING_REJECTED: "DBA_NEGATIVE_CEILING_REJECTED";
|
|
665
|
+
}>;
|
|
666
|
+
export declare const DBA_EVENTS: Readonly<{
|
|
667
|
+
readonly TOKEN_BUDGET_THRESHOLD: "dba.token_budget_threshold";
|
|
668
|
+
readonly DELIBERATION_BUDGET_THRESHOLD: "dba.deliberation_budget_threshold";
|
|
669
|
+
readonly TOKEN_BUDGET_EXCEEDED: "dba.token_budget_exceeded";
|
|
670
|
+
readonly DELIBERATION_BUDGET_EXCEEDED: "dba.deliberation_budget_exceeded";
|
|
671
|
+
readonly PROMPT_COMPLETION_DISCREPANCY: "dba.prompt_completion_discrepancy";
|
|
672
|
+
readonly CONTEXT_WINDOW_DISCREPANCY: "dba.context_window_discrepancy";
|
|
673
|
+
readonly ACCOUNTING_MODE_TRANSITION: "dba.accounting_mode_transition";
|
|
674
|
+
readonly ESTIMATOR_VERSION_CHANGED: "dba.estimator_version_changed";
|
|
675
|
+
readonly ECB_NEGATIVE_NORMALIZED: "dba.ecb_negative_normalized";
|
|
676
|
+
/** DC-DBA-811: Both provider and kernel counting fail for prompt/completion */
|
|
677
|
+
readonly MEASUREMENT_FAILURE: "dba.measurement_failure";
|
|
678
|
+
/** DC-DBA-910: ECB=0 advisory — invocation will fail CGP admission */
|
|
679
|
+
readonly ECB_ZERO_ADVISORY: "dba.ecb_zero_advisory";
|
|
680
|
+
/** DC-DBA-306: Budget mutated between pre-check and reconciliation by external action */
|
|
681
|
+
readonly EXTERNAL_BUDGET_MUTATION_OVERAGE: "dba.external_budget_mutation_overage";
|
|
682
|
+
/** DC-DBA-901 (amended): SC-8 approval timeout — task liveness defense */
|
|
683
|
+
readonly SC8_APPROVAL_TIMEOUT: "dba.sc8_approval_timeout";
|
|
684
|
+
/** DC-DBA-909: Parent ceiling change while child tasks active */
|
|
685
|
+
readonly CEILING_CHANGE_PROPAGATION: "dba.ceiling_change_propagation";
|
|
686
|
+
}>;
|
|
687
|
+
/** PSD-10: Default threshold percentages for both dimensions */
|
|
688
|
+
export declare const DBA_DEFAULT_THRESHOLD_PERCENTAGES: readonly ThresholdPercentage[];
|
|
689
|
+
/** v1 contextPolicy shape: ceiling only (PSD-3) */
|
|
690
|
+
export declare const CONTEXT_POLICY_V1_FIELDS: readonly ["ceiling"];
|
|
691
|
+
/**
|
|
692
|
+
* InvocationAccounting field count verification:
|
|
693
|
+
*
|
|
694
|
+
* Top-level: 5 (invocationId, taskId, missionId, providerBilledTokens, timestamp)
|
|
695
|
+
* PromptCompletion: 11 (chosen×2, provenance, providerReported×2, kernelCounted×2,
|
|
696
|
+
* kernelCountingBasis, discrepancyDetected, discrepancyAmount×2)
|
|
697
|
+
* Deliberation: 5 (deliberationTokens, accountingMode, estimatorId, estimatorVersion,
|
|
698
|
+
* estimatorInputBasis)
|
|
699
|
+
* ContextBudget: 10 (chosenAvailableInputWindow, windowProvenance, providerReportedWindow,
|
|
700
|
+
* kernelDerivedWindow, kernelDerivationVersion, windowDiscrepancyDetected,
|
|
701
|
+
* systemOverhead, overheadComputationBasis, effectivePolicyCeiling,
|
|
702
|
+
* effectiveContextBudget)
|
|
703
|
+
* Admissibility: 3 (tokenEnvelope, deliberationEnvelope, result)
|
|
704
|
+
*
|
|
705
|
+
* TOTAL: 34
|
|
706
|
+
*/
|
|
707
|
+
export declare const INVOCATION_ACCOUNTING_FIELD_COUNT: 34;
|
|
708
|
+
//# sourceMappingURL=dba_types.d.ts.map
|