@mindrian_os/cli 2.0.0-beta.3 → 2.0.0-beta.31
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/.claude-plugin/plugin.json +21 -0
- package/.mcp.json +14 -0
- package/CHANGELOG.md +467 -0
- package/agents/analogy-query-fetcher.md +119 -0
- package/agents/brain-query.md +91 -0
- package/agents/competitor-watch-fetcher.md +94 -0
- package/agents/framework-runner.md +258 -0
- package/agents/grading.md +216 -0
- package/agents/grant-reviewer.md +191 -0
- package/agents/investor.md +141 -0
- package/agents/larry-extended.md +215 -0
- package/agents/meeting-perspective-extractor.md +94 -0
- package/agents/opportunity-scanner.md +105 -0
- package/agents/persona-analyst.md +201 -0
- package/agents/research.md +103 -0
- package/agents/reverse-salient-agent.md +42 -0
- package/agents/vault-section-reviewer.md +107 -0
- package/assets/banner-showcase.html +537 -0
- package/assets/fonts/BebasNeue-Regular.ttf +0 -0
- package/assets/fonts/Inter-Bold.ttf +0 -0
- package/assets/fonts/Inter-Regular.ttf +0 -0
- package/assets/logo.svg +10 -0
- package/bin/local-chain-recommender.cjs +256 -0
- package/bin/mindrian-brain-mcp-client.cjs +319 -0
- package/bin/mindrian-mcp-server.cjs +445 -0
- package/bin/mindrian-mcp-shim.cjs +100 -0
- package/bin/mindrian-tools.cjs +784 -0
- package/commands/act.md +529 -0
- package/commands/admin.md +439 -0
- package/commands/agentshield.md +49 -0
- package/commands/analyze-needs.md +78 -0
- package/commands/analyze-systems.md +73 -0
- package/commands/analyze-timing.md +98 -0
- package/commands/auto-explore.md +85 -0
- package/commands/beautiful-question.md +76 -0
- package/commands/bono.md +152 -0
- package/commands/brain-derive.md +137 -0
- package/commands/build-knowledge.md +121 -0
- package/commands/build-thesis.md +94 -0
- package/commands/causal.md +269 -0
- package/commands/challenge-assumptions.md +78 -0
- package/commands/compare-ventures.md +117 -0
- package/commands/correct-reference-now.md +88 -0
- package/commands/dashboard.md +144 -0
- package/commands/deck.md +117 -0
- package/commands/deep-grade.md +214 -0
- package/commands/diagnose.md +131 -0
- package/commands/diagnostics.md +195 -0
- package/commands/dial-memory-refresh.md +113 -0
- package/commands/diffusion.md +129 -0
- package/commands/discover.md +221 -0
- package/commands/doctor.md +271 -0
- package/commands/dogfood-flush.md +130 -0
- package/commands/dominant-designs.md +76 -0
- package/commands/eureka.md +315 -0
- package/commands/explain-decision.md +135 -0
- package/commands/explore-domains.md +78 -0
- package/commands/explore-futures.md +67 -0
- package/commands/explore-opportunity.md +172 -0
- package/commands/explore-trends.md +78 -0
- package/commands/export.md +128 -0
- package/commands/feynman-timeline-refresh.md +102 -0
- package/commands/file-meeting.md +1195 -0
- package/commands/find-analogies.md +369 -0
- package/commands/find-bottlenecks.md +108 -0
- package/commands/find-connections.md +111 -0
- package/commands/funding.md +114 -0
- package/commands/futures.md +128 -0
- package/commands/grade-grant.md +297 -0
- package/commands/grade.md +257 -0
- package/commands/graph.md +218 -0
- package/commands/hat-briefing.md +163 -0
- package/commands/heal.md +72 -0
- package/commands/help.md +176 -0
- package/commands/hmi-status.md +75 -0
- package/commands/ignite.md +229 -0
- package/commands/ingest-methodology.md +128 -0
- package/commands/intel-pipeline.md +133 -0
- package/commands/jtbd.md +262 -0
- package/commands/leadership.md +113 -0
- package/commands/lean-canvas.md +74 -0
- package/commands/macro-trends.md +88 -0
- package/commands/map-unknowns.md +76 -0
- package/commands/memory-cortex-reach.md +79 -0
- package/commands/memory.md +213 -0
- package/commands/models.md +200 -0
- package/commands/mos-reason.md +489 -0
- package/commands/mos.md +162 -0
- package/commands/mullins.md +155 -0
- package/commands/mva-brief.md +86 -0
- package/commands/mva-option.md +119 -0
- package/commands/mva-report.md +76 -0
- package/commands/new-project.md +633 -0
- package/commands/new-surface.md +116 -0
- package/commands/onboard.md +489 -0
- package/commands/operator.md +168 -0
- package/commands/opportunities.md +177 -0
- package/commands/organize.md +74 -0
- package/commands/persona.md +276 -0
- package/commands/pipeline.md +167 -0
- package/commands/present.md +125 -0
- package/commands/publish.md +227 -0
- package/commands/pws-brain.md +154 -0
- package/commands/qualify-opportunity.md +113 -0
- package/commands/query.md +70 -0
- package/commands/radar.md +110 -0
- package/commands/reanalyze.md +124 -0
- package/commands/research.md +467 -0
- package/commands/room.md +385 -0
- package/commands/rooms.md +682 -0
- package/commands/root-cause.md +77 -0
- package/commands/rs-experts.md +153 -0
- package/commands/rs-explain.md +134 -0
- package/commands/rs-fetch.md +119 -0
- package/commands/rs-thesis.md +131 -0
- package/commands/scenario-plan.md +80 -0
- package/commands/scheduled-tasks.md +308 -0
- package/commands/score-innovation.md +78 -0
- package/commands/scout.md +379 -0
- package/commands/setup.md +658 -0
- package/commands/show.md +71 -0
- package/commands/skill.md +108 -0
- package/commands/snapshot.md +179 -0
- package/commands/speakers.md +118 -0
- package/commands/splash.md +55 -0
- package/commands/stance.md +91 -0
- package/commands/status.md +109 -0
- package/commands/structure-argument.md +82 -0
- package/commands/suggest-next.md +141 -0
- package/commands/systems-thinking.md +224 -0
- package/commands/think-hats.md +86 -0
- package/commands/trending-to-absurd.md +151 -0
- package/commands/update.md +256 -0
- package/commands/user-needs.md +77 -0
- package/commands/validate.md +77 -0
- package/commands/value-proposition.md +116 -0
- package/commands/vault.md +330 -0
- package/commands/visualize.md +71 -0
- package/commands/whitespace.md +541 -0
- package/commands/wiki.md +96 -0
- package/data/ROOM.md +47 -0
- package/data/brain-census.generated.json +2617 -0
- package/data/brain-orchestration-projection.json +4973 -0
- package/data/brain-packet-schema.json +545 -0
- package/data/brain-surface-contract.json +32 -0
- package/data/capability-ledger.json +391 -0
- package/data/capability-map-registry.json +23 -0
- package/data/command-registry.json +2433 -0
- package/data/connector-coverage-ledger.json +1618 -0
- package/data/connector-out-of-spine-allowlist.json +71 -0
- package/data/connector-registry.json +3637 -0
- package/data/corpus-stats-source.json +11 -0
- package/data/corpus-stats.generated.json +10 -0
- package/data/cross-domain-analogues.json +15 -0
- package/data/deck-aliases.json +6 -0
- package/data/deck-styles.json +85 -0
- package/data/deployment-surfaces.json +69 -0
- package/data/dispatch-framework-map.json +18 -0
- package/data/doctor-modules.json +206 -0
- package/data/dual-graph-health-baseline.json +12 -0
- package/data/eureka-critic-tags.json +32 -0
- package/data/first-reward-surfaces.json +66 -0
- package/data/first-touch-surfaces.json +60 -0
- package/data/flagship-floor-set.json +37 -0
- package/data/framework-names.json +121 -0
- package/data/grant-rubric-fixtures/early-stage-pre-seed.json +18 -0
- package/data/grant-rubric-fixtures/early-stage-round-a.json +18 -0
- package/data/grant-rubric-fixtures/early-stage-seed.json +18 -0
- package/data/grant-rubric-fixtures/hybrid-seed-incentive.json +18 -0
- package/data/grant-rubric-fixtures/rd-fund.json +18 -0
- package/data/grant-rubric-fixtures/regional-innovation-incubators.json +18 -0
- package/data/grant-rubric-fixtures/technology-incubators.json +18 -0
- package/data/grant-rubric-fixtures/tnufa.json +167 -0
- package/data/grant-rubric-schema.json +33 -0
- package/data/harness-fixtures/converged-room/.context/ROOM.md +13 -0
- package/data/harness-fixtures/converged-room/.intelligence/ROOM.md +13 -0
- package/data/harness-fixtures/converged-room/.snapshots/ROOM.md +13 -0
- package/data/harness-fixtures/converged-room/MINTO.md +19 -0
- package/data/harness-fixtures/converged-room/STATE.md +73 -0
- package/data/harness-fixtures/converged-room/USER.md +23 -0
- package/data/harness-fixtures/converged-room/assets/ROOM.md +13 -0
- package/data/harness-fixtures/converged-room/business-model/CONTEXT.md +32 -0
- package/data/harness-fixtures/converged-room/business-model/ROOM.md +36 -0
- package/data/harness-fixtures/converged-room/competitive-analysis/CONTEXT.md +33 -0
- package/data/harness-fixtures/converged-room/competitive-analysis/ROOM.md +35 -0
- package/data/harness-fixtures/converged-room/financial-model/CONTEXT.md +30 -0
- package/data/harness-fixtures/converged-room/financial-model/ROOM.md +35 -0
- package/data/harness-fixtures/converged-room/funding/CONTEXT.md +41 -0
- package/data/harness-fixtures/converged-room/funding/ROOM.md +35 -0
- package/data/harness-fixtures/converged-room/legal-ip/CONTEXT.md +30 -0
- package/data/harness-fixtures/converged-room/legal-ip/ROOM.md +35 -0
- package/data/harness-fixtures/converged-room/market-analysis/CONTEXT.md +32 -0
- package/data/harness-fixtures/converged-room/market-analysis/ROOM.md +35 -0
- package/data/harness-fixtures/converged-room/opportunity-bank/CONTEXT.md +39 -0
- package/data/harness-fixtures/converged-room/opportunity-bank/ROOM.md +36 -0
- package/data/harness-fixtures/converged-room/problem-definition/CONTEXT.md +32 -0
- package/data/harness-fixtures/converged-room/problem-definition/ROOM.md +36 -0
- package/data/harness-fixtures/converged-room/references/ROOM.md +13 -0
- package/data/harness-fixtures/converged-room/references/SECTION-SCHEMA.md +213 -0
- package/data/harness-fixtures/converged-room/references/SUB-SCHEMAS.md +91 -0
- package/data/harness-fixtures/converged-room/solution-design/CONTEXT.md +36 -0
- package/data/harness-fixtures/converged-room/solution-design/ROOM.md +36 -0
- package/data/harness-fixtures/converged-room/strategy/CONTEXT.md +35 -0
- package/data/harness-fixtures/converged-room/strategy/ROOM.md +35 -0
- package/data/harness-fixtures/converged-room/team/ROOM.md +13 -0
- package/data/harness-fixtures/converged-room/team-execution/CONTEXT.md +36 -0
- package/data/harness-fixtures/converged-room/team-execution/ROOM.md +35 -0
- package/data/harness-manifest.json +74 -0
- package/data/harness-policies/CONTEXT.md +55 -0
- package/data/harness-policies/_schema.json +42 -0
- package/data/harness-policies/contract-parity-larry.json +63 -0
- package/data/harness-policies/gate-card-fire.json +13 -0
- package/data/harness-policies/gate-graph-derive-health.json +13 -0
- package/data/harness-policies/gate-shape-declaration.json +13 -0
- package/data/harness-policies/gate-tool-honesty.json +13 -0
- package/data/harness-policies/gate-worktree-hygiene.json +13 -0
- package/data/harness-policies/memory-write-policy.json +28 -0
- package/data/harness-policies/registry-drift.json +13 -0
- package/data/harness-policies/release-payload-ceiling.json +13 -0
- package/data/harness-policies/voice-backend-noun-free.json +13 -0
- package/data/harness-policies/voice-fork-as-card.json +13 -0
- package/data/harness-policies/voice-glyph-present.json +13 -0
- package/data/harness-policies/voice-hyphens-only.json +13 -0
- package/data/help-groups.json +236 -0
- package/data/hitl-shape-backfill.json +777 -0
- package/data/hitl-shape-declaration-fixtures/invalid-bad-shape.json +5 -0
- package/data/hitl-shape-declaration-fixtures/invalid-missing-why.json +4 -0
- package/data/hitl-shape-declaration-fixtures/invalid-ranker-contradiction.json +6 -0
- package/data/hitl-shape-declaration-fixtures/invalid-skill-gap.json +3 -0
- package/data/hitl-shape-declaration-fixtures/valid-multi-stage.json +7 -0
- package/data/hitl-shape-declaration-fixtures/valid-single-shape.json +5 -0
- package/data/hitl-shape-declaration-fixtures/valid-skill-exempt.json +5 -0
- package/data/hitl-shape-declaration-schema.json +34 -0
- package/data/hitl-stages-fixtures/bono.json +10 -0
- package/data/hitl-stages-fixtures/pipeline-1.json +9 -0
- package/data/hitl-stages-fixtures/pipeline-2.json +9 -0
- package/data/hitl-stages-fixtures/pipeline-3.json +10 -0
- package/data/hitl-stages-fixtures/research.json +10 -0
- package/data/hitl-stages-fixtures/rs-convergence.json +10 -0
- package/data/hitl-stages-fixtures/rs-family.json +11 -0
- package/data/hitl-stages-fixtures/rs-reverse-salient.json +10 -0
- package/data/hitl-stages-fixtures/trending-to-absurd.json +11 -0
- package/data/hitl-stages-schema.json +26 -0
- package/data/mcp-tool-connectors.json +464 -0
- package/data/mva-agent-prompts.json +31 -0
- package/data/mva-deck-template.html +15 -0
- package/data/mva-heuristic-keywords.json +35 -0
- package/data/orchestration-command-ledger.json +576 -0
- package/data/orchestration-unwired-allowlist.json +6 -0
- package/data/portfolio-ahp-matrix.json +16 -0
- package/data/publish-needs.json +76 -0
- package/data/render-coverage-registry.json +1152 -0
- package/data/research-sources.json +58 -0
- package/data/roadmap-type-chains.json +28 -0
- package/data/room-blueprints.json +156 -0
- package/data/subagent-dispatch-grants.json +150 -0
- package/hooks/hooks.json +493 -0
- package/hooks/run-hook.cmd +64 -0
- package/lib/__init__.py +0 -0
- package/lib/__pycache__/__init__.cpython-312.pyc +0 -0
- package/lib/agents/auto-explore-agent.cjs +1163 -0
- package/lib/agents/mva/brain-classic-traps.cjs +55 -0
- package/lib/agents/mva/brain-cross-domain.cjs +79 -0
- package/lib/agents/mva/brain-similar-ventures.cjs +93 -0
- package/lib/agents/mva/dashboard-graph-neighborhood.cjs +72 -0
- package/lib/agents/mva/index.cjs +42 -0
- package/lib/agents/mva/six-hats-red-black.cjs +137 -0
- package/lib/agents/mva/tavily-funding-scan.cjs +147 -0
- package/lib/agents/mva/test-all-six-agents.cjs +467 -0
- package/lib/agents/reverse-salient-agent.cjs +757 -0
- package/lib/agents/tension-hook-agent.cjs +586 -0
- package/lib/brain/ROOM.md +44 -0
- package/lib/brain/chain-recommender.cjs +784 -0
- package/lib/brain/curation-batch.cjs +519 -0
- package/lib/brain/framework-chain-slice.cjs +252 -0
- package/lib/brain/hypergraph-event-schema.cjs +184 -0
- package/lib/chat/chat-context.js +185 -0
- package/lib/chat/chat-panel.js +721 -0
- package/lib/chat/fabric-chat.cjs +288 -0
- package/lib/chat/generative-tools.js +219 -0
- package/lib/conversation/ROOM.md +39 -0
- package/lib/conversation/classifier-rules.json +38 -0
- package/lib/conversation/classifier.cjs +264 -0
- package/lib/conversation/operator-epistemic-cap.test.cjs +156 -0
- package/lib/conversation/operator.cjs +492 -0
- package/lib/conversation/operator.test.cjs +160 -0
- package/lib/copy/115-spec-strings.cjs +55 -0
- package/lib/core/__init__.py +0 -0
- package/lib/core/__nav-stub.cjs +14 -0
- package/lib/core/__pycache__/__init__.cpython-312.pyc +0 -0
- package/lib/core/__pycache__/rs-math.cpython-312.pyc +0 -0
- package/lib/core/__pycache__/rs_cache.cpython-312.pyc +0 -0
- package/lib/core/__pycache__/rs_corpus.cpython-312.pyc +0 -0
- package/lib/core/__pycache__/rs_corpus_exclude.cpython-312.pyc +0 -0
- package/lib/core/__pycache__/rs_hybrid.cpython-312.pyc +0 -0
- package/lib/core/__pycache__/rs_math.cpython-312.pyc +0 -0
- package/lib/core/__pycache__/rs_rooms.cpython-312.pyc +0 -0
- package/lib/core/abstraction-gate.cjs +133 -0
- package/lib/core/act-jtbd-blurb.cjs +231 -0
- package/lib/core/artifact-id.cjs +148 -0
- package/lib/core/asset-ops.cjs +151 -0
- package/lib/core/auto-commit-throttle.cjs +129 -0
- package/lib/core/bearer-token.cjs +199 -0
- package/lib/core/behavioral/observation-schema.cjs +86 -0
- package/lib/core/bono/cell-fanout.cjs +305 -0
- package/lib/core/bono/debate-composition.cjs +495 -0
- package/lib/core/bono/hat-governance.cjs +367 -0
- package/lib/core/bono/persona-research.cjs +288 -0
- package/lib/core/bono/reviewer-governance.cjs +331 -0
- package/lib/core/brain-client.cjs +2365 -0
- package/lib/core/brain-derivation-prompts.cjs +331 -0
- package/lib/core/brain-derivation-queue.cjs +535 -0
- package/lib/core/brain-derivation.cjs +740 -0
- package/lib/core/brain-md-schema.cjs +528 -0
- package/lib/core/brain-md-staleness.cjs +357 -0
- package/lib/core/brain-response-sanitize.cjs +396 -0
- package/lib/core/breakthrough/canary.cjs +134 -0
- package/lib/core/breakthrough/canary.test.cjs +136 -0
- package/lib/core/breakthrough/detectors.cjs +359 -0
- package/lib/core/breakthrough/detectors.test.cjs +333 -0
- package/lib/core/breakthrough/ethics-fence.cjs +129 -0
- package/lib/core/breakthrough/ethics-fence.test.cjs +178 -0
- package/lib/core/breakthrough/resurfacing.cjs +150 -0
- package/lib/core/breakthrough/resurfacing.test.cjs +233 -0
- package/lib/core/breakthrough/review-queue.cjs +168 -0
- package/lib/core/breakthrough/review-queue.test.cjs +160 -0
- package/lib/core/breakthrough/scanner-d17-d18.test.cjs +229 -0
- package/lib/core/breakthrough/scanner.cjs +435 -0
- package/lib/core/breakthrough/scanner.test.cjs +267 -0
- package/lib/core/breakthrough/schema.cjs +180 -0
- package/lib/core/breakthrough/schema.test.cjs +256 -0
- package/lib/core/breakthrough/scoring.cjs +293 -0
- package/lib/core/breakthrough/scoring.test.cjs +423 -0
- package/lib/core/breakthrough/verb-dispatch.cjs +230 -0
- package/lib/core/breakthrough/verb-dispatch.test.cjs +185 -0
- package/lib/core/breakthrough/voice-scaffold.cjs +249 -0
- package/lib/core/breakthrough/voice-scaffold.test.cjs +251 -0
- package/lib/core/bridge-writer.cjs +477 -0
- package/lib/core/cache-prune.cjs +314 -0
- package/lib/core/card-fire-gate.cjs +107 -0
- package/lib/core/card-fire-sidechannel.cjs +518 -0
- package/lib/core/chain-executor.cjs +939 -0
- package/lib/core/chain-retry.cjs +214 -0
- package/lib/core/chain-step-dispatcher.cjs +397 -0
- package/lib/core/chat-context-builder.cjs +253 -0
- package/lib/core/check-plugin-enabled.cjs +145 -0
- package/lib/core/close-loop-writer.cjs +492 -0
- package/lib/core/command-registration-check.cjs +246 -0
- package/lib/core/correlation-label-index.cjs +230 -0
- package/lib/core/correlation.cjs +112 -0
- package/lib/core/coverage-monitor.cjs +183 -0
- package/lib/core/coverage-rollup.cjs +232 -0
- package/lib/core/cross-room-aggregator.cjs +1127 -0
- package/lib/core/cross-room-store.cjs +292 -0
- package/lib/core/cross-room-triggers.cjs +222 -0
- package/lib/core/daily-briefing.cjs +438 -0
- package/lib/core/decision-axes.cjs +178 -0
- package/lib/core/decision-capture.cjs +618 -0
- package/lib/core/deck-design-rules.cjs +211 -0
- package/lib/core/deep-links.cjs +82 -0
- package/lib/core/directive-envelope.cjs +217 -0
- package/lib/core/directive-envelope.test.cjs +225 -0
- package/lib/core/dispatch-optimizer.cjs +354 -0
- package/lib/core/doc-text-extractor.cjs +133 -0
- package/lib/core/doctor/capability-ledger-module.cjs +170 -0
- package/lib/core/doctor/card-fire-health-module.cjs +159 -0
- package/lib/core/doctor/cascade-rooms-active-module.cjs +127 -0
- package/lib/core/doctor/cascade-rooms-module.cjs +184 -0
- package/lib/core/doctor/class-m-brain-smoke.cjs +479 -0
- package/lib/core/doctor/class-m-brain-smoke.test.cjs +448 -0
- package/lib/core/doctor/class-s-eureka-smoke.cjs +380 -0
- package/lib/core/doctor/deployment-surfaces-module.cjs +408 -0
- package/lib/core/doctor/deprecated-usage-module.cjs +155 -0
- package/lib/core/doctor/eureka-fts-health-module.cjs +236 -0
- package/lib/core/doctor/graph-derive-heal-retrofit-module.cjs +148 -0
- package/lib/core/doctor/graph-derive-health-module.cjs +486 -0
- package/lib/core/doctor/install-incomplete-module.cjs +320 -0
- package/lib/core/doctor/install-state-module.cjs +503 -0
- package/lib/core/doctor/mcp-surface-module.cjs +369 -0
- package/lib/core/doctor/mode-select-checkpoint-module.cjs +113 -0
- package/lib/core/doctor/plugin-enabled-state-module.cjs +86 -0
- package/lib/core/doctor/room-graph-density-module.cjs +181 -0
- package/lib/core/doctor/room-md-module.cjs +198 -0
- package/lib/core/doctor/shared.cjs +555 -0
- package/lib/core/doctor/stale-first-touch-copy-module.cjs +83 -0
- package/lib/core/doctor/statusline-visibility-module.cjs +295 -0
- package/lib/core/doctor/ui-compliance-module.cjs +223 -0
- package/lib/core/doctor/umbilical-module.cjs +486 -0
- package/lib/core/doctor/verify-surface-module.cjs +82 -0
- package/lib/core/doctor/voice-style-log-module.cjs +146 -0
- package/lib/core/domain-insight-sweep.cjs +224 -0
- package/lib/core/drift-baseline.cjs +362 -0
- package/lib/core/drift-runtime-reachability.cjs +283 -0
- package/lib/core/dual-path-detector.cjs +84 -0
- package/lib/core/dual-path-detector.test.cjs +334 -0
- package/lib/core/enrichment-queue.cjs +636 -0
- package/lib/core/eureka/ahp-weights.cjs +232 -0
- package/lib/core/eureka/analogy-fitness.cjs +326 -0
- package/lib/core/eureka/compression-meter.cjs +165 -0
- package/lib/core/eureka/embedding-classifier.cjs +226 -0
- package/lib/core/eureka/embedding-spine.cjs +563 -0
- package/lib/core/eureka/entity-classifier.cjs +232 -0
- package/lib/core/eureka/entity-extractor.cjs +356 -0
- package/lib/core/eureka/eureka-enable.cjs +228 -0
- package/lib/core/eureka/eureka-offer.cjs +225 -0
- package/lib/core/eureka/eureka-reach-runner.cjs +430 -0
- package/lib/core/eureka/explore-chain.cjs +834 -0
- package/lib/core/eureka/explored-artifact.cjs +456 -0
- package/lib/core/eureka/fts-index-lifecycle.cjs +265 -0
- package/lib/core/eureka/grade-grant-examine.cjs +544 -0
- package/lib/core/eureka/grade-grant.cjs +596 -0
- package/lib/core/eureka/hybrid-retrieve.cjs +256 -0
- package/lib/core/eureka/lateral-engine-adapter.cjs +118 -0
- package/lib/core/eureka/lexical-overlap.cjs +98 -0
- package/lib/core/eureka/online-pattern-query.cjs +142 -0
- package/lib/core/eureka/opportunity-harvest.cjs +752 -0
- package/lib/core/eureka/opportunity-statement.cjs +519 -0
- package/lib/core/eureka/portfolio-dimensions.cjs +255 -0
- package/lib/core/eureka/qualify-opportunity.cjs +607 -0
- package/lib/core/eureka/reasoning-mode.cjs +481 -0
- package/lib/core/eureka/report-html.cjs +368 -0
- package/lib/core/eureka/research-filing.cjs +547 -0
- package/lib/core/eureka/room-native-substrate.cjs +343 -0
- package/lib/core/eureka/tail-quadrant.cjs +177 -0
- package/lib/core/eureka/tri-modal-index.cjs +564 -0
- package/lib/core/eureka/vector-store.cjs +414 -0
- package/lib/core/eureka-critic.cjs +733 -0
- package/lib/core/eureka-deps-resolver.cjs +179 -0
- package/lib/core/expert-genesis.cjs +437 -0
- package/lib/core/expert-library.cjs +303 -0
- package/lib/core/exports-log.cjs +79 -0
- package/lib/core/feynman/ROOM.md +25 -0
- package/lib/core/feynman/dial-memory-renderer.cjs +279 -0
- package/lib/core/feynman/dial-memory-runner.cjs +173 -0
- package/lib/core/feynman/feynman-seed-writer.cjs +187 -0
- package/lib/core/feynman/timeline-renderer.cjs +197 -0
- package/lib/core/feynman/timeline-runner.cjs +281 -0
- package/lib/core/feynman-minto-invariants.cjs +609 -0
- package/lib/core/findings-wirer.cjs +360 -0
- package/lib/core/first-touch-version-stamper.cjs +113 -0
- package/lib/core/folder-memory-async.cjs +424 -0
- package/lib/core/folder-memory-shared.cjs +890 -0
- package/lib/core/folder-memory.cjs +546 -0
- package/lib/core/framework-chain-composer.cjs +583 -0
- package/lib/core/frontmatter-schemas.cjs +468 -0
- package/lib/core/fusion-router.cjs +540 -0
- package/lib/core/futures/causal-cue.cjs +91 -0
- package/lib/core/futures/orchestrator.cjs +1391 -0
- package/lib/core/futures/subsystem-render.cjs +164 -0
- package/lib/core/gate-relevance.cjs +278 -0
- package/lib/core/git-ops.cjs +141 -0
- package/lib/core/graph-backfill.cjs +562 -0
- package/lib/core/graph-candidate-producer.cjs +235 -0
- package/lib/core/graph-derivation.cjs +546 -0
- package/lib/core/graph-derive-classifier.cjs +352 -0
- package/lib/core/graph-ops.cjs +274 -0
- package/lib/core/graph-refine-loop.cjs +194 -0
- package/lib/core/graph-self-heal.cjs +289 -0
- package/lib/core/greeting-intent-detector.cjs +201 -0
- package/lib/core/grill-engine.cjs +459 -0
- package/lib/core/hat-persistence.cjs +274 -0
- package/lib/core/hsi-engine.cjs +439 -0
- package/lib/core/hsi-lsa.cjs +246 -0
- package/lib/core/hsi-spectral.cjs +554 -0
- package/lib/core/hsi-to-graph.test.cjs +168 -0
- package/lib/core/icm-forest.cjs +703 -0
- package/lib/core/ignite-branch-gate.cjs +66 -0
- package/lib/core/index.cjs +60 -0
- package/lib/core/insight-sensors.cjs +1000 -0
- package/lib/core/install-state.cjs +242 -0
- package/lib/core/integration-registry.cjs +232 -0
- package/lib/core/intel-pipeline.cjs +545 -0
- package/lib/core/intelligence-cascade.cjs +852 -0
- package/lib/core/issue-tree.cjs +269 -0
- package/lib/core/larry-thinness-acknowledgment.cjs +64 -0
- package/lib/core/larry-thinness-acknowledgment.test.cjs +97 -0
- package/lib/core/lazygraph-ops.cjs +1453 -0
- package/lib/core/lens-engine.cjs +434 -0
- package/lib/core/leverage-scan.cjs +218 -0
- package/lib/core/llm-name-suggester.cjs +194 -0
- package/lib/core/llm-name-suggester.test.cjs +132 -0
- package/lib/core/lru-cache.cjs +139 -0
- package/lib/core/mcp-dep-heal.cjs +475 -0
- package/lib/core/mcp-dep-heal.test.cjs +253 -0
- package/lib/core/mcp-profiles.cjs +185 -0
- package/lib/core/meeting-ops.cjs +54 -0
- package/lib/core/memory/governance-candidate-raiser.cjs +205 -0
- package/lib/core/memory/governance-candidate.cjs +95 -0
- package/lib/core/memory/reconcile-memory-runner.cjs +653 -0
- package/lib/core/memory-ops.cjs +641 -0
- package/lib/core/meter/gate-density-reader.cjs +112 -0
- package/lib/core/meter/transfer-reader.cjs +276 -0
- package/lib/core/meter/two-gauge.cjs +245 -0
- package/lib/core/methodology-ingest.cjs +346 -0
- package/lib/core/metrics/larryreach-loop-health.cjs +142 -0
- package/lib/core/migration-snapshot.cjs +287 -0
- package/lib/core/migration-snapshot.test.cjs +174 -0
- package/lib/core/migrations/ROOM.md +33 -0
- package/lib/core/migrations/phase-109-nodes-provenance.cjs +400 -0
- package/lib/core/migrations/phase-109-session-focus.cjs +99 -0
- package/lib/core/migrations/phase-160-nodes-bitemporal.cjs +168 -0
- package/lib/core/migrations/phase-160-nodes-bitemporal.test.cjs +140 -0
- package/lib/core/migrations/phase-162-section-nodes.cjs +156 -0
- package/lib/core/migrations/phase-222-ranker-weights.cjs +62 -0
- package/lib/core/migrations/phase-224-edge-review-status.cjs +87 -0
- package/lib/core/mindrian-brain-shim.test.cjs +221 -0
- package/lib/core/mode-select-sidechannel.cjs +259 -0
- package/lib/core/model-profiles.cjs +246 -0
- package/lib/core/mullins-scaffold.cjs +258 -0
- package/lib/core/mullins-scaffold.test.cjs +128 -0
- package/lib/core/mva-agent-contract.cjs +170 -0
- package/lib/core/mva-agent-contract.test.cjs +169 -0
- package/lib/core/mva-budget.cjs +75 -0
- package/lib/core/mva-budget.test.cjs +68 -0
- package/lib/core/mva-classifier.cjs +392 -0
- package/lib/core/mva-classifier.test.cjs +248 -0
- package/lib/core/mva-deck-builder.cjs +452 -0
- package/lib/core/mva-deck-builder.test.cjs +287 -0
- package/lib/core/mva-detect.smoke.test.cjs +209 -0
- package/lib/core/mva-dispatcher.cjs +110 -0
- package/lib/core/mva-dispatcher.test.cjs +216 -0
- package/lib/core/mva-option-router.cjs +414 -0
- package/lib/core/mva-option-router.test.cjs +483 -0
- package/lib/core/mva-orchestrator.cjs +365 -0
- package/lib/core/mva-orchestrator.test.cjs +916 -0
- package/lib/core/mva-progressive-renderer.cjs +194 -0
- package/lib/core/mva-progressive-renderer.test.cjs +157 -0
- package/lib/core/mva-rule-linter.cjs +458 -0
- package/lib/core/mva-rule-linter.test.cjs +484 -0
- package/lib/core/mva-state.cjs +159 -0
- package/lib/core/mva-telemetry.cjs +58 -0
- package/lib/core/mva-telemetry.test.cjs +196 -0
- package/lib/core/mva-vercel-deploy.cjs +168 -0
- package/lib/core/mva-vercel-deploy.test.cjs +239 -0
- package/lib/core/nav-dial.cjs +440 -0
- package/lib/core/navigation/ROOM.md +15 -0
- package/lib/core/navigation/abstraction-claim.cjs +185 -0
- package/lib/core/navigation/calibration-gate.cjs +284 -0
- package/lib/core/navigation/calibration-log.cjs +141 -0
- package/lib/core/navigation/confirm-node.cjs +73 -0
- package/lib/core/navigation/dashboard-helpers.cjs +145 -0
- package/lib/core/navigation/edges.cjs +1150 -0
- package/lib/core/navigation/evidence-claim.cjs +186 -0
- package/lib/core/navigation/explanation.cjs +48 -0
- package/lib/core/navigation/file-evidence-readback.cjs +242 -0
- package/lib/core/navigation/focus.cjs +155 -0
- package/lib/core/navigation/get-domains-for-trends.cjs +277 -0
- package/lib/core/navigation/governance.cjs +101 -0
- package/lib/core/navigation/grant-rubric.cjs +218 -0
- package/lib/core/navigation/graph-export.cjs +325 -0
- package/lib/core/navigation/ingestion.cjs +109 -0
- package/lib/core/navigation/insights-stale.test.cjs +127 -0
- package/lib/core/navigation/insights.cjs +574 -0
- package/lib/core/navigation/lens-nodes.cjs +315 -0
- package/lib/core/navigation/memory-artifacts.cjs +437 -0
- package/lib/core/navigation/memory-cortex-packet.cjs +274 -0
- package/lib/core/navigation/memory-events.cjs +811 -0
- package/lib/core/navigation/neighborhood.cjs +79 -0
- package/lib/core/navigation/packet.cjs +420 -0
- package/lib/core/navigation/planning-artifacts.cjs +219 -0
- package/lib/core/navigation/projections.cjs +295 -0
- package/lib/core/navigation/ranker-weights.cjs +133 -0
- package/lib/core/navigation/reasoning-write.cjs +211 -0
- package/lib/core/navigation/reconcile-guard.cjs +98 -0
- package/lib/core/navigation/reified-claim.cjs +287 -0
- package/lib/core/navigation/research-preflight.cjs +156 -0
- package/lib/core/navigation/room-birth.cjs +1213 -0
- package/lib/core/navigation/room-context.cjs +380 -0
- package/lib/core/navigation/room-home.cjs +142 -0
- package/lib/core/navigation/spine-events.cjs +548 -0
- package/lib/core/navigation/synthetic-expert.cjs +177 -0
- package/lib/core/navigation/transitions.cjs +253 -0
- package/lib/core/navigation/typed-claim.cjs +208 -0
- package/lib/core/navigation/typed-domain.cjs +249 -0
- package/lib/core/navigation/typed-entity.cjs +236 -0
- package/lib/core/navigation/typed-frame.cjs +257 -0
- package/lib/core/navigation/typed-open-question.cjs +130 -0
- package/lib/core/navigation/typed-opportunity.cjs +418 -0
- package/lib/core/navigation-engine-offer.cjs +776 -0
- package/lib/core/navigation-engine-shared.cjs +256 -0
- package/lib/core/navigation-engine.cjs +1696 -0
- package/lib/core/navigation.cjs +686 -0
- package/lib/core/nl-graph-queries.cjs +164 -0
- package/lib/core/node-insert-epistemic.test.cjs +212 -0
- package/lib/core/node-insert-overrides.test.cjs +273 -0
- package/lib/core/node-insert.cjs +274 -0
- package/lib/core/npm-cli-resolve.cjs +151 -0
- package/lib/core/npm-cli-resolve.test.cjs +153 -0
- package/lib/core/npm-install-lock.cjs +326 -0
- package/lib/core/npm-install-lock.test.cjs +379 -0
- package/lib/core/numeric/sklearn-stopwords-v1.json +325 -0
- package/lib/core/numeric/svd.cjs +377 -0
- package/lib/core/numeric/tfidf.cjs +241 -0
- package/lib/core/offer-presenter.cjs +406 -0
- package/lib/core/opportunity-extractor.cjs +183 -0
- package/lib/core/opportunity-ops.cjs +1423 -0
- package/lib/core/orchestration-candidate-lift.cjs +284 -0
- package/lib/core/part8-egress-guard.cjs +536 -0
- package/lib/core/part8-egress-guard.test.cjs +194 -0
- package/lib/core/part8-egress-ontology.cjs +174 -0
- package/lib/core/part8-egress-ontology.test.cjs +133 -0
- package/lib/core/persona-ops.cjs +692 -0
- package/lib/core/persona-override.cjs +327 -0
- package/lib/core/persona-taxonomy.cjs +328 -0
- package/lib/core/pinecone-inference.cjs +176 -0
- package/lib/core/pitch-feedback-schemas.cjs +303 -0
- package/lib/core/planning/artifact-brain-packet.cjs +212 -0
- package/lib/core/planning/reconcile-runner.cjs +347 -0
- package/lib/core/platform-gates.cjs +120 -0
- package/lib/core/platform.cjs +257 -0
- package/lib/core/proactive-intelligence.cjs +528 -0
- package/lib/core/problem-type-router.cjs +315 -0
- package/lib/core/publish-needs-default-lane.cjs +110 -0
- package/lib/core/ralph-loop-gate.cjs +48 -0
- package/lib/core/reader/ab-harness.cjs +177 -0
- package/lib/core/reader/decide-projection-reader.cjs +358 -0
- package/lib/core/reasoning-ops.cjs +639 -0
- package/lib/core/recipe-maps.cjs +442 -0
- package/lib/core/recovery/case-file.cjs +358 -0
- package/lib/core/recovery/controller.cjs +1008 -0
- package/lib/core/recovery/dispatcher.cjs +533 -0
- package/lib/core/recovery/result-semantics.cjs +488 -0
- package/lib/core/recovery/stage-envelope.cjs +338 -0
- package/lib/core/refusal-messaging.cjs +569 -0
- package/lib/core/refusal-messaging.test.cjs +220 -0
- package/lib/core/repo-version.cjs +134 -0
- package/lib/core/research-cache.cjs +165 -0
- package/lib/core/research-cache.test.cjs +137 -0
- package/lib/core/research-context-extractor.cjs +283 -0
- package/lib/core/research-corpus.cjs +814 -0
- package/lib/core/research-corpus.test.cjs +280 -0
- package/lib/core/research-filing-selector.cjs +189 -0
- package/lib/core/resolve-active-room.cjs +602 -0
- package/lib/core/resolve-brain-key.cjs +273 -0
- package/lib/core/resolve-umbilical-target.cjs +288 -0
- package/lib/core/resolve-vercel-key.cjs +107 -0
- package/lib/core/resolve-vercel-key.test.cjs +137 -0
- package/lib/core/reverse-salient-persona-suffix.cjs +115 -0
- package/lib/core/room-auto-create.cjs +318 -0
- package/lib/core/room-auto-create.test.cjs +198 -0
- package/lib/core/room-chooser.cjs +244 -0
- package/lib/core/room-classifier-strict-mode.cjs +235 -0
- package/lib/core/room-db.cjs +348 -0
- package/lib/core/room-discard-cascade.cjs +238 -0
- package/lib/core/room-discard-cascade.test.cjs +135 -0
- package/lib/core/room-name-validator.cjs +132 -0
- package/lib/core/room-name-validator.test.cjs +156 -0
- package/lib/core/room-naming-selector.cjs +357 -0
- package/lib/core/room-naming-selector.test.cjs +277 -0
- package/lib/core/room-open.cjs +259 -0
- package/lib/core/room-ops-async.cjs +92 -0
- package/lib/core/room-ops-shared.cjs +64 -0
- package/lib/core/room-ops-sync.cjs +70 -0
- package/lib/core/room-ops.cjs +32 -0
- package/lib/core/room-receipt-emit.cjs +63 -0
- package/lib/core/room-root.cjs +93 -0
- package/lib/core/room-skeleton-scaffold.cjs +669 -0
- package/lib/core/room-skeleton-scaffold.test.cjs +296 -0
- package/lib/core/room-type-detector.cjs +386 -0
- package/lib/core/rs-backend-dispatch.cjs +64 -0
- package/lib/core/rs-brain-substrate-prompts.cjs +129 -0
- package/lib/core/rs-brain-substrate.cjs +570 -0
- package/lib/core/rs-breakthrough-scorer.cjs +255 -0
- package/lib/core/rs-canon-violations.cjs +82 -0
- package/lib/core/rs-chain-feeder.cjs +381 -0
- package/lib/core/rs-commercial-assessor.cjs +280 -0
- package/lib/core/rs-corpus-quality-gate.cjs +62 -0
- package/lib/core/rs-differential-scorer.cjs +629 -0
- package/lib/core/rs-domain-analyzer.cjs +385 -0
- package/lib/core/rs-egress-prompts.cjs +113 -0
- package/lib/core/rs-egress-telemetry.cjs +225 -0
- package/lib/core/rs-egress-violations.cjs +53 -0
- package/lib/core/rs-engine.cjs +597 -0
- package/lib/core/rs-expert-brain-projection.cjs +280 -0
- package/lib/core/rs-expert-mapper.cjs +467 -0
- package/lib/core/rs-fetcher-academic.cjs +697 -0
- package/lib/core/rs-fetcher-experts.cjs +314 -0
- package/lib/core/rs-fetcher-industry.cjs +731 -0
- package/lib/core/rs-fetcher-patents.cjs +564 -0
- package/lib/core/rs-innovation-classifier.cjs +194 -0
- package/lib/core/rs-math.cjs +458 -0
- package/lib/core/rs-mind-map.cjs +656 -0
- package/lib/core/rs-neo4j-writer.cjs +388 -0
- package/lib/core/rs-nl-to-query.cjs +435 -0
- package/lib/core/rs-pinecone-bridge.cjs +344 -0
- package/lib/core/rs-preprocessor.cjs +350 -0
- package/lib/core/rs-query-matrix.cjs +316 -0
- package/lib/core/rs-query-to-text.cjs +438 -0
- package/lib/core/rs-sqlite-mirror.cjs +495 -0
- package/lib/core/rs-thesis-generator.cjs +188 -0
- package/lib/core/rs_cache.py +635 -0
- package/lib/core/rs_corpus.py +562 -0
- package/lib/core/rs_corpus_exclude.py +62 -0
- package/lib/core/rs_hybrid.py +589 -0
- package/lib/core/rs_math.py +287 -0
- package/lib/core/rs_rooms.py +196 -0
- package/lib/core/salient-governance.cjs +315 -0
- package/lib/core/scheduled-scanner.cjs +658 -0
- package/lib/core/scratchpad-ops.cjs +316 -0
- package/lib/core/seam-liveness.cjs +191 -0
- package/lib/core/seam-liveness.test.cjs +177 -0
- package/lib/core/section-8-trace-schema.cjs +138 -0
- package/lib/core/section-registry.cjs +167 -0
- package/lib/core/security/agentshield-adapters.test.cjs +104 -0
- package/lib/core/security/agentshield-run.cjs +343 -0
- package/lib/core/security/agentshield-scanner.cjs +314 -0
- package/lib/core/security/agentshield-scanner.test.cjs +259 -0
- package/lib/core/sensors/hat-scoping-table.cjs +103 -0
- package/lib/core/sensors/sensor-circularity.cjs +278 -0
- package/lib/core/sensors/sensor-content-relevance.cjs +407 -0
- package/lib/core/sensors/sensor-diffusion-adoption.cjs +230 -0
- package/lib/core/sensors/sensor-eureka.cjs +208 -0
- package/lib/core/sensors/sensor-expert-skill.cjs +293 -0
- package/lib/core/sensors/sensor-external-fact.cjs +184 -0
- package/lib/core/sensors/sensor-gate-approach.cjs +104 -0
- package/lib/core/sensors/sensor-jtbd-reweight.cjs +141 -0
- package/lib/core/sensors/sensor-lagging-component.cjs +115 -0
- package/lib/core/sensors/sensor-memory-cortex.cjs +111 -0
- package/lib/core/sensors/sensor-methodology-decision.cjs +131 -0
- package/lib/core/sensors/sensor-opportunity-harvest.cjs +195 -0
- package/lib/core/sensors/sensor-perspective-lock.cjs +174 -0
- package/lib/core/sensors/sensor-priority.cjs +183 -0
- package/lib/core/sensors/sensor-recency.cjs +151 -0
- package/lib/core/sensors/sensor-roadmap-type.cjs +421 -0
- package/lib/core/sensors/sensor-room-pick.cjs +238 -0
- package/lib/core/sensors/sensor-show-share.cjs +215 -0
- package/lib/core/sensors/sensor-temporal-blindness.cjs +123 -0
- package/lib/core/sensors/sensor-types.cjs +294 -0
- package/lib/core/sensors/sensor-url-ingest.cjs +234 -0
- package/lib/core/session-binding.cjs +208 -0
- package/lib/core/session-presence.cjs +404 -0
- package/lib/core/session-register.cjs +138 -0
- package/lib/core/session-state.cjs +144 -0
- package/lib/core/shallow-doc-parser.cjs +353 -0
- package/lib/core/shallow-doc-parser.test.cjs +226 -0
- package/lib/core/skill-activation-router.cjs +284 -0
- package/lib/core/skillopt-schemas.cjs +509 -0
- package/lib/core/stale-copy-scanner.cjs +190 -0
- package/lib/core/stance-state.cjs +153 -0
- package/lib/core/state-aware-router.cjs +78 -0
- package/lib/core/state-ops.cjs +80 -0
- package/lib/core/state-version.cjs +350 -0
- package/lib/core/statusline-cache.cjs +266 -0
- package/lib/core/statusline-liveness-gate.cjs +105 -0
- package/lib/core/surface-fence.cjs +127 -0
- package/lib/core/synthesizers/comparison-matrix.cjs +82 -0
- package/lib/core/synthesizers/convergence-map.cjs +107 -0
- package/lib/core/synthesizers/domain-hierarchy.cjs +138 -0
- package/lib/core/synthesizers/source-comparison.cjs +56 -0
- package/lib/core/synthesizers/tension-map.cjs +119 -0
- package/lib/core/synthetic-expert-behavior-gate.cjs +99 -0
- package/lib/core/synthetic-expert-construction-gate.cjs +170 -0
- package/lib/core/telemetry/schema.cjs +168 -0
- package/lib/core/telemetry/schema.test.cjs +124 -0
- package/lib/core/telemetry/validator.cjs +200 -0
- package/lib/core/telemetry/validator.test.cjs +188 -0
- package/lib/core/telemetry/writer.cjs +141 -0
- package/lib/core/telemetry/writer.test.cjs +331 -0
- package/lib/core/temporal/date-sync-gate.cjs +256 -0
- package/lib/core/temporal/date-sync-gate.test.cjs +191 -0
- package/lib/core/temporal/dual-stamp.cjs +172 -0
- package/lib/core/temporal/dual-stamp.test.cjs +172 -0
- package/lib/core/temporal/point-in-time.cjs +76 -0
- package/lib/core/temporal/point-in-time.test.cjs +169 -0
- package/lib/core/temporal/recency-decay.cjs +119 -0
- package/lib/core/temporal/recency-decay.test.cjs +140 -0
- package/lib/core/temporal/reference-now.cjs +281 -0
- package/lib/core/temporal/reference-now.test.cjs +225 -0
- package/lib/core/temporal/resolve-relative-time.cjs +116 -0
- package/lib/core/temporal/resolve-relative-time.test.cjs +138 -0
- package/lib/core/temporal/supersession.cjs +250 -0
- package/lib/core/temporal/supersession.test.cjs +103 -0
- package/lib/core/terminal-capability.cjs +88 -0
- package/lib/core/token-estimator.cjs +348 -0
- package/lib/core/tone-filter.cjs +147 -0
- package/lib/core/trending-to-absurd/orchestrator.cjs +341 -0
- package/lib/core/trending-to-absurd/stage7-roadmap.cjs +317 -0
- package/lib/core/trending-to-absurd/variance.cjs +169 -0
- package/lib/core/unknowns/bandit.cjs +332 -0
- package/lib/core/unknowns/corpus-adapter.cjs +327 -0
- package/lib/core/unknowns/dsp.cjs +356 -0
- package/lib/core/unknowns/edge-writer.cjs +211 -0
- package/lib/core/unknowns/iface.cjs +212 -0
- package/lib/core/unknowns/orchestrator.cjs +375 -0
- package/lib/core/unknowns/pattern-miner.cjs +214 -0
- package/lib/core/unknowns/rumsfeld-matrix.cjs +155 -0
- package/lib/core/unknowns/verdict.cjs +254 -0
- package/lib/core/update-path.cjs +57 -0
- package/lib/core/url-ingest.cjs +568 -0
- package/lib/core/user-archetype.cjs +284 -0
- package/lib/core/user-md-ops.cjs +578 -0
- package/lib/core/venture-shape-nudge.cjs +178 -0
- package/lib/core/venture-shape-nudge.test.cjs +266 -0
- package/lib/core/verb-reach-affinity.cjs +299 -0
- package/lib/core/visual-ops.cjs +692 -0
- package/lib/core/voice-transition-detector.cjs +125 -0
- package/lib/core/watched-sources.cjs +237 -0
- package/lib/core/write-lock.cjs +149 -0
- package/lib/graph/canvas-graph.js +467 -0
- package/lib/graph/constellation-config.cjs +299 -0
- package/lib/graph/graph-detail-panel.js +165 -0
- package/lib/hmi/ROOM.md +47 -0
- package/lib/hmi/across-session-memory.cjs +669 -0
- package/lib/hmi/agentshield-drift-gate.cjs +142 -0
- package/lib/hmi/brain-review-packet.cjs +221 -0
- package/lib/hmi/cortex-reach-adapter.cjs +271 -0
- package/lib/hmi/cross-room-memory.cjs +618 -0
- package/lib/hmi/decoy-tier.cjs +395 -0
- package/lib/hmi/depth-state.cjs +164 -0
- package/lib/hmi/dial-label-composer.cjs +410 -0
- package/lib/hmi/dial-presenter.cjs +508 -0
- package/lib/hmi/dial-reach-orchestrator.cjs +377 -0
- package/lib/hmi/dial-selector.cjs +239 -0
- package/lib/hmi/f1-pick-capture-cli.cjs +131 -0
- package/lib/hmi/f3-depth-capture-cli.cjs +77 -0
- package/lib/hmi/f4-scope-capture-cli.cjs +86 -0
- package/lib/hmi/f8-action-capture-cli.cjs +145 -0
- package/lib/hmi/f8-capture.test.cjs +77 -0
- package/lib/hmi/f9-ordered-capture-cli.cjs +138 -0
- package/lib/hmi/harvest-scope-state.cjs +202 -0
- package/lib/hmi/hats-persona-cache.cjs +142 -0
- package/lib/hmi/jtbd-classifier.cjs +219 -0
- package/lib/hmi/jtbd-state.cjs +263 -0
- package/lib/hmi/jtbd-taxonomy.json +402 -0
- package/lib/hmi/mindrian-ascii-logo.cjs +96 -0
- package/lib/hmi/part8-egress-gate.cjs +149 -0
- package/lib/hmi/reach-component-map.json +47 -0
- package/lib/hmi/reach-relevance-gate.cjs +147 -0
- package/lib/hmi/selector-dispatcher.cjs +1201 -0
- package/lib/hmi/selector-dispatcher.test.cjs +141 -0
- package/lib/hmi/selector-telemetry.cjs +269 -0
- package/lib/hmi/shape-f0-renderer.cjs +145 -0
- package/lib/hmi/shape-f1-fallback.cjs +80 -0
- package/lib/hmi/shape-f1-renderer.cjs +219 -0
- package/lib/hmi/shape-f2-renderer.cjs +132 -0
- package/lib/hmi/shape-f3-parity.test.cjs +64 -0
- package/lib/hmi/shape-f3-renderer.cjs +66 -0
- package/lib/hmi/shape-f4-parity.test.cjs +72 -0
- package/lib/hmi/shape-f4-renderer.cjs +72 -0
- package/lib/hmi/shape-f5-renderer.cjs +155 -0
- package/lib/hmi/shape-f6-plan-review-renderer.cjs +324 -0
- package/lib/hmi/shape-f6-renderer.cjs +144 -0
- package/lib/hmi/shape-f7-breakthrough-renderer.cjs +234 -0
- package/lib/hmi/shape-f7-breakthrough-renderer.test.cjs +233 -0
- package/lib/hmi/shape-f8-renderer.cjs +150 -0
- package/lib/hmi/shape-f8-renderer.test.cjs +70 -0
- package/lib/hmi/shape-f9-renderer.cjs +187 -0
- package/lib/hmi/shape-f9-renderer.test.cjs +80 -0
- package/lib/hmi/shape-g-renderer.cjs +219 -0
- package/lib/hmi/shape-h-renderer.cjs +222 -0
- package/lib/hmi/tier-check.cjs +63 -0
- package/lib/hmi/turn-text.cjs +268 -0
- package/lib/hmi/voice-color-mark.cjs +318 -0
- package/lib/hmi/voice-style-log.cjs +276 -0
- package/lib/import/PRECONDITIONS.md +41 -0
- package/lib/import/branding.cjs +210 -0
- package/lib/import/branding.test.cjs +235 -0
- package/lib/import/classifications-sync.cjs +104 -0
- package/lib/import/classifications-sync.test.cjs +129 -0
- package/lib/import/enricher.cjs +296 -0
- package/lib/import/enricher.test.cjs +273 -0
- package/lib/import/integration.test.cjs +376 -0
- package/lib/import/manifest.cjs +129 -0
- package/lib/import/manifest.schema.json +185 -0
- package/lib/import/manifest.test.cjs +123 -0
- package/lib/import/meeting-detector.cjs +92 -0
- package/lib/import/meeting-detector.test.cjs +100 -0
- package/lib/import/person-detector.cjs +229 -0
- package/lib/import/person-detector.test.cjs +149 -0
- package/lib/import/report.cjs +186 -0
- package/lib/import/report.test.cjs +186 -0
- package/lib/import/room-md-scaffolder.cjs +49 -0
- package/lib/import/router.cjs +224 -0
- package/lib/import/router.test.cjs +356 -0
- package/lib/import/run-all-tests.cjs +36 -0
- package/lib/import/smoke-test.cjs +213 -0
- package/lib/import/smoke-test.test.cjs +148 -0
- package/lib/import/undo.test.cjs +199 -0
- package/lib/import/vault-scanner.cjs +105 -0
- package/lib/import/vault-scanner.test.cjs +67 -0
- package/lib/lens-engine/correlation-resolver.cjs +174 -0
- package/lib/lens-engine/source-lens-driver.cjs +736 -0
- package/lib/mcp/adapter-client.cjs +103 -0
- package/lib/mcp/app-html/dashboard.html +316 -0
- package/lib/mcp/app-html/graph.html +428 -0
- package/lib/mcp/app-html/mindrian-platform.html +1841 -0
- package/lib/mcp/app-html/wiki.html +383 -0
- package/lib/mcp/app-views.cjs +322 -0
- package/lib/mcp/brain-composition-census.cjs +184 -0
- package/lib/mcp/brain-router.cjs +530 -0
- package/lib/mcp/capability-registry.cjs +62 -0
- package/lib/mcp/contract-version.cjs +59 -0
- package/lib/mcp/daemon-lifecycle.cjs +324 -0
- package/lib/mcp/gate-dedup.cjs +120 -0
- package/lib/mcp/gate-ledger.cjs +145 -0
- package/lib/mcp/gate-render.cjs +483 -0
- package/lib/mcp/hook-adapter-audit.cjs +199 -0
- package/lib/mcp/larry-context.cjs +42 -0
- package/lib/mcp/mcp-first-flag.cjs +147 -0
- package/lib/mcp/no-instructions.test.cjs +270 -0
- package/lib/mcp/pipeline-state.cjs +424 -0
- package/lib/mcp/prompts.cjs +421 -0
- package/lib/mcp/register-core-tools.cjs +78 -0
- package/lib/mcp/resources.cjs +359 -0
- package/lib/mcp/runtime-instructions.cjs +38 -0
- package/lib/mcp/session-catchup.cjs +349 -0
- package/lib/mcp/session-registry.cjs +113 -0
- package/lib/mcp/session-room.cjs +124 -0
- package/lib/mcp/sse-event-bus.cjs +98 -0
- package/lib/mcp/stop-gate-handler.cjs +589 -0
- package/lib/mcp/surface-detect.cjs +186 -0
- package/lib/mcp/tool-router.cjs +2113 -0
- package/lib/mcp/tools/chain.cjs +674 -0
- package/lib/mcp/tools/claim.cjs +180 -0
- package/lib/mcp/tools/context.cjs +92 -0
- package/lib/mcp/tools/dual-path.cjs +79 -0
- package/lib/mcp/tools/gate.cjs +392 -0
- package/lib/mcp/tools/graph-reason.cjs +130 -0
- package/lib/mcp/tools/graph.cjs +321 -0
- package/lib/mcp/tools/identity.cjs +174 -0
- package/lib/mcp/tools/room.cjs +449 -0
- package/lib/mcp/tools/sensors.cjs +450 -0
- package/lib/mcp/tools/status.cjs +183 -0
- package/lib/mcp/tools/stop-gate.cjs +103 -0
- package/lib/mcp/tools/views.cjs +382 -0
- package/lib/mcp/tree-watcher.cjs +199 -0
- package/lib/memory/.mindrian/auto-explore-mat-test-001.json +11 -0
- package/lib/memory/aaak-compress.cjs +403 -0
- package/lib/memory/aaak-compress.test.cjs +288 -0
- package/lib/memory/async-artifact-auto-commit.test.cjs +223 -0
- package/lib/memory/bearer-token.test.cjs +315 -0
- package/lib/memory/body-shape-coverage.test.cjs +268 -0
- package/lib/memory/brain-cache-lru.test.cjs +259 -0
- package/lib/memory/brain-client-query-shape.test.cjs +160 -0
- package/lib/memory/brain-cypher-chain-slice.test.cjs +368 -0
- package/lib/memory/brain-derivation-graceful-degradation.test.cjs +1019 -0
- package/lib/memory/brain-derivation-queue.test.cjs +553 -0
- package/lib/memory/brain-derivation.test.cjs +639 -0
- package/lib/memory/brain-derive-command.test.cjs +534 -0
- package/lib/memory/brain-derive-curation.test.cjs +243 -0
- package/lib/memory/brain-md-invariants-validator.test.cjs +704 -0
- package/lib/memory/brain-md-schema.test.cjs +467 -0
- package/lib/memory/brain-md-staleness.test.cjs +525 -0
- package/lib/memory/brain-server-resolution.test.cjs +314 -0
- package/lib/memory/brain-suggestion-template.test.cjs +200 -0
- package/lib/memory/chain-recommender-canonical.test.cjs +208 -0
- package/lib/memory/chain-recommender.test.cjs +233 -0
- package/lib/memory/chat-context.test.cjs +128 -0
- package/lib/memory/command-registry.test.cjs +220 -0
- package/lib/memory/connector-registry.test.cjs +94 -0
- package/lib/memory/correlation-label-index.test.cjs +119 -0
- package/lib/memory/correlation.test.cjs +253 -0
- package/lib/memory/cross-room-aggregator.test.cjs +909 -0
- package/lib/memory/curation-132-03-dedup-held-rename.test.cjs +251 -0
- package/lib/memory/curation-132-05-pseudonymize.test.cjs +205 -0
- package/lib/memory/curation-batch.test.cjs +213 -0
- package/lib/memory/dashboard-server.test.cjs +256 -0
- package/lib/memory/debouncer-drain-at-prompt.test.cjs +389 -0
- package/lib/memory/decision-capture.test.cjs +632 -0
- package/lib/memory/decision-capture.worker.cjs +70 -0
- package/lib/memory/doctor-deprecation-surface.test.cjs +188 -0
- package/lib/memory/dual-graph-health.test.cjs +485 -0
- package/lib/memory/explain-decision-command.test.cjs +521 -0
- package/lib/memory/explain-decision-footer.test.cjs +316 -0
- package/lib/memory/explored-materials-store.cjs +392 -0
- package/lib/memory/f-selector-ranker.test.cjs +593 -0
- package/lib/memory/feynman-minto-guardian.test.cjs +863 -0
- package/lib/memory/feynman-minto-invariants.test.cjs +554 -0
- package/lib/memory/feynman-prompts-drift.test.cjs +144 -0
- package/lib/memory/feynman-prompts.cjs +151 -0
- package/lib/memory/feynman-prompts.test.cjs +96 -0
- package/lib/memory/first-touch-version.test.cjs +198 -0
- package/lib/memory/folder-memory-quadruple.test.cjs +548 -0
- package/lib/memory/folder-memory.test.cjs +503 -0
- package/lib/memory/framework-chain-composer.test.cjs +549 -0
- package/lib/memory/frontmatter-schema-validator.test.cjs +344 -0
- package/lib/memory/guardian-onstop-reaches-user.test.cjs +396 -0
- package/lib/memory/heal-command.test.cjs +604 -0
- package/lib/memory/help-coverage.test.cjs +108 -0
- package/lib/memory/help-renderer.test.cjs +145 -0
- package/lib/memory/huji-run-one-async-parity.test.cjs +242 -0
- package/lib/memory/hypergraph-event-schema.test.cjs +116 -0
- package/lib/memory/index-artifact-transaction.test.cjs +333 -0
- package/lib/memory/lazygraph-rs-discoveries-view.test.cjs +122 -0
- package/lib/memory/local-chain-recommender.test.cjs +172 -0
- package/lib/memory/mcp-input-validation.test.cjs +240 -0
- package/lib/memory/mcp-server-brain-deps.test.cjs +270 -0
- package/lib/memory/mcp-stack-fallback.test.cjs +433 -0
- package/lib/memory/minto-debounce-consumer-census.test.cjs +567 -0
- package/lib/memory/minto-debouncer.test.cjs +407 -0
- package/lib/memory/minto-debouncer.worker.cjs +46 -0
- package/lib/memory/minto-migration-v88.test.cjs +265 -0
- package/lib/memory/minto-schema-v88.test.cjs +390 -0
- package/lib/memory/mos-status-renderer.test.cjs +631 -0
- package/lib/memory/narrative-schema.cjs +376 -0
- package/lib/memory/narrative-schema.test.cjs +209 -0
- package/lib/memory/nav-dial.test.cjs +414 -0
- package/lib/memory/navigation-engine-core.test.cjs +712 -0
- package/lib/memory/navigation-engine-offer.test.cjs +404 -0
- package/lib/memory/navigation-hook-resolver.test.cjs +177 -0
- package/lib/memory/navigation-invariants.test.cjs +483 -0
- package/lib/memory/navigation-projections.test.cjs +241 -0
- package/lib/memory/navigation-write-edge.test.cjs +206 -0
- package/lib/memory/offer-closer.test.cjs +258 -0
- package/lib/memory/offer-presenter.test.cjs +554 -0
- package/lib/memory/on-stop-snapshot.test.cjs +404 -0
- package/lib/memory/orchestration-projection.test.cjs +706 -0
- package/lib/memory/packet-chain-hint.test.cjs +407 -0
- package/lib/memory/packet-schema-validation.test.cjs +317 -0
- package/lib/memory/palette-consistency.test.cjs +127 -0
- package/lib/memory/pending-tension-store.cjs +453 -0
- package/lib/memory/per-command-jtbd-derivation.test.cjs +130 -0
- package/lib/memory/per-command-teaching.test.cjs +110 -0
- package/lib/memory/post-compact-reinjection.test.cjs +854 -0
- package/lib/memory/post-write-triple.test.cjs +317 -0
- package/lib/memory/pre-compact-snapshot.test.cjs +495 -0
- package/lib/memory/precommit-real-commit.test.cjs +301 -0
- package/lib/memory/problem-type-router.test.cjs +656 -0
- package/lib/memory/query-efficiency-telemetry.test.cjs +612 -0
- package/lib/memory/recompile-room-references.test.cjs +392 -0
- package/lib/memory/recompile-room-references.worker.cjs +42 -0
- package/lib/memory/record-decision-dual-write.test.cjs +454 -0
- package/lib/memory/render-v2-disposition.test.cjs +199 -0
- package/lib/memory/room-classifier-strict-mode.test.cjs +430 -0
- package/lib/memory/room-minto-hook.test.cjs +398 -0
- package/lib/memory/rs-discovery-engine.test.cjs +323 -0
- package/lib/memory/run-feynman-tests.cjs +2101 -0
- package/lib/memory/security-trifecta.test.cjs +329 -0
- package/lib/memory/selector-alias-map.test.cjs +172 -0
- package/lib/memory/selector-decisions.test.cjs +417 -0
- package/lib/memory/selector-miss.test.cjs +290 -0
- package/lib/memory/session-start-brain-staleness.test.cjs +363 -0
- package/lib/memory/session-start-triple-injection.test.cjs +514 -0
- package/lib/memory/sessionstart-banner-formatter.cjs +318 -0
- package/lib/memory/sessionstart-coordinator.test.cjs +446 -0
- package/lib/memory/sessionstart-minto-banner.test.cjs +373 -0
- package/lib/memory/skill-activation-router.test.cjs +465 -0
- package/lib/memory/skill-vs-code-drift.test.cjs +257 -0
- package/lib/memory/soft-alias.test.cjs +144 -0
- package/lib/memory/spine-events-correlation.test.cjs +198 -0
- package/lib/memory/stale-copy-scanner.test.cjs +294 -0
- package/lib/memory/stamp-artifact-write.test.cjs +304 -0
- package/lib/memory/state-aware-router.test.cjs +90 -0
- package/lib/memory/statusline-active-room-write.test.cjs +245 -0
- package/lib/memory/statusline-active-room.test.cjs +315 -0
- package/lib/memory/statusline-minto-segment.test.cjs +292 -0
- package/lib/memory/statusline-two-row.test.cjs +338 -0
- package/lib/memory/suggest-next-workflow.test.cjs +176 -0
- package/lib/memory/sync-async-entry-points.test.cjs +204 -0
- package/lib/memory/terminal-capability.test.cjs +155 -0
- package/lib/memory/test-bridge-writer-enhanced.cjs +452 -0
- package/lib/memory/test-rs-brain-substrate-shape.cjs +529 -0
- package/lib/memory/test-rs-brain-substrate.cjs +636 -0
- package/lib/memory/test-rs-breakthrough-scorer.cjs +375 -0
- package/lib/memory/test-rs-canon-violations.cjs +218 -0
- package/lib/memory/test-rs-chain-feeder-core.cjs +344 -0
- package/lib/memory/test-rs-chain-feeder-skill-spawn.cjs +297 -0
- package/lib/memory/test-rs-commercial-assessor.cjs +385 -0
- package/lib/memory/test-rs-differential-scorer.cjs +480 -0
- package/lib/memory/test-rs-discovery-engine.cjs +648 -0
- package/lib/memory/test-rs-domain-analyzer.cjs +492 -0
- package/lib/memory/test-rs-egress-primitives.cjs +420 -0
- package/lib/memory/test-rs-expert-mapper.cjs +547 -0
- package/lib/memory/test-rs-explain-command.cjs +443 -0
- package/lib/memory/test-rs-fetcher-academic.cjs +848 -0
- package/lib/memory/test-rs-fetcher-experts.cjs +496 -0
- package/lib/memory/test-rs-fetcher-industry.cjs +702 -0
- package/lib/memory/test-rs-fetcher-patents.cjs +674 -0
- package/lib/memory/test-rs-innovation-classifier.cjs +301 -0
- package/lib/memory/test-rs-mind-map.cjs +646 -0
- package/lib/memory/test-rs-neo4j-writer.cjs +518 -0
- package/lib/memory/test-rs-nl-to-query.cjs +449 -0
- package/lib/memory/test-rs-pinecone-bridge.cjs +282 -0
- package/lib/memory/test-rs-preprocessor.cjs +433 -0
- package/lib/memory/test-rs-query-matrix.cjs +391 -0
- package/lib/memory/test-rs-query-to-text.cjs +551 -0
- package/lib/memory/test-rs-sqlite-mirror.cjs +649 -0
- package/lib/memory/test-rs-thesis-generator.cjs +360 -0
- package/lib/memory/triple-context-formatter.cjs +473 -0
- package/lib/memory/triple-context-formatter.test.cjs +442 -0
- package/lib/memory/user-md-persona.test.cjs +565 -0
- package/lib/memory/userpromptsubmit-integration.test.cjs +787 -0
- package/lib/memory/validators/README.md +157 -0
- package/lib/memory/validators/brain-md-invariants.cjs +475 -0
- package/lib/memory/validators/brain-substrate-invariants.cjs +285 -0
- package/lib/memory/validators/external-academic-invariants.cjs +249 -0
- package/lib/memory/validators/external-industry-invariants.cjs +271 -0
- package/lib/memory/validators/external-patents-invariants.cjs +266 -0
- package/lib/memory/validators/minto-invariants.cjs +62 -0
- package/lib/memory/validators/navigation-invariants.cjs +340 -0
- package/lib/memory/validators/queue-health.cjs +95 -0
- package/lib/memory/validators/snapshot-integrity.cjs +129 -0
- package/lib/memory/validators/stale-lifecycle.cjs +116 -0
- package/lib/memory/vault-section-minto-generator-atomic.test.cjs +556 -0
- package/lib/memory/vault-section-minto-generator-atomic.worker.cjs +73 -0
- package/lib/memory/workflow-layer-e2e.test.cjs +262 -0
- package/lib/memory/write-lock-atomic.test.cjs +137 -0
- package/lib/memory/write-lock-atomic.worker.cjs +55 -0
- package/lib/parity/check-parity.cjs +83 -0
- package/lib/presentation/presentation-server.cjs +101 -0
- package/lib/presentation/presentation-watcher.cjs +123 -0
- package/lib/quickview/hub-server.cjs +719 -0
- package/lib/quickview/server.cjs +533 -0
- package/lib/render/JTBD-PALETTES.md +145 -0
- package/lib/render/ROOM.md +111 -0
- package/lib/render/render-v2.cjs +532 -0
- package/lib/render/render-v2.test.cjs +267 -0
- package/lib/render/render.cjs +65 -0
- package/lib/sessionstart/budget-compressor.cjs +130 -0
- package/lib/sessionstart/contributor-interface.cjs +134 -0
- package/lib/sessionstart/contributor-isolator.cjs +128 -0
- package/lib/sessionstart/precedence-ladder.cjs +47 -0
- package/lib/state/ROOM.md +46 -0
- package/lib/state/state-md-parser.cjs +215 -0
- package/lib/statusline/ROOM.md +38 -0
- package/lib/statusline/banner-suppression.cjs +50 -0
- package/lib/statusline/cockpit-renderer.cjs +443 -0
- package/lib/statusline/cockpit-signals.cjs +312 -0
- package/lib/statusline/cockpit-telemetry.cjs +152 -0
- package/lib/statusline/ctx-window.cjs +135 -0
- package/lib/statusline/governing-thought-truncator.cjs +45 -0
- package/lib/statusline/next-move-cache.cjs +235 -0
- package/lib/statusline/ratification-next.cjs +164 -0
- package/lib/statusline/room-health-cache.cjs +200 -0
- package/lib/statusline/surface-detect.cjs +85 -0
- package/lib/statusline/two-row-renderer.cjs +207 -0
- package/lib/statusline/version-resolver.cjs +81 -0
- package/lib/ui/design-system.cjs +19 -0
- package/lib/update-bootstrap.sh.template +145 -0
- package/lib/vault/frontmatter-schema.cjs +297 -0
- package/lib/vault/room-scanner.cjs +365 -0
- package/lib/vault/wikilink-builder.cjs +231 -0
- package/lib/vault/wikilink-builder.test.cjs +182 -0
- package/lib/wiki/briefing.cjs +193 -0
- package/lib/wiki/editor-dist/wiki-editor.css +1 -0
- package/lib/wiki/editor-dist/wiki-editor.js +1327 -0
- package/lib/wiki/graph-links.cjs +281 -0
- package/lib/wiki/page-renderer.cjs +229 -0
- package/lib/wiki/room-home.cjs +353 -0
- package/lib/wiki/wiki-chat.cjs +81 -0
- package/lib/wiki/wiki-export.cjs +364 -0
- package/lib/wiki/wiki-layout.cjs +1143 -0
- package/lib/wiki/wiki-search.cjs +142 -0
- package/lib/wiki/wiki-server.cjs +748 -0
- package/lib/wiki/wiki-watcher.cjs +105 -0
- package/lib/workflow/ROOM.md +47 -0
- package/lib/workflow/chain-source.cjs +179 -0
- package/lib/workflow/command-resolver.cjs +155 -0
- package/lib/workflow/command-resolver.test.cjs +235 -0
- package/lib/workflow/cross-room-umbilical-closer.cjs +364 -0
- package/lib/workflow/dial-close-reach.cjs +405 -0
- package/lib/workflow/f-selector-ranker.cjs +1148 -0
- package/lib/workflow/f1-pick-consumer.cjs +232 -0
- package/lib/workflow/f3-depth-consumer.cjs +98 -0
- package/lib/workflow/f4-scope-consumer.cjs +112 -0
- package/lib/workflow/f8-consumer.test.cjs +82 -0
- package/lib/workflow/f8-fanout-consumer.cjs +208 -0
- package/lib/workflow/f9-consumer.test.cjs +71 -0
- package/lib/workflow/f9-ordered-consumer.cjs +199 -0
- package/lib/workflow/local-chain-recommender.cjs +330 -0
- package/lib/workflow/memory-cascade-f9-adapter.cjs +273 -0
- package/lib/workflow/memory-governance-closer.cjs +384 -0
- package/lib/workflow/offer-closer.cjs +407 -0
- package/lib/workflow/reach-hedge-ranker.cjs +809 -0
- package/lib/workflow/reach-reject-reader.cjs +372 -0
- package/lib/workflow/reconcile-f9-adapter.cjs +299 -0
- package/lib/workflow/selector-decisions.cjs +478 -0
- package/lib/workflow/session-binding-consumer.cjs +249 -0
- package/npm-shrinkwrap.json +1544 -0
- package/output-styles/destijl.md +67 -0
- package/package.json +22 -4
- package/pipelines/PWS_grading/01-deep-grade.md +48 -0
- package/pipelines/PWS_grading/02-mullins.md +50 -0
- package/pipelines/PWS_grading/03-build-thesis.md +60 -0
- package/pipelines/PWS_grading/04-structure-argument.md +77 -0
- package/pipelines/PWS_grading/CHAIN.md +79 -0
- package/pipelines/analogy/01-decompose.md +80 -0
- package/pipelines/analogy/02-abstract.md +87 -0
- package/pipelines/analogy/03-search.md +135 -0
- package/pipelines/analogy/04-transfer.md +101 -0
- package/pipelines/analogy/05-validate.md +106 -0
- package/pipelines/analogy/CHAIN.md +73 -0
- package/pipelines/discovery/01-explore-domains.md +44 -0
- package/pipelines/discovery/02-think-hats.md +50 -0
- package/pipelines/discovery/03-analyze-needs.md +54 -0
- package/pipelines/discovery/CHAIN.md +48 -0
- package/pipelines/thesis/01-structure-argument.md +45 -0
- package/pipelines/thesis/02-challenge-assumptions.md +48 -0
- package/pipelines/thesis/03-build-thesis.md +54 -0
- package/pipelines/thesis/CHAIN.md +48 -0
- package/references/brain/causal-directives.md +91 -0
- package/references/brain/causal-enrichment.cypher +165 -0
- package/references/brain/command-triggers-schema.md +15 -0
- package/references/brain/graph-architecture.md +317 -0
- package/references/brain/query-patterns.md +504 -0
- package/references/brain/room-hierarchy-schema.md +218 -0
- package/references/brain/schema.md +86 -0
- package/references/capability-radar/capabilities-index.md +269 -0
- package/references/capability-radar/changelog-cache.md +95 -0
- package/references/causal/causal-schema.md +103 -0
- package/references/design/email-template-standard.md +169 -0
- package/references/design/graph-visualization-standard.md +178 -0
- package/references/design/newsletter-email-template.html +307 -0
- package/references/document-generation.md +179 -0
- package/references/hsi/HSI-TOOLS-REFERENCE.md +222 -0
- package/references/import-config.md +141 -0
- package/references/integrations/detection-patterns.md +101 -0
- package/references/meeting/artifact-template.md +377 -0
- package/references/meeting/cross-meeting-intelligence.md +216 -0
- package/references/meeting/cross-relationship-patterns.md +202 -0
- package/references/meeting/extraction-perspectives.md +225 -0
- package/references/meeting/filing-protocol.md +222 -0
- package/references/meeting/knowledge-typing.md +242 -0
- package/references/meeting/live-join-interface.md +244 -0
- package/references/meeting/section-mapping.md +192 -0
- package/references/meeting/segment-classification.md +258 -0
- package/references/meeting/speaker-profile-template.md +219 -0
- package/references/meeting/summary-template.md +348 -0
- package/references/meeting/transcript-patterns.md +226 -0
- package/references/methodology/analyze-needs.md +135 -0
- package/references/methodology/analyze-systems.md +121 -0
- package/references/methodology/analyze-timing.md +149 -0
- package/references/methodology/beautiful-question.md +109 -0
- package/references/methodology/build-knowledge.md +161 -0
- package/references/methodology/build-thesis-scored.md +60 -0
- package/references/methodology/build-thesis.md +237 -0
- package/references/methodology/causal-loop-diagrams.md +65 -0
- package/references/methodology/challenge-assumptions.md +127 -0
- package/references/methodology/diagnose.md +169 -0
- package/references/methodology/dominant-designs.md +212 -0
- package/references/methodology/explore-domains.md +147 -0
- package/references/methodology/explore-futures.md +163 -0
- package/references/methodology/explore-trends.md +129 -0
- package/references/methodology/find-bottlenecks.md +131 -0
- package/references/methodology/grade.md +211 -0
- package/references/methodology/huji-stage-a-intake.md +246 -0
- package/references/methodology/index.md +34 -0
- package/references/methodology/leadership.md +200 -0
- package/references/methodology/lean-canvas.md +116 -0
- package/references/methodology/leverage-scan-signatures.md +83 -0
- package/references/methodology/macro-trends.md +192 -0
- package/references/methodology/map-unknowns.md +137 -0
- package/references/methodology/mullins-7-domains.md +104 -0
- package/references/methodology/problem-types.md +65 -0
- package/references/methodology/root-cause.md +178 -0
- package/references/methodology/rubric-huji.md +160 -0
- package/references/methodology/sapphire-encoding.md +355 -0
- package/references/methodology/scenario-plan.md +190 -0
- package/references/methodology/score-innovation.md +154 -0
- package/references/methodology/skillopt-judge-rubric.md +48 -0
- package/references/methodology/skillopt-queries-rubric.md +60 -0
- package/references/methodology/skillopt-refute-rubric.md +59 -0
- package/references/methodology/skillopt-review-rubric.md +72 -0
- package/references/methodology/skillopt-revise-rubric.md +48 -0
- package/references/methodology/structure-argument.md +158 -0
- package/references/methodology/systems-thinking.md +231 -0
- package/references/methodology/think-hats.md +147 -0
- package/references/methodology/triz-matrix.json +751 -0
- package/references/methodology/triz-principles.md +501 -0
- package/references/methodology/user-needs.md +199 -0
- package/references/methodology/validate.md +163 -0
- package/references/methodology/value-proposition.md +244 -0
- package/references/opportunities/funding-lifecycle.md +103 -0
- package/references/opportunities/grant-api-patterns.md +99 -0
- package/references/opportunities/opportunity-template.md +84 -0
- package/references/opportunities/tnufa-rubric.md +81 -0
- package/references/personality/assessment-philosophy.md +72 -0
- package/references/personality/lexicon.md +100 -0
- package/references/personality/persona-chains.md +56 -0
- package/references/personality/pws-lexicon-full.md +499 -0
- package/references/personality/voice-dna.md +156 -0
- package/references/personas/hat-perspectives.md +76 -0
- package/references/personas/persona-template.md +63 -0
- package/references/pipeline/act-output-contract.md +88 -0
- package/references/pipeline/chains-index.md +39 -0
- package/references/pws-profile-generation.md +79 -0
- package/references/reasoning/reasoning-schema.md +143 -0
- package/references/reasoning/reasoning-template.md +68 -0
- package/references/reasoning/run-template.md +38 -0
- package/references/research/RESEARCH_14_CLAUDE_CODE_SOURCE_ARCHITECTURE.md +209 -0
- package/references/research/RESEARCH_15_V1.8_OPTIMIZATION_JTBD.md +375 -0
- package/references/research/RESEARCH_16_NATIVE_FIRST_PLUGIN_ARCHITECTURE.md +575 -0
- package/references/research/RESEARCH_17_MCP_UI_FRAMEWORKS.md +272 -0
- package/references/security/agentshield-baseline.json +8 -0
- package/references/security/cve-db.json +220 -0
- package/references/taxonomy/TAXONOMY.md +192 -0
- package/references/templates/MINTO.md +36 -0
- package/references/user-research/2026-04-05-leah-lawrence-session.md +202 -0
- package/references/vault-kit/README.md +35 -0
- package/references/vault-kit/app.json +12 -0
- package/references/vault-kit/appearance.json +12 -0
- package/references/vault-kit/graph.json +35 -0
- package/references/vault-kit/snippets/mindrian-destijl.css +297 -0
- package/references/vault-kit/templates/new-artifact.md +37 -0
- package/references/vault-kit/templates/new-meeting-note.md +35 -0
- package/references/vault-kit/templates/new-team-profile.md +29 -0
- package/references/vault-kit/templates/new-xref.md +35 -0
- package/references/visual/ROOM.md +55 -0
- package/references/visual/palette.json +54 -0
- package/references/visual/symbol-system.md +151 -0
- package/scripts/189-plurai-gate-check.cjs +88 -0
- package/scripts/198-plurai-gate-check.cjs +118 -0
- package/scripts/198-rollback-rehearsal.cjs +233 -0
- package/scripts/83-scope-injection.test.cjs +648 -0
- package/scripts/PYTHON_GATES.md +78 -0
- package/scripts/__pycache__/compute-hsi.cpython-312.pyc +0 -0
- package/scripts/__pycache__/detect-reverse-salients.cpython-312.pyc +0 -0
- package/scripts/__pycache__/rs-engine.cpython-312.pyc +0 -0
- package/scripts/act-command.cjs +518 -0
- package/scripts/admin-brain-write.cjs +442 -0
- package/scripts/admin-command-gate.cjs +178 -0
- package/scripts/agentshield-scan-cli.cjs +226 -0
- package/scripts/agentshield-sessionstart-scan.cjs +282 -0
- package/scripts/analogy-fitness-report.cjs +266 -0
- package/scripts/analyze-room +1079 -0
- package/scripts/apply-teaching-content.cjs +298 -0
- package/scripts/async-artifact-auto-commit.cjs +485 -0
- package/scripts/audit-active-phase-resolver.cjs +160 -0
- package/scripts/audit-body-shape-coverage.cjs +213 -0
- package/scripts/auto-explore-drain.cjs +274 -0
- package/scripts/auto-explore-fingerprint.cjs +354 -0
- package/scripts/auto-explore-fire.cjs +359 -0
- package/scripts/backfill-correlation-id.cjs +425 -0
- package/scripts/backfill-hitl-shape.cjs +276 -0
- package/scripts/backfill-hitl-shape.test.cjs +307 -0
- package/scripts/backup-modifications +68 -0
- package/scripts/banner +182 -0
- package/scripts/brain-derivation-drain.cjs +291 -0
- package/scripts/brain-derive-command.cjs +846 -0
- package/scripts/brain-normalize-books.cypher +505 -0
- package/scripts/brain-normalize-final.cypher +1355 -0
- package/scripts/brain-normalize-problemtype.cypher +475 -0
- package/scripts/brain-normalize-supplement.cypher +449 -0
- package/scripts/brain-normalize-targeted.cypher +344 -0
- package/scripts/brain-normalize-v194.cypher +61 -0
- package/scripts/brain-normalize.cypher +530 -0
- package/scripts/brain-response-sanitize-hook.cjs +165 -0
- package/scripts/build-brain-census.cjs +957 -0
- package/scripts/build-brain-packet-schema.cjs +225 -0
- package/scripts/build-command-registry.cjs +587 -0
- package/scripts/build-connector-registry.cjs +1331 -0
- package/scripts/build-corpus-stats.cjs +408 -0
- package/scripts/build-dist-bundles.cjs +495 -0
- package/scripts/build-ecosystem-graph.cjs +490 -0
- package/scripts/build-graph +1462 -0
- package/scripts/build-graph-from-sqlite.cjs +97 -0
- package/scripts/build-harness-manifest.cjs +1090 -0
- package/scripts/build-jtbd-nudges +205 -0
- package/scripts/build-new-surface.cjs +805 -0
- package/scripts/build-orchestration-projection.cjs +1221 -0
- package/scripts/build-render-coverage.cjs +637 -0
- package/scripts/build-skill-mirrors.cjs +681 -0
- package/scripts/cache-hitrate-report.cjs +216 -0
- package/scripts/causal-to-graph.cjs +163 -0
- package/scripts/check-abstraction-fixture-neutral.cjs +160 -0
- package/scripts/check-admin-identity.cjs +212 -0
- package/scripts/check-brain-tool-liveness.cjs +502 -0
- package/scripts/check-card-fire.cjs +1809 -0
- package/scripts/check-cirs-declaration.cjs +279 -0
- package/scripts/check-deck-design.cjs +104 -0
- package/scripts/check-dual-graph-health.cjs +645 -0
- package/scripts/check-first-touch-drift.cjs +220 -0
- package/scripts/check-flagship-floor.cjs +391 -0
- package/scripts/check-framework-vocabulary-drift.cjs +563 -0
- package/scripts/check-gate-seam.cjs +178 -0
- package/scripts/check-graph-derive-health.cjs +208 -0
- package/scripts/check-graph-export-typemap.cjs +118 -0
- package/scripts/check-help-coverage.cjs +290 -0
- package/scripts/check-hitl-stages.cjs +219 -0
- package/scripts/check-hook-schema-compatibility.cjs +231 -0
- package/scripts/check-hsi-deps +42 -0
- package/scripts/check-kuzu-reintroduction.cjs +251 -0
- package/scripts/check-onboard +43 -0
- package/scripts/check-onboard-statusline.cjs +363 -0
- package/scripts/check-palette-consistency.cjs +106 -0
- package/scripts/check-pending-ambiguous.cjs +244 -0
- package/scripts/check-pending-breakthrough.cjs +189 -0
- package/scripts/check-pending-breakthrough.test.cjs +166 -0
- package/scripts/check-pending-naming-decision.cjs +97 -0
- package/scripts/check-plugin-path-anchoring.cjs +830 -0
- package/scripts/check-publish-needs.cjs +126 -0
- package/scripts/check-registry-drift.cjs +206 -0
- package/scripts/check-release-payload-ceiling.cjs +269 -0
- package/scripts/check-render-coverage.cjs +558 -0
- package/scripts/check-research-isomorphism.cjs +446 -0
- package/scripts/check-reward-before-investment.cjs +261 -0
- package/scripts/check-room-blueprints.cjs +213 -0
- package/scripts/check-schema-aliases.cjs +532 -0
- package/scripts/check-shape-declaration.cjs +958 -0
- package/scripts/check-shape-declaration.test.cjs +185 -0
- package/scripts/check-skill-spec.cjs +312 -0
- package/scripts/check-skill-vs-code-drift.cjs +178 -0
- package/scripts/check-substrate.cjs +513 -0
- package/scripts/check-tool-honesty.cjs +1601 -0
- package/scripts/check-update +60 -0
- package/scripts/check-version-and-sha.cjs +366 -0
- package/scripts/check-voice-style.cjs +184 -0
- package/scripts/check-worktree-hygiene.cjs +530 -0
- package/scripts/classify-insight +59 -0
- package/scripts/coherence-smoke-test.cjs +489 -0
- package/scripts/compute-bayesian-surprise.py +175 -0
- package/scripts/compute-blindspot-mass.py +209 -0
- package/scripts/compute-disruption-index.py +211 -0
- package/scripts/compute-element-novelty.py +254 -0
- package/scripts/compute-external-whitespace.py +563 -0
- package/scripts/compute-hsi.py +947 -0
- package/scripts/compute-meetings-intelligence +716 -0
- package/scripts/compute-opportunity-state +17 -0
- package/scripts/compute-state +393 -0
- package/scripts/compute-team +1112 -0
- package/scripts/compute-whitespace-embeddings.py +464 -0
- package/scripts/compute-whitespace-gaps.py +562 -0
- package/scripts/compute_topic_forest.py +684 -0
- package/scripts/consolidate-pinecone.py +265 -0
- package/scripts/context-monitor +943 -0
- package/scripts/create-speaker-profile +311 -0
- package/scripts/cross-room-detect.cjs +195 -0
- package/scripts/csv-to-idea-graph.cjs +755 -0
- package/scripts/ctxl-eval.cjs +846 -0
- package/scripts/curation-132-03-dedup-held-rename.cjs +395 -0
- package/scripts/curation-132-05-pseudonymize.cjs +189 -0
- package/scripts/derive-verb-reach-affinity.cjs +507 -0
- package/scripts/detect-reverse-salients.py +242 -0
- package/scripts/diagnostics-command.cjs +345 -0
- package/scripts/dial-memory-refresh-command.cjs +147 -0
- package/scripts/discover-analogy-whitespace.py +433 -0
- package/scripts/discover-hsi-whitespace.py +352 -0
- package/scripts/discover-rs-whitespace.py +327 -0
- package/scripts/discovery-cycle.cjs +625 -0
- package/scripts/disposition-render-v2.cjs +229 -0
- package/scripts/doctor-preflight-format.cjs +101 -0
- package/scripts/doctor.cjs +4327 -0
- package/scripts/dogfood-bridge/append-to-queue.sh +59 -0
- package/scripts/dogfood-bridge/path-filter.cjs +86 -0
- package/scripts/dogfood-derive.cjs +158 -0
- package/scripts/dogfood-emit.cjs +126 -0
- package/scripts/empathy-observation-emit.cjs +108 -0
- package/scripts/enrichment-queue-append.cjs +157 -0
- package/scripts/ensure-brain-baseline.cjs +117 -0
- package/scripts/entity-extract.cjs +1135 -0
- package/scripts/eureka-command.cjs +687 -0
- package/scripts/eureka-critic-run.cjs +662 -0
- package/scripts/eureka-portfolio-report.cjs +2038 -0
- package/scripts/eureka-room-report.cjs +419 -0
- package/scripts/explain-decision-command.cjs +499 -0
- package/scripts/export-pinecone-embeddings.cjs +516 -0
- package/scripts/extract-room-intelligence.cjs +714 -0
- package/scripts/fetch-brain-baseline.cjs +190 -0
- package/scripts/fetch-brain-baseline.py +360 -0
- package/scripts/feynman-minto-guardian.cjs +672 -0
- package/scripts/feynman-timeline-refresh-command.cjs +270 -0
- package/scripts/file-asset +253 -0
- package/scripts/fire-sensor-event.cjs +83 -0
- package/scripts/first-install-router.cjs +968 -0
- package/scripts/frontmatter-schema-validator.cjs +339 -0
- package/scripts/fts-index-drain.cjs +221 -0
- package/scripts/generate-chat-embed.cjs +179 -0
- package/scripts/generate-deck.cjs +322 -0
- package/scripts/generate-export.cjs +474 -0
- package/scripts/generate-hub.cjs +2553 -0
- package/scripts/generate-lobby.cjs +718 -0
- package/scripts/generate-presentation.cjs +988 -0
- package/scripts/generate-presentation.test.cjs +405 -0
- package/scripts/generate-section-intelligence.cjs +330 -0
- package/scripts/generate-snapshot.cjs +1410 -0
- package/scripts/generate-standalone +159 -0
- package/scripts/git-ops +211 -0
- package/scripts/graph-heal-pipeline.cjs +321 -0
- package/scripts/gsd-artifact-graph-hook.cjs +219 -0
- package/scripts/gsd-graph-derive-drain.cjs +571 -0
- package/scripts/gsd-graph-derive-sweep.cjs +195 -0
- package/scripts/heal-command.cjs +1365 -0
- package/scripts/hedge-refit-pipeline.cjs +207 -0
- package/scripts/help-renderer.cjs +303 -0
- package/scripts/hmi-compliance-poll.cjs +451 -0
- package/scripts/hmi-status-command.cjs +510 -0
- package/scripts/hooked-rescore-117.cjs +224 -0
- package/scripts/hooks/pre-commit +533 -0
- package/scripts/hooks/pre-commit-room-minto-guard.cmd +43 -0
- package/scripts/hooks/pre-commit-room-minto-guard.sh +533 -0
- package/scripts/hsi-to-graph.cjs +194 -0
- package/scripts/huji-batch.cjs +821 -0
- package/scripts/huji-eval.cjs +1158 -0
- package/scripts/huji-intake.cjs +563 -0
- package/scripts/huji-pin-smoketest.cjs +454 -0
- package/scripts/huji-run-one-async.cjs +305 -0
- package/scripts/huji-run-one.cjs +671 -0
- package/scripts/install-pre-commit.sh +113 -0
- package/scripts/intent-classifier +106 -0
- package/scripts/intent-classifier.cjs +3620 -0
- package/scripts/interpret-whitespace.cjs +691 -0
- package/scripts/jtbd-command.cjs +810 -0
- package/scripts/jtbd-update.cjs +299 -0
- package/scripts/label-topic-forest.cjs +667 -0
- package/scripts/learn-from-usage +168 -0
- package/scripts/lib/__pycache__/ensure_ml_deps.cpython-312.pyc +0 -0
- package/scripts/lib/ensure_ml_deps.py +97 -0
- package/scripts/load-embeddings-into-neo4j.cjs +569 -0
- package/scripts/memory-artifact-graph-hook.cjs +191 -0
- package/scripts/memory-command.cjs +687 -0
- package/scripts/memory-completion-detector.cjs +217 -0
- package/scripts/memory-lifecycle.cjs +620 -0
- package/scripts/memory-resume-nudge.cjs +233 -0
- package/scripts/methodology-ingest-local.sh +36 -0
- package/scripts/migrate-brain-mcp-from-http-to-stdio.cjs +190 -0
- package/scripts/migrate-brain-mcp-from-http-to-stdio.test.cjs +242 -0
- package/scripts/migrate-hats-to-roomdb.cjs +217 -0
- package/scripts/migrate-lazygraph.cjs +250 -0
- package/scripts/migrate-minto-schema-v88.cjs +296 -0
- package/scripts/migrate-plugin-root-refs.cjs +168 -0
- package/scripts/migrate-room-sections-v275.cjs +556 -0
- package/scripts/migrate-rooms +417 -0
- package/scripts/migrate-skill-frontmatter.cjs +472 -0
- package/scripts/migrate-stale-user-settings.cjs +296 -0
- package/scripts/migrate-telemetry-v1.cjs +384 -0
- package/scripts/migrate-telemetry-v1.test.cjs +356 -0
- package/scripts/minto-debouncer.cjs +428 -0
- package/scripts/mos-status.cjs +622 -0
- package/scripts/mva-detect.cjs +229 -0
- package/scripts/mva-run.cjs +36 -0
- package/scripts/on-agent-complete +163 -0
- package/scripts/on-cwd-changed +149 -0
- package/scripts/on-file-changed +68 -0
- package/scripts/on-stop +617 -0
- package/scripts/on-task-complete +194 -0
- package/scripts/operator-command.cjs +858 -0
- package/scripts/operator-update.cjs +308 -0
- package/scripts/part8-egress-guard-hook.cjs +229 -0
- package/scripts/pipeline-command.cjs +271 -0
- package/scripts/post-compact +383 -0
- package/scripts/post-update-activation.cjs +339 -0
- package/scripts/post-write +283 -0
- package/scripts/power-demo-prompt.md +621 -0
- package/scripts/pre-compact +273 -0
- package/scripts/preflight-auto-explore.cjs +314 -0
- package/scripts/preflight-doctor.cjs +225 -0
- package/scripts/preflight-release-drift.cjs +168 -0
- package/scripts/preflight-tension-surface.cjs +414 -0
- package/scripts/probe-brain-contract.cjs +502 -0
- package/scripts/publish-ops +346 -0
- package/scripts/query-efficiency-telemetry.cjs +364 -0
- package/scripts/query-semantic-scholar.cjs +545 -0
- package/scripts/reapply-modifications +49 -0
- package/scripts/reassign-primary.cjs +125 -0
- package/scripts/recompile-room-references.cjs +601 -0
- package/scripts/release-beta-preflight.sh +69 -0
- package/scripts/render-pdf +588 -0
- package/scripts/render-viz +190 -0
- package/scripts/research-speaker +239 -0
- package/scripts/resolve-room +204 -0
- package/scripts/restore-post-compact-context.cjs +320 -0
- package/scripts/room-auto-create-nudge.cjs +136 -0
- package/scripts/room-naming-selector.cjs +201 -0
- package/scripts/room-registry +767 -0
- package/scripts/rs-discovery-engine.cjs +725 -0
- package/scripts/rs-engine.py +2073 -0
- package/scripts/rs-experts-command.cjs +300 -0
- package/scripts/rs-explain-command.cjs +323 -0
- package/scripts/rs-fetch-command.cjs +170 -0
- package/scripts/rs-thesis-command.cjs +203 -0
- package/scripts/rs-vector-bridge.cjs +410 -0
- package/scripts/run-harness.cjs +890 -0
- package/scripts/scout-cadence-guard.cjs +323 -0
- package/scripts/scout-cadence-runner.cjs +509 -0
- package/scripts/scout-telemetry-aggregator.cjs +268 -0
- package/scripts/sealed-walker.py +96 -0
- package/scripts/seed-brain-commands.cjs +324 -0
- package/scripts/self-update +105 -0
- package/scripts/sentinel-deadline-monitor +241 -0
- package/scripts/sentinel-health-check +198 -0
- package/scripts/sentinel-snapshot +42 -0
- package/scripts/serve-dashboard +103 -0
- package/scripts/serve-dashboard-live +932 -0
- package/scripts/serve-presentation +97 -0
- package/scripts/serve-wiki +90 -0
- package/scripts/session-end-presence.cjs +79 -0
- package/scripts/session-start +1942 -0
- package/scripts/sessionstart-coordinator.cjs +249 -0
- package/scripts/sessionstart-npm-reconcile.cjs +111 -0
- package/scripts/sessionstart-post-update-preflight.cjs +303 -0
- package/scripts/sessionstart-reference-now-seed.cjs +137 -0
- package/scripts/setup-hooks.sh +112 -0
- package/scripts/skillopt-codereview.cjs +830 -0
- package/scripts/skillopt-eval.cjs +519 -0
- package/scripts/skillopt-funnel.cjs +1076 -0
- package/scripts/skillopt-genqueries.cjs +571 -0
- package/scripts/skillopt-inventory.cjs +319 -0
- package/scripts/skillopt-merge.cjs +656 -0
- package/scripts/skillopt-triggerloop.cjs +1126 -0
- package/scripts/soft-alias-runner.cjs +116 -0
- package/scripts/stamp-artifact-write.cjs +276 -0
- package/scripts/stamp-firing-block.cjs +325 -0
- package/scripts/state-write.cjs +97 -0
- package/scripts/statusline-fallback-echo.cjs +297 -0
- package/scripts/statusline-mos +116 -0
- package/scripts/statusline-mos-dispatch +127 -0
- package/scripts/suggest-next-command.cjs +416 -0
- package/scripts/sweep-skill-descriptions.cjs +263 -0
- package/scripts/sync-rooms-brain +438 -0
- package/scripts/sync-rooms-graph +264 -0
- package/scripts/telemetry-command-invocation.cjs +120 -0
- package/scripts/test-doctor-recovery.cjs +242 -0
- package/scripts/test-fresh-install.md +140 -0
- package/scripts/track-analytics +156 -0
- package/scripts/transcribe-audio +148 -0
- package/scripts/transcript-ingest.cjs +225 -0
- package/scripts/update-icm-index +153 -0
- package/scripts/v182-brain-optimize.cypher +1191 -0
- package/scripts/validate-model-profiles +93 -0
- package/scripts/vault-content-reformatter.cjs +581 -0
- package/scripts/vault-export-orchestrator.cjs +400 -0
- package/scripts/vault-footer-injector.cjs +315 -0
- package/scripts/vault-import.cjs +839 -0
- package/scripts/vault-integration-test.cjs +318 -0
- package/scripts/vault-regenerate-all.cjs +216 -0
- package/scripts/vault-regenerate-all.test.cjs +138 -0
- package/scripts/vault-rules-generator.cjs +220 -0
- package/scripts/vault-section-minto-generator.cjs +1642 -0
- package/scripts/vault-section-minto-generator.integration.test.cjs +576 -0
- package/scripts/vault-section-minto-generator.test.cjs +291 -0
- package/scripts/vault-section-state-generator.cjs +385 -0
- package/scripts/vault-welcome-generator.cjs +403 -0
- package/scripts/vault-wikilink-injector.cjs +449 -0
- package/scripts/verify-phase-132.cjs +338 -0
- package/scripts/verify-release +744 -0
- package/scripts/whitespace-command.cjs +831 -0
- package/scripts/whitespace-to-brain.cjs +383 -0
- package/scripts/whitespace-to-graph.cjs +220 -0
- package/scripts/wikilink-batch.cjs +102 -0
- package/scripts/wikilink-file.cjs +139 -0
- package/scripts/write-bridge-artifacts.cjs +140 -0
- package/scripts/write-scope-check +12 -0
- package/scripts/write-scope-check.cjs +461 -0
- package/scripts/write-whitespace-sections.cjs +483 -0
- package/settings.json +7 -0
- package/skills/act/SKILL.md +523 -0
- package/skills/admin/SKILL.md +437 -0
- package/skills/agentshield/SKILL.md +50 -0
- package/skills/analyze-needs/SKILL.md +74 -0
- package/skills/analyze-systems/SKILL.md +69 -0
- package/skills/analyze-timing/SKILL.md +94 -0
- package/skills/auto-explore/SKILL.md +84 -0
- package/skills/beautiful-question/SKILL.md +72 -0
- package/skills/bono/SKILL.md +146 -0
- package/skills/brain-connector/SKILL.md +206 -0
- package/skills/brain-derive/SKILL.md +140 -0
- package/skills/build-knowledge/SKILL.md +118 -0
- package/skills/build-thesis/SKILL.md +90 -0
- package/skills/causal/SKILL.md +265 -0
- package/skills/challenge-assumptions/SKILL.md +74 -0
- package/skills/client-discovery-interview/SKILL.md +94 -0
- package/skills/client-discovery-interview/discovery-scaffold.json +41 -0
- package/skills/client-discovery-interview/question-bank.md +149 -0
- package/skills/compare-ventures/SKILL.md +113 -0
- package/skills/context-engine/SKILL.md +169 -0
- package/skills/conversation-mode/SKILL.md +189 -0
- package/skills/correct-reference-now/SKILL.md +86 -0
- package/skills/dashboard/SKILL.md +142 -0
- package/skills/deck/SKILL.md +113 -0
- package/skills/deep-grade/SKILL.md +210 -0
- package/skills/diagnose/SKILL.md +128 -0
- package/skills/diagnostics/SKILL.md +193 -0
- package/skills/dial-memory-refresh/SKILL.md +116 -0
- package/skills/diffusion/SKILL.md +125 -0
- package/skills/discover/SKILL.md +216 -0
- package/skills/doctor/SKILL.md +269 -0
- package/skills/dogfood-flush/SKILL.md +133 -0
- package/skills/dominant-designs/SKILL.md +72 -0
- package/skills/eureka/SKILL.md +313 -0
- package/skills/explain-decision/SKILL.md +138 -0
- package/skills/explore-domains/SKILL.md +74 -0
- package/skills/explore-futures/SKILL.md +64 -0
- package/skills/explore-opportunity/SKILL.md +168 -0
- package/skills/explore-trends/SKILL.md +74 -0
- package/skills/export/SKILL.md +126 -0
- package/skills/feynman-timeline-refresh/SKILL.md +105 -0
- package/skills/file-meeting/SKILL.md +1190 -0
- package/skills/find-analogies/SKILL.md +360 -0
- package/skills/find-bottlenecks/SKILL.md +104 -0
- package/skills/find-connections/SKILL.md +108 -0
- package/skills/funding/SKILL.md +110 -0
- package/skills/futures/SKILL.md +124 -0
- package/skills/grade/SKILL.md +252 -0
- package/skills/grade-grant/SKILL.md +293 -0
- package/skills/graph/SKILL.md +216 -0
- package/skills/hat-briefing/SKILL.md +160 -0
- package/skills/heal/SKILL.md +69 -0
- package/skills/help/SKILL.md +172 -0
- package/skills/hmi-status/SKILL.md +73 -0
- package/skills/ignite/SKILL.md +225 -0
- package/skills/ingest-methodology/SKILL.md +125 -0
- package/skills/intel-pipeline/SKILL.md +128 -0
- package/skills/intelligence-orchestrator/SKILL.md +262 -0
- package/skills/jtbd/SKILL.md +261 -0
- package/skills/larry-personality/SKILL.md +570 -0
- package/skills/larry-personality/framework-chains.md +92 -0
- package/skills/larry-personality/mode-engine.md +185 -0
- package/skills/leadership/SKILL.md +109 -0
- package/skills/lean-canvas/SKILL.md +70 -0
- package/skills/macro-trends/SKILL.md +84 -0
- package/skills/map-unknowns/SKILL.md +72 -0
- package/skills/memory/SKILL.md +212 -0
- package/skills/memory-cortex-reach/SKILL.md +80 -0
- package/skills/models/SKILL.md +197 -0
- package/skills/mos/SKILL.md +160 -0
- package/skills/mos-deck-engine/SKILL.md +329 -0
- package/skills/mos-reason/SKILL.md +484 -0
- package/skills/mullins/SKILL.md +151 -0
- package/skills/mullins-scaffold/SKILL.md +132 -0
- package/skills/mullins-scaffold/scaffold.json +223 -0
- package/skills/mva-brief/SKILL.md +87 -0
- package/skills/mva-option/SKILL.md +120 -0
- package/skills/mva-pipeline/SKILL.md +158 -0
- package/skills/mva-report/SKILL.md +79 -0
- package/skills/new-project/SKILL.md +629 -0
- package/skills/new-surface/SKILL.md +112 -0
- package/skills/onboard/SKILL.md +485 -0
- package/skills/operator/SKILL.md +167 -0
- package/skills/opportunities/SKILL.md +171 -0
- package/skills/organize/SKILL.md +69 -0
- package/skills/persona/SKILL.md +272 -0
- package/skills/pipeline/SKILL.md +164 -0
- package/skills/present/SKILL.md +123 -0
- package/skills/publish/SKILL.md +224 -0
- package/skills/pws-brain/SKILL.md +152 -0
- package/skills/pws-methodology/SKILL.md +92 -0
- package/skills/qualify-opportunity/SKILL.md +111 -0
- package/skills/query/SKILL.md +68 -0
- package/skills/radar/SKILL.md +106 -0
- package/skills/reanalyze/SKILL.md +122 -0
- package/skills/research/SKILL.md +462 -0
- package/skills/room/SKILL.md +381 -0
- package/skills/room-passive/SKILL.md +174 -0
- package/skills/room-proactive/SKILL.md +344 -0
- package/skills/rooms/SKILL.md +678 -0
- package/skills/root-cause/SKILL.md +73 -0
- package/skills/rs-experts/SKILL.md +151 -0
- package/skills/rs-explain/SKILL.md +130 -0
- package/skills/rs-fetch/SKILL.md +115 -0
- package/skills/rs-thesis/SKILL.md +129 -0
- package/skills/scenario-plan/SKILL.md +76 -0
- package/skills/scheduled-tasks/SKILL.md +301 -0
- package/skills/score-innovation/SKILL.md +74 -0
- package/skills/scout/SKILL.md +370 -0
- package/skills/setup/SKILL.md +654 -0
- package/skills/show/SKILL.md +68 -0
- package/skills/skill/SKILL.md +104 -0
- package/skills/snapshot/SKILL.md +178 -0
- package/skills/speakers/SKILL.md +116 -0
- package/skills/splash/SKILL.md +54 -0
- package/skills/stance/SKILL.md +89 -0
- package/skills/status/SKILL.md +107 -0
- package/skills/structure-argument/SKILL.md +78 -0
- package/skills/suggest-next/SKILL.md +137 -0
- package/skills/systems-thinking/SKILL.md +220 -0
- package/skills/think-hats/SKILL.md +82 -0
- package/skills/trending-to-absurd/SKILL.md +100 -0
- package/skills/ui-system/SKILL.md +474 -0
- package/skills/ui-system/design-system/M-OS-DESIGN-SYSTEM.md +273 -0
- package/skills/ui-system/design-system/SPEC.md +72 -0
- package/skills/ui-system/design-system/image-prompt-style.md +29 -0
- package/skills/ui-system/design-system/mos-design-system.css +240 -0
- package/skills/ui-system/rules/design-system.md +60 -0
- package/skills/ui-system/rules/dual-palette.md +156 -0
- package/skills/ui-system/rules/glyph-disambiguation.md +171 -0
- package/skills/ui-system/rules/shape-f-zero-and-six.md +169 -0
- package/skills/update/SKILL.md +254 -0
- package/skills/user-needs/SKILL.md +73 -0
- package/skills/validate/SKILL.md +73 -0
- package/skills/value-proposition/SKILL.md +141 -0
- package/skills/vault/SKILL.md +326 -0
- package/skills/visualize/SKILL.md +69 -0
- package/skills/whitespace/SKILL.md +539 -0
- package/skills/wiki/SKILL.md +94 -0
- package/templates/_base.html +20 -0
- package/templates/chat-panel.html +205 -0
- package/templates/constellation-chat-hooks.js +89 -0
- package/templates/constellation.html +1272 -0
- package/templates/destijl-base.css +268 -0
- package/templates/discovery/discovery-brief-template.md +97 -0
- package/templates/due-diligence.html +49 -0
- package/templates/executive-summary.html +40 -0
- package/templates/icm/CLAUDE.md +31 -0
- package/templates/icm/GROUP-CLAUDE.md +33 -0
- package/templates/icm/INDEX.md +26 -0
- package/templates/import/stage-contracts/01-ingest.md +34 -0
- package/templates/import/stage-contracts/02-classify.md +48 -0
- package/templates/import/stage-contracts/03-route.md +42 -0
- package/templates/import/stage-contracts/04-enrich.md +40 -0
- package/templates/investment-thesis.html +25 -0
- package/templates/meeting-report.html +361 -0
- package/templates/presentation/dashboard.html +1150 -0
- package/templates/presentation/deck.html +540 -0
- package/templates/presentation/diagrams.html +437 -0
- package/templates/presentation/graph.html +391 -0
- package/templates/presentation/insights.html +548 -0
- package/templates/presentation/wiki.html +533 -0
- package/templates/profile.html +136 -0
- package/templates/room-context/last-session.md +56 -0
- package/templates/room-context/methodology-history.md +28 -0
- package/templates/room-context/rejection-log.md +25 -0
- package/templates/room-context/weekly-digest.md +54 -0
- package/templates/room-skeleton/MINTO.md.tmpl +19 -0
- package/templates/room-skeleton/ROOM.md.identity.tmpl +13 -0
- package/templates/room-skeleton/ROOM.md.section.tmpl +33 -0
- package/templates/room-skeleton/STATE.md.tmpl +33 -0
- package/templates/room-skeleton/USER.md.tmpl +23 -0
- package/templates/room-skeleton/references/.gitkeep +0 -0
- package/templates/room-skeleton/references/SECTION-SCHEMA.md +213 -0
- package/templates/room-skeleton/references/SUB-SCHEMAS.md +91 -0
- package/templates/room-skeleton/section-contracts/.gitkeep +0 -0
- package/templates/room-skeleton/section-contracts/business-model.md +32 -0
- package/templates/room-skeleton/section-contracts/competitive-analysis.md +33 -0
- package/templates/room-skeleton/section-contracts/financial-model.md +30 -0
- package/templates/room-skeleton/section-contracts/funding.md +41 -0
- package/templates/room-skeleton/section-contracts/legal-ip.md +30 -0
- package/templates/room-skeleton/section-contracts/market-analysis.md +32 -0
- package/templates/room-skeleton/section-contracts/opportunity-bank.md +39 -0
- package/templates/room-skeleton/section-contracts/problem-definition.md +32 -0
- package/templates/room-skeleton/section-contracts/solution-design.md +36 -0
- package/templates/room-skeleton/section-contracts/strategy.md +35 -0
- package/templates/room-skeleton/section-contracts/team-execution.md +36 -0
- package/templates/shared.css +427 -0
- package/templates/showcase/blueprint.html +432 -0
- package/templates/showcase/library.html +571 -0
- package/templates/showcase/narrative.html +361 -0
- package/templates/showcase/overview.html +468 -0
- package/templates/showcase/synthesis.html +473 -0
- package/templates/signature-footer.html +34 -0
|
@@ -0,0 +1,1391 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MindrianOS Plugin -- Futures Wheel orchestrator (Phase 156, Wave 1 shell)
|
|
3
|
+
*
|
|
4
|
+
* This is the interface-first SHELL for the /mos:futures pipeline. It owns the
|
|
5
|
+
* consequence frontmatter CONTRACT (horizon / confidence / PESTEL domain) and the
|
|
6
|
+
* bounded depth / fan-out cap CONSTANTS that the later waves build against, so
|
|
7
|
+
* Wave 2 receives the contract in-hand and never explores for it.
|
|
8
|
+
*
|
|
9
|
+
* Wave 1 scope (this file): the cap constants, the two frozen enums, and
|
|
10
|
+
* validateConsequenceFrontmatter (FW-04). ZERO graph writes, ZERO HSI surface,
|
|
11
|
+
* ZERO Larry generation loop -- those land in Waves 2-4 (clearly labeled stubs
|
|
12
|
+
* below). Canon Part 8: everything local, zero Brain egress.
|
|
13
|
+
*
|
|
14
|
+
* Pure Node.js built-ins only (zero npm deps per Phase 10 decision).
|
|
15
|
+
* Reuses opportunity-ops.parseFrontmatter for any frontmatter parsing
|
|
16
|
+
* (Part 7: do NOT hand-roll a YAML parser).
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
'use strict';
|
|
20
|
+
|
|
21
|
+
const fs = require('fs');
|
|
22
|
+
const path = require('path');
|
|
23
|
+
const { execFileSync } = require('child_process');
|
|
24
|
+
const { parseFrontmatter } = require('../opportunity-ops.cjs');
|
|
25
|
+
const navigation = require('../navigation.cjs');
|
|
26
|
+
const { flagCausalCue } = require('./causal-cue.cjs');
|
|
27
|
+
// Phase 272 D-04: the single dispatch chokepoint deciding CJS vs Python for
|
|
28
|
+
// both this file's spawn sites (runHsiScan's compute-hsi.py call and
|
|
29
|
+
// runRSReverseSalient's rs-engine.py call below). No other function in this
|
|
30
|
+
// file decides backend selection directly.
|
|
31
|
+
const rsBackendDispatch = require('../rs-backend-dispatch.cjs');
|
|
32
|
+
const hsiEngine = require('../hsi-engine.cjs');
|
|
33
|
+
const rsEngineCjs = require('../rs-engine.cjs');
|
|
34
|
+
|
|
35
|
+
// --- Bounded caps (FW-02) ---
|
|
36
|
+
// The wheel "explodes in complexity, mathematically unmanageable without
|
|
37
|
+
// software" -- these caps keep it tractable. Navigator-overridable, but every
|
|
38
|
+
// override is CLAMPED to the cap maximum (a navigator may shrink, never exceed).
|
|
39
|
+
const FUTURES_DEPTH_CAP = 3; // default + maximum number of rings
|
|
40
|
+
const FUTURES_FANOUT_CAP = 5; // default + maximum children per node
|
|
41
|
+
|
|
42
|
+
// --- Frozen enums (FW-04) ---
|
|
43
|
+
const HORIZON_ENUM = Object.freeze(['near', 'mid', 'long']);
|
|
44
|
+
const PESTEL_DOMAIN_ENUM = Object.freeze([
|
|
45
|
+
'Political',
|
|
46
|
+
'Economic',
|
|
47
|
+
'Social',
|
|
48
|
+
'Technological',
|
|
49
|
+
'Environmental',
|
|
50
|
+
'Legal',
|
|
51
|
+
]);
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Resolve the effective depth cap, clamping a navigator override to the maximum.
|
|
55
|
+
* A navigator may request fewer rings; never more than FUTURES_DEPTH_CAP.
|
|
56
|
+
*
|
|
57
|
+
* @param {Object} [opts]
|
|
58
|
+
* @param {number} [opts.depth] - requested ring depth
|
|
59
|
+
* @returns {number} effective depth (1..FUTURES_DEPTH_CAP)
|
|
60
|
+
*/
|
|
61
|
+
function resolveDepthCap(opts) {
|
|
62
|
+
opts = opts || {};
|
|
63
|
+
const requested = Number.isFinite(opts.depth) ? Math.floor(opts.depth) : FUTURES_DEPTH_CAP;
|
|
64
|
+
if (requested < 1) return 1;
|
|
65
|
+
if (requested > FUTURES_DEPTH_CAP) return FUTURES_DEPTH_CAP;
|
|
66
|
+
return requested;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Resolve the effective fan-out cap, clamping a navigator override to the maximum.
|
|
71
|
+
*
|
|
72
|
+
* @param {Object} [opts]
|
|
73
|
+
* @param {number} [opts.fanout] - requested per-node fan-out
|
|
74
|
+
* @returns {number} effective fan-out (1..FUTURES_FANOUT_CAP)
|
|
75
|
+
*/
|
|
76
|
+
function resolveFanoutCap(opts) {
|
|
77
|
+
opts = opts || {};
|
|
78
|
+
const requested = Number.isFinite(opts.fanout) ? Math.floor(opts.fanout) : FUTURES_FANOUT_CAP;
|
|
79
|
+
if (requested < 1) return 1;
|
|
80
|
+
if (requested > FUTURES_FANOUT_CAP) return FUTURES_FANOUT_CAP;
|
|
81
|
+
return requested;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Validate a consequence frontmatter object against the FW-04 contract:
|
|
86
|
+
* - horizon is in HORIZON_ENUM
|
|
87
|
+
* - confidence is a float in the inclusive range 0.0-1.0
|
|
88
|
+
* - domain is in PESTEL_DOMAIN_ENUM
|
|
89
|
+
*
|
|
90
|
+
* Advisory-free: this is a hard structural validator (the contract Wave 2's
|
|
91
|
+
* generation loop writes against). It NEVER mutates the input.
|
|
92
|
+
*
|
|
93
|
+
* @param {Object} fm - the consequence frontmatter object (or a parsed string)
|
|
94
|
+
* @returns {{ valid: boolean, errors: string[] }}
|
|
95
|
+
*/
|
|
96
|
+
function validateConsequenceFrontmatter(fm) {
|
|
97
|
+
const errors = [];
|
|
98
|
+
|
|
99
|
+
// Accept a raw markdown/frontmatter string by reusing the shipped parser.
|
|
100
|
+
if (typeof fm === 'string') {
|
|
101
|
+
fm = parseFrontmatter(fm);
|
|
102
|
+
}
|
|
103
|
+
if (!fm || typeof fm !== 'object') {
|
|
104
|
+
return { valid: false, errors: ['frontmatter is not an object'] };
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// horizon: enum
|
|
108
|
+
if (!HORIZON_ENUM.includes(fm.horizon)) {
|
|
109
|
+
errors.push(
|
|
110
|
+
'horizon must be one of ' + HORIZON_ENUM.join(' / ') + ' (got ' + String(fm.horizon) + ')'
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// confidence: float in [0.0, 1.0]
|
|
115
|
+
const conf = fm.confidence;
|
|
116
|
+
if (typeof conf !== 'number' || Number.isNaN(conf)) {
|
|
117
|
+
errors.push('confidence must be a number (got ' + String(conf) + ')');
|
|
118
|
+
} else if (conf < 0 || conf > 1) {
|
|
119
|
+
errors.push('confidence must be in the inclusive range 0.0-1.0 (got ' + conf + ')');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// domain: enum
|
|
123
|
+
if (!PESTEL_DOMAIN_ENUM.includes(fm.domain)) {
|
|
124
|
+
errors.push(
|
|
125
|
+
'domain must be one of ' + PESTEL_DOMAIN_ENUM.join(' / ') + ' (got ' + String(fm.domain) + ')'
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return { valid: errors.length === 0, errors };
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// ---------------------------------------------------------------------------
|
|
133
|
+
// Wave 2 surface (FW-02 / FW-05 / FW-06)
|
|
134
|
+
//
|
|
135
|
+
// generateRing -- the bounded guided-by-ring generation loop (D-01).
|
|
136
|
+
// writeCascadeEdges -- the ROOT_CAUSES / ENABLES cascade-edge writer (Part 9
|
|
137
|
+
// chokepoint navigation.writeEdge ONLY; never raw SQL).
|
|
138
|
+
// registerConsequenceArtifacts -- files each consequence as a nested .md AND
|
|
139
|
+
// registers it as a type='Artifact' node in room.db.
|
|
140
|
+
// assertArtifactCountMatchesFiled -- the LANDMINE #1 precondition guard.
|
|
141
|
+
// runHsiScan -- the ordered register->assert->compute-hsi->hsi-to-graph
|
|
142
|
+
// ->read-back sequencer.
|
|
143
|
+
// ---------------------------------------------------------------------------
|
|
144
|
+
|
|
145
|
+
// --- Forbidden non-frozen edge types (RESEARCH landmine #2) ---
|
|
146
|
+
// HSI_CONNECTION / REVERSE_SALIENT are NOT in ALLOWED_EDGE_TYPES; they go ONLY
|
|
147
|
+
// through scripts/hsi-to-graph.cjs raw SQL, NEVER through navigation.writeEdge.
|
|
148
|
+
// The non-frozen causal aliases (the LEADS-TO / generic-cause variants) are
|
|
149
|
+
// never referenced here; only the frozen ROOT_CAUSES type is written.
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Slugify a free-text label into a filesystem-safe, lowercase, hyphenated slug.
|
|
153
|
+
* Pure ASCII transform (no em-dashes, only hyphens). Used for the nested
|
|
154
|
+
* Obsidian folder names (CLAUDE.md decision 16) under opportunity-bank/.
|
|
155
|
+
* @param {string} label
|
|
156
|
+
* @returns {string}
|
|
157
|
+
*/
|
|
158
|
+
function slugify(label) {
|
|
159
|
+
return String(label || '')
|
|
160
|
+
.toLowerCase()
|
|
161
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
162
|
+
.replace(/^-+|-+$/g, '')
|
|
163
|
+
.slice(0, 64) || 'consequence';
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Compute the room-relative Artifact id for a consequence .md path. MUST match
|
|
168
|
+
* the id convention used by lib/core/lazygraph-ops.cjs::getArtifactId AND by
|
|
169
|
+
* scripts/compute-hsi.py::discover_artifacts (room-relative path, .md stripped,
|
|
170
|
+
* forward-slashed) so the registered Artifact node id and the HSI pair endpoint
|
|
171
|
+
* id are byte-identical. Without this, hsi-to-graph silently writes zero edges.
|
|
172
|
+
* @param {string} roomDir
|
|
173
|
+
* @param {string} mdPath - absolute path to the consequence .md
|
|
174
|
+
* @returns {string}
|
|
175
|
+
*/
|
|
176
|
+
function consequenceArtifactId(roomDir, mdPath) {
|
|
177
|
+
const rel = path.relative(path.resolve(roomDir), path.resolve(mdPath));
|
|
178
|
+
return rel.replace(/\.md$/, '').replace(/\\/g, '/');
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* generateRing -- the bounded D-01 "and then what?" expansion (FW-02).
|
|
183
|
+
*
|
|
184
|
+
* Ring 1 is generated directly from the seed; ring N>1 expands ONLY the approved
|
|
185
|
+
* parents, each into at most FUTURES_FANOUT_CAP children. ringNumber is clamped
|
|
186
|
+
* to FUTURES_DEPTH_CAP and per-parent children to FUTURES_FANOUT_CAP so the wheel
|
|
187
|
+
* cannot balloon (the guard that MUST run before the HSI O(n^2) pairing).
|
|
188
|
+
*
|
|
189
|
+
* Prose generation is Larry-driven on Desktop/Cowork; on CLI the function
|
|
190
|
+
* accepts a pre-supplied consequence batch (opts.children for ring 1, or
|
|
191
|
+
* parent.children on each parent for ring N>1) so it is unit-testable headlessly.
|
|
192
|
+
*
|
|
193
|
+
* Each returned consequence object carries: id, ring, parent_id (null for ring
|
|
194
|
+
* 1), horizon, confidence, domain, label, and a causal_cue annotation. The
|
|
195
|
+
* domain is validated via validateConsequenceFrontmatter; an invalid consequence
|
|
196
|
+
* is skipped (advisory, never throws on a single bad child).
|
|
197
|
+
*
|
|
198
|
+
* @param {string} seed - the seed label / focus (ring-1 driver)
|
|
199
|
+
* @param {number} ringNumber - requested ring (clamped to FUTURES_DEPTH_CAP)
|
|
200
|
+
* @param {Array<Object>} parents - approved parent consequence objects (ring N>1)
|
|
201
|
+
* @param {Object} [opts]
|
|
202
|
+
* @param {Array<Object>} [opts.children] - pre-supplied ring-1 children batch
|
|
203
|
+
* @param {number} [opts.fanout] - navigator fan-out override (clamped)
|
|
204
|
+
* @returns {Array<Object>} the bounded ring-N consequence objects
|
|
205
|
+
*/
|
|
206
|
+
function generateRing(seed, ringNumber, parents, opts) {
|
|
207
|
+
opts = opts || {};
|
|
208
|
+
// Clamp the ring number to the depth cap (FW-02: caps clamp, never error).
|
|
209
|
+
const ring = resolveDepthCap({ depth: ringNumber });
|
|
210
|
+
const fanout = resolveFanoutCap({ fanout: opts.fanout });
|
|
211
|
+
|
|
212
|
+
const out = [];
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Normalize + validate one raw child into a consequence object. Returns null
|
|
216
|
+
* when the child fails the frontmatter contract (skip, do not throw).
|
|
217
|
+
*/
|
|
218
|
+
function buildConsequence(raw, parentId) {
|
|
219
|
+
if (!raw || typeof raw !== 'object') return null;
|
|
220
|
+
const label = String(raw.label || raw.title || '').trim();
|
|
221
|
+
const fm = {
|
|
222
|
+
horizon: raw.horizon,
|
|
223
|
+
confidence: raw.confidence,
|
|
224
|
+
domain: raw.domain,
|
|
225
|
+
};
|
|
226
|
+
const v = validateConsequenceFrontmatter(fm);
|
|
227
|
+
if (!v.valid) return null;
|
|
228
|
+
const cue = flagCausalCue(label + ' ' + String(raw.body || ''));
|
|
229
|
+
return {
|
|
230
|
+
id: raw.id || (slugify(label) + '-r' + ring),
|
|
231
|
+
ring,
|
|
232
|
+
parent_id: parentId,
|
|
233
|
+
horizon: fm.horizon,
|
|
234
|
+
confidence: fm.confidence,
|
|
235
|
+
domain: fm.domain,
|
|
236
|
+
label,
|
|
237
|
+
body: typeof raw.body === 'string' ? raw.body : '',
|
|
238
|
+
causal_cue: cue.flag,
|
|
239
|
+
cue_matched: cue.matched,
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (ring === 1) {
|
|
244
|
+
// Ring 1: generated from the seed. Children clamped to the fan-out cap.
|
|
245
|
+
const batch = Array.isArray(opts.children) ? opts.children.slice(0, fanout) : [];
|
|
246
|
+
for (const raw of batch) {
|
|
247
|
+
const c = buildConsequence(raw, null);
|
|
248
|
+
if (c) out.push(c);
|
|
249
|
+
}
|
|
250
|
+
return out;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Ring N>1: expand ONLY the approved parents, each into at most `fanout`
|
|
254
|
+
// children, stamping ring N and the parent link.
|
|
255
|
+
const parentList = Array.isArray(parents) ? parents : [];
|
|
256
|
+
for (const parent of parentList) {
|
|
257
|
+
if (!parent || typeof parent.id !== 'string') continue;
|
|
258
|
+
const rawChildren = Array.isArray(parent.children) ? parent.children.slice(0, fanout) : [];
|
|
259
|
+
for (const raw of rawChildren) {
|
|
260
|
+
const c = buildConsequence(raw, parent.id);
|
|
261
|
+
if (c) out.push(c);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return out;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* writeCascadeEdges -- write a ROOT_CAUSES edge (source=parent CAUSE,
|
|
269
|
+
* target=child EFFECT) for every consequence carrying a non-null parent_id, via
|
|
270
|
+
* the navigation.writeEdge chokepoint ONLY (Part 9). ROOT_CAUSES is the frozen
|
|
271
|
+
* cascade edge for the parent->child causal link (added to ALLOWED_EDGE_TYPES by
|
|
272
|
+
* Phase 150.8). An explicit enabling relation requests ENABLES.
|
|
273
|
+
*
|
|
274
|
+
* NOTE (Wave 2 deviation, Rule 1): the plan and 156-RESEARCH assumed ENABLES is
|
|
275
|
+
* in the frozen ALLOWED_EDGE_TYPES set; it is NOT (only ROOT_CAUSES is). Because
|
|
276
|
+
* the Part 9 chokepoint + the orchestrator grep gate (zero raw edge-table writes)
|
|
277
|
+
* forbid raw-SQL bypassing writeEdge, an ENABLES request is routed through
|
|
278
|
+
* writeEdge and faithfully REPORTED as a failure ({reason:'invalid_edge_type'})
|
|
279
|
+
* rather than silently raw-SQL'd. ROOT_CAUSES (the actual parent->child cascade
|
|
280
|
+
* relation this wave needs) is frozen and always succeeds once both endpoints
|
|
281
|
+
* are registered Artifact nodes.
|
|
282
|
+
*
|
|
283
|
+
* Properties are enum/scalar ONLY (ring + confidence) -- never the consequence
|
|
284
|
+
* body (Part 8). The result surfaces failures so the caller / test sees them.
|
|
285
|
+
*
|
|
286
|
+
* @param {Object} db - caller-owned room.db handle (openGraph().db)
|
|
287
|
+
* @param {Array<Object>} consequences - ring consequence objects (with parent_id)
|
|
288
|
+
* @returns {{ written: number, edges: Array<Object>, failures: Array<Object> }}
|
|
289
|
+
*/
|
|
290
|
+
function writeCascadeEdges(db, consequences) {
|
|
291
|
+
const list = Array.isArray(consequences) ? consequences : [];
|
|
292
|
+
const edges = [];
|
|
293
|
+
const failures = [];
|
|
294
|
+
let written = 0;
|
|
295
|
+
|
|
296
|
+
for (const c of list) {
|
|
297
|
+
if (!c || typeof c.parent_id !== 'string' || c.parent_id.length === 0) continue;
|
|
298
|
+
// ROOT_CAUSES is the frozen cascade edge (parent->child). ENABLES is only
|
|
299
|
+
// attempted when explicitly requested; nothing non-frozen is ever forced.
|
|
300
|
+
const edgeType = c.edge_type === 'ENABLES' ? 'ENABLES' : 'ROOT_CAUSES';
|
|
301
|
+
const res = navigation.writeEdge(db, {
|
|
302
|
+
source_id: c.parent_id,
|
|
303
|
+
target_id: c.id,
|
|
304
|
+
edge_type: edgeType,
|
|
305
|
+
// enum/scalar ONLY (Part 8): ring number + confidence float. No body text.
|
|
306
|
+
properties: { ring: c.ring, confidence: c.confidence },
|
|
307
|
+
});
|
|
308
|
+
if (res && res.ok) {
|
|
309
|
+
written++;
|
|
310
|
+
edges.push({ source: c.parent_id, target: c.id, type: edgeType });
|
|
311
|
+
} else {
|
|
312
|
+
failures.push({ source: c.parent_id, target: c.id, type: edgeType, reason: res && res.reason });
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
return { written, edges, failures };
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* registerConsequenceArtifacts -- file each consequence as a nested Obsidian
|
|
321
|
+
* .md (CLAUDE.md decision 16: opportunity-bank/futures-<seed>/<slug>/<slug>.md)
|
|
322
|
+
* WITH an ICM Layer 0 ROOM.md per folder (CLAUDE.md decision 15), THEN register
|
|
323
|
+
* each consequence as a type='Artifact' node in room.db via the lazygraph
|
|
324
|
+
* indexing path (indexArtifact -> _indexArtifactBody -> insertNode). Both
|
|
325
|
+
* registrations are required: the .md for compute-hsi discover_artifacts, the
|
|
326
|
+
* Artifact node for hsi-to-graph's findArtifact gate.
|
|
327
|
+
*
|
|
328
|
+
* @param {string} roomDir - absolute room directory
|
|
329
|
+
* @param {Array<Object>} consequences - consequence objects (id/label/horizon/...)
|
|
330
|
+
* @param {Object} [opts]
|
|
331
|
+
* @param {string} [opts.seed] - seed label for the futures-<seed-slug> folder
|
|
332
|
+
* @returns {Promise<{ filed: Array<{id,path}>, seedDir: string }>}
|
|
333
|
+
*/
|
|
334
|
+
async function registerConsequenceArtifacts(roomDir, consequences, opts) {
|
|
335
|
+
opts = opts || {};
|
|
336
|
+
const lazygraph = require('../lazygraph-ops.cjs');
|
|
337
|
+
const resolvedRoom = path.resolve(roomDir);
|
|
338
|
+
const seedSlug = slugify(opts.seed || 'seed');
|
|
339
|
+
const seedDir = path.join(resolvedRoom, 'opportunity-bank', 'futures-' + seedSlug);
|
|
340
|
+
fs.mkdirSync(seedDir, { recursive: true });
|
|
341
|
+
|
|
342
|
+
// ICM Layer 0: the seed folder itself gets a ROOM.md identity file.
|
|
343
|
+
writeRoomMd(seedDir, 'Futures Wheel: ' + (opts.seed || seedSlug),
|
|
344
|
+
'Seed folder for the Futures Wheel consequence rings. Each child folder is one consequence artifact.');
|
|
345
|
+
|
|
346
|
+
const list = Array.isArray(consequences) ? consequences : [];
|
|
347
|
+
const filed = [];
|
|
348
|
+
|
|
349
|
+
// 1. File every consequence .md (and its ROOM.md) on disk FIRST.
|
|
350
|
+
const plan = [];
|
|
351
|
+
for (const c of list) {
|
|
352
|
+
if (!c || typeof c.label !== 'string') continue;
|
|
353
|
+
const slug = slugify(c.label) + (c.ring ? '-r' + c.ring : '');
|
|
354
|
+
const folder = path.join(seedDir, slug);
|
|
355
|
+
fs.mkdirSync(folder, { recursive: true });
|
|
356
|
+
// ICM Layer 0: each consequence folder gets a ROOM.md (decision 15).
|
|
357
|
+
writeRoomMd(folder, c.label, 'Consequence artifact (ring ' + c.ring + ', ' + c.domain + ').');
|
|
358
|
+
const mdPath = path.join(folder, slug + '.md');
|
|
359
|
+
const artifactId = consequenceArtifactId(resolvedRoom, mdPath);
|
|
360
|
+
// GAP FIX (live-UAT on formation, 2026-06-15): stamp the registered
|
|
361
|
+
// (path-derived) Artifact-node id back onto the consequence object so the
|
|
362
|
+
// downstream writeCascadeEdges targets the id that actually exists as a node.
|
|
363
|
+
// Before this, generateRing's short slug id (slug-rN) never matched the
|
|
364
|
+
// registered node id -> ROOT_CAUSES edges silently failed (0 written).
|
|
365
|
+
c.id = artifactId;
|
|
366
|
+
const fmBody = renderConsequenceMd(c);
|
|
367
|
+
fs.writeFileSync(mdPath, fmBody, 'utf-8');
|
|
368
|
+
plan.push({ artifactId, mdPath });
|
|
369
|
+
filed.push({ id: artifactId, path: mdPath });
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// 2. Register each consequence as an Artifact node in room.db (the gate for
|
|
373
|
+
// hsi-to-graph). indexArtifact derives the SAME id from the .md path.
|
|
374
|
+
const graph = await lazygraph.openGraph(resolvedRoom);
|
|
375
|
+
try {
|
|
376
|
+
for (const p of plan) {
|
|
377
|
+
await lazygraph.indexArtifact(graph.conn, resolvedRoom, p.mdPath);
|
|
378
|
+
}
|
|
379
|
+
} finally {
|
|
380
|
+
await lazygraph.closeGraph(graph.db);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
return { filed, seedDir };
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Render a consequence object to a frontmatter + body markdown string. Body is
|
|
388
|
+
* >50 chars so compute-hsi.py::discover_artifacts does not skip it as near-empty.
|
|
389
|
+
*/
|
|
390
|
+
function renderConsequenceMd(c) {
|
|
391
|
+
const lines = [];
|
|
392
|
+
lines.push('---');
|
|
393
|
+
lines.push('horizon: ' + c.horizon);
|
|
394
|
+
lines.push('confidence: ' + c.confidence);
|
|
395
|
+
lines.push('domain: ' + c.domain);
|
|
396
|
+
lines.push('ring: ' + c.ring);
|
|
397
|
+
if (c.parent_id) lines.push('parent_id: ' + c.parent_id);
|
|
398
|
+
lines.push('causal_cue: ' + (c.causal_cue || 'cue-thin'));
|
|
399
|
+
lines.push('review_status: proposed');
|
|
400
|
+
lines.push('---');
|
|
401
|
+
lines.push('');
|
|
402
|
+
lines.push('# ' + c.label);
|
|
403
|
+
lines.push('');
|
|
404
|
+
lines.push(c.body && c.body.length > 0 ? c.body
|
|
405
|
+
: 'Consequence in the ' + c.domain + ' domain at the ' + c.horizon
|
|
406
|
+
+ ' horizon. This artifact records a ring ' + c.ring
|
|
407
|
+
+ ' consequence of the Futures Wheel seed for cross-domain HSI analysis.');
|
|
408
|
+
lines.push('');
|
|
409
|
+
return lines.join('\n');
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Write an ICM Layer 0 ROOM.md identity file into a folder (CLAUDE.md decision
|
|
414
|
+
* 15: every directory in the Data Room gets a ROOM.md). Idempotent overwrite.
|
|
415
|
+
*/
|
|
416
|
+
function writeRoomMd(dir, title, description) {
|
|
417
|
+
const body = [
|
|
418
|
+
'# ' + title,
|
|
419
|
+
'',
|
|
420
|
+
description,
|
|
421
|
+
'',
|
|
422
|
+
'_ICM Layer 0 identity file (Futures Wheel)._',
|
|
423
|
+
'',
|
|
424
|
+
].join('\n');
|
|
425
|
+
fs.writeFileSync(path.join(dir, 'ROOM.md'), body, 'utf-8');
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* assertArtifactCountMatchesFiled -- the LANDMINE #1 precondition (RESEARCH risk
|
|
430
|
+
* 1). SELECTs COUNT(*) of type='Artifact' nodes whose id is in the filed set and
|
|
431
|
+
* asserts it equals the filed count. runHsiScan MUST call this and HARD-FAIL if
|
|
432
|
+
* the counts differ -- preventing hsi-to-graph's silent zero-edge false-success.
|
|
433
|
+
*
|
|
434
|
+
* @param {Object} db - caller-owned room.db handle
|
|
435
|
+
* @param {Array<string>} filedConsequenceIds - the filed Artifact ids
|
|
436
|
+
* @returns {{ ok: boolean, artifactCount: number, filedCount: number, missing: string[] }}
|
|
437
|
+
*/
|
|
438
|
+
function assertArtifactCountMatchesFiled(db, filedConsequenceIds) {
|
|
439
|
+
const ids = Array.isArray(filedConsequenceIds) ? filedConsequenceIds.filter((x) => typeof x === 'string') : [];
|
|
440
|
+
const filedCount = ids.length;
|
|
441
|
+
if (filedCount === 0) {
|
|
442
|
+
return { ok: false, artifactCount: 0, filedCount: 0, missing: [] };
|
|
443
|
+
}
|
|
444
|
+
const stmt = db.prepare("SELECT id FROM nodes WHERE id = ? AND type = 'Artifact'");
|
|
445
|
+
let artifactCount = 0;
|
|
446
|
+
const missing = [];
|
|
447
|
+
for (const id of ids) {
|
|
448
|
+
const row = stmt.get(id);
|
|
449
|
+
if (row) artifactCount++;
|
|
450
|
+
else missing.push(id);
|
|
451
|
+
}
|
|
452
|
+
return { ok: artifactCount === filedCount, artifactCount, filedCount, missing };
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* runHsiScan -- the FW-06 deterministic file-then-scan sequencer:
|
|
457
|
+
* (1) assertArtifactCountMatchesFiled -- HARD-FAIL (return {ok:false}) if
|
|
458
|
+
* counts differ; do NOT proceed to compute-hsi (the landmine guard).
|
|
459
|
+
* (2) python3 scripts/compute-hsi.py <roomDir> --tier 1 -> .hsi-results.json
|
|
460
|
+
* (3) node scripts/hsi-to-graph.cjs <roomDir> -> HSI_CONNECTION edges (raw SQL)
|
|
461
|
+
* (4) read back the HSI_CONNECTION edges and rank the cross-domain bridges
|
|
462
|
+
* (cross-domain = the two endpoints carry different PESTEL domains).
|
|
463
|
+
*
|
|
464
|
+
* Tri-Polar: detects python3 absence and degrades cleanly to a Tier 0 fallback
|
|
465
|
+
* (returns { degraded:true, tier:0 }) rather than crashing on Desktop/Cowork.
|
|
466
|
+
* This command OWNS the sequence; no hidden async.
|
|
467
|
+
*
|
|
468
|
+
* NEVER routes HSI_CONNECTION / REVERSE_SALIENT through navigation.writeEdge
|
|
469
|
+
* (they are not frozen) -- step (3) is the raw hsi-to-graph.cjs path.
|
|
470
|
+
*
|
|
471
|
+
* @param {string} roomDir
|
|
472
|
+
* @param {Array<string>} filedConsequenceIds
|
|
473
|
+
* @param {Object} [opts]
|
|
474
|
+
* @param {string} [opts.pluginRoot] - root holding scripts/ (default: repo root)
|
|
475
|
+
* @returns {Promise<Object>} result with { ok, guard, degraded?, tier, hsiEdgeCount, bridges[] }}
|
|
476
|
+
*/
|
|
477
|
+
async function runHsiScan(roomDir, filedConsequenceIds, opts) {
|
|
478
|
+
opts = opts || {};
|
|
479
|
+
const lazygraph = require('../lazygraph-ops.cjs');
|
|
480
|
+
const resolvedRoom = path.resolve(roomDir);
|
|
481
|
+
const pluginRoot = opts.pluginRoot || path.resolve(__dirname, '..', '..', '..');
|
|
482
|
+
const computeHsi = path.join(pluginRoot, 'scripts', 'compute-hsi.py');
|
|
483
|
+
const hsiToGraph = path.join(pluginRoot, 'scripts', 'hsi-to-graph.cjs');
|
|
484
|
+
|
|
485
|
+
// --- Step 1: LANDMINE #1 precondition. Hard-fail BEFORE compute-hsi. ---
|
|
486
|
+
let guard;
|
|
487
|
+
{
|
|
488
|
+
const graph = await lazygraph.openGraph(resolvedRoom);
|
|
489
|
+
try {
|
|
490
|
+
guard = assertArtifactCountMatchesFiled(graph.db, filedConsequenceIds);
|
|
491
|
+
} finally {
|
|
492
|
+
await lazygraph.closeGraph(graph.db);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
if (!guard.ok) {
|
|
496
|
+
return {
|
|
497
|
+
ok: false,
|
|
498
|
+
reason: 'artifact_count_mismatch',
|
|
499
|
+
guard,
|
|
500
|
+
hsiEdgeCount: 0,
|
|
501
|
+
bridges: [],
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// --- Step 2: compute-hsi (backend-dispatched) <room> --tier 1 -> .hsi-results.json ---
|
|
506
|
+
const hsiBackend = rsBackendDispatch.resolveBackend();
|
|
507
|
+
if (hsiBackend === 'python') {
|
|
508
|
+
// --- Tri-Polar python3 detection: degrade to Tier 0 fallback if absent. ---
|
|
509
|
+
const python = resolvePython3();
|
|
510
|
+
if (!python) {
|
|
511
|
+
return {
|
|
512
|
+
ok: true,
|
|
513
|
+
degraded: true,
|
|
514
|
+
tier: 0,
|
|
515
|
+
reason: 'python3_absent_tier0_fallback',
|
|
516
|
+
guard,
|
|
517
|
+
hsiEdgeCount: 0,
|
|
518
|
+
bridges: [],
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
try {
|
|
522
|
+
execFileSync(python, [computeHsi, resolvedRoom, '--tier', '1'], {
|
|
523
|
+
stdio: 'pipe',
|
|
524
|
+
cwd: pluginRoot,
|
|
525
|
+
});
|
|
526
|
+
} catch (e) {
|
|
527
|
+
// python3 present but the HSI deps (numpy/sklearn) missing -> Tier 0 degrade.
|
|
528
|
+
return {
|
|
529
|
+
ok: true,
|
|
530
|
+
degraded: true,
|
|
531
|
+
tier: 0,
|
|
532
|
+
reason: 'compute_hsi_unavailable_tier0_fallback',
|
|
533
|
+
detail: String((e && e.message) || '').slice(0, 160),
|
|
534
|
+
guard,
|
|
535
|
+
hsiEdgeCount: 0,
|
|
536
|
+
bridges: [],
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
} else {
|
|
540
|
+
// 'cjs' backend (D-04 default): in-process hsi-engine.cjs, no python3
|
|
541
|
+
// resolution check needed on this branch -- degrades to the SAME Tier 0
|
|
542
|
+
// graceful-degradation shape the Python branch already returns on any
|
|
543
|
+
// failure, rather than throwing.
|
|
544
|
+
try {
|
|
545
|
+
const result = await hsiEngine.runTier1(resolvedRoom, { tier: 1 });
|
|
546
|
+
if (result && result.success === false) {
|
|
547
|
+
return {
|
|
548
|
+
ok: true,
|
|
549
|
+
degraded: true,
|
|
550
|
+
tier: 0,
|
|
551
|
+
reason: 'compute_hsi_unavailable_tier0_fallback',
|
|
552
|
+
detail: String(result.detail || result.error || '').slice(0, 160),
|
|
553
|
+
guard,
|
|
554
|
+
hsiEdgeCount: 0,
|
|
555
|
+
bridges: [],
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
} catch (e) {
|
|
559
|
+
return {
|
|
560
|
+
ok: true,
|
|
561
|
+
degraded: true,
|
|
562
|
+
tier: 0,
|
|
563
|
+
reason: 'compute_hsi_unavailable_tier0_fallback',
|
|
564
|
+
detail: String((e && e.message) || '').slice(0, 160),
|
|
565
|
+
guard,
|
|
566
|
+
hsiEdgeCount: 0,
|
|
567
|
+
bridges: [],
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// --- Step 3: hsi-to-graph.cjs <room> -> HSI_CONNECTION edges (raw SQL). ---
|
|
573
|
+
execFileSync(process.execPath, [hsiToGraph, resolvedRoom], { stdio: 'pipe', cwd: pluginRoot });
|
|
574
|
+
|
|
575
|
+
// --- Step 4: read back HSI_CONNECTION edges, rank cross-domain bridges. ---
|
|
576
|
+
const bridges = [];
|
|
577
|
+
let hsiEdgeCount = 0;
|
|
578
|
+
const graph = await lazygraph.openGraph(resolvedRoom);
|
|
579
|
+
try {
|
|
580
|
+
const rows = graph.db.prepare(
|
|
581
|
+
"SELECT source, target, properties FROM edges WHERE type = 'HSI_CONNECTION'"
|
|
582
|
+
).all();
|
|
583
|
+
hsiEdgeCount = rows.length;
|
|
584
|
+
for (const r of rows) {
|
|
585
|
+
let score = 0;
|
|
586
|
+
try { score = JSON.parse(r.properties || '{}').hsi_score || 0; } catch (_e) { score = 0; }
|
|
587
|
+
const srcDomain = domainOfArtifact(resolvedRoom, r.source);
|
|
588
|
+
const tgtDomain = domainOfArtifact(resolvedRoom, r.target);
|
|
589
|
+
const crossDomain = !!srcDomain && !!tgtDomain && srcDomain !== tgtDomain;
|
|
590
|
+
bridges.push({ source: r.source, target: r.target, hsi_score: score, crossDomain });
|
|
591
|
+
}
|
|
592
|
+
} finally {
|
|
593
|
+
await lazygraph.closeGraph(graph.db);
|
|
594
|
+
}
|
|
595
|
+
bridges.sort((a, b) => b.hsi_score - a.hsi_score);
|
|
596
|
+
|
|
597
|
+
return { ok: true, tier: 1, guard, hsiEdgeCount, bridges };
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Read the PESTEL domain of a consequence Artifact for cross-domain bridge
|
|
602
|
+
* detection. The Artifact id is the room-relative path stem; reconstruct the
|
|
603
|
+
* .md path and parse its frontmatter domain. Returns '' when unavailable (no
|
|
604
|
+
* cross-domain claim). LOCAL filesystem read only (Part 8).
|
|
605
|
+
* @param {string} roomDir - absolute room directory
|
|
606
|
+
* @param {string} artifactId - room-relative path stem (the node id)
|
|
607
|
+
* @returns {string} PESTEL domain or ''
|
|
608
|
+
*/
|
|
609
|
+
function domainOfArtifact(roomDir, artifactId) {
|
|
610
|
+
try {
|
|
611
|
+
const mdPath = path.join(path.resolve(roomDir), artifactId + '.md');
|
|
612
|
+
if (!fs.existsSync(mdPath)) return '';
|
|
613
|
+
const fm = parseFrontmatter(fs.readFileSync(mdPath, 'utf-8'));
|
|
614
|
+
return fm && typeof fm.domain === 'string' ? fm.domain : '';
|
|
615
|
+
} catch (_e) {
|
|
616
|
+
return '';
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Resolve a usable python3 executable, or null when none is available
|
|
622
|
+
* (Tri-Polar: Desktop/Cowork may lack python3 -> Tier 0 degrade).
|
|
623
|
+
*/
|
|
624
|
+
function resolvePython3() {
|
|
625
|
+
const candidates = ['python3', 'python'];
|
|
626
|
+
for (const exe of candidates) {
|
|
627
|
+
try {
|
|
628
|
+
execFileSync(exe, ['--version'], { stdio: 'pipe' });
|
|
629
|
+
return exe;
|
|
630
|
+
} catch (_e) {
|
|
631
|
+
// try next
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
return null;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
// ---------------------------------------------------------------------------
|
|
638
|
+
// Wave 3 surface (FW-07 / FW-08 / FW-09 / FW-10)
|
|
639
|
+
//
|
|
640
|
+
// surfaceBridgesAtGate -- the per-ring batch tri-context Decision Gate (D-02):
|
|
641
|
+
// present the ring's proposed consequences + the top-N
|
|
642
|
+
// cross-domain HSI bridges the navigator did NOT draw,
|
|
643
|
+
// via the Shape F.1 selector (APPROVE / REJECT / DEFER).
|
|
644
|
+
// confirmRingDecisions -- promote APPROVE consequences proposed->confirmed via
|
|
645
|
+
// the navigation.confirmNode chokepoint with a human
|
|
646
|
+
// byUser (Part 9); REJECT writes a REJECTED_BECAUSE
|
|
647
|
+
// reason edge; DEFER writes a DEFERRED edge (Part 4).
|
|
648
|
+
// bankCandidateWithProvenance -- bank an approved candidate via
|
|
649
|
+
// opportunity-ops.bankOpportunity with an additive
|
|
650
|
+
// provenance field tracing to a source edge (FW-08/09).
|
|
651
|
+
// ---------------------------------------------------------------------------
|
|
652
|
+
|
|
653
|
+
// The closed tri-context Decision Gate verb set for the per-ring batch (D-02).
|
|
654
|
+
// Drawn from the Canon Part 3 / Shape F.1 vocabulary -- APPROVE promotes,
|
|
655
|
+
// REJECT captures the reason as graph data, DEFER queues for milestone audit.
|
|
656
|
+
const RING_GATE_VERBS = Object.freeze(['APPROVE', 'REJECT', 'DEFER']);
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* surfaceBridgesAtGate -- assemble the per-ring batch tri-context Decision Gate
|
|
660
|
+
* (D-02). Returns a structured gate descriptor the command / Larry layer renders
|
|
661
|
+
* through the Shape F.1 AskUserQuestion selector (the only choice primitive,
|
|
662
|
+
* Part 3). This function does the LOCAL assembly; it never renders the gate
|
|
663
|
+
* itself (the HITL checkpoint is the navigator's, not the agent's).
|
|
664
|
+
*
|
|
665
|
+
* The surfaced bridges are the CROSS-DOMAIN HSI_CONNECTION bridges from
|
|
666
|
+
* runHsiScan whose endpoints span two different PESTEL domains and that are NOT
|
|
667
|
+
* a direct ROOT_CAUSES ring parent->child link -- the "do what a human cannot"
|
|
668
|
+
* surfaced ripple (the invisible cross-domain effect a linear mind misses).
|
|
669
|
+
*
|
|
670
|
+
* @param {string} roomDir - absolute room directory (LOCAL context source)
|
|
671
|
+
* @param {Array<Object>} bridges - ranked bridge objects from runHsiScan
|
|
672
|
+
* (each carries { source, target, hsi_score, crossDomain })
|
|
673
|
+
* @param {Array<Object>} ringConsequences - the ring's proposed consequences
|
|
674
|
+
* @param {Object} [opts]
|
|
675
|
+
* @param {number} [opts.topN] - cap on surfaced bridges (default 5)
|
|
676
|
+
* @param {Set<string>} [opts.ringParentLinks] - set of 'parent->child' id pairs
|
|
677
|
+
* that ARE direct ROOT_CAUSES ring links (excluded from the surfaced bridges)
|
|
678
|
+
* @returns {{ ring: (number|null), verbs: string[], surface: string,
|
|
679
|
+
* consequences: Array<Object>, bridges: Array<Object>, contexts: Object }}
|
|
680
|
+
*/
|
|
681
|
+
function surfaceBridgesAtGate(roomDir, bridges, ringConsequences, opts) {
|
|
682
|
+
opts = opts || {};
|
|
683
|
+
const topN = Number.isFinite(opts.topN) ? opts.topN : 5;
|
|
684
|
+
const ringParentLinks = opts.ringParentLinks instanceof Set ? opts.ringParentLinks : new Set();
|
|
685
|
+
const cons = Array.isArray(ringConsequences) ? ringConsequences : [];
|
|
686
|
+
const bridgeList = Array.isArray(bridges) ? bridges : [];
|
|
687
|
+
|
|
688
|
+
// Surfaced bridges = cross-domain AND not a direct ring parent->child link.
|
|
689
|
+
const surfaced = bridgeList
|
|
690
|
+
.filter((b) => b && b.crossDomain === true)
|
|
691
|
+
.filter((b) => !ringParentLinks.has(b.source + '->' + b.target)
|
|
692
|
+
&& !ringParentLinks.has(b.target + '->' + b.source))
|
|
693
|
+
.slice(0, topN);
|
|
694
|
+
|
|
695
|
+
// The ring number is taken from the batch (all share one ring); null if empty.
|
|
696
|
+
const ring = cons.length && Number.isFinite(cons[0].ring) ? cons[0].ring : null;
|
|
697
|
+
|
|
698
|
+
return {
|
|
699
|
+
ring,
|
|
700
|
+
// Shape F.1 selector vocabulary (the tri-context Decision Gate; Part 3).
|
|
701
|
+
verbs: RING_GATE_VERBS.slice(),
|
|
702
|
+
surface: 'F.1',
|
|
703
|
+
consequences: cons.map((c) => ({ id: c.id, label: c.label, domain: c.domain, ring: c.ring })),
|
|
704
|
+
bridges: surfaced,
|
|
705
|
+
// Tri-context panels: LOCAL (the room's ring batch) + BRAIN (generic
|
|
706
|
+
// methodology handle only, never room content; Part 8) + SIGNAL (none this
|
|
707
|
+
// turn -- no external sweep in the wheel gate).
|
|
708
|
+
contexts: {
|
|
709
|
+
local: { roomDir: path.resolve(roomDir), ringConsequenceCount: cons.length },
|
|
710
|
+
brain: { methodology: 'Futures Wheel', note: 'generic framework handle only (Part 8)' },
|
|
711
|
+
signal: { note: 'none this turn' },
|
|
712
|
+
},
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* confirmRingDecisions -- apply the navigator's per-ring batch decisions.
|
|
718
|
+
*
|
|
719
|
+
* For each decision:
|
|
720
|
+
* - APPROVE: resolve the navigator identity via navigation.resolveByUser
|
|
721
|
+
* (NEVER an agent identity -- a poisoned USER.md coerces to 'navigator')
|
|
722
|
+
* and call navigation.confirmNode(db, id, byUser) to promote the consequence
|
|
723
|
+
* proposed -> confirmed (Part 9 chokepoint; truth-claim nodes only).
|
|
724
|
+
* - REJECT: write a REJECTED_BECAUSE edge via navigation.writeEdge carrying the
|
|
725
|
+
* reason as a SCALAR reason-code property (Part 4 reason becomes graph data;
|
|
726
|
+
* Part 8 no body text on the edge).
|
|
727
|
+
* - DEFER: write a DEFERRED edge via navigation.writeEdge.
|
|
728
|
+
*
|
|
729
|
+
* The promotion routes through confirmNode ONLY (never promoteNodeStatus or a
|
|
730
|
+
* raw UPDATE on review_status). REJECT / DEFER edges target a stable
|
|
731
|
+
* 'futures:gate' decision node so the reason is graph-local data.
|
|
732
|
+
*
|
|
733
|
+
* @param {Object} db - caller-owned room.db handle (openGraph().db)
|
|
734
|
+
* @param {string} roomDir - room directory (for resolveByUser USER.md lookup)
|
|
735
|
+
* @param {Array<Object>} decisions - [{ id, verb, reason? }] per consequence
|
|
736
|
+
* @returns {{ confirmed: Array<Object>, rejected: Array<Object>,
|
|
737
|
+
* deferred: Array<Object>, byUser: string, failures: Array<Object> }}
|
|
738
|
+
*/
|
|
739
|
+
function confirmRingDecisions(db, roomDir, decisions) {
|
|
740
|
+
const list = Array.isArray(decisions) ? decisions : [];
|
|
741
|
+
const byUser = navigation.resolveByUser(roomDir);
|
|
742
|
+
const confirmed = [];
|
|
743
|
+
const rejected = [];
|
|
744
|
+
const deferred = [];
|
|
745
|
+
const failures = [];
|
|
746
|
+
|
|
747
|
+
// Stable decision-gate node id the REJECT/DEFER reason edges point at. The
|
|
748
|
+
// edges are graph-local (Part 8); the reason rides as a scalar property.
|
|
749
|
+
const GATE_NODE = 'futures:gate';
|
|
750
|
+
|
|
751
|
+
for (const d of list) {
|
|
752
|
+
if (!d || typeof d.id !== 'string') continue;
|
|
753
|
+
const verb = String(d.verb || '').toUpperCase();
|
|
754
|
+
|
|
755
|
+
if (verb === 'APPROVE') {
|
|
756
|
+
// Promote proposed -> confirmed via the chokepoint with a HUMAN byUser.
|
|
757
|
+
const res = navigation.confirmNode(db, d.id, byUser);
|
|
758
|
+
if (res && res.ok) {
|
|
759
|
+
confirmed.push({ id: d.id, byUser });
|
|
760
|
+
} else {
|
|
761
|
+
failures.push({ id: d.id, verb, reason: res && res.reason });
|
|
762
|
+
}
|
|
763
|
+
} else if (verb === 'REJECT') {
|
|
764
|
+
// REJECTED_BECAUSE edge -- reason as a SCALAR reason-code (Part 4 + Part 8).
|
|
765
|
+
const res = navigation.writeEdge(db, {
|
|
766
|
+
source_id: d.id,
|
|
767
|
+
target_id: GATE_NODE,
|
|
768
|
+
edge_type: 'REJECTED_BECAUSE',
|
|
769
|
+
properties: { reason: scalarReasonCode(d.reason) },
|
|
770
|
+
});
|
|
771
|
+
if (res && res.ok) {
|
|
772
|
+
rejected.push({ id: d.id, reason: scalarReasonCode(d.reason) });
|
|
773
|
+
} else {
|
|
774
|
+
failures.push({ id: d.id, verb, reason: res && res.reason });
|
|
775
|
+
}
|
|
776
|
+
} else if (verb === 'DEFER') {
|
|
777
|
+
const res = navigation.writeEdge(db, {
|
|
778
|
+
source_id: d.id,
|
|
779
|
+
target_id: GATE_NODE,
|
|
780
|
+
edge_type: 'DEFERRED',
|
|
781
|
+
properties: { reason: scalarReasonCode(d.reason) },
|
|
782
|
+
});
|
|
783
|
+
if (res && res.ok) {
|
|
784
|
+
deferred.push({ id: d.id });
|
|
785
|
+
} else {
|
|
786
|
+
failures.push({ id: d.id, verb, reason: res && res.reason });
|
|
787
|
+
}
|
|
788
|
+
} else {
|
|
789
|
+
failures.push({ id: d.id, verb, reason: 'unknown_verb' });
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
return { confirmed, rejected, deferred, byUser, failures };
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Coerce a free-text rejection reason into a short SCALAR reason-code so the
|
|
798
|
+
* consequence body never lands on the edge (Part 8). Accepts a known enum
|
|
799
|
+
* code verbatim; otherwise maps to 'other'. Closed enum mirrors the F.0
|
|
800
|
+
* REJECTED_BECAUSE reason-code idiom.
|
|
801
|
+
* @param {string} reason
|
|
802
|
+
* @returns {string}
|
|
803
|
+
*/
|
|
804
|
+
function scalarReasonCode(reason) {
|
|
805
|
+
const known = new Set(['low_evidence', 'off_topic', 'duplicate', 'out_of_scope', 'low_confidence', 'other']);
|
|
806
|
+
const r = String(reason || 'other').toLowerCase();
|
|
807
|
+
return known.has(r) ? r : 'other';
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* The source-edge types a banked opportunity's provenance may trace to (FW-09).
|
|
812
|
+
* A candidate with no traceable source edge is NOT bankable.
|
|
813
|
+
*/
|
|
814
|
+
const PROVENANCE_EDGE_TYPES = Object.freeze(['HSI_CONNECTION', 'REVERSE_SALIENT', 'ROOT_CAUSES']);
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* bankCandidateWithProvenance -- bank an approved opportunity candidate via the
|
|
818
|
+
* shipped opportunity-ops.bankOpportunity engine (FW-08), adding an ADDITIVE
|
|
819
|
+
* `provenance` frontmatter field that names the source edge the candidate traces
|
|
820
|
+
* to: an HSI_CONNECTION / REVERSE_SALIENT / ROOT_CAUSES edge id or source-target
|
|
821
|
+
* pair (FW-09). bankOpportunity passes the provenance frontmatter through and
|
|
822
|
+
* preserves problem_hash dedup.
|
|
823
|
+
*
|
|
824
|
+
* A candidate WITHOUT a traceable source edge is refused (returns an error;
|
|
825
|
+
* nothing is banked) -- this prevents banking an opportunity with fabricated
|
|
826
|
+
* lineage (threat T-156-01).
|
|
827
|
+
*
|
|
828
|
+
* @param {string} roomDir - absolute room directory
|
|
829
|
+
* @param {Object} candidate - { problem (required), confidence, evidence,
|
|
830
|
+
* domain?, provenance: { edge_type, source, target } | string }
|
|
831
|
+
* @returns {{ banked: boolean, updated: boolean, path: string, error?: string,
|
|
832
|
+
* provenance?: string }}
|
|
833
|
+
*/
|
|
834
|
+
function bankCandidateWithProvenance(roomDir, candidate) {
|
|
835
|
+
const oppOps = require('../opportunity-ops.cjs');
|
|
836
|
+
|
|
837
|
+
if (!candidate || typeof candidate !== 'object') {
|
|
838
|
+
return { banked: false, updated: false, path: '', error: 'Invalid candidate object' };
|
|
839
|
+
}
|
|
840
|
+
if (!candidate.problem) {
|
|
841
|
+
return { banked: false, updated: false, path: '', error: 'Candidate missing required field: problem' };
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
// Resolve + validate the provenance source edge (FW-09; refuse if absent).
|
|
845
|
+
const provenance = formatProvenance(candidate.provenance);
|
|
846
|
+
if (!provenance) {
|
|
847
|
+
return {
|
|
848
|
+
banked: false,
|
|
849
|
+
updated: false,
|
|
850
|
+
path: '',
|
|
851
|
+
error: 'Candidate has no traceable source edge (HSI_CONNECTION / REVERSE_SALIENT / ROOT_CAUSES); not bankable',
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
// Build the opportunity object with the ADDITIVE provenance field. The
|
|
856
|
+
// shipped bankOpportunity passes unknown frontmatter fields through.
|
|
857
|
+
const opportunity = {
|
|
858
|
+
problem: candidate.problem,
|
|
859
|
+
confidence: candidate.confidence,
|
|
860
|
+
evidence: candidate.evidence,
|
|
861
|
+
domain: candidate.domain,
|
|
862
|
+
source_framework: candidate.source_framework || 'Futures Wheel',
|
|
863
|
+
provenance,
|
|
864
|
+
};
|
|
865
|
+
|
|
866
|
+
const res = oppOps.bankOpportunity(roomDir, opportunity);
|
|
867
|
+
return Object.assign({}, res, { provenance });
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* Format a candidate provenance descriptor into a single scalar string naming
|
|
872
|
+
* the source edge (Part 8 scalar; no body text). Returns '' when the descriptor
|
|
873
|
+
* names no valid source edge type. Accepts either an object
|
|
874
|
+
* { edge_type, source, target } or a pre-formatted 'TYPE:source->target' string.
|
|
875
|
+
* @param {Object|string} prov
|
|
876
|
+
* @returns {string}
|
|
877
|
+
*/
|
|
878
|
+
function formatProvenance(prov) {
|
|
879
|
+
if (typeof prov === 'string' && prov.length > 0) {
|
|
880
|
+
const t = prov.split(':')[0];
|
|
881
|
+
return PROVENANCE_EDGE_TYPES.includes(t) ? prov : '';
|
|
882
|
+
}
|
|
883
|
+
if (prov && typeof prov === 'object') {
|
|
884
|
+
const type = String(prov.edge_type || '');
|
|
885
|
+
if (!PROVENANCE_EDGE_TYPES.includes(type)) return '';
|
|
886
|
+
const src = String(prov.source || '');
|
|
887
|
+
const tgt = String(prov.target || '');
|
|
888
|
+
if (!src && !tgt) return type;
|
|
889
|
+
return type + ':' + src + '->' + tgt;
|
|
890
|
+
}
|
|
891
|
+
return '';
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* Wave 3 alias retained for the Wave-1/2 surface contract. The real per-ring
|
|
896
|
+
* gate is now surfaceBridgesAtGate + confirmRingDecisions (FW-10). Kept as a
|
|
897
|
+
* thin pointer so any prior caller gets a clear redirect rather than a throw.
|
|
898
|
+
*/
|
|
899
|
+
function runRingGate(db, roomDir, gate) {
|
|
900
|
+
const decisions = gate && Array.isArray(gate.decisions) ? gate.decisions : [];
|
|
901
|
+
return confirmRingDecisions(db, roomDir, decisions);
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
// ---------------------------------------------------------------------------
|
|
905
|
+
// Wave 4 surface (FW-11 / FW-12 / FW-13)
|
|
906
|
+
//
|
|
907
|
+
// surfaceChainingHandoffs -- the top-3-of-N ranked foresight-web chaining
|
|
908
|
+
// surfacer (D-04). EVERY handoff target resolves
|
|
909
|
+
// through the Phase 122 command-resolver
|
|
910
|
+
// (commandsForFramework / composeWorkflow); NEVER a
|
|
911
|
+
// hardcoded /mos: command string (FW-12).
|
|
912
|
+
// runRSReverseSalient -- the RS handoff: invoke the shipped
|
|
913
|
+
// scripts/rs-engine.py over the consequence set so
|
|
914
|
+
// >=1 REVERSE_SALIENT edge is written via the
|
|
915
|
+
// rs-engine raw path (NOT writeEdge; REVERSE_SALIENT
|
|
916
|
+
// is not frozen).
|
|
917
|
+
// runSignalResearch / seedGrounding / perRingResearch -- the FW-13 SIGNAL leg:
|
|
918
|
+
// two fire points, cache-first (30-day TTL), generic
|
|
919
|
+
// domain handles ONLY (Part 8).
|
|
920
|
+
// ---------------------------------------------------------------------------
|
|
921
|
+
|
|
922
|
+
// The 8 foresight-web partners (FW-12). Each is named ONLY by its FRAMEWORK
|
|
923
|
+
// HANDLE -- the command-resolver maps the framework name to its /mos: command
|
|
924
|
+
// at runtime against data/command-registry.json. This table carries ZERO
|
|
925
|
+
// hardcoded /mos: command strings (the FW-12 grep gate); the partner's command
|
|
926
|
+
// is resolved through commandsForFramework / composeWorkflow only. A registry
|
|
927
|
+
// miss degrades to a manual "run X" line (never a crash, never a fabricated
|
|
928
|
+
// command -- the resolver's degrade contract).
|
|
929
|
+
//
|
|
930
|
+
// `kind` is the local trigger this partner answers (used for ranking):
|
|
931
|
+
// rs -- a cross-domain HSI bridge wants the reverse-salient lens
|
|
932
|
+
// causal_loop -- a causal ring structure wants the systems-thinking lens
|
|
933
|
+
// branch -- co-occurring consequence branches want scenario planning
|
|
934
|
+
// far_horizon -- a long-horizon consequence wants trends / S-curve timing
|
|
935
|
+
// banked -- a banked candidate wants the Mullins seven-domains screen
|
|
936
|
+
// reformulate -- a tangled consequence set wants problem-definition diagnose
|
|
937
|
+
const FORESIGHT_WEB_PARTNERS = Object.freeze([
|
|
938
|
+
{ id: 'reverse-salient', framework: 'Reverse Salient Analysis', kind: 'rs' },
|
|
939
|
+
{ id: 'systems-thinking', framework: 'Systems Thinking', kind: 'causal_loop' },
|
|
940
|
+
{ id: 'scenario-plan', framework: 'Scenario Planning', kind: 'branch' },
|
|
941
|
+
{ id: 'explore-trends', framework: 'S-Curve Analysis', kind: 'far_horizon' },
|
|
942
|
+
{ id: 'analyze-timing', framework: 'S-Curve Analysis', kind: 'far_horizon' },
|
|
943
|
+
{ id: 'dominant-designs', framework: 'Dominant Design', kind: 'far_horizon' },
|
|
944
|
+
{ id: 'diagnose', framework: 'Problem Definition Transformation Framework', kind: 'reformulate' },
|
|
945
|
+
{ id: 'mullins', framework: 'Mullins Model', kind: 'banked' },
|
|
946
|
+
{ id: 'explore-futures', framework: 'Scenario Planning', kind: 'branch' },
|
|
947
|
+
]);
|
|
948
|
+
|
|
949
|
+
// D-04: surface the TOP-3-of-N (mirror the 150.x dial top-3-of-N).
|
|
950
|
+
const CHAINING_HANDOFF_TOP_N = 3;
|
|
951
|
+
|
|
952
|
+
// The reverse "open as a futures wheel?" hook is reachable from these partner
|
|
953
|
+
// surfaces (FW-12 mutual handoff): the RS and systems-thinking surfaces declare
|
|
954
|
+
// it so an RS finding / a systems-thinking loop can be re-opened AS a wheel.
|
|
955
|
+
const REVERSE_OPEN_AS_WHEEL_SURFACES = Object.freeze(['reverse-salient', 'systems-thinking']);
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* Detect which foresight-web triggers a consequence set fires, ranking each
|
|
959
|
+
* partner by a LOCAL signal only (zero Brain egress; Part 8):
|
|
960
|
+
* - rs : >=1 cross-domain bridge (two endpoints, different domains)
|
|
961
|
+
* - causal_loop : >=1 parent->child cascade (a causal ring exists)
|
|
962
|
+
* - branch : >=2 consequences co-occur in one domain (a fork to cluster)
|
|
963
|
+
* - far_horizon : >=1 long-horizon consequence
|
|
964
|
+
* - banked : >=1 high-confidence consequence (a bankable candidate)
|
|
965
|
+
* - reformulate : a tangled set (>= depth-cap rings present) wants a re-frame
|
|
966
|
+
*
|
|
967
|
+
* @param {Array<Object>} consequences - ring consequence objects
|
|
968
|
+
* @param {Object} [opts]
|
|
969
|
+
* @param {Array<Object>} [opts.bridges] - cross-domain bridges from runHsiScan
|
|
970
|
+
* @returns {Object} score-by-kind map (higher = stronger trigger)
|
|
971
|
+
*/
|
|
972
|
+
function detectChainingTriggers(consequences, opts) {
|
|
973
|
+
opts = opts || {};
|
|
974
|
+
const cons = Array.isArray(consequences) ? consequences : [];
|
|
975
|
+
const bridges = Array.isArray(opts.bridges) ? opts.bridges : [];
|
|
976
|
+
|
|
977
|
+
const crossDomainBridges = bridges.filter((b) => b && b.crossDomain === true).length;
|
|
978
|
+
const cascadeLinks = cons.filter((c) => c && typeof c.parent_id === 'string' && c.parent_id.length > 0).length;
|
|
979
|
+
|
|
980
|
+
// Domain co-occurrence: any domain carrying >=2 consequences is a fork.
|
|
981
|
+
const byDomain = {};
|
|
982
|
+
for (const c of cons) {
|
|
983
|
+
if (c && typeof c.domain === 'string') byDomain[c.domain] = (byDomain[c.domain] || 0) + 1;
|
|
984
|
+
}
|
|
985
|
+
const branchForks = Object.values(byDomain).filter((n) => n >= 2).length;
|
|
986
|
+
|
|
987
|
+
const farHorizon = cons.filter((c) => c && c.horizon === 'long').length;
|
|
988
|
+
const bankable = cons.filter((c) => c && typeof c.confidence === 'number' && c.confidence >= 0.6).length;
|
|
989
|
+
const ringSpan = new Set(cons.map((c) => c && c.ring).filter((r) => Number.isFinite(r))).size;
|
|
990
|
+
|
|
991
|
+
return {
|
|
992
|
+
rs: crossDomainBridges,
|
|
993
|
+
causal_loop: cascadeLinks,
|
|
994
|
+
branch: branchForks,
|
|
995
|
+
far_horizon: farHorizon,
|
|
996
|
+
banked: bankable,
|
|
997
|
+
reformulate: ringSpan >= FUTURES_DEPTH_CAP ? 1 : 0,
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* surfaceChainingHandoffs -- the FW-12 top-3-of-N ranked foresight-web chaining
|
|
1003
|
+
* surfacer at the F.1 gate (D-04, mirror the 150.x dial top-3-of-N).
|
|
1004
|
+
*
|
|
1005
|
+
* Ranks the 8 foresight-web partners by their detected LOCAL trigger, resolves
|
|
1006
|
+
* EACH surviving partner's command through the Phase 122 command-resolver
|
|
1007
|
+
* (commandsForFramework -> composeWorkflow), and returns the top-3. A registry
|
|
1008
|
+
* miss degrades to a manual "run X" line (manual:true, command:null) -- never a
|
|
1009
|
+
* crash, never a fabricated command string (FW-12 acceptance).
|
|
1010
|
+
*
|
|
1011
|
+
* The reverse "open as a futures wheel?" hook is attached to the RS and
|
|
1012
|
+
* systems-thinking handoffs (REVERSE_OPEN_AS_WHEEL_SURFACES) so the mutual
|
|
1013
|
+
* handoff is reachable from those surfaces (FW-12 reverse handoff).
|
|
1014
|
+
*
|
|
1015
|
+
* NO hardcoded /mos: command strings live in this function: every command comes
|
|
1016
|
+
* BACK from the resolver. The grep gate
|
|
1017
|
+
* grep -ciE "'/mos:(systems-thinking|scenario-plan|...)'"
|
|
1018
|
+
* over orchestrator.cjs is 0.
|
|
1019
|
+
*
|
|
1020
|
+
* @param {string} roomDir - absolute room directory (LOCAL context source)
|
|
1021
|
+
* @param {Array<Object>} consequences - the ring's consequence objects
|
|
1022
|
+
* @param {Object} [opts]
|
|
1023
|
+
* @param {Array<Object>} [opts.bridges] - cross-domain bridges from runHsiScan
|
|
1024
|
+
* @param {Object} [opts.resolver] - injected command-resolver (default: the shipped one)
|
|
1025
|
+
* @param {number} [opts.topN] - override the top-N cap (default CHAINING_HANDOFF_TOP_N)
|
|
1026
|
+
* @returns {{ surface: string, handoffs: Array<Object>, reverseHook: Object }}
|
|
1027
|
+
*/
|
|
1028
|
+
function surfaceChainingHandoffs(roomDir, consequences, opts) {
|
|
1029
|
+
opts = opts || {};
|
|
1030
|
+
const resolver = opts.resolver || require('../../workflow/command-resolver.cjs');
|
|
1031
|
+
const topN = Number.isFinite(opts.topN) ? opts.topN : CHAINING_HANDOFF_TOP_N;
|
|
1032
|
+
const triggers = detectChainingTriggers(consequences, opts);
|
|
1033
|
+
|
|
1034
|
+
// Score each partner by its trigger; keep only fired partners (score > 0).
|
|
1035
|
+
// Stable de-dup by framework so two partners sharing a framework (e.g.
|
|
1036
|
+
// explore-futures + scenario-plan both -> Scenario Planning) do not both
|
|
1037
|
+
// occupy a slot with the identical resolved command.
|
|
1038
|
+
const seenFramework = new Set();
|
|
1039
|
+
const ranked = FORESIGHT_WEB_PARTNERS
|
|
1040
|
+
.map((p) => ({ partner: p, score: triggers[p.kind] || 0 }))
|
|
1041
|
+
.filter((r) => r.score > 0)
|
|
1042
|
+
.sort((a, b) => b.score - a.score)
|
|
1043
|
+
.filter((r) => {
|
|
1044
|
+
if (seenFramework.has(r.partner.framework)) return false;
|
|
1045
|
+
seenFramework.add(r.partner.framework);
|
|
1046
|
+
return true;
|
|
1047
|
+
})
|
|
1048
|
+
.slice(0, topN);
|
|
1049
|
+
|
|
1050
|
+
// Resolve each surviving partner's command through the resolver ONLY.
|
|
1051
|
+
const handoffs = ranked.map((r) => {
|
|
1052
|
+
const workflow = resolver.composeWorkflow([r.partner.framework]);
|
|
1053
|
+
const step = workflow.length > 0 ? workflow[0] : { command: null, optional: true };
|
|
1054
|
+
const command = step.command || null;
|
|
1055
|
+
const handoff = {
|
|
1056
|
+
id: r.partner.id,
|
|
1057
|
+
framework: r.partner.framework,
|
|
1058
|
+
trigger: r.partner.kind,
|
|
1059
|
+
score: r.score,
|
|
1060
|
+
// command came BACK from the resolver (FW-12); manual when the registry
|
|
1061
|
+
// has no command for the framework (degrade, do not fabricate).
|
|
1062
|
+
command,
|
|
1063
|
+
manual: command === null,
|
|
1064
|
+
};
|
|
1065
|
+
if (REVERSE_OPEN_AS_WHEEL_SURFACES.includes(r.partner.id)) {
|
|
1066
|
+
handoff.reverse_open_as_wheel = true;
|
|
1067
|
+
}
|
|
1068
|
+
return handoff;
|
|
1069
|
+
});
|
|
1070
|
+
|
|
1071
|
+
return {
|
|
1072
|
+
surface: 'F.1',
|
|
1073
|
+
handoffs,
|
|
1074
|
+
// The reverse hook descriptor: the "open as a futures wheel?" mutual handoff
|
|
1075
|
+
// declared for the RS + systems-thinking surfaces (FW-12).
|
|
1076
|
+
reverseHook: {
|
|
1077
|
+
verb: 'open-as-futures-wheel',
|
|
1078
|
+
reachableFrom: REVERSE_OPEN_AS_WHEEL_SURFACES.slice(),
|
|
1079
|
+
note: 'A reverse-salient finding or a systems-thinking loop can be re-opened AS a Futures Wheel seed.',
|
|
1080
|
+
},
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
/**
|
|
1085
|
+
* runRSReverseSalient -- the RS handoff. When the navigator accepts the RS
|
|
1086
|
+
* chaining handoff, invoke the SHIPPED scripts/rs-engine.py (Mode A internal)
|
|
1087
|
+
* over the room so it writes >=1 REVERSE_SALIENT edge into room.db via the
|
|
1088
|
+
* rs-engine RAW path (properties.source='rs-engine'). REVERSE_SALIENT is NOT in
|
|
1089
|
+
* the frozen ALLOWED_EDGE_TYPES, so it MUST NOT route through navigation.writeEdge
|
|
1090
|
+
* (that path rejects it). The rs-engine raw writer is the canonical path (mirrors
|
|
1091
|
+
* the Wave 2 HSI_CONNECTION raw-path decision).
|
|
1092
|
+
*
|
|
1093
|
+
* Tri-Polar: python3 absence degrades cleanly to a Tier 0 no-op (no crash on
|
|
1094
|
+
* Desktop/Cowork). Part 8: rs-engine reads LOCAL room artifacts only; zero Brain
|
|
1095
|
+
* egress (Mode A internal scan; no --topic, no external corpus).
|
|
1096
|
+
*
|
|
1097
|
+
* @param {string} roomDir - absolute room directory
|
|
1098
|
+
* @param {Object} [opts]
|
|
1099
|
+
* @param {string} [opts.pluginRoot] - root holding scripts/ (default: repo root)
|
|
1100
|
+
* @returns {Promise<{ ok: boolean, degraded?: boolean, reason?: string, reverseSalientEdges: number }>}
|
|
1101
|
+
*/
|
|
1102
|
+
async function runRSReverseSalient(roomDir, opts) {
|
|
1103
|
+
opts = opts || {};
|
|
1104
|
+
const resolvedRoom = path.resolve(roomDir);
|
|
1105
|
+
const pluginRoot = opts.pluginRoot || path.resolve(__dirname, '..', '..', '..');
|
|
1106
|
+
const rsEngine = path.join(pluginRoot, 'scripts', 'rs-engine.py');
|
|
1107
|
+
|
|
1108
|
+
// Phase 272 D-04: backend-dispatched. 'python' keeps the existing
|
|
1109
|
+
// execFileSync call and its Tri-Polar graceful-degradation contract
|
|
1110
|
+
// UNCHANGED. 'cjs' calls rs-engine.cjs::runModeInternal directly, in
|
|
1111
|
+
// process -- no python3 resolution check needed on this branch, since the
|
|
1112
|
+
// resolvePython3() guard only ever gated the Python leg. On failure it
|
|
1113
|
+
// maps to the SAME { ok:true, degraded:true, tier:0,
|
|
1114
|
+
// reason:'rs_engine_unavailable_tier0_fallback', reverseSalientEdges:0 }
|
|
1115
|
+
// shape the Python branch already returns -- this function's whole design
|
|
1116
|
+
// is Tri-Polar graceful degradation, and the CJS branch must degrade
|
|
1117
|
+
// exactly as gracefully, not throw.
|
|
1118
|
+
const rsBackend = rsBackendDispatch.resolveBackend();
|
|
1119
|
+
if (rsBackend === 'python') {
|
|
1120
|
+
const python = resolvePython3();
|
|
1121
|
+
if (!python) {
|
|
1122
|
+
return { ok: true, degraded: true, tier: 0, reason: 'python3_absent_tier0_fallback', reverseSalientEdges: 0 };
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
// Mode A internal scan: LOCAL room only, no external corpus (Part 8).
|
|
1126
|
+
try {
|
|
1127
|
+
execFileSync(python, [rsEngine, '--mode', 'internal', '--room', resolvedRoom], {
|
|
1128
|
+
stdio: 'pipe',
|
|
1129
|
+
cwd: pluginRoot,
|
|
1130
|
+
});
|
|
1131
|
+
} catch (e) {
|
|
1132
|
+
return {
|
|
1133
|
+
ok: true,
|
|
1134
|
+
degraded: true,
|
|
1135
|
+
tier: 0,
|
|
1136
|
+
reason: 'rs_engine_unavailable_tier0_fallback',
|
|
1137
|
+
detail: String((e && e.message) || '').slice(0, 160),
|
|
1138
|
+
reverseSalientEdges: 0,
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
} else {
|
|
1142
|
+
// Mode A internal scan, in-process: LOCAL room only, no external corpus (Part 8).
|
|
1143
|
+
try {
|
|
1144
|
+
await rsEngineCjs.runModeInternal(resolvedRoom, { mode: 'internal' });
|
|
1145
|
+
} catch (e) {
|
|
1146
|
+
return {
|
|
1147
|
+
ok: true,
|
|
1148
|
+
degraded: true,
|
|
1149
|
+
tier: 0,
|
|
1150
|
+
reason: 'rs_engine_unavailable_tier0_fallback',
|
|
1151
|
+
detail: String((e && e.message) || '').slice(0, 160),
|
|
1152
|
+
reverseSalientEdges: 0,
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
// Read back the REVERSE_SALIENT edges the rs-engine raw path wrote, via the
|
|
1158
|
+
// SAME lazygraph handle the rest of the orchestrator uses (node:sqlite under
|
|
1159
|
+
// the hood; no better-sqlite3 dependency).
|
|
1160
|
+
let reverseSalientEdges = 0;
|
|
1161
|
+
const dbPath = path.join(resolvedRoom, '.mindrian', 'room.db');
|
|
1162
|
+
if (fs.existsSync(dbPath)) {
|
|
1163
|
+
const lazygraph = require('../lazygraph-ops.cjs');
|
|
1164
|
+
const graph = await lazygraph.openGraph(resolvedRoom);
|
|
1165
|
+
try {
|
|
1166
|
+
const row = graph.db.prepare("SELECT COUNT(*) AS n FROM edges WHERE type = 'REVERSE_SALIENT'").get();
|
|
1167
|
+
reverseSalientEdges = (row && row.n) || 0;
|
|
1168
|
+
} catch (_e) {
|
|
1169
|
+
reverseSalientEdges = 0;
|
|
1170
|
+
} finally {
|
|
1171
|
+
await lazygraph.closeGraph(graph.db);
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
return { ok: true, tier: 1, reverseSalientEdges };
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
// --- FW-13 SIGNAL research: two fire points, cache-first, generic handles ---
|
|
1179
|
+
|
|
1180
|
+
// The default external corpus source for the SIGNAL leg. openalex is a public
|
|
1181
|
+
// academic source (no API key needed) so seed grounding works out of the box.
|
|
1182
|
+
const SIGNAL_DEFAULT_SOURCE = 'openalex';
|
|
1183
|
+
const SIGNAL_DEFAULT_LIMIT = 5;
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* Coerce a free-text concept/domain into a GENERIC search handle (Part 8). The
|
|
1187
|
+
* handle carries ONLY a domain/concept keyword -- NEVER a consequence body or
|
|
1188
|
+
* any room artifact text. We strip to a short lowercased keyword phrase (the
|
|
1189
|
+
* same generic-handle discipline the brain-cypher adapter uses), bounded to a
|
|
1190
|
+
* few words so a long artifact body cannot smuggle itself through as a "handle".
|
|
1191
|
+
*
|
|
1192
|
+
* @param {string} handle - the seed concept or a ring domain keyword
|
|
1193
|
+
* @returns {string} a bounded generic handle (or '' when nothing generic remains)
|
|
1194
|
+
*/
|
|
1195
|
+
function genericDomainHandle(handle) {
|
|
1196
|
+
const s = String(handle == null ? '' : handle).toLowerCase();
|
|
1197
|
+
// Keep word characters + spaces only; collapse whitespace; cap at 6 words so
|
|
1198
|
+
// a consequence sentence cannot ride through as a "handle".
|
|
1199
|
+
const words = s.replace(/[^a-z0-9 ]+/g, ' ').replace(/\s+/g, ' ').trim().split(' ').filter(Boolean);
|
|
1200
|
+
return words.slice(0, 6).join(' ');
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* runSignalResearch -- the bounded SIGNAL leg (FW-13), cache-first:
|
|
1205
|
+
* getCached(roomDir, source, handle) -> if a fresh hit, return it (no fetch)
|
|
1206
|
+
* else fetchCorpus({ source, query: handle, limit }) -> putCached -> return
|
|
1207
|
+
*
|
|
1208
|
+
* The `query` passed to fetchCorpus is ALWAYS a GENERIC DOMAIN HANDLE
|
|
1209
|
+
* (genericDomainHandle), NEVER a consequence body or room artifact text (Part 8).
|
|
1210
|
+
* The 30-day cache (research-cache) bounds external calls: a second call within
|
|
1211
|
+
* the TTL window is a cache hit (isFresh true), so this is NOT always-on.
|
|
1212
|
+
*
|
|
1213
|
+
* @param {string} roomDir - absolute room directory (cache location)
|
|
1214
|
+
* @param {string} query - the seed concept / a ring domain keyword (generic)
|
|
1215
|
+
* @param {Object} [opts]
|
|
1216
|
+
* @param {string} [opts.source] - corpus source (default SIGNAL_DEFAULT_SOURCE)
|
|
1217
|
+
* @param {number} [opts.limit] - result cap (default SIGNAL_DEFAULT_LIMIT)
|
|
1218
|
+
* @param {Object} [opts.corpus] - injected research-corpus (default: shipped)
|
|
1219
|
+
* @param {Object} [opts.cache] - injected research-cache (default: shipped)
|
|
1220
|
+
* @param {Object} [opts.cacheOpts] - passed to getCached/isFresh (now/ttlMs seam)
|
|
1221
|
+
* @returns {Promise<{ handle: string, cacheHit: boolean, results: Array, count: number }>}
|
|
1222
|
+
*/
|
|
1223
|
+
async function runSignalResearch(roomDir, query, opts) {
|
|
1224
|
+
opts = opts || {};
|
|
1225
|
+
const corpus = opts.corpus || require('../research-corpus.cjs');
|
|
1226
|
+
const cache = opts.cache || require('../research-cache.cjs');
|
|
1227
|
+
const source = opts.source || SIGNAL_DEFAULT_SOURCE;
|
|
1228
|
+
const limit = Number.isFinite(opts.limit) ? opts.limit : SIGNAL_DEFAULT_LIMIT;
|
|
1229
|
+
const cacheOpts = opts.cacheOpts || {};
|
|
1230
|
+
|
|
1231
|
+
// The ONLY thing that crosses the boundary: a generic domain/concept handle.
|
|
1232
|
+
const handle = genericDomainHandle(query);
|
|
1233
|
+
if (!handle) {
|
|
1234
|
+
return { handle: '', cacheHit: false, results: [], count: 0 };
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
// Cache-first: a fresh entry short-circuits the external call (30-day TTL).
|
|
1238
|
+
const cached = cache.getCached(roomDir, source, handle, cacheOpts);
|
|
1239
|
+
if (cached !== null) {
|
|
1240
|
+
return { handle, cacheHit: true, results: cached, count: cached.length };
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
// Miss / stale: fetch with the GENERIC HANDLE ONLY, then cache the result.
|
|
1244
|
+
const results = await corpus.fetchCorpus({ source, query: handle, limit });
|
|
1245
|
+
const list = Array.isArray(results) ? results : [];
|
|
1246
|
+
cache.putCached(roomDir, source, handle, list, cacheOpts);
|
|
1247
|
+
return { handle, cacheHit: false, results: list, count: list.length };
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
/**
|
|
1251
|
+
* seedGrounding -- FW-13 fire point (a): called ONCE up front to ground ring-1
|
|
1252
|
+
* generation. Fetches >=1 public source (cache hit or live) for the seed
|
|
1253
|
+
* concept (a generic handle) so ring-1 is grounded in real signal, not guesses.
|
|
1254
|
+
*
|
|
1255
|
+
* @param {string} roomDir
|
|
1256
|
+
* @param {string} seed - the seed concept (a generic domain/concept handle)
|
|
1257
|
+
* @param {Object} [opts] - forwarded to runSignalResearch
|
|
1258
|
+
* @returns {Promise<{ grounded: boolean, handle: string, cacheHit: boolean, sources: Array, count: number }>}
|
|
1259
|
+
*/
|
|
1260
|
+
async function seedGrounding(roomDir, seed, opts) {
|
|
1261
|
+
const res = await runSignalResearch(roomDir, seed, opts);
|
|
1262
|
+
return {
|
|
1263
|
+
grounded: res.count > 0,
|
|
1264
|
+
handle: res.handle,
|
|
1265
|
+
cacheHit: res.cacheHit,
|
|
1266
|
+
sources: res.results,
|
|
1267
|
+
count: res.count,
|
|
1268
|
+
};
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* perRingResearch -- FW-13 fire point (b): the navigator fires research over a
|
|
1273
|
+
* ring's consequences ON DEMAND. The query is the ring's GENERIC DOMAIN keyword
|
|
1274
|
+
* (the PESTEL domain handle), NEVER a consequence body (Part 8). Each pass
|
|
1275
|
+
* either:
|
|
1276
|
+
* - corroborates a consequence's confidence (raises evidence tier; returns a
|
|
1277
|
+
* `confidenceAdjustments` list naming each consequence + a delta), OR
|
|
1278
|
+
* - proposes >=1 signal-derived consequence (tagged signal_derived:true).
|
|
1279
|
+
*
|
|
1280
|
+
* The corroborate-vs-propose decision is LOCAL and bounded: if the ring already
|
|
1281
|
+
* has a consequence in the researched domain, the finding corroborates it;
|
|
1282
|
+
* otherwise the finding proposes a new signal-derived consequence in that domain.
|
|
1283
|
+
* Findings wire as typed LOCAL evidence via the evidence-claim path (Part 5) when
|
|
1284
|
+
* a db handle is supplied; with no db this returns the structured deltas the
|
|
1285
|
+
* caller (Larry) wires at the gate.
|
|
1286
|
+
*
|
|
1287
|
+
* @param {string} roomDir
|
|
1288
|
+
* @param {Array<Object>} ringConsequences - the ring's consequence objects
|
|
1289
|
+
* @param {string} domainHandle - the GENERIC domain keyword to research
|
|
1290
|
+
* @param {Object} [opts] - forwarded to runSignalResearch
|
|
1291
|
+
* @returns {Promise<{ handle: string, cacheHit: boolean, sourceCount: number,
|
|
1292
|
+
* confidenceAdjustments: Array, signalDerived: Array }>}
|
|
1293
|
+
*/
|
|
1294
|
+
async function perRingResearch(roomDir, ringConsequences, domainHandle, opts) {
|
|
1295
|
+
opts = opts || {};
|
|
1296
|
+
const cons = Array.isArray(ringConsequences) ? ringConsequences : [];
|
|
1297
|
+
const res = await runSignalResearch(roomDir, domainHandle, opts);
|
|
1298
|
+
|
|
1299
|
+
const confidenceAdjustments = [];
|
|
1300
|
+
const signalDerived = [];
|
|
1301
|
+
|
|
1302
|
+
if (res.count > 0) {
|
|
1303
|
+
const handleDomain = genericDomainHandle(domainHandle);
|
|
1304
|
+
// Find a consequence whose domain matches the researched handle to corroborate.
|
|
1305
|
+
const target = cons.find((c) => c
|
|
1306
|
+
&& typeof c.domain === 'string'
|
|
1307
|
+
&& genericDomainHandle(c.domain) === handleDomain);
|
|
1308
|
+
if (target) {
|
|
1309
|
+
// Corroborate: a cited public source raises this consequence's confidence.
|
|
1310
|
+
confidenceAdjustments.push({
|
|
1311
|
+
id: target.id,
|
|
1312
|
+
confidence_adjust: 0.1,
|
|
1313
|
+
evidence_tier: 'Academic',
|
|
1314
|
+
source: res.results[0] && res.results[0].id ? res.results[0].id : 'signal',
|
|
1315
|
+
});
|
|
1316
|
+
} else {
|
|
1317
|
+
// Propose a signal-derived consequence in the researched domain.
|
|
1318
|
+
const top = res.results[0] || {};
|
|
1319
|
+
signalDerived.push({
|
|
1320
|
+
id: slugify((top.title || domainHandle) + '-signal') + '-signal',
|
|
1321
|
+
domain: matchPestelDomain(domainHandle),
|
|
1322
|
+
horizon: 'mid',
|
|
1323
|
+
confidence: 0.4,
|
|
1324
|
+
label: 'Signal-derived consequence in ' + domainHandle,
|
|
1325
|
+
signal_derived: true,
|
|
1326
|
+
source: top.id || 'signal',
|
|
1327
|
+
});
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
return {
|
|
1332
|
+
handle: res.handle,
|
|
1333
|
+
cacheHit: res.cacheHit,
|
|
1334
|
+
sourceCount: res.count,
|
|
1335
|
+
confidenceAdjustments,
|
|
1336
|
+
signalDerived,
|
|
1337
|
+
};
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
/**
|
|
1341
|
+
* Map a free-text domain handle to its PESTEL enum member (default Social when
|
|
1342
|
+
* no match). Keeps a signal-derived consequence inside the frozen domain enum.
|
|
1343
|
+
*/
|
|
1344
|
+
function matchPestelDomain(handle) {
|
|
1345
|
+
const h = String(handle || '').toLowerCase();
|
|
1346
|
+
for (const d of PESTEL_DOMAIN_ENUM) {
|
|
1347
|
+
if (h.includes(d.toLowerCase())) return d;
|
|
1348
|
+
}
|
|
1349
|
+
return 'Social';
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
module.exports = {
|
|
1353
|
+
// caps (FW-02)
|
|
1354
|
+
FUTURES_DEPTH_CAP,
|
|
1355
|
+
FUTURES_FANOUT_CAP,
|
|
1356
|
+
resolveDepthCap,
|
|
1357
|
+
resolveFanoutCap,
|
|
1358
|
+
// enums (FW-04)
|
|
1359
|
+
HORIZON_ENUM,
|
|
1360
|
+
PESTEL_DOMAIN_ENUM,
|
|
1361
|
+
// validator (FW-04)
|
|
1362
|
+
validateConsequenceFrontmatter,
|
|
1363
|
+
// generation + cascade (FW-02 / FW-05)
|
|
1364
|
+
generateRing,
|
|
1365
|
+
writeCascadeEdges,
|
|
1366
|
+
slugify,
|
|
1367
|
+
consequenceArtifactId,
|
|
1368
|
+
// Artifact registration + HSI sequencer (FW-06)
|
|
1369
|
+
registerConsequenceArtifacts,
|
|
1370
|
+
assertArtifactCountMatchesFiled,
|
|
1371
|
+
runHsiScan,
|
|
1372
|
+
// Wave 3 Decision Gate + confirm + bank (FW-07 / FW-08 / FW-09 / FW-10)
|
|
1373
|
+
surfaceBridgesAtGate,
|
|
1374
|
+
confirmRingDecisions,
|
|
1375
|
+
bankCandidateWithProvenance,
|
|
1376
|
+
RING_GATE_VERBS,
|
|
1377
|
+
PROVENANCE_EDGE_TYPES,
|
|
1378
|
+
runRingGate,
|
|
1379
|
+
// Wave 4 chaining handoffs (FW-12)
|
|
1380
|
+
surfaceChainingHandoffs,
|
|
1381
|
+
detectChainingTriggers,
|
|
1382
|
+
runRSReverseSalient,
|
|
1383
|
+
FORESIGHT_WEB_PARTNERS,
|
|
1384
|
+
CHAINING_HANDOFF_TOP_N,
|
|
1385
|
+
REVERSE_OPEN_AS_WHEEL_SURFACES,
|
|
1386
|
+
// Wave 4 SIGNAL research (FW-13)
|
|
1387
|
+
runSignalResearch,
|
|
1388
|
+
seedGrounding,
|
|
1389
|
+
perRingResearch,
|
|
1390
|
+
genericDomainHandle,
|
|
1391
|
+
};
|