@zhivex-ai/harness 1.7.0 → 1.8.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 +8 -2
- package/README.md +17 -5
- package/SECURITY.md +1 -1
- package/SUPPORT.md +2 -2
- package/benchmarks/README.md +26 -0
- package/contracts/engine-api.json +1557 -0
- package/contracts/public-api.json +114 -0
- package/contracts/stable-api-signatures.json +17 -17
- package/dist/acp-cli.js +37 -1090
- package/dist/application/agenda.d.ts +10 -0
- package/dist/application/approval-review.d.ts +61 -0
- package/dist/application/assistant/automation/scheduler.d.ts +21 -0
- package/dist/application/assistant/automation/summary.d.ts +29 -0
- package/dist/application/assistant/automation/time.d.ts +10 -0
- package/dist/application/assistant/calendar/calendar.d.ts +238 -0
- package/dist/application/assistant/calendar/connection.d.ts +50 -0
- package/dist/application/assistant/calendar/create-event.d.ts +75 -0
- package/dist/application/assistant/calendar/environment.d.ts +2 -0
- package/dist/application/assistant/calendar/http.d.ts +6 -0
- package/dist/application/assistant/calendar/oauth.d.ts +68 -0
- package/dist/application/assistant/calendar/store.d.ts +11 -0
- package/dist/application/assistant/calendar/tools.d.ts +78 -0
- package/dist/application/assistant/client.d.ts +10 -0
- package/dist/application/assistant/config.d.ts +9 -0
- package/dist/application/assistant/contracts.d.ts +77 -0
- package/dist/application/assistant/daily/service.d.ts +181 -0
- package/dist/application/assistant/doctor.d.ts +22 -0
- package/dist/application/assistant/evaluation.d.ts +81 -0
- package/dist/application/assistant/host.d.ts +399 -0
- package/dist/application/assistant/integrations/google.d.ts +117 -0
- package/dist/application/assistant/integrations/public-web.d.ts +16 -0
- package/dist/application/assistant/managed/secrets.d.ts +10 -0
- package/dist/application/assistant/managed/setup-state.d.ts +346 -0
- package/dist/application/assistant/managed/setup.d.ts +492 -0
- package/dist/application/assistant/microsoft/connection.d.ts +73 -0
- package/dist/application/assistant/microsoft/tools.d.ts +78 -0
- package/dist/application/assistant/modules/calendar.d.ts +3 -0
- package/dist/application/assistant/modules/catalog.d.ts +38 -0
- package/dist/application/assistant/modules/daily.d.ts +5 -0
- package/dist/application/assistant/modules/github.d.ts +5 -0
- package/dist/application/assistant/modules/google.d.ts +3 -0
- package/dist/application/assistant/modules/mcp.d.ts +11 -0
- package/dist/application/assistant/modules/microsoft.d.ts +3 -0
- package/dist/application/assistant/modules/module.d.ts +224 -0
- package/dist/application/assistant/modules/tools.d.ts +11 -0
- package/dist/application/assistant/modules/web.d.ts +7 -0
- package/dist/application/assistant/private-directory.d.ts +3 -0
- package/dist/application/assistant/proactive/service.d.ts +142 -0
- package/dist/application/assistant/providers/openai-compatible.d.ts +66 -0
- package/dist/application/assistant/providers/provider.d.ts +141 -0
- package/dist/application/assistant/providers/web-citations.d.ts +2 -0
- package/dist/application/assistant/runtime.d.ts +16 -0
- package/dist/application/assistant/task-metrics.d.ts +304 -0
- package/dist/application/assistant/telegram/api.d.ts +47 -0
- package/dist/application/assistant/telegram/bridge.d.ts +69 -0
- package/dist/application/assistant/telegram/store.d.ts +10 -0
- package/dist/application/automation.d.ts +5 -0
- package/dist/application/calendar-review.d.ts +5 -0
- package/dist/application/checkpoint-review.d.ts +30 -0
- package/dist/application/client.d.ts +18 -0
- package/dist/application/code/context.d.ts +5 -0
- package/dist/application/code/delivery.d.ts +6 -0
- package/dist/application/code/git-delivery.d.ts +54 -0
- package/dist/application/code/github-git-transport.d.ts +15 -0
- package/dist/application/code/github-pr-transport.d.ts +6 -0
- package/dist/application/code/host.d.ts +25 -0
- package/dist/application/code/pr-delivery.d.ts +79 -0
- package/dist/application/code/projects.d.ts +90 -0
- package/dist/application/code/remote-delivery.d.ts +80 -0
- package/dist/application/code/repository.d.ts +9 -0
- package/dist/application/code/worktrees.d.ts +123 -0
- package/dist/application/contracts.d.ts +288 -0
- package/dist/application/coordinator-client.d.ts +33 -0
- package/dist/application/coordinator-discovery.d.ts +17 -0
- package/dist/application/coordinator-launcher.d.ts +2 -0
- package/dist/application/coordinator.d.ts +27 -0
- package/dist/application/credential-process.d.ts +13 -0
- package/dist/application/host.d.ts +7 -0
- package/dist/application/management.d.ts +68 -0
- package/dist/application/notes.d.ts +5 -0
- package/dist/application/offline-migration.d.ts +16 -0
- package/dist/application/personal-state.d.ts +5 -0
- package/dist/application/review-channel.d.ts +23 -0
- package/dist/application/review-tickets.d.ts +29 -0
- package/dist/application/runtime-binding.d.ts +4 -0
- package/dist/application-cli-wfh08g41.js +184 -0
- package/dist/application-cli-z3f9pvcf.js +209 -0
- package/dist/approvals/auto-approve.d.ts +1 -1
- package/dist/arguments-75r85mvc.js +27 -0
- package/dist/arguments-x24bbqvd.js +22 -0
- package/dist/audit/index.js +16 -472
- package/dist/audit-pack-1gnych0m.js +93 -0
- package/dist/{audit-pack-y02n8zd0.js → audit-pack-h44kjkbj.js} +17 -11
- package/dist/calendar-2xw0rr7b.js +49 -0
- package/dist/cli/application-cli.d.ts +2 -0
- package/dist/cli/arguments.d.ts +14 -1
- package/dist/cli/auto-approve-setup.d.ts +13 -0
- package/dist/cli/configured-harness.d.ts +1 -2
- package/dist/cli/console/console-budget.d.ts +16 -2
- package/dist/cli/console/console-checkpoints.d.ts +12 -0
- package/dist/cli/console/console-commands.d.ts +3 -3
- package/dist/cli/console/console-compaction.d.ts +1 -1
- package/dist/cli/console/console-diff.d.ts +2 -0
- package/dist/cli/console/console-input.d.ts +29 -1
- package/dist/cli/console/console-navigation.d.ts +2 -2
- package/dist/cli/console/console-outcome.d.ts +10 -0
- package/dist/cli/console/console-presentation.d.ts +17 -2
- package/dist/cli/console/console-pricing.d.ts +14 -0
- package/dist/cli/console/console-reasoning.d.ts +1 -1
- package/dist/cli/console/console-recovery.d.ts +2 -0
- package/dist/cli/console/console-review.d.ts +34 -0
- package/dist/cli/console/console-run-policy.d.ts +5 -0
- package/dist/cli/console/console-run-view.d.ts +28 -0
- package/dist/cli/console/console-task.d.ts +30 -0
- package/dist/cli/console/console-welcome.d.ts +13 -3
- package/dist/cli/console/review-diff.d.ts +20 -0
- package/dist/cli/presentation.d.ts +8 -6
- package/dist/cli/service-checkpoints.d.ts +234 -0
- package/dist/cli/terminal/activity-history.d.ts +4 -2
- package/dist/cli/terminal/activity-stream.d.ts +33 -0
- package/dist/cli/terminal/file-diff.d.ts +11 -0
- package/dist/cli/terminal/terminal-theme.d.ts +9 -0
- package/dist/cli/terminal/terminal-ui.d.ts +44 -2
- package/dist/cli/terminal/tool-activity.d.ts +6 -2
- package/dist/{cli-entry-hdtfef27.js → cli-entry-68kqraj7.js} +95 -43
- package/dist/{cli-entry-j6jcb2jb.js → cli-entry-86rcbmwh.js} +294 -14
- package/dist/cli-entry-btkpb4h1.js +3627 -0
- package/dist/cli-entry-bxjbs6qq.js +200 -0
- package/dist/cli-entry-cpm89r9q.js +624 -0
- package/dist/{cli-entry-v5db3eb2.js → cli-entry-dksm56sj.js} +39 -297
- package/dist/{cli-entry-td04s0fa.js → cli-entry-eka68ttb.js} +3919 -4549
- package/dist/cli-entry-h7dcah4p.js +137 -0
- package/dist/cli-entry-kwk23ktq.js +33 -0
- package/dist/{cli-entry-ynahz9qc.js → cli-entry-vmce694z.js} +1251 -3139
- package/dist/cli-entry-wanv05db.js +1113 -0
- package/dist/{cli-zw18kdqx.js → cli-z7vhm1rk.js} +1767 -380
- package/dist/cli.js +8 -6
- package/dist/client/json-contracts.d.ts +153 -0
- package/dist/client/local-service.d.ts +7 -12
- package/dist/client/local-transport.d.ts +14 -0
- package/dist/client/protocol.d.ts +43 -1
- package/dist/compat/cli-options.d.ts +7 -1
- package/dist/compat/cli.d.ts +2 -0
- package/dist/compat/cli.js +4043 -0
- package/dist/compat/code-support.d.ts +3 -0
- package/dist/compat/code-support.js +50 -28
- package/dist/{config-r9fdhce6.js → config-hw78440t.js} +5 -5
- package/dist/{config-vyajmksy.js → config-v7s8hp37.js} +1 -1
- package/dist/context/adaptive-compaction.d.ts +1 -0
- package/dist/context/lossless-lines.d.ts +13 -0
- package/dist/context/numbered-read-lines.d.ts +15 -0
- package/dist/context/read-attempts.d.ts +21 -0
- package/dist/context/request-projection.d.ts +32 -4
- package/dist/context/scoped-context.d.ts +14 -0
- package/dist/context/working-read-replay.d.ts +12 -0
- package/dist/coordinator-client-nzysqxf0.js +10 -0
- package/dist/engine/acp.js +27 -21
- package/dist/engine/application-client.d.ts +11 -0
- package/dist/engine/application-client.js +18 -0
- package/dist/engine/application-protocol.d.ts +5 -0
- package/dist/engine/application-protocol.js +7 -0
- package/dist/engine/application.d.ts +43 -0
- package/dist/engine/application.js +206 -0
- package/dist/engine/assistant/automation/scheduler.d.ts +2 -0
- package/dist/engine/assistant/automation/scheduler.js +11 -0
- package/dist/engine/assistant/automation/summary.d.ts +3 -0
- package/dist/engine/assistant/automation/summary.js +8 -0
- package/dist/engine/assistant/automation/time.d.ts +5 -0
- package/dist/engine/assistant/automation/time.js +15 -0
- package/dist/engine/assistant/calendar/calendar.d.ts +5 -0
- package/dist/engine/assistant/calendar/calendar.js +12 -0
- package/dist/engine/assistant/calendar/connection.d.ts +2 -0
- package/dist/engine/assistant/calendar/connection.js +11 -0
- package/dist/engine/assistant/calendar/environment.d.ts +1 -0
- package/dist/engine/assistant/calendar/environment.js +7 -0
- package/dist/engine/assistant/calendar/http.d.ts +3 -0
- package/dist/engine/assistant/calendar/http.js +9 -0
- package/dist/engine/assistant/calendar/oauth.d.ts +5 -0
- package/dist/engine/assistant/calendar/oauth.js +12 -0
- package/dist/engine/assistant/calendar/store.d.ts +2 -0
- package/dist/engine/assistant/calendar/store.js +8 -0
- package/dist/engine/assistant/calendar/tools.d.ts +2 -0
- package/dist/engine/assistant/calendar/tools.js +46 -0
- package/dist/engine/assistant/client.d.ts +2 -0
- package/dist/engine/assistant/client.js +33 -0
- package/dist/engine/assistant/config.d.ts +1 -0
- package/dist/engine/assistant/config.js +102 -0
- package/dist/engine/assistant/contracts.d.ts +10 -0
- package/dist/engine/assistant/contracts.js +78 -0
- package/dist/engine/assistant/daily/service.d.ts +12 -0
- package/dist/engine/assistant/daily/service.js +27 -0
- package/dist/engine/assistant/doctor.d.ts +1 -0
- package/dist/engine/assistant/doctor.js +116 -0
- package/dist/engine/assistant/evaluation.d.ts +2 -0
- package/dist/engine/assistant/evaluation.js +76 -0
- package/dist/engine/assistant/host.d.ts +2 -0
- package/dist/engine/assistant/host.js +63 -0
- package/dist/engine/assistant/integrations/google.d.ts +9 -0
- package/dist/engine/assistant/integrations/google.js +30 -0
- package/dist/engine/assistant/integrations/public-web.d.ts +3 -0
- package/dist/engine/assistant/integrations/public-web.js +11 -0
- package/dist/engine/assistant/managed/secrets.d.ts +1 -0
- package/dist/engine/assistant/managed/secrets.js +0 -0
- package/dist/engine/assistant/managed/setup-state.d.ts +11 -0
- package/dist/engine/assistant/managed/setup-state.js +84 -0
- package/dist/engine/assistant/managed/setup.d.ts +3 -0
- package/dist/engine/assistant/managed/setup.js +85 -0
- package/dist/engine/assistant/microsoft/connection.d.ts +7 -0
- package/dist/engine/assistant/microsoft/connection.js +21 -0
- package/dist/engine/assistant/microsoft/tools.d.ts +8 -0
- package/dist/engine/assistant/microsoft/tools.js +30 -0
- package/dist/engine/assistant/modules/calendar.d.ts +1 -0
- package/dist/engine/assistant/modules/calendar.js +49 -0
- package/dist/engine/assistant/modules/catalog.d.ts +3 -0
- package/dist/engine/assistant/modules/catalog.js +67 -0
- package/dist/engine/assistant/modules/daily.d.ts +1 -0
- package/dist/engine/assistant/modules/daily.js +48 -0
- package/dist/engine/assistant/modules/github.d.ts +1 -0
- package/dist/engine/assistant/modules/github.js +43 -0
- package/dist/engine/assistant/modules/google.d.ts +1 -0
- package/dist/engine/assistant/modules/google.js +53 -0
- package/dist/engine/assistant/modules/mcp.d.ts +1 -0
- package/dist/engine/assistant/modules/mcp.js +42 -0
- package/dist/engine/assistant/modules/microsoft.d.ts +1 -0
- package/dist/engine/assistant/modules/microsoft.js +53 -0
- package/dist/engine/assistant/modules/module.d.ts +5 -0
- package/dist/engine/assistant/modules/module.js +42 -0
- package/dist/engine/assistant/modules/tools.d.ts +2 -0
- package/dist/engine/assistant/modules/tools.js +42 -0
- package/dist/engine/assistant/modules/web.d.ts +1 -0
- package/dist/engine/assistant/modules/web.js +45 -0
- package/dist/engine/assistant/private-directory.d.ts +1 -0
- package/dist/engine/assistant/private-directory.js +7 -0
- package/dist/engine/assistant/proactive/service.d.ts +6 -0
- package/dist/engine/assistant/proactive/service.js +16 -0
- package/dist/engine/assistant/providers/openai-compatible.d.ts +4 -0
- package/dist/engine/assistant/providers/openai-compatible.js +12 -0
- package/dist/engine/assistant/providers/provider.d.ts +7 -0
- package/dist/engine/assistant/providers/provider.js +54 -0
- package/dist/engine/assistant/providers/web-citations.d.ts +1 -0
- package/dist/engine/assistant/providers/web-citations.js +7 -0
- package/dist/engine/assistant/runtime.d.ts +2 -0
- package/dist/engine/assistant/runtime.js +73 -0
- package/dist/engine/assistant/task-metrics.d.ts +8 -0
- package/dist/engine/assistant/task-metrics.js +17 -0
- package/dist/engine/assistant/telegram/api.d.ts +5 -0
- package/dist/engine/assistant/telegram/api.js +11 -0
- package/dist/engine/assistant/telegram/bridge.d.ts +2 -0
- package/dist/engine/assistant/telegram/bridge.js +40 -0
- package/dist/engine/assistant/telegram/store.d.ts +2 -0
- package/dist/engine/assistant/telegram/store.js +8 -0
- package/dist/engine/client.js +26 -18
- package/dist/engine/desktop-providers-v1.js +4 -4
- package/dist/engine/desktop-state-v1.js +16 -13
- package/dist/engine/index.js +111 -159
- package/dist/engine/mcp-stdio-v1.js +13 -12
- package/dist/engine/models.js +65 -23
- package/dist/engine/protocol.js +10 -6
- package/dist/engine/service.js +32 -21
- package/dist/hostile-repository-demo.js +1822 -696
- package/dist/index-09rsdr2d.js +1744 -0
- package/dist/index-0csc5sc7.js +139 -0
- package/dist/{index-v86bh0eg.js → index-0dkty795.js} +8 -6
- package/dist/index-0kkgqvg7.js +0 -0
- package/dist/index-0mzz9axm.js +58 -0
- package/dist/index-1e69ar8r.js +38 -0
- package/dist/index-1z0xhkh9.js +18 -0
- package/dist/index-2cef1k92.js +356 -0
- package/dist/{index-k1a1xesg.js → index-2j0v1xwr.js} +17 -13
- package/dist/index-2jw9jd7h.js +116 -0
- package/dist/index-2n9qx4km.js +0 -0
- package/dist/index-3rvk23e8.js +877 -0
- package/dist/index-3wa4j0yk.js +71 -0
- package/dist/index-41q1k17x.js +210 -0
- package/dist/index-4vz4bqqw.js +33 -0
- package/dist/index-5jxm2wy5.js +123 -0
- package/dist/index-5rk6ss42.js +216 -0
- package/dist/index-5v1skxf7.js +1852 -0
- package/dist/{index-qz4fs9f9.js → index-6ehtssyz.js} +355 -332
- package/dist/index-76kpdbpw.js +80 -0
- package/dist/{index-r0q0r88h.js → index-7nbmhmw5.js} +10 -10
- package/dist/index-8mx0yrkz.js +31 -0
- package/dist/index-8tjev5ds.js +11 -0
- package/dist/index-91n5wr6s.js +163 -0
- package/dist/index-91trs3ew.js +151 -0
- package/dist/index-9y8p5vy5.js +222 -0
- package/dist/index-abxahprd.js +55 -0
- package/dist/index-aptyr511.js +84 -0
- package/dist/{index-8sm2a1wa.js → index-ay26xfxt.js} +28 -20
- package/dist/index-b4yed1s3.js +657 -0
- package/dist/index-bb7phvtg.js +23 -0
- package/dist/index-bk5tn9b8.js +236 -0
- package/dist/index-bw34861c.js +292 -0
- package/dist/index-c6fnjhgv.js +55 -0
- package/dist/{index-qfsrrnz6.js → index-cjevq9s8.js} +2 -2
- package/dist/{index-c39197wq.js → index-ctcwrkrc.js} +4 -4
- package/dist/{index-yx52bt4a.js → index-cztmcesv.js} +2 -2
- package/dist/index-dpbmxnrf.js +564 -0
- package/dist/index-ekxdcy36.js +134 -0
- package/dist/index-f8zpcsx3.js +289 -0
- package/dist/{index-6dxrbnxm.js → index-f970qtb4.js} +7 -143
- package/dist/index-fatcn6fp.js +2791 -0
- package/dist/index-fbzykqxy.js +105 -0
- package/dist/{index-1265j7t2.js → index-fwf274vc.js} +24 -14
- package/dist/index-fy4w0a7v.js +0 -0
- package/dist/index-gvva3e5x.js +76 -0
- package/dist/index-h7dcah4p.js +137 -0
- package/dist/index-hm9r120s.js +42 -0
- package/dist/index-j3d2tw97.js +328 -0
- package/dist/index-jfqj20x8.js +41 -0
- package/dist/{index-yp0jtaxp.js → index-k529a278.js} +6 -6
- package/dist/{index-bt2p8x7r.js → index-kbrf5bx7.js} +110 -106
- package/dist/index-kwk23ktq.js +33 -0
- package/dist/index-kz857p1j.js +557 -0
- package/dist/{index-tc2r2n8b.js → index-mkt5yrax.js} +31 -105
- package/dist/{index-tgt8gtq7.js → index-ndgnvjez.js} +18 -18
- package/dist/index-nemn4epv.js +43 -0
- package/dist/index-nkwy5bjr.js +1225 -0
- package/dist/index-nvvzr4ny.js +136 -0
- package/dist/index-pkspzsfs.js +78 -0
- package/dist/{index-fm84men1.js → index-px1tnqgt.js} +2 -2
- package/dist/index-q7qdw883.js +79 -0
- package/dist/{index-mzydbzp8.js → index-qvbg6tx1.js} +65 -23
- package/dist/index-r3mwr5fb.js +0 -0
- package/dist/index-rdr78m0k.js +91 -0
- package/dist/index-rtamqsfs.js +59 -0
- package/dist/index-s125ss45.js +38 -0
- package/dist/{index-h8r80xhk.js → index-sx1t6dnd.js} +4005 -2781
- package/dist/index-tar0ngkm.js +359 -0
- package/dist/index-tn58cr6w.js +471 -0
- package/dist/{index-v17e1xs8.js → index-v79s9bf9.js} +96 -23
- package/dist/index-vk3rq21m.js +17 -0
- package/dist/index-vmvnr28y.js +72 -0
- package/dist/index-vz629cg8.js +49 -0
- package/dist/{index-eps3c3g6.js → index-w292hdpz.js} +197 -960
- package/dist/{index-t6sjhxh8.js → index-w9eqg6p9.js} +24 -302
- package/dist/index-wj96kdw2.js +57 -0
- package/dist/index-wyck5yhd.js +141 -0
- package/dist/index-xvtk8pxs.js +674 -0
- package/dist/{index-bpc596v3.js → index-xwb691v9.js} +2 -2
- package/dist/index-ym69x168.js +518 -0
- package/dist/index-yprdjk9v.js +65 -0
- package/dist/index-z2a81ccr.js +35 -0
- package/dist/{index-3ah1f369.js → index-z69cqk74.js} +3 -3
- package/dist/index-zaakvmzq.js +62 -0
- package/dist/index-zk3m4mzg.js +232 -0
- package/dist/index-zx3wgvx4.js +218 -0
- package/dist/index.js +102 -83
- package/dist/persistence/migration-guard.d.ts +3 -0
- package/dist/runtime/harness.d.ts +2 -0
- package/dist/service-cli.js +130 -40
- package/dist/service-client-cli-2rzxy5mj.js +1166 -0
- package/dist/service-client-cli-5ne8q5ej.js +543 -0
- package/dist/tools/ooxml-zip.d.ts +21 -0
- package/dist/tools/presentations.d.ts +47 -0
- package/dist/tools/tabular-data.d.ts +114 -0
- package/dist/tools/workspace.d.ts +76 -0
- package/dist/verify-historical-migrations.js +1923 -797
- package/dist/workspace/workspace.d.ts +13 -1
- package/dist/zhx.js +8 -6
- package/docs/APPLICATION_MIGRATION.md +32 -0
- package/docs/CLI.md +166 -2
- package/docs/CODE_RELEASE.md +5 -3
- package/docs/CODE_WEB_TASKS.md +3 -114
- package/docs/CONTEXT_ENGINEERING.md +27 -0
- package/docs/ENGINE_API.md +1 -1
- package/docs/EXTENSIBILITY.md +1 -1
- package/docs/FIRST_USE.md +6 -6
- package/docs/INTERNAL_ARCHIVE.md +43 -0
- package/docs/LOCAL_SERVICE.md +1 -1
- package/docs/MODEL_CATALOG.md +14 -0
- package/docs/README.md +13 -2
- package/evaluations/representative-assembly-matrix.json +10 -1
- package/examples/README.md +3 -3
- package/examples/assistant/compatible-calendar.json +17 -0
- package/examples/assistant/composed-modules.json +23 -0
- package/examples/assistant/connected-tools.json +9 -0
- package/examples/assistant/daily-tools.json +6 -0
- package/examples/assistant/offline.mjs +24 -0
- package/fixtures/cli-compatibility/README.md +10 -0
- package/fixtures/cli-compatibility/inventory.json +7858 -0
- package/package.json +230 -28
- package/dist/cli/console/console-model-catalog.d.ts +0 -8
- package/dist/index-4gt045j0.js +0 -288
- package/dist/index-4jw3tvy8.js +0 -301
- package/dist/index-ebb5d4s3.js +0 -640
- package/dist/index-x9hv1a34.js +0 -274
- package/dist/service-client-cli-gtk26axb.js +0 -1251
|
@@ -1,30 +1,310 @@
|
|
|
1
|
+
import {
|
|
2
|
+
changeEnvelopeSchema,
|
|
3
|
+
streamEventDocument,
|
|
4
|
+
verifyChangeEnvelope
|
|
5
|
+
} from "./cli-entry-cpm89r9q.js";
|
|
1
6
|
import {
|
|
2
7
|
APPROVAL_HISTORY_KEY,
|
|
8
|
+
SqliteDatabase,
|
|
3
9
|
TASK_ACCEPTANCE_EVIDENCE_KEY,
|
|
4
10
|
USAGE_LEDGER_KEY,
|
|
5
11
|
approvalDecisionViews,
|
|
6
|
-
changeEnvelopeSchema,
|
|
7
12
|
harnessPolicyDecisionEventSchema,
|
|
8
13
|
inspectRuntimeManifest,
|
|
9
14
|
inspectUsageLedger,
|
|
15
|
+
openCliSessionStore,
|
|
10
16
|
readTaskAcceptanceLedger,
|
|
11
|
-
taskCheckReceiptSchema
|
|
12
|
-
|
|
13
|
-
} from "./cli-entry-ynahz9qc.js";
|
|
17
|
+
taskCheckReceiptSchema
|
|
18
|
+
} from "./cli-entry-vmce694z.js";
|
|
14
19
|
import {
|
|
15
20
|
HARNESS_VERSION
|
|
16
|
-
} from "./cli-entry-
|
|
21
|
+
} from "./cli-entry-kwk23ktq.js";
|
|
17
22
|
|
|
18
|
-
// src/
|
|
19
|
-
import { createHash
|
|
23
|
+
// packages/core/src/client/service-events.ts
|
|
24
|
+
import { createHash } from "node:crypto";
|
|
25
|
+
import { createRedactionPolicy } from "@zhivex-ai/agents";
|
|
26
|
+
var MAX_SNAPSHOT_BYTES = 2 * 1024 * 1024;
|
|
27
|
+
var TEXT_CHUNK_CHARACTERS = 8192;
|
|
28
|
+
var serializeBoundedSnapshot = (snapshot, currentRun) => {
|
|
29
|
+
let encoded = JSON.stringify(snapshot);
|
|
30
|
+
if (Buffer.byteLength(encoded) <= MAX_SNAPSHOT_BYTES)
|
|
31
|
+
return encoded;
|
|
32
|
+
const historical = Object.keys(snapshot.runs).filter((id) => id !== currentRun);
|
|
33
|
+
const compact = (ids) => {
|
|
34
|
+
for (const field of ["text", "prompt", "tools"])
|
|
35
|
+
for (const id of ids) {
|
|
36
|
+
const run = snapshot.runs[id];
|
|
37
|
+
if (field === "text") {
|
|
38
|
+
if (!run.text)
|
|
39
|
+
continue;
|
|
40
|
+
run.text = "";
|
|
41
|
+
} else {
|
|
42
|
+
if (run[field] === undefined)
|
|
43
|
+
continue;
|
|
44
|
+
delete run[field];
|
|
45
|
+
}
|
|
46
|
+
run.truncated = true;
|
|
47
|
+
encoded = JSON.stringify(snapshot);
|
|
48
|
+
if (Buffer.byteLength(encoded) <= MAX_SNAPSHOT_BYTES)
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
};
|
|
53
|
+
if (compact(historical) || compact([currentRun]))
|
|
54
|
+
return encoded;
|
|
55
|
+
throw new Error("ACTIVITY_SNAPSHOT_LIMIT");
|
|
56
|
+
};
|
|
57
|
+
var openHarnessActivityStore = async (config, options = {}) => {
|
|
58
|
+
const index = await openCliSessionStore({ workspace: config.workspace, stateDirectory: config.stateDirectory, scope: config.scope });
|
|
59
|
+
const scope = `${index.workspaceKey}:${index.scopeKey}`;
|
|
60
|
+
const db = new SqliteDatabase(index.databasePath);
|
|
61
|
+
index.close();
|
|
62
|
+
const maxEvents = options.maxEvents ?? 1e4, retentionMs = options.retentionMs ?? 7 * 24 * 3600 * 1000, now = options.now ?? Date.now;
|
|
63
|
+
if (!Number.isSafeInteger(maxEvents) || maxEvents < 1 || maxEvents > 1e5 || !Number.isSafeInteger(retentionMs) || retentionMs < 1) {
|
|
64
|
+
db.close();
|
|
65
|
+
throw new Error("ACTIVITY_LIMIT_INVALID");
|
|
66
|
+
}
|
|
67
|
+
db.exec(`CREATE TABLE IF NOT EXISTS client_activity_events(sequence INTEGER PRIMARY KEY AUTOINCREMENT, scope TEXT NOT NULL, session TEXT NOT NULL, run TEXT NOT NULL, at INTEGER NOT NULL, activity TEXT NOT NULL);
|
|
68
|
+
CREATE INDEX IF NOT EXISTS client_activity_scope ON client_activity_events(scope, session, sequence);
|
|
69
|
+
CREATE INDEX IF NOT EXISTS client_activity_sequence ON client_activity_events(scope, sequence);
|
|
70
|
+
CREATE INDEX IF NOT EXISTS client_activity_age ON client_activity_events(scope, at);
|
|
71
|
+
CREATE TABLE IF NOT EXISTS client_activity_snapshots(scope TEXT NOT NULL, session TEXT NOT NULL, sequence INTEGER NOT NULL, expired_through INTEGER NOT NULL DEFAULT 0, snapshot TEXT NOT NULL, PRIMARY KEY(scope,session));`);
|
|
72
|
+
const readSnapshot = db.query("SELECT snapshot,expired_through FROM client_activity_snapshots WHERE scope=? AND session=?");
|
|
73
|
+
const retentionCutoff = db.query("SELECT sequence FROM client_activity_events WHERE scope=? ORDER BY sequence DESC LIMIT 1 OFFSET ?");
|
|
74
|
+
const expiredEvents = db.query(`SELECT session,MAX(sequence) AS seq FROM (
|
|
75
|
+
SELECT session,sequence FROM client_activity_events WHERE scope=? AND at < ?
|
|
76
|
+
UNION ALL SELECT session,sequence FROM client_activity_events WHERE scope=? AND sequence<=?
|
|
77
|
+
) GROUP BY session`);
|
|
78
|
+
const markExpired = db.query("UPDATE client_activity_snapshots SET expired_through=MAX(expired_through,?) WHERE scope=? AND session=?");
|
|
79
|
+
const deleteExpired = db.query("DELETE FROM client_activity_events WHERE scope=? AND session=? AND sequence<=?");
|
|
80
|
+
const insertEvent = db.query("INSERT INTO client_activity_events(scope,session,run,at,activity) VALUES(?,?,?,?,?)");
|
|
81
|
+
const lastSequence = db.query("SELECT last_insert_rowid() AS seq");
|
|
82
|
+
const saveSnapshot = db.query("INSERT INTO client_activity_snapshots(scope,session,sequence,snapshot) VALUES(?,?,?,?) ON CONFLICT(scope,session) DO UPDATE SET sequence=excluded.sequence,snapshot=excluded.snapshot");
|
|
83
|
+
const dataVersion = db.query("PRAGMA data_version");
|
|
84
|
+
let cached;
|
|
85
|
+
const readEvents = db.query("SELECT sequence,session,run,at,activity FROM client_activity_events WHERE scope=? AND session=? AND sequence>? ORDER BY sequence LIMIT 201");
|
|
86
|
+
const redaction = createRedactionPolicy({ includeEmails: true });
|
|
87
|
+
const redact = (text) => {
|
|
88
|
+
let result = text;
|
|
89
|
+
for (const secret of options.sensitiveValues ?? [])
|
|
90
|
+
if (secret)
|
|
91
|
+
result = result.split(secret).join("[REDACTED]");
|
|
92
|
+
return redaction.redactText(result).replace(/\b(?:sk|ghp|github_pat|xox[baprs])[-_][A-Za-z0-9_-]+/gi, "[REDACTED]");
|
|
93
|
+
};
|
|
94
|
+
const redactValue = (value) => typeof value === "string" ? redact(value) : Array.isArray(value) ? value.map(redactValue) : value && typeof value === "object" ? Object.fromEntries(Object.entries(value).map(([k, v]) => [k, redactValue(v)])) : value;
|
|
95
|
+
const tails = new Map;
|
|
96
|
+
const discard = new Set;
|
|
97
|
+
const flush = (key, chunk, final = false) => {
|
|
98
|
+
let text = (tails.get(key) ?? "") + chunk;
|
|
99
|
+
for (const secret of options.sensitiveValues ?? [])
|
|
100
|
+
if (secret)
|
|
101
|
+
text = text.split(secret).join("[REDACTED]");
|
|
102
|
+
if (discard.has(key)) {
|
|
103
|
+
const end = text.search(/\s/);
|
|
104
|
+
if (end < 0 && !final)
|
|
105
|
+
return "";
|
|
106
|
+
text = end < 0 ? "" : text.slice(end);
|
|
107
|
+
discard.delete(key);
|
|
108
|
+
}
|
|
109
|
+
let boundary = final ? text.length : text.match(/^[\s\S]*\s/)?.[0].length ?? 0;
|
|
110
|
+
if (!final)
|
|
111
|
+
for (const secret of options.sensitiveValues ?? []) {
|
|
112
|
+
if (!secret)
|
|
113
|
+
continue;
|
|
114
|
+
let start = text.indexOf(secret[0], Math.max(0, text.length - secret.length + 1));
|
|
115
|
+
while (start >= 0 && start < boundary) {
|
|
116
|
+
if (secret.startsWith(text.slice(start))) {
|
|
117
|
+
boundary = start;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
start = text.indexOf(secret[0], start + 1);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
let result = redact(text.slice(0, boundary));
|
|
124
|
+
text = text.slice(boundary);
|
|
125
|
+
if (text.length > 16384) {
|
|
126
|
+
result += "[TRUNCATED]";
|
|
127
|
+
text = "";
|
|
128
|
+
discard.add(key);
|
|
129
|
+
}
|
|
130
|
+
tails.set(key, text);
|
|
131
|
+
return result;
|
|
132
|
+
};
|
|
133
|
+
const snapshot = (sessionId) => {
|
|
134
|
+
const row = readSnapshot.get(scope, sessionId);
|
|
135
|
+
return { state: row ? JSON.parse(row.snapshot) : { schemaVersion: 1, sessionId, sequence: 0, runs: {} }, expiredThrough: row?.expired_through ?? 0 };
|
|
136
|
+
};
|
|
137
|
+
const prune = () => {
|
|
138
|
+
const cutoff = retentionCutoff.get(scope, maxEvents)?.sequence ?? 0;
|
|
139
|
+
const expired = expiredEvents.all(scope, now() - retentionMs, scope, cutoff);
|
|
140
|
+
for (const row of expired) {
|
|
141
|
+
markExpired.run(row.seq, scope, row.session);
|
|
142
|
+
deleteExpired.run(scope, row.session, row.seq);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
const write = (sessionId, runId, activity) => {
|
|
146
|
+
if (!/^[A-Za-z0-9._:-]{1,128}$/.test(sessionId) || !/^[A-Za-z0-9._:-]{1,128}$/.test(runId))
|
|
147
|
+
throw new Error("ACTIVITY_ID_INVALID");
|
|
148
|
+
const at = now();
|
|
149
|
+
const encoded = JSON.stringify(activity);
|
|
150
|
+
if (Buffer.byteLength(encoded) > 64 * 1024)
|
|
151
|
+
throw new Error("ACTIVITY_TOO_LARGE");
|
|
152
|
+
db.exec("BEGIN IMMEDIATE");
|
|
153
|
+
try {
|
|
154
|
+
const version = dataVersion.get().data_version;
|
|
155
|
+
const runs = cached?.sessionId === sessionId && cached.version === version ? { ...cached.runs } : Object.fromEntries(Object.entries(snapshot(sessionId).state.runs).map(([id, run]) => [id, JSON.stringify(run)]));
|
|
156
|
+
const previous = Object.hasOwn(runs, runId) ? runs[runId] : undefined;
|
|
157
|
+
if (!previous && Object.keys(runs).length >= 1000)
|
|
158
|
+
throw new Error("ACTIVITY_RUN_LIMIT");
|
|
159
|
+
const state = previous ? JSON.parse(previous) : { text: "", status: "running", truncated: false };
|
|
160
|
+
if (typeof activity.textDelta === "string") {
|
|
161
|
+
state.text += activity.textDelta;
|
|
162
|
+
if (state.text.length > 256 * 1024) {
|
|
163
|
+
state.text = state.text.slice(-256 * 1024);
|
|
164
|
+
state.truncated = true;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (activity.type === "user-message" && typeof activity.prompt === "string")
|
|
168
|
+
state.prompt = activity.prompt;
|
|
169
|
+
if (typeof activity.toolCallId === "string" && typeof activity.toolName === "string") {
|
|
170
|
+
state.tools ??= {};
|
|
171
|
+
const key = `tool:${activity.toolCallId}`;
|
|
172
|
+
if (state.tools[key] || Object.keys(state.tools).length < 256) {
|
|
173
|
+
const status = activity.type === "tool-result" ? activity.isError === true || activity.timedOut === true || typeof activity.exitCode === "number" && activity.exitCode !== 0 ? "failed" : "completed" : "running";
|
|
174
|
+
state.tools[key] = { name: activity.toolName, status, ...typeof activity.exitCode === "number" ? { exitCode: activity.exitCode } : {}, ...typeof activity.timedOut === "boolean" ? { timedOut: activity.timedOut } : {} };
|
|
175
|
+
} else
|
|
176
|
+
state.truncated = true;
|
|
177
|
+
}
|
|
178
|
+
if (typeof activity.status === "string" && (activity.type === "checkpoint" || activity.type === "agent-run-finish"))
|
|
179
|
+
state.status = activity.status;
|
|
180
|
+
if (activity.type === "agent-run-start")
|
|
181
|
+
state.status = "running";
|
|
182
|
+
if (activity.type === "tool-approval-request" || activity.type === "agent-approval-request")
|
|
183
|
+
state.status = "waiting_approval";
|
|
184
|
+
insertEvent.run(scope, sessionId, runId, at, encoded);
|
|
185
|
+
const sequence = lastSequence.get().seq;
|
|
186
|
+
Object.defineProperty(runs, runId, { value: JSON.stringify(state), enumerable: true, configurable: true, writable: true });
|
|
187
|
+
const header = JSON.stringify({ schemaVersion: 1, sessionId, sequence });
|
|
188
|
+
let bounded = header.slice(0, -1) + ',"runs":{' + Object.entries(runs).map(([id, run]) => JSON.stringify(id) + ":" + run).join(",") + "}}";
|
|
189
|
+
if (Buffer.byteLength(bounded) > MAX_SNAPSHOT_BYTES) {
|
|
190
|
+
bounded = serializeBoundedSnapshot(JSON.parse(bounded), runId);
|
|
191
|
+
const compacted = JSON.parse(bounded);
|
|
192
|
+
for (const [id, run] of Object.entries(compacted.runs))
|
|
193
|
+
runs[id] = JSON.stringify(run);
|
|
194
|
+
}
|
|
195
|
+
saveSnapshot.run(scope, sessionId, sequence, bounded);
|
|
196
|
+
prune();
|
|
197
|
+
db.exec("COMMIT");
|
|
198
|
+
cached = { sessionId, version, runs };
|
|
199
|
+
} catch (e) {
|
|
200
|
+
cached = undefined;
|
|
201
|
+
db.exec("ROLLBACK");
|
|
202
|
+
throw e;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
const writeText = (sessionId, runId, text) => {
|
|
206
|
+
for (let start = 0;start < text.length; ) {
|
|
207
|
+
let end = Math.min(text.length, start + TEXT_CHUNK_CHARACTERS);
|
|
208
|
+
if (end < text.length && /[\uD800-\uDBFF]/.test(text[end - 1]) && /[\uDC00-\uDFFF]/.test(text[end]))
|
|
209
|
+
end--;
|
|
210
|
+
write(sessionId, runId, { type: "text-delta", textDelta: text.slice(start, end) });
|
|
211
|
+
start = end;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
return {
|
|
215
|
+
policyDecision(sessionId, runId, event) {
|
|
216
|
+
write(sessionId, runId, redactValue(harnessPolicyDecisionEventSchema.parse(event)));
|
|
217
|
+
},
|
|
218
|
+
prompt(sessionId, runId, prompt) {
|
|
219
|
+
const safe = redact(prompt);
|
|
220
|
+
const activity = (value) => ({ type: "user-message", prompt: value });
|
|
221
|
+
let bounded = safe;
|
|
222
|
+
if (Buffer.byteLength(JSON.stringify(activity(safe))) > 60 * 1024) {
|
|
223
|
+
const characters = Array.from(safe);
|
|
224
|
+
let lower = 0, upper = characters.length;
|
|
225
|
+
while (lower < upper) {
|
|
226
|
+
const middle = Math.ceil((lower + upper) / 2);
|
|
227
|
+
const candidate = characters.slice(0, middle).join("") + "[TRUNCATED]";
|
|
228
|
+
if (Buffer.byteLength(JSON.stringify(activity(candidate))) <= 60 * 1024)
|
|
229
|
+
lower = middle;
|
|
230
|
+
else
|
|
231
|
+
upper = middle - 1;
|
|
232
|
+
}
|
|
233
|
+
bounded = characters.slice(0, lower).join("") + "[TRUNCATED]";
|
|
234
|
+
}
|
|
235
|
+
write(sessionId, runId, activity(bounded));
|
|
236
|
+
},
|
|
237
|
+
append(sessionId, runId, event) {
|
|
238
|
+
const key = `${sessionId}:${runId}`;
|
|
239
|
+
if (event.type === "text-delta") {
|
|
240
|
+
const textDelta = flush(key, event.textDelta);
|
|
241
|
+
writeText(sessionId, runId, textDelta);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
if (event.type === "agent-run-finish" || event.type === "error") {
|
|
245
|
+
const textDelta = flush(key, "", true);
|
|
246
|
+
writeText(sessionId, runId, textDelta);
|
|
247
|
+
tails.delete(key);
|
|
248
|
+
}
|
|
249
|
+
const projected = streamEventDocument(event);
|
|
250
|
+
if (projected) {
|
|
251
|
+
let receipt = {};
|
|
252
|
+
if (event.type === "tool-result" && event.toolResult.toolName === "run_check") {
|
|
253
|
+
const output = event.toolResult.output;
|
|
254
|
+
if (output && typeof output === "object" && !Array.isArray(output) && "exitCode" in output && Number.isSafeInteger(output.exitCode))
|
|
255
|
+
receipt = { exitCode: output.exitCode, timedOut: "timedOut" in output && output.timedOut === true };
|
|
256
|
+
}
|
|
257
|
+
write(sessionId, runId, redactValue({ ...projected, ...receipt }));
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
checkpoint(sessionId, runId, status) {
|
|
261
|
+
const key = `${sessionId}:${runId}`;
|
|
262
|
+
const textDelta = flush(key, "", true);
|
|
263
|
+
writeText(sessionId, runId, textDelta);
|
|
264
|
+
tails.delete(key);
|
|
265
|
+
write(sessionId, runId, { type: "checkpoint", status });
|
|
266
|
+
},
|
|
267
|
+
replay(sessionId, after = 0) {
|
|
268
|
+
if (!Number.isSafeInteger(after) || after < 0)
|
|
269
|
+
throw new Error("ACTIVITY_CURSOR_INVALID");
|
|
270
|
+
db.exec("BEGIN IMMEDIATE");
|
|
271
|
+
try {
|
|
272
|
+
prune();
|
|
273
|
+
db.exec("COMMIT");
|
|
274
|
+
} catch (e) {
|
|
275
|
+
cached = undefined;
|
|
276
|
+
db.exec("ROLLBACK");
|
|
277
|
+
throw e;
|
|
278
|
+
}
|
|
279
|
+
const current = snapshot(sessionId);
|
|
280
|
+
const expired = after < current.expiredThrough;
|
|
281
|
+
if (after > current.state.sequence)
|
|
282
|
+
throw new Error("ACTIVITY_CURSOR_AHEAD");
|
|
283
|
+
if (expired)
|
|
284
|
+
return { schemaVersion: 1, cursorExpired: true, hasMore: false, policyEvidenceIncomplete: true, nextCursor: current.state.sequence, events: [], snapshot: current.state };
|
|
285
|
+
const rows = readEvents.all(scope, sessionId, after);
|
|
286
|
+
const events = rows.slice(0, 200).map((row) => ({ schemaVersion: 1, eventId: createHash("sha256").update(`${scope}:${row.sequence}`).digest("hex"), sequence: row.sequence, sessionId: row.session, runId: row.run, at: row.at, activity: JSON.parse(row.activity) }));
|
|
287
|
+
return { schemaVersion: 1, cursorExpired: false, hasMore: rows.length > 200, policyEvidenceIncomplete: current.expiredThrough > 0, nextCursor: events.at(-1)?.sequence ?? after, events };
|
|
288
|
+
},
|
|
289
|
+
close() {
|
|
290
|
+
db.close();
|
|
291
|
+
cached = undefined;
|
|
292
|
+
tails.clear();
|
|
293
|
+
discard.clear();
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
// packages/core/src/persistence/governance-report.ts
|
|
299
|
+
import { createHash as createHash3 } from "node:crypto";
|
|
20
300
|
import { z as z2 } from "zod";
|
|
21
301
|
|
|
22
|
-
// src/persistence/governance-context.ts
|
|
23
|
-
import { createHash } from "node:crypto";
|
|
302
|
+
// packages/core/src/persistence/governance-context.ts
|
|
303
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
24
304
|
import { z } from "zod";
|
|
25
305
|
var digest = z.string().regex(/^sha256:[a-f0-9]{64}$/);
|
|
26
306
|
var count = z.number().int().nonnegative().safe();
|
|
27
|
-
var governanceReference = (kind, value) => "sha256:" +
|
|
307
|
+
var governanceReference = (kind, value) => "sha256:" + createHash2("sha256").update(JSON.stringify([kind, value])).digest("hex");
|
|
28
308
|
var governanceSessionSchema = z.strictObject({ availability: z.enum(["recorded", "unavailable"]), reference: digest.nullable(), revision: count.nullable() });
|
|
29
309
|
var governanceHistorySchema = z.strictObject({
|
|
30
310
|
availability: z.enum(["recorded", "unavailable"]),
|
|
@@ -155,7 +435,7 @@ function projectGovernanceEnvelopes(envelopes, patches, now) {
|
|
|
155
435
|
});
|
|
156
436
|
}
|
|
157
437
|
|
|
158
|
-
// src/persistence/governance-report.ts
|
|
438
|
+
// packages/core/src/persistence/governance-report.ts
|
|
159
439
|
var digest2 = z2.string().regex(/^sha256:[a-f0-9]{64}$/);
|
|
160
440
|
var version = z2.string().regex(/^\d+\.\d+\.\d+(?:[-+][a-zA-Z0-9.-]+)?$/);
|
|
161
441
|
var bindingSchema = z2.object({ schemaVersion: z2.literal(1), id: z2.literal("zhivex-harness"), version, fingerprint: digest2, algorithm: z2.literal("sha256") });
|
|
@@ -293,7 +573,7 @@ function projectRun(state, journal, limitations) {
|
|
|
293
573
|
const bound = parsedDelivery.success && contract && parsedDelivery.data.contractDigest === contract.digest && parsedDelivery.data.contractRevision === contract.revision && (!parsedDelivery.data.delivery || parsedDelivery.data.delivery.runId === state.runId);
|
|
294
574
|
const candidate = bound ? parsedDelivery.data : undefined;
|
|
295
575
|
const verified = candidate?.status === "verified" || candidate?.status === "pending_review";
|
|
296
|
-
const validSuccess = !verified || stateStatus === "completed" && candidate.delivery && contract && contract.contract.requiredChecks.every((required) => candidate.checks.some((check) => check.checkId === required.id && check.runId === state.runId && check.argvDigest === "sha256:" +
|
|
576
|
+
const validSuccess = !verified || stateStatus === "completed" && candidate.delivery && contract && contract.contract.requiredChecks.every((required) => candidate.checks.some((check) => check.checkId === required.id && check.runId === state.runId && check.argvDigest === "sha256:" + createHash3("sha256").update(JSON.stringify([required.command, ...required.args])).digest("hex") && check.contractDigest === contract.digest && check.contractRevision === contract.revision && check.exitCode === 0 && !check.timedOut && check.unchanged && check.patchId === candidate.delivery.patchId && check.snapshotDigest === candidate.delivery.snapshotDigest && check.executionIdentity === candidate.delivery.executionIdentity)) && candidate.status === "pending_review" === contract.contract.humanReview.length > 0;
|
|
297
577
|
const delivery = validSuccess ? candidate : undefined;
|
|
298
578
|
if (rawDelivery !== undefined && !delivery)
|
|
299
579
|
limitations.add("invalid_delivery");
|
|
@@ -350,7 +630,7 @@ function projectRun(state, journal, limitations) {
|
|
|
350
630
|
humanReviewsPending: contract?.contract.humanReview.length ?? null,
|
|
351
631
|
allowedWritePathReferences: contract?.contract.allowedWritePaths.map((file) => governanceReference("path", file)) ?? [],
|
|
352
632
|
protectedPathReferences: contract?.contract.protectedFiles.map((file) => governanceReference("path", file)) ?? [],
|
|
353
|
-
checks: contract?.contract.requiredChecks.map((check) => ({ reference: governanceReference("check", check.id), argvDigest: "sha256:" +
|
|
633
|
+
checks: contract?.contract.requiredChecks.map((check) => ({ reference: governanceReference("check", check.id), argvDigest: "sha256:" + createHash3("sha256").update(JSON.stringify([check.command, ...check.args])).digest("hex"), kind: check.kind, backend: check.execution.backend, approval: check.execution.approval })) ?? [],
|
|
354
634
|
humanReviewReferences: contract?.contract.humanReview.map((review) => governanceReference("review", review.id)) ?? []
|
|
355
635
|
},
|
|
356
636
|
delivery: {
|
|
@@ -481,4 +761,4 @@ function renderHarnessGovernanceMarkdown(input) {
|
|
|
481
761
|
`);
|
|
482
762
|
}
|
|
483
763
|
|
|
484
|
-
export { harnessGovernanceReportSchema, exportHarnessGovernanceReport, renderHarnessGovernanceMarkdown };
|
|
764
|
+
export { harnessGovernanceReportSchema, exportHarnessGovernanceReport, renderHarnessGovernanceMarkdown, openHarnessActivityStore };
|