@haaaiawd/second-nature 0.1.50 → 0.2.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 +22 -320
- package/{docs/claw-second-nature-inner-guide.md → agent-inner-guide.md} +43 -0
- package/openclaw.plugin.json +29 -0
- package/package.json +55 -84
- package/{dist/src → runtime}/cli/commands/index.js +1 -0
- package/{dist/src → runtime}/cli/ops/ops-router.js +73 -0
- package/runtime/connectors/evidence-normalizer.d.ts +45 -0
- package/runtime/connectors/evidence-normalizer.js +115 -0
- package/runtime/core/second-nature/action/action-closure-recorder.d.ts +70 -0
- package/runtime/core/second-nature/action/action-closure-recorder.js +184 -0
- package/runtime/core/second-nature/action/action-proposal-builder.d.ts +70 -0
- package/runtime/core/second-nature/action/action-proposal-builder.js +217 -0
- package/runtime/core/second-nature/action/autonomy-policy-evaluator.d.ts +43 -0
- package/runtime/core/second-nature/action/autonomy-policy-evaluator.js +213 -0
- package/runtime/core/second-nature/action/policy-bound-dispatch.d.ts +69 -0
- package/runtime/core/second-nature/action/policy-bound-dispatch.js +112 -0
- package/runtime/core/second-nature/body/tool-affordance/affordance-side-effect.d.ts +49 -0
- package/runtime/core/second-nature/body/tool-affordance/affordance-side-effect.js +100 -0
- package/runtime/core/second-nature/control-plane/accepted-projection-loader.d.ts +45 -0
- package/runtime/core/second-nature/control-plane/accepted-projection-loader.js +85 -0
- package/runtime/core/second-nature/control-plane/heartbeat-orchestrator.d.ts +38 -0
- package/runtime/core/second-nature/control-plane/heartbeat-orchestrator.js +165 -0
- package/runtime/core/second-nature/guidance/guidance-proposal-consumer.d.ts +51 -0
- package/runtime/core/second-nature/guidance/guidance-proposal-consumer.js +113 -0
- package/runtime/core/second-nature/perception/judgment-engine.d.ts +53 -0
- package/runtime/core/second-nature/perception/judgment-engine.js +239 -0
- package/runtime/core/second-nature/perception/perception-builder.d.ts +62 -0
- package/runtime/core/second-nature/perception/perception-builder.js +208 -0
- package/runtime/core/second-nature/perception/sensitivity-classifier.d.ts +37 -0
- package/runtime/core/second-nature/perception/sensitivity-classifier.js +87 -0
- package/runtime/core/second-nature/quiet-dream/dream-consolidation-runner.d.ts +44 -0
- package/runtime/core/second-nature/quiet-dream/dream-consolidation-runner.js +180 -0
- package/runtime/core/second-nature/quiet-dream/dream-scheduler.d.ts +36 -0
- package/runtime/core/second-nature/quiet-dream/dream-scheduler.js +105 -0
- package/runtime/core/second-nature/quiet-dream/memory-projection-lifecycle.d.ts +36 -0
- package/runtime/core/second-nature/quiet-dream/memory-projection-lifecycle.js +151 -0
- package/runtime/core/second-nature/quiet-dream/quiet-daily-review-builder.d.ts +46 -0
- package/runtime/core/second-nature/quiet-dream/quiet-daily-review-builder.js +123 -0
- package/runtime/observability/causal-loop-health.d.ts +44 -0
- package/runtime/observability/causal-loop-health.js +118 -0
- package/runtime/observability/diagnostic-redaction.d.ts +43 -0
- package/runtime/observability/diagnostic-redaction.js +114 -0
- package/runtime/observability/loop-stage-event-sink.d.ts +43 -0
- package/runtime/observability/loop-stage-event-sink.js +148 -0
- package/runtime/observability/loop-status.d.ts +46 -0
- package/runtime/observability/loop-status.js +85 -0
- package/{dist/src → runtime}/shared/types/index.js +3 -0
- package/runtime/shared/types/v8-contracts.d.ts +86 -0
- package/runtime/shared/types/v8-contracts.js +84 -0
- package/{dist/src → runtime}/storage/db/schema/index.d.ts +1 -0
- package/{dist/src → runtime}/storage/db/schema/index.js +1 -0
- package/runtime/storage/db/schema/v8-entities.d.ts +1973 -0
- package/runtime/storage/db/schema/v8-entities.js +160 -0
- package/runtime/storage/v8-state-stores.d.ts +147 -0
- package/runtime/storage/v8-state-stores.js +491 -0
- package/HEARTBEAT.md +0 -44
- package/LICENSE +0 -176
- package/README.md +0 -136
- package/README.zh-CN.md +0 -120
- package/dist/data/observability.db +0 -0
- package/dist/data/state.db +0 -0
- package/dist/plugin/index.d.ts +0 -31
- package/dist/plugin/workspace-ops-bridge.d.ts +0 -15
- package/dist/scripts/build-plugin-package.d.ts +0 -12
- package/dist/scripts/build-plugin-package.js +0 -220
- package/dist/scripts/build-plugin-runtime.d.ts +0 -10
- package/dist/scripts/build-plugin-runtime.js +0 -198
- package/dist/scripts/packaging-feasibility-poc.d.ts +0 -1
- package/dist/scripts/packaging-feasibility-poc.js +0 -127
- package/dist/scripts/plugin-smoke-check.d.ts +0 -1
- package/dist/scripts/plugin-smoke-check.js +0 -124
- package/dist/src/cli/action-bridge.d.ts +0 -11
- package/dist/src/cli/index.d.ts +0 -65
- package/dist/tests/integration/cli/cli-ops-surface.test.d.ts +0 -1
- package/dist/tests/integration/cli/cli-ops-surface.test.js +0 -380
- package/dist/tests/integration/cli/heartbeat-surface-workspace.test.d.ts +0 -1
- package/dist/tests/integration/cli/heartbeat-surface-workspace.test.js +0 -61
- package/dist/tests/integration/cli/host-capability-probe.test.d.ts +0 -1
- package/dist/tests/integration/cli/host-capability-probe.test.js +0 -37
- package/dist/tests/integration/cli/host-smoke-heartbeat-tool.test.d.ts +0 -1
- package/dist/tests/integration/cli/host-smoke-heartbeat-tool.test.js +0 -34
- package/dist/tests/integration/cli/plugin-packaging-walkthrough.test.d.ts +0 -1
- package/dist/tests/integration/cli/plugin-packaging-walkthrough.test.js +0 -79
- package/dist/tests/integration/cli/plugin-runtime-registration.test.d.ts +0 -1
- package/dist/tests/integration/cli/plugin-runtime-registration.test.js +0 -285
- package/dist/tests/integration/cli/plugin-workspace-ops-bridge.test.d.ts +0 -1
- package/dist/tests/integration/cli/plugin-workspace-ops-bridge.test.js +0 -487
- package/dist/tests/integration/cli/t1-2-1-explain-read-models.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-1-explain-read-models.test.js +0 -58
- package/dist/tests/integration/cli/t1-2-1-narrative-command.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-1-narrative-command.test.js +0 -194
- package/dist/tests/integration/cli/t1-2-2-dream-recent.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-2-dream-recent.test.js +0 -100
- package/dist/tests/integration/cli/t1-2-3-status-observability-writeback.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-3-status-observability-writeback.test.js +0 -71
- package/dist/tests/integration/cli/t1-2-4-quiet-report-read-canonical.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-4-quiet-report-read-canonical.test.js +0 -206
- package/dist/tests/integration/cli/t1-2-5-cycle-recent.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-5-cycle-recent.test.js +0 -156
- package/dist/tests/integration/cli/t1-2-5-status-delivery-posture-audit-store.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-5-status-delivery-posture-audit-store.test.js +0 -95
- package/dist/tests/integration/cli/t1-2-6-policy-show-non-shell.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-6-policy-show-non-shell.test.js +0 -74
- package/dist/tests/integration/cli/t1-2-6-status-aggregate.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-6-status-aggregate.test.js +0 -223
- package/dist/tests/integration/cli/t1-2-7-audit-command-minimal-closure.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-7-audit-command-minimal-closure.test.js +0 -101
- package/dist/tests/integration/cli/t1-2-8-capability-probe-ops-surface.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-8-capability-probe-ops-surface.test.js +0 -74
- package/dist/tests/integration/cli/t1-2-9-decision-denied-not-degraded.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-9-decision-denied-not-degraded.test.js +0 -79
- package/dist/tests/integration/cli/t1-4-1-runtime-secret-bootstrap.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-4-1-runtime-secret-bootstrap.test.js +0 -139
- package/dist/tests/integration/cli/t1-4-2-activation-ux-contract.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-4-2-activation-ux-contract.test.js +0 -143
- package/dist/tests/integration/cli/t2-2-2-snapshot-life-evidence.test.d.ts +0 -1
- package/dist/tests/integration/cli/t2-2-2-snapshot-life-evidence.test.js +0 -116
- package/dist/tests/integration/cli/t3-3-2-near-real-smoke-cli-bridge.test.d.ts +0 -1
- package/dist/tests/integration/cli/t3-3-2-near-real-smoke-cli-bridge.test.js +0 -69
- package/dist/tests/integration/connectors/connector-base.test.d.ts +0 -1
- package/dist/tests/integration/connectors/connector-base.test.js +0 -211
- package/dist/tests/integration/connectors/connector-executor-adapter-honest-failure.test.d.ts +0 -1
- package/dist/tests/integration/connectors/connector-executor-adapter-honest-failure.test.js +0 -311
- package/dist/tests/integration/connectors/credential-optional-regression.test.d.ts +0 -1
- package/dist/tests/integration/connectors/credential-optional-regression.test.js +0 -117
- package/dist/tests/integration/connectors/declarative-http-runner.test.d.ts +0 -7
- package/dist/tests/integration/connectors/declarative-http-runner.test.js +0 -229
- package/dist/tests/integration/connectors/evomap-secret-port.test.d.ts +0 -1
- package/dist/tests/integration/connectors/evomap-secret-port.test.js +0 -83
- package/dist/tests/integration/connectors/life-evidence-chain.test.d.ts +0 -1
- package/dist/tests/integration/connectors/life-evidence-chain.test.js +0 -188
- package/dist/tests/integration/connectors/moltbook-client.test.d.ts +0 -1
- package/dist/tests/integration/connectors/moltbook-client.test.js +0 -274
- package/dist/tests/integration/connectors/moltbook-mock-runner.test.d.ts +0 -7
- package/dist/tests/integration/connectors/moltbook-mock-runner.test.js +0 -108
- package/dist/tests/integration/connectors/near-real-connector-smoke.test.d.ts +0 -1
- package/dist/tests/integration/connectors/near-real-connector-smoke.test.js +0 -38
- package/dist/tests/integration/connectors/platform-adapters.test.d.ts +0 -1
- package/dist/tests/integration/connectors/platform-adapters.test.js +0 -189
- package/dist/tests/integration/connectors/policy-layer.test.d.ts +0 -1
- package/dist/tests/integration/connectors/policy-layer.test.js +0 -249
- package/dist/tests/integration/connectors/scriptable-node-e2e.test.d.ts +0 -1
- package/dist/tests/integration/connectors/scriptable-node-e2e.test.js +0 -228
- package/dist/tests/integration/connectors/t3-3-1-real-connector-evidence.test.d.ts +0 -1
- package/dist/tests/integration/connectors/t3-3-1-real-connector-evidence.test.js +0 -171
- package/dist/tests/integration/control-plane/_helpers/decision-cycle-harness.d.ts +0 -40
- package/dist/tests/integration/control-plane/_helpers/decision-cycle-harness.js +0 -116
- package/dist/tests/integration/control-plane/decision-loop-validation.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/decision-loop-validation.test.js +0 -319
- package/dist/tests/integration/control-plane/delivery-failed-fallback.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/delivery-failed-fallback.test.js +0 -118
- package/dist/tests/integration/control-plane/dream-projection-heartbeat.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/dream-projection-heartbeat.test.js +0 -109
- package/dist/tests/integration/control-plane/effect-dispatcher.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/effect-dispatcher.test.js +0 -157
- package/dist/tests/integration/control-plane/guidance-request.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/guidance-request.test.js +0 -63
- package/dist/tests/integration/control-plane/heartbeat-executor.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/heartbeat-executor.test.js +0 -363
- package/dist/tests/integration/control-plane/heartbeat-loop.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/heartbeat-loop.test.js +0 -190
- package/dist/tests/integration/control-plane/heartbeat-quiet-orchestration.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/heartbeat-quiet-orchestration.test.js +0 -133
- package/dist/tests/integration/control-plane/heartbeat-spine-integration.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/heartbeat-spine-integration.test.js +0 -342
- package/dist/tests/integration/control-plane/heartbeat-spine.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/heartbeat-spine.test.js +0 -216
- package/dist/tests/integration/control-plane/int-s3-outreach-delivery-quiet-closure.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/int-s3-outreach-delivery-quiet-closure.test.js +0 -241
- package/dist/tests/integration/control-plane/outreach-resume.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/outreach-resume.test.js +0 -158
- package/dist/tests/integration/control-plane/outreach-style.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/outreach-style.test.js +0 -46
- package/dist/tests/integration/control-plane/quiet-reflection.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/quiet-reflection.test.js +0 -73
- package/dist/tests/integration/control-plane/rhythm-intent-guard.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/rhythm-intent-guard.test.js +0 -99
- package/dist/tests/integration/control-plane/run-heartbeat-cycle.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/run-heartbeat-cycle.test.js +0 -80
- package/dist/tests/integration/control-plane/t2-3-1-outreach-v6.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/t2-3-1-outreach-v6.test.js +0 -208
- package/dist/tests/integration/control-plane/t2-4-1-heartbeat-platform-intent.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/t2-4-1-heartbeat-platform-intent.test.js +0 -156
- package/dist/tests/integration/control-plane/t2-4-2-source-backed-outreach-loop.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/t2-4-2-source-backed-outreach-loop.test.js +0 -188
- package/dist/tests/integration/control-plane/v7c-evidence-body-feedback.test.d.ts +0 -11
- package/dist/tests/integration/control-plane/v7c-evidence-body-feedback.test.js +0 -213
- package/dist/tests/integration/control-plane/v7c-heartbeat-unlock-e2e.test.d.ts +0 -9
- package/dist/tests/integration/control-plane/v7c-heartbeat-unlock-e2e.test.js +0 -134
- package/dist/tests/integration/dream/quiet-dream-trigger.test.d.ts +0 -1
- package/dist/tests/integration/dream/quiet-dream-trigger.test.js +0 -86
- package/dist/tests/integration/dream/t7-1-1-dream-pipeline.test.d.ts +0 -1
- package/dist/tests/integration/dream/t7-1-1-dream-pipeline.test.js +0 -378
- package/dist/tests/integration/dream/t7-1-2-dream-scheduler.test.d.ts +0 -1
- package/dist/tests/integration/dream/t7-1-2-dream-scheduler.test.js +0 -124
- package/dist/tests/integration/dream/v7c-rhythm-loop.test.d.ts +0 -10
- package/dist/tests/integration/dream/v7c-rhythm-loop.test.js +0 -185
- package/dist/tests/integration/guidance/assembler-and-fallback.test.d.ts +0 -1
- package/dist/tests/integration/guidance/assembler-and-fallback.test.js +0 -86
- package/dist/tests/integration/guidance/outreach-draft-contract.test.d.ts +0 -1
- package/dist/tests/integration/guidance/outreach-draft-contract.test.js +0 -106
- package/dist/tests/integration/guidance/persona-selection.test.d.ts +0 -1
- package/dist/tests/integration/guidance/persona-selection.test.js +0 -70
- package/dist/tests/integration/guidance/template-review.test.d.ts +0 -1
- package/dist/tests/integration/guidance/template-review.test.js +0 -26
- package/dist/tests/integration/guidance/user-reply-continuity.test.d.ts +0 -1
- package/dist/tests/integration/guidance/user-reply-continuity.test.js +0 -96
- package/dist/tests/integration/guidance/v7c-guidance-chain.test.d.ts +0 -1
- package/dist/tests/integration/guidance/v7c-guidance-chain.test.js +0 -190
- package/dist/tests/integration/guidance/v7c-guidance-semantics.test.d.ts +0 -1
- package/dist/tests/integration/guidance/v7c-guidance-semantics.test.js +0 -146
- package/dist/tests/integration/observability/digest-delivery.test.d.ts +0 -14
- package/dist/tests/integration/observability/digest-delivery.test.js +0 -160
- package/dist/tests/integration/observability/evidence-query-engine.test.d.ts +0 -1
- package/dist/tests/integration/observability/evidence-query-engine.test.js +0 -219
- package/dist/tests/integration/observability/explain-query-export.test.d.ts +0 -1
- package/dist/tests/integration/observability/explain-query-export.test.js +0 -92
- package/dist/tests/integration/observability/guidance-audit.test.d.ts +0 -1
- package/dist/tests/integration/observability/guidance-audit.test.js +0 -55
- package/dist/tests/integration/observability/heartbeat-decision-record.test.d.ts +0 -1
- package/dist/tests/integration/observability/heartbeat-decision-record.test.js +0 -223
- package/dist/tests/integration/observability/heartbeat-narrative-trace.test.d.ts +0 -1
- package/dist/tests/integration/observability/heartbeat-narrative-trace.test.js +0 -230
- package/dist/tests/integration/observability/lived-experience-audit-chain.test.d.ts +0 -1
- package/dist/tests/integration/observability/lived-experience-audit-chain.test.js +0 -43
- package/dist/tests/integration/observability/observability-gates.test.d.ts +0 -1
- package/dist/tests/integration/observability/observability-gates.test.js +0 -224
- package/dist/tests/integration/observability/observability-retention-cleanup.test.d.ts +0 -1
- package/dist/tests/integration/observability/observability-retention-cleanup.test.js +0 -94
- package/dist/tests/integration/observability/observability-services.test.d.ts +0 -1
- package/dist/tests/integration/observability/observability-services.test.js +0 -219
- package/dist/tests/integration/observability/projections.test.d.ts +0 -1
- package/dist/tests/integration/observability/projections.test.js +0 -36
- package/dist/tests/integration/observability/t5-1-1-dream-trace-audit.test.d.ts +0 -1
- package/dist/tests/integration/observability/t5-1-1-dream-trace-audit.test.js +0 -115
- package/dist/tests/integration/plugin/plugin-registration.test.d.ts +0 -16
- package/dist/tests/integration/plugin/plugin-registration.test.js +0 -151
- package/dist/tests/integration/runtime-ops/commands.test.d.ts +0 -16
- package/dist/tests/integration/runtime-ops/commands.test.js +0 -662
- package/dist/tests/integration/s3-exit/int-s3-body-heartbeat.test.d.ts +0 -15
- package/dist/tests/integration/s3-exit/int-s3-body-heartbeat.test.js +0 -462
- package/dist/tests/integration/s5-exit/int-s5-observability.test.d.ts +0 -17
- package/dist/tests/integration/s5-exit/int-s5-observability.test.js +0 -402
- package/dist/tests/integration/state/t4-2-1-owner-reply-relationship-loop.test.d.ts +0 -1
- package/dist/tests/integration/state/t4-2-1-owner-reply-relationship-loop.test.js +0 -132
- package/dist/tests/integration/state/v7c-identity-goal-hygiene.test.d.ts +0 -9
- package/dist/tests/integration/state/v7c-identity-goal-hygiene.test.js +0 -240
- package/dist/tests/integration/storage/packaged-runtime-smoke.test.d.ts +0 -1
- package/dist/tests/integration/storage/packaged-runtime-smoke.test.js +0 -17
- package/dist/tests/integration/storage/persona-candidate-loader.test.d.ts +0 -1
- package/dist/tests/integration/storage/persona-candidate-loader.test.js +0 -23
- package/dist/tests/integration/storage/quiet-artifact-writer.test.d.ts +0 -1
- package/dist/tests/integration/storage/quiet-artifact-writer.test.js +0 -66
- package/dist/tests/integration/storage/repair-and-backup.test.d.ts +0 -1
- package/dist/tests/integration/storage/repair-and-backup.test.js +0 -125
- package/dist/tests/integration/storage/schema-migration.test.d.ts +0 -11
- package/dist/tests/integration/storage/schema-migration.test.js +0 -183
- package/dist/tests/integration/storage/storage-mode-smoke.test.d.ts +0 -1
- package/dist/tests/integration/storage/storage-mode-smoke.test.js +0 -18
- package/dist/tests/integration/storage/t4-1-5-memory-store-lifecycle.test.d.ts +0 -1
- package/dist/tests/integration/storage/t4-1-5-memory-store-lifecycle.test.js +0 -118
- package/dist/tests/unit/body/affordance-assembler.test.d.ts +0 -14
- package/dist/tests/unit/body/affordance-assembler.test.js +0 -259
- package/dist/tests/unit/body/affordance-context-scope.test.d.ts +0 -12
- package/dist/tests/unit/body/affordance-context-scope.test.js +0 -73
- package/dist/tests/unit/body/behavior-promotion-loop.test.d.ts +0 -15
- package/dist/tests/unit/body/behavior-promotion-loop.test.js +0 -130
- package/dist/tests/unit/body/circuit-breaker-manager.test.d.ts +0 -13
- package/dist/tests/unit/body/circuit-breaker-manager.test.js +0 -160
- package/dist/tests/unit/body/experience-writer.test.d.ts +0 -11
- package/dist/tests/unit/body/experience-writer.test.js +0 -77
- package/dist/tests/unit/body/pain-signal-query.test.d.ts +0 -11
- package/dist/tests/unit/body/pain-signal-query.test.js +0 -104
- package/dist/tests/unit/cli/connector-init-manifest.test.d.ts +0 -9
- package/dist/tests/unit/cli/connector-init-manifest.test.js +0 -68
- package/dist/tests/unit/cli/delivery-target-probe.test.d.ts +0 -1
- package/dist/tests/unit/cli/delivery-target-probe.test.js +0 -108
- package/dist/tests/unit/cli/host-capability.test.d.ts +0 -1
- package/dist/tests/unit/cli/host-capability.test.js +0 -50
- package/dist/tests/unit/cli/operator-fallback-view.test.d.ts +0 -1
- package/dist/tests/unit/cli/operator-fallback-view.test.js +0 -60
- package/dist/tests/unit/cli/runtime-artifact-boundary.test.d.ts +0 -1
- package/dist/tests/unit/cli/runtime-artifact-boundary.test.js +0 -57
- package/dist/tests/unit/cli/t1-2-3-connector-status.test.d.ts +0 -1
- package/dist/tests/unit/cli/t1-2-3-connector-status.test.js +0 -214
- package/dist/tests/unit/cli/t1-2-4-goal-command.test.d.ts +0 -1
- package/dist/tests/unit/cli/t1-2-4-goal-command.test.js +0 -207
- package/dist/tests/unit/cli/t1-3-1-connector-init.test.d.ts +0 -1
- package/dist/tests/unit/cli/t1-3-1-connector-init.test.js +0 -212
- package/dist/tests/unit/connectors/connector-manifest-and-evidence-map.test.d.ts +0 -1
- package/dist/tests/unit/connectors/connector-manifest-and-evidence-map.test.js +0 -71
- package/dist/tests/unit/connectors/effect-commit-ledger-sqlite.test.d.ts +0 -10
- package/dist/tests/unit/connectors/effect-commit-ledger-sqlite.test.js +0 -101
- package/dist/tests/unit/connectors/evomap-runner.test.d.ts +0 -1
- package/dist/tests/unit/connectors/evomap-runner.test.js +0 -136
- package/dist/tests/unit/connectors/execution-policy.test.d.ts +0 -1
- package/dist/tests/unit/connectors/execution-policy.test.js +0 -71
- package/dist/tests/unit/connectors/instreet-registration.test.d.ts +0 -1
- package/dist/tests/unit/connectors/instreet-registration.test.js +0 -102
- package/dist/tests/unit/connectors/manifest-v7-schema.test.d.ts +0 -9
- package/dist/tests/unit/connectors/manifest-v7-schema.test.js +0 -165
- package/dist/tests/unit/connectors/scriptable-node-runner.test.d.ts +0 -1
- package/dist/tests/unit/connectors/scriptable-node-runner.test.js +0 -246
- package/dist/tests/unit/connectors/structured-unavailable-reason.test.d.ts +0 -11
- package/dist/tests/unit/connectors/structured-unavailable-reason.test.js +0 -76
- package/dist/tests/unit/connectors/t3-1-1-dynamic-registry.test.d.ts +0 -1
- package/dist/tests/unit/connectors/t3-1-1-dynamic-registry.test.js +0 -178
- package/dist/tests/unit/connectors/t3-1-2-capability-registry.test.d.ts +0 -1
- package/dist/tests/unit/connectors/t3-1-2-capability-registry.test.js +0 -105
- package/dist/tests/unit/connectors/t3-2-1-v5-parity.test.d.ts +0 -1
- package/dist/tests/unit/connectors/t3-2-1-v5-parity.test.js +0 -103
- package/dist/tests/unit/connectors/t3-3-1-evidence-mapper.test.d.ts +0 -1
- package/dist/tests/unit/connectors/t3-3-1-evidence-mapper.test.js +0 -198
- package/dist/tests/unit/connectors/t3-3-1-evidence-redaction.test.d.ts +0 -1
- package/dist/tests/unit/connectors/t3-3-1-evidence-redaction.test.js +0 -95
- package/dist/tests/unit/connectors/wet-probe-runner.test.d.ts +0 -11
- package/dist/tests/unit/connectors/wet-probe-runner.test.js +0 -84
- package/dist/tests/unit/control-plane/decision-trace-emitter.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/decision-trace-emitter.test.js +0 -51
- package/dist/tests/unit/control-plane/downstream-intent-orchestrator.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/downstream-intent-orchestrator.test.js +0 -57
- package/dist/tests/unit/control-plane/embodied-context-assembler.test.d.ts +0 -13
- package/dist/tests/unit/control-plane/embodied-context-assembler.test.js +0 -182
- package/dist/tests/unit/control-plane/goal-lifecycle-policy.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/goal-lifecycle-policy.test.js +0 -75
- package/dist/tests/unit/control-plane/hard-guard-evaluator.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/hard-guard-evaluator.test.js +0 -113
- package/dist/tests/unit/control-plane/idle-curiosity-policy.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/idle-curiosity-policy.test.js +0 -69
- package/dist/tests/unit/control-plane/intent-planner-source-ref-fallback.test.d.ts +0 -7
- package/dist/tests/unit/control-plane/intent-planner-source-ref-fallback.test.js +0 -124
- package/dist/tests/unit/control-plane/rhythm-policy-snapshot-window.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/rhythm-policy-snapshot-window.test.js +0 -64
- package/dist/tests/unit/control-plane/run-heartbeat-cycle-v7.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/run-heartbeat-cycle-v7.test.js +0 -165
- package/dist/tests/unit/control-plane/t2-1-4-goal-priority.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/t2-1-4-goal-priority.test.js +0 -185
- package/dist/tests/unit/control-plane/t2-1-5-narrative-update.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/t2-1-5-narrative-update.test.js +0 -313
- package/dist/tests/unit/control-plane/t2-4-1-credential-route.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/t2-4-1-credential-route.test.js +0 -75
- package/dist/tests/unit/control-plane/t2-4-1-platform-intent.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/t2-4-1-platform-intent.test.js +0 -168
- package/dist/tests/unit/core/outreach-judgment.test.d.ts +0 -1
- package/dist/tests/unit/core/outreach-judgment.test.js +0 -109
- package/dist/tests/unit/core/resolve-allowed-intent.test.d.ts +0 -1
- package/dist/tests/unit/core/resolve-allowed-intent.test.js +0 -69
- package/dist/tests/unit/core/t2-2-3-connector-action-honest-result.test.d.ts +0 -1
- package/dist/tests/unit/core/t2-2-3-connector-action-honest-result.test.js +0 -130
- package/dist/tests/unit/core/t2-2-3-connector-dispatch-wired.test.d.ts +0 -1
- package/dist/tests/unit/core/t2-2-3-connector-dispatch-wired.test.js +0 -99
- package/dist/tests/unit/dream/dream-input-loader.test.d.ts +0 -15
- package/dist/tests/unit/dream/dream-input-loader.test.js +0 -424
- package/dist/tests/unit/dream/dream-scheduler.test.d.ts +0 -1
- package/dist/tests/unit/dream/dream-scheduler.test.js +0 -57
- package/dist/tests/unit/dream/t-dqs-c3-redacted-evidence.test.d.ts +0 -11
- package/dist/tests/unit/dream/t-dqs-c3-redacted-evidence.test.js +0 -298
- package/dist/tests/unit/dream/t7-1-3-insight-extraction.test.d.ts +0 -1
- package/dist/tests/unit/dream/t7-1-3-insight-extraction.test.js +0 -79
- package/dist/tests/unit/dream/t7-1-4-narrative-update.test.d.ts +0 -1
- package/dist/tests/unit/dream/t7-1-4-narrative-update.test.js +0 -93
- package/dist/tests/unit/dream/t7-1-5-relationship-update.test.d.ts +0 -1
- package/dist/tests/unit/dream/t7-1-5-relationship-update.test.js +0 -116
- package/dist/tests/unit/feedback/t4-2-1-owner-reply-inference.test.d.ts +0 -1
- package/dist/tests/unit/feedback/t4-2-1-owner-reply-inference.test.js +0 -58
- package/dist/tests/unit/guidance/capability-class.test.d.ts +0 -1
- package/dist/tests/unit/guidance/capability-class.test.js +0 -96
- package/dist/tests/unit/guidance/channel-feedback-ingestion.test.d.ts +0 -1
- package/dist/tests/unit/guidance/channel-feedback-ingestion.test.js +0 -163
- package/dist/tests/unit/guidance/evidence-guidance.test.d.ts +0 -1
- package/dist/tests/unit/guidance/evidence-guidance.test.js +0 -40
- package/dist/tests/unit/guidance/guidance-draft-service.test.d.ts +0 -1
- package/dist/tests/unit/guidance/guidance-draft-service.test.js +0 -140
- package/dist/tests/unit/guidance/impulse-assembler.test.d.ts +0 -1
- package/dist/tests/unit/guidance/impulse-assembler.test.js +0 -169
- package/dist/tests/unit/guidance/outreach-draft-schema.test.d.ts +0 -1
- package/dist/tests/unit/guidance/outreach-draft-schema.test.js +0 -56
- package/dist/tests/unit/guidance/outreach-strategy-selector.test.d.ts +0 -1
- package/dist/tests/unit/guidance/outreach-strategy-selector.test.js +0 -208
- package/dist/tests/unit/guidance/outreach-style-fixtures.test.d.ts +0 -1
- package/dist/tests/unit/guidance/outreach-style-fixtures.test.js +0 -81
- package/dist/tests/unit/guidance/t6-1-1-narrative-outreach.test.d.ts +0 -1
- package/dist/tests/unit/guidance/t6-1-1-narrative-outreach.test.js +0 -256
- package/dist/tests/unit/observability/audit-envelope.test.d.ts +0 -1
- package/dist/tests/unit/observability/audit-envelope.test.js +0 -169
- package/dist/tests/unit/observability/connector-inventory-ledger.test.d.ts +0 -1
- package/dist/tests/unit/observability/connector-inventory-ledger.test.js +0 -128
- package/dist/tests/unit/observability/family-registry.test.d.ts +0 -12
- package/dist/tests/unit/observability/family-registry.test.js +0 -105
- package/dist/tests/unit/observability/governance-plane-recorder.test.d.ts +0 -1
- package/dist/tests/unit/observability/governance-plane-recorder.test.js +0 -72
- package/dist/tests/unit/observability/heartbeat-digest-assembler.test.d.ts +0 -1
- package/dist/tests/unit/observability/heartbeat-digest-assembler.test.js +0 -227
- package/dist/tests/unit/observability/lived-experience-audit.test.d.ts +0 -1
- package/dist/tests/unit/observability/lived-experience-audit.test.js +0 -105
- package/dist/tests/unit/observability/narrative-timeline-query.test.d.ts +0 -18
- package/dist/tests/unit/observability/narrative-timeline-query.test.js +0 -239
- package/dist/tests/unit/observability/restore-audit-service.test.d.ts +0 -16
- package/dist/tests/unit/observability/restore-audit-service.test.js +0 -186
- package/dist/tests/unit/observability/runtime-decision-recorder.test.d.ts +0 -1
- package/dist/tests/unit/observability/runtime-decision-recorder.test.js +0 -66
- package/dist/tests/unit/observability/runtime-secret-anchor-view.test.d.ts +0 -18
- package/dist/tests/unit/observability/runtime-secret-anchor-view.test.js +0 -209
- package/dist/tests/unit/observability/self-health-snapshot.test.d.ts +0 -1
- package/dist/tests/unit/observability/self-health-snapshot.test.js +0 -223
- package/dist/tests/unit/observability/verify-audit-hash-chain.test.d.ts +0 -1
- package/dist/tests/unit/observability/verify-audit-hash-chain.test.js +0 -93
- package/dist/tests/unit/ops/manual-run-dispatcher.test.d.ts +0 -13
- package/dist/tests/unit/ops/manual-run-dispatcher.test.js +0 -219
- package/dist/tests/unit/quiet/claim-synthesizer.test.d.ts +0 -17
- package/dist/tests/unit/quiet/claim-synthesizer.test.js +0 -289
- package/dist/tests/unit/quiet/daily-diary-writer.test.d.ts +0 -12
- package/dist/tests/unit/quiet/daily-diary-writer.test.js +0 -108
- package/dist/tests/unit/shared/v7-entities.test.d.ts +0 -13
- package/dist/tests/unit/shared/v7-entities.test.js +0 -306
- package/dist/tests/unit/storage/delivery-attempt.test.d.ts +0 -1
- package/dist/tests/unit/storage/delivery-attempt.test.js +0 -72
- package/dist/tests/unit/storage/diary-dream-store.test.d.ts +0 -12
- package/dist/tests/unit/storage/diary-dream-store.test.js +0 -118
- package/dist/tests/unit/storage/embodied-context-state-port.test.d.ts +0 -4
- package/dist/tests/unit/storage/embodied-context-state-port.test.js +0 -77
- package/dist/tests/unit/storage/goal-lifecycle-store.test.d.ts +0 -4
- package/dist/tests/unit/storage/goal-lifecycle-store.test.js +0 -143
- package/dist/tests/unit/storage/history-digest-store.test.d.ts +0 -10
- package/dist/tests/unit/storage/history-digest-store.test.js +0 -126
- package/dist/tests/unit/storage/identity-profile-store.test.d.ts +0 -4
- package/dist/tests/unit/storage/identity-profile-store.test.js +0 -48
- package/dist/tests/unit/storage/life-evidence-snapshot.test.d.ts +0 -1
- package/dist/tests/unit/storage/life-evidence-snapshot.test.js +0 -60
- package/dist/tests/unit/storage/life-evidence.test.d.ts +0 -1
- package/dist/tests/unit/storage/life-evidence.test.js +0 -54
- package/dist/tests/unit/storage/migration-runner.test.d.ts +0 -12
- package/dist/tests/unit/storage/migration-runner.test.js +0 -197
- package/dist/tests/unit/storage/repair-gate.test.d.ts +0 -1
- package/dist/tests/unit/storage/repair-gate.test.js +0 -41
- package/dist/tests/unit/storage/restore-snapshot-store.test.d.ts +0 -11
- package/dist/tests/unit/storage/restore-snapshot-store.test.js +0 -161
- package/dist/tests/unit/storage/rhythm-policy-snapshot.test.d.ts +0 -1
- package/dist/tests/unit/storage/rhythm-policy-snapshot.test.js +0 -31
- package/dist/tests/unit/storage/runtime-secret-anchor-store.test.d.ts +0 -10
- package/dist/tests/unit/storage/runtime-secret-anchor-store.test.js +0 -81
- package/dist/tests/unit/storage/t1-4-1-credential-health-mapper.test.d.ts +0 -1
- package/dist/tests/unit/storage/t1-4-1-credential-health-mapper.test.js +0 -83
- package/dist/tests/unit/storage/t4-1-1-session-chronicle.test.d.ts +0 -1
- package/dist/tests/unit/storage/t4-1-1-session-chronicle.test.js +0 -112
- package/dist/tests/unit/storage/t4-1-2-narrative-state.test.d.ts +0 -1
- package/dist/tests/unit/storage/t4-1-2-narrative-state.test.js +0 -80
- package/dist/tests/unit/storage/t4-1-3-relationship-memory.test.d.ts +0 -1
- package/dist/tests/unit/storage/t4-1-3-relationship-memory.test.js +0 -65
- package/dist/tests/unit/storage/t4-1-4-agent-goal.test.d.ts +0 -1
- package/dist/tests/unit/storage/t4-1-4-agent-goal.test.js +0 -166
- package/dist/tests/unit/storage/tool-experience-store.test.d.ts +0 -4
- package/dist/tests/unit/storage/tool-experience-store.test.js +0 -92
- package/dist/tests/unit/storage/user-interest-snapshot.test.d.ts +0 -1
- package/dist/tests/unit/storage/user-interest-snapshot.test.js +0 -48
- package/dist/tests/unit/storage/write-queue.test.d.ts +0 -12
- package/dist/tests/unit/storage/write-queue.test.js +0 -177
- package/dist/tests/unit/storage/write-validation-gate.test.d.ts +0 -9
- package/dist/tests/unit/storage/write-validation-gate.test.js +0 -153
- /package/{dist/plugin/index.js → index.js} +0 -0
- /package/{dist/src → runtime}/cli/action-bridge.js +0 -0
- /package/{dist/src → runtime}/cli/commands/connector-behavior.d.ts +0 -0
- /package/{dist/src → runtime}/cli/commands/connector-behavior.js +0 -0
- /package/{dist/src → runtime}/cli/commands/connector-init.d.ts +0 -0
- /package/{dist/src → runtime}/cli/commands/connector-init.js +0 -0
- /package/{dist/src → runtime}/cli/commands/connector-status.d.ts +0 -0
- /package/{dist/src → runtime}/cli/commands/connector-status.js +0 -0
- /package/{dist/src → runtime}/cli/commands/credential.d.ts +0 -0
- /package/{dist/src → runtime}/cli/commands/credential.js +0 -0
- /package/{dist/src → runtime}/cli/commands/goal.d.ts +0 -0
- /package/{dist/src → runtime}/cli/commands/goal.js +0 -0
- /package/{dist/src → runtime}/cli/commands/index.d.ts +0 -0
- /package/{dist/src → runtime}/cli/commands/policy.d.ts +0 -0
- /package/{dist/src → runtime}/cli/commands/policy.js +0 -0
- /package/{dist/src → runtime}/cli/explain/explain-surface-subject.d.ts +0 -0
- /package/{dist/src → runtime}/cli/explain/explain-surface-subject.js +0 -0
- /package/{dist/src → runtime}/cli/explain/format-explanation.d.ts +0 -0
- /package/{dist/src → runtime}/cli/explain/format-explanation.js +0 -0
- /package/{dist/src → runtime}/cli/explain/resolve-subject.d.ts +0 -0
- /package/{dist/src → runtime}/cli/explain/resolve-subject.js +0 -0
- /package/{dist/src → runtime}/cli/host-capability/classify-delivery.d.ts +0 -0
- /package/{dist/src → runtime}/cli/host-capability/classify-delivery.js +0 -0
- /package/{dist/src → runtime}/cli/host-capability/probe-host-capability.d.ts +0 -0
- /package/{dist/src → runtime}/cli/host-capability/probe-host-capability.js +0 -0
- /package/{dist/src → runtime}/cli/host-capability/record-host-capability.d.ts +0 -0
- /package/{dist/src → runtime}/cli/host-capability/record-host-capability.js +0 -0
- /package/{dist/src → runtime}/cli/host-capability/types.d.ts +0 -0
- /package/{dist/src → runtime}/cli/host-capability/types.js +0 -0
- /package/{dist/src → runtime}/cli/host-smoke/run-host-smoke.d.ts +0 -0
- /package/{dist/src → runtime}/cli/host-smoke/run-host-smoke.js +0 -0
- /package/{dist/src → runtime}/cli/host-smoke/types.d.ts +0 -0
- /package/{dist/src → runtime}/cli/host-smoke/types.js +0 -0
- /package/{dist/src → runtime}/cli/index.js +0 -0
- /package/{dist/src → runtime}/cli/ops/heartbeat-surface.d.ts +0 -0
- /package/{dist/src → runtime}/cli/ops/heartbeat-surface.js +0 -0
- /package/{dist/src → runtime}/cli/ops/manual-run-dispatcher.d.ts +0 -0
- /package/{dist/src → runtime}/cli/ops/manual-run-dispatcher.js +0 -0
- /package/{dist/src → runtime}/cli/ops/ops-router.d.ts +0 -0
- /package/{dist/src → runtime}/cli/ops/show-operator-fallback.d.ts +0 -0
- /package/{dist/src → runtime}/cli/ops/show-operator-fallback.js +0 -0
- /package/{dist/src → runtime}/cli/ops/workspace-heartbeat-runner.d.ts +0 -0
- /package/{dist/src → runtime}/cli/ops/workspace-heartbeat-runner.js +0 -0
- /package/{dist/src → runtime}/cli/read-models/index.d.ts +0 -0
- /package/{dist/src → runtime}/cli/read-models/index.js +0 -0
- /package/{dist/src → runtime}/cli/read-models/operator-explain-map.d.ts +0 -0
- /package/{dist/src → runtime}/cli/read-models/operator-explain-map.js +0 -0
- /package/{dist/src → runtime}/cli/read-models/types.d.ts +0 -0
- /package/{dist/src → runtime}/cli/read-models/types.js +0 -0
- /package/{dist/src → runtime}/cli/runtime/runtime-artifact-boundary.d.ts +0 -0
- /package/{dist/src → runtime}/cli/runtime/runtime-artifact-boundary.js +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/agent-world/adapter.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/agent-world/adapter.js +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/agent-world/index.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/agent-world/index.js +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/agent-world/manifest.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/agent-world/manifest.js +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/evomap/adapter.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/evomap/adapter.js +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/evomap/index.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/evomap/index.js +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/evomap/manifest.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/evomap/manifest.js +0 -0
- /package/{dist/src → runtime}/connectors/base/channel-health.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/channel-health.js +0 -0
- /package/{dist/src → runtime}/connectors/base/contract.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/contract.js +0 -0
- /package/{dist/src → runtime}/connectors/base/effect-commit-ledger-sqlite.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/effect-commit-ledger-sqlite.js +0 -0
- /package/{dist/src → runtime}/connectors/base/execution-policy.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/execution-policy.js +0 -0
- /package/{dist/src → runtime}/connectors/base/failure-taxonomy.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/failure-taxonomy.js +0 -0
- /package/{dist/src → runtime}/connectors/base/index.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/index.js +0 -0
- /package/{dist/src → runtime}/connectors/base/manifest-v7.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/manifest-v7.js +0 -0
- /package/{dist/src → runtime}/connectors/base/manifest.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/manifest.js +0 -0
- /package/{dist/src → runtime}/connectors/base/map-life-evidence.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/map-life-evidence.js +0 -0
- /package/{dist/src → runtime}/connectors/base/policy-layer.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/policy-layer.js +0 -0
- /package/{dist/src → runtime}/connectors/base/route-planner.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/route-planner.js +0 -0
- /package/{dist/src → runtime}/connectors/base/structured-unavailable-reason.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/structured-unavailable-reason.js +0 -0
- /package/{dist/src → runtime}/connectors/base/wet-probe-runner.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/wet-probe-runner.js +0 -0
- /package/{dist/src → runtime}/connectors/index.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/index.js +0 -0
- /package/{dist/src → runtime}/connectors/manifest/manifest-parser.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/manifest/manifest-parser.js +0 -0
- /package/{dist/src → runtime}/connectors/manifest/manifest-schema.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/manifest/manifest-schema.js +0 -0
- /package/{dist/src → runtime}/connectors/near-real/near-real-connector-smoke.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/near-real/near-real-connector-smoke.js +0 -0
- /package/{dist/src → runtime}/connectors/registry/dynamic-connector-registry.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/registry/dynamic-connector-registry.js +0 -0
- /package/{dist/src → runtime}/connectors/registry/index.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/registry/index.js +0 -0
- /package/{dist/src → runtime}/connectors/registry/manifest-scanner.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/registry/manifest-scanner.js +0 -0
- /package/{dist/src → runtime}/connectors/registry/trust-policy.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/registry/trust-policy.js +0 -0
- /package/{dist/src → runtime}/connectors/services/connector-executor-adapter.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/services/connector-executor-adapter.js +0 -0
- /package/{dist/src → runtime}/connectors/services/credential-route-context.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/services/credential-route-context.js +0 -0
- /package/{dist/src → runtime}/connectors/social-community/instreet/adapter.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/social-community/instreet/adapter.js +0 -0
- /package/{dist/src → runtime}/connectors/social-community/instreet/index.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/social-community/instreet/index.js +0 -0
- /package/{dist/src → runtime}/connectors/social-community/instreet/manifest.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/social-community/instreet/manifest.js +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/adapter.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/adapter.js +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/api-client.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/api-client.js +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/index.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/index.js +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/manifest.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/manifest.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/behavior-promotion/behavior-promotion-loop.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/behavior-promotion/behavior-promotion-loop.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/circuit-breaker/circuit-breaker-manager.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/circuit-breaker/circuit-breaker-manager.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/probe-signal-adapter.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/probe-signal-adapter.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-affordance/affordance-assembler.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-affordance/affordance-assembler.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-affordance/affordance-context-scope.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-affordance/affordance-context-scope.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-experience/experience-writer.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-experience/experience-writer.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-experience/pain-signal-query.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-experience/pain-signal-query.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/feedback/owner-reply-feedback.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/feedback/owner-reply-feedback.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/guidance/apply-guidance.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/guidance/apply-guidance.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/guidance/request-guidance.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/guidance/request-guidance.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/guidance/user-reply-continuity.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/guidance/user-reply-continuity.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/decision-trace-emitter.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/decision-trace-emitter.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/embodied-context-assembler.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/embodied-context-assembler.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/goal-lifecycle-policy.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/goal-lifecycle-policy.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/heartbeat-executor.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/heartbeat-executor.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/heartbeat-loop.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/heartbeat-loop.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/idle-curiosity-policy.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/idle-curiosity-policy.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/index.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/index.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/run-heartbeat-cycle-v7.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/run-heartbeat-cycle-v7.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/run-heartbeat-cycle.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/run-heartbeat-cycle.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/runtime-snapshot.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/runtime-snapshot.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/scope-router.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/scope-router.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/signal.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/signal.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/snapshot-builder.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/snapshot-builder.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/index.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/index.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/downstream-intent-orchestrator.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/downstream-intent-orchestrator.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/effect-dispatcher.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/effect-dispatcher.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/goal-priority.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/goal-priority.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/guard-layer.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/guard-layer.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/hard-guard-evaluator.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/hard-guard-evaluator.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/index.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/index.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/intent-planner.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/intent-planner.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/lease-manager.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/lease-manager.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/narrative-update.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/narrative-update.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/platform-capability-router.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/platform-capability-router.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/resume-from-checkpoint.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/resume-from-checkpoint.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/build-message.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/build-message.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/build-outreach-draft-request.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/build-outreach-draft-request.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/delivery-target.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/delivery-target.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/dispatch-user-outreach.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/dispatch-user-outreach.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/evaluate-outreach.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/evaluate-outreach.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/judge-input-from-snapshot.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/judge-input-from-snapshot.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/judge-outreach.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/judge-outreach.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/claim-synthesizer.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/claim-synthesizer.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/daily-diary-writer.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/daily-diary-writer.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/index.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/index.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/quiet-pipeline.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/quiet-pipeline.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/run-source-backed-quiet.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/run-source-backed-quiet.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/reflection/run-narrative-reflection.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/reflection/run-narrative-reflection.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/planner-rhythm-window.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/planner-rhythm-window.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/policy-bridge.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/policy-bridge.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/rhythm-policy.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/rhythm-policy.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/select-window.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/select-window.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/runtime/lifecycle-service.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/runtime/lifecycle-service.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/runtime/service-entry.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/runtime/service-entry.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/types.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/types.js +0 -0
- /package/{dist/src → runtime}/dream/dream-engine.d.ts +0 -0
- /package/{dist/src → runtime}/dream/dream-engine.js +0 -0
- /package/{dist/src → runtime}/dream/dream-input-loader.d.ts +0 -0
- /package/{dist/src → runtime}/dream/dream-input-loader.js +0 -0
- /package/{dist/src → runtime}/dream/dream-scheduler.d.ts +0 -0
- /package/{dist/src → runtime}/dream/dream-scheduler.js +0 -0
- /package/{dist/src → runtime}/dream/index.d.ts +0 -0
- /package/{dist/src → runtime}/dream/index.js +0 -0
- /package/{dist/src → runtime}/dream/insight-extractor.d.ts +0 -0
- /package/{dist/src → runtime}/dream/insight-extractor.js +0 -0
- /package/{dist/src → runtime}/dream/memory-consolidator.d.ts +0 -0
- /package/{dist/src → runtime}/dream/memory-consolidator.js +0 -0
- /package/{dist/src → runtime}/dream/narrative-update-proposal.d.ts +0 -0
- /package/{dist/src → runtime}/dream/narrative-update-proposal.js +0 -0
- /package/{dist/src → runtime}/dream/output-validator.d.ts +0 -0
- /package/{dist/src → runtime}/dream/output-validator.js +0 -0
- /package/{dist/src → runtime}/dream/redaction-gate.d.ts +0 -0
- /package/{dist/src → runtime}/dream/redaction-gate.js +0 -0
- /package/{dist/src → runtime}/dream/relationship-update-proposal.d.ts +0 -0
- /package/{dist/src → runtime}/dream/relationship-update-proposal.js +0 -0
- /package/{dist/src → runtime}/dream/sampler.d.ts +0 -0
- /package/{dist/src → runtime}/dream/sampler.js +0 -0
- /package/{dist/src → runtime}/dream/types.d.ts +0 -0
- /package/{dist/src → runtime}/dream/types.js +0 -0
- /package/{dist/src → runtime}/guidance/capability-class.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/capability-class.js +0 -0
- /package/{dist/src → runtime}/guidance/channel-feedback-ingestion-service.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/channel-feedback-ingestion-service.js +0 -0
- /package/{dist/src → runtime}/guidance/contracts.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/contracts.js +0 -0
- /package/{dist/src → runtime}/guidance/draft-narrative-outreach.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/draft-narrative-outreach.js +0 -0
- /package/{dist/src → runtime}/guidance/draft-outreach-message.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/draft-outreach-message.js +0 -0
- /package/{dist/src → runtime}/guidance/evidence-guidance.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/evidence-guidance.js +0 -0
- /package/{dist/src → runtime}/guidance/fallback.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/fallback.js +0 -0
- /package/{dist/src → runtime}/guidance/guidance-assembler.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/guidance-assembler.js +0 -0
- /package/{dist/src → runtime}/guidance/guidance-draft-service.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/guidance-draft-service.js +0 -0
- /package/{dist/src → runtime}/guidance/impulse-assembler.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/impulse-assembler.js +0 -0
- /package/{dist/src → runtime}/guidance/index.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/index.js +0 -0
- /package/{dist/src → runtime}/guidance/output-guard.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/output-guard.js +0 -0
- /package/{dist/src → runtime}/guidance/outreach-draft-schema.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/outreach-draft-schema.js +0 -0
- /package/{dist/src → runtime}/guidance/outreach-strategy-selector.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/outreach-strategy-selector.js +0 -0
- /package/{dist/src → runtime}/guidance/persona-selection.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/persona-selection.js +0 -0
- /package/{dist/src → runtime}/guidance/review-workflow.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/review-workflow.js +0 -0
- /package/{dist/src → runtime}/guidance/template-registry.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/template-registry.js +0 -0
- /package/{dist/src → runtime}/guidance/types.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/types.js +0 -0
- /package/{dist/src → runtime}/observability/audit/append-only-audit-store.d.ts +0 -0
- /package/{dist/src → runtime}/observability/audit/append-only-audit-store.js +0 -0
- /package/{dist/src → runtime}/observability/audit/audit-envelope.d.ts +0 -0
- /package/{dist/src → runtime}/observability/audit/audit-envelope.js +0 -0
- /package/{dist/src → runtime}/observability/audit/audit-family-registry.json +0 -0
- /package/{dist/src → runtime}/observability/audit/family-registry.d.ts +0 -0
- /package/{dist/src → runtime}/observability/audit/family-registry.js +0 -0
- /package/{dist/src → runtime}/observability/audit/verify-audit-hash-chain.d.ts +0 -0
- /package/{dist/src → runtime}/observability/audit/verify-audit-hash-chain.js +0 -0
- /package/{dist/src → runtime}/observability/connector-inventory-ledger.d.ts +0 -0
- /package/{dist/src → runtime}/observability/connector-inventory-ledger.js +0 -0
- /package/{dist/src → runtime}/observability/db/index.d.ts +0 -0
- /package/{dist/src → runtime}/observability/db/index.js +0 -0
- /package/{dist/src → runtime}/observability/db/schema/connector-inventory.d.ts +0 -0
- /package/{dist/src → runtime}/observability/db/schema/connector-inventory.js +0 -0
- /package/{dist/src → runtime}/observability/db/schema/host-capability-reports.d.ts +0 -0
- /package/{dist/src → runtime}/observability/db/schema/host-capability-reports.js +0 -0
- /package/{dist/src → runtime}/observability/db/schema/index.d.ts +0 -0
- /package/{dist/src → runtime}/observability/db/schema/index.js +0 -0
- /package/{dist/src → runtime}/observability/index.d.ts +0 -0
- /package/{dist/src → runtime}/observability/index.js +0 -0
- /package/{dist/src → runtime}/observability/projections/guidance-audit.d.ts +0 -0
- /package/{dist/src → runtime}/observability/projections/guidance-audit.js +0 -0
- /package/{dist/src → runtime}/observability/projections/outreach-quality-audit.d.ts +0 -0
- /package/{dist/src → runtime}/observability/projections/outreach-quality-audit.js +0 -0
- /package/{dist/src → runtime}/observability/projections/reflection-audit.d.ts +0 -0
- /package/{dist/src → runtime}/observability/projections/reflection-audit.js +0 -0
- /package/{dist/src → runtime}/observability/query/compose-evidence.d.ts +0 -0
- /package/{dist/src → runtime}/observability/query/compose-evidence.js +0 -0
- /package/{dist/src → runtime}/observability/query/evidence-query-engine.d.ts +0 -0
- /package/{dist/src → runtime}/observability/query/evidence-query-engine.js +0 -0
- /package/{dist/src → runtime}/observability/query/explain-query.d.ts +0 -0
- /package/{dist/src → runtime}/observability/query/explain-query.js +0 -0
- /package/{dist/src → runtime}/observability/query/export-audit-bundle.d.ts +0 -0
- /package/{dist/src → runtime}/observability/query/export-audit-bundle.js +0 -0
- /package/{dist/src → runtime}/observability/redaction/manifest.d.ts +0 -0
- /package/{dist/src → runtime}/observability/redaction/manifest.js +0 -0
- /package/{dist/src → runtime}/observability/redaction/policy.d.ts +0 -0
- /package/{dist/src → runtime}/observability/redaction/policy.js +0 -0
- /package/{dist/src → runtime}/observability/services/decision-ledger.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/decision-ledger.js +0 -0
- /package/{dist/src → runtime}/observability/services/execution-telemetry.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/execution-telemetry.js +0 -0
- /package/{dist/src → runtime}/observability/services/governance-audit.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/governance-audit.js +0 -0
- /package/{dist/src → runtime}/observability/services/governance-plane-recorder.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/governance-plane-recorder.js +0 -0
- /package/{dist/src → runtime}/observability/services/heartbeat-digest-assembler.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/heartbeat-digest-assembler.js +0 -0
- /package/{dist/src → runtime}/observability/services/lived-experience-audit.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/lived-experience-audit.js +0 -0
- /package/{dist/src → runtime}/observability/services/narrative-timeline-query-service.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/narrative-timeline-query-service.js +0 -0
- /package/{dist/src → runtime}/observability/services/observability-retention.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/observability-retention.js +0 -0
- /package/{dist/src → runtime}/observability/services/redaction-store.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/redaction-store.js +0 -0
- /package/{dist/src → runtime}/observability/services/restore-audit-service.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/restore-audit-service.js +0 -0
- /package/{dist/src → runtime}/observability/services/runtime-decision-recorder.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/runtime-decision-recorder.js +0 -0
- /package/{dist/src → runtime}/observability/services/runtime-secret-anchor-view.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/runtime-secret-anchor-view.js +0 -0
- /package/{dist/src → runtime}/observability/services/self-health-snapshot.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/self-health-snapshot.js +0 -0
- /package/{dist/src → runtime}/shared/types/continuity.d.ts +0 -0
- /package/{dist/src → runtime}/shared/types/continuity.js +0 -0
- /package/{dist/src → runtime}/shared/types/credential.d.ts +0 -0
- /package/{dist/src → runtime}/shared/types/credential.js +0 -0
- /package/{dist/src → runtime}/shared/types/goal.d.ts +0 -0
- /package/{dist/src → runtime}/shared/types/goal.js +0 -0
- /package/{dist/src → runtime}/shared/types/index.d.ts +0 -0
- /package/{dist/src → runtime}/shared/types/outreach.d.ts +0 -0
- /package/{dist/src → runtime}/shared/types/outreach.js +0 -0
- /package/{dist/src → runtime}/shared/types/source-ref.d.ts +0 -0
- /package/{dist/src → runtime}/shared/types/source-ref.js +0 -0
- /package/{dist/src → runtime}/shared/types/v7-entities.d.ts +0 -0
- /package/{dist/src → runtime}/shared/types/v7-entities.js +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/native-sqlite-probe.d.ts +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/native-sqlite-probe.js +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/repair-gate.d.ts +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/repair-gate.js +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/repair.d.ts +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/repair.js +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/storage-mode-smoke.d.ts +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/storage-mode-smoke.js +0 -0
- /package/{dist/src → runtime}/storage/chronicle/session-chronicle-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/chronicle/session-chronicle-store.js +0 -0
- /package/{dist/src → runtime}/storage/db/index.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/index.js +0 -0
- /package/{dist/src → runtime}/storage/db/migration-runner.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/migration-runner.js +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/index.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/index.js +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-001-foundation.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-001-foundation.js +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-002-effect-commit-ledger.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-002-effect-commit-ledger.js +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-003-circuit-breaker.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-003-circuit-breaker.js +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-004-behavior-promotion.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-004-behavior-promotion.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/agent-goal.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/agent-goal.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/assets.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/assets.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/credentials.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/credentials.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/delivery-attempts.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/delivery-attempts.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/intent-commits.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/intent-commits.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/life-evidence-index.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/life-evidence-index.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/memory-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/memory-store.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/narrative-state.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/narrative-state.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/operator-fallback-artifacts.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/operator-fallback-artifacts.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/policies.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/policies.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/proposals.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/proposals.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/provenance.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/provenance.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/relationship-memory.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/relationship-memory.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/session-chronicle.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/session-chronicle.js +0 -0
- /package/{dist/src → runtime}/storage/db/transaction-utils.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/transaction-utils.js +0 -0
- /package/{dist/src → runtime}/storage/db/write-queue.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/write-queue.js +0 -0
- /package/{dist/src → runtime}/storage/delivery/query-delivery-attempts.d.ts +0 -0
- /package/{dist/src → runtime}/storage/delivery/query-delivery-attempts.js +0 -0
- /package/{dist/src → runtime}/storage/delivery/types.d.ts +0 -0
- /package/{dist/src → runtime}/storage/delivery/types.js +0 -0
- /package/{dist/src → runtime}/storage/delivery/write-delivery-attempt.d.ts +0 -0
- /package/{dist/src → runtime}/storage/delivery/write-delivery-attempt.js +0 -0
- /package/{dist/src → runtime}/storage/fallback/load-operator-fallback.d.ts +0 -0
- /package/{dist/src → runtime}/storage/fallback/load-operator-fallback.js +0 -0
- /package/{dist/src → runtime}/storage/fallback/operator-fallback-types.d.ts +0 -0
- /package/{dist/src → runtime}/storage/fallback/operator-fallback-types.js +0 -0
- /package/{dist/src → runtime}/storage/fallback/operator-fallback-view.d.ts +0 -0
- /package/{dist/src → runtime}/storage/fallback/operator-fallback-view.js +0 -0
- /package/{dist/src → runtime}/storage/fallback/write-operator-fallback.d.ts +0 -0
- /package/{dist/src → runtime}/storage/fallback/write-operator-fallback.js +0 -0
- /package/{dist/src → runtime}/storage/goal/agent-goal-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/goal/agent-goal-store.js +0 -0
- /package/{dist/src → runtime}/storage/index.d.ts +0 -0
- /package/{dist/src → runtime}/storage/index.js +0 -0
- /package/{dist/src → runtime}/storage/life-evidence/append-life-evidence.d.ts +0 -0
- /package/{dist/src → runtime}/storage/life-evidence/append-life-evidence.js +0 -0
- /package/{dist/src → runtime}/storage/life-evidence/types.d.ts +0 -0
- /package/{dist/src → runtime}/storage/life-evidence/types.js +0 -0
- /package/{dist/src → runtime}/storage/memory/workspace/paths.d.ts +0 -0
- /package/{dist/src → runtime}/storage/memory/workspace/paths.js +0 -0
- /package/{dist/src → runtime}/storage/memory/workspace/store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/memory/workspace/store.js +0 -0
- /package/{dist/src → runtime}/storage/memory/workspace/types.d.ts +0 -0
- /package/{dist/src → runtime}/storage/memory/workspace/types.js +0 -0
- /package/{dist/src → runtime}/storage/memory-store/memory-store-lifecycle.d.ts +0 -0
- /package/{dist/src → runtime}/storage/memory-store/memory-store-lifecycle.js +0 -0
- /package/{dist/src → runtime}/storage/narrative/narrative-state-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/narrative/narrative-state-store.js +0 -0
- /package/{dist/src → runtime}/storage/quiet/persist-quiet-artifact.d.ts +0 -0
- /package/{dist/src → runtime}/storage/quiet/persist-quiet-artifact.js +0 -0
- /package/{dist/src → runtime}/storage/quiet/quiet-artifact-types.d.ts +0 -0
- /package/{dist/src → runtime}/storage/quiet/quiet-artifact-types.js +0 -0
- /package/{dist/src → runtime}/storage/quiet/quiet-artifact-writer.d.ts +0 -0
- /package/{dist/src → runtime}/storage/quiet/quiet-artifact-writer.js +0 -0
- /package/{dist/src → runtime}/storage/relationship/relationship-memory-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/relationship/relationship-memory-store.js +0 -0
- /package/{dist/src → runtime}/storage/repositories/asset-repository.d.ts +0 -0
- /package/{dist/src → runtime}/storage/repositories/asset-repository.js +0 -0
- /package/{dist/src → runtime}/storage/repositories/credential-repository.d.ts +0 -0
- /package/{dist/src → runtime}/storage/repositories/credential-repository.js +0 -0
- /package/{dist/src → runtime}/storage/repositories/index.d.ts +0 -0
- /package/{dist/src → runtime}/storage/repositories/index.js +0 -0
- /package/{dist/src → runtime}/storage/repositories/intent-commit-repository.d.ts +0 -0
- /package/{dist/src → runtime}/storage/repositories/intent-commit-repository.js +0 -0
- /package/{dist/src → runtime}/storage/repositories/policy-repository.d.ts +0 -0
- /package/{dist/src → runtime}/storage/repositories/policy-repository.js +0 -0
- /package/{dist/src → runtime}/storage/repositories/proposal-repository.d.ts +0 -0
- /package/{dist/src → runtime}/storage/repositories/proposal-repository.js +0 -0
- /package/{dist/src → runtime}/storage/repositories/provenance-repository.d.ts +0 -0
- /package/{dist/src → runtime}/storage/repositories/provenance-repository.js +0 -0
- /package/{dist/src → runtime}/storage/rhythm/rhythm-policy-snapshot.d.ts +0 -0
- /package/{dist/src → runtime}/storage/rhythm/rhythm-policy-snapshot.js +0 -0
- /package/{dist/src → runtime}/storage/services/credential-vault.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/credential-vault.js +0 -0
- /package/{dist/src → runtime}/storage/services/daily-log-pipeline.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/daily-log-pipeline.js +0 -0
- /package/{dist/src → runtime}/storage/services/diary-dream-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/diary-dream-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/effect-commit-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/effect-commit-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/embodied-context-state-port.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/embodied-context-state-port.js +0 -0
- /package/{dist/src → runtime}/storage/services/goal-lifecycle-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/goal-lifecycle-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/governance-layer.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/governance-layer.js +0 -0
- /package/{dist/src → runtime}/storage/services/history-digest-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/history-digest-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/identity-profile-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/identity-profile-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/interaction-snapshot-projector.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/interaction-snapshot-projector.js +0 -0
- /package/{dist/src → runtime}/storage/services/persona-candidate-loader.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/persona-candidate-loader.js +0 -0
- /package/{dist/src → runtime}/storage/services/provenance-service.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/provenance-service.js +0 -0
- /package/{dist/src → runtime}/storage/services/quiet-input-loader.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/quiet-input-loader.js +0 -0
- /package/{dist/src → runtime}/storage/services/repair-and-backup.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/repair-and-backup.js +0 -0
- /package/{dist/src → runtime}/storage/services/restore-snapshot-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/restore-snapshot-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/runtime-secret-anchor-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/runtime-secret-anchor-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/tool-experience-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/tool-experience-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/write-validation-gate.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/write-validation-gate.js +0 -0
- /package/{dist/src → runtime}/storage/snapshots/continuity-snapshot.d.ts +0 -0
- /package/{dist/src → runtime}/storage/snapshots/continuity-snapshot.js +0 -0
- /package/{dist/src → runtime}/storage/snapshots/life-evidence-snapshot.d.ts +0 -0
- /package/{dist/src → runtime}/storage/snapshots/life-evidence-snapshot.js +0 -0
- /package/{dist/src → runtime}/storage/snapshots/types.d.ts +0 -0
- /package/{dist/src → runtime}/storage/snapshots/types.js +0 -0
- /package/{dist/src → runtime}/storage/state-api.d.ts +0 -0
- /package/{dist/src → runtime}/storage/state-api.js +0 -0
- /package/{dist/src → runtime}/storage/user-interest/load-user-interest-snapshot.d.ts +0 -0
- /package/{dist/src → runtime}/storage/user-interest/load-user-interest-snapshot.js +0 -0
- /package/{dist/src → runtime}/storage/user-interest/types.d.ts +0 -0
- /package/{dist/src → runtime}/storage/user-interest/types.js +0 -0
- /package/{dist/plugin/workspace-ops-bridge.js → workspace-ops-bridge.js} +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QuietDailyReviewBuilder — Aggregate daily closures, perceptions, and
|
|
3
|
+
* memory-review candidates into a source-backed QuietDailyReview.
|
|
4
|
+
*
|
|
5
|
+
* Core logic: Read ActionClosureRecords by day, collect memory-review
|
|
6
|
+
* candidates, build summary, and write QuietDailyReview row.
|
|
7
|
+
*
|
|
8
|
+
* Design authority:
|
|
9
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/dream-quiet-memory-system.detail.md §3.1`
|
|
10
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/dream-quiet-memory-system.md §4.2`
|
|
11
|
+
*
|
|
12
|
+
* Dependencies:
|
|
13
|
+
* - `src/storage/v8-state-stores.js` (readActionClosuresByDay, writeQuietDailyReview)
|
|
14
|
+
* - `src/shared/types/v8-contracts.js` (SourceRef, DegradedOperationResult, V8ReasonCode)
|
|
15
|
+
*
|
|
16
|
+
* Boundary:
|
|
17
|
+
* - Does not form long-term memory; only emits review input for Dream.
|
|
18
|
+
* - Does not judge importance; reads closure status and risk flags.
|
|
19
|
+
* - Degrades gracefully on unreadable state.
|
|
20
|
+
*
|
|
21
|
+
* Test coverage: tests/unit/quiet/quiet-daily-review-builder.test.ts
|
|
22
|
+
*/
|
|
23
|
+
import { readActionClosuresByDay, writeQuietDailyReview, } from "../../../storage/v8-state-stores.js";
|
|
24
|
+
// ───────────────────────────────────────────────────────────────
|
|
25
|
+
// Config
|
|
26
|
+
// ───────────────────────────────────────────────────────────────
|
|
27
|
+
const QUIET_MAX_CLOSURES_PER_DAY = 200;
|
|
28
|
+
// ───────────────────────────────────────────────────────────────
|
|
29
|
+
// Helpers
|
|
30
|
+
// ───────────────────────────────────────────────────────────────
|
|
31
|
+
function todayString(now) {
|
|
32
|
+
return now.slice(0, 10);
|
|
33
|
+
}
|
|
34
|
+
function parsePayloadJson(json) {
|
|
35
|
+
if (!json)
|
|
36
|
+
return {};
|
|
37
|
+
try {
|
|
38
|
+
return JSON.parse(json);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return {};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function buildSourceRefFromClosure(closure) {
|
|
45
|
+
return {
|
|
46
|
+
uri: `sn://closure/${closure.id}`,
|
|
47
|
+
family: "action_closure",
|
|
48
|
+
id: closure.id,
|
|
49
|
+
redactionClass: "none",
|
|
50
|
+
resolveStatus: "resolvable",
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
// ───────────────────────────────────────────────────────────────
|
|
54
|
+
// Public API
|
|
55
|
+
// ───────────────────────────────────────────────────────────────
|
|
56
|
+
export async function buildQuietDailyReview(db, options) {
|
|
57
|
+
const now = options?.now ?? new Date().toISOString();
|
|
58
|
+
const day = options?.day ?? todayString(now);
|
|
59
|
+
const readResult = await readActionClosuresByDay(db, day);
|
|
60
|
+
if (readResult.degraded) {
|
|
61
|
+
return readResult.degraded;
|
|
62
|
+
}
|
|
63
|
+
const closures = readResult.rows.slice(0, QUIET_MAX_CLOSURES_PER_DAY);
|
|
64
|
+
if (closures.length === 0) {
|
|
65
|
+
return {
|
|
66
|
+
status: "empty",
|
|
67
|
+
reason: "quiet_empty_input",
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const sourceRefs = closures.map(buildSourceRefFromClosure);
|
|
71
|
+
// Collect memory-review candidates from closure payloads
|
|
72
|
+
const memoryCandidates = [];
|
|
73
|
+
for (const closure of closures) {
|
|
74
|
+
const payload = parsePayloadJson(closure.payloadJson);
|
|
75
|
+
if (payload.memoryReviewCandidate) {
|
|
76
|
+
memoryCandidates.push(payload.memoryReviewCandidate);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Build summary
|
|
80
|
+
const completedCount = closures.filter((c) => c.status === "completed").length;
|
|
81
|
+
const deniedCount = closures.filter((c) => c.status === "denied").length;
|
|
82
|
+
const failedCount = closures.filter((c) => c.status === "failed").length;
|
|
83
|
+
const reviewSummary = `Day ${day}: ${closures.length} closures (${completedCount} completed, ${deniedCount} denied, ${failedCount} failed)`;
|
|
84
|
+
const importanceSignals = [];
|
|
85
|
+
if (memoryCandidates.length > 0) {
|
|
86
|
+
importanceSignals.push(`${memoryCandidates.length} memory-review candidates`);
|
|
87
|
+
}
|
|
88
|
+
if (failedCount > 0) {
|
|
89
|
+
importanceSignals.push(`${failedCount} failed actions`);
|
|
90
|
+
}
|
|
91
|
+
const reviewId = `quiet_${day}`;
|
|
92
|
+
const writeResult = await writeQuietDailyReview(db, {
|
|
93
|
+
id: reviewId,
|
|
94
|
+
createdAt: now,
|
|
95
|
+
day,
|
|
96
|
+
closureCount: closures.length,
|
|
97
|
+
memoryCandidateCount: memoryCandidates.length,
|
|
98
|
+
sourceRefs,
|
|
99
|
+
redactionClass: "none",
|
|
100
|
+
lifecycleStatus: "pending",
|
|
101
|
+
payloadJson: JSON.stringify({
|
|
102
|
+
reviewSummary,
|
|
103
|
+
importanceSignals,
|
|
104
|
+
memoryCandidates,
|
|
105
|
+
}),
|
|
106
|
+
});
|
|
107
|
+
if ("reason" in writeResult) {
|
|
108
|
+
return writeResult;
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
status: "completed",
|
|
112
|
+
review: {
|
|
113
|
+
id: reviewId,
|
|
114
|
+
day,
|
|
115
|
+
closureCount: closures.length,
|
|
116
|
+
memoryCandidateCount: memoryCandidates.length,
|
|
117
|
+
sourceRefs,
|
|
118
|
+
reviewSummary,
|
|
119
|
+
importanceSignals,
|
|
120
|
+
createdAt: now,
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CausalLoopHealth — Assemble loop health snapshot from cycle traces and stage events.
|
|
3
|
+
*
|
|
4
|
+
* Core logic: Read recent HeartbeatCycleTrace and LoopStageEvent rows,
|
|
5
|
+
* compute stage freshness, identify stalled stages, and return
|
|
6
|
+
* CausalLoopHealthSnapshot.
|
|
7
|
+
*
|
|
8
|
+
* Design authority:
|
|
9
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/observability-health-system.detail.md §3.2`
|
|
10
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/observability-health-system.md §5`
|
|
11
|
+
*
|
|
12
|
+
* Dependencies:
|
|
13
|
+
* - `src/storage/v8-state-stores.js` (readHeartbeatCycleTraces, readLoopStageEventsByStage)
|
|
14
|
+
* - `src/shared/types/v8-contracts.js` (LoopStage, DegradedOperationResult)
|
|
15
|
+
*
|
|
16
|
+
* Boundary:
|
|
17
|
+
* - Does not judge action correctness; only measures loop progression.
|
|
18
|
+
* - Does not block heartbeat; returns degraded diagnostics.
|
|
19
|
+
* - Stall detection uses cycle-sequence gaps, not wall-clock only.
|
|
20
|
+
*
|
|
21
|
+
* Test coverage: tests/unit/observability/causal-loop-health.test.ts
|
|
22
|
+
*/
|
|
23
|
+
import type { StateDatabase } from "../storage/db/index.js";
|
|
24
|
+
import type { LoopStage, DegradedOperationResult } from "../shared/types/v8-contracts.js";
|
|
25
|
+
export interface StageHealth {
|
|
26
|
+
stage: LoopStage;
|
|
27
|
+
lastEventAt?: string;
|
|
28
|
+
lastCycleSequence?: number;
|
|
29
|
+
eventCount: number;
|
|
30
|
+
stalled: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface CausalLoopHealthSnapshot {
|
|
33
|
+
overallStatus: "healthy" | "degraded" | "stalled" | "no_data";
|
|
34
|
+
stalledAt?: LoopStage;
|
|
35
|
+
lastCycleSequence: number;
|
|
36
|
+
lastHeartbeatAt?: string;
|
|
37
|
+
stages: StageHealth[];
|
|
38
|
+
reason?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface AssembleLoopStatusOptions {
|
|
41
|
+
stallThresholdCycles?: number;
|
|
42
|
+
limit?: number;
|
|
43
|
+
}
|
|
44
|
+
export declare function assembleLoopStatus(db: StateDatabase, options?: AssembleLoopStatusOptions): Promise<CausalLoopHealthSnapshot | DegradedOperationResult>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CausalLoopHealth — Assemble loop health snapshot from cycle traces and stage events.
|
|
3
|
+
*
|
|
4
|
+
* Core logic: Read recent HeartbeatCycleTrace and LoopStageEvent rows,
|
|
5
|
+
* compute stage freshness, identify stalled stages, and return
|
|
6
|
+
* CausalLoopHealthSnapshot.
|
|
7
|
+
*
|
|
8
|
+
* Design authority:
|
|
9
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/observability-health-system.detail.md §3.2`
|
|
10
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/observability-health-system.md §5`
|
|
11
|
+
*
|
|
12
|
+
* Dependencies:
|
|
13
|
+
* - `src/storage/v8-state-stores.js` (readHeartbeatCycleTraces, readLoopStageEventsByStage)
|
|
14
|
+
* - `src/shared/types/v8-contracts.js` (LoopStage, DegradedOperationResult)
|
|
15
|
+
*
|
|
16
|
+
* Boundary:
|
|
17
|
+
* - Does not judge action correctness; only measures loop progression.
|
|
18
|
+
* - Does not block heartbeat; returns degraded diagnostics.
|
|
19
|
+
* - Stall detection uses cycle-sequence gaps, not wall-clock only.
|
|
20
|
+
*
|
|
21
|
+
* Test coverage: tests/unit/observability/causal-loop-health.test.ts
|
|
22
|
+
*/
|
|
23
|
+
import { readHeartbeatCycleTraces, readLoopStageEventsByStage, } from "../storage/v8-state-stores.js";
|
|
24
|
+
// ───────────────────────────────────────────────────────────────
|
|
25
|
+
// Config
|
|
26
|
+
// ───────────────────────────────────────────────────────────────
|
|
27
|
+
const DEFAULT_STALL_THRESHOLD_CYCLES = 2;
|
|
28
|
+
const LOOP_STAGES = [
|
|
29
|
+
"ingestion",
|
|
30
|
+
"perception",
|
|
31
|
+
"judgment",
|
|
32
|
+
"policy",
|
|
33
|
+
"execution",
|
|
34
|
+
"closure",
|
|
35
|
+
"quiet",
|
|
36
|
+
"dream",
|
|
37
|
+
"projection",
|
|
38
|
+
];
|
|
39
|
+
// ───────────────────────────────────────────────────────────────
|
|
40
|
+
// Helpers
|
|
41
|
+
// ───────────────────────────────────────────────────────────────
|
|
42
|
+
function maxCycleSequence(stages) {
|
|
43
|
+
return Math.max(0, ...stages.map((s) => s.lastCycleSequence ?? 0));
|
|
44
|
+
}
|
|
45
|
+
function findStalledStage(stages, threshold) {
|
|
46
|
+
const maxSeq = maxCycleSequence(stages);
|
|
47
|
+
if (maxSeq === 0)
|
|
48
|
+
return undefined;
|
|
49
|
+
for (const stage of stages) {
|
|
50
|
+
if (stage.lastCycleSequence === undefined) {
|
|
51
|
+
// No events for this stage → stalled if other stages have progressed
|
|
52
|
+
if (maxSeq > 0)
|
|
53
|
+
return stage.stage;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
const gap = maxSeq - stage.lastCycleSequence;
|
|
57
|
+
if (gap >= threshold) {
|
|
58
|
+
return stage.stage;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
// ───────────────────────────────────────────────────────────────
|
|
64
|
+
// Public API
|
|
65
|
+
// ───────────────────────────────────────────────────────────────
|
|
66
|
+
export async function assembleLoopStatus(db, options) {
|
|
67
|
+
const threshold = options?.stallThresholdCycles ?? DEFAULT_STALL_THRESHOLD_CYCLES;
|
|
68
|
+
const limit = options?.limit ?? 100;
|
|
69
|
+
const cycleResult = await readHeartbeatCycleTraces(db, limit);
|
|
70
|
+
if (cycleResult.degraded) {
|
|
71
|
+
return cycleResult.degraded;
|
|
72
|
+
}
|
|
73
|
+
const cycles = cycleResult.rows;
|
|
74
|
+
if (cycles.length === 0) {
|
|
75
|
+
return {
|
|
76
|
+
overallStatus: "no_data",
|
|
77
|
+
lastCycleSequence: 0,
|
|
78
|
+
stages: [],
|
|
79
|
+
reason: "no heartbeat cycles recorded",
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const lastCycle = cycles[0];
|
|
83
|
+
// Gather stage health
|
|
84
|
+
const stages = [];
|
|
85
|
+
for (const stage of LOOP_STAGES) {
|
|
86
|
+
const eventResult = await readLoopStageEventsByStage(db, stage, limit);
|
|
87
|
+
if (eventResult.degraded) {
|
|
88
|
+
return eventResult.degraded;
|
|
89
|
+
}
|
|
90
|
+
const events = eventResult.rows;
|
|
91
|
+
const lastEvent = events[0];
|
|
92
|
+
stages.push({
|
|
93
|
+
stage,
|
|
94
|
+
lastEventAt: lastEvent?.occurredAt ?? undefined,
|
|
95
|
+
lastCycleSequence: lastEvent?.cycleSequence ?? undefined,
|
|
96
|
+
eventCount: events.length,
|
|
97
|
+
stalled: false, // computed below
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
const stalledAt = findStalledStage(stages, threshold);
|
|
101
|
+
// Mark stalled stages
|
|
102
|
+
for (const stage of stages) {
|
|
103
|
+
if (stalledAt === stage.stage) {
|
|
104
|
+
stage.stalled = true;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
const overallStatus = stalledAt
|
|
108
|
+
? "stalled"
|
|
109
|
+
: "healthy";
|
|
110
|
+
return {
|
|
111
|
+
overallStatus,
|
|
112
|
+
stalledAt,
|
|
113
|
+
lastCycleSequence: lastCycle.cycleSequence,
|
|
114
|
+
lastHeartbeatAt: lastCycle.heartbeatStartedAt,
|
|
115
|
+
stages,
|
|
116
|
+
reason: stalledAt ? `stage ${stalledAt} stalled for >=${threshold} cycles` : undefined,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiagnosticRedaction — Attribute sensitivity blocks and redact diagnostics.
|
|
3
|
+
*
|
|
4
|
+
* Core logic: Given a diagnostic payload, classify its sensitivity,
|
|
5
|
+
* redact credential-shaped values, preserve public technical summaries,
|
|
6
|
+
* and attribute the block to the responsible system.
|
|
7
|
+
*
|
|
8
|
+
* Design authority:
|
|
9
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/observability-health-system.detail.md §3.4`
|
|
10
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/observability-health-system.md §5`
|
|
11
|
+
*
|
|
12
|
+
* Dependencies:
|
|
13
|
+
* - `src/shared/types/v8-contracts.js` (SourceRef, RedactionClass, SensitivityClass)
|
|
14
|
+
*
|
|
15
|
+
* Boundary:
|
|
16
|
+
* - Pure function; no DB access.
|
|
17
|
+
* - Does not modify source data; returns redacted copy.
|
|
18
|
+
* - Public technical vocabulary is preserved.
|
|
19
|
+
*
|
|
20
|
+
* Test coverage: tests/unit/observability/diagnostic-redaction.test.ts
|
|
21
|
+
*/
|
|
22
|
+
import type { RedactionClass, SensitivityClass, V8ReasonCode } from "../shared/types/v8-contracts.js";
|
|
23
|
+
export interface DiagnosticPayload {
|
|
24
|
+
summary: string;
|
|
25
|
+
detail?: string;
|
|
26
|
+
sourceSystem: "perception" | "judgment" | "dream" | "policy" | "storage" | "unknown";
|
|
27
|
+
sensitivityHint?: SensitivityClass;
|
|
28
|
+
reasonCode?: V8ReasonCode;
|
|
29
|
+
}
|
|
30
|
+
export interface RedactedDiagnostic {
|
|
31
|
+
summary: string;
|
|
32
|
+
detail?: string;
|
|
33
|
+
redactionClass: RedactionClass;
|
|
34
|
+
attribution: string;
|
|
35
|
+
}
|
|
36
|
+
export type DiagnosticAttribution = "storage_validation_block" | "dream_redaction_block" | "perception_risk_block" | "policy_denial" | "credential_shape_detected" | "private_context" | "public_technical_preserved" | "no_redaction_needed";
|
|
37
|
+
/**
|
|
38
|
+
* Classify sensitivity-related diagnostic attribution based on source system
|
|
39
|
+
* and reason code. Maps to deterministic attribution categories per
|
|
40
|
+
* observability-health-system.detail.md §4.2.
|
|
41
|
+
*/
|
|
42
|
+
export declare function classifyDiagnosticAttribution(sourceSystem: DiagnosticPayload["sourceSystem"], reasonCode?: V8ReasonCode): DiagnosticAttribution;
|
|
43
|
+
export declare function projectDiagnosticRedaction(payload: DiagnosticPayload): RedactedDiagnostic;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiagnosticRedaction — Attribute sensitivity blocks and redact diagnostics.
|
|
3
|
+
*
|
|
4
|
+
* Core logic: Given a diagnostic payload, classify its sensitivity,
|
|
5
|
+
* redact credential-shaped values, preserve public technical summaries,
|
|
6
|
+
* and attribute the block to the responsible system.
|
|
7
|
+
*
|
|
8
|
+
* Design authority:
|
|
9
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/observability-health-system.detail.md §3.4`
|
|
10
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/observability-health-system.md §5`
|
|
11
|
+
*
|
|
12
|
+
* Dependencies:
|
|
13
|
+
* - `src/shared/types/v8-contracts.js` (SourceRef, RedactionClass, SensitivityClass)
|
|
14
|
+
*
|
|
15
|
+
* Boundary:
|
|
16
|
+
* - Pure function; no DB access.
|
|
17
|
+
* - Does not modify source data; returns redacted copy.
|
|
18
|
+
* - Public technical vocabulary is preserved.
|
|
19
|
+
*
|
|
20
|
+
* Test coverage: tests/unit/observability/diagnostic-redaction.test.ts
|
|
21
|
+
*/
|
|
22
|
+
// ───────────────────────────────────────────────────────────────
|
|
23
|
+
// Helpers
|
|
24
|
+
// ───────────────────────────────────────────────────────────────
|
|
25
|
+
function containsCredentialValue(text) {
|
|
26
|
+
// Match both key=value and Bearer token formats
|
|
27
|
+
return /\b(?:Bearer|token|secret|password|key|credential)\s*[:=\s]\s*[a-zA-Z0-9+/=_-]{8,}\b/i.test(text);
|
|
28
|
+
}
|
|
29
|
+
function containsPrivateMarker(text) {
|
|
30
|
+
return /\b(?:DM|private message|confidential|internal only)\b/i.test(text);
|
|
31
|
+
}
|
|
32
|
+
function redactCredentialValues(text) {
|
|
33
|
+
// Redact both key=value and Bearer token formats
|
|
34
|
+
return text.replace(/\b((?:Bearer|token|secret|password|key|credential)\s*[:=\s]\s*)[a-zA-Z0-9+/=_-]{8,}\b/gi, "$1[REDACTED]");
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Classify sensitivity-related diagnostic attribution based on source system
|
|
38
|
+
* and reason code. Maps to deterministic attribution categories per
|
|
39
|
+
* observability-health-system.detail.md §4.2.
|
|
40
|
+
*/
|
|
41
|
+
export function classifyDiagnosticAttribution(sourceSystem, reasonCode) {
|
|
42
|
+
// Storage validation blocks
|
|
43
|
+
if (reasonCode === "state_unreadable" || reasonCode === "quiet_validation_failed") {
|
|
44
|
+
return "storage_validation_block";
|
|
45
|
+
}
|
|
46
|
+
// Dream redaction blocks
|
|
47
|
+
if (reasonCode === "dream_blocked_redaction") {
|
|
48
|
+
return "dream_redaction_block";
|
|
49
|
+
}
|
|
50
|
+
// Perception risk blocks
|
|
51
|
+
if (reasonCode === "perception_rules_only" || reasonCode === "evidence_batch_truncated") {
|
|
52
|
+
return "perception_risk_block";
|
|
53
|
+
}
|
|
54
|
+
// Policy denial
|
|
55
|
+
if (reasonCode?.startsWith("policy_denied") || reasonCode === "policy_downgraded_to_draft") {
|
|
56
|
+
return "policy_denial";
|
|
57
|
+
}
|
|
58
|
+
return "no_redaction_needed";
|
|
59
|
+
}
|
|
60
|
+
// ───────────────────────────────────────────────────────────────
|
|
61
|
+
// Public API
|
|
62
|
+
// ───────────────────────────────────────────────────────────────
|
|
63
|
+
export function projectDiagnosticRedaction(payload) {
|
|
64
|
+
const summary = payload.summary;
|
|
65
|
+
const detail = payload.detail;
|
|
66
|
+
// Credential value shape → blocked
|
|
67
|
+
if (containsCredentialValue(summary) || (detail && containsCredentialValue(detail))) {
|
|
68
|
+
return {
|
|
69
|
+
summary: redactCredentialValues(summary),
|
|
70
|
+
detail: detail ? redactCredentialValues(detail) : undefined,
|
|
71
|
+
redactionClass: "blocked",
|
|
72
|
+
attribution: `${payload.sourceSystem}:credential_shape_detected`,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
// Classify attribution from source system + reason code
|
|
76
|
+
const attribution = classifyDiagnosticAttribution(payload.sourceSystem, payload.reasonCode);
|
|
77
|
+
// Private context → redacted
|
|
78
|
+
if (payload.sensitivityHint === "private_context" ||
|
|
79
|
+
containsPrivateMarker(summary) ||
|
|
80
|
+
(detail && containsPrivateMarker(detail))) {
|
|
81
|
+
return {
|
|
82
|
+
summary: "[redacted: private context]",
|
|
83
|
+
detail: undefined,
|
|
84
|
+
redactionClass: "redacted",
|
|
85
|
+
attribution: `${payload.sourceSystem}:${attribution}`,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
// Public technical → preserve with light redaction
|
|
89
|
+
if (payload.sensitivityHint === "public_technical") {
|
|
90
|
+
return {
|
|
91
|
+
summary,
|
|
92
|
+
detail,
|
|
93
|
+
redactionClass: "none",
|
|
94
|
+
attribution: `${payload.sourceSystem}:public_technical_preserved`,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
// Source-system-specific attribution for blocked/redacted cases
|
|
98
|
+
if (attribution !== "no_redaction_needed") {
|
|
99
|
+
const isBlocked = attribution === "policy_denial" || attribution === "dream_redaction_block";
|
|
100
|
+
return {
|
|
101
|
+
summary: isBlocked ? `[blocked: ${attribution.replace(/_/g, " ")}]` : summary,
|
|
102
|
+
detail: isBlocked ? undefined : detail,
|
|
103
|
+
redactionClass: isBlocked ? "blocked" : "redacted",
|
|
104
|
+
attribution: `${payload.sourceSystem}:${attribution}`,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
// Default: preserve
|
|
108
|
+
return {
|
|
109
|
+
summary,
|
|
110
|
+
detail,
|
|
111
|
+
redactionClass: "none",
|
|
112
|
+
attribution: `${payload.sourceSystem}:no_redaction_needed`,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LoopStageEventSink — v8 observability stage event recorder.
|
|
3
|
+
*
|
|
4
|
+
* Core logic: Validate, redact, and append LoopStageEvent rows.
|
|
5
|
+
* Malformed events produce degraded diagnostics without blocking the
|
|
6
|
+
* heartbeat main loop.
|
|
7
|
+
*
|
|
8
|
+
* Design authority:
|
|
9
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/observability-health-system.md §5`
|
|
10
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/observability-health-system.detail.md §3.1`
|
|
11
|
+
*
|
|
12
|
+
* Dependencies:
|
|
13
|
+
* - `src/storage/v8-state-stores.js` (writeLoopStageEvent)
|
|
14
|
+
* - `src/shared/types/v8-contracts.js` (LoopStageEvent, SourceRef, V8ReasonCode)
|
|
15
|
+
*
|
|
16
|
+
* Boundary:
|
|
17
|
+
* - Does NOT make semantic decisions about stage health.
|
|
18
|
+
* - Does NOT block callers on DB failure; returns degraded result.
|
|
19
|
+
* - Redacts credential-shaped values before persistence.
|
|
20
|
+
*
|
|
21
|
+
* Test coverage: tests/unit/observability/loop-stage-event-sink.test.ts
|
|
22
|
+
*/
|
|
23
|
+
import type { StateDatabase } from "../storage/db/index.js";
|
|
24
|
+
import type { LoopStageEvent, DegradedOperationResult } from "../shared/types/v8-contracts.js";
|
|
25
|
+
export interface RecordLoopStageEventOptions {
|
|
26
|
+
now?: string;
|
|
27
|
+
}
|
|
28
|
+
export type RecordLoopStageEventResult = {
|
|
29
|
+
ok: true;
|
|
30
|
+
id: string;
|
|
31
|
+
} | {
|
|
32
|
+
ok: false;
|
|
33
|
+
degraded: DegradedOperationResult;
|
|
34
|
+
};
|
|
35
|
+
export declare function recordLoopStageEvent(db: StateDatabase, event: Partial<LoopStageEvent>, options?: RecordLoopStageEventOptions): Promise<RecordLoopStageEventResult>;
|
|
36
|
+
export interface BatchRecordResult {
|
|
37
|
+
succeeded: string[];
|
|
38
|
+
failed: {
|
|
39
|
+
id?: string;
|
|
40
|
+
degraded: DegradedOperationResult;
|
|
41
|
+
}[];
|
|
42
|
+
}
|
|
43
|
+
export declare function recordLoopStageEvents(db: StateDatabase, events: Partial<LoopStageEvent>[], options?: RecordLoopStageEventOptions): Promise<BatchRecordResult>;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LoopStageEventSink — v8 observability stage event recorder.
|
|
3
|
+
*
|
|
4
|
+
* Core logic: Validate, redact, and append LoopStageEvent rows.
|
|
5
|
+
* Malformed events produce degraded diagnostics without blocking the
|
|
6
|
+
* heartbeat main loop.
|
|
7
|
+
*
|
|
8
|
+
* Design authority:
|
|
9
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/observability-health-system.md §5`
|
|
10
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/observability-health-system.detail.md §3.1`
|
|
11
|
+
*
|
|
12
|
+
* Dependencies:
|
|
13
|
+
* - `src/storage/v8-state-stores.js` (writeLoopStageEvent)
|
|
14
|
+
* - `src/shared/types/v8-contracts.js` (LoopStageEvent, SourceRef, V8ReasonCode)
|
|
15
|
+
*
|
|
16
|
+
* Boundary:
|
|
17
|
+
* - Does NOT make semantic decisions about stage health.
|
|
18
|
+
* - Does NOT block callers on DB failure; returns degraded result.
|
|
19
|
+
* - Redacts credential-shaped values before persistence.
|
|
20
|
+
*
|
|
21
|
+
* Test coverage: tests/unit/observability/loop-stage-event-sink.test.ts
|
|
22
|
+
*/
|
|
23
|
+
import { writeLoopStageEvent } from "../storage/v8-state-stores.js";
|
|
24
|
+
function validateEvent(event) {
|
|
25
|
+
if (!event.cycleId || event.cycleId.trim().length === 0) {
|
|
26
|
+
return { ok: false, reason: "cycle_id_required", field: "cycleId" };
|
|
27
|
+
}
|
|
28
|
+
if (!event.stage || event.stage.trim().length === 0) {
|
|
29
|
+
return { ok: false, reason: "stage_required", field: "stage" };
|
|
30
|
+
}
|
|
31
|
+
if (!event.status || event.status.trim().length === 0) {
|
|
32
|
+
return { ok: false, reason: "status_required", field: "status" };
|
|
33
|
+
}
|
|
34
|
+
if (!event.occurredAt || event.occurredAt.trim().length === 0) {
|
|
35
|
+
return { ok: false, reason: "occurred_at_required", field: "occurredAt" };
|
|
36
|
+
}
|
|
37
|
+
const validStages = [
|
|
38
|
+
"ingestion",
|
|
39
|
+
"perception",
|
|
40
|
+
"judgment",
|
|
41
|
+
"policy",
|
|
42
|
+
"execution",
|
|
43
|
+
"closure",
|
|
44
|
+
"quiet",
|
|
45
|
+
"dream",
|
|
46
|
+
"projection",
|
|
47
|
+
];
|
|
48
|
+
if (!validStages.includes(event.stage)) {
|
|
49
|
+
return { ok: false, reason: "stage_invalid", field: "stage" };
|
|
50
|
+
}
|
|
51
|
+
const validStatuses = [
|
|
52
|
+
"started",
|
|
53
|
+
"completed",
|
|
54
|
+
"skipped",
|
|
55
|
+
"blocked",
|
|
56
|
+
"failed",
|
|
57
|
+
];
|
|
58
|
+
if (!validStatuses.includes(event.status)) {
|
|
59
|
+
return { ok: false, reason: "status_invalid", field: "status" };
|
|
60
|
+
}
|
|
61
|
+
return { ok: true };
|
|
62
|
+
}
|
|
63
|
+
// ───────────────────────────────────────────────────────────────
|
|
64
|
+
// Redaction
|
|
65
|
+
// ───────────────────────────────────────────────────────────────
|
|
66
|
+
function redactSourceRefs(refs) {
|
|
67
|
+
let hasRedacted = false;
|
|
68
|
+
let hasBlocked = false;
|
|
69
|
+
const redacted = refs.map((ref) => {
|
|
70
|
+
if (ref.sensitivityClass === "sensitive") {
|
|
71
|
+
hasBlocked = true;
|
|
72
|
+
return {
|
|
73
|
+
...ref,
|
|
74
|
+
redactionClass: "blocked",
|
|
75
|
+
resolveStatus: "redacted",
|
|
76
|
+
resolveFailureReason: "sensitivity_class_blocked",
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
if (ref.sensitivityClass === "private_context") {
|
|
80
|
+
hasRedacted = true;
|
|
81
|
+
return {
|
|
82
|
+
...ref,
|
|
83
|
+
redactionClass: "redacted",
|
|
84
|
+
resolveStatus: "redacted",
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
return ref;
|
|
88
|
+
});
|
|
89
|
+
const redactionClass = hasBlocked
|
|
90
|
+
? "blocked"
|
|
91
|
+
: hasRedacted
|
|
92
|
+
? "redacted"
|
|
93
|
+
: "none";
|
|
94
|
+
return { redacted, redactionClass };
|
|
95
|
+
}
|
|
96
|
+
// ───────────────────────────────────────────────────────────────
|
|
97
|
+
// Public API
|
|
98
|
+
// ───────────────────────────────────────────────────────────────
|
|
99
|
+
export async function recordLoopStageEvent(db, event, options) {
|
|
100
|
+
const validation = validateEvent(event);
|
|
101
|
+
if (!validation.ok) {
|
|
102
|
+
const degraded = {
|
|
103
|
+
status: "degraded",
|
|
104
|
+
reason: "stage_event_missing",
|
|
105
|
+
ownerStage: event.stage || "ingestion",
|
|
106
|
+
sourceRefs: event.sourceRefs || [],
|
|
107
|
+
operatorNextAction: `Fix missing ${validation.field} in stage event`,
|
|
108
|
+
retryable: false,
|
|
109
|
+
};
|
|
110
|
+
return { ok: false, degraded };
|
|
111
|
+
}
|
|
112
|
+
const now = options?.now ?? new Date().toISOString();
|
|
113
|
+
const sourceRefs = event.sourceRefs ?? [];
|
|
114
|
+
const { redacted: redactedRefs, redactionClass } = redactSourceRefs(sourceRefs);
|
|
115
|
+
const record = {
|
|
116
|
+
id: event.id ?? `evt_${now.replace(/[:.]/g, "")}_${event.cycleId}_${event.stage}`,
|
|
117
|
+
cycleId: event.cycleId,
|
|
118
|
+
cycleSequence: event.cycleSequence ?? 0,
|
|
119
|
+
stage: event.stage,
|
|
120
|
+
status: event.status,
|
|
121
|
+
reason: event.reason,
|
|
122
|
+
sourceRefs: redactedRefs,
|
|
123
|
+
redactionClass,
|
|
124
|
+
occurredAt: event.occurredAt,
|
|
125
|
+
expectedDownstreamByCycle: event.expectedDownstreamByCycle,
|
|
126
|
+
payloadJson: event.payloadJson ?? null,
|
|
127
|
+
lifecycleStatus: "completed",
|
|
128
|
+
};
|
|
129
|
+
const result = await writeLoopStageEvent(db, record);
|
|
130
|
+
if ("id" in result) {
|
|
131
|
+
return { ok: true, id: result.id };
|
|
132
|
+
}
|
|
133
|
+
return { ok: false, degraded: result };
|
|
134
|
+
}
|
|
135
|
+
export async function recordLoopStageEvents(db, events, options) {
|
|
136
|
+
const succeeded = [];
|
|
137
|
+
const failed = [];
|
|
138
|
+
for (const event of events) {
|
|
139
|
+
const result = await recordLoopStageEvent(db, event, options);
|
|
140
|
+
if (result.ok) {
|
|
141
|
+
succeeded.push(result.id);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
failed.push({ id: event.id ?? "unknown", degraded: result.degraded });
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return { succeeded, failed };
|
|
148
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LoopStatus — Expose loop health and stalled stage diagnostics.
|
|
3
|
+
*
|
|
4
|
+
* Core logic: Call assembleLoopStatus, format into v8 loop_status shape,
|
|
5
|
+
* and include policy-denied closure counts.
|
|
6
|
+
*
|
|
7
|
+
* Design authority:
|
|
8
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/observability-health-system.md §5`
|
|
9
|
+
* - `.anws/v8/04_SYSTEM_DESIGN/runtime-ops-system.md`
|
|
10
|
+
*
|
|
11
|
+
* Dependencies:
|
|
12
|
+
* - `src/observability/causal-loop-health.js` (assembleLoopStatus)
|
|
13
|
+
* - `src/storage/v8-state-stores.js` (readLoopStageEventsByStage)
|
|
14
|
+
*
|
|
15
|
+
* Boundary:
|
|
16
|
+
* - Read-only diagnostic query; does not modify state.
|
|
17
|
+
* - Returns degraded envelope when state unreadable.
|
|
18
|
+
*
|
|
19
|
+
* Test coverage: tests/unit/observability/loop-status.test.ts
|
|
20
|
+
*/
|
|
21
|
+
import type { StateDatabase } from "../storage/db/index.js";
|
|
22
|
+
import type { DegradedOperationResult } from "../shared/types/v8-contracts.js";
|
|
23
|
+
export interface LoopStatusReadModel {
|
|
24
|
+
ok: true;
|
|
25
|
+
overallStatus: string;
|
|
26
|
+
stalledAt?: string;
|
|
27
|
+
lastCycleSequence: number;
|
|
28
|
+
lastHeartbeatAt?: string;
|
|
29
|
+
stageSummaries: StageSummary[];
|
|
30
|
+
policyDeniedCount: number;
|
|
31
|
+
nextAction: string;
|
|
32
|
+
}
|
|
33
|
+
export interface StageSummary {
|
|
34
|
+
stage: string;
|
|
35
|
+
eventCount: number;
|
|
36
|
+
stalled: boolean;
|
|
37
|
+
lastEventAt?: string;
|
|
38
|
+
}
|
|
39
|
+
export type LoopStatusResult = {
|
|
40
|
+
ok: true;
|
|
41
|
+
status: LoopStatusReadModel;
|
|
42
|
+
} | {
|
|
43
|
+
ok: false;
|
|
44
|
+
degraded: DegradedOperationResult;
|
|
45
|
+
};
|
|
46
|
+
export declare function readLoopStatus(db: StateDatabase): Promise<LoopStatusResult>;
|