chainlesschain 0.166.44 → 0.166.46
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/package.json +3 -3
- package/src/assets/web-panel/.build-hash +1 -1
- package/src/assets/web-panel/assets/{AIOps-HiHMDVK3.js → AIOps-Cp8KiMmv.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-H2RKuS8V.js → ActionButton-B4d9BGsm.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-CBPFBB61.js → Analytics-Cf9yXTkv.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-Da-3Laze.js → AppLayout-40UkmxtP.js} +4 -4
- package/src/assets/web-panel/assets/{Artifacts-DiRQ9yzD.js → Artifacts-Ckkb4oOA.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-C9LtWEBh.js → Audit-Dnf569k5.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-4rpi7fVg.js → BackgroundAgents-CA6bLem4.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-B8VQmHys.js → Backup-ChQU0I_Q.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-iCVpF2DK.js → BaseInput-BHeZXnNN.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-BrQaXBwC.js → Chat-DcFVYB2E.js} +5 -5
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-HIyU-9c0.js → ChatBubbleRenderer-Bi2SY9E_.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-CsV__0_R.js → Checkbox-2PDbejv2.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-BvFeCIAE.js → Codegen-DJBn1RAu.js} +1 -1
- package/src/assets/web-panel/assets/{Col-CagxV1O8.js → Col-CPRq7n6y.js} +1 -1
- package/src/assets/web-panel/assets/{Community-DAWr4ahG.js → Community-axvINFMi.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-Ba49Tdc2.js → Compact-_OX4Qbe0.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-Brk-MSO4.js → Compliance-DWAkvzRL.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-DeKH1v0o.js → Cowork-CUIJ25oj.js} +2 -2
- package/src/assets/web-panel/assets/{Cron-AHB-T-VL.js → Cron-nR0m7H3_.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-Zbcrtimh.js → Crosschain-CgTLXzh_.js} +1 -1
- package/src/assets/web-panel/assets/{DID-ByFa1MWG.js → DID-BllzRB6Q.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-9jKovyuH.js → Dashboard-C9f0IIBN.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-DY8TaXi5.js → Dropdown-BkahetiO.js} +1 -1
- package/src/assets/web-panel/assets/EmailListRenderer-rartVC-k.js +1 -0
- package/src/assets/web-panel/assets/EvolutionSettings-BqpG3XHV.js +1 -0
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-5ao8smvA.js → FamilyGuardDashboard-DgUdFvw1.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-RTpNXXHT.js → Federation-oFpIQU6g.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-DWZvRMWv.js → FormItemContext-BUH5xlyP.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-CWi8SGvx.js → GenericCardRenderer-ilRa-ueg.js} +1 -1
- package/src/assets/web-panel/assets/{Git-CCLgDIqs.js → Git-DlHHSF8j.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-DUuyKrQl.js → Governance-yQiiXIWe.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-RkFcM2A0.js → Inference-BUDRVGOP.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-C-QTauZr.js → KnowledgeGraph-BaGyIoN1.js} +1 -1
- package/src/assets/web-panel/assets/Logs-C1cO6zE0.js +2 -0
- package/src/assets/web-panel/assets/{MarkdownRenderer-CgiHBe0A.js → MarkdownRenderer-_z_Iaoes.js} +1 -1
- package/src/assets/web-panel/assets/{Marketplace-CK1kSFDt.js → Marketplace-CM8cGL0K.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-BcaVwoY6.js → McpTools-CDqAMU0U.js} +3 -3
- package/src/assets/web-panel/assets/{Memory-QEI4xRwF.js → Memory-CfB0-Ofv.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-BqD-R0Ek.js → MobileBridge-BL18ytvB.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-CwFoXf1M.js → MobileProjects-PIyyxbuJ.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-CTZ6qICG.js → Mtc-BTTrFCol.js} +4 -4
- package/src/assets/web-panel/assets/{MtcAudit-Cn7y2BzO.js → MtcAudit-JHZn037c.js} +4 -4
- package/src/assets/web-panel/assets/{Multisig-BCjsdGiN.js → Multisig-CMf9NEdB.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-CupTVNtA.js → NLProgramming-Dhk3qaus.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-C8kO3mGt.js → Notes-6F8EarNN.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-Cn-MJ8sQ.js → NotificationSettings-gxdaVEit.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-BX4PrVfN.js → OrderTableRenderer-gVgXQWdc.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-G_RjOL7M.js → Organization-CzvHcDNO.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-BvX644ya.js → Overflow-Dclx30Vv.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-yWmLgYgQ.js → P2P-CM0Wm9vZ.js} +2 -2
- package/src/assets/web-panel/assets/PdhVaultBrowser-fYmQzmTA.js +7 -0
- package/src/assets/web-panel/assets/{Permissions-DtU8fhcZ.js → Permissions-B_oATenG.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-B17Vyk-x.js → PersonalDataHub-CptiVBh5.js} +5 -5
- package/src/assets/web-panel/assets/{Pipeline-BZUsTyhP.js → Pipeline-DkHzgyyI.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-BswdhlPL.js → Privacy-DzZvwcKh.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-sJxSlY0C.js → ProjectInit-CzkCs-5G.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-BnbpdOke.js → ProjectSettings-BB8dcxRD.js} +2 -2
- package/src/assets/web-panel/assets/{Projects-DUjauf-6.js → Projects-B7PW9CFY.js} +1 -1
- package/src/assets/web-panel/assets/{Providers-DhF5I-UR.js → Providers-Tfx-ti1V.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-B3PeCAGo.js → QrScannerModal-EvWlNhfX.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-Cpaxrabg.js → QuickAsk-CUspgbNC.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-DqXFF66-.js → Recommend-COY2g77J.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-DtDQ76Ox.js → RemoteSession-BzMBU6E6.js} +2 -2
- package/src/assets/web-panel/assets/{Reputation-BgLLKwu2.js → Reputation-RtYRF4YP.js} +1 -1
- package/src/assets/web-panel/assets/{Row-BuMLhd8M.js → Row-Bva3l9Lc.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-BizxUzBA.js → RssFeed-BhjzLvW3.js} +2 -2
- package/src/assets/web-panel/assets/{Search-CYNrJAQY.js → Search-BYzT2PTR.js} +1 -1
- package/src/assets/web-panel/assets/{Security-CIC02soH.js → Security-Bcl4-KTv.js} +4 -4
- package/src/assets/web-panel/assets/{Services-DD3WxXxw.js → Services-BRRa4A0f.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-C-d9Mbos.js → Skeleton-DYQ016qy.js} +1 -1
- package/src/assets/web-panel/assets/Skills-CAUKL9JA.js +1 -0
- package/src/assets/web-panel/assets/{Sla-DgrqUhns.js → Sla-BTyUqfuD.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-CDXFwOHX.js → SpeechSettings-CUjMihrs.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-BBio_v8M.js → SyncSettings-CvfOSupr.js} +2 -2
- package/src/assets/web-panel/assets/Tasks-EvjNXrWH.js +1 -0
- package/src/assets/web-panel/assets/{Templates-RAPdM85o.js → Templates-wPAp0EoM.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-2jI745PC.js → Tenant-CP0D-q9Q.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-ZCtYBMAe.js → Terminal-CQ0f2iFg.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-DfI36Yg6.js → TimelineRenderer-D3JrGSPb.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-NQ1VaO0W.js → Tokens-yXf2PPp9.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-DwFh5AMe.js → Trigger-DfmMOoZ2.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-Dr0v45uH.js → Trust-BTCyMgf1.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-i7Q1Bdqr.js → UkeySign-DKCwIBHi.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-CXSkk4gl.js → VideoEditing-CQpDSzLO.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-8_cAjou4.js → Wallet-CyFrzC3K.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-jn_3Gma7.js → WebAuthn-D6Nr_1kd.js} +4 -4
- package/src/assets/web-panel/assets/{WorkflowEditor-BmvodVLl.js → WorkflowEditor-CgR9tNrB.js} +1 -1
- package/src/assets/web-panel/assets/{chat-DGi3bmwL.js → chat-CRG_IeyP.js} +1 -1
- package/src/assets/web-panel/assets/{colors-D8OSTOU0.js → colors-MdE3TStI.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-DfNygJU_.js → compact-item-B0LRuiNV.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-B0lT0dbj.js → createContext-B_V5fjcX.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-BtFLt3qI.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-Xtzg_EDR.js → hasIn-DSL-c_hr.js} +1 -1
- package/src/assets/web-panel/assets/{index-BBegBTDb.js → index-0200QxC4.js} +1 -1
- package/src/assets/web-panel/assets/{index-BBR-_Pkv.js → index-B3iW-mhn.js} +1 -1
- package/src/assets/web-panel/assets/{index-BFRkiqtr.js → index-BD0w-888.js} +1 -1
- package/src/assets/web-panel/assets/{index-B4-hl9Rw.js → index-BHp1nSur.js} +1 -1
- package/src/assets/web-panel/assets/{index-BJ6nxb18.js → index-BIDCNwy6.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cx_EAQEh.js → index-BMm8tO2X.js} +1 -1
- package/src/assets/web-panel/assets/{index-BhS9-r8Z.js → index-BNhWoD6d.js} +1 -1
- package/src/assets/web-panel/assets/{index-CShl59Um.js → index-BQAsL19t.js} +1 -1
- package/src/assets/web-panel/assets/{index-DEH5ms1R.js → index-BbZZ7P_c.js} +1 -1
- package/src/assets/web-panel/assets/index-BhuWQHeG.js +1 -0
- package/src/assets/web-panel/assets/{index-DVfE2S0f.js → index-BpwGsAA-.js} +1 -1
- package/src/assets/web-panel/assets/{index-B3ittRaJ.js → index-Bq8-2Ibv.js} +1 -1
- package/src/assets/web-panel/assets/{index-DWpRgQvO.js → index-BsAEd-Do.js} +1 -1
- package/src/assets/web-panel/assets/{index-B0kDqFPU.js → index-C-aKWR2v.js} +1 -1
- package/src/assets/web-panel/assets/{index-CyVOaMS7.js → index-C5dqieYX.js} +1 -1
- package/src/assets/web-panel/assets/{index-De9jsBiC.js → index-C67dPW0L.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cp-yGWti.js → index-CEOAZm5j.js} +1 -1
- package/src/assets/web-panel/assets/{index-B-B7DDjX.js → index-CNytQuFq.js} +1 -1
- package/src/assets/web-panel/assets/{index-ConAvib0.js → index-CPYshcic.js} +1 -1
- package/src/assets/web-panel/assets/{index-EV-o-rTH.js → index-CS3bOhV7.js} +1 -1
- package/src/assets/web-panel/assets/{index-4s8GZJ73.js → index-CVDi4rS9.js} +1 -1
- package/src/assets/web-panel/assets/{index-Byto86PA.js → index-CXMeisJK.js} +1 -1
- package/src/assets/web-panel/assets/{index-DXNWsfbw.js → index-CZICtYJ0.js} +1 -1
- package/src/assets/web-panel/assets/{index-BpsIkWwQ.js → index-CdHMc9LQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-CIbYQLD-.js → index-CdplnAS9.js} +1 -1
- package/src/assets/web-panel/assets/{index-DVnowoxR.js → index-CkN53KiJ.js} +1 -1
- package/src/assets/web-panel/assets/index-D-4tFek3.js +1 -0
- package/src/assets/web-panel/assets/{index-CLRMkKeD.js → index-D3pJBTvo.js} +1 -1
- package/src/assets/web-panel/assets/{index-BVOyO-ZV.js → index-DBwBZwio.js} +1 -1
- package/src/assets/web-panel/assets/{index-DFkgqRqx.js → index-DE7bSYmW.js} +1 -1
- package/src/assets/web-panel/assets/{index-hDo9-qDw.js → index-DRRY44XP.js} +1 -1
- package/src/assets/web-panel/assets/{index-BbTx5wo1.js → index-DVgTf7CZ.js} +1 -1
- package/src/assets/web-panel/assets/{index-BhYM_Rzp.js → index-Didyuq2Z.js} +1 -1
- package/src/assets/web-panel/assets/{index-DZKM2nm2.js → index-DtOTppk8.js} +1 -1
- package/src/assets/web-panel/assets/{index-kdyFlPZw.js → index-KaSejHjf.js} +1 -1
- package/src/assets/web-panel/assets/{index-svr-L6NS.js → index-OBhlHSMN.js} +3 -3
- package/src/assets/web-panel/assets/{index-B2bgL5vL.js → index-SmQfEHjp.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bujix_OR.js → index-Tg3yl8wc.js} +1 -1
- package/src/assets/web-panel/assets/{index-BhhS0xnV.js → index-c8OqO3rq.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-CPsOp_T6.js → initDefaultProps-P8SBN6Di.js} +1 -1
- package/src/assets/web-panel/assets/{motion-8Jakob3_.js → motion-BubbjUT_.js} +1 -1
- package/src/assets/web-panel/assets/{move-DAogsEBs.js → move-Chcykv0I.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-CkA9zZB_.js → mtc-parser-DyiYuGDu.js} +1 -1
- package/src/assets/web-panel/assets/{omit-DMHNkosQ.js → omit-Rdwb_Neb.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-ByIvo_lk.js → pickAttrs-CCr0MYHl.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-CafMUHzz.js → placementArrow-B1ZXz3bb.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-CTehELUQ.js → responsiveObserve-BGEdwej6.js} +1 -1
- package/src/assets/web-panel/assets/{slide-BQISQ1KV.js → slide-CpnsUMaT.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-Drm4jUoK.js → statusUtils-C7x-TVp_.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-DGniLRqn.js → styleChecker-CC5k_791.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-DYz_z9wn.js → useFlexGapSupport-BpZFKsJW.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-DRAPQMjC.js → useFs-CVq5HySy.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-CpgGLb8q.js → usePersonalDataHub-BGkdLryu.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-p6925VWJ.js → vnode-uLtOUEK-.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-ClpO8REK.js → zoom-BfVC9iUs.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/command-help-index.json +1 -1
- package/src/commands/agent.js +14 -1
- package/src/commands/ask.js +13 -8
- package/src/commands/chat.js +8 -5
- package/src/commands/cowork.js +18 -9
- package/src/commands/eval.js +100 -45
- package/src/commands/evolution-deployment.js +58 -0
- package/src/commands/hub.js +13 -7
- package/src/commands/setup.js +31 -1
- package/src/data/changelog.json +18 -5
- package/src/gateways/ws/personal-data-hub-protocol.js +12 -5
- package/src/lazy-dispatch.js +42 -6
- package/src/lib/agent-router.js +25 -23
- package/src/lib/chat-intent-service.js +3 -13
- package/src/lib/context-memory-kernel/provider-context.js +19 -3
- package/src/lib/cowork-adapter.js +9 -4
- package/src/lib/doctor-checkup.js +42 -0
- package/src/lib/eval/evidence.js +203 -0
- package/src/lib/eval/runner.js +16 -2
- package/src/lib/eval/trend.js +4 -3
- package/src/lib/evolution/agent-evolution-ingress.js +60 -8
- package/src/lib/evolution/evolution-deployment-config.js +217 -10
- package/src/lib/evolution/evolution-deployment-descriptor-revocations.js +131 -0
- package/src/lib/evolution/evolution-deployment-loader.js +126 -11
- package/src/lib/evolution/evolution-deployment-profile.js +281 -37
- package/src/lib/evolution/evolution-deployment-root-rotation.js +154 -0
- package/src/lib/evolution/governed-hub-llm.js +18 -12
- package/src/lib/evolution/governed-hub-skill.js +4 -17
- package/src/lib/evolution/governed-model-turn.js +7 -8
- package/src/lib/orchestrator.js +14 -8
- package/src/lib/personal-data-hub-wiring.js +7 -1
- package/src/lib/sub-agent-context.js +5 -1
- package/src/repl/chat-repl.js +8 -4
- package/src/runtime/agent-core.js +14 -0
- package/src/runtime/headless-runner.js +16 -0
- package/src/assets/web-panel/assets/EmailListRenderer-rcaSveQ8.js +0 -1
- package/src/assets/web-panel/assets/EvolutionSettings-B3dcSq1H.js +0 -1
- package/src/assets/web-panel/assets/Logs-B-7Dz5Ui.js +0 -2
- package/src/assets/web-panel/assets/PdhVaultBrowser-yYL7-rno.js +0 -7
- package/src/assets/web-panel/assets/Skills-BBkg1Eqr.js +0 -1
- package/src/assets/web-panel/assets/Tasks-QQWSk-tc.js +0 -1
- package/src/assets/web-panel/assets/devWarning-BUooUkHH.js +0 -1
- package/src/assets/web-panel/assets/index-DVu4QCII.js +0 -1
- package/src/assets/web-panel/assets/index-XYnz-yJ_.js +0 -1
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
+
assertEvolutionDeploymentActiveTrustRoot,
|
|
3
|
+
assertEvolutionDeploymentDescriptorNotRevoked,
|
|
4
|
+
assertEvolutionDeploymentRevisionFloor,
|
|
2
5
|
readEvolutionDeploymentProfile,
|
|
3
6
|
setEvolutionDeploymentProfileEnabled,
|
|
4
|
-
|
|
7
|
+
updateEvolutionDeploymentProfile,
|
|
5
8
|
} from "./evolution-deployment-profile.js";
|
|
6
9
|
import { verifyEvolutionDeployment } from "./evolution-deployment-loader.js";
|
|
10
|
+
import { verifyEvolutionDeploymentRootRotationSync } from "./evolution-deployment-root-rotation.js";
|
|
11
|
+
import { verifyEvolutionDeploymentDescriptorRevocationsSync } from "./evolution-deployment-descriptor-revocations.js";
|
|
7
12
|
|
|
8
13
|
function environmentSelection(env) {
|
|
9
14
|
const descriptorPath = env.CHAINLESSCHAIN_EVOLUTION_DEPLOYMENT_DESCRIPTOR;
|
|
@@ -12,6 +17,102 @@ function environmentSelection(env) {
|
|
|
12
17
|
return { descriptorPath, trustRootPath };
|
|
13
18
|
}
|
|
14
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Project verified deployment prerequisites without importing the host module.
|
|
22
|
+
* `ready` describes deployment admission only, never a successful model probe:
|
|
23
|
+
* the command must still load and validate its composition at execution time.
|
|
24
|
+
*/
|
|
25
|
+
export function assessEvolutionDeploymentReadiness(
|
|
26
|
+
status,
|
|
27
|
+
{ requiredCommands = ["ask", "agent"] } = {},
|
|
28
|
+
) {
|
|
29
|
+
if (
|
|
30
|
+
!Array.isArray(requiredCommands) ||
|
|
31
|
+
requiredCommands.length === 0 ||
|
|
32
|
+
requiredCommands.some(
|
|
33
|
+
(command) =>
|
|
34
|
+
typeof command !== "string" || !/^[a-z][a-z-]*$/.test(command),
|
|
35
|
+
)
|
|
36
|
+
) {
|
|
37
|
+
throw new TypeError("deployment readiness requires explicit command names");
|
|
38
|
+
}
|
|
39
|
+
const commands = Object.freeze([...new Set(requiredCommands)]);
|
|
40
|
+
const allowed = Array.isArray(status?.commands) ? status.commands : [];
|
|
41
|
+
const missingCommands = Object.freeze(
|
|
42
|
+
commands.filter((command) => !allowed.includes(command)),
|
|
43
|
+
);
|
|
44
|
+
const result = (state, code, detail, remediation) => {
|
|
45
|
+
const ready = state === "admitted";
|
|
46
|
+
return Object.freeze({
|
|
47
|
+
scope: "deployment-admission",
|
|
48
|
+
state,
|
|
49
|
+
code,
|
|
50
|
+
ready,
|
|
51
|
+
requiredCommands: commands,
|
|
52
|
+
missingCommands,
|
|
53
|
+
runtimeVerification: "not_checked",
|
|
54
|
+
taskReady: ready ? null : false,
|
|
55
|
+
detail,
|
|
56
|
+
remediation,
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
if (
|
|
60
|
+
status?.error ||
|
|
61
|
+
(status?.effectiveEnabled === true && status?.verified !== true)
|
|
62
|
+
) {
|
|
63
|
+
return result(
|
|
64
|
+
"invalid",
|
|
65
|
+
"EVOLUTION_DEPLOYMENT_NOT_VERIFIED",
|
|
66
|
+
`configured Evolution deployment is not verified${status?.error ? `: ${status.error}` : ""}`,
|
|
67
|
+
"repair the signed descriptor or trust root, then run cc evolution deployment status --json",
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
if (status?.effectiveEnabled !== true) {
|
|
71
|
+
const disabled =
|
|
72
|
+
status?.profileEnabled === false && Boolean(status?.descriptorPath);
|
|
73
|
+
return result(
|
|
74
|
+
disabled ? "disabled" : "not_configured",
|
|
75
|
+
disabled
|
|
76
|
+
? "EVOLUTION_DEPLOYMENT_DISABLED"
|
|
77
|
+
: "EVOLUTION_DEPLOYMENT_NOT_CONFIGURED",
|
|
78
|
+
disabled
|
|
79
|
+
? "signed Evolution deployment is disabled"
|
|
80
|
+
: "no enabled signed Evolution deployment",
|
|
81
|
+
disabled
|
|
82
|
+
? "review the saved signed deployment, then run cc evolution deployment enable"
|
|
83
|
+
: "configure a signed descriptor and trust root with cc evolution deployment configure --descriptor <path> --trust-root <path>",
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
if (missingCommands.length > 0) {
|
|
87
|
+
return result(
|
|
88
|
+
"command_not_allowed",
|
|
89
|
+
"EVOLUTION_DEPLOYMENT_COMMAND_NOT_ALLOWED",
|
|
90
|
+
`signed Evolution deployment does not admit commands: ${missingCommands.join(", ")}`,
|
|
91
|
+
`request a signed deployment that admits ${missingCommands.join(", ")}; do not edit the signed descriptor in place`,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
return result(
|
|
95
|
+
"admitted",
|
|
96
|
+
"EVOLUTION_DEPLOYMENT_ADMITTED",
|
|
97
|
+
`signed Evolution deployment admits ${commands.join(", ")}; runtime composition and model execution are not checked`,
|
|
98
|
+
null,
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function withDeploymentReadiness(status) {
|
|
103
|
+
return Object.freeze({
|
|
104
|
+
...status,
|
|
105
|
+
readiness: Object.freeze({
|
|
106
|
+
ask: assessEvolutionDeploymentReadiness(status, {
|
|
107
|
+
requiredCommands: ["ask"],
|
|
108
|
+
}),
|
|
109
|
+
agent: assessEvolutionDeploymentReadiness(status, {
|
|
110
|
+
requiredCommands: ["agent"],
|
|
111
|
+
}),
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
15
116
|
export async function getEvolutionDeploymentStatus(options = {}) {
|
|
16
117
|
const env = options.env || process.env;
|
|
17
118
|
const saved = await readEvolutionDeploymentProfile(options);
|
|
@@ -28,6 +129,7 @@ export async function getEvolutionDeploymentStatus(options = {}) {
|
|
|
28
129
|
effectiveEnabled: source !== "none",
|
|
29
130
|
profileEnabled: saved.profile?.enabled === true,
|
|
30
131
|
profilePath: saved.filePath,
|
|
132
|
+
activeTrustRootDigest: saved.profile?.activeTrustRootDigest || null,
|
|
31
133
|
descriptorPath:
|
|
32
134
|
selected?.descriptorPath || saved.profile?.descriptorPath || null,
|
|
33
135
|
trustRootPath:
|
|
@@ -36,20 +138,38 @@ export async function getEvolutionDeploymentStatus(options = {}) {
|
|
|
36
138
|
error: saved.error,
|
|
37
139
|
autoPromotion: "hold",
|
|
38
140
|
};
|
|
39
|
-
if (!selected || saved.error) return
|
|
141
|
+
if (!selected || saved.error) return withDeploymentReadiness(base);
|
|
40
142
|
try {
|
|
41
143
|
const verified = await verifyEvolutionDeployment(selected, options);
|
|
42
|
-
|
|
144
|
+
if (source === "profile")
|
|
145
|
+
assertEvolutionDeploymentActiveTrustRoot(
|
|
146
|
+
saved.profile,
|
|
147
|
+
verified.descriptor,
|
|
148
|
+
);
|
|
149
|
+
if (source === "profile")
|
|
150
|
+
assertEvolutionDeploymentDescriptorNotRevoked(
|
|
151
|
+
saved.profile,
|
|
152
|
+
verified.descriptor,
|
|
153
|
+
);
|
|
154
|
+
if (source === "profile")
|
|
155
|
+
assertEvolutionDeploymentRevisionFloor(
|
|
156
|
+
saved.profile,
|
|
157
|
+
verified.descriptor,
|
|
158
|
+
);
|
|
159
|
+
return withDeploymentReadiness({
|
|
43
160
|
...base,
|
|
44
161
|
verified: true,
|
|
45
162
|
error: null,
|
|
46
163
|
revision: verified.descriptor.revision,
|
|
164
|
+
revisionFloor:
|
|
165
|
+
saved.profile?.revisionFloors?.[verified.descriptor.trustRootDigest] ||
|
|
166
|
+
null,
|
|
47
167
|
modulePath: verified.modulePath,
|
|
48
168
|
moduleDigest: verified.descriptor.moduleDigest,
|
|
49
169
|
commands: verified.descriptor.commands,
|
|
50
170
|
});
|
|
51
171
|
} catch (error) {
|
|
52
|
-
return
|
|
172
|
+
return withDeploymentReadiness({
|
|
53
173
|
...base,
|
|
54
174
|
error: error instanceof Error ? error.message : String(error),
|
|
55
175
|
});
|
|
@@ -57,21 +177,77 @@ export async function getEvolutionDeploymentStatus(options = {}) {
|
|
|
57
177
|
}
|
|
58
178
|
|
|
59
179
|
export async function configureEvolutionDeployment(
|
|
60
|
-
{
|
|
180
|
+
{
|
|
181
|
+
descriptorPath,
|
|
182
|
+
trustRootPath,
|
|
183
|
+
rootRotationPath = null,
|
|
184
|
+
revocationPath = null,
|
|
185
|
+
enabled = true,
|
|
186
|
+
},
|
|
61
187
|
options = {},
|
|
62
188
|
) {
|
|
63
189
|
const verified = await verifyEvolutionDeployment(
|
|
64
190
|
{ descriptorPath, trustRootPath },
|
|
65
191
|
options,
|
|
66
192
|
);
|
|
67
|
-
|
|
68
|
-
|
|
193
|
+
updateEvolutionDeploymentProfile((current) => {
|
|
194
|
+
if (
|
|
195
|
+
current?.activeTrustRootDigest &&
|
|
196
|
+
current.activeTrustRootDigest !== verified.descriptor.trustRootDigest
|
|
197
|
+
) {
|
|
198
|
+
if (typeof rootRotationPath !== "string" || !rootRotationPath) {
|
|
199
|
+
const error = new Error(
|
|
200
|
+
"evolution deployment trust root rotation requires a certificate signed by the active root",
|
|
201
|
+
);
|
|
202
|
+
error.code = "EVOLUTION_DEPLOYMENT_ROOT_ROTATION_REQUIRED";
|
|
203
|
+
throw error;
|
|
204
|
+
}
|
|
205
|
+
verifyEvolutionDeploymentRootRotationSync({
|
|
206
|
+
rotationPath: rootRotationPath,
|
|
207
|
+
fromTrustRootPath: current.trustRootPath,
|
|
208
|
+
expectedFromTrustRootDigest: current.activeTrustRootDigest,
|
|
209
|
+
expectedToTrustRootDigest: verified.descriptor.trustRootDigest,
|
|
210
|
+
destinationRevision: verified.descriptor.revision,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
assertEvolutionDeploymentRevisionFloor(current, verified.descriptor);
|
|
214
|
+
const receivedRevocations = revocationPath
|
|
215
|
+
? verifyEvolutionDeploymentDescriptorRevocationsSync({
|
|
216
|
+
revocationPath,
|
|
217
|
+
trustRootPath: verified.trustRootPath,
|
|
218
|
+
expectedTrustRootDigest: verified.descriptor.trustRootDigest,
|
|
219
|
+
}).revokedDescriptorRevisions
|
|
220
|
+
: [];
|
|
221
|
+
const priorRevocations =
|
|
222
|
+
current?.revokedDescriptorRevisions?.[
|
|
223
|
+
verified.descriptor.trustRootDigest
|
|
224
|
+
] || [];
|
|
225
|
+
const revokedDescriptorRevisions = {
|
|
226
|
+
...(current?.revokedDescriptorRevisions || {}),
|
|
227
|
+
[verified.descriptor.trustRootDigest]: [
|
|
228
|
+
...new Set([...priorRevocations, ...receivedRevocations]),
|
|
229
|
+
].sort((left, right) => left - right),
|
|
230
|
+
};
|
|
231
|
+
assertEvolutionDeploymentDescriptorNotRevoked(
|
|
232
|
+
{ revokedDescriptorRevisions },
|
|
233
|
+
verified.descriptor,
|
|
234
|
+
);
|
|
235
|
+
const revisionFloors = {
|
|
236
|
+
...(current?.revisionFloors || {}),
|
|
237
|
+
[verified.descriptor.trustRootDigest]: Math.max(
|
|
238
|
+
current?.revisionFloors?.[verified.descriptor.trustRootDigest] || 0,
|
|
239
|
+
verified.descriptor.revision,
|
|
240
|
+
),
|
|
241
|
+
};
|
|
242
|
+
return {
|
|
69
243
|
enabled: enabled === true,
|
|
70
244
|
descriptorPath: verified.descriptorPath,
|
|
71
245
|
trustRootPath: verified.trustRootPath,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
246
|
+
revisionFloors,
|
|
247
|
+
activeTrustRootDigest: verified.descriptor.trustRootDigest,
|
|
248
|
+
revokedDescriptorRevisions,
|
|
249
|
+
};
|
|
250
|
+
}, options);
|
|
75
251
|
return getEvolutionDeploymentStatus(options);
|
|
76
252
|
}
|
|
77
253
|
|
|
@@ -79,3 +255,34 @@ export async function setEvolutionDeploymentEnabled(enabled, options = {}) {
|
|
|
79
255
|
await setEvolutionDeploymentProfileEnabled(enabled, options);
|
|
80
256
|
return getEvolutionDeploymentStatus(options);
|
|
81
257
|
}
|
|
258
|
+
|
|
259
|
+
export function revokeEvolutionDeploymentDescriptorRevisions(
|
|
260
|
+
{ revocationPath },
|
|
261
|
+
options = {},
|
|
262
|
+
) {
|
|
263
|
+
updateEvolutionDeploymentProfile((current) => {
|
|
264
|
+
if (!current?.activeTrustRootDigest)
|
|
265
|
+
throw new Error("evolution deployment profile is not configured");
|
|
266
|
+
const record = verifyEvolutionDeploymentDescriptorRevocationsSync({
|
|
267
|
+
revocationPath,
|
|
268
|
+
trustRootPath: current.trustRootPath,
|
|
269
|
+
expectedTrustRootDigest: current.activeTrustRootDigest,
|
|
270
|
+
});
|
|
271
|
+
const prior =
|
|
272
|
+
current.revokedDescriptorRevisions?.[current.activeTrustRootDigest] || [];
|
|
273
|
+
return {
|
|
274
|
+
...current,
|
|
275
|
+
// Disabling is conservative: the current descriptor may be one of the
|
|
276
|
+
// newly revoked revisions, and it must not remain executable while the
|
|
277
|
+
// caller is recovering or selecting a replacement.
|
|
278
|
+
enabled: false,
|
|
279
|
+
revokedDescriptorRevisions: {
|
|
280
|
+
...(current.revokedDescriptorRevisions || {}),
|
|
281
|
+
[current.activeTrustRootDigest]: [
|
|
282
|
+
...new Set([...prior, ...record.revokedDescriptorRevisions]),
|
|
283
|
+
].sort((left, right) => left - right),
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
}, options);
|
|
287
|
+
return getEvolutionDeploymentStatus(options);
|
|
288
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { createHash, createPublicKey, verify } from "node:crypto";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { isAbsolute } from "node:path";
|
|
4
|
+
|
|
5
|
+
export const EVOLUTION_DEPLOYMENT_DESCRIPTOR_REVOCATIONS_SCHEMA =
|
|
6
|
+
"chainlesschain.evolution-deployment-descriptor-revocations/v1";
|
|
7
|
+
|
|
8
|
+
const DIGEST = /^sha256:[a-f0-9]{64}$/u;
|
|
9
|
+
const MAX_BYTES = 64 * 1024;
|
|
10
|
+
const MAX_REVOKED_REVISIONS = 1024;
|
|
11
|
+
|
|
12
|
+
function canonical(value) {
|
|
13
|
+
if (value === null || typeof value !== "object") return JSON.stringify(value);
|
|
14
|
+
if (Array.isArray(value)) return `[${value.map(canonical).join(",")}]`;
|
|
15
|
+
return `{${Object.keys(value)
|
|
16
|
+
.sort()
|
|
17
|
+
.map((key) => `${JSON.stringify(key)}:${canonical(value[key])}`)
|
|
18
|
+
.join(",")}}`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function digest(bytes) {
|
|
22
|
+
return `sha256:${createHash("sha256").update(bytes).digest("hex")}`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function normalize(value) {
|
|
26
|
+
const expected = [
|
|
27
|
+
"revision",
|
|
28
|
+
"revokedDescriptorRevisions",
|
|
29
|
+
"schema",
|
|
30
|
+
"signature",
|
|
31
|
+
"trustRootDigest",
|
|
32
|
+
];
|
|
33
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
34
|
+
throw new TypeError("evolution deployment revocations must be an object");
|
|
35
|
+
if (canonical(Object.keys(value).sort()) !== canonical(expected))
|
|
36
|
+
throw new TypeError("evolution deployment revocations fields are invalid");
|
|
37
|
+
if (value.schema !== EVOLUTION_DEPLOYMENT_DESCRIPTOR_REVOCATIONS_SCHEMA)
|
|
38
|
+
throw new TypeError("evolution deployment revocations schema is invalid");
|
|
39
|
+
if (!DIGEST.test(value.trustRootDigest || ""))
|
|
40
|
+
throw new TypeError("evolution deployment revocations trust root is invalid");
|
|
41
|
+
if (!Number.isSafeInteger(value.revision) || value.revision < 1)
|
|
42
|
+
throw new TypeError("evolution deployment revocations revision is invalid");
|
|
43
|
+
if (
|
|
44
|
+
!Array.isArray(value.revokedDescriptorRevisions) ||
|
|
45
|
+
value.revokedDescriptorRevisions.length > MAX_REVOKED_REVISIONS ||
|
|
46
|
+
value.revokedDescriptorRevisions.some(
|
|
47
|
+
(revision) => !Number.isSafeInteger(revision) || revision < 1,
|
|
48
|
+
) ||
|
|
49
|
+
new Set(value.revokedDescriptorRevisions).size !==
|
|
50
|
+
value.revokedDescriptorRevisions.length
|
|
51
|
+
) {
|
|
52
|
+
throw new TypeError("evolution deployment revoked revisions are invalid");
|
|
53
|
+
}
|
|
54
|
+
if (
|
|
55
|
+
typeof value.signature !== "string" ||
|
|
56
|
+
value.signature.length === 0 ||
|
|
57
|
+
!/^[A-Za-z0-9+/]+={0,2}$/u.test(value.signature)
|
|
58
|
+
) {
|
|
59
|
+
throw new TypeError("evolution deployment revocations signature is invalid");
|
|
60
|
+
}
|
|
61
|
+
return Object.freeze({
|
|
62
|
+
...value,
|
|
63
|
+
revokedDescriptorRevisions: Object.freeze(
|
|
64
|
+
[...value.revokedDescriptorRevisions].sort((left, right) => left - right),
|
|
65
|
+
),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function serializeEvolutionDeploymentDescriptorRevocationsPayload(value) {
|
|
70
|
+
const revocations = normalize({ ...value, signature: "AA==" });
|
|
71
|
+
return canonical({
|
|
72
|
+
schema: revocations.schema,
|
|
73
|
+
revision: revocations.revision,
|
|
74
|
+
trustRootDigest: revocations.trustRootDigest,
|
|
75
|
+
revokedDescriptorRevisions: revocations.revokedDescriptorRevisions,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function verifyEvolutionDeploymentDescriptorRevocationsSync({
|
|
80
|
+
revocationPath,
|
|
81
|
+
trustRootPath,
|
|
82
|
+
expectedTrustRootDigest,
|
|
83
|
+
}) {
|
|
84
|
+
if (
|
|
85
|
+
typeof revocationPath !== "string" ||
|
|
86
|
+
!isAbsolute(revocationPath) ||
|
|
87
|
+
typeof trustRootPath !== "string" ||
|
|
88
|
+
!isAbsolute(trustRootPath) ||
|
|
89
|
+
!DIGEST.test(expectedTrustRootDigest || "")
|
|
90
|
+
) {
|
|
91
|
+
throw new Error("evolution deployment revocation inputs are invalid");
|
|
92
|
+
}
|
|
93
|
+
let record;
|
|
94
|
+
let trustRootBytes;
|
|
95
|
+
try {
|
|
96
|
+
const bytes = readFileSync(revocationPath);
|
|
97
|
+
if (bytes.byteLength === 0 || bytes.byteLength > MAX_BYTES)
|
|
98
|
+
throw new Error("evolution deployment revocations size is invalid");
|
|
99
|
+
record = normalize(JSON.parse(bytes.toString("utf8")));
|
|
100
|
+
trustRootBytes = readFileSync(trustRootPath);
|
|
101
|
+
} catch (error) {
|
|
102
|
+
throw new Error(
|
|
103
|
+
"evolution deployment revocations could not be read",
|
|
104
|
+
error instanceof Error ? { cause: error } : undefined,
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
if (digest(trustRootBytes) !== expectedTrustRootDigest)
|
|
108
|
+
throw new Error("evolution deployment revocation trust root changed");
|
|
109
|
+
if (record.trustRootDigest !== expectedTrustRootDigest)
|
|
110
|
+
throw new Error("evolution deployment revocation trust root does not match");
|
|
111
|
+
let publicKey;
|
|
112
|
+
try {
|
|
113
|
+
publicKey = createPublicKey(trustRootBytes);
|
|
114
|
+
} catch {
|
|
115
|
+
throw new Error("evolution deployment revocation trust root is invalid");
|
|
116
|
+
}
|
|
117
|
+
if (
|
|
118
|
+
!verify(
|
|
119
|
+
null,
|
|
120
|
+
Buffer.from(
|
|
121
|
+
serializeEvolutionDeploymentDescriptorRevocationsPayload(record),
|
|
122
|
+
"utf8",
|
|
123
|
+
),
|
|
124
|
+
publicKey,
|
|
125
|
+
Buffer.from(record.signature, "base64"),
|
|
126
|
+
)
|
|
127
|
+
) {
|
|
128
|
+
throw new Error("evolution deployment revocation signature rejected");
|
|
129
|
+
}
|
|
130
|
+
return record;
|
|
131
|
+
}
|
|
@@ -2,7 +2,12 @@ import { createHash, createPublicKey, verify } from "node:crypto";
|
|
|
2
2
|
import { readFile, realpath } from "node:fs/promises";
|
|
3
3
|
import { isAbsolute } from "node:path";
|
|
4
4
|
import { types as utilTypes } from "node:util";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
assertEvolutionDeploymentActiveTrustRoot,
|
|
7
|
+
assertEvolutionDeploymentDescriptorNotRevoked,
|
|
8
|
+
assertEvolutionDeploymentRevisionFloor,
|
|
9
|
+
readEvolutionDeploymentProfile,
|
|
10
|
+
} from "./evolution-deployment-profile.js";
|
|
6
11
|
|
|
7
12
|
export const EVOLUTION_DEPLOYMENT_DESCRIPTOR_SCHEMA =
|
|
8
13
|
"chainlesschain.evolution-deployment-descriptor/v1";
|
|
@@ -126,6 +131,77 @@ function dependencies(value, commandName) {
|
|
|
126
131
|
return Object.freeze({ ...value });
|
|
127
132
|
}
|
|
128
133
|
|
|
134
|
+
function deniedAgentDependencies(commandName, code, message, source = null) {
|
|
135
|
+
if (commandName !== "agent") return null;
|
|
136
|
+
const evolutionCompositionFactory = Object.freeze(async () => {
|
|
137
|
+
const error = new Error(message);
|
|
138
|
+
error.code = code;
|
|
139
|
+
throw error;
|
|
140
|
+
});
|
|
141
|
+
if (
|
|
142
|
+
source === null ||
|
|
143
|
+
typeof source !== "object" ||
|
|
144
|
+
Array.isArray(source) ||
|
|
145
|
+
utilTypes.isProxy(source)
|
|
146
|
+
) {
|
|
147
|
+
return Object.freeze({ evolutionCompositionFactory });
|
|
148
|
+
}
|
|
149
|
+
const descriptors = Object.getOwnPropertyDescriptors(source);
|
|
150
|
+
const result = {};
|
|
151
|
+
for (const [name, descriptor] of Object.entries(descriptors)) {
|
|
152
|
+
if (name === "evolutionCompositionFactory" || !("value" in descriptor)) {
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
Object.defineProperty(result, name, {
|
|
156
|
+
value: descriptor.value,
|
|
157
|
+
enumerable: descriptor.enumerable,
|
|
158
|
+
configurable: false,
|
|
159
|
+
writable: false,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
Object.defineProperty(result, "evolutionCompositionFactory", {
|
|
163
|
+
value: evolutionCompositionFactory,
|
|
164
|
+
enumerable: true,
|
|
165
|
+
configurable: false,
|
|
166
|
+
writable: false,
|
|
167
|
+
});
|
|
168
|
+
return Object.freeze(result);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function authenticatedDependencies(value, commandName) {
|
|
172
|
+
if (commandName !== "agent") return dependencies(value, commandName);
|
|
173
|
+
if (
|
|
174
|
+
value === null ||
|
|
175
|
+
typeof value !== "object" ||
|
|
176
|
+
Array.isArray(value) ||
|
|
177
|
+
utilTypes.isProxy(value)
|
|
178
|
+
) {
|
|
179
|
+
return deniedAgentDependencies(
|
|
180
|
+
commandName,
|
|
181
|
+
"EVOLUTION_DEPLOYMENT_INVALID_DEPENDENCIES",
|
|
182
|
+
"Authenticated agent deployment returned invalid dependencies",
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
const descriptor = Object.getOwnPropertyDescriptor(
|
|
186
|
+
value,
|
|
187
|
+
"evolutionCompositionFactory",
|
|
188
|
+
);
|
|
189
|
+
if (
|
|
190
|
+
!descriptor ||
|
|
191
|
+
!("value" in descriptor) ||
|
|
192
|
+
typeof descriptor.value !== "function" ||
|
|
193
|
+
descriptor.enumerable !== true
|
|
194
|
+
) {
|
|
195
|
+
return deniedAgentDependencies(
|
|
196
|
+
commandName,
|
|
197
|
+
"EVOLUTION_DEPLOYMENT_INVALID_DEPENDENCIES",
|
|
198
|
+
"Authenticated agent deployment did not provide an evolution composition factory",
|
|
199
|
+
value,
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
return dependencies(value, commandName);
|
|
203
|
+
}
|
|
204
|
+
|
|
129
205
|
async function loadBuiltInFactories(commandName) {
|
|
130
206
|
const factories = {};
|
|
131
207
|
if (commandName === "learning") {
|
|
@@ -224,9 +300,7 @@ async function loadBuiltInFactories(commandName) {
|
|
|
224
300
|
import("./evolution-eval-process-supervisor.js"),
|
|
225
301
|
import("./governed-skill-synthesis-attestor-trust-approval-client.js"),
|
|
226
302
|
import("./governed-skill-synthesis-attestor-trust-operations-client.js"),
|
|
227
|
-
import(
|
|
228
|
-
"./governed-skill-synthesis-attestor-trust-operations-cli-host.js"
|
|
229
|
-
),
|
|
303
|
+
import("./governed-skill-synthesis-attestor-trust-operations-cli-host.js"),
|
|
230
304
|
]);
|
|
231
305
|
factories.createEvolutionWorkbenchCliHost = createEvolutionWorkbenchCliHost;
|
|
232
306
|
factories.createEvolutionWorkbenchReviewRuntime =
|
|
@@ -353,9 +427,8 @@ async function loadBuiltInFactories(commandName) {
|
|
|
353
427
|
commandName === "stream" ||
|
|
354
428
|
commandName === "ui"
|
|
355
429
|
) {
|
|
356
|
-
const { createAgentEvolutionRuntimeComposition } =
|
|
357
|
-
"./agent-evolution-runtime-composition.js"
|
|
358
|
-
);
|
|
430
|
+
const { createAgentEvolutionRuntimeComposition } =
|
|
431
|
+
await import("./agent-evolution-runtime-composition.js");
|
|
359
432
|
factories.createAgentEvolutionRuntimeComposition =
|
|
360
433
|
createAgentEvolutionRuntimeComposition;
|
|
361
434
|
}
|
|
@@ -486,8 +559,23 @@ export async function loadEvolutionDeploymentCommandDependencies(
|
|
|
486
559
|
let descriptorPath = env.CHAINLESSCHAIN_EVOLUTION_DEPLOYMENT_DESCRIPTOR;
|
|
487
560
|
let trustRootPath = env.CHAINLESSCHAIN_EVOLUTION_DEPLOYMENT_TRUST_ROOT;
|
|
488
561
|
let fromSavedProfile = false;
|
|
562
|
+
let saved = null;
|
|
489
563
|
if (!descriptorPath && !trustRootPath) {
|
|
490
|
-
|
|
564
|
+
saved = await readEvolutionDeploymentProfile({ env });
|
|
565
|
+
if (saved.error) {
|
|
566
|
+
return deniedAgentDependencies(
|
|
567
|
+
commandName,
|
|
568
|
+
"EVOLUTION_DEPLOYMENT_PROFILE_INVALID",
|
|
569
|
+
"Saved evolution deployment profile is invalid",
|
|
570
|
+
);
|
|
571
|
+
}
|
|
572
|
+
if (saved.profile && !saved.profile.enabled) {
|
|
573
|
+
return deniedAgentDependencies(
|
|
574
|
+
commandName,
|
|
575
|
+
"EVOLUTION_DEPLOYMENT_DISABLED",
|
|
576
|
+
"Saved evolution deployment profile is disabled",
|
|
577
|
+
);
|
|
578
|
+
}
|
|
491
579
|
if (!saved.error && saved.profile?.enabled) {
|
|
492
580
|
descriptorPath = saved.profile.descriptorPath;
|
|
493
581
|
trustRootPath = saved.profile.trustRootPath;
|
|
@@ -505,16 +593,43 @@ export async function loadEvolutionDeploymentCommandDependencies(
|
|
|
505
593
|
{ descriptorPath, trustRootPath },
|
|
506
594
|
{ read, resolveRealPath, includeModuleBytes: true },
|
|
507
595
|
);
|
|
596
|
+
if (fromSavedProfile)
|
|
597
|
+
assertEvolutionDeploymentActiveTrustRoot(
|
|
598
|
+
saved.profile,
|
|
599
|
+
verified.descriptor,
|
|
600
|
+
);
|
|
601
|
+
if (fromSavedProfile)
|
|
602
|
+
assertEvolutionDeploymentDescriptorNotRevoked(
|
|
603
|
+
saved.profile,
|
|
604
|
+
verified.descriptor,
|
|
605
|
+
);
|
|
606
|
+
if (fromSavedProfile)
|
|
607
|
+
assertEvolutionDeploymentRevisionFloor(
|
|
608
|
+
saved.profile,
|
|
609
|
+
verified.descriptor,
|
|
610
|
+
);
|
|
508
611
|
} catch (error) {
|
|
509
612
|
// A saved profile may become stale after files are moved or rotated. Keep
|
|
510
613
|
// governed capabilities fail-closed while allowing `deployment status`,
|
|
511
614
|
// `configure`, and `disable` to start so the operator can recover. Explicit
|
|
512
615
|
// environment overrides remain strict and surface the error immediately.
|
|
513
|
-
if (fromSavedProfile)
|
|
616
|
+
if (fromSavedProfile) {
|
|
617
|
+
return deniedAgentDependencies(
|
|
618
|
+
commandName,
|
|
619
|
+
error?.code || "EVOLUTION_DEPLOYMENT_NOT_VERIFIED",
|
|
620
|
+
`Saved evolution deployment could not be verified: ${error?.message || String(error)}`,
|
|
621
|
+
);
|
|
622
|
+
}
|
|
514
623
|
throw error;
|
|
515
624
|
}
|
|
516
625
|
const { descriptor, moduleBytes } = verified;
|
|
517
|
-
if (!descriptor.commands.includes(commandName))
|
|
626
|
+
if (!descriptor.commands.includes(commandName)) {
|
|
627
|
+
return deniedAgentDependencies(
|
|
628
|
+
commandName,
|
|
629
|
+
"EVOLUTION_DEPLOYMENT_COMMAND_NOT_ALLOWED",
|
|
630
|
+
`Signed evolution deployment does not admit command: ${commandName}`,
|
|
631
|
+
);
|
|
632
|
+
}
|
|
518
633
|
// Import the exact bytes that were authenticated. Importing modulePath here
|
|
519
634
|
// would reopen a pathname-replacement window between hashing and execution.
|
|
520
635
|
// Deployment entrypoints are therefore single-file ESM bundles; any external
|
|
@@ -557,7 +672,7 @@ export async function loadEvolutionDeploymentCommandDependencies(
|
|
|
557
672
|
"additional evolution deployment factories are invalid",
|
|
558
673
|
);
|
|
559
674
|
}
|
|
560
|
-
return
|
|
675
|
+
return authenticatedDependencies(
|
|
561
676
|
await loaded.createChainlessChainCommandDependencies(
|
|
562
677
|
Object.freeze({
|
|
563
678
|
commandName,
|