@reticlehq/server 3.1.0 → 3.3.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/SKILL.md +30 -28
- package/dist/command/cli/adhoc-suite.d.ts +19 -0
- package/dist/command/cli/adhoc-suite.js +88 -0
- package/dist/command/cli/adhoc-verdict.d.ts +23 -2
- package/dist/command/cli/adhoc-verdict.js +18 -10
- package/dist/command/cli/auth/device-flow.d.ts +2 -2
- package/dist/command/cli/cli-doctor.js +37 -5
- package/dist/command/cli/cli-flow-commands.d.ts +2 -1
- package/dist/command/cli/cli-kill.js +1 -1
- package/dist/command/cli/cli-parse-grammar.d.ts +7 -0
- package/dist/command/cli/cli-parse-grammar.js +7 -0
- package/dist/command/cli/cli-parse-verify.d.ts +2 -5
- package/dist/command/cli/cli-parse-verify.js +86 -13
- package/dist/command/cli/cli-parse.d.ts +8 -1
- package/dist/command/cli/cli-parse.js +38 -7
- package/dist/command/cli/cli-verify.d.ts +59 -0
- package/dist/command/cli/cli-verify.js +131 -19
- package/dist/command/cli/cloud-cli.js +7 -6
- package/dist/command/cli/cloud-kit.d.ts +0 -2
- package/dist/command/cli/cloud-kit.js +3 -7
- package/dist/command/cli/config/config-discovery.d.ts +12 -0
- package/dist/command/cli/config/config-discovery.js +19 -0
- package/dist/command/cli/doctor/doctor-rows.d.ts +12 -0
- package/dist/command/cli/doctor/doctor-rows.js +12 -0
- package/dist/command/cli/doctor/doctor-sessions-line.d.ts +2 -1
- package/dist/command/cli/drive/drive-command.js +1 -1
- package/dist/command/cli/launch/cli-launch.d.ts +3 -23
- package/dist/command/cli/launch/cli-launch.js +29 -70
- package/dist/command/cli/lifecycle/daemon-lifecycle.d.ts +33 -0
- package/dist/command/cli/lifecycle/daemon-lifecycle.js +198 -0
- package/dist/command/cli/mcp-command.js +5 -3
- package/dist/command/cli/ports/resolve/cli-port.d.ts +15 -1
- package/dist/command/cli/ports/resolve/cli-port.js +50 -2
- package/dist/command/cli/report-command.d.ts +16 -0
- package/dist/command/cli/report-command.js +97 -0
- package/dist/command/cli/status/status-lines.d.ts +28 -0
- package/dist/command/cli/status/status-lines.js +117 -0
- package/dist/command/cli.d.ts +1 -1
- package/dist/command/cli.js +29 -177
- package/dist/command/daemon/binding/daemon-status-probe.d.ts +32 -0
- package/dist/command/daemon/binding/daemon-status-probe.js +93 -0
- package/dist/command/daemon/binding/loopback-reach.d.ts +42 -0
- package/dist/command/daemon/binding/loopback-reach.js +63 -0
- package/dist/command/daemon/binding/port-presence.d.ts +1 -1
- package/dist/command/daemon/daemon-resilience.d.ts +13 -1
- package/dist/command/daemon/daemon-resilience.js +12 -1
- package/dist/command/daemon/daemon.d.ts +2 -11
- package/dist/command/daemon/daemon.js +8 -11
- package/dist/command/daemon/idle-shutdown.d.ts +2 -1
- package/dist/command/daemon/lifetime/heartbeat.d.ts +8 -0
- package/dist/command/daemon/lifetime/heartbeat.js +10 -0
- package/dist/command/daemon/lifetime/log-cap.d.ts +68 -0
- package/dist/command/daemon/lifetime/log-cap.js +115 -0
- package/dist/command/setup/agent-notice-memory.d.ts +16 -0
- package/dist/command/setup/agent-notice-memory.js +65 -0
- package/dist/command/setup/bringup/dev-server-wait.d.ts +1 -0
- package/dist/command/setup/bringup/dev-server-wait.js +16 -0
- package/dist/command/setup/bringup/ensure-daemon.js +1 -1
- package/dist/command/setup/init/init-host.js +8 -0
- package/dist/command/setup/init/init-runtime.js +13 -1
- package/dist/command/setup/node-effects.js +1 -1
- package/dist/command/setup/probe/page-probe.js +9 -2
- package/dist/command/setup/run-setup.d.ts +25 -7
- package/dist/command/setup/run-setup.js +51 -9
- package/dist/command/setup/setup-command.js +31 -3
- package/dist/command/setup/terminal/confirm.js +2 -1
- package/dist/command/update/updater.d.ts +27 -0
- package/dist/command/update/updater.js +35 -2
- package/dist/features/crawl/crawl-tools.js +3 -1
- package/dist/features/crawl/crawl.d.ts +2 -0
- package/dist/features/crawl/crawl.js +3 -1
- package/dist/features/harness/drive-report.d.ts +73 -0
- package/dist/features/harness/drive-report.js +196 -0
- package/dist/features/harness/driver.js +29 -8
- package/dist/features/harness/drivers.d.ts +19 -0
- package/dist/features/harness/drivers.js +19 -0
- package/dist/features/harness/fill-values.d.ts +67 -0
- package/dist/features/harness/fill-values.js +153 -0
- package/dist/features/harness/jev-driver.d.ts +188 -0
- package/dist/features/harness/jev-driver.js +661 -0
- package/dist/features/harness/openai-driver.d.ts +46 -0
- package/dist/features/harness/openai-driver.js +197 -0
- package/dist/features/harness/platform-config.d.ts +62 -0
- package/dist/features/harness/platform-config.js +97 -0
- package/dist/features/visual/visual-tools.js +26 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +80 -130
- package/dist/judgement/capsule/capsule-store.d.ts +31 -2
- package/dist/judgement/capsule/capsule-store.js +58 -6
- package/dist/judgement/capsule/capsule.js +5 -0
- package/dist/judgement/capsule/causal-summary.d.ts +13 -1
- package/dist/judgement/capsule/causal-summary.js +7 -0
- package/dist/judgement/domain/domain-model.js +38 -9
- package/dist/judgement/domain/domain-tools.js +4 -2
- package/dist/judgement/outcome/assertion-integrity.d.ts +3 -3
- package/dist/judgement/phenomena/phenomena.d.ts +2 -1
- package/dist/judgement/runs/artifact/gap-report.d.ts +17 -0
- package/dist/judgement/runs/artifact/gap-report.js +46 -0
- package/dist/judgement/runs/artifact/gap-summary.d.ts +58 -0
- package/dist/judgement/runs/artifact/gap-summary.js +85 -0
- package/dist/judgement/runs/artifact/render-report.js +4 -1
- package/dist/judgement/runs/artifact/to-artifact.d.ts +7 -2
- package/dist/judgement/runs/artifact/to-artifact.js +1 -1
- package/dist/judgement/runs/context-tools.js +21 -3
- package/dist/judgement/runs/drive-run.js +7 -2
- package/dist/judgement/runs/verification-sync.d.ts +2 -2
- package/dist/judgement/runs/verification-sync.js +9 -2
- package/dist/language/flows/affected-tools.js +6 -3
- package/dist/language/flows/annotate-notes/annotate.d.ts +0 -15
- package/dist/language/flows/annotate-notes/annotate.js +66 -18
- package/dist/language/flows/flow-anchor.d.ts +12 -0
- package/dist/language/flows/flow-anchor.js +20 -0
- package/dist/language/flows/flow-expect-grammar.d.ts +2 -2
- package/dist/language/flows/flow-expect-grammar.js +92 -11
- package/dist/language/flows/flow-intent.js +1 -1
- package/dist/language/flows/flow-learning.d.ts +3 -0
- package/dist/language/flows/flow-learning.js +39 -8
- package/dist/language/flows/flow-replay-run.d.ts +55 -10
- package/dist/language/flows/flow-replay-run.js +217 -58
- package/dist/language/flows/flow-replay-types.d.ts +9 -0
- package/dist/language/flows/flow-replay.d.ts +29 -11
- package/dist/language/flows/flow-replay.js +221 -203
- package/dist/language/flows/flow-result.d.ts +18 -1
- package/dist/language/flows/flow-result.js +18 -2
- package/dist/language/flows/flow-step-runners.d.ts +26 -10
- package/dist/language/flows/flow-step-runners.js +20 -4
- package/dist/language/flows/flow-store-for-session.d.ts +2 -1
- package/dist/language/flows/flow-success.d.ts +21 -6
- package/dist/language/flows/flow-success.js +50 -138
- package/dist/language/flows/flow-tools.js +8 -4
- package/dist/language/flows/flows.d.ts +15 -10
- package/dist/language/flows/flows.js +17 -4
- package/dist/language/flows/heal.d.ts +9 -1
- package/dist/language/flows/heal.js +24 -2
- package/dist/language/flows/learned-sources.d.ts +21 -0
- package/dist/language/flows/learned-sources.js +84 -0
- package/dist/language/flows/narrow-write.d.ts +4 -4
- package/dist/language/flows/recording/recording-backtrack.d.ts +0 -7
- package/dist/language/flows/recording/recording-backtrack.js +1 -1
- package/dist/language/flows/recording/replay-halt.d.ts +2 -1
- package/dist/language/flows/recording/tape/recordings.d.ts +2 -2
- package/dist/language/flows/replay.js +13 -9
- package/dist/language/flows/stores/annotation-store.d.ts +5 -5
- package/dist/language/flows/stores/assertion-tiers-store.js +2 -3
- package/dist/language/flows/stores/flake-store.js +2 -3
- package/dist/language/flows/suite/coverage.d.ts +1 -1
- package/dist/language/flows/suite/parallel-suite.d.ts +2 -1
- package/dist/language/flows/suite-selection.d.ts +15 -1
- package/dist/language/flows/suite-selection.js +1 -1
- package/dist/language/flows/verify-change-tools.js +21 -4
- package/dist/memory/cloud/account-state.d.ts +1 -1
- package/dist/memory/cloud/account-state.js +5 -4
- package/dist/memory/cloud/cloud-config.d.ts +9 -0
- package/dist/memory/cloud/cloud-config.js +9 -0
- package/dist/memory/cloud/cloud-sync.d.ts +7 -4
- package/dist/memory/cloud/cloud-sync.js +11 -6
- package/dist/memory/cloud/harness-config.d.ts +12 -0
- package/dist/memory/cloud/harness-config.js +58 -0
- package/dist/memory/cloud/harness-offer.d.ts +44 -0
- package/dist/memory/cloud/harness-offer.js +146 -0
- package/dist/memory/cloud/harness-switch.d.ts +11 -0
- package/dist/memory/cloud/harness-switch.js +53 -0
- package/dist/memory/cloud/sync-cycle.d.ts +12 -0
- package/dist/memory/cloud/sync-cycle.js +29 -4
- package/dist/memory/cloud/sync-daemon.d.ts +35 -2
- package/dist/memory/cloud/sync-daemon.js +45 -0
- package/dist/memory/cloud/sync-disk.js +11 -6
- package/dist/memory/impact/impact-recorder.d.ts +8 -0
- package/dist/memory/impact/impact-recorder.js +2 -1
- package/dist/memory/impact/impact-store.d.ts +5 -0
- package/dist/memory/impact/impact-store.js +25 -0
- package/dist/memory/intent/inline-intent.js +8 -3
- package/dist/memory/intent/intent-shard-store.d.ts +33 -47
- package/dist/memory/intent/intent-shard-store.js +253 -141
- package/dist/memory/intent/intent-shard.d.ts +22 -23
- package/dist/memory/intent/intent-shard.js +1 -1
- package/dist/memory/intent/intent-store.d.ts +13 -8
- package/dist/memory/intent/intent-store.js +46 -90
- package/dist/memory/intent/intent-tools.js +34 -23
- package/dist/memory/journal/ambient-store.js +2 -3
- package/dist/memory/journal/attach-journal.d.ts +11 -0
- package/dist/memory/journal/attach-journal.js +1 -1
- package/dist/memory/journal/deviation-report.js +4 -1
- package/dist/memory/journal/deviation-service.js +10 -2
- package/dist/memory/journal/drive-flow.d.ts +2 -2
- package/dist/memory/journal/drive-flow.js +21 -12
- package/dist/memory/journal/envelope-store.js +2 -3
- package/dist/memory/journal/journal-query.d.ts +35 -1
- package/dist/memory/journal/journal-query.js +46 -0
- package/dist/memory/journal/journal-recorder.d.ts +71 -2
- package/dist/memory/journal/journal-recorder.js +45 -7
- package/dist/memory/journal/on-disk/retain-policy.d.ts +34 -0
- package/dist/memory/journal/on-disk/retain-policy.js +44 -0
- package/dist/memory/journal/on-disk/retention.d.ts +91 -2
- package/dist/memory/journal/on-disk/retention.js +181 -11
- package/dist/memory/journal/on-disk/startup-maintenance.d.ts +42 -0
- package/dist/memory/journal/on-disk/startup-maintenance.js +14 -0
- package/dist/memory/journal/on-disk/workspace-gitignore.d.ts +0 -2
- package/dist/memory/journal/on-disk/workspace-gitignore.js +6 -38
- package/dist/memory/journal/on-disk/workspace-tiers.d.ts +52 -0
- package/dist/memory/journal/on-disk/workspace-tiers.js +88 -0
- package/dist/memory/journal/route-template.d.ts +22 -0
- package/dist/memory/journal/route-template.js +44 -0
- package/dist/memory/journal/self-observation.d.ts +3 -0
- package/dist/memory/journal/self-observation.js +67 -0
- package/dist/memory/journal/session-end.d.ts +17 -4
- package/dist/memory/journal/session-end.js +85 -7
- package/dist/memory/journal/session-journal.d.ts +122 -5
- package/dist/memory/journal/session-journal.js +489 -32
- package/dist/memory/project/artifact-root-resolver.d.ts +3 -0
- package/dist/memory/project/artifact-root-resolver.js +89 -0
- package/dist/memory/project/artifact-root.d.ts +39 -2
- package/dist/memory/project/artifact-root.js +58 -1
- package/dist/memory/project/baselines.d.ts +1 -1
- package/dist/memory/project/dir/fill-value-store.d.ts +32 -0
- package/dist/memory/project/dir/fill-value-store.js +88 -0
- package/dist/memory/project/dir/reticle-dir.d.ts +15 -5
- package/dist/memory/project/dir/reticle-dir.js +11 -0
- package/dist/memory/project/fs/fs-port.d.ts +22 -1
- package/dist/memory/project/fs/fs-port.js +72 -5
- package/dist/memory/project/fs/write-atomic.d.ts +26 -0
- package/dist/memory/project/fs/write-atomic.js +48 -0
- package/dist/memory/project/learned-routes.d.ts +16 -2
- package/dist/memory/project/learned-routes.js +26 -10
- package/dist/memory/project/project-for-root.d.ts +30 -0
- package/dist/memory/project/project-for-root.js +43 -0
- package/dist/memory/project/project-tools.js +10 -5
- package/dist/memory/project/session-root.d.ts +35 -6
- package/dist/memory/project/session-root.js +70 -8
- package/dist/memory/recall/prior/connection-memory.d.ts +6 -0
- package/dist/memory/recall/prior/connection-memory.js +8 -0
- package/dist/memory/recall/registered-projects.d.ts +2 -1
- package/dist/portal/bridge/auth-failure-reason.d.ts +9 -0
- package/dist/portal/bridge/auth-failure-reason.js +20 -3
- package/dist/portal/bridge/bridge.d.ts +6 -1
- package/dist/portal/bridge/bridge.js +36 -2
- package/dist/portal/input/real-input.js +2 -1
- package/dist/portal/pool/browser-pool.d.ts +10 -0
- package/dist/portal/pool/browser-pool.js +10 -0
- package/dist/portal/pool/playwright-launcher.js +1 -0
- package/dist/portal/pool/pool-contract.d.ts +2 -0
- package/dist/portal/pool/storage-seed.d.ts +2 -1
- package/dist/portal/pool/zero-install.d.ts +27 -0
- package/dist/portal/pool/zero-install.js +54 -0
- package/dist/portal/realm/web-realm.js +6 -0
- package/dist/portal/session/dev-server/dev-server-probe.d.ts +2 -1
- package/dist/portal/session/dev-server/served-document.d.ts +21 -0
- package/dist/portal/session/dev-server/served-document.js +57 -0
- package/dist/portal/session/facts/background-traffic.d.ts +9 -0
- package/dist/portal/session/facts/background-traffic.js +25 -0
- package/dist/portal/session/facts/session-replaced.d.ts +19 -0
- package/dist/portal/session/facts/session-replaced.js +22 -0
- package/dist/portal/session/live-control-tools.js +48 -3
- package/dist/portal/session/no-session-diagnosis.d.ts +1 -0
- package/dist/portal/session/no-session-diagnosis.js +67 -60
- package/dist/portal/session/no-session-next-action.js +3 -2
- package/dist/portal/session/no-session-watch.js +14 -10
- package/dist/portal/session/presence/attachment-history.d.ts +13 -2
- package/dist/portal/session/rebind.d.ts +18 -0
- package/dist/portal/session/rebind.js +38 -0
- package/dist/portal/session/session-health.d.ts +61 -0
- package/dist/portal/session/session-health.js +40 -1
- package/dist/portal/session/session-info.d.ts +6 -0
- package/dist/portal/session/session-manager.d.ts +13 -0
- package/dist/portal/session/session-manager.js +42 -3
- package/dist/portal/session/session-successor.d.ts +11 -0
- package/dist/portal/session/session-successor.js +14 -1
- package/dist/portal/session/session-verdict-facts.d.ts +28 -0
- package/dist/portal/session/session-verdict-facts.js +15 -0
- package/dist/portal/session/session.d.ts +26 -10
- package/dist/portal/session/session.js +48 -49
- package/dist/status-payload.d.ts +12 -1
- package/dist/status-payload.js +4 -1
- package/dist/surface/http-server.js +3 -5
- package/dist/surface/mcp/faults/mcp-outage.d.ts +2 -1
- package/dist/surface/mcp/faults/mcp-outage.js +20 -4
- package/dist/surface/mcp/mcp-proxy.d.ts +10 -1
- package/dist/surface/mcp/mcp-proxy.js +23 -12
- package/dist/surface/mcp/mcp.d.ts +10 -1
- package/dist/surface/mcp/mcp.js +59 -29
- package/dist/surface/mcp/proxy/proxy-daemon-probe.d.ts +15 -2
- package/dist/surface/mcp/proxy/proxy-daemon-probe.js +22 -5
- package/dist/surface/mcp/proxy/proxy-log.d.ts +5 -11
- package/dist/surface/mcp/proxy/proxy-log.js +7 -22
- package/dist/surface/mcp/proxy-idle-exit.d.ts +2 -1
- package/dist/surface/mcp/server-instructions.js +12 -1
- package/dist/surface/tools/act/act-preflight.js +6 -1
- package/dist/surface/tools/act/already-true.d.ts +40 -0
- package/dist/surface/tools/act/already-true.js +36 -0
- package/dist/surface/tools/act/navigation/navigate-arrival.d.ts +6 -0
- package/dist/surface/tools/act/navigation/navigate-arrival.js +13 -0
- package/dist/surface/tools/act/sequence-grade.js +13 -0
- package/dist/surface/tools/act/settle-in-flight.d.ts +6 -2
- package/dist/surface/tools/act/settle-in-flight.js +29 -6
- package/dist/surface/tools/act-capsule.js +49 -8
- package/dist/surface/tools/act-tools.js +25 -24
- package/dist/surface/tools/args/numeric-bounds.d.ts +15 -2
- package/dist/surface/tools/args/numeric-bounds.js +30 -3
- package/dist/surface/tools/assert/assert-grade.js +14 -2
- package/dist/surface/tools/assert/assert-verdict.js +74 -21
- package/dist/surface/tools/browser-tools.js +4 -3
- package/dist/surface/tools/coverage-tools.js +5 -2
- package/dist/surface/tools/dynamic-tools.js +43 -46
- package/dist/surface/tools/error-recovery.d.ts +6 -0
- package/dist/surface/tools/error-recovery.js +15 -0
- package/dist/surface/tools/explore-tools.js +80 -7
- package/dist/surface/tools/feedback-tools.d.ts +2 -1
- package/dist/surface/tools/feedback-tools.js +50 -3
- package/dist/surface/tools/first-sentence.d.ts +24 -0
- package/dist/surface/tools/first-sentence.js +0 -0
- package/dist/surface/tools/harness-explore.d.ts +125 -1
- package/dist/surface/tools/harness-explore.js +401 -15
- package/dist/surface/tools/harness-plan.d.ts +76 -0
- package/dist/surface/tools/harness-plan.js +156 -0
- package/dist/surface/tools/harness-toolset.js +12 -1
- package/dist/surface/tools/invoke-tool.js +82 -9
- package/dist/surface/tools/lease-hint.d.ts +8 -0
- package/dist/surface/tools/lease-hint.js +10 -0
- package/dist/surface/tools/lease-tools.d.ts +16 -28
- package/dist/surface/tools/lease-tools.js +53 -5
- package/dist/surface/tools/lineage-tools.js +1 -1
- package/dist/surface/tools/live-call-text.d.ts +6 -0
- package/dist/surface/tools/live-call-text.js +36 -2
- package/dist/surface/tools/observe-tools.js +69 -15
- package/dist/surface/tools/read/query-windowed.d.ts +1 -1
- package/dist/surface/tools/read/query-windowed.js +1 -1
- package/dist/surface/tools/read-tools.js +1 -2
- package/dist/surface/tools/real-input-attempt.d.ts +0 -5
- package/dist/surface/tools/real-input-attempt.js +1 -1
- package/dist/surface/tools/tool-kit.d.ts +23 -3
- package/dist/surface/tools/tool-kit.js +6 -1
- package/dist/surface/tools/tool-surface.js +17 -5
- package/dist/surface/tools/tools-helpers.d.ts +8 -7
- package/dist/surface/tools/tools-helpers.js +11 -13
- package/dist/surface/tools/tools.js +70 -30
- package/dist/telemetry/bug-found.js +32 -2
- package/dist/telemetry/feedback-context.js +3 -3
- package/dist/telemetry/feedback-local.d.ts +1 -0
- package/dist/telemetry/feedback-local.js +1 -3
- package/dist/telemetry/feedback.d.ts +1 -1
- package/dist/telemetry/harness-drive.d.ts +6 -0
- package/dist/telemetry/harness-drive.js +39 -0
- package/dist/telemetry/hud-metrics.d.ts +32 -0
- package/dist/telemetry/hud-metrics.js +95 -0
- package/dist/telemetry/mcp-connection.d.ts +14 -1
- package/dist/telemetry/mcp-connection.js +17 -2
- package/dist/telemetry/onboarding-firsts.d.ts +30 -1
- package/dist/telemetry/onboarding-firsts.js +54 -12
- package/dist/telemetry/session-metrics.d.ts +5 -0
- package/dist/telemetry/session-metrics.js +15 -1
- package/dist/telemetry/verification-of.js +31 -3
- package/dist/wire-journal.d.ts +31 -0
- package/dist/wire-journal.js +100 -0
- package/docs/README.md +1 -0
- package/docs/agent-cheatsheet.md +7 -3
- package/docs/autodrive.md +42 -2
- package/docs/benchmarks.md +1 -1
- package/docs/capabilities.mdx +1 -1
- package/docs/cli/cloud.mdx +11 -9
- package/docs/cli/doctor.mdx +1 -0
- package/docs/cli/init.mdx +1 -0
- package/docs/cli/report.mdx +44 -0
- package/docs/cli/status.mdx +35 -20
- package/docs/cli.mdx +8 -18
- package/docs/desktop.mdx +1 -1
- package/docs/faq.mdx +1 -1
- package/docs/flows.md +11 -0
- package/docs/frameworks.mdx +113 -1
- package/docs/install-agentic.mdx +36 -0
- package/docs/install-manual.mdx +1 -1
- package/docs/packages/tauri.mdx +1 -1
- package/docs/packages.mdx +1 -1
- package/docs/predicates.mdx +144 -4
- package/docs/system-map.md +6 -4
- package/docs/telemetry.md +2 -1
- package/docs/token-efficiency.md +2 -2
- package/docs/tools/overview.mdx +1 -1
- package/docs/tools/query.mdx +10 -10
- package/docs/troubleshooting.mdx +8 -2
- package/docs/usage.md +2 -2
- package/docs/what-is-recorded.md +62 -0
- package/package.json +5 -5
- package/dist/judgement/outcome/predicate-to-expect.d.ts +0 -44
- package/dist/judgement/outcome/predicate-to-expect.js +0 -148
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type DriveProgram, type TapeStep } from './drive-flow.js';
|
|
2
2
|
import { type OnboardingStep } from '@reticlehq/core/telemetry';
|
|
3
3
|
import type { AmbientCounts } from '@reticlehq/engine/window/ambient.js';
|
|
4
|
-
import { type JournalAction } from '@reticlehq/core';
|
|
4
|
+
import { type ProjectId, type JournalAction } from '@reticlehq/core';
|
|
5
5
|
import type { FileSystemPort } from '../project/fs/fs-port.js';
|
|
6
|
+
import { type PruneWorkspaceOptions } from './on-disk/startup-maintenance.js';
|
|
6
7
|
/**
|
|
7
8
|
* Session teardown: the durable half of ending a session. Two things must happen when a tab disconnects,
|
|
8
9
|
* and neither did before — the journal batches events and only writes at its flush threshold, so the tail
|
|
@@ -39,13 +40,15 @@ export interface SessionEndTarget {
|
|
|
39
40
|
readJournalActions?(): Promise<JournalAction[]>;
|
|
40
41
|
/** The project's own `.reticle`, so a run lands in the repo it is about. */
|
|
41
42
|
readonly artifactRoot?: string | undefined;
|
|
42
|
-
readonly projectId?:
|
|
43
|
+
readonly projectId?: ProjectId | undefined;
|
|
43
44
|
}
|
|
44
45
|
interface SessionEndDeps {
|
|
45
46
|
fs: FileSystemPort;
|
|
46
47
|
reticleRoot: string;
|
|
47
|
-
/** Journaling/persistence off (opt-out) → teardown is a no-op. */
|
|
48
|
+
/** Journaling/persistence off (opt-out) → teardown is a no-op. Retention still runs. */
|
|
48
49
|
enabled: boolean;
|
|
50
|
+
/** What this project is willing to keep — the `retain` block of its `.reticle.json`. */
|
|
51
|
+
retain?: PruneWorkspaceOptions;
|
|
49
52
|
/**
|
|
50
53
|
* The one clock in this file, injected — the run artifact stamps `createdAt` from it.
|
|
51
54
|
*
|
|
@@ -76,7 +79,7 @@ interface SessionEndDeps {
|
|
|
76
79
|
* this handler follows.
|
|
77
80
|
*/
|
|
78
81
|
flows?: {
|
|
79
|
-
save: (program: DriveProgram, annotations?: undefined, projectId?:
|
|
82
|
+
save: (program: DriveProgram, annotations?: undefined, projectId?: ProjectId) => Promise<unknown>;
|
|
80
83
|
};
|
|
81
84
|
/**
|
|
82
85
|
* Called when a run artifact is written, so cloud sync can cycle instead of waiting for its timer.
|
|
@@ -84,6 +87,16 @@ interface SessionEndDeps {
|
|
|
84
87
|
* Optional, like everything else here: absent simply means the next scheduled cycle picks it up.
|
|
85
88
|
*/
|
|
86
89
|
onRunPersisted?: () => void;
|
|
90
|
+
/**
|
|
91
|
+
* The ids of the sessions still OPEN, read at each teardown so retention never deletes a journal
|
|
92
|
+
* that is still being written. A getter rather than a snapshot: this handler is built once at
|
|
93
|
+
* wiring and fires for every session for the life of the daemon.
|
|
94
|
+
*
|
|
95
|
+
* Injected, like the clock and the reporter — teardown needs the answer, not the registry.
|
|
96
|
+
* Optional so every existing construction keeps compiling, and absent means "none known", which
|
|
97
|
+
* is exactly the old behaviour.
|
|
98
|
+
*/
|
|
99
|
+
liveSessionIds?: () => ReadonlySet<string>;
|
|
87
100
|
}
|
|
88
101
|
/**
|
|
89
102
|
* Build the teardown handler the bridge fires when a session is removed. Flushes the journal first (so no
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { driveFlowsFrom } from './drive-flow.js';
|
|
2
|
+
import { journalActionsPath, sessionDirPath } from '../project/dir/reticle-dir.js';
|
|
3
|
+
import { asSessionId } from '@reticlehq/core';
|
|
2
4
|
import { OnboardingPhase, OnboardingStepStatus, } from '@reticlehq/core/telemetry';
|
|
3
5
|
import { AmbientStore } from './ambient-store.js';
|
|
4
6
|
import { subjectOf } from '@reticlehq/core';
|
|
5
|
-
import {
|
|
7
|
+
import { pruneWorkspace } from './on-disk/startup-maintenance.js';
|
|
6
8
|
import { buildVerificationRun } from '../../judgement/runs/artifact/build-verification-run.js';
|
|
7
9
|
import { driveRunFrom, driveRunId } from '../../judgement/runs/drive-run.js';
|
|
8
10
|
import { RunStore } from '../../judgement/runs/artifact/run-store.js';
|
|
@@ -13,8 +15,28 @@ import { RunStore } from '../../judgement/runs/artifact/run-store.js';
|
|
|
13
15
|
*/
|
|
14
16
|
export function makeSessionEnd(deps) {
|
|
15
17
|
return async (session) => {
|
|
16
|
-
|
|
18
|
+
/*
|
|
19
|
+
* Retention is maintenance of a directory, not a part of journalling, so it runs either way.
|
|
20
|
+
*
|
|
21
|
+
* Teardown used to return here, and this is the one setting under which that mattered most:
|
|
22
|
+
* somebody switches journalling off BECAUSE `.reticle/` got too big, and switching it off was
|
|
23
|
+
* what stopped anything ever deleting what was already there. It also stopped the sweep of
|
|
24
|
+
* visual diffs, feedback copies and run artifacts, none of which need the journal to be written
|
|
25
|
+
* at all. The daemon's own start-path sweep was gated on the same flag, so there was no second
|
|
26
|
+
* site still running — both are ungated now.
|
|
27
|
+
*/
|
|
28
|
+
const sweep = async () => {
|
|
29
|
+
try {
|
|
30
|
+
await pruneWorkspace(deps.fs, session.artifactRoot ?? deps.reticleRoot, deps.liveSessionIds?.() ?? new Set(), deps.retain ?? {});
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// retention is best-effort maintenance; never surface at teardown
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
if (!deps.enabled) {
|
|
37
|
+
await sweep();
|
|
17
38
|
return;
|
|
39
|
+
}
|
|
18
40
|
try {
|
|
19
41
|
await session.flushJournal();
|
|
20
42
|
}
|
|
@@ -22,7 +44,10 @@ export function makeSessionEnd(deps) {
|
|
|
22
44
|
// a failed flush must not block ambient persistence, and must never throw at teardown
|
|
23
45
|
}
|
|
24
46
|
try {
|
|
25
|
-
|
|
47
|
+
// The session's own root, like the run artifact below: a churn map learned from one app is
|
|
48
|
+
// not about another, and writing it to the daemon's cwd both mixed two apps' maps together and
|
|
49
|
+
// left an `ambient.json` in a tree the user never instrumented.
|
|
50
|
+
const store = new AmbientStore(deps.fs, session.artifactRoot ?? deps.reticleRoot);
|
|
26
51
|
const persisted = await store.load();
|
|
27
52
|
// Accumulate history + what is NEW. `ownAmbientCounts` excludes the map this session was
|
|
28
53
|
// seeded from at startup; `ambientCounts` includes it, and adding that onto `persisted` wrote
|
|
@@ -81,13 +106,48 @@ export function makeSessionEnd(deps) {
|
|
|
81
106
|
// because it is precisely when a new directory has just been created, which makes this amortized
|
|
82
107
|
// rather than periodic (no timer to leak) and mirrors what RunStore already does.
|
|
83
108
|
//
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
|
|
109
|
+
// What makes this safe is the `live` set, NOT the order.
|
|
110
|
+
//
|
|
111
|
+
// This used to read "safe against deleting the session that just ended: pruning selects the
|
|
112
|
+
// OLDEST by mtime, and the directory written moments ago is the newest". That is true of the
|
|
113
|
+
// session that ENDED and says nothing about the ones still open — and it is not even true of
|
|
114
|
+
// the byte budget, which has no count floor and will evict the single oldest entry the moment
|
|
115
|
+
// the tier is over, however few there are.
|
|
116
|
+
//
|
|
117
|
+
// A session directory's mtime is stamped at creation and never moves again (appending to a
|
|
118
|
+
// file inside it advances the FILE's mtime), so the longest-running open session is the
|
|
119
|
+
// oldest-looking thing on disk and was the first candidate for both bounds. Passing the open
|
|
120
|
+
// ids is what actually holds. The ended session is already out of the registry by the time
|
|
121
|
+
// this runs — the bridge removes it before firing teardown — so it is eligible again, which
|
|
122
|
+
// is correct: it is finished, and its journal was flushed above.
|
|
123
|
+
// The root this session actually journalled into. Pruning the daemon's tree instead meant a
|
|
124
|
+
// per-project workspace was never swept at all, so the one place journals really accumulate
|
|
125
|
+
// was the one place retention never ran.
|
|
126
|
+
/*
|
|
127
|
+
* A session nobody ever drove keeps no journal.
|
|
128
|
+
*
|
|
129
|
+
* The observers run from the moment the SDK attaches, so an idle tab on a busy page
|
|
130
|
+
* accumulates megabytes without a single tool call. The cost is not the disk: those
|
|
131
|
+
* directories occupy retention SLOTS, so a journal that could answer a verdict question is
|
|
132
|
+
* evicted by one that was never asked one.
|
|
133
|
+
*
|
|
134
|
+
* Decided at the END and never by gating CAPTURE. Whether a tool call will happen is not
|
|
135
|
+
* knowable while the events that would answer it are being recorded, and gating capture on it
|
|
136
|
+
* would leave the first assertion of a session with nothing to read.
|
|
137
|
+
*/
|
|
138
|
+
await dropUndrivenJournal(deps.fs, session.artifactRoot ?? deps.reticleRoot, asSessionId(session.id));
|
|
87
139
|
}
|
|
88
140
|
catch {
|
|
89
|
-
//
|
|
141
|
+
// teardown must never throw: the tab is already gone
|
|
90
142
|
}
|
|
143
|
+
// EVERY tier, not just sessions. Visual diffs and feedback copies were pruned only at daemon
|
|
144
|
+
// start, against the DAEMON's root — which for a globally registered daemon is `$HOME` and not
|
|
145
|
+
// the project at all, so the two tiers that only ever grow in a project workspace were the two
|
|
146
|
+
// never swept there. Same defect as the one this line already fixed for sessions, one move
|
|
147
|
+
// behind. The byte budget rides along for the same reason: it was wired at daemon start too.
|
|
148
|
+
//
|
|
149
|
+
// Outside the try above, so a failure anywhere in teardown still leaves the directory swept.
|
|
150
|
+
await sweep();
|
|
91
151
|
};
|
|
92
152
|
}
|
|
93
153
|
/**
|
|
@@ -157,3 +217,21 @@ async function saveDrivenFlow(deps, session) {
|
|
|
157
217
|
...(outcome.unprovenSteps === undefined ? {} : { reason: 'no_declared_consequence' }),
|
|
158
218
|
});
|
|
159
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Remove this session's journal when it served no tool call.
|
|
222
|
+
*
|
|
223
|
+
* "Served no tool call" is read off the actions ledger, which is written one line per call: absent
|
|
224
|
+
* or empty means nothing was ever driven here. Best-effort like every other maintenance step —
|
|
225
|
+
* a session that cannot be tidied is not a session that failed.
|
|
226
|
+
*/
|
|
227
|
+
async function dropUndrivenJournal(fs, root, sessionId) {
|
|
228
|
+
try {
|
|
229
|
+
const actions = await fs.readFile(journalActionsPath(root, sessionId)).catch(() => '');
|
|
230
|
+
if (actions.trim().length > 0)
|
|
231
|
+
return;
|
|
232
|
+
await fs.rm(sessionDirPath(root, sessionId));
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
// tidying is never the reason a teardown fails
|
|
236
|
+
}
|
|
237
|
+
}
|
|
@@ -1,5 +1,61 @@
|
|
|
1
|
-
import { type JournalAction, type ReticleEvent } from '@reticlehq/core';
|
|
1
|
+
import { type JournalAction, type JournalWriteLoss, type ReticleEvent } from '@reticlehq/core';
|
|
2
2
|
import type { FileSystemPort } from '../project/fs/fs-port.js';
|
|
3
|
+
import type { JournalLedgerSize, JournalReadLoss } from './journal-recorder.js';
|
|
4
|
+
/**
|
|
5
|
+
* The two ceilings a durable read is held to.
|
|
6
|
+
*
|
|
7
|
+
* Neither is a tuning number. `events.jsonl` is append-only and nothing prunes a single session's
|
|
8
|
+
* file (`pruneSessions` caps how many session DIRECTORIES survive, never how large one grows), and
|
|
9
|
+
* the session id lives in the page's sessionStorage, so a reload reconnects under the same id and
|
|
10
|
+
* builds a fresh journal over the same file with its byte cursor back at zero. That first read
|
|
11
|
+
* asked for the whole accumulated file, and V8 cannot build a string longer than 0x1fffffe8
|
|
12
|
+
* characters: `Buffer.prototype.toString` throws rather than returning a shorter one. The throw came
|
|
13
|
+
* out of the daemon as a raw exception on `reticle_assert` and `reticle_act_and_wait` — the only
|
|
14
|
+
* tools that reach this fall-through, and the only two that produce a verdict at all.
|
|
15
|
+
*
|
|
16
|
+
* `MAX_READ_BYTES` bounds ONE read. That alone bounds nothing over the life of a session: reads are
|
|
17
|
+
* incremental, so a thousand reads each well under the ceiling still accumulate every record they
|
|
18
|
+
* parsed. `MAX_RETAINED_*` bound what the parse-cache keeps, which is the quantity that actually
|
|
19
|
+
* grows with session age.
|
|
20
|
+
*
|
|
21
|
+
* The numbers, and what they are measured against:
|
|
22
|
+
*
|
|
23
|
+
* - 32 MiB is four times the ring buffer's own byte budget (`RING_BUFFER_DEFAULTS.MAX_BYTES`), so
|
|
24
|
+
* the durable half still reaches meaningfully further back than the hot cache it backs, and
|
|
25
|
+
* roughly a sixteenth of the string ceiling above (0x1fffffe8 characters, about 512 MB of
|
|
26
|
+
* ASCII) — a margin, not an order of magnitude, and enough of one.
|
|
27
|
+
* - Retention is bounded in journal BYTES and in RECORDS, because neither alone bounds memory:
|
|
28
|
+
* bytes track the file, records track the parsed objects, and an object costs several times the
|
|
29
|
+
* JSONL it came from (see the parse-cache note below). 100k records is fifty times the ring
|
|
30
|
+
* buffer's event budget, so the fall-through is still the long-memory half by a wide margin.
|
|
31
|
+
*/
|
|
32
|
+
export declare const JOURNAL_READ_LIMITS: {
|
|
33
|
+
/** What ONE read materialises as a single string. */
|
|
34
|
+
readonly MAX_READ_BYTES: number;
|
|
35
|
+
/** What the parse-cache keeps, in the journal bytes those records were parsed from. */
|
|
36
|
+
readonly MAX_RETAINED_BYTES: number;
|
|
37
|
+
/** What the parse-cache keeps, in records. Whichever bound binds first wins. */
|
|
38
|
+
readonly MAX_RETAINED_EVENTS: 100000;
|
|
39
|
+
};
|
|
40
|
+
/** Ceiling overrides. Injected so a test can drive a cut without writing 32 MiB of fixture. */
|
|
41
|
+
export interface SessionJournalOptions {
|
|
42
|
+
maxReadBytes?: number;
|
|
43
|
+
maxRetainedBytes?: number;
|
|
44
|
+
maxRetainedEvents?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Default byte budget for one serialized writer's event ledger (#986).
|
|
48
|
+
*
|
|
49
|
+
* A ledger may exceed this by one bounded truncation marker. Existing oversized files are not
|
|
50
|
+
* deleted or rewritten; they stop accepting event batches. This is a per-event-file limit, not a
|
|
51
|
+
* workspace-wide quota, and does not bound action journals or concurrent independent writers.
|
|
52
|
+
*/
|
|
53
|
+
export declare const JOURNAL_EVENT_BYTES_CAP: number;
|
|
54
|
+
/** Construction-time knobs. The cap is injected so a test can prove the bound at a few kilobytes. */
|
|
55
|
+
export interface SessionJournalOptions {
|
|
56
|
+
/** Byte ceiling for this session's event ledger. Defaults to {@link JOURNAL_EVENT_BYTES_CAP}. */
|
|
57
|
+
eventBytesCap?: number;
|
|
58
|
+
}
|
|
3
59
|
/**
|
|
4
60
|
* The durable per-session journal: append-only JSONL for events and actions, the ledger the ring
|
|
5
61
|
* buffer becomes a hot cache over. Writes are batched (the caller flushes ring-buffer windows), so a
|
|
@@ -10,15 +66,76 @@ import type { FileSystemPort } from '../project/fs/fs-port.js';
|
|
|
10
66
|
* journal stores redacted payloads; the ledger is local-only. A server-side second-pass event redactor
|
|
11
67
|
* is defense-in-depth for a later commit, not a correctness gate here.
|
|
12
68
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
69
|
+
* Event READS are BOUNDED at both ends — one read, and what the parse-cache keeps across reads.
|
|
70
|
+
* Both keep the NEWEST records and declare what they removed through `readLoss()`. Without the read
|
|
71
|
+
* ceiling a long session's file outgrew what a JavaScript string can hold and the read threw
|
|
72
|
+
* instead of answering; without the retention ceiling the cache grew for the life of the session.
|
|
73
|
+
* See `JOURNAL_READ_LIMITS` and `session-journal.lossy-conformance.test.ts`.
|
|
74
|
+
*
|
|
75
|
+
* The event ledger is also bounded on the WRITE side — see {@link JOURNAL_EVENT_BYTES_CAP} and
|
|
76
|
+
* `#closeAtCap`. Session directories are pruned by recency in `on-disk/retention.ts`; this is the
|
|
77
|
+
* per-file half of the same question, and the half a single runaway session needs. The two ceilings
|
|
78
|
+
* answer different questions and neither substitutes for the other: one stops a read from throwing,
|
|
79
|
+
* the other stops the file from growing without end.
|
|
80
|
+
*
|
|
81
|
+
* `readActions` is NOT bounded: it reads the whole action ledger as one string and would throw the
|
|
82
|
+
* same V8 string-length error on a large enough one. Left that way deliberately, and the reason is
|
|
83
|
+
* the loss channel rather than the read — the action ledger is one record per tool call, so it is
|
|
84
|
+
* orders of magnitude smaller than the event stream, and it is read by the run fold rather than by
|
|
85
|
+
* a verdict. Bounding it needs a loss report of its own: folding an action-ledger cut into
|
|
86
|
+
* `readLoss` would impeach page verdicts (through `Session.lostSince`) over a ledger that is not
|
|
87
|
+
* page evidence. Do that when an action ledger is measured large, not before.
|
|
88
|
+
*
|
|
89
|
+
* ponytail: append-per-batch. Perf ceiling: if main-thread overhead becomes visible at high event
|
|
90
|
+
* rates, coalesce batches behind a flush timer.
|
|
16
91
|
*/
|
|
17
92
|
export declare class SessionJournal {
|
|
18
93
|
#private;
|
|
19
|
-
constructor(fs: FileSystemPort, root: string, sessionId: string);
|
|
94
|
+
constructor(fs: FileSystemPort, root: string, sessionId: string, options?: SessionJournalOptions);
|
|
95
|
+
/**
|
|
96
|
+
* Append a batch, or refuse it at the byte cap and say so.
|
|
97
|
+
*
|
|
98
|
+
* A batch is accepted whole or not at all. This preserves the batch's ordering and avoids
|
|
99
|
+
* representing only part of a refused batch as successfully persisted evidence.
|
|
100
|
+
*
|
|
101
|
+
* REFUSAL, not rotation. Rotation keeps the newest evidence, which is the better policy in the
|
|
102
|
+
* abstract, but it shrinks the file — and `readEvents` tracks a byte offset into it, so a rotation
|
|
103
|
+
* resets that cursor and the reader silently returns FEWER events than it did a call earlier, with
|
|
104
|
+
* nothing to say why. Refusal keeps the file monotonic, so every cursor stays valid, no evidence
|
|
105
|
+
* already on disk is deleted, and the loss is at the end where it can be declared.
|
|
106
|
+
*/
|
|
20
107
|
appendEvents(events: readonly ReticleEvent[]): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* What this session's durable ledger lost on the WRITE side, or `undefined` if it lost nothing.
|
|
110
|
+
*
|
|
111
|
+
* The half the in-band marker cannot cover. That record carries the `t` of the last refused event
|
|
112
|
+
* and every journal-backed query filters on `t`, so a window opened after the ceiling was reached
|
|
113
|
+
* holds no marker and no events — which is indistinguishable from a complete window in which
|
|
114
|
+
* nothing happened. Named `readWriteLoss` because it is the WRITER's loss: what never reached the
|
|
115
|
+
* file, as opposed to what a bounded read declined to hand back.
|
|
116
|
+
*/
|
|
117
|
+
readWriteLoss(): Promise<JournalWriteLoss | undefined>;
|
|
118
|
+
/**
|
|
119
|
+
* The ledger's size against its ceiling, once the size is known.
|
|
120
|
+
*
|
|
121
|
+
* `undefined` before the first append, because `#eventBytes` is seeded from `stat` at that point
|
|
122
|
+
* and a zero reported before it is measured would be a claim rather than a reading.
|
|
123
|
+
*/
|
|
124
|
+
ledger(): JournalLedgerSize | undefined;
|
|
21
125
|
appendAction(action: JournalAction): Promise<void>;
|
|
22
126
|
readEvents(): Promise<ReticleEvent[]>;
|
|
127
|
+
/**
|
|
128
|
+
* What these reads could not produce, or `undefined` when nothing was lost.
|
|
129
|
+
*
|
|
130
|
+
* A report beside the value, not inside it: the events keep the exact shape their consumers parse,
|
|
131
|
+
* and a caller holding a short list can still tell it apart from a complete one. `Session.lostSince`
|
|
132
|
+
* is what carries this to a verdict.
|
|
133
|
+
*/
|
|
134
|
+
readLoss(): JournalReadLoss | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* The action ledger, whole — the one read here that is still UNBOUNDED, on purpose. See the class
|
|
137
|
+
* note: it holds one record per tool call rather than one per observed event, and bounding it
|
|
138
|
+
* needs a loss channel that does not impeach page verdicts.
|
|
139
|
+
*/
|
|
23
140
|
readActions(): Promise<JournalAction[]>;
|
|
24
141
|
}
|