@haaaiawd/second-nature 0.1.43 → 0.1.50
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/HEARTBEAT.md +44 -0
- package/LICENSE +176 -0
- package/README.md +136 -0
- package/README.zh-CN.md +120 -0
- package/SKILL.md +320 -22
- package/dist/data/observability.db +0 -0
- package/dist/data/state.db +0 -0
- package/dist/plugin/index.d.ts +31 -0
- package/dist/plugin/workspace-ops-bridge.d.ts +15 -0
- package/dist/scripts/build-plugin-package.d.ts +12 -0
- package/dist/scripts/build-plugin-package.js +220 -0
- package/dist/scripts/build-plugin-runtime.d.ts +10 -0
- package/dist/scripts/build-plugin-runtime.js +198 -0
- package/dist/scripts/packaging-feasibility-poc.js +127 -0
- package/dist/scripts/plugin-smoke-check.js +124 -0
- package/dist/src/cli/action-bridge.d.ts +11 -0
- package/dist/src/cli/index.d.ts +65 -0
- package/dist/src/cli/ops/heartbeat-surface.d.ts +84 -0
- package/dist/src/cli/ops/heartbeat-surface.js +100 -0
- package/dist/src/cli/ops/ops-router.js +1482 -0
- package/dist/src/cli/ops/workspace-heartbeat-runner.d.ts +85 -0
- package/dist/src/cli/ops/workspace-heartbeat-runner.js +242 -0
- package/dist/src/core/second-nature/heartbeat/goal-lifecycle-policy.d.ts +24 -0
- package/dist/src/core/second-nature/heartbeat/goal-lifecycle-policy.js +61 -0
- package/dist/src/core/second-nature/heartbeat/heartbeat-loop.d.ts +97 -0
- package/dist/src/core/second-nature/heartbeat/heartbeat-loop.js +397 -0
- package/dist/src/core/second-nature/orchestrator/platform-capability-router.js +149 -0
- package/dist/src/storage/snapshots/types.js +1 -0
- package/dist/src/storage/user-interest/types.js +1 -0
- package/dist/tests/integration/cli/cli-ops-surface.test.d.ts +1 -0
- package/dist/tests/integration/cli/cli-ops-surface.test.js +380 -0
- package/dist/tests/integration/cli/heartbeat-surface-workspace.test.d.ts +1 -0
- package/dist/tests/integration/cli/heartbeat-surface-workspace.test.js +61 -0
- package/dist/tests/integration/cli/host-capability-probe.test.d.ts +1 -0
- package/dist/tests/integration/cli/host-capability-probe.test.js +37 -0
- package/dist/tests/integration/cli/host-smoke-heartbeat-tool.test.d.ts +1 -0
- package/dist/tests/integration/cli/host-smoke-heartbeat-tool.test.js +34 -0
- package/dist/tests/integration/cli/plugin-packaging-walkthrough.test.d.ts +1 -0
- package/dist/tests/integration/cli/plugin-packaging-walkthrough.test.js +79 -0
- package/dist/tests/integration/cli/plugin-runtime-registration.test.d.ts +1 -0
- package/dist/tests/integration/cli/plugin-runtime-registration.test.js +285 -0
- package/dist/tests/integration/cli/plugin-workspace-ops-bridge.test.d.ts +1 -0
- package/dist/tests/integration/cli/plugin-workspace-ops-bridge.test.js +487 -0
- package/dist/tests/integration/cli/t1-2-1-explain-read-models.test.d.ts +1 -0
- package/dist/tests/integration/cli/t1-2-1-explain-read-models.test.js +58 -0
- package/dist/tests/integration/cli/t1-2-1-narrative-command.test.d.ts +1 -0
- package/dist/tests/integration/cli/t1-2-1-narrative-command.test.js +194 -0
- package/dist/tests/integration/cli/t1-2-2-dream-recent.test.d.ts +1 -0
- package/dist/tests/integration/cli/t1-2-2-dream-recent.test.js +100 -0
- package/dist/tests/integration/cli/t1-2-3-status-observability-writeback.test.d.ts +1 -0
- package/dist/tests/integration/cli/t1-2-3-status-observability-writeback.test.js +71 -0
- package/dist/tests/integration/cli/t1-2-4-quiet-report-read-canonical.test.d.ts +1 -0
- package/dist/tests/integration/cli/t1-2-4-quiet-report-read-canonical.test.js +206 -0
- package/dist/tests/integration/cli/t1-2-5-cycle-recent.test.d.ts +1 -0
- package/dist/tests/integration/cli/t1-2-5-cycle-recent.test.js +156 -0
- package/dist/tests/integration/cli/t1-2-5-status-delivery-posture-audit-store.test.d.ts +1 -0
- package/dist/tests/integration/cli/t1-2-5-status-delivery-posture-audit-store.test.js +95 -0
- package/dist/tests/integration/cli/t1-2-6-policy-show-non-shell.test.d.ts +1 -0
- package/dist/tests/integration/cli/t1-2-6-policy-show-non-shell.test.js +74 -0
- package/dist/tests/integration/cli/t1-2-6-status-aggregate.test.d.ts +1 -0
- package/dist/tests/integration/cli/t1-2-6-status-aggregate.test.js +223 -0
- package/dist/tests/integration/cli/t1-2-7-audit-command-minimal-closure.test.d.ts +1 -0
- package/dist/tests/integration/cli/t1-2-7-audit-command-minimal-closure.test.js +101 -0
- package/dist/tests/integration/cli/t1-2-8-capability-probe-ops-surface.test.d.ts +1 -0
- package/dist/tests/integration/cli/t1-2-8-capability-probe-ops-surface.test.js +74 -0
- package/dist/tests/integration/cli/t1-2-9-decision-denied-not-degraded.test.d.ts +1 -0
- package/dist/tests/integration/cli/t1-2-9-decision-denied-not-degraded.test.js +79 -0
- package/dist/tests/integration/cli/t1-4-1-runtime-secret-bootstrap.test.d.ts +1 -0
- package/dist/tests/integration/cli/t1-4-1-runtime-secret-bootstrap.test.js +139 -0
- package/dist/tests/integration/cli/t1-4-2-activation-ux-contract.test.d.ts +1 -0
- package/dist/tests/integration/cli/t1-4-2-activation-ux-contract.test.js +143 -0
- package/dist/tests/integration/cli/t2-2-2-snapshot-life-evidence.test.d.ts +1 -0
- package/dist/tests/integration/cli/t2-2-2-snapshot-life-evidence.test.js +116 -0
- package/dist/tests/integration/cli/t3-3-2-near-real-smoke-cli-bridge.test.d.ts +1 -0
- package/dist/tests/integration/cli/t3-3-2-near-real-smoke-cli-bridge.test.js +69 -0
- package/dist/tests/integration/connectors/connector-base.test.d.ts +1 -0
- package/dist/tests/integration/connectors/connector-base.test.js +211 -0
- package/dist/tests/integration/connectors/connector-executor-adapter-honest-failure.test.d.ts +1 -0
- package/dist/tests/integration/connectors/connector-executor-adapter-honest-failure.test.js +311 -0
- package/dist/tests/integration/connectors/credential-optional-regression.test.d.ts +1 -0
- package/dist/tests/integration/connectors/credential-optional-regression.test.js +117 -0
- package/dist/tests/integration/connectors/declarative-http-runner.test.d.ts +7 -0
- package/dist/tests/integration/connectors/declarative-http-runner.test.js +229 -0
- package/dist/tests/integration/connectors/evomap-secret-port.test.d.ts +1 -0
- package/dist/tests/integration/connectors/evomap-secret-port.test.js +83 -0
- package/dist/tests/integration/connectors/life-evidence-chain.test.d.ts +1 -0
- package/dist/tests/integration/connectors/life-evidence-chain.test.js +188 -0
- package/dist/tests/integration/connectors/moltbook-client.test.d.ts +1 -0
- package/dist/tests/integration/connectors/moltbook-client.test.js +274 -0
- package/dist/tests/integration/connectors/moltbook-mock-runner.test.d.ts +7 -0
- package/dist/tests/integration/connectors/moltbook-mock-runner.test.js +108 -0
- package/dist/tests/integration/connectors/near-real-connector-smoke.test.d.ts +1 -0
- package/dist/tests/integration/connectors/near-real-connector-smoke.test.js +38 -0
- package/dist/tests/integration/connectors/platform-adapters.test.d.ts +1 -0
- package/dist/tests/integration/connectors/platform-adapters.test.js +189 -0
- package/dist/tests/integration/connectors/policy-layer.test.d.ts +1 -0
- package/dist/tests/integration/connectors/policy-layer.test.js +249 -0
- package/dist/tests/integration/connectors/scriptable-node-e2e.test.d.ts +1 -0
- package/dist/tests/integration/connectors/scriptable-node-e2e.test.js +228 -0
- package/dist/tests/integration/connectors/t3-3-1-real-connector-evidence.test.d.ts +1 -0
- package/dist/tests/integration/connectors/t3-3-1-real-connector-evidence.test.js +171 -0
- package/dist/tests/integration/control-plane/_helpers/decision-cycle-harness.d.ts +40 -0
- package/dist/tests/integration/control-plane/_helpers/decision-cycle-harness.js +116 -0
- package/dist/tests/integration/control-plane/decision-loop-validation.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/decision-loop-validation.test.js +319 -0
- package/dist/tests/integration/control-plane/delivery-failed-fallback.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/delivery-failed-fallback.test.js +118 -0
- package/dist/tests/integration/control-plane/dream-projection-heartbeat.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/dream-projection-heartbeat.test.js +109 -0
- package/dist/tests/integration/control-plane/effect-dispatcher.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/effect-dispatcher.test.js +157 -0
- package/dist/tests/integration/control-plane/guidance-request.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/guidance-request.test.js +63 -0
- package/dist/tests/integration/control-plane/heartbeat-executor.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/heartbeat-executor.test.js +363 -0
- package/dist/tests/integration/control-plane/heartbeat-loop.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/heartbeat-loop.test.js +190 -0
- package/dist/tests/integration/control-plane/heartbeat-quiet-orchestration.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/heartbeat-quiet-orchestration.test.js +133 -0
- package/dist/tests/integration/control-plane/heartbeat-spine-integration.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/heartbeat-spine-integration.test.js +342 -0
- package/dist/tests/integration/control-plane/heartbeat-spine.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/heartbeat-spine.test.js +216 -0
- package/dist/tests/integration/control-plane/int-s3-outreach-delivery-quiet-closure.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/int-s3-outreach-delivery-quiet-closure.test.js +241 -0
- package/dist/tests/integration/control-plane/outreach-resume.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/outreach-resume.test.js +158 -0
- package/dist/tests/integration/control-plane/outreach-style.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/outreach-style.test.js +46 -0
- package/dist/tests/integration/control-plane/quiet-reflection.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/quiet-reflection.test.js +73 -0
- package/dist/tests/integration/control-plane/rhythm-intent-guard.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/rhythm-intent-guard.test.js +99 -0
- package/dist/tests/integration/control-plane/run-heartbeat-cycle.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/run-heartbeat-cycle.test.js +80 -0
- package/dist/tests/integration/control-plane/t2-3-1-outreach-v6.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/t2-3-1-outreach-v6.test.js +208 -0
- package/dist/tests/integration/control-plane/t2-4-1-heartbeat-platform-intent.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/t2-4-1-heartbeat-platform-intent.test.js +156 -0
- package/dist/tests/integration/control-plane/t2-4-2-source-backed-outreach-loop.test.d.ts +1 -0
- package/dist/tests/integration/control-plane/t2-4-2-source-backed-outreach-loop.test.js +188 -0
- package/dist/tests/integration/control-plane/v7c-evidence-body-feedback.test.d.ts +11 -0
- package/dist/tests/integration/control-plane/v7c-evidence-body-feedback.test.js +213 -0
- package/dist/tests/integration/control-plane/v7c-heartbeat-unlock-e2e.test.d.ts +9 -0
- package/dist/tests/integration/control-plane/v7c-heartbeat-unlock-e2e.test.js +134 -0
- package/dist/tests/integration/dream/quiet-dream-trigger.test.d.ts +1 -0
- package/dist/tests/integration/dream/quiet-dream-trigger.test.js +86 -0
- package/dist/tests/integration/dream/t7-1-1-dream-pipeline.test.d.ts +1 -0
- package/dist/tests/integration/dream/t7-1-1-dream-pipeline.test.js +378 -0
- package/dist/tests/integration/dream/t7-1-2-dream-scheduler.test.d.ts +1 -0
- package/dist/tests/integration/dream/t7-1-2-dream-scheduler.test.js +124 -0
- package/dist/tests/integration/dream/v7c-rhythm-loop.test.d.ts +10 -0
- package/dist/tests/integration/dream/v7c-rhythm-loop.test.js +185 -0
- package/dist/tests/integration/guidance/assembler-and-fallback.test.d.ts +1 -0
- package/dist/tests/integration/guidance/assembler-and-fallback.test.js +86 -0
- package/dist/tests/integration/guidance/outreach-draft-contract.test.d.ts +1 -0
- package/dist/tests/integration/guidance/outreach-draft-contract.test.js +106 -0
- package/dist/tests/integration/guidance/persona-selection.test.d.ts +1 -0
- package/dist/tests/integration/guidance/persona-selection.test.js +70 -0
- package/dist/tests/integration/guidance/template-review.test.d.ts +1 -0
- package/dist/tests/integration/guidance/template-review.test.js +26 -0
- package/dist/tests/integration/guidance/user-reply-continuity.test.d.ts +1 -0
- package/dist/tests/integration/guidance/user-reply-continuity.test.js +96 -0
- package/dist/tests/integration/guidance/v7c-guidance-chain.test.d.ts +1 -0
- package/dist/tests/integration/guidance/v7c-guidance-chain.test.js +190 -0
- package/dist/tests/integration/guidance/v7c-guidance-semantics.test.d.ts +1 -0
- package/dist/tests/integration/guidance/v7c-guidance-semantics.test.js +146 -0
- package/dist/tests/integration/observability/digest-delivery.test.d.ts +14 -0
- package/dist/tests/integration/observability/digest-delivery.test.js +160 -0
- package/dist/tests/integration/observability/evidence-query-engine.test.d.ts +1 -0
- package/dist/tests/integration/observability/evidence-query-engine.test.js +219 -0
- package/dist/tests/integration/observability/explain-query-export.test.d.ts +1 -0
- package/dist/tests/integration/observability/explain-query-export.test.js +92 -0
- package/dist/tests/integration/observability/guidance-audit.test.d.ts +1 -0
- package/dist/tests/integration/observability/guidance-audit.test.js +55 -0
- package/dist/tests/integration/observability/heartbeat-decision-record.test.d.ts +1 -0
- package/dist/tests/integration/observability/heartbeat-decision-record.test.js +223 -0
- package/dist/tests/integration/observability/heartbeat-narrative-trace.test.d.ts +1 -0
- package/dist/tests/integration/observability/heartbeat-narrative-trace.test.js +230 -0
- package/dist/tests/integration/observability/lived-experience-audit-chain.test.d.ts +1 -0
- package/dist/tests/integration/observability/lived-experience-audit-chain.test.js +43 -0
- package/dist/tests/integration/observability/observability-gates.test.d.ts +1 -0
- package/dist/tests/integration/observability/observability-gates.test.js +224 -0
- package/dist/tests/integration/observability/observability-retention-cleanup.test.d.ts +1 -0
- package/dist/tests/integration/observability/observability-retention-cleanup.test.js +94 -0
- package/dist/tests/integration/observability/observability-services.test.d.ts +1 -0
- package/dist/tests/integration/observability/observability-services.test.js +219 -0
- package/dist/tests/integration/observability/projections.test.d.ts +1 -0
- package/dist/tests/integration/observability/projections.test.js +36 -0
- package/dist/tests/integration/observability/t5-1-1-dream-trace-audit.test.d.ts +1 -0
- package/dist/tests/integration/observability/t5-1-1-dream-trace-audit.test.js +115 -0
- package/dist/tests/integration/plugin/plugin-registration.test.d.ts +16 -0
- package/dist/tests/integration/plugin/plugin-registration.test.js +151 -0
- package/dist/tests/integration/runtime-ops/commands.test.d.ts +16 -0
- package/dist/tests/integration/runtime-ops/commands.test.js +662 -0
- package/dist/tests/integration/s3-exit/int-s3-body-heartbeat.test.d.ts +15 -0
- package/dist/tests/integration/s3-exit/int-s3-body-heartbeat.test.js +462 -0
- package/dist/tests/integration/s5-exit/int-s5-observability.test.d.ts +17 -0
- package/dist/tests/integration/s5-exit/int-s5-observability.test.js +402 -0
- package/dist/tests/integration/state/t4-2-1-owner-reply-relationship-loop.test.d.ts +1 -0
- package/dist/tests/integration/state/t4-2-1-owner-reply-relationship-loop.test.js +132 -0
- package/dist/tests/integration/state/v7c-identity-goal-hygiene.test.d.ts +9 -0
- package/dist/tests/integration/state/v7c-identity-goal-hygiene.test.js +240 -0
- package/dist/tests/integration/storage/packaged-runtime-smoke.test.d.ts +1 -0
- package/dist/tests/integration/storage/packaged-runtime-smoke.test.js +17 -0
- package/dist/tests/integration/storage/persona-candidate-loader.test.d.ts +1 -0
- package/dist/tests/integration/storage/persona-candidate-loader.test.js +23 -0
- package/dist/tests/integration/storage/quiet-artifact-writer.test.d.ts +1 -0
- package/dist/tests/integration/storage/quiet-artifact-writer.test.js +66 -0
- package/dist/tests/integration/storage/repair-and-backup.test.d.ts +1 -0
- package/dist/tests/integration/storage/repair-and-backup.test.js +125 -0
- package/dist/tests/integration/storage/schema-migration.test.d.ts +11 -0
- package/dist/tests/integration/storage/schema-migration.test.js +183 -0
- package/dist/tests/integration/storage/storage-mode-smoke.test.d.ts +1 -0
- package/dist/tests/integration/storage/storage-mode-smoke.test.js +18 -0
- package/dist/tests/integration/storage/t4-1-5-memory-store-lifecycle.test.d.ts +1 -0
- package/dist/tests/integration/storage/t4-1-5-memory-store-lifecycle.test.js +118 -0
- package/dist/tests/unit/body/affordance-assembler.test.d.ts +14 -0
- package/dist/tests/unit/body/affordance-assembler.test.js +259 -0
- package/dist/tests/unit/body/affordance-context-scope.test.d.ts +12 -0
- package/dist/tests/unit/body/affordance-context-scope.test.js +73 -0
- package/dist/tests/unit/body/behavior-promotion-loop.test.d.ts +15 -0
- package/dist/tests/unit/body/behavior-promotion-loop.test.js +130 -0
- package/dist/tests/unit/body/circuit-breaker-manager.test.d.ts +13 -0
- package/dist/tests/unit/body/circuit-breaker-manager.test.js +160 -0
- package/dist/tests/unit/body/experience-writer.test.d.ts +11 -0
- package/dist/tests/unit/body/experience-writer.test.js +77 -0
- package/dist/tests/unit/body/pain-signal-query.test.d.ts +11 -0
- package/dist/tests/unit/body/pain-signal-query.test.js +104 -0
- package/dist/tests/unit/cli/connector-init-manifest.test.d.ts +9 -0
- package/dist/tests/unit/cli/connector-init-manifest.test.js +68 -0
- package/dist/tests/unit/cli/delivery-target-probe.test.d.ts +1 -0
- package/dist/tests/unit/cli/delivery-target-probe.test.js +108 -0
- package/dist/tests/unit/cli/host-capability.test.d.ts +1 -0
- package/dist/tests/unit/cli/host-capability.test.js +50 -0
- package/dist/tests/unit/cli/operator-fallback-view.test.d.ts +1 -0
- package/dist/tests/unit/cli/operator-fallback-view.test.js +60 -0
- package/dist/tests/unit/cli/runtime-artifact-boundary.test.d.ts +1 -0
- package/dist/tests/unit/cli/runtime-artifact-boundary.test.js +57 -0
- package/dist/tests/unit/cli/t1-2-3-connector-status.test.d.ts +1 -0
- package/dist/tests/unit/cli/t1-2-3-connector-status.test.js +214 -0
- package/dist/tests/unit/cli/t1-2-4-goal-command.test.d.ts +1 -0
- package/dist/tests/unit/cli/t1-2-4-goal-command.test.js +207 -0
- package/dist/tests/unit/cli/t1-3-1-connector-init.test.d.ts +1 -0
- package/dist/tests/unit/cli/t1-3-1-connector-init.test.js +212 -0
- package/dist/tests/unit/connectors/connector-manifest-and-evidence-map.test.d.ts +1 -0
- package/dist/tests/unit/connectors/connector-manifest-and-evidence-map.test.js +71 -0
- package/dist/tests/unit/connectors/effect-commit-ledger-sqlite.test.d.ts +10 -0
- package/dist/tests/unit/connectors/effect-commit-ledger-sqlite.test.js +101 -0
- package/dist/tests/unit/connectors/evomap-runner.test.d.ts +1 -0
- package/dist/tests/unit/connectors/evomap-runner.test.js +136 -0
- package/dist/tests/unit/connectors/execution-policy.test.d.ts +1 -0
- package/dist/tests/unit/connectors/execution-policy.test.js +71 -0
- package/dist/tests/unit/connectors/instreet-registration.test.d.ts +1 -0
- package/dist/tests/unit/connectors/instreet-registration.test.js +102 -0
- package/dist/tests/unit/connectors/manifest-v7-schema.test.d.ts +9 -0
- package/dist/tests/unit/connectors/manifest-v7-schema.test.js +165 -0
- package/dist/tests/unit/connectors/scriptable-node-runner.test.d.ts +1 -0
- package/dist/tests/unit/connectors/scriptable-node-runner.test.js +246 -0
- package/dist/tests/unit/connectors/structured-unavailable-reason.test.d.ts +11 -0
- package/dist/tests/unit/connectors/structured-unavailable-reason.test.js +76 -0
- package/dist/tests/unit/connectors/t3-1-1-dynamic-registry.test.d.ts +1 -0
- package/dist/tests/unit/connectors/t3-1-1-dynamic-registry.test.js +178 -0
- package/dist/tests/unit/connectors/t3-1-2-capability-registry.test.d.ts +1 -0
- package/dist/tests/unit/connectors/t3-1-2-capability-registry.test.js +105 -0
- package/dist/tests/unit/connectors/t3-2-1-v5-parity.test.d.ts +1 -0
- package/dist/tests/unit/connectors/t3-2-1-v5-parity.test.js +103 -0
- package/dist/tests/unit/connectors/t3-3-1-evidence-mapper.test.d.ts +1 -0
- package/dist/tests/unit/connectors/t3-3-1-evidence-mapper.test.js +198 -0
- package/dist/tests/unit/connectors/t3-3-1-evidence-redaction.test.d.ts +1 -0
- package/dist/tests/unit/connectors/t3-3-1-evidence-redaction.test.js +95 -0
- package/dist/tests/unit/connectors/wet-probe-runner.test.d.ts +11 -0
- package/dist/tests/unit/connectors/wet-probe-runner.test.js +84 -0
- package/dist/tests/unit/control-plane/decision-trace-emitter.test.d.ts +1 -0
- package/dist/tests/unit/control-plane/decision-trace-emitter.test.js +51 -0
- package/dist/tests/unit/control-plane/downstream-intent-orchestrator.test.d.ts +1 -0
- package/dist/tests/unit/control-plane/downstream-intent-orchestrator.test.js +57 -0
- package/dist/tests/unit/control-plane/embodied-context-assembler.test.d.ts +13 -0
- package/dist/tests/unit/control-plane/embodied-context-assembler.test.js +182 -0
- package/dist/tests/unit/control-plane/goal-lifecycle-policy.test.d.ts +1 -0
- package/dist/tests/unit/control-plane/goal-lifecycle-policy.test.js +75 -0
- package/dist/tests/unit/control-plane/hard-guard-evaluator.test.d.ts +1 -0
- package/dist/tests/unit/control-plane/hard-guard-evaluator.test.js +113 -0
- package/dist/tests/unit/control-plane/idle-curiosity-policy.test.d.ts +1 -0
- package/dist/tests/unit/control-plane/idle-curiosity-policy.test.js +69 -0
- package/dist/tests/unit/control-plane/intent-planner-source-ref-fallback.test.d.ts +7 -0
- package/dist/tests/unit/control-plane/intent-planner-source-ref-fallback.test.js +124 -0
- package/dist/tests/unit/control-plane/rhythm-policy-snapshot-window.test.d.ts +1 -0
- package/dist/tests/unit/control-plane/rhythm-policy-snapshot-window.test.js +64 -0
- package/dist/tests/unit/control-plane/run-heartbeat-cycle-v7.test.d.ts +1 -0
- package/dist/tests/unit/control-plane/run-heartbeat-cycle-v7.test.js +165 -0
- package/dist/tests/unit/control-plane/t2-1-4-goal-priority.test.d.ts +1 -0
- package/dist/tests/unit/control-plane/t2-1-4-goal-priority.test.js +185 -0
- package/dist/tests/unit/control-plane/t2-1-5-narrative-update.test.d.ts +1 -0
- package/dist/tests/unit/control-plane/t2-1-5-narrative-update.test.js +313 -0
- package/dist/tests/unit/control-plane/t2-4-1-credential-route.test.d.ts +1 -0
- package/dist/tests/unit/control-plane/t2-4-1-credential-route.test.js +75 -0
- package/dist/tests/unit/control-plane/t2-4-1-platform-intent.test.d.ts +1 -0
- package/dist/tests/unit/control-plane/t2-4-1-platform-intent.test.js +168 -0
- package/dist/tests/unit/core/outreach-judgment.test.d.ts +1 -0
- package/dist/tests/unit/core/outreach-judgment.test.js +109 -0
- package/dist/tests/unit/core/resolve-allowed-intent.test.d.ts +1 -0
- package/dist/tests/unit/core/resolve-allowed-intent.test.js +69 -0
- package/dist/tests/unit/core/t2-2-3-connector-action-honest-result.test.d.ts +1 -0
- package/dist/tests/unit/core/t2-2-3-connector-action-honest-result.test.js +130 -0
- package/dist/tests/unit/core/t2-2-3-connector-dispatch-wired.test.d.ts +1 -0
- package/dist/tests/unit/core/t2-2-3-connector-dispatch-wired.test.js +99 -0
- package/dist/tests/unit/dream/dream-input-loader.test.d.ts +15 -0
- package/dist/tests/unit/dream/dream-input-loader.test.js +424 -0
- package/dist/tests/unit/dream/dream-scheduler.test.d.ts +1 -0
- package/dist/tests/unit/dream/dream-scheduler.test.js +57 -0
- package/dist/tests/unit/dream/t-dqs-c3-redacted-evidence.test.d.ts +11 -0
- package/dist/tests/unit/dream/t-dqs-c3-redacted-evidence.test.js +298 -0
- package/dist/tests/unit/dream/t7-1-3-insight-extraction.test.d.ts +1 -0
- package/dist/tests/unit/dream/t7-1-3-insight-extraction.test.js +79 -0
- package/dist/tests/unit/dream/t7-1-4-narrative-update.test.d.ts +1 -0
- package/dist/tests/unit/dream/t7-1-4-narrative-update.test.js +93 -0
- package/dist/tests/unit/dream/t7-1-5-relationship-update.test.d.ts +1 -0
- package/dist/tests/unit/dream/t7-1-5-relationship-update.test.js +116 -0
- package/dist/tests/unit/feedback/t4-2-1-owner-reply-inference.test.d.ts +1 -0
- package/dist/tests/unit/feedback/t4-2-1-owner-reply-inference.test.js +58 -0
- package/dist/tests/unit/guidance/capability-class.test.d.ts +1 -0
- package/dist/tests/unit/guidance/capability-class.test.js +96 -0
- package/dist/tests/unit/guidance/channel-feedback-ingestion.test.d.ts +1 -0
- package/dist/tests/unit/guidance/channel-feedback-ingestion.test.js +163 -0
- package/dist/tests/unit/guidance/evidence-guidance.test.d.ts +1 -0
- package/dist/tests/unit/guidance/evidence-guidance.test.js +40 -0
- package/dist/tests/unit/guidance/guidance-draft-service.test.d.ts +1 -0
- package/dist/tests/unit/guidance/guidance-draft-service.test.js +140 -0
- package/dist/tests/unit/guidance/impulse-assembler.test.d.ts +1 -0
- package/dist/tests/unit/guidance/impulse-assembler.test.js +169 -0
- package/dist/tests/unit/guidance/outreach-draft-schema.test.d.ts +1 -0
- package/dist/tests/unit/guidance/outreach-draft-schema.test.js +56 -0
- package/dist/tests/unit/guidance/outreach-strategy-selector.test.d.ts +1 -0
- package/dist/tests/unit/guidance/outreach-strategy-selector.test.js +208 -0
- package/dist/tests/unit/guidance/outreach-style-fixtures.test.d.ts +1 -0
- package/dist/tests/unit/guidance/outreach-style-fixtures.test.js +81 -0
- package/dist/tests/unit/guidance/t6-1-1-narrative-outreach.test.d.ts +1 -0
- package/dist/tests/unit/guidance/t6-1-1-narrative-outreach.test.js +256 -0
- package/dist/tests/unit/observability/audit-envelope.test.d.ts +1 -0
- package/dist/tests/unit/observability/audit-envelope.test.js +169 -0
- package/dist/tests/unit/observability/connector-inventory-ledger.test.d.ts +1 -0
- package/dist/tests/unit/observability/connector-inventory-ledger.test.js +128 -0
- package/dist/tests/unit/observability/family-registry.test.d.ts +12 -0
- package/dist/tests/unit/observability/family-registry.test.js +105 -0
- package/dist/tests/unit/observability/governance-plane-recorder.test.d.ts +1 -0
- package/dist/tests/unit/observability/governance-plane-recorder.test.js +72 -0
- package/dist/tests/unit/observability/heartbeat-digest-assembler.test.d.ts +1 -0
- package/dist/tests/unit/observability/heartbeat-digest-assembler.test.js +227 -0
- package/dist/tests/unit/observability/lived-experience-audit.test.d.ts +1 -0
- package/dist/tests/unit/observability/lived-experience-audit.test.js +105 -0
- package/dist/tests/unit/observability/narrative-timeline-query.test.d.ts +18 -0
- package/dist/tests/unit/observability/narrative-timeline-query.test.js +239 -0
- package/dist/tests/unit/observability/restore-audit-service.test.d.ts +16 -0
- package/dist/tests/unit/observability/restore-audit-service.test.js +186 -0
- package/dist/tests/unit/observability/runtime-decision-recorder.test.d.ts +1 -0
- package/dist/tests/unit/observability/runtime-decision-recorder.test.js +66 -0
- package/dist/tests/unit/observability/runtime-secret-anchor-view.test.d.ts +18 -0
- package/dist/tests/unit/observability/runtime-secret-anchor-view.test.js +209 -0
- package/dist/tests/unit/observability/self-health-snapshot.test.d.ts +1 -0
- package/dist/tests/unit/observability/self-health-snapshot.test.js +223 -0
- package/dist/tests/unit/observability/verify-audit-hash-chain.test.d.ts +1 -0
- package/dist/tests/unit/observability/verify-audit-hash-chain.test.js +93 -0
- package/dist/tests/unit/ops/manual-run-dispatcher.test.d.ts +13 -0
- package/dist/tests/unit/ops/manual-run-dispatcher.test.js +219 -0
- package/dist/tests/unit/quiet/claim-synthesizer.test.d.ts +17 -0
- package/dist/tests/unit/quiet/claim-synthesizer.test.js +289 -0
- package/dist/tests/unit/quiet/daily-diary-writer.test.d.ts +12 -0
- package/dist/tests/unit/quiet/daily-diary-writer.test.js +108 -0
- package/dist/tests/unit/shared/v7-entities.test.d.ts +13 -0
- package/dist/tests/unit/shared/v7-entities.test.js +306 -0
- package/dist/tests/unit/storage/delivery-attempt.test.d.ts +1 -0
- package/dist/tests/unit/storage/delivery-attempt.test.js +72 -0
- package/dist/tests/unit/storage/diary-dream-store.test.d.ts +12 -0
- package/dist/tests/unit/storage/diary-dream-store.test.js +118 -0
- package/dist/tests/unit/storage/embodied-context-state-port.test.d.ts +4 -0
- package/dist/tests/unit/storage/embodied-context-state-port.test.js +77 -0
- package/dist/tests/unit/storage/goal-lifecycle-store.test.d.ts +4 -0
- package/dist/tests/unit/storage/goal-lifecycle-store.test.js +143 -0
- package/dist/tests/unit/storage/history-digest-store.test.d.ts +10 -0
- package/dist/tests/unit/storage/history-digest-store.test.js +126 -0
- package/dist/tests/unit/storage/identity-profile-store.test.d.ts +4 -0
- package/dist/tests/unit/storage/identity-profile-store.test.js +48 -0
- package/dist/tests/unit/storage/life-evidence-snapshot.test.d.ts +1 -0
- package/dist/tests/unit/storage/life-evidence-snapshot.test.js +60 -0
- package/dist/tests/unit/storage/life-evidence.test.d.ts +1 -0
- package/dist/tests/unit/storage/life-evidence.test.js +54 -0
- package/dist/tests/unit/storage/migration-runner.test.d.ts +12 -0
- package/dist/tests/unit/storage/migration-runner.test.js +197 -0
- package/dist/tests/unit/storage/repair-gate.test.d.ts +1 -0
- package/dist/tests/unit/storage/repair-gate.test.js +41 -0
- package/dist/tests/unit/storage/restore-snapshot-store.test.d.ts +11 -0
- package/dist/tests/unit/storage/restore-snapshot-store.test.js +161 -0
- package/dist/tests/unit/storage/rhythm-policy-snapshot.test.d.ts +1 -0
- package/dist/tests/unit/storage/rhythm-policy-snapshot.test.js +31 -0
- package/dist/tests/unit/storage/runtime-secret-anchor-store.test.d.ts +10 -0
- package/dist/tests/unit/storage/runtime-secret-anchor-store.test.js +81 -0
- package/dist/tests/unit/storage/t1-4-1-credential-health-mapper.test.d.ts +1 -0
- package/dist/tests/unit/storage/t1-4-1-credential-health-mapper.test.js +83 -0
- package/dist/tests/unit/storage/t4-1-1-session-chronicle.test.d.ts +1 -0
- package/dist/tests/unit/storage/t4-1-1-session-chronicle.test.js +112 -0
- package/dist/tests/unit/storage/t4-1-2-narrative-state.test.d.ts +1 -0
- package/dist/tests/unit/storage/t4-1-2-narrative-state.test.js +80 -0
- package/dist/tests/unit/storage/t4-1-3-relationship-memory.test.d.ts +1 -0
- package/dist/tests/unit/storage/t4-1-3-relationship-memory.test.js +65 -0
- package/dist/tests/unit/storage/t4-1-4-agent-goal.test.d.ts +1 -0
- package/dist/tests/unit/storage/t4-1-4-agent-goal.test.js +166 -0
- package/dist/tests/unit/storage/tool-experience-store.test.d.ts +4 -0
- package/dist/tests/unit/storage/tool-experience-store.test.js +92 -0
- package/dist/tests/unit/storage/user-interest-snapshot.test.d.ts +1 -0
- package/dist/tests/unit/storage/user-interest-snapshot.test.js +48 -0
- package/dist/tests/unit/storage/write-queue.test.d.ts +12 -0
- package/dist/tests/unit/storage/write-queue.test.js +177 -0
- package/dist/tests/unit/storage/write-validation-gate.test.d.ts +9 -0
- package/dist/tests/unit/storage/write-validation-gate.test.js +153 -0
- package/docs/claw-second-nature-inner-guide.md +144 -0
- package/package.json +84 -55
- package/agent-inner-guide.md +0 -187
- package/openclaw.plugin.json +0 -29
- package/runtime/cli/ops/heartbeat-surface.d.ts +0 -75
- package/runtime/cli/ops/heartbeat-surface.js +0 -97
- package/runtime/cli/ops/ops-router.js +0 -1454
- package/runtime/cli/ops/workspace-heartbeat-runner.d.ts +0 -76
- package/runtime/cli/ops/workspace-heartbeat-runner.js +0 -236
- package/runtime/core/second-nature/heartbeat/goal-lifecycle-policy.d.ts +0 -37
- package/runtime/core/second-nature/heartbeat/goal-lifecycle-policy.js +0 -61
- package/runtime/core/second-nature/heartbeat/heartbeat-loop.d.ts +0 -88
- package/runtime/core/second-nature/heartbeat/heartbeat-loop.js +0 -329
- package/runtime/core/second-nature/orchestrator/platform-capability-router.js +0 -131
- /package/{index.js → dist/plugin/index.js} +0 -0
- /package/{workspace-ops-bridge.js → dist/plugin/workspace-ops-bridge.js} +0 -0
- /package/{runtime/cli/read-models/types.js → dist/scripts/packaging-feasibility-poc.d.ts} +0 -0
- /package/{runtime/core/second-nature/types.js → dist/scripts/plugin-smoke-check.d.ts} +0 -0
- /package/{runtime → dist/src}/cli/action-bridge.js +0 -0
- /package/{runtime → dist/src}/cli/commands/connector-behavior.d.ts +0 -0
- /package/{runtime → dist/src}/cli/commands/connector-behavior.js +0 -0
- /package/{runtime → dist/src}/cli/commands/connector-init.d.ts +0 -0
- /package/{runtime → dist/src}/cli/commands/connector-init.js +0 -0
- /package/{runtime → dist/src}/cli/commands/connector-status.d.ts +0 -0
- /package/{runtime → dist/src}/cli/commands/connector-status.js +0 -0
- /package/{runtime → dist/src}/cli/commands/credential.d.ts +0 -0
- /package/{runtime → dist/src}/cli/commands/credential.js +0 -0
- /package/{runtime → dist/src}/cli/commands/goal.d.ts +0 -0
- /package/{runtime → dist/src}/cli/commands/goal.js +0 -0
- /package/{runtime → dist/src}/cli/commands/index.d.ts +0 -0
- /package/{runtime → dist/src}/cli/commands/index.js +0 -0
- /package/{runtime → dist/src}/cli/commands/policy.d.ts +0 -0
- /package/{runtime → dist/src}/cli/commands/policy.js +0 -0
- /package/{runtime → dist/src}/cli/explain/explain-surface-subject.d.ts +0 -0
- /package/{runtime → dist/src}/cli/explain/explain-surface-subject.js +0 -0
- /package/{runtime → dist/src}/cli/explain/format-explanation.d.ts +0 -0
- /package/{runtime → dist/src}/cli/explain/format-explanation.js +0 -0
- /package/{runtime → dist/src}/cli/explain/resolve-subject.d.ts +0 -0
- /package/{runtime → dist/src}/cli/explain/resolve-subject.js +0 -0
- /package/{runtime → dist/src}/cli/host-capability/classify-delivery.d.ts +0 -0
- /package/{runtime → dist/src}/cli/host-capability/classify-delivery.js +0 -0
- /package/{runtime → dist/src}/cli/host-capability/probe-host-capability.d.ts +0 -0
- /package/{runtime → dist/src}/cli/host-capability/probe-host-capability.js +0 -0
- /package/{runtime → dist/src}/cli/host-capability/record-host-capability.d.ts +0 -0
- /package/{runtime → dist/src}/cli/host-capability/record-host-capability.js +0 -0
- /package/{runtime → dist/src}/cli/host-capability/types.d.ts +0 -0
- /package/{runtime → dist/src}/cli/host-capability/types.js +0 -0
- /package/{runtime → dist/src}/cli/host-smoke/run-host-smoke.d.ts +0 -0
- /package/{runtime → dist/src}/cli/host-smoke/run-host-smoke.js +0 -0
- /package/{runtime → dist/src}/cli/host-smoke/types.d.ts +0 -0
- /package/{runtime → dist/src}/cli/host-smoke/types.js +0 -0
- /package/{runtime → dist/src}/cli/index.js +0 -0
- /package/{runtime → dist/src}/cli/ops/manual-run-dispatcher.d.ts +0 -0
- /package/{runtime → dist/src}/cli/ops/manual-run-dispatcher.js +0 -0
- /package/{runtime → dist/src}/cli/ops/ops-router.d.ts +0 -0
- /package/{runtime → dist/src}/cli/ops/show-operator-fallback.d.ts +0 -0
- /package/{runtime → dist/src}/cli/ops/show-operator-fallback.js +0 -0
- /package/{runtime → dist/src}/cli/read-models/index.d.ts +0 -0
- /package/{runtime → dist/src}/cli/read-models/index.js +0 -0
- /package/{runtime → dist/src}/cli/read-models/operator-explain-map.d.ts +0 -0
- /package/{runtime → dist/src}/cli/read-models/operator-explain-map.js +0 -0
- /package/{runtime → dist/src}/cli/read-models/types.d.ts +0 -0
- /package/{runtime/guidance → dist/src/cli/read-models}/types.js +0 -0
- /package/{runtime → dist/src}/cli/runtime/runtime-artifact-boundary.d.ts +0 -0
- /package/{runtime → dist/src}/cli/runtime/runtime-artifact-boundary.js +0 -0
- /package/{runtime → dist/src}/connectors/agent-network/agent-world/adapter.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/agent-network/agent-world/adapter.js +0 -0
- /package/{runtime → dist/src}/connectors/agent-network/agent-world/index.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/agent-network/agent-world/index.js +0 -0
- /package/{runtime → dist/src}/connectors/agent-network/agent-world/manifest.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/agent-network/agent-world/manifest.js +0 -0
- /package/{runtime → dist/src}/connectors/agent-network/evomap/adapter.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/agent-network/evomap/adapter.js +0 -0
- /package/{runtime → dist/src}/connectors/agent-network/evomap/index.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/agent-network/evomap/index.js +0 -0
- /package/{runtime → dist/src}/connectors/agent-network/evomap/manifest.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/agent-network/evomap/manifest.js +0 -0
- /package/{runtime → dist/src}/connectors/base/channel-health.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/base/channel-health.js +0 -0
- /package/{runtime → dist/src}/connectors/base/contract.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/base/contract.js +0 -0
- /package/{runtime → dist/src}/connectors/base/effect-commit-ledger-sqlite.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/base/effect-commit-ledger-sqlite.js +0 -0
- /package/{runtime → dist/src}/connectors/base/execution-policy.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/base/execution-policy.js +0 -0
- /package/{runtime → dist/src}/connectors/base/failure-taxonomy.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/base/failure-taxonomy.js +0 -0
- /package/{runtime → dist/src}/connectors/base/index.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/base/index.js +0 -0
- /package/{runtime → dist/src}/connectors/base/manifest-v7.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/base/manifest-v7.js +0 -0
- /package/{runtime → dist/src}/connectors/base/manifest.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/base/manifest.js +0 -0
- /package/{runtime → dist/src}/connectors/base/map-life-evidence.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/base/map-life-evidence.js +0 -0
- /package/{runtime → dist/src}/connectors/base/policy-layer.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/base/policy-layer.js +0 -0
- /package/{runtime → dist/src}/connectors/base/route-planner.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/base/route-planner.js +0 -0
- /package/{runtime → dist/src}/connectors/base/structured-unavailable-reason.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/base/structured-unavailable-reason.js +0 -0
- /package/{runtime → dist/src}/connectors/base/wet-probe-runner.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/base/wet-probe-runner.js +0 -0
- /package/{runtime → dist/src}/connectors/index.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/index.js +0 -0
- /package/{runtime → dist/src}/connectors/manifest/manifest-parser.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/manifest/manifest-parser.js +0 -0
- /package/{runtime → dist/src}/connectors/manifest/manifest-schema.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/manifest/manifest-schema.js +0 -0
- /package/{runtime → dist/src}/connectors/near-real/near-real-connector-smoke.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/near-real/near-real-connector-smoke.js +0 -0
- /package/{runtime → dist/src}/connectors/registry/dynamic-connector-registry.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/registry/dynamic-connector-registry.js +0 -0
- /package/{runtime → dist/src}/connectors/registry/index.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/registry/index.js +0 -0
- /package/{runtime → dist/src}/connectors/registry/manifest-scanner.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/registry/manifest-scanner.js +0 -0
- /package/{runtime → dist/src}/connectors/registry/trust-policy.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/registry/trust-policy.js +0 -0
- /package/{runtime → dist/src}/connectors/services/connector-executor-adapter.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/services/connector-executor-adapter.js +0 -0
- /package/{runtime → dist/src}/connectors/services/credential-route-context.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/services/credential-route-context.js +0 -0
- /package/{runtime → dist/src}/connectors/social-community/instreet/adapter.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/social-community/instreet/adapter.js +0 -0
- /package/{runtime → dist/src}/connectors/social-community/instreet/index.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/social-community/instreet/index.js +0 -0
- /package/{runtime → dist/src}/connectors/social-community/instreet/manifest.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/social-community/instreet/manifest.js +0 -0
- /package/{runtime → dist/src}/connectors/social-community/moltbook/adapter.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/social-community/moltbook/adapter.js +0 -0
- /package/{runtime → dist/src}/connectors/social-community/moltbook/api-client.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/social-community/moltbook/api-client.js +0 -0
- /package/{runtime → dist/src}/connectors/social-community/moltbook/index.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/social-community/moltbook/index.js +0 -0
- /package/{runtime → dist/src}/connectors/social-community/moltbook/manifest.d.ts +0 -0
- /package/{runtime → dist/src}/connectors/social-community/moltbook/manifest.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/body/behavior-promotion/behavior-promotion-loop.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/body/behavior-promotion/behavior-promotion-loop.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/body/circuit-breaker/circuit-breaker-manager.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/body/circuit-breaker/circuit-breaker-manager.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/body/probe-signal-adapter.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/body/probe-signal-adapter.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/body/tool-affordance/affordance-assembler.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/body/tool-affordance/affordance-assembler.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/body/tool-affordance/affordance-context-scope.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/body/tool-affordance/affordance-context-scope.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/body/tool-experience/experience-writer.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/body/tool-experience/experience-writer.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/body/tool-experience/pain-signal-query.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/body/tool-experience/pain-signal-query.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/feedback/owner-reply-feedback.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/feedback/owner-reply-feedback.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/guidance/apply-guidance.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/guidance/apply-guidance.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/guidance/request-guidance.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/guidance/request-guidance.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/guidance/user-reply-continuity.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/guidance/user-reply-continuity.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/decision-trace-emitter.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/decision-trace-emitter.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/embodied-context-assembler.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/embodied-context-assembler.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/heartbeat-executor.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/heartbeat-executor.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/idle-curiosity-policy.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/idle-curiosity-policy.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/index.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/index.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/run-heartbeat-cycle-v7.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/run-heartbeat-cycle-v7.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/run-heartbeat-cycle.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/run-heartbeat-cycle.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/runtime-snapshot.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/runtime-snapshot.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/scope-router.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/scope-router.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/signal.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/signal.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/snapshot-builder.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/heartbeat/snapshot-builder.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/index.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/index.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/downstream-intent-orchestrator.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/downstream-intent-orchestrator.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/effect-dispatcher.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/effect-dispatcher.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/goal-priority.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/goal-priority.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/guard-layer.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/guard-layer.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/hard-guard-evaluator.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/hard-guard-evaluator.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/index.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/index.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/intent-planner.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/intent-planner.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/lease-manager.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/lease-manager.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/narrative-update.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/narrative-update.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/platform-capability-router.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/resume-from-checkpoint.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/orchestrator/resume-from-checkpoint.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/outreach/build-message.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/outreach/build-message.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/outreach/build-outreach-draft-request.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/outreach/build-outreach-draft-request.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/outreach/delivery-target.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/outreach/delivery-target.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/outreach/dispatch-user-outreach.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/outreach/dispatch-user-outreach.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/outreach/evaluate-outreach.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/outreach/evaluate-outreach.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/outreach/judge-input-from-snapshot.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/outreach/judge-input-from-snapshot.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/outreach/judge-outreach.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/outreach/judge-outreach.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/quiet/claim-synthesizer.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/quiet/claim-synthesizer.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/quiet/daily-diary-writer.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/quiet/daily-diary-writer.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/quiet/index.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/quiet/index.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/quiet/quiet-pipeline.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/quiet/quiet-pipeline.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/quiet/run-source-backed-quiet.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/quiet/run-source-backed-quiet.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/reflection/run-narrative-reflection.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/reflection/run-narrative-reflection.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/rhythm/planner-rhythm-window.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/rhythm/planner-rhythm-window.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/rhythm/policy-bridge.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/rhythm/policy-bridge.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/rhythm/rhythm-policy.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/rhythm/rhythm-policy.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/rhythm/select-window.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/rhythm/select-window.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/runtime/lifecycle-service.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/runtime/lifecycle-service.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/runtime/service-entry.d.ts +0 -0
- /package/{runtime → dist/src}/core/second-nature/runtime/service-entry.js +0 -0
- /package/{runtime → dist/src}/core/second-nature/types.d.ts +0 -0
- /package/{runtime/storage/delivery → dist/src/core/second-nature}/types.js +0 -0
- /package/{runtime → dist/src}/dream/dream-engine.d.ts +0 -0
- /package/{runtime → dist/src}/dream/dream-engine.js +0 -0
- /package/{runtime → dist/src}/dream/dream-input-loader.d.ts +0 -0
- /package/{runtime → dist/src}/dream/dream-input-loader.js +0 -0
- /package/{runtime → dist/src}/dream/dream-scheduler.d.ts +0 -0
- /package/{runtime → dist/src}/dream/dream-scheduler.js +0 -0
- /package/{runtime → dist/src}/dream/index.d.ts +0 -0
- /package/{runtime → dist/src}/dream/index.js +0 -0
- /package/{runtime → dist/src}/dream/insight-extractor.d.ts +0 -0
- /package/{runtime → dist/src}/dream/insight-extractor.js +0 -0
- /package/{runtime → dist/src}/dream/memory-consolidator.d.ts +0 -0
- /package/{runtime → dist/src}/dream/memory-consolidator.js +0 -0
- /package/{runtime → dist/src}/dream/narrative-update-proposal.d.ts +0 -0
- /package/{runtime → dist/src}/dream/narrative-update-proposal.js +0 -0
- /package/{runtime → dist/src}/dream/output-validator.d.ts +0 -0
- /package/{runtime → dist/src}/dream/output-validator.js +0 -0
- /package/{runtime → dist/src}/dream/redaction-gate.d.ts +0 -0
- /package/{runtime → dist/src}/dream/redaction-gate.js +0 -0
- /package/{runtime → dist/src}/dream/relationship-update-proposal.d.ts +0 -0
- /package/{runtime → dist/src}/dream/relationship-update-proposal.js +0 -0
- /package/{runtime → dist/src}/dream/sampler.d.ts +0 -0
- /package/{runtime → dist/src}/dream/sampler.js +0 -0
- /package/{runtime → dist/src}/dream/types.d.ts +0 -0
- /package/{runtime → dist/src}/dream/types.js +0 -0
- /package/{runtime → dist/src}/guidance/capability-class.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/capability-class.js +0 -0
- /package/{runtime → dist/src}/guidance/channel-feedback-ingestion-service.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/channel-feedback-ingestion-service.js +0 -0
- /package/{runtime → dist/src}/guidance/contracts.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/contracts.js +0 -0
- /package/{runtime → dist/src}/guidance/draft-narrative-outreach.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/draft-narrative-outreach.js +0 -0
- /package/{runtime → dist/src}/guidance/draft-outreach-message.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/draft-outreach-message.js +0 -0
- /package/{runtime → dist/src}/guidance/evidence-guidance.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/evidence-guidance.js +0 -0
- /package/{runtime → dist/src}/guidance/fallback.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/fallback.js +0 -0
- /package/{runtime → dist/src}/guidance/guidance-assembler.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/guidance-assembler.js +0 -0
- /package/{runtime → dist/src}/guidance/guidance-draft-service.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/guidance-draft-service.js +0 -0
- /package/{runtime → dist/src}/guidance/impulse-assembler.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/impulse-assembler.js +0 -0
- /package/{runtime → dist/src}/guidance/index.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/index.js +0 -0
- /package/{runtime → dist/src}/guidance/output-guard.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/output-guard.js +0 -0
- /package/{runtime → dist/src}/guidance/outreach-draft-schema.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/outreach-draft-schema.js +0 -0
- /package/{runtime → dist/src}/guidance/outreach-strategy-selector.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/outreach-strategy-selector.js +0 -0
- /package/{runtime → dist/src}/guidance/persona-selection.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/persona-selection.js +0 -0
- /package/{runtime → dist/src}/guidance/review-workflow.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/review-workflow.js +0 -0
- /package/{runtime → dist/src}/guidance/template-registry.d.ts +0 -0
- /package/{runtime → dist/src}/guidance/template-registry.js +0 -0
- /package/{runtime → dist/src}/guidance/types.d.ts +0 -0
- /package/{runtime/storage/memory/workspace → dist/src/guidance}/types.js +0 -0
- /package/{runtime → dist/src}/observability/audit/append-only-audit-store.d.ts +0 -0
- /package/{runtime → dist/src}/observability/audit/append-only-audit-store.js +0 -0
- /package/{runtime → dist/src}/observability/audit/audit-envelope.d.ts +0 -0
- /package/{runtime → dist/src}/observability/audit/audit-envelope.js +0 -0
- /package/{runtime → dist/src}/observability/audit/audit-family-registry.json +0 -0
- /package/{runtime → dist/src}/observability/audit/family-registry.d.ts +0 -0
- /package/{runtime → dist/src}/observability/audit/family-registry.js +0 -0
- /package/{runtime → dist/src}/observability/audit/verify-audit-hash-chain.d.ts +0 -0
- /package/{runtime → dist/src}/observability/audit/verify-audit-hash-chain.js +0 -0
- /package/{runtime → dist/src}/observability/connector-inventory-ledger.d.ts +0 -0
- /package/{runtime → dist/src}/observability/connector-inventory-ledger.js +0 -0
- /package/{runtime → dist/src}/observability/db/index.d.ts +0 -0
- /package/{runtime → dist/src}/observability/db/index.js +0 -0
- /package/{runtime → dist/src}/observability/db/schema/connector-inventory.d.ts +0 -0
- /package/{runtime → dist/src}/observability/db/schema/connector-inventory.js +0 -0
- /package/{runtime → dist/src}/observability/db/schema/host-capability-reports.d.ts +0 -0
- /package/{runtime → dist/src}/observability/db/schema/host-capability-reports.js +0 -0
- /package/{runtime → dist/src}/observability/db/schema/index.d.ts +0 -0
- /package/{runtime → dist/src}/observability/db/schema/index.js +0 -0
- /package/{runtime → dist/src}/observability/index.d.ts +0 -0
- /package/{runtime → dist/src}/observability/index.js +0 -0
- /package/{runtime → dist/src}/observability/projections/guidance-audit.d.ts +0 -0
- /package/{runtime → dist/src}/observability/projections/guidance-audit.js +0 -0
- /package/{runtime → dist/src}/observability/projections/outreach-quality-audit.d.ts +0 -0
- /package/{runtime → dist/src}/observability/projections/outreach-quality-audit.js +0 -0
- /package/{runtime → dist/src}/observability/projections/reflection-audit.d.ts +0 -0
- /package/{runtime → dist/src}/observability/projections/reflection-audit.js +0 -0
- /package/{runtime → dist/src}/observability/query/compose-evidence.d.ts +0 -0
- /package/{runtime → dist/src}/observability/query/compose-evidence.js +0 -0
- /package/{runtime → dist/src}/observability/query/evidence-query-engine.d.ts +0 -0
- /package/{runtime → dist/src}/observability/query/evidence-query-engine.js +0 -0
- /package/{runtime → dist/src}/observability/query/explain-query.d.ts +0 -0
- /package/{runtime → dist/src}/observability/query/explain-query.js +0 -0
- /package/{runtime → dist/src}/observability/query/export-audit-bundle.d.ts +0 -0
- /package/{runtime → dist/src}/observability/query/export-audit-bundle.js +0 -0
- /package/{runtime → dist/src}/observability/redaction/manifest.d.ts +0 -0
- /package/{runtime → dist/src}/observability/redaction/manifest.js +0 -0
- /package/{runtime → dist/src}/observability/redaction/policy.d.ts +0 -0
- /package/{runtime → dist/src}/observability/redaction/policy.js +0 -0
- /package/{runtime → dist/src}/observability/services/decision-ledger.d.ts +0 -0
- /package/{runtime → dist/src}/observability/services/decision-ledger.js +0 -0
- /package/{runtime → dist/src}/observability/services/execution-telemetry.d.ts +0 -0
- /package/{runtime → dist/src}/observability/services/execution-telemetry.js +0 -0
- /package/{runtime → dist/src}/observability/services/governance-audit.d.ts +0 -0
- /package/{runtime → dist/src}/observability/services/governance-audit.js +0 -0
- /package/{runtime → dist/src}/observability/services/governance-plane-recorder.d.ts +0 -0
- /package/{runtime → dist/src}/observability/services/governance-plane-recorder.js +0 -0
- /package/{runtime → dist/src}/observability/services/heartbeat-digest-assembler.d.ts +0 -0
- /package/{runtime → dist/src}/observability/services/heartbeat-digest-assembler.js +0 -0
- /package/{runtime → dist/src}/observability/services/lived-experience-audit.d.ts +0 -0
- /package/{runtime → dist/src}/observability/services/lived-experience-audit.js +0 -0
- /package/{runtime → dist/src}/observability/services/narrative-timeline-query-service.d.ts +0 -0
- /package/{runtime → dist/src}/observability/services/narrative-timeline-query-service.js +0 -0
- /package/{runtime → dist/src}/observability/services/observability-retention.d.ts +0 -0
- /package/{runtime → dist/src}/observability/services/observability-retention.js +0 -0
- /package/{runtime → dist/src}/observability/services/redaction-store.d.ts +0 -0
- /package/{runtime → dist/src}/observability/services/redaction-store.js +0 -0
- /package/{runtime → dist/src}/observability/services/restore-audit-service.d.ts +0 -0
- /package/{runtime → dist/src}/observability/services/restore-audit-service.js +0 -0
- /package/{runtime → dist/src}/observability/services/runtime-decision-recorder.d.ts +0 -0
- /package/{runtime → dist/src}/observability/services/runtime-decision-recorder.js +0 -0
- /package/{runtime → dist/src}/observability/services/runtime-secret-anchor-view.d.ts +0 -0
- /package/{runtime → dist/src}/observability/services/runtime-secret-anchor-view.js +0 -0
- /package/{runtime → dist/src}/observability/services/self-health-snapshot.d.ts +0 -0
- /package/{runtime → dist/src}/observability/services/self-health-snapshot.js +0 -0
- /package/{runtime → dist/src}/shared/types/continuity.d.ts +0 -0
- /package/{runtime → dist/src}/shared/types/continuity.js +0 -0
- /package/{runtime → dist/src}/shared/types/credential.d.ts +0 -0
- /package/{runtime → dist/src}/shared/types/credential.js +0 -0
- /package/{runtime → dist/src}/shared/types/goal.d.ts +0 -0
- /package/{runtime → dist/src}/shared/types/goal.js +0 -0
- /package/{runtime → dist/src}/shared/types/index.d.ts +0 -0
- /package/{runtime → dist/src}/shared/types/index.js +0 -0
- /package/{runtime → dist/src}/shared/types/outreach.d.ts +0 -0
- /package/{runtime → dist/src}/shared/types/outreach.js +0 -0
- /package/{runtime → dist/src}/shared/types/source-ref.d.ts +0 -0
- /package/{runtime → dist/src}/shared/types/source-ref.js +0 -0
- /package/{runtime → dist/src}/shared/types/v7-entities.d.ts +0 -0
- /package/{runtime → dist/src}/shared/types/v7-entities.js +0 -0
- /package/{runtime → dist/src}/storage/bootstrap/native-sqlite-probe.d.ts +0 -0
- /package/{runtime → dist/src}/storage/bootstrap/native-sqlite-probe.js +0 -0
- /package/{runtime → dist/src}/storage/bootstrap/repair-gate.d.ts +0 -0
- /package/{runtime → dist/src}/storage/bootstrap/repair-gate.js +0 -0
- /package/{runtime → dist/src}/storage/bootstrap/repair.d.ts +0 -0
- /package/{runtime → dist/src}/storage/bootstrap/repair.js +0 -0
- /package/{runtime → dist/src}/storage/bootstrap/storage-mode-smoke.d.ts +0 -0
- /package/{runtime → dist/src}/storage/bootstrap/storage-mode-smoke.js +0 -0
- /package/{runtime → dist/src}/storage/chronicle/session-chronicle-store.d.ts +0 -0
- /package/{runtime → dist/src}/storage/chronicle/session-chronicle-store.js +0 -0
- /package/{runtime → dist/src}/storage/db/index.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/index.js +0 -0
- /package/{runtime → dist/src}/storage/db/migration-runner.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/migration-runner.js +0 -0
- /package/{runtime → dist/src}/storage/db/migrations/index.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/migrations/index.js +0 -0
- /package/{runtime → dist/src}/storage/db/migrations/v7-001-foundation.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/migrations/v7-001-foundation.js +0 -0
- /package/{runtime → dist/src}/storage/db/migrations/v7-002-effect-commit-ledger.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/migrations/v7-002-effect-commit-ledger.js +0 -0
- /package/{runtime → dist/src}/storage/db/migrations/v7-003-circuit-breaker.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/migrations/v7-003-circuit-breaker.js +0 -0
- /package/{runtime → dist/src}/storage/db/migrations/v7-004-behavior-promotion.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/migrations/v7-004-behavior-promotion.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/agent-goal.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/agent-goal.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/assets.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/assets.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/credentials.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/credentials.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/delivery-attempts.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/delivery-attempts.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/index.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/index.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/intent-commits.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/intent-commits.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/life-evidence-index.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/life-evidence-index.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/memory-store.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/memory-store.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/narrative-state.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/narrative-state.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/operator-fallback-artifacts.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/operator-fallback-artifacts.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/policies.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/policies.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/proposals.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/proposals.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/provenance.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/provenance.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/relationship-memory.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/relationship-memory.js +0 -0
- /package/{runtime → dist/src}/storage/db/schema/session-chronicle.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/schema/session-chronicle.js +0 -0
- /package/{runtime → dist/src}/storage/db/transaction-utils.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/transaction-utils.js +0 -0
- /package/{runtime → dist/src}/storage/db/write-queue.d.ts +0 -0
- /package/{runtime → dist/src}/storage/db/write-queue.js +0 -0
- /package/{runtime → dist/src}/storage/delivery/query-delivery-attempts.d.ts +0 -0
- /package/{runtime → dist/src}/storage/delivery/query-delivery-attempts.js +0 -0
- /package/{runtime → dist/src}/storage/delivery/types.d.ts +0 -0
- /package/{runtime/storage/snapshots → dist/src/storage/delivery}/types.js +0 -0
- /package/{runtime → dist/src}/storage/delivery/write-delivery-attempt.d.ts +0 -0
- /package/{runtime → dist/src}/storage/delivery/write-delivery-attempt.js +0 -0
- /package/{runtime → dist/src}/storage/fallback/load-operator-fallback.d.ts +0 -0
- /package/{runtime → dist/src}/storage/fallback/load-operator-fallback.js +0 -0
- /package/{runtime → dist/src}/storage/fallback/operator-fallback-types.d.ts +0 -0
- /package/{runtime → dist/src}/storage/fallback/operator-fallback-types.js +0 -0
- /package/{runtime → dist/src}/storage/fallback/operator-fallback-view.d.ts +0 -0
- /package/{runtime → dist/src}/storage/fallback/operator-fallback-view.js +0 -0
- /package/{runtime → dist/src}/storage/fallback/write-operator-fallback.d.ts +0 -0
- /package/{runtime → dist/src}/storage/fallback/write-operator-fallback.js +0 -0
- /package/{runtime → dist/src}/storage/goal/agent-goal-store.d.ts +0 -0
- /package/{runtime → dist/src}/storage/goal/agent-goal-store.js +0 -0
- /package/{runtime → dist/src}/storage/index.d.ts +0 -0
- /package/{runtime → dist/src}/storage/index.js +0 -0
- /package/{runtime → dist/src}/storage/life-evidence/append-life-evidence.d.ts +0 -0
- /package/{runtime → dist/src}/storage/life-evidence/append-life-evidence.js +0 -0
- /package/{runtime → dist/src}/storage/life-evidence/types.d.ts +0 -0
- /package/{runtime → dist/src}/storage/life-evidence/types.js +0 -0
- /package/{runtime → dist/src}/storage/memory/workspace/paths.d.ts +0 -0
- /package/{runtime → dist/src}/storage/memory/workspace/paths.js +0 -0
- /package/{runtime → dist/src}/storage/memory/workspace/store.d.ts +0 -0
- /package/{runtime → dist/src}/storage/memory/workspace/store.js +0 -0
- /package/{runtime → dist/src}/storage/memory/workspace/types.d.ts +0 -0
- /package/{runtime/storage/user-interest → dist/src/storage/memory/workspace}/types.js +0 -0
- /package/{runtime → dist/src}/storage/memory-store/memory-store-lifecycle.d.ts +0 -0
- /package/{runtime → dist/src}/storage/memory-store/memory-store-lifecycle.js +0 -0
- /package/{runtime → dist/src}/storage/narrative/narrative-state-store.d.ts +0 -0
- /package/{runtime → dist/src}/storage/narrative/narrative-state-store.js +0 -0
- /package/{runtime → dist/src}/storage/quiet/persist-quiet-artifact.d.ts +0 -0
- /package/{runtime → dist/src}/storage/quiet/persist-quiet-artifact.js +0 -0
- /package/{runtime → dist/src}/storage/quiet/quiet-artifact-types.d.ts +0 -0
- /package/{runtime → dist/src}/storage/quiet/quiet-artifact-types.js +0 -0
- /package/{runtime → dist/src}/storage/quiet/quiet-artifact-writer.d.ts +0 -0
- /package/{runtime → dist/src}/storage/quiet/quiet-artifact-writer.js +0 -0
- /package/{runtime → dist/src}/storage/relationship/relationship-memory-store.d.ts +0 -0
- /package/{runtime → dist/src}/storage/relationship/relationship-memory-store.js +0 -0
- /package/{runtime → dist/src}/storage/repositories/asset-repository.d.ts +0 -0
- /package/{runtime → dist/src}/storage/repositories/asset-repository.js +0 -0
- /package/{runtime → dist/src}/storage/repositories/credential-repository.d.ts +0 -0
- /package/{runtime → dist/src}/storage/repositories/credential-repository.js +0 -0
- /package/{runtime → dist/src}/storage/repositories/index.d.ts +0 -0
- /package/{runtime → dist/src}/storage/repositories/index.js +0 -0
- /package/{runtime → dist/src}/storage/repositories/intent-commit-repository.d.ts +0 -0
- /package/{runtime → dist/src}/storage/repositories/intent-commit-repository.js +0 -0
- /package/{runtime → dist/src}/storage/repositories/policy-repository.d.ts +0 -0
- /package/{runtime → dist/src}/storage/repositories/policy-repository.js +0 -0
- /package/{runtime → dist/src}/storage/repositories/proposal-repository.d.ts +0 -0
- /package/{runtime → dist/src}/storage/repositories/proposal-repository.js +0 -0
- /package/{runtime → dist/src}/storage/repositories/provenance-repository.d.ts +0 -0
- /package/{runtime → dist/src}/storage/repositories/provenance-repository.js +0 -0
- /package/{runtime → dist/src}/storage/rhythm/rhythm-policy-snapshot.d.ts +0 -0
- /package/{runtime → dist/src}/storage/rhythm/rhythm-policy-snapshot.js +0 -0
- /package/{runtime → dist/src}/storage/services/credential-vault.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/credential-vault.js +0 -0
- /package/{runtime → dist/src}/storage/services/daily-log-pipeline.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/daily-log-pipeline.js +0 -0
- /package/{runtime → dist/src}/storage/services/diary-dream-store.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/diary-dream-store.js +0 -0
- /package/{runtime → dist/src}/storage/services/effect-commit-store.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/effect-commit-store.js +0 -0
- /package/{runtime → dist/src}/storage/services/embodied-context-state-port.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/embodied-context-state-port.js +0 -0
- /package/{runtime → dist/src}/storage/services/goal-lifecycle-store.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/goal-lifecycle-store.js +0 -0
- /package/{runtime → dist/src}/storage/services/governance-layer.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/governance-layer.js +0 -0
- /package/{runtime → dist/src}/storage/services/history-digest-store.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/history-digest-store.js +0 -0
- /package/{runtime → dist/src}/storage/services/identity-profile-store.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/identity-profile-store.js +0 -0
- /package/{runtime → dist/src}/storage/services/interaction-snapshot-projector.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/interaction-snapshot-projector.js +0 -0
- /package/{runtime → dist/src}/storage/services/persona-candidate-loader.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/persona-candidate-loader.js +0 -0
- /package/{runtime → dist/src}/storage/services/provenance-service.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/provenance-service.js +0 -0
- /package/{runtime → dist/src}/storage/services/quiet-input-loader.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/quiet-input-loader.js +0 -0
- /package/{runtime → dist/src}/storage/services/repair-and-backup.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/repair-and-backup.js +0 -0
- /package/{runtime → dist/src}/storage/services/restore-snapshot-store.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/restore-snapshot-store.js +0 -0
- /package/{runtime → dist/src}/storage/services/runtime-secret-anchor-store.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/runtime-secret-anchor-store.js +0 -0
- /package/{runtime → dist/src}/storage/services/tool-experience-store.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/tool-experience-store.js +0 -0
- /package/{runtime → dist/src}/storage/services/write-validation-gate.d.ts +0 -0
- /package/{runtime → dist/src}/storage/services/write-validation-gate.js +0 -0
- /package/{runtime → dist/src}/storage/snapshots/continuity-snapshot.d.ts +0 -0
- /package/{runtime → dist/src}/storage/snapshots/continuity-snapshot.js +0 -0
- /package/{runtime → dist/src}/storage/snapshots/life-evidence-snapshot.d.ts +0 -0
- /package/{runtime → dist/src}/storage/snapshots/life-evidence-snapshot.js +0 -0
- /package/{runtime → dist/src}/storage/snapshots/types.d.ts +0 -0
- /package/{runtime → dist/src}/storage/state-api.d.ts +0 -0
- /package/{runtime → dist/src}/storage/state-api.js +0 -0
- /package/{runtime → dist/src}/storage/user-interest/load-user-interest-snapshot.d.ts +0 -0
- /package/{runtime → dist/src}/storage/user-interest/load-user-interest-snapshot.js +0 -0
- /package/{runtime → dist/src}/storage/user-interest/types.d.ts +0 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* T1.2.1 — CLI `narrative` 命令最小闭环。
|
|
3
|
+
*
|
|
4
|
+
* Acceptance:
|
|
5
|
+
* A. 无数据时返回 ok:true + status nothing_yet,不返回空对象。
|
|
6
|
+
* B. 有数据时返回 focus、progress、nextIntent、sourceRefs、groundingStatus。
|
|
7
|
+
* C. groundingStatus 随 confidence 正确推导(pass / degraded / blocked)。
|
|
8
|
+
* D. 命令通过 createCommandRouter 正确注册并可解析。
|
|
9
|
+
*/
|
|
10
|
+
import test from "node:test";
|
|
11
|
+
import assert from "node:assert/strict";
|
|
12
|
+
import { closeCliRuntimeDeps, createCliRuntimeDeps, createCommandRouter, } from "../../../src/cli/index.js";
|
|
13
|
+
import { createStateDatabase } from "../../../src/storage/db/index.js";
|
|
14
|
+
import { createObservabilityDatabase } from "../../../src/observability/db/index.js";
|
|
15
|
+
import { createNarrativeStateStore } from "../../../src/storage/narrative/narrative-state-store.js";
|
|
16
|
+
test("T1.2.1-A: narrative returns ok:true with nothing_yet when store is empty", async () => {
|
|
17
|
+
const stateDb = createStateDatabase(":memory:");
|
|
18
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
19
|
+
const deps = createCliRuntimeDeps({ stateDb, observabilityDb });
|
|
20
|
+
const router = createCommandRouter({ deps });
|
|
21
|
+
const cmd = router.resolve("narrative");
|
|
22
|
+
assert.ok(cmd, "narrative command must be registered");
|
|
23
|
+
const result = (await cmd.execute());
|
|
24
|
+
assert.equal(result.ok, true, "narrative must return ok: true");
|
|
25
|
+
assert.ok(!JSON.stringify(result).includes("Implementation lands in later Wave tasks"), "must not return notImplemented placeholder");
|
|
26
|
+
const data = result.data;
|
|
27
|
+
assert.ok(data, "must include data");
|
|
28
|
+
assert.equal(data.status, "nothing_yet", "empty store must return status: nothing_yet");
|
|
29
|
+
assert.equal(data.focus, "", "empty store focus must be empty string");
|
|
30
|
+
assert.deepEqual(data.progress, [], "empty store progress must be []");
|
|
31
|
+
assert.deepEqual(data.sourceRefs, [], "empty store sourceRefs must be []");
|
|
32
|
+
assert.equal(data.groundingStatus, "blocked", "empty store groundingStatus must be blocked");
|
|
33
|
+
await closeCliRuntimeDeps(deps);
|
|
34
|
+
});
|
|
35
|
+
test("T1.2.1-B: narrative returns full NarrativeReadModel shape when data exists", async () => {
|
|
36
|
+
const stateDb = createStateDatabase(":memory:");
|
|
37
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
38
|
+
// Seed a NarrativeState row before constructing deps
|
|
39
|
+
const narrativeStore = createNarrativeStateStore(stateDb);
|
|
40
|
+
await narrativeStore.updateNarrativeState({
|
|
41
|
+
narrativeId: "default",
|
|
42
|
+
revision: 2,
|
|
43
|
+
focus: "Completing Wave 32 narrative command",
|
|
44
|
+
progress: ["T1.2.1 spec implemented", "T1.2.6 aggregate ready"],
|
|
45
|
+
nextIntent: "Write integration tests",
|
|
46
|
+
confidence: 0.85,
|
|
47
|
+
sourceRefs: [{ sourceId: "src-001", kind: "heartbeat", url: "https://example.com/evidence" }],
|
|
48
|
+
unsupportedClaims: [],
|
|
49
|
+
status: "active",
|
|
50
|
+
updatedAt: "2026-05-16T10:00:00Z",
|
|
51
|
+
});
|
|
52
|
+
const deps = createCliRuntimeDeps({ stateDb, observabilityDb });
|
|
53
|
+
const router = createCommandRouter({ deps });
|
|
54
|
+
const cmd = router.resolve("narrative");
|
|
55
|
+
assert.ok(cmd);
|
|
56
|
+
const result = (await cmd.execute());
|
|
57
|
+
assert.equal(result.ok, true);
|
|
58
|
+
const data = result.data;
|
|
59
|
+
assert.equal(data.narrativeId, "default");
|
|
60
|
+
assert.equal(data.revision, 2);
|
|
61
|
+
assert.equal(data.focus, "Completing Wave 32 narrative command");
|
|
62
|
+
assert.deepEqual(data.progress, ["T1.2.1 spec implemented", "T1.2.6 aggregate ready"]);
|
|
63
|
+
assert.equal(data.nextIntent, "Write integration tests");
|
|
64
|
+
assert.equal(data.confidence, 0.85);
|
|
65
|
+
assert.equal(data.status, "active");
|
|
66
|
+
assert.equal(data.updatedAt, "2026-05-16T10:00:00Z");
|
|
67
|
+
const refs = data.sourceRefs;
|
|
68
|
+
assert.equal(refs.length, 1);
|
|
69
|
+
assert.equal(refs[0].sourceId, "src-001");
|
|
70
|
+
assert.equal(refs[0].kind, "heartbeat");
|
|
71
|
+
assert.equal(refs[0].url, "https://example.com/evidence");
|
|
72
|
+
await closeCliRuntimeDeps(deps);
|
|
73
|
+
});
|
|
74
|
+
test("T1.2.1-C: groundingStatus correctly derived from confidence and status", async () => {
|
|
75
|
+
const stateDb = createStateDatabase(":memory:");
|
|
76
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
77
|
+
const narrativeStore = createNarrativeStateStore(stateDb);
|
|
78
|
+
// Case 1: confidence >= 0.7, active => pass
|
|
79
|
+
await narrativeStore.updateNarrativeState({
|
|
80
|
+
narrativeId: "default",
|
|
81
|
+
revision: 1,
|
|
82
|
+
focus: "pass scenario",
|
|
83
|
+
progress: [],
|
|
84
|
+
nextIntent: "next",
|
|
85
|
+
confidence: 0.75,
|
|
86
|
+
sourceRefs: [],
|
|
87
|
+
unsupportedClaims: [],
|
|
88
|
+
status: "active",
|
|
89
|
+
updatedAt: "2026-05-16T10:00:00Z",
|
|
90
|
+
});
|
|
91
|
+
let deps = createCliRuntimeDeps({ stateDb, observabilityDb });
|
|
92
|
+
let router = createCommandRouter({ deps });
|
|
93
|
+
let cmd = router.resolve("narrative");
|
|
94
|
+
let result = (await cmd.execute());
|
|
95
|
+
let data = result.data;
|
|
96
|
+
assert.equal(data.groundingStatus, "pass", "confidence 0.75 + active => pass");
|
|
97
|
+
await closeCliRuntimeDeps(deps);
|
|
98
|
+
// Case 2: confidence 0.5, insufficient_sources => degraded
|
|
99
|
+
const stateDb2 = createStateDatabase(":memory:");
|
|
100
|
+
const narrativeStore2 = createNarrativeStateStore(stateDb2);
|
|
101
|
+
await narrativeStore2.updateNarrativeState({
|
|
102
|
+
narrativeId: "default",
|
|
103
|
+
revision: 1,
|
|
104
|
+
focus: "degraded scenario",
|
|
105
|
+
progress: [],
|
|
106
|
+
nextIntent: "next",
|
|
107
|
+
confidence: 0.5,
|
|
108
|
+
sourceRefs: [],
|
|
109
|
+
unsupportedClaims: ["unsupported claim"],
|
|
110
|
+
status: "insufficient_sources",
|
|
111
|
+
updatedAt: "2026-05-16T10:00:00Z",
|
|
112
|
+
});
|
|
113
|
+
deps = createCliRuntimeDeps({ stateDb: stateDb2, observabilityDb });
|
|
114
|
+
router = createCommandRouter({ deps });
|
|
115
|
+
cmd = router.resolve("narrative");
|
|
116
|
+
result = (await cmd.execute());
|
|
117
|
+
data = result.data;
|
|
118
|
+
assert.equal(data.groundingStatus, "degraded", "confidence 0.5 + insufficient_sources => degraded");
|
|
119
|
+
await closeCliRuntimeDeps(deps);
|
|
120
|
+
// Case 3: awaiting_sources => blocked
|
|
121
|
+
const stateDb3 = createStateDatabase(":memory:");
|
|
122
|
+
const narrativeStore3 = createNarrativeStateStore(stateDb3);
|
|
123
|
+
await narrativeStore3.updateNarrativeState({
|
|
124
|
+
narrativeId: "default",
|
|
125
|
+
revision: 1,
|
|
126
|
+
focus: "blocked scenario",
|
|
127
|
+
progress: [],
|
|
128
|
+
nextIntent: "next",
|
|
129
|
+
confidence: 0.9,
|
|
130
|
+
sourceRefs: [],
|
|
131
|
+
unsupportedClaims: [],
|
|
132
|
+
status: "awaiting_sources",
|
|
133
|
+
updatedAt: "2026-05-16T10:00:00Z",
|
|
134
|
+
});
|
|
135
|
+
const obsDb3 = createObservabilityDatabase(":memory:");
|
|
136
|
+
deps = createCliRuntimeDeps({ stateDb: stateDb3, observabilityDb: obsDb3 });
|
|
137
|
+
router = createCommandRouter({ deps });
|
|
138
|
+
cmd = router.resolve("narrative");
|
|
139
|
+
result = (await cmd.execute());
|
|
140
|
+
data = result.data;
|
|
141
|
+
assert.equal(data.groundingStatus, "blocked", "awaiting_sources => blocked regardless of confidence");
|
|
142
|
+
await closeCliRuntimeDeps(deps);
|
|
143
|
+
});
|
|
144
|
+
test("T1.2.1-E: groundingStatus boundary value matrix", async () => {
|
|
145
|
+
// Boundary value analysis for deriveGroundingStatus thresholds (0.4, 0.7)
|
|
146
|
+
const cases = [
|
|
147
|
+
// Boundary at 0.7 (pass threshold)
|
|
148
|
+
{ confidence: 0.7, status: "active", expected: "pass", label: "exactly 0.7 + active => pass" },
|
|
149
|
+
{ confidence: 0.69, status: "active", expected: "degraded", label: "0.69 + active => degraded (just below pass)" },
|
|
150
|
+
// Boundary at 0.4 (degraded threshold)
|
|
151
|
+
{ confidence: 0.4, status: "active", expected: "degraded", label: "exactly 0.4 + active => degraded" },
|
|
152
|
+
{ confidence: 0.39, status: "active", expected: "blocked", label: "0.39 + active => blocked (just below degraded)" },
|
|
153
|
+
// Mid-range values
|
|
154
|
+
{ confidence: 0.5, status: "active", expected: "degraded", label: "0.5 + active => degraded" },
|
|
155
|
+
{ confidence: 0.75, status: "insufficient_sources", expected: "degraded", label: "0.75 + insufficient_sources => degraded" },
|
|
156
|
+
// Extremes
|
|
157
|
+
{ confidence: 0.0, status: "active", expected: "blocked", label: "0.0 + active => blocked" },
|
|
158
|
+
{ confidence: 1.0, status: "active", expected: "pass", label: "1.0 + active => pass" },
|
|
159
|
+
];
|
|
160
|
+
for (const c of cases) {
|
|
161
|
+
const stateDb = createStateDatabase(":memory:");
|
|
162
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
163
|
+
const narrativeStore = createNarrativeStateStore(stateDb);
|
|
164
|
+
await narrativeStore.updateNarrativeState({
|
|
165
|
+
narrativeId: "default",
|
|
166
|
+
revision: 1,
|
|
167
|
+
focus: c.label,
|
|
168
|
+
progress: [],
|
|
169
|
+
nextIntent: "next",
|
|
170
|
+
confidence: c.confidence,
|
|
171
|
+
sourceRefs: [],
|
|
172
|
+
unsupportedClaims: [],
|
|
173
|
+
status: c.status,
|
|
174
|
+
updatedAt: "2026-05-16T10:00:00Z",
|
|
175
|
+
});
|
|
176
|
+
const deps = createCliRuntimeDeps({ stateDb, observabilityDb });
|
|
177
|
+
const router = createCommandRouter({ deps });
|
|
178
|
+
const cmd = router.resolve("narrative");
|
|
179
|
+
const result = (await cmd.execute());
|
|
180
|
+
const data = result.data;
|
|
181
|
+
assert.equal(data.groundingStatus, c.expected, `${c.label} (confidence=${c.confidence}, status=${c.status})`);
|
|
182
|
+
await closeCliRuntimeDeps(deps);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
test("T1.2.1-D: narrative command is registered in createCommandRouter", async () => {
|
|
186
|
+
const stateDb = createStateDatabase(":memory:");
|
|
187
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
188
|
+
const deps = createCliRuntimeDeps({ stateDb, observabilityDb });
|
|
189
|
+
const router = createCommandRouter({ deps });
|
|
190
|
+
const cmd = router.resolve("narrative");
|
|
191
|
+
assert.ok(cmd, "narrative must be registered in command router");
|
|
192
|
+
assert.ok(cmd.description.toLowerCase().includes("narrative"), "description must mention narrative");
|
|
193
|
+
await closeCliRuntimeDeps(deps);
|
|
194
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* T1.2.2 — CLI `dream:recent` 命令最小闭环。
|
|
3
|
+
*
|
|
4
|
+
* Acceptance:
|
|
5
|
+
* A. 空 audit store 时返回 ok:true + { totalRuns: 0, runs: [] },不含 notImplemented 占位。
|
|
6
|
+
* B. 有 dream.trace 事件时返回正确结构的 DreamRecentReadModel。
|
|
7
|
+
* C. limit 参数有效限制返回条数。
|
|
8
|
+
* D. 命令通过 createCommandRouter 正确注册并可解析。
|
|
9
|
+
*/
|
|
10
|
+
import test from "node:test";
|
|
11
|
+
import assert from "node:assert/strict";
|
|
12
|
+
import { closeCliRuntimeDeps, createCliRuntimeDeps, createCommandRouter, } from "../../../src/cli/index.js";
|
|
13
|
+
import { createStateDatabase } from "../../../src/storage/db/index.js";
|
|
14
|
+
import { createObservabilityDatabase } from "../../../src/observability/db/index.js";
|
|
15
|
+
import { AppendOnlyAuditStore } from "../../../src/observability/audit/append-only-audit-store.js";
|
|
16
|
+
import { createLivedExperienceAuditRecorder } from "../../../src/observability/services/lived-experience-audit.js";
|
|
17
|
+
test("T1.2.2-A: dream:recent returns ok:true with honest empty when store is empty", async () => {
|
|
18
|
+
const stateDb = createStateDatabase(":memory:");
|
|
19
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
20
|
+
const deps = createCliRuntimeDeps({ stateDb, observabilityDb });
|
|
21
|
+
const router = createCommandRouter({ deps });
|
|
22
|
+
const cmd = router.resolve("dream:recent");
|
|
23
|
+
assert.ok(cmd, "dream:recent command must be registered");
|
|
24
|
+
const result = (await cmd.execute());
|
|
25
|
+
assert.equal(result.ok, true, "dream:recent must return ok: true");
|
|
26
|
+
assert.ok(!JSON.stringify(result).includes("Implementation lands in later Wave tasks"), "must not return notImplemented placeholder");
|
|
27
|
+
const data = result.data;
|
|
28
|
+
assert.ok(data, "must include data");
|
|
29
|
+
assert.equal(data.totalRuns, 0, "empty store must return totalRuns: 0");
|
|
30
|
+
assert.deepEqual(data.runs, [], "empty store must return runs: []");
|
|
31
|
+
await closeCliRuntimeDeps(deps);
|
|
32
|
+
});
|
|
33
|
+
test("T1.2.2-B: dream:recent returns correct DreamRecentReadModel shape", async () => {
|
|
34
|
+
const stateDb = createStateDatabase(":memory:");
|
|
35
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
36
|
+
const store = new AppendOnlyAuditStore();
|
|
37
|
+
const recorder = createLivedExperienceAuditRecorder(store);
|
|
38
|
+
recorder.recordDreamTrace({
|
|
39
|
+
traceId: "dream:trace-cli-001",
|
|
40
|
+
runId: "run-cli-001",
|
|
41
|
+
startedAt: "2026-05-16T08:00:00Z",
|
|
42
|
+
finishedAt: "2026-05-16T08:01:00Z",
|
|
43
|
+
durationMs: 60000,
|
|
44
|
+
inputCounts: { evidence: 3, chronicle: 2, memoryEntries: 5 },
|
|
45
|
+
});
|
|
46
|
+
const deps = createCliRuntimeDeps({ stateDb, observabilityDb, livedExperienceAuditStore: store });
|
|
47
|
+
const router = createCommandRouter({ deps });
|
|
48
|
+
const cmd = router.resolve("dream:recent");
|
|
49
|
+
assert.ok(cmd);
|
|
50
|
+
const result = (await cmd.execute());
|
|
51
|
+
assert.equal(result.ok, true);
|
|
52
|
+
const data = result.data;
|
|
53
|
+
assert.equal(data.totalRuns, 1);
|
|
54
|
+
const runs = data.runs;
|
|
55
|
+
assert.equal(runs.length, 1);
|
|
56
|
+
const run = runs[0];
|
|
57
|
+
assert.equal(run.traceId, "dream:trace-cli-001");
|
|
58
|
+
assert.equal(run.runId, "run-cli-001");
|
|
59
|
+
assert.equal(run.durationMs, 60000);
|
|
60
|
+
assert.deepEqual(run.inputCounts, { evidence: 3, chronicle: 2, memoryEntries: 5 });
|
|
61
|
+
assert.equal(run.lifecycleStatus, "completed");
|
|
62
|
+
assert.ok(typeof run.createdAt === "string");
|
|
63
|
+
await closeCliRuntimeDeps(deps);
|
|
64
|
+
});
|
|
65
|
+
test("T1.2.2-C: dream:recent respects limit parameter", async () => {
|
|
66
|
+
const stateDb = createStateDatabase(":memory:");
|
|
67
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
68
|
+
const store = new AppendOnlyAuditStore();
|
|
69
|
+
const recorder = createLivedExperienceAuditRecorder(store);
|
|
70
|
+
for (let i = 0; i < 5; i++) {
|
|
71
|
+
recorder.recordDreamTrace({
|
|
72
|
+
traceId: `dream:trace-limit-${i}`,
|
|
73
|
+
runId: `run-limit-${i}`,
|
|
74
|
+
startedAt: "2026-05-16T08:00:00Z",
|
|
75
|
+
finishedAt: `2026-05-16T0${i + 1}:00:00Z`,
|
|
76
|
+
durationMs: 1000,
|
|
77
|
+
inputCounts: { evidence: 1, chronicle: 0, memoryEntries: 0 },
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const deps = createCliRuntimeDeps({ stateDb, observabilityDb, livedExperienceAuditStore: store });
|
|
81
|
+
const router = createCommandRouter({ deps });
|
|
82
|
+
const cmd = router.resolve("dream:recent");
|
|
83
|
+
assert.ok(cmd);
|
|
84
|
+
const result = (await cmd.execute({ limit: 2 }));
|
|
85
|
+
assert.equal(result.ok, true);
|
|
86
|
+
const data = result.data;
|
|
87
|
+
assert.equal(data.totalRuns, 5); // totalRuns reflects all events
|
|
88
|
+
assert.equal(data.runs.length, 2); // but only 2 returned
|
|
89
|
+
await closeCliRuntimeDeps(deps);
|
|
90
|
+
});
|
|
91
|
+
test("T1.2.2-D: dream:recent command is registered in createCommandRouter", async () => {
|
|
92
|
+
const stateDb = createStateDatabase(":memory:");
|
|
93
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
94
|
+
const deps = createCliRuntimeDeps({ stateDb, observabilityDb });
|
|
95
|
+
const router = createCommandRouter({ deps });
|
|
96
|
+
const cmd = router.resolve("dream:recent");
|
|
97
|
+
assert.ok(cmd, "dream:recent must be registered in command router");
|
|
98
|
+
assert.ok(cmd.description.toLowerCase().includes("dream"), "description must mention dream");
|
|
99
|
+
await closeCliRuntimeDeps(deps);
|
|
100
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* T1.2.3 — `loadStatus` aggregate observability writeback.
|
|
3
|
+
*
|
|
4
|
+
* Verifies that a workspace `heartbeat_check` (full runtime) writes:
|
|
5
|
+
* - `decision_ledger` row with `traceId` prefix `sn-runtime-`
|
|
6
|
+
* - `execution_attempts` row with `platformId === "second-nature-runtime"`
|
|
7
|
+
* so that `loadStatus()` no longer returns `unknown` for `rhythm.mode` /
|
|
8
|
+
* `runtime.serviceStatus` purely because observability tables are empty.
|
|
9
|
+
*
|
|
10
|
+
* Also verifies that carrier-only / probe-only paths intentionally do NOT write,
|
|
11
|
+
* preserving the host-safe carrier contract from T1.1.3 / ADR-005.
|
|
12
|
+
*/
|
|
13
|
+
import test from "node:test";
|
|
14
|
+
import assert from "node:assert/strict";
|
|
15
|
+
import { desc } from "drizzle-orm";
|
|
16
|
+
import { closeCliRuntimeDeps, createCliRuntimeDeps, createCommandRouter, } from "../../../src/cli/index.js";
|
|
17
|
+
import { createStateDatabase } from "../../../src/storage/db/index.js";
|
|
18
|
+
import { createObservabilityDatabase } from "../../../src/observability/db/index.js";
|
|
19
|
+
import { decisionLedger, executionAttempts } from "../../../src/observability/db/schema/index.js";
|
|
20
|
+
test("T1.2.3 workspace heartbeat_check writes sn-runtime ledger + second-nature-runtime attempt", async () => {
|
|
21
|
+
const stateDb = createStateDatabase(":memory:");
|
|
22
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
23
|
+
const deps = createCliRuntimeDeps({ stateDb, observabilityDb });
|
|
24
|
+
const before = await deps.readModels.loadStatus();
|
|
25
|
+
assert.equal(before.rhythm.mode, "unknown", "baseline rhythm must be unknown when ledger is empty");
|
|
26
|
+
assert.equal(before.runtime.serviceStatus, "unknown", "baseline runtime serviceStatus must be unknown when execution_attempts is empty");
|
|
27
|
+
const router = createCommandRouter({ deps });
|
|
28
|
+
const cmd = router.resolve("heartbeat_check");
|
|
29
|
+
assert.ok(cmd, "heartbeat_check command must be registered");
|
|
30
|
+
const out = (await cmd.execute({ timestamp: "2026-05-09T10:00:00.000Z" }));
|
|
31
|
+
assert.equal(out.ok, true);
|
|
32
|
+
assert.equal(out.surfaceMode, "workspace_full_runtime");
|
|
33
|
+
assert.equal(out.livedExperienceLoopClaimed, false);
|
|
34
|
+
const decisions = await observabilityDb.db
|
|
35
|
+
.select()
|
|
36
|
+
.from(decisionLedger)
|
|
37
|
+
.orderBy(desc(decisionLedger.createdAt))
|
|
38
|
+
.limit(5);
|
|
39
|
+
const runtimeDecision = decisions.find((row) => row.traceId.startsWith("sn-runtime-"));
|
|
40
|
+
assert.ok(runtimeDecision, "decision_ledger must contain a sn-runtime-* row after heartbeat_check");
|
|
41
|
+
const attempts = await observabilityDb.db
|
|
42
|
+
.select()
|
|
43
|
+
.from(executionAttempts)
|
|
44
|
+
.orderBy(desc(executionAttempts.startedAt));
|
|
45
|
+
const runtimeAttempt = attempts.find((row) => row.platformId === "second-nature-runtime");
|
|
46
|
+
assert.ok(runtimeAttempt, "execution_attempts must contain a second-nature-runtime row after heartbeat_check");
|
|
47
|
+
assert.equal(runtimeAttempt.traceId, runtimeDecision.traceId, "attempt and decision must share traceId");
|
|
48
|
+
const after = await deps.readModels.loadStatus();
|
|
49
|
+
assert.notEqual(after.rhythm.mode, "unknown", "rhythm.mode must exit unknown after a recorded cycle");
|
|
50
|
+
assert.notEqual(after.runtime.serviceStatus, "unknown", "runtime.serviceStatus must exit unknown after a recorded attempt");
|
|
51
|
+
closeCliRuntimeDeps(deps);
|
|
52
|
+
});
|
|
53
|
+
test("T1.2.3 probeOnly heartbeat_check does not write observability rows (host-safe carrier preserved)", async () => {
|
|
54
|
+
const stateDb = createStateDatabase(":memory:");
|
|
55
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
56
|
+
const deps = createCliRuntimeDeps({ stateDb, observabilityDb });
|
|
57
|
+
const router = createCommandRouter({ deps });
|
|
58
|
+
const cmd = router.resolve("heartbeat_check");
|
|
59
|
+
assert.ok(cmd);
|
|
60
|
+
const out = (await cmd.execute({ probeOnly: true }));
|
|
61
|
+
assert.equal(out.ok, true);
|
|
62
|
+
assert.equal(out.surfaceMode, "capability_probe");
|
|
63
|
+
const decisions = await observabilityDb.db.select().from(decisionLedger);
|
|
64
|
+
const attempts = await observabilityDb.db.select().from(executionAttempts);
|
|
65
|
+
assert.equal(decisions.filter((d) => d.traceId.startsWith("sn-runtime-")).length, 0, "probe-only must not write sn-runtime decision rows");
|
|
66
|
+
assert.equal(attempts.filter((a) => a.platformId === "second-nature-runtime").length, 0, "probe-only must not write second-nature-runtime attempts");
|
|
67
|
+
const after = await deps.readModels.loadStatus();
|
|
68
|
+
assert.equal(after.rhythm.mode, "unknown", "probe-only must keep rhythm.mode unknown");
|
|
69
|
+
assert.equal(after.runtime.serviceStatus, "unknown", "probe-only must keep runtime.serviceStatus unknown");
|
|
70
|
+
closeCliRuntimeDeps(deps);
|
|
71
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* T1.2.4 — Quiet JSON 工件与 `report`/`quiet` canonical 对齐 + workspace quietWorkflow 接线。
|
|
3
|
+
*
|
|
4
|
+
* CH-14-07 根因:
|
|
5
|
+
* - `persistQuietArtifactToWorkspace` 写入 `.second-nature/quiet/{day}/`
|
|
6
|
+
* - `loadQuiet` 读取 `memory/` 目录(journal + reports)
|
|
7
|
+
* - 两路数据断裂:写了 JSON 工件后,`loadQuiet` 仍返回 sourceCount=0
|
|
8
|
+
*
|
|
9
|
+
* 场测勘误:「写了读不到」当前现场不适用(磁盘无 `.second-nature/quiet/`);
|
|
10
|
+
* 但任务仍需保证 Quiet 一旦运行后读路径非空。
|
|
11
|
+
*
|
|
12
|
+
* 验收标准 A:fixture 已执行一次 source-backed Quiet 并落盘 JSON 后,
|
|
13
|
+
* `loadQuiet` 返回 sourceCount > 0 且 mode !== "unknown"。
|
|
14
|
+
* 验收标准 B:full-runtime heartbeat 选中 quiet intent(通过 maintenance_only + quietEnabled 路径
|
|
15
|
+
* 来触发 quiet intent 写盘)后,周期结果含 `quiet_artifact_written` 或诚实原因。
|
|
16
|
+
* 验收标准 C:quietWorkflow 接线后,heartbeat 不因 workspaceRoot 注入而崩溃。
|
|
17
|
+
*/
|
|
18
|
+
import test from "node:test";
|
|
19
|
+
import assert from "node:assert/strict";
|
|
20
|
+
import fs from "node:fs";
|
|
21
|
+
import path from "node:path";
|
|
22
|
+
import os from "node:os";
|
|
23
|
+
import { createCliReadModels } from "../../../src/cli/read-models/index.js";
|
|
24
|
+
import { createStateDatabase } from "../../../src/storage/db/index.js";
|
|
25
|
+
import { createObservabilityDatabase } from "../../../src/observability/db/index.js";
|
|
26
|
+
import { writeQuietArtifact } from "../../../src/storage/quiet/quiet-artifact-writer.js";
|
|
27
|
+
import { persistQuietArtifactToWorkspace } from "../../../src/storage/quiet/persist-quiet-artifact.js";
|
|
28
|
+
import { createWorkspaceHeartbeatRunner } from "../../../src/cli/ops/workspace-heartbeat-runner.js";
|
|
29
|
+
function makeTempWorkspace() {
|
|
30
|
+
return fs.mkdtempSync(path.join(os.tmpdir(), "sn-t124-"));
|
|
31
|
+
}
|
|
32
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
33
|
+
// ─── Case A: 写盘后 loadQuiet 非零 ───────────────────────────────────────────
|
|
34
|
+
test("T1.2.4 A — after empty Quiet artifact persisted, loadQuiet tracks empty state separately", async () => {
|
|
35
|
+
const ws = makeTempWorkspace();
|
|
36
|
+
const stateDb = createStateDatabase(":memory:");
|
|
37
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
38
|
+
const readModels = createCliReadModels({
|
|
39
|
+
stateDb,
|
|
40
|
+
observabilityDb,
|
|
41
|
+
workspaceRoot: ws,
|
|
42
|
+
});
|
|
43
|
+
// Before: quiet should be unknown
|
|
44
|
+
const before = await readModels.loadQuiet();
|
|
45
|
+
assert.equal(before.mode, "unknown", "Before Quiet runs, mode must be unknown");
|
|
46
|
+
assert.equal(before.sourceCount, 0, "Before Quiet runs, sourceCount must be 0");
|
|
47
|
+
// Simulate Quiet artifact write (empty_state path, simplest valid write).
|
|
48
|
+
const input = {
|
|
49
|
+
day: today,
|
|
50
|
+
kind: "empty_state",
|
|
51
|
+
title: "Quiet — empty state test",
|
|
52
|
+
body: "No evidence.",
|
|
53
|
+
claims: [],
|
|
54
|
+
sourceRefs: [],
|
|
55
|
+
};
|
|
56
|
+
const ack = writeQuietArtifact(input);
|
|
57
|
+
await persistQuietArtifactToWorkspace(ws, ack, input);
|
|
58
|
+
// After: empty_state is visible, but does not masquerade as a source-backed report.
|
|
59
|
+
const after = await readModels.loadQuiet();
|
|
60
|
+
assert.equal(after.sourceCount, 0, `Expected sourceCount to remain 0 for empty_state; got ${after.sourceCount}`);
|
|
61
|
+
assert.equal(after.emptyStateCount, 1);
|
|
62
|
+
assert.equal(after.mode, "unknown", "Empty state alone must not switch Quiet read model into source-backed mode");
|
|
63
|
+
stateDb.close();
|
|
64
|
+
observabilityDb.close();
|
|
65
|
+
fs.rmSync(ws, { recursive: true, force: true });
|
|
66
|
+
});
|
|
67
|
+
// ─── Case B: 无 workspaceRoot → loadQuiet 静默降级,不崩溃 ───────────────────
|
|
68
|
+
test("T1.2.4 B — without workspaceRoot, loadQuiet returns unknown gracefully", async () => {
|
|
69
|
+
const stateDb = createStateDatabase(":memory:");
|
|
70
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
71
|
+
// Intentionally omit workspaceRoot.
|
|
72
|
+
const readModels = createCliReadModels({ stateDb, observabilityDb });
|
|
73
|
+
const result = await readModels.loadQuiet();
|
|
74
|
+
// Without workspaceRoot, can't scan .second-nature/quiet/ — should return unknown safely.
|
|
75
|
+
assert.equal(result.mode, "unknown", "Without workspaceRoot, mode must be unknown (no evidence)");
|
|
76
|
+
assert.equal(result.sourceCount, 0, "Without workspaceRoot, sourceCount must be 0");
|
|
77
|
+
stateDb.close();
|
|
78
|
+
observabilityDb.close();
|
|
79
|
+
});
|
|
80
|
+
// ─── Case C: quietWorkflow 注入不崩溃心跳 ─────────────────────────────────────
|
|
81
|
+
test("T1.2.4 C — createWorkspaceHeartbeatRunner with quietWorkflow injected does not crash", async () => {
|
|
82
|
+
const ws = makeTempWorkspace();
|
|
83
|
+
const stateDb = createStateDatabase(":memory:");
|
|
84
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
85
|
+
const readModels = createCliReadModels({
|
|
86
|
+
stateDb,
|
|
87
|
+
observabilityDb,
|
|
88
|
+
workspaceRoot: ws,
|
|
89
|
+
});
|
|
90
|
+
const runner = createWorkspaceHeartbeatRunner(readModels, {
|
|
91
|
+
workspaceRoot: ws,
|
|
92
|
+
enableQuietWorkflow: true,
|
|
93
|
+
state: stateDb,
|
|
94
|
+
});
|
|
95
|
+
const signal = {
|
|
96
|
+
trigger: "heartbeat_bridge",
|
|
97
|
+
scopeHint: "rhythm",
|
|
98
|
+
payload: { timestamp: "2026-05-10T10:00:00.000Z" },
|
|
99
|
+
};
|
|
100
|
+
const result = await runner(signal);
|
|
101
|
+
// Should complete without throwing, returning a valid HeartbeatCycleResult.
|
|
102
|
+
assert.ok(result.status, "heartbeat cycle must return a valid status");
|
|
103
|
+
assert.ok(Array.isArray(result.reasons), "heartbeat cycle must return reasons array");
|
|
104
|
+
stateDb.close();
|
|
105
|
+
observabilityDb.close();
|
|
106
|
+
fs.rmSync(ws, { recursive: true, force: true });
|
|
107
|
+
});
|
|
108
|
+
// ─── Case D: quiet intent path → artifact 写盘 → loadQuiet 读到 ───────────────
|
|
109
|
+
test("T1.2.4 D — after quiet intent writes artifact via heartbeat runner, loadQuiet reads it back", async () => {
|
|
110
|
+
const ws = makeTempWorkspace();
|
|
111
|
+
const stateDb = createStateDatabase(":memory:");
|
|
112
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
113
|
+
const readModels = createCliReadModels({
|
|
114
|
+
stateDb,
|
|
115
|
+
observabilityDb,
|
|
116
|
+
workspaceRoot: ws,
|
|
117
|
+
});
|
|
118
|
+
// Directly persist a daily_report artifact (simulating a non-empty Quiet path).
|
|
119
|
+
const input = {
|
|
120
|
+
day: today,
|
|
121
|
+
kind: "daily_report",
|
|
122
|
+
title: "Quiet daily report",
|
|
123
|
+
body: "Source-backed summary.",
|
|
124
|
+
claims: [
|
|
125
|
+
{
|
|
126
|
+
id: "fact:1",
|
|
127
|
+
text: "Evidence-backed fact",
|
|
128
|
+
claimType: "fact",
|
|
129
|
+
sourceRefs: [
|
|
130
|
+
{ id: "src-1", kind: "platform_item", uri: "moltbook://1" },
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
sourceRefs: [
|
|
135
|
+
{
|
|
136
|
+
id: "src-1",
|
|
137
|
+
kind: "platform_item",
|
|
138
|
+
uri: "moltbook://1",
|
|
139
|
+
excerptHash: undefined,
|
|
140
|
+
observedAt: undefined,
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
};
|
|
144
|
+
const ack = writeQuietArtifact(input);
|
|
145
|
+
await persistQuietArtifactToWorkspace(ws, ack, input);
|
|
146
|
+
const quietResult = await readModels.loadQuiet();
|
|
147
|
+
assert.ok(quietResult.sourceCount > 0, "loadQuiet must reflect persisted daily_report artifact");
|
|
148
|
+
assert.equal(quietResult.mode, "quiet", "mode must be 'quiet' when artifacts exist");
|
|
149
|
+
assert.ok(quietResult.reportCount > 0, "reportCount must be > 0 after artifact persisted");
|
|
150
|
+
stateDb.close();
|
|
151
|
+
observabilityDb.close();
|
|
152
|
+
fs.rmSync(ws, { recursive: true, force: true });
|
|
153
|
+
});
|
|
154
|
+
// ─── Case E: loadDailyReport 也反映写盘工件(T1.2.4 / code review gap 修复)──────
|
|
155
|
+
//
|
|
156
|
+
// Code review 发现 loadDailyReport 未扫描 .second-nature/quiet/{day}/;
|
|
157
|
+
// 本测试验证修复后 loadDailyReport(day).sourceRefs 能反映写盘工件。
|
|
158
|
+
test("T1.2.4 E — after Quiet artifact persisted, loadDailyReport sourceRefs is non-empty", async () => {
|
|
159
|
+
const ws = makeTempWorkspace();
|
|
160
|
+
const stateDb = createStateDatabase(":memory:");
|
|
161
|
+
const observabilityDb = createObservabilityDatabase(":memory:");
|
|
162
|
+
const readModels = createCliReadModels({
|
|
163
|
+
stateDb,
|
|
164
|
+
observabilityDb,
|
|
165
|
+
workspaceRoot: ws,
|
|
166
|
+
});
|
|
167
|
+
// Before: loadDailyReport should have no sourceRefs.
|
|
168
|
+
const before = await readModels.loadDailyReport(today);
|
|
169
|
+
assert.equal(before.sourceRefs.length, 0, "Before artifact persisted, sourceRefs must be empty");
|
|
170
|
+
// Write a source-backed Quiet report artifact for today.
|
|
171
|
+
const input = {
|
|
172
|
+
day: today,
|
|
173
|
+
kind: "daily_report",
|
|
174
|
+
title: "Quiet — daily report test",
|
|
175
|
+
body: "Saw a source-backed event worth carrying forward.",
|
|
176
|
+
claims: [
|
|
177
|
+
{
|
|
178
|
+
id: "fact:daily-report-source",
|
|
179
|
+
text: "Source-backed event observed.",
|
|
180
|
+
claimType: "fact",
|
|
181
|
+
sourceRefs: [
|
|
182
|
+
{
|
|
183
|
+
id: "src-daily-report-source",
|
|
184
|
+
kind: "platform_item",
|
|
185
|
+
uri: "moltbook://daily-report-source",
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
sourceRefs: [
|
|
191
|
+
{
|
|
192
|
+
id: "src-daily-report-source",
|
|
193
|
+
kind: "platform_item",
|
|
194
|
+
uri: "moltbook://daily-report-source",
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
};
|
|
198
|
+
const ack = writeQuietArtifact(input);
|
|
199
|
+
await persistQuietArtifactToWorkspace(ws, ack, input);
|
|
200
|
+
// After: loadDailyReport should include the artifact as a sourceRef.
|
|
201
|
+
const after = await readModels.loadDailyReport(today);
|
|
202
|
+
assert.ok(after.sourceRefs.length > 0, `Expected loadDailyReport sourceRefs to be non-empty after artifact persisted; got ${after.sourceRefs.length}`);
|
|
203
|
+
stateDb.close();
|
|
204
|
+
observabilityDb.close();
|
|
205
|
+
fs.rmSync(ws, { recursive: true, force: true });
|
|
206
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|