@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,1148 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2026 Mindrian. BSL 1.1.
|
|
4
|
+
*
|
|
5
|
+
* Phase 125-05 -- F-selector top-K ranker. Pure synchronous function.
|
|
6
|
+
* ====================================================================
|
|
7
|
+
* Implements CONTEXT.md D1-D11. Plan 05 of the 9-plan F-selector ranker
|
|
8
|
+
* phase. The heart of Phase 125 -- turns the packet (Phase 110) + projections
|
|
9
|
+
* (Plan 01) + command registry (Phase 122 + Phase 104.1) into a top-K
|
|
10
|
+
* ranked F-selector list with investment-aware content selection (D9) and
|
|
11
|
+
* decay-weight integration (D7).
|
|
12
|
+
*
|
|
13
|
+
* HARD PRECONDITION: Phase 104.1 ships jtbd_label + jtbd_summary + teaching
|
|
14
|
+
* fields in data/command-registry.json. The ranker fails closed on every
|
|
15
|
+
* command if Phase 104.1 hasn't shipped (returns empty list, no crash).
|
|
16
|
+
* Verified at module load via the contract: every command must have all
|
|
17
|
+
* three fields or it is excluded from F-selector output.
|
|
18
|
+
*
|
|
19
|
+
* Canon Part 7 (reuse over build): extends shipped command-resolver +
|
|
20
|
+
* chain-recommender + packet without modifying their closed surfaces.
|
|
21
|
+
* Canon Part 8 (Graph Boundary): zero Brain calls (consumes packet, never
|
|
22
|
+
* issues query); LOCAL only. No network. No db writes. No I/O writes.
|
|
23
|
+
* Canon Part 9 (Memory Locality): this ranker is the "ranks structured
|
|
24
|
+
* packets" face -- SQL navigates; Brain reasons over packets that have
|
|
25
|
+
* already been built; this module just ranks what's on the table.
|
|
26
|
+
*
|
|
27
|
+
* Function signatures LOCKED in 125-CONTEXT.md "Function signatures":
|
|
28
|
+
* rankForSelector({jtbd, problemType, focusNodeId, roomState,
|
|
29
|
+
* packetOptional, k=3}) -> Array<RankedItem>
|
|
30
|
+
* selectWhyContent(jtbd_summary, teaching, investment_level) -> string
|
|
31
|
+
* renderInvestmentBadge(investment_level) -> string
|
|
32
|
+
* renderSliceBadge(slice_scope, slice_rationale) -> string
|
|
33
|
+
*
|
|
34
|
+
* Returned RankedItem shape (CONTEXT.md):
|
|
35
|
+
* {
|
|
36
|
+
* command: '/mos:slug',
|
|
37
|
+
* jtbd_label: string, // from Phase 104.1
|
|
38
|
+
* jtbd_summary: string, // from Phase 104.1
|
|
39
|
+
* teaching: string, // from Phase 104.1 (D11)
|
|
40
|
+
* framework: string, // implementation detail
|
|
41
|
+
* score: number, // 0..1 (D7 decay applied)
|
|
42
|
+
* why: string, // shape scales with investment (D9)
|
|
43
|
+
* source: 'packet'|'chain'|'registry-only',
|
|
44
|
+
* investment_level: number, // 0..1
|
|
45
|
+
* }
|
|
46
|
+
*
|
|
47
|
+
* D4 scoring formula (CONTEXT.md verbatim):
|
|
48
|
+
* score = (
|
|
49
|
+
* brain_confidence * 0.40 // always weighted
|
|
50
|
+
* + (1 - recency_decay) * 0.30 * investment_level // grows with use
|
|
51
|
+
* + problem_type_bind * 0.30 * investment_level // grows with use
|
|
52
|
+
* ) / (0.40 + 0.30*investment_level + 0.30*investment_level) // normalize 0..1
|
|
53
|
+
*
|
|
54
|
+
* License: BSL 1.1.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
const path = require('node:path');
|
|
58
|
+
const fs = require('node:fs');
|
|
59
|
+
const projections = require('../core/navigation/projections.cjs');
|
|
60
|
+
const { ROLE_BLEND_KEYS } = require('../core/persona-override.cjs');
|
|
61
|
+
// Phase 205-05 (item 5): the role_level competence axis biases the dial DEFAULT +
|
|
62
|
+
// elevation emphasis (NO quotas). decision-axes is required for the hedged-always
|
|
63
|
+
// posture the dial default descends from (item 4). Both are pure LOCAL modules.
|
|
64
|
+
const { ROLE_LEVELS, detectRoleLevel, resolveElevationLean } = require('../core/persona-taxonomy.cjs');
|
|
65
|
+
// decision-axes is required LAZILY inside _applyRoleLevelBias (below): a top-level
|
|
66
|
+
// require is captured while the module graph is mid-load (navigation-engine <->
|
|
67
|
+
// f-selector-ranker already form a runtime cycle), so decisionAxes.SAFE_MODES
|
|
68
|
+
// would read undefined. The lazy require resolves the fully-loaded cached module
|
|
69
|
+
// at call time.
|
|
70
|
+
|
|
71
|
+
const REGISTRY_PATH = path.join(__dirname, '..', '..', 'data', 'command-registry.json');
|
|
72
|
+
const TAXONOMY_PATH = path.join(__dirname, '..', 'hmi', 'jtbd-taxonomy.json');
|
|
73
|
+
|
|
74
|
+
// DEFAULT_SEED is duplicated from lib/brain/chain-recommender.cjs intentionally
|
|
75
|
+
// to keep rankForSelector synchronous + module-independent for the cold-start
|
|
76
|
+
// path. If chain-recommender ever exports DEFAULT_SEED as a const, switch to
|
|
77
|
+
// import. Minor Canon Part 7 (reuse) drift accepted in exchange for zero
|
|
78
|
+
// cross-module coupling on the hot ranking path.
|
|
79
|
+
const DEFAULT_SEED = 'Beautiful Question Framework';
|
|
80
|
+
|
|
81
|
+
// Phase 121.5-10 Sub-plan K (audit Section 5.2.3 anti-pattern "More than 3
|
|
82
|
+
// lines per option"): the locked Brain-suggestion template renders TWO lines
|
|
83
|
+
// per option row (glyph + verb + score line, then meta line). With the
|
|
84
|
+
// AskUserQuestion auto-injected "Type something" / "Chat about this" rows
|
|
85
|
+
// plus the footer stat-strip, the visual budget caps at 3 user-facing
|
|
86
|
+
// options. MAX_K = 3 clamps caller k to fit the locked mockup row budget.
|
|
87
|
+
const MAX_K = 3;
|
|
88
|
+
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
// Phase 244 (TRIG-02) -- the dedicated cross-family fusion k, resolved through
|
|
91
|
+
// the SAME env-idiom hybrid-retrieve.cjs::resolveRrfK uses (:68-77), but
|
|
92
|
+
// reading a DEDICATED env var, TRIG_RRF_K, never the eureka subsystem's own
|
|
93
|
+
// fusion-k env var. The two consumers have different corpus sizes (eureka's
|
|
94
|
+
// room-scale corpus vs this ranker's MAX_K=3-bounded dial list), so
|
|
95
|
+
// overloading one env var would couple two unrelated tuning dials. Defaults
|
|
96
|
+
// to 25 (this repo's own
|
|
97
|
+
// researched small-corpus value, hybrid-retrieve.cjs:8-13 -- the 2026-07-04
|
|
98
|
+
// WebSearch validation prescribing k in 20-30 for small corpora, NOT the
|
|
99
|
+
// textbook k=60); invalid values clamp back to 25.
|
|
100
|
+
//
|
|
101
|
+
// Honest limitation: at k=25 the rank-1-versus-rank-2 RRF gap is about 3.8%,
|
|
102
|
+
// small relative to the frozen 0.15 BEHAVIORAL_CHANNEL_MARGIN detent
|
|
103
|
+
// threshold below, so RRF ordering alone will rarely flip that detent on its
|
|
104
|
+
// own. The diversity term (Plan 07's MMR pass) is what will actually change
|
|
105
|
+
// outcomes; this fusion pass earns its keep mainly when a cross-family
|
|
106
|
+
// candidate is buried multiple ranks deep by the D4 score.
|
|
107
|
+
function _resolveTrigRrfK() {
|
|
108
|
+
const raw = process.env.TRIG_RRF_K;
|
|
109
|
+
if (typeof raw === 'string' && raw.trim() !== '') {
|
|
110
|
+
const v = Number(raw);
|
|
111
|
+
if (Number.isFinite(v) && v > 0) return v;
|
|
112
|
+
}
|
|
113
|
+
return 25;
|
|
114
|
+
}
|
|
115
|
+
const TRIG_RRF_K = _resolveTrigRrfK();
|
|
116
|
+
|
|
117
|
+
// ---------------------------------------------------------------------------
|
|
118
|
+
// Phase 177-01 -- the BEHAVIORAL-CHANNEL thresholds (BCH-05, BCH-06).
|
|
119
|
+
//
|
|
120
|
+
// These three numbers govern how a behavioral-channel cue (a later-wave SIGNAL-
|
|
121
|
+
// tier observation about the navigator's posture) is allowed to influence the
|
|
122
|
+
// ranked selector. They live HERE, in the engine-side ranker, and in NO prompt
|
|
123
|
+
// and NO SKILL.md (BCH-05 adversarial grep). The engine owns the composed
|
|
124
|
+
// decision; the model emits observations only (the bright line).
|
|
125
|
+
//
|
|
126
|
+
// Below floor < 0.50 cue discarded; engine runs the base curve.
|
|
127
|
+
// (the discarded cue is STILL LOGGED in a later wave.)
|
|
128
|
+
// Protected band [0.50,0.85] cue fires SIGNAL-tier, OUTRANKS keyword, but
|
|
129
|
+
// CANNOT override Brain >= 0.70 inside the band.
|
|
130
|
+
// Above ceiling > 0.85 cue MAY outrank the graph.
|
|
131
|
+
//
|
|
132
|
+
// The ceiling is COMPUTED, not hand-typed: it is the Brain RECOMMENDED-gate floor
|
|
133
|
+
// (navigation-engine.cjs RECOMMENDED_CONFIDENCE_FLOOR == 0.70) PLUS a 0.15 margin,
|
|
134
|
+
// so it sits at least 15 points above the Brain floor by construction (BCH-06). If
|
|
135
|
+
// the Brain floor ever moves, the channel ceiling tracks it automatically and the
|
|
136
|
+
// >= 15-point invariant cannot silently drift. The require is the live source line
|
|
137
|
+
// the >= 15-point invariant is derived from -- never a duplicated literal.
|
|
138
|
+
const { RECOMMENDED_CONFIDENCE_FLOOR } = require('../core/navigation-engine.cjs');
|
|
139
|
+
const BEHAVIORAL_CHANNEL_FLOOR = 0.50;
|
|
140
|
+
const BEHAVIORAL_CHANNEL_MARGIN = 0.15;
|
|
141
|
+
const BEHAVIORAL_CHANNEL_CEILING = RECOMMENDED_CONFIDENCE_FLOOR + BEHAVIORAL_CHANNEL_MARGIN; // == 0.85
|
|
142
|
+
// The protected band is the half-open interval [FLOOR, CEILING]. A cue strictly
|
|
143
|
+
// below FLOOR is discarded; a cue strictly above CEILING may outrank the graph.
|
|
144
|
+
|
|
145
|
+
// ---------------------------------------------------------------------------
|
|
146
|
+
// Phase 177-01 -- the IGNITE-PERSONA dial seed (BCH-17, BCH-PERSONA).
|
|
147
|
+
//
|
|
148
|
+
// A pure, deterministic read of the ignite persona prior off roomState. It seeds
|
|
149
|
+
// the dial DEFAULT pre turn-1 so the first turn already leans the right way:
|
|
150
|
+
// - role_blend top=student -> ASK-leaning LOW seed (lands in selectWhyContent's
|
|
151
|
+
// teaching-density branch, investment_level < 0.4)
|
|
152
|
+
// - role_blend top=founder/investor -> TELL-leaning HIGH seed (lands in the terse
|
|
153
|
+
// jtbd_summary branch, investment_level >= 0.7)
|
|
154
|
+
// - any other known role -> NEUTRAL mid seed (the 0.4-0.7 stitched branch)
|
|
155
|
+
// Degrade ladder (never fabricate a blend):
|
|
156
|
+
// role_blend (object of {role:weight}) -> top-weighted role
|
|
157
|
+
// else roomState.canonical_role scalar -> same mapping
|
|
158
|
+
// else -> cold-start NEUTRAL mid seed
|
|
159
|
+
// The model emits NO dial; this is engine-side (the bright line). The seed BIASES
|
|
160
|
+
// investment_level (the 0.30*investment_level problem_type_bind term, D4) for the
|
|
161
|
+
// SAME turn; the Pass-2 prose dial is INJECTED from the composed number, not here.
|
|
162
|
+
//
|
|
163
|
+
// Seed values are chosen to land squarely inside the three selectWhyContent bands
|
|
164
|
+
// (< 0.4 / 0.4-0.7 / >= 0.7) with margin, so the band classification is robust.
|
|
165
|
+
const IGNITE_SEED_ASK = 0.20; // student -> patient, ASK-leaning, teaching density
|
|
166
|
+
const IGNITE_SEED_NEUTRAL = 0.55; // unknown/other known role -> balanced mid
|
|
167
|
+
const IGNITE_SEED_TELL = 0.80; // founder/investor -> terse, TELL-leaning
|
|
168
|
+
|
|
169
|
+
// role-key (one of ROLE_BLEND_KEYS) -> seed. student is the lone ASK lean; founder
|
|
170
|
+
// and investor are the TELL lean; the remaining known roles take the neutral mid.
|
|
171
|
+
const _ROLE_SEED = Object.freeze({
|
|
172
|
+
student: IGNITE_SEED_ASK,
|
|
173
|
+
founder: IGNITE_SEED_TELL,
|
|
174
|
+
investor: IGNITE_SEED_TELL,
|
|
175
|
+
researcher: IGNITE_SEED_NEUTRAL,
|
|
176
|
+
operator: IGNITE_SEED_NEUTRAL,
|
|
177
|
+
mentor: IGNITE_SEED_NEUTRAL,
|
|
178
|
+
domain_expert: IGNITE_SEED_NEUTRAL,
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
// Normalize an arbitrary role label to one of the 7 frozen ROLE_BLEND_KEYS, or
|
|
182
|
+
// null. Mirrors persona-override.normalizeRoleKey without importing the private
|
|
183
|
+
// fn: lowercase, collapse whitespace to underscore, membership-check the frozen set.
|
|
184
|
+
function _normalizeRoleKey(k) {
|
|
185
|
+
if (typeof k !== 'string') return null;
|
|
186
|
+
const key = k.trim().toLowerCase().replace(/\s+/g, '_');
|
|
187
|
+
return ROLE_BLEND_KEYS.indexOf(key) >= 0 ? key : null;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Pick the top-weighted role from a role_blend object. Ties (and the all-zero /
|
|
191
|
+
// all-equal case) break by ROLE_BLEND_KEYS order for determinism. Returns a
|
|
192
|
+
// normalized role key, or null when the blend yields no usable role. NEVER
|
|
193
|
+
// fabricates a role: an empty / malformed blend returns null (caller degrades).
|
|
194
|
+
function _topRoleFromBlend(roleBlend) {
|
|
195
|
+
if (!roleBlend || typeof roleBlend !== 'object' || Array.isArray(roleBlend)) return null;
|
|
196
|
+
let best = null;
|
|
197
|
+
let bestWeight = -Infinity;
|
|
198
|
+
// Iterate in frozen-set order so ties resolve deterministically.
|
|
199
|
+
for (const key of ROLE_BLEND_KEYS) {
|
|
200
|
+
if (!Object.prototype.hasOwnProperty.call(roleBlend, key)) continue;
|
|
201
|
+
const w = roleBlend[key];
|
|
202
|
+
if (typeof w !== 'number' || !Number.isFinite(w)) continue;
|
|
203
|
+
if (w > bestWeight) {
|
|
204
|
+
bestWeight = w;
|
|
205
|
+
best = key;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return best;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Does roomState carry an ACTUAL ignite persona prior (a usable role_blend or a
|
|
212
|
+
// recognized canonical_role scalar)? When false, igniteDialSeed returns the
|
|
213
|
+
// cold-start neutral value but the ranker must NOT bias investment_level with it
|
|
214
|
+
// (a personaless room keeps its pure runtime gradient, byte-stable with pre-177).
|
|
215
|
+
function hasIgnitePrior(roomState) {
|
|
216
|
+
if (!roomState || typeof roomState !== 'object') return false;
|
|
217
|
+
if (_topRoleFromBlend(roomState.role_blend) !== null) return true;
|
|
218
|
+
if (_normalizeRoleKey(roomState.canonical_role) !== null) return true;
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// THE deterministic ignite-persona dial seed. Pure: same roomState -> same seed.
|
|
223
|
+
// Returns a number in [0,1]. Degrades real (blend -> canonical_role scalar ->
|
|
224
|
+
// cold-start neutral); never fabricates a blend.
|
|
225
|
+
function igniteDialSeed(roomState) {
|
|
226
|
+
if (!roomState || typeof roomState !== 'object') return IGNITE_SEED_NEUTRAL;
|
|
227
|
+
// 1. role_blend (the ignite prior, a weighted object).
|
|
228
|
+
const topFromBlend = _topRoleFromBlend(roomState.role_blend);
|
|
229
|
+
if (topFromBlend !== null) {
|
|
230
|
+
return _ROLE_SEED[topFromBlend];
|
|
231
|
+
}
|
|
232
|
+
// 2. degrade to the canonical_role scalar.
|
|
233
|
+
const scalarKey = _normalizeRoleKey(roomState.canonical_role);
|
|
234
|
+
if (scalarKey !== null) {
|
|
235
|
+
return _ROLE_SEED[scalarKey];
|
|
236
|
+
}
|
|
237
|
+
// 3. neither present -> cold-start NEUTRAL. No role invented.
|
|
238
|
+
return IGNITE_SEED_NEUTRAL;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Per-process caches. The registry + taxonomy are generated artifacts that do
|
|
242
|
+
// not change during a run; reading each once is the command-resolver.cjs
|
|
243
|
+
// precedent. Tests can override the registry via _test._setRegistry.
|
|
244
|
+
let _registryCache = null;
|
|
245
|
+
let _taxonomyCache = null;
|
|
246
|
+
|
|
247
|
+
function _loadRegistry() {
|
|
248
|
+
if (_registryCache) return _registryCache;
|
|
249
|
+
try {
|
|
250
|
+
_registryCache = JSON.parse(fs.readFileSync(REGISTRY_PATH, 'utf8'));
|
|
251
|
+
} catch (_e) {
|
|
252
|
+
_registryCache = { commands: [] };
|
|
253
|
+
}
|
|
254
|
+
return _registryCache;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function _loadTaxonomy() {
|
|
258
|
+
if (_taxonomyCache) return _taxonomyCache;
|
|
259
|
+
try {
|
|
260
|
+
_taxonomyCache = JSON.parse(fs.readFileSync(TAXONOMY_PATH, 'utf8'));
|
|
261
|
+
} catch (_e) {
|
|
262
|
+
_taxonomyCache = { entries: [] };
|
|
263
|
+
}
|
|
264
|
+
return _taxonomyCache;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Test seam. Lets tests reset between cases AND inject a fake registry shape
|
|
268
|
+
// so the ranker doesn't have to read disk. NOT exposed via the public API.
|
|
269
|
+
function _resetCaches() {
|
|
270
|
+
_registryCache = null;
|
|
271
|
+
_taxonomyCache = null;
|
|
272
|
+
}
|
|
273
|
+
function _setRegistry(obj) {
|
|
274
|
+
_registryCache = obj || { commands: [] };
|
|
275
|
+
}
|
|
276
|
+
function _setTaxonomy(obj) {
|
|
277
|
+
_taxonomyCache = obj || { entries: [] };
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// ---------------------------------------------------------------------------
|
|
281
|
+
// D9 implementation -- content selection by investment_level.
|
|
282
|
+
// Pure. Same inputs -> same output. No I/O. No state mutation.
|
|
283
|
+
//
|
|
284
|
+
// investment_level < 0.4 -> teaching (Larry-voice prose)
|
|
285
|
+
// investment_level >= 0.7 -> jtbd_summary (terse rationale)
|
|
286
|
+
// 0.4 <= investment_level < 0.7 -> stitched: teaching + ' -- ' + jtbd_summary
|
|
287
|
+
//
|
|
288
|
+
// The separator is ' -- ' (double-hyphen with spaces) per the project no-em-
|
|
289
|
+
// dash rule + CONTEXT.md D9 (Open question 9 resolution: lean double-hyphen
|
|
290
|
+
// over parens or newline).
|
|
291
|
+
// ---------------------------------------------------------------------------
|
|
292
|
+
function selectWhyContent(jtbd_summary, teaching, investment_level) {
|
|
293
|
+
const hasJtbd = typeof jtbd_summary === 'string' && jtbd_summary.length > 0;
|
|
294
|
+
const hasTeaching = typeof teaching === 'string' && teaching.length > 0;
|
|
295
|
+
if (!hasJtbd && !hasTeaching) return '';
|
|
296
|
+
if (!hasJtbd) return teaching;
|
|
297
|
+
if (!hasTeaching) return jtbd_summary;
|
|
298
|
+
const lvl = (typeof investment_level === 'number') ? investment_level : 0;
|
|
299
|
+
if (lvl < 0.4) return teaching;
|
|
300
|
+
if (lvl >= 0.7) return jtbd_summary;
|
|
301
|
+
// Mid-band: stitch with the ' -- ' separator.
|
|
302
|
+
return teaching + ' -- ' + jtbd_summary;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// ---------------------------------------------------------------------------
|
|
306
|
+
// D5 visible-investment badge. Single-line, <= 80 chars. The renderer (F-
|
|
307
|
+
// selector consumer) drops this string into the intelligence strip.
|
|
308
|
+
// ---------------------------------------------------------------------------
|
|
309
|
+
function renderInvestmentBadge(investment_level) {
|
|
310
|
+
const lvl = (typeof investment_level === 'number')
|
|
311
|
+
? Math.max(0, Math.min(1, investment_level))
|
|
312
|
+
: 0;
|
|
313
|
+
const pct = Math.round(lvl * 100);
|
|
314
|
+
const remaining = Math.max(0, 10 - Math.round(lvl * 10));
|
|
315
|
+
let line;
|
|
316
|
+
if (lvl === 0) {
|
|
317
|
+
line = 'Investment: 0% -- Brain priors only (10 invocations to full local)';
|
|
318
|
+
} else if (lvl >= 1.0) {
|
|
319
|
+
line = 'Investment: 100% -- full local scoring with Brain confidence';
|
|
320
|
+
} else {
|
|
321
|
+
line = 'Investment: ' + pct + '% -- Brain + local signal ('
|
|
322
|
+
+ remaining + ' invocations to full)';
|
|
323
|
+
}
|
|
324
|
+
return (line.length > 80) ? line.slice(0, 80) : line;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// ---------------------------------------------------------------------------
|
|
328
|
+
// D5 slice rationale badge. Single-line, <= 80 chars.
|
|
329
|
+
// ---------------------------------------------------------------------------
|
|
330
|
+
function renderSliceBadge(slice_scope, slice_rationale) {
|
|
331
|
+
const scope = (slice_scope === 1 || slice_scope === 2 || slice_scope === 3)
|
|
332
|
+
? slice_scope : 3;
|
|
333
|
+
const rationaleStr = (typeof slice_rationale === 'string') ? slice_rationale : '';
|
|
334
|
+
const head = 'Slice: ' + scope + ' hop' + (scope === 1 ? '' : 's') + ' -- ';
|
|
335
|
+
const room = Math.max(0, 80 - head.length);
|
|
336
|
+
const rationaleShort = rationaleStr.slice(0, room);
|
|
337
|
+
return head + rationaleShort;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// ---------------------------------------------------------------------------
|
|
341
|
+
// Phase 125-07 -- D8 none-fit affordance label. The user-facing string the
|
|
342
|
+
// F-selector renderer places alongside F.0/F.1/F.2 affordances when none of
|
|
343
|
+
// the top-K fit the user's intent. Per CONTEXT.md Open Question #8 lean
|
|
344
|
+
// ("None fit -- tell me what you need"). Larry-voice; clear; <= 80 chars
|
|
345
|
+
// for the single-line intelligence strip. Deterministic (idempotent across
|
|
346
|
+
// calls -- the renderer can cache freely).
|
|
347
|
+
//
|
|
348
|
+
// Wave-1 user test of the wording remains an Open Question for v2 (per
|
|
349
|
+
// Open Q #8). When that test lands, swap the literal here -- no consumer
|
|
350
|
+
// change needed because the renderer treats this as an opaque label string.
|
|
351
|
+
//
|
|
352
|
+
// The consumer (F-selector renderer) is responsible for the follow-up
|
|
353
|
+
// /mos:do call when the user picks this affordance. recordSelectorMiss
|
|
354
|
+
// (Plan 07; same Phase 125-07 wave) is the capture writer that pairs with
|
|
355
|
+
// this label.
|
|
356
|
+
// ---------------------------------------------------------------------------
|
|
357
|
+
function renderNoneFitAffordance() {
|
|
358
|
+
return 'None fit -- tell me what you need';
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// ---------------------------------------------------------------------------
|
|
362
|
+
// D7 decay-weight integration. When opts._applyDecayWeight is provided
|
|
363
|
+
// (typically by the F-selector renderer that wires Plan 05 + Plan 06), apply
|
|
364
|
+
// it. When absent, default no-op (returns base score untouched). Plan 06
|
|
365
|
+
// ships the actual decay function; Plan 05 stays callable in its absence.
|
|
366
|
+
// ---------------------------------------------------------------------------
|
|
367
|
+
function _applyDecay(applyDecayWeight, baseScore, commandId, roomState) {
|
|
368
|
+
if (typeof applyDecayWeight !== 'function') return baseScore;
|
|
369
|
+
try {
|
|
370
|
+
const adjusted = applyDecayWeight(baseScore, commandId, roomState);
|
|
371
|
+
return (typeof adjusted === 'number' && isFinite(adjusted)) ? adjusted : baseScore;
|
|
372
|
+
} catch (_e) {
|
|
373
|
+
return baseScore;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// JTBD selection per RESEARCH G-01: lean roomState.activeJtbd if it matches
|
|
378
|
+
// one of the command's serves_jtbd entries; otherwise fall back to serves_jtbd[0].
|
|
379
|
+
function _resolveJtbdForCommand(cmd, roomState) {
|
|
380
|
+
const serves = Array.isArray(cmd.serves_jtbd) ? cmd.serves_jtbd : [];
|
|
381
|
+
if (serves.length === 0) return null;
|
|
382
|
+
const activeJtbd =
|
|
383
|
+
(roomState && typeof roomState.activeJtbd === 'string') ? roomState.activeJtbd : null;
|
|
384
|
+
if (activeJtbd && serves.indexOf(activeJtbd) !== -1) return activeJtbd;
|
|
385
|
+
return serves[0];
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// Extract brain_confidence for this command's framework from the packet's
|
|
389
|
+
// framework_chain_hint. The highest confidence edge that touches the
|
|
390
|
+
// framework (as source or target) wins. Returns null when no signal.
|
|
391
|
+
function _brainConfidenceFromPacket(packetOptional, framework) {
|
|
392
|
+
if (!packetOptional || !packetOptional.local_graph_summary) return null;
|
|
393
|
+
const hint = packetOptional.local_graph_summary.framework_chain_hint;
|
|
394
|
+
if (!hint || !Array.isArray(hint.edges)) return null;
|
|
395
|
+
let best = null;
|
|
396
|
+
for (const e of hint.edges) {
|
|
397
|
+
if (!e) continue;
|
|
398
|
+
const touches = (e.from === framework) || (e.to === framework);
|
|
399
|
+
if (touches && typeof e.confidence === 'number') {
|
|
400
|
+
if (best === null || e.confidence > best) best = e.confidence;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
return best;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// D4 recency_decay term: 1.0 = fully decayed (old); 0.0 = fresh.
|
|
407
|
+
// Computed from roomState.lastInvokedAt[command] if available (ms epoch),
|
|
408
|
+
// else 0.5 default. Linear ramp: 0..30 days -> 0..1.
|
|
409
|
+
function _recencyDecay(cmd, roomState) {
|
|
410
|
+
if (!roomState || !roomState.lastInvokedAt) return 0.5;
|
|
411
|
+
const last = roomState.lastInvokedAt[cmd.command];
|
|
412
|
+
if (typeof last !== 'number' || !isFinite(last)) return 0.5;
|
|
413
|
+
const ageDays = (Date.now() - last) / (24 * 3600 * 1000);
|
|
414
|
+
if (ageDays <= 0) return 0;
|
|
415
|
+
return Math.min(1.0, ageDays / 30);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// D4 problem_type_bind term: 1.0 if the command's frameworks align with
|
|
419
|
+
// roomState.problemType's preferred shape; 0.0 otherwise; 0.5 default when
|
|
420
|
+
// problemType is absent.
|
|
421
|
+
// Simple proxy (Plan 05 v1; Plan 06+ may refine via Brain chain weight):
|
|
422
|
+
// WDP + kind=methodology -> 1.0
|
|
423
|
+
// UDP/IDP + frameworks includes 'Beautiful Question Framework'-> 1.0
|
|
424
|
+
// else -> 0.5
|
|
425
|
+
function _problemTypeBind(cmd, roomState) {
|
|
426
|
+
if (!roomState || typeof roomState.problemType !== 'string') return 0.5;
|
|
427
|
+
const pt = roomState.problemType.toUpperCase();
|
|
428
|
+
const fws = Array.isArray(cmd.frameworks) ? cmd.frameworks : [];
|
|
429
|
+
if (pt === 'WDP' && cmd.kind === 'methodology') return 1.0;
|
|
430
|
+
if ((pt === 'UDP' || pt === 'IDP') && fws.indexOf('Beautiful Question Framework') !== -1) {
|
|
431
|
+
return 1.0;
|
|
432
|
+
}
|
|
433
|
+
return 0.5;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
// D4 scoring formula. Numerator + denominator coded with the exact 0.40 /
|
|
437
|
+
// 0.30 / 0.30 weights from CONTEXT.md. Normalizes to 0..1 at every
|
|
438
|
+
// investment_level; investment_level=0 reduces to pure brain_confidence
|
|
439
|
+
// (no discontinuity).
|
|
440
|
+
function _scoreCommand({ cmd, packetOptional, roomState, investment_level }) {
|
|
441
|
+
const fw = (Array.isArray(cmd.frameworks) && cmd.frameworks.length > 0)
|
|
442
|
+
? cmd.frameworks[0] : DEFAULT_SEED;
|
|
443
|
+
const bc = _brainConfidenceFromPacket(packetOptional, fw);
|
|
444
|
+
const brain_confidence = (typeof bc === 'number') ? bc : 0.5;
|
|
445
|
+
const recency_decay = _recencyDecay(cmd, roomState);
|
|
446
|
+
const problem_type_bind = _problemTypeBind(cmd, roomState);
|
|
447
|
+
const inv = investment_level;
|
|
448
|
+
const numerator =
|
|
449
|
+
brain_confidence * 0.40
|
|
450
|
+
+ (1 - recency_decay) * 0.30 * inv
|
|
451
|
+
+ problem_type_bind * 0.30 * inv;
|
|
452
|
+
const denominator = 0.40 + 0.30 * inv + 0.30 * inv;
|
|
453
|
+
if (denominator <= 0) return 0;
|
|
454
|
+
return numerator / denominator;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// Phase 121.5-10 Sub-plan K: derive optional `category` field for the locked
|
|
458
|
+
// Brain-suggestion template meta row. Sourced from packetOptional's
|
|
459
|
+
// local_graph_summary.category_hint when present, falling back to the
|
|
460
|
+
// command's registry-declared `kind` field, falling back to '' (empty string
|
|
461
|
+
// is acceptable per the locked template -- the meta row renders blank).
|
|
462
|
+
function _categoryFromPacket(packetOptional, cmd) {
|
|
463
|
+
if (packetOptional && packetOptional.local_graph_summary
|
|
464
|
+
&& typeof packetOptional.local_graph_summary.category_hint === 'string'
|
|
465
|
+
&& packetOptional.local_graph_summary.category_hint.length > 0) {
|
|
466
|
+
return packetOptional.local_graph_summary.category_hint;
|
|
467
|
+
}
|
|
468
|
+
if (cmd && typeof cmd.kind === 'string' && cmd.kind.length > 0) return cmd.kind;
|
|
469
|
+
return '';
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// Phase 121.5-10 Sub-plan K: derive optional `graph_relationship` field for
|
|
473
|
+
// the locked Brain-suggestion template meta row. Sourced from
|
|
474
|
+
// packetOptional's framework_chain_hint -- the highest-confidence edge that
|
|
475
|
+
// touches the framework gets its relationship rendered (e.g. "feeds Porter
|
|
476
|
+
// Five Forces"). Falls back to '' when no edge data exists.
|
|
477
|
+
function _graphRelationshipFromPacket(packetOptional, framework) {
|
|
478
|
+
if (!packetOptional || !packetOptional.local_graph_summary) return '';
|
|
479
|
+
const hint = packetOptional.local_graph_summary.framework_chain_hint;
|
|
480
|
+
if (!hint || !Array.isArray(hint.edges)) return '';
|
|
481
|
+
let bestEdge = null;
|
|
482
|
+
let bestConf = -1;
|
|
483
|
+
for (const e of hint.edges) {
|
|
484
|
+
if (!e) continue;
|
|
485
|
+
const touches = (e.from === framework) || (e.to === framework);
|
|
486
|
+
if (touches && typeof e.confidence === 'number' && e.confidence > bestConf) {
|
|
487
|
+
bestConf = e.confidence;
|
|
488
|
+
bestEdge = e;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
if (!bestEdge) return '';
|
|
492
|
+
const rel = (typeof bestEdge.relationship === 'string' && bestEdge.relationship.length > 0)
|
|
493
|
+
? bestEdge.relationship : 'feeds';
|
|
494
|
+
const target = (bestEdge.from === framework)
|
|
495
|
+
? (typeof bestEdge.to === 'string' ? bestEdge.to : '')
|
|
496
|
+
: (typeof bestEdge.from === 'string' ? bestEdge.from : '');
|
|
497
|
+
if (target.length === 0) return rel;
|
|
498
|
+
return rel + ' ' + target;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// Per-command source attribution per Test 5 (CONTEXT.md acceptance):
|
|
502
|
+
// packet has framework_chain_hint with edges -> 'packet'
|
|
503
|
+
// command has frameworks[] (chain-recommender-derivable)-> 'chain'
|
|
504
|
+
// neither -> 'registry-only'
|
|
505
|
+
function _sourceFor(packetOptional, cmd) {
|
|
506
|
+
if (packetOptional
|
|
507
|
+
&& packetOptional.local_graph_summary
|
|
508
|
+
&& packetOptional.local_graph_summary.framework_chain_hint) {
|
|
509
|
+
const hint = packetOptional.local_graph_summary.framework_chain_hint;
|
|
510
|
+
if (Array.isArray(hint.edges) && hint.edges.length > 0) return 'packet';
|
|
511
|
+
}
|
|
512
|
+
if (Array.isArray(cmd.frameworks) && cmd.frameworks.length > 0) return 'chain';
|
|
513
|
+
return 'registry-only';
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// ---------------------------------------------------------------------------
|
|
517
|
+
// Phase 205-03 -- the SENS-10 anti-circular RANKER FLIP (clarify-vs-reframe).
|
|
518
|
+
//
|
|
519
|
+
// When the SENS-10 circularity sensor fires this turn, a clarifying ASK (asking
|
|
520
|
+
// the SAME question again, within the current frame) PERPETUATES the circle and
|
|
521
|
+
// must NEVER be the recommended detent. A REFRAME ASK (a NEW question that
|
|
522
|
+
// changes the frame -- the beautiful-question exit) is the allowed ASK. This is
|
|
523
|
+
// the clarify-vs-reframe rule (205-CONTEXT.md item 2).
|
|
524
|
+
//
|
|
525
|
+
// This is a RANKING SUPPRESSION, not a bank edit (mirrors the Phase 158
|
|
526
|
+
// discount-touches-runtime-only discipline): no command is removed from the
|
|
527
|
+
// registry; the flip only reorders the already-scored list for THIS turn.
|
|
528
|
+
// It runs ONLY when sens10.fired === true, so a turn with no SENS-10 signal
|
|
529
|
+
// returns byte-identical to the pre-205 behavior (the no-op guard).
|
|
530
|
+
//
|
|
531
|
+
// The frozen Shape-F scalars are untouched: MAX_K, the 0.70/0.15 detent, and the
|
|
532
|
+
// D4 weights are NOT changed here. The 0.70 act-vs-offer line (D-Q4) is governed
|
|
533
|
+
// downstream; this task only governs the clarify-vs-reframe recommendation.
|
|
534
|
+
//
|
|
535
|
+
// Detent classification over the scored rows (each row is a command):
|
|
536
|
+
// exit the SENS-10 exit command (sens10.exit_command) -> TOP
|
|
537
|
+
// ask_reframe the reframe path (sens10.reframe_command, default
|
|
538
|
+
// /mos:beautiful-question, or framework 'Beautiful Question
|
|
539
|
+
// Framework') -> kept ELIGIBLE (a reserved slot)
|
|
540
|
+
// ask_clarification a re-ask-within-frame command (sens10.clarify_commands)
|
|
541
|
+
// -> demoted BELOW every non-clarification row (never top)
|
|
542
|
+
// other everything else -> score order
|
|
543
|
+
//
|
|
544
|
+
// Ordering: [exit(s)] then [one reframe] then [remaining reframe + other by
|
|
545
|
+
// score] then [clarification last], sliced to k.
|
|
546
|
+
const SENS10_DEFAULT_REFRAME_COMMAND = '/mos:beautiful-question';
|
|
547
|
+
const SENS10_REFRAME_FRAMEWORK = 'Beautiful Question Framework';
|
|
548
|
+
|
|
549
|
+
function _applySens10Flip(scored, sens10, k) {
|
|
550
|
+
const exitCmd = (typeof sens10.exit_command === 'string') ? sens10.exit_command : '';
|
|
551
|
+
const reframeCmd = (typeof sens10.reframe_command === 'string' && sens10.reframe_command)
|
|
552
|
+
? sens10.reframe_command : SENS10_DEFAULT_REFRAME_COMMAND;
|
|
553
|
+
const clarify = Array.isArray(sens10.clarify_commands)
|
|
554
|
+
? sens10.clarify_commands.filter(function (c) { return typeof c === 'string'; })
|
|
555
|
+
: [];
|
|
556
|
+
const cause = (typeof sens10.cause === 'string') ? sens10.cause : '';
|
|
557
|
+
|
|
558
|
+
function detentOf(item) {
|
|
559
|
+
if (exitCmd && item.command === exitCmd) return 'exit';
|
|
560
|
+
if (item.command === reframeCmd || item.framework === SENS10_REFRAME_FRAMEWORK) return 'ask_reframe';
|
|
561
|
+
if (clarify.indexOf(item.command) !== -1) return 'ask_clarification';
|
|
562
|
+
return 'other';
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
// Tag on a COPY so the base rows stay clean (the sens10 fields appear only on
|
|
566
|
+
// the flipped output). scored is already sorted score-desc, so partitioning
|
|
567
|
+
// preserves score order within each detent bucket.
|
|
568
|
+
const tagged = scored.map(function (it) {
|
|
569
|
+
return Object.assign({}, it, {
|
|
570
|
+
detent: detentOf(it),
|
|
571
|
+
sens10_applied: true,
|
|
572
|
+
sens10_cause: cause,
|
|
573
|
+
});
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
const exit = tagged.filter(function (t) { return t.detent === 'exit'; });
|
|
577
|
+
const reframe = tagged.filter(function (t) { return t.detent === 'ask_reframe'; });
|
|
578
|
+
const others = tagged.filter(function (t) { return t.detent === 'other'; });
|
|
579
|
+
const clarification = tagged.filter(function (t) { return t.detent === 'ask_clarification'; });
|
|
580
|
+
|
|
581
|
+
const ordered = [];
|
|
582
|
+
for (const e of exit) ordered.push(e); // exit(s) recommended (top)
|
|
583
|
+
if (reframe.length) ordered.push(reframe[0]); // reserve a reframe slot (eligible)
|
|
584
|
+
const middle = reframe.slice(1).concat(others).sort(function (a, b) { return b.score - a.score; });
|
|
585
|
+
for (const m of middle) ordered.push(m); // remaining reframe + others by score
|
|
586
|
+
for (const c of clarification) ordered.push(c); // clarification always last (never recommended)
|
|
587
|
+
|
|
588
|
+
return ordered.slice(0, k);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
// ---------------------------------------------------------------------------
|
|
592
|
+
// Phase 205-05 (item 5) -- the role_level DIAL-DEFAULT + elevation-emphasis bias.
|
|
593
|
+
//
|
|
594
|
+
// role_level (student|practitioner|researcher|professor) biases which elevation
|
|
595
|
+
// direction the default leans toward, per Lawrence's Test-6 ratio: a student
|
|
596
|
+
// skews VERTICAL (depth), every non-student skews HORIZONTAL/LATERAL (connect
|
|
597
|
+
// their own separate ideas + import from outside). This is a BIAS on the seed /
|
|
598
|
+
// default only -- it must NOT force a fixed count of any elevation type (Non-goal:
|
|
599
|
+
// no elevation quotas; gate on signal). There is NO count/quota gate here: the
|
|
600
|
+
// helper stamps a lean descriptor and NEVER filters, caps, or requires N of any
|
|
601
|
+
// direction. The hedged-always decision posture (item 4) rides alongside: the
|
|
602
|
+
// default is offered as an ASK unless the confidence detent permits act-report,
|
|
603
|
+
// and it is ALWAYS hedged (decision-axes clamps the confidence axis off).
|
|
604
|
+
//
|
|
605
|
+
// Runs ONLY when a role_level resolves (explicit arg, roomState, or detection off
|
|
606
|
+
// opening turns). Absent role_level => this is a no-op and the returned list is
|
|
607
|
+
// byte-identical to the pre-205-05 shape (so the 205-03 / 205-04 suites, which
|
|
608
|
+
// pass no role_level, stay green).
|
|
609
|
+
function _resolveRoleLevel(o, roomState) {
|
|
610
|
+
// Precedence: explicit arg -> roomState scalar -> detection off opening turns.
|
|
611
|
+
if (typeof o.role_level === 'string' && ROLE_LEVELS.indexOf(o.role_level) !== -1) {
|
|
612
|
+
return o.role_level;
|
|
613
|
+
}
|
|
614
|
+
if (roomState && typeof roomState.role_level === 'string'
|
|
615
|
+
&& ROLE_LEVELS.indexOf(roomState.role_level) !== -1) {
|
|
616
|
+
return roomState.role_level;
|
|
617
|
+
}
|
|
618
|
+
const turns = (o.openingTurns !== undefined) ? o.openingTurns
|
|
619
|
+
: (roomState ? roomState.openingTurns : undefined);
|
|
620
|
+
const detected = detectRoleLevel(turns);
|
|
621
|
+
return (detected !== null) ? detected : null;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
function _applyRoleLevelBias(list, role_level) {
|
|
625
|
+
const lean = resolveElevationLean(role_level);
|
|
626
|
+
if (lean === null) return list; // no bias resolvable -> no-op.
|
|
627
|
+
// The dial default is ALWAYS hedged (item 4): stamp the hedged-always posture
|
|
628
|
+
// so the default cannot descend into a confident tell. This reads decision-axes
|
|
629
|
+
// as the single source of the confidence-axis clamp; the exact mode still
|
|
630
|
+
// resolves per turn downstream from the live confidence scalar.
|
|
631
|
+
const decisionAxes = require('../core/decision-axes.cjs');
|
|
632
|
+
const hedgedAlways = decisionAxes.SAFE_MODES.indexOf('tell_and_confident') === -1;
|
|
633
|
+
return list.map(function (it) {
|
|
634
|
+
return Object.assign({}, it, {
|
|
635
|
+
role_level: role_level,
|
|
636
|
+
// The elevation the default LEANS toward (bias, not a quota).
|
|
637
|
+
elevation_lean: lean.primary,
|
|
638
|
+
elevation_secondary: lean.secondary,
|
|
639
|
+
// The confidence axis is clamped to hedged for the default (never confident).
|
|
640
|
+
dial_default_hedged: hedgedAlways,
|
|
641
|
+
});
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
// ---------------------------------------------------------------------------
|
|
646
|
+
// Phase 244 (TRIG-02) -- the optional cross-family RANK FUSION pass.
|
|
647
|
+
//
|
|
648
|
+
// Closes RESEARCH BLOCKER B-1: the `scored` rows here carry no trigger-tier
|
|
649
|
+
// field (they are read from data/command-registry.json, not sensor candidate
|
|
650
|
+
// reaches -- 244-RESEARCH.md Q3). Rather than making this function depend on
|
|
651
|
+
// sensor output, the caller (lib/core/orchestration-candidate-lift.cjs, Task
|
|
652
|
+
// 2 of this plan) builds tier-tagged command-slug lists from data ALREADY in
|
|
653
|
+
// its own scope and threads them in as o.tierCandidates. This keeps
|
|
654
|
+
// rankForSelector pure/sync/registry-only while still closing the seam at
|
|
655
|
+
// both ends (a production caller genuinely supplies the argument).
|
|
656
|
+
//
|
|
657
|
+
// Fusion calls the ALREADY-SHIPPED rrfFuse (hybrid-retrieve.cjs:90-118) --
|
|
658
|
+
// writing a second fusion implementation here would be a Canon Part 7
|
|
659
|
+
// violation. rrfFuse reads array POSITION, never item.score/item.rank, so it
|
|
660
|
+
// is immune to bm25's negative-score sign convention: both the `command_d4`
|
|
661
|
+
// list built below (already sorted score-desc, see the sort above) and any
|
|
662
|
+
// caller-supplied list are assumed pre-sorted best-first; no normalization,
|
|
663
|
+
// no sign flip, no min-max scaling happens anywhere in this pass.
|
|
664
|
+
//
|
|
665
|
+
// No-op guard + copy-on-write, mirroring _applyRoleLevelBias immediately
|
|
666
|
+
// above: absent/empty tierCandidates, or a tierCandidates array that
|
|
667
|
+
// contributes zero usable items (a string, a number, an array of nulls, a
|
|
668
|
+
// list whose items lack `id`), returns the INPUT ARRAY BY REFERENCE
|
|
669
|
+
// untouched -- byte-identical to the pre-244 shape. Every base row is copied
|
|
670
|
+
// via Object.assign before any field is added; base rows are never mutated.
|
|
671
|
+
// Wrapped in a try/catch that degrades to the untouched input on any fault.
|
|
672
|
+
function _applyTierFusion(scored, tierCandidates, k) {
|
|
673
|
+
if (!Array.isArray(tierCandidates) || tierCandidates.length === 0) return scored;
|
|
674
|
+
try {
|
|
675
|
+
// Function-local require (the navigation-engine.cjs:510 idiom) to avoid a
|
|
676
|
+
// module-load cycle: hybrid-retrieve.cjs sits under lib/core/eureka/, and
|
|
677
|
+
// a top-level require here would be evaluated while this module's own
|
|
678
|
+
// graph may still be mid-load.
|
|
679
|
+
const { rrfFuse } = require('../core/eureka/hybrid-retrieve.cjs');
|
|
680
|
+
|
|
681
|
+
// Count usable items across every supplied list (id != null). A
|
|
682
|
+
// malformed tierCandidates array (garbage entries, items without id)
|
|
683
|
+
// contributes zero usable items, in which case fusion is a no-op even
|
|
684
|
+
// though the top-level Array.isArray/length guard above passed.
|
|
685
|
+
function usableItems(entry) {
|
|
686
|
+
const arr = Array.isArray(entry)
|
|
687
|
+
? entry
|
|
688
|
+
: (entry && Array.isArray(entry.items) ? entry.items : []);
|
|
689
|
+
return arr.filter(function (it) { return it && typeof it === 'object' && it.id != null; });
|
|
690
|
+
}
|
|
691
|
+
let suppliedCount = 0;
|
|
692
|
+
const suppliedIds = new Set();
|
|
693
|
+
for (const entry of tierCandidates) {
|
|
694
|
+
for (const item of usableItems(entry)) {
|
|
695
|
+
suppliedCount += 1;
|
|
696
|
+
suppliedIds.add(item.id);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
if (suppliedCount === 0) return scored;
|
|
700
|
+
|
|
701
|
+
// The D4 registry list, already sorted score-desc by the caller (the
|
|
702
|
+
// sort above this composition). This is list index 0 so command_d4 wins
|
|
703
|
+
// ties over caller-supplied sources in rrfFuse's DEFAULT_SOURCE_NAMES
|
|
704
|
+
// fallback (irrelevant here since every list is explicitly tagged).
|
|
705
|
+
const commandD4 = {
|
|
706
|
+
source: 'command_d4',
|
|
707
|
+
items: scored.map(function (r) { return { id: r.command }; }),
|
|
708
|
+
};
|
|
709
|
+
const fused = rrfFuse([commandD4].concat(tierCandidates), TRIG_RRF_K);
|
|
710
|
+
|
|
711
|
+
const byCommand = new Map();
|
|
712
|
+
for (const row of scored) byCommand.set(row.command, row);
|
|
713
|
+
|
|
714
|
+
const seen = new Set();
|
|
715
|
+
const out = [];
|
|
716
|
+
for (const f of fused) {
|
|
717
|
+
const row = byCommand.get(f.node_id);
|
|
718
|
+
if (!row || seen.has(row.command)) continue;
|
|
719
|
+
seen.add(row.command);
|
|
720
|
+
// Tag on a COPY (never mutate the base row). tier_family is stamped on
|
|
721
|
+
// every returned row so the field is never undefined on some rows.
|
|
722
|
+
const tagged = Object.assign({}, row, { tier_family: 'command' });
|
|
723
|
+
// Only rows that appeared in a CALLER-SUPPLIED list (not merely the
|
|
724
|
+
// internal command_d4 list) additionally carry the fusion evidence.
|
|
725
|
+
if (suppliedIds.has(row.command)) {
|
|
726
|
+
tagged.rrf_score = f.rrf_score;
|
|
727
|
+
tagged.tier_sources = f.sources.slice();
|
|
728
|
+
}
|
|
729
|
+
out.push(tagged);
|
|
730
|
+
}
|
|
731
|
+
// Defensive append: every scored row is already present in command_d4,
|
|
732
|
+
// so this loop should be a no-op in practice, but it guarantees fusion
|
|
733
|
+
// can only REORDER, never DROP, a row -- even if a future edit narrows
|
|
734
|
+
// the command_d4 list.
|
|
735
|
+
for (const row of scored) {
|
|
736
|
+
if (!seen.has(row.command)) {
|
|
737
|
+
seen.add(row.command);
|
|
738
|
+
out.push(Object.assign({}, row, { tier_family: 'command' }));
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
return out;
|
|
742
|
+
} catch (_e) {
|
|
743
|
+
return scored;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
// ---------------------------------------------------------------------------
|
|
748
|
+
// Phase 244 (TRIG-03) -- the MMR (Maximal Marginal Relevance) diversity pass.
|
|
749
|
+
//
|
|
750
|
+
// Closes the crowding-out gap left open by fusion (_applyTierFusion above):
|
|
751
|
+
// fusion can promote a buried cross-family candidate into contention, but it
|
|
752
|
+
// cannot stop three near-duplicate same-family candidates from occupying all
|
|
753
|
+
// three top slots once they ARE all in contention. This pass is the greedy
|
|
754
|
+
// diversity cut that fusion is not -- Carbonell and Goldstein SIGIR 1998,
|
|
755
|
+
// "The Use of MMR, Diversity-Based Reranking for Reordering Documents and
|
|
756
|
+
// Producing Summaries."
|
|
757
|
+
//
|
|
758
|
+
// CANONICAL FORM (this is what is implemented):
|
|
759
|
+
// MMR = argmax over d in pool of [ lambda * Rel(d, q) - (1 - lambda) * max Sim(d, d_selected) ]
|
|
760
|
+
// where lambda = 1 means pure relevance, lambda = 0 means pure diversity.
|
|
761
|
+
//
|
|
762
|
+
// LAMBDA-ORIENTATION GOTCHA: ROADMAP SC3 states the formula inverted, as
|
|
763
|
+
// `(1-lambda)*relevance - lambda*max_similarity_to_selected`. The two are
|
|
764
|
+
// algebraically equivalent under `lambda' = 1 - lambda`, but the SEMANTICS OF
|
|
765
|
+
// THE KNOB ARE FLIPPED: under the ROADMAP's form, someone writing lambda=0.7
|
|
766
|
+
// intending "mostly relevance" would actually get "mostly diversity". This
|
|
767
|
+
// implementation follows the CANONICAL Carbonell orientation, and the
|
|
768
|
+
// constant is named MMR_LAMBDA_RELEVANCE so the name itself carries the
|
|
769
|
+
// semantics: 0.7 means mostly RELEVANCE weight, not mostly diversity. ROADMAP
|
|
770
|
+
// SC3's one-line formula needs a navigator amendment; this is not silently
|
|
771
|
+
// edited here (244-07-SUMMARY.md records the exact amendment needed).
|
|
772
|
+
//
|
|
773
|
+
// The similarity term reuses the ALREADY-SHIPPED Jaccard primitive
|
|
774
|
+
// (lib/core/eureka/lexical-overlap.cjs::lexicalOverlap, versioned
|
|
775
|
+
// 'jaccard-v1') -- Canon Part 7 (reuse before build). This is the THIRD
|
|
776
|
+
// production instance of that primitive, not a new similarity measure. An
|
|
777
|
+
// embedding-based similarity is deliberately excluded: the exclusion reason
|
|
778
|
+
// is LATENCY BUDGET, not missing capability -- a per-turn transformer model
|
|
779
|
+
// load is orders of magnitude beyond the 1200ms NAV budget
|
|
780
|
+
// (navigation-engine.cjs:820), even though sqlite-vec and
|
|
781
|
+
// @huggingface/transformers are already pinned dependencies and
|
|
782
|
+
// vector-store.cjs already runs a local embedding store (244-RESEARCH.md
|
|
783
|
+
// Finding F-10). The lexical leg already separates cleanly at negligible
|
|
784
|
+
// cost: at most 6x6 Jaccard comparisons per turn given MAX_K=3 and
|
|
785
|
+
// DIAL_REACH_K=6.
|
|
786
|
+
//
|
|
787
|
+
// The env-tunable lambda, resolved through the SAME idiom
|
|
788
|
+
// _resolveTrigRrfK uses above (validate finite, clamp to the closed interval
|
|
789
|
+
// 0..1, fall back to the default). Resolved ONCE at module load, mirroring
|
|
790
|
+
// TRIG_RRF_K -- a test that needs a different lambda must delete the module
|
|
791
|
+
// from require.cache and re-require (see tests/test-244-mmr-diversity.cjs).
|
|
792
|
+
function _resolveMmrLambda() {
|
|
793
|
+
const raw = process.env.TRIG_MMR_LAMBDA;
|
|
794
|
+
if (typeof raw === 'string' && raw.trim() !== '') {
|
|
795
|
+
const v = Number(raw);
|
|
796
|
+
if (Number.isFinite(v) && v >= 0 && v <= 1) return v;
|
|
797
|
+
}
|
|
798
|
+
return 0.7;
|
|
799
|
+
}
|
|
800
|
+
const MMR_LAMBDA_RELEVANCE = _resolveMmrLambda();
|
|
801
|
+
|
|
802
|
+
// The similarity projection: a LOCAL, non-prose handle built from `command`,
|
|
803
|
+
// `jtbd_label` and `framework` ONLY. Canon Part 8 keeps this similarity
|
|
804
|
+
// computation over closed LOCAL command handles rather than user or Brain
|
|
805
|
+
// content -- `jtbd_summary`, `teaching` and `why` (or any field that can
|
|
806
|
+
// carry prose) are deliberately excluded from the projection. Every field is
|
|
807
|
+
// guarded with a string check so a missing field contributes an empty
|
|
808
|
+
// string rather than 'undefined' leaking into the token stream.
|
|
809
|
+
function _mmrTextOf(row) {
|
|
810
|
+
const command = (row && typeof row.command === 'string') ? row.command : '';
|
|
811
|
+
const jtbd_label = (row && typeof row.jtbd_label === 'string') ? row.jtbd_label : '';
|
|
812
|
+
const framework = (row && typeof row.framework === 'string') ? row.framework : '';
|
|
813
|
+
return command + ' ' + jtbd_label + ' ' + framework;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
// _applyMmrDiversity(list, k) -- the greedy MMR cut. Pure, sync, no I/O.
|
|
817
|
+
//
|
|
818
|
+
// No-op guard conditions (returns the INPUT REFERENCE untouched, byte-
|
|
819
|
+
// identical, mirroring the _applyRoleLevelBias envelope immediately above):
|
|
820
|
+
// - list is null or not an array
|
|
821
|
+
// - list has 0 or 1 entries (nothing to diversify against)
|
|
822
|
+
// - only one distinct `tier_family` value is present across every row
|
|
823
|
+
// (including the case where no row carries the field at all, which
|
|
824
|
+
// counts as a single implicit "undefined" family). A single-family list
|
|
825
|
+
// has no cross-family hit to protect, so running the greedy loop would
|
|
826
|
+
// reorder for no benefit and would risk perturbing the byte-identical
|
|
827
|
+
// pre-244 path -- this is exactly the pre-244 shape when no tier
|
|
828
|
+
// candidates were ever supplied upstream (_applyTierFusion is itself a
|
|
829
|
+
// no-op then, so `list` here carries no `tier_family` field on any row).
|
|
830
|
+
function _applyMmrDiversity(list, k) {
|
|
831
|
+
if (!Array.isArray(list) || list.length <= 1) return list;
|
|
832
|
+
|
|
833
|
+
const families = new Set(list.map(function (it) { return it && it.tier_family; }));
|
|
834
|
+
if (families.size <= 1) return list;
|
|
835
|
+
|
|
836
|
+
// Relevance normalization: use `rrf_score` when present (Plan 04 stamps
|
|
837
|
+
// it on fused rows), otherwise fall back to `score`. Normalized to 0..1
|
|
838
|
+
// across the CURRENT list by dividing by the maximum, guarding a zero (or
|
|
839
|
+
// negative) maximum. This normalization is needed HERE but was not needed
|
|
840
|
+
// for fusion: RRF fused by array POSITION and never touched magnitudes, so
|
|
841
|
+
// sign/scale never mattered there; MMR SUBTRACTS a 0..1 similarity from
|
|
842
|
+
// the relevance term, so the two must share a scale or the subtraction is
|
|
843
|
+
// meaningless.
|
|
844
|
+
const rawRel = list.map(function (it) {
|
|
845
|
+
if (it && typeof it.rrf_score === 'number' && Number.isFinite(it.rrf_score)) return it.rrf_score;
|
|
846
|
+
if (it && typeof it.score === 'number' && Number.isFinite(it.score)) return it.score;
|
|
847
|
+
return 0;
|
|
848
|
+
});
|
|
849
|
+
let maxRaw = -Infinity;
|
|
850
|
+
for (const r of rawRel) { if (r > maxRaw) maxRaw = r; }
|
|
851
|
+
const rel = rawRel.map(function (r) { return (maxRaw > 0) ? (r / maxRaw) : 0; });
|
|
852
|
+
|
|
853
|
+
// Function-local require (the navigation-engine.cjs:510 idiom, already
|
|
854
|
+
// used by _applyTierFusion above) so a module-load cycle is never risked.
|
|
855
|
+
const { lexicalOverlap } = require('../core/eureka/lexical-overlap.cjs');
|
|
856
|
+
|
|
857
|
+
const kk = (typeof k === 'number' && Number.isFinite(k) && k > 0) ? Math.floor(k) : list.length;
|
|
858
|
+
|
|
859
|
+
const pool = list.map(function (it, idx) {
|
|
860
|
+
return { row: it, rel: rel[idx], text: _mmrTextOf(it) };
|
|
861
|
+
});
|
|
862
|
+
const selected = [];
|
|
863
|
+
const selectedTexts = [];
|
|
864
|
+
|
|
865
|
+
while (selected.length < kk && pool.length > 0) {
|
|
866
|
+
let bestIdx = 0;
|
|
867
|
+
let bestScore = -Infinity;
|
|
868
|
+
for (let i = 0; i < pool.length; i += 1) {
|
|
869
|
+
const cand = pool[i];
|
|
870
|
+
let maxSim = 0;
|
|
871
|
+
for (let j = 0; j < selectedTexts.length; j += 1) {
|
|
872
|
+
const sim = lexicalOverlap(cand.text, selectedTexts[j]);
|
|
873
|
+
if (sim > maxSim) maxSim = sim;
|
|
874
|
+
}
|
|
875
|
+
const mmr = MMR_LAMBDA_RELEVANCE * cand.rel - (1 - MMR_LAMBDA_RELEVANCE) * maxSim;
|
|
876
|
+
if (mmr > bestScore) {
|
|
877
|
+
bestScore = mmr;
|
|
878
|
+
bestIdx = i;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
const chosen = pool.splice(bestIdx, 1)[0];
|
|
882
|
+
selected.push(chosen);
|
|
883
|
+
selectedTexts.push(chosen.text);
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
// Copy-on-write, mirroring _applyRoleLevelBias: base rows are never
|
|
887
|
+
// mutated, and every returned entry is a fresh copy even when no field is
|
|
888
|
+
// added, so an object-identity check on the input array's entries always
|
|
889
|
+
// shows the returned entries are copies.
|
|
890
|
+
return selected.map(function (s) { return Object.assign({}, s.row); });
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
// ---------------------------------------------------------------------------
|
|
894
|
+
// MAIN SIGNATURE -- rankForSelector. Pure synchronous function. No Promise.
|
|
895
|
+
// No await. No Brain calls. No db writes. No memory_event writes. No event
|
|
896
|
+
// subscriptions (D10 invariant). Phase 244 (TRIG-02): the optional
|
|
897
|
+
// o.tierCandidates input is caller-supplied LOCAL data (pre-ranked tier-
|
|
898
|
+
// tagged command-slug lists a production caller builds from its OWN scope,
|
|
899
|
+
// e.g. orchestration-candidate-lift.cjs::buildTierCandidates) -- it widens
|
|
900
|
+
// what this function ACCEPTS, not what it DOES. Every clause above stays
|
|
901
|
+
// literally true: still sync, still no Promise/await, still no Brain calls,
|
|
902
|
+
// still no db writes, still no memory_event writes, still no event
|
|
903
|
+
// subscriptions.
|
|
904
|
+
// ---------------------------------------------------------------------------
|
|
905
|
+
function rankForSelector(args) {
|
|
906
|
+
const o = args || {};
|
|
907
|
+
// jtbd, problemType, focusNodeId are intentionally read off args even when
|
|
908
|
+
// we don't immediately use them here (the LOCKED CONTEXT.md signature
|
|
909
|
+
// preserves them as ranker inputs; consumers may surface them via roomState
|
|
910
|
+
// patching for future tuning passes).
|
|
911
|
+
const jtbd = (typeof o.jtbd === 'string') ? o.jtbd : null;
|
|
912
|
+
const problemType = (typeof o.problemType === 'string') ? o.problemType : null;
|
|
913
|
+
const focusNodeId = (typeof o.focusNodeId === 'string') ? o.focusNodeId : null;
|
|
914
|
+
const roomState = (o.roomState && typeof o.roomState === 'object') ? o.roomState : {};
|
|
915
|
+
const packetOptional = (o.packetOptional && typeof o.packetOptional === 'object')
|
|
916
|
+
? o.packetOptional : null;
|
|
917
|
+
// Phase 121.5-10 Sub-plan K: clamp k at MAX_K (3) per audit Section 5.2.3
|
|
918
|
+
// anti-pattern -- more than 3 option rows pushes the auto-injected
|
|
919
|
+
// AskUserQuestion "Type something" / "Chat about this" rows off-screen
|
|
920
|
+
// and breaks the locked template visual budget. Caller asking k=20
|
|
921
|
+
// receives k=MAX_K silently. Existing default k=3 unchanged.
|
|
922
|
+
const requestedK = (typeof o.k === 'number' && o.k > 0) ? Math.floor(o.k) : 3;
|
|
923
|
+
const k = Math.min(requestedK, MAX_K);
|
|
924
|
+
const applyDecayWeight = (typeof o._applyDecayWeight === 'function')
|
|
925
|
+
? o._applyDecayWeight : null;
|
|
926
|
+
// Phase 311 (SEED-052, D-02/D-03): the caller-declared admin-visibility
|
|
927
|
+
// flag. STRICT `=== true` on purpose -- a stray string, number, or object
|
|
928
|
+
// must never grant admin. Absent or falsy reads as "not admin", which is
|
|
929
|
+
// the fail-closed default: a caller that never wires this flag gets the
|
|
930
|
+
// SAFE (filtered) behavior automatically, never the leaky one. The ranker
|
|
931
|
+
// only ever reads this already-resolved boolean; it never resolves admin
|
|
932
|
+
// identity itself (mirrors the opts._applyDecayWeight injection above).
|
|
933
|
+
const isAdmin = (o.isAdmin === true);
|
|
934
|
+
// Phase 205-03: the optional SENS-10 circularity signal. When fired, the
|
|
935
|
+
// clarify-vs-reframe flip suppresses ASK-as-clarification as the recommended
|
|
936
|
+
// detent. Absent or not-fired => the flip never runs (byte-identical no-op).
|
|
937
|
+
const sens10 = (o.sens10 && typeof o.sens10 === 'object') ? o.sens10 : null;
|
|
938
|
+
// Phase 244 (TRIG-02): the optional cross-family tier-candidate lists.
|
|
939
|
+
// Absent or not-an-array => the fusion pass never runs (byte-identical
|
|
940
|
+
// no-op).
|
|
941
|
+
const tierCandidates = Array.isArray(o.tierCandidates) ? o.tierCandidates : null;
|
|
942
|
+
|
|
943
|
+
// Patch roomState with jtbd / problemType if caller supplied them at the
|
|
944
|
+
// top level but not on roomState. Non-destructive: tests that pass
|
|
945
|
+
// roomState verbatim should see no mutation.
|
|
946
|
+
let effectiveRoomState = roomState;
|
|
947
|
+
if (jtbd && !roomState.activeJtbd) {
|
|
948
|
+
effectiveRoomState = Object.assign({}, roomState, { activeJtbd: jtbd });
|
|
949
|
+
}
|
|
950
|
+
if (problemType && !effectiveRoomState.problemType) {
|
|
951
|
+
effectiveRoomState = Object.assign({}, effectiveRoomState, { problemType });
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
// Snapshot investment level at rank time (D9 invariant: all returned items
|
|
955
|
+
// see the same investment_level).
|
|
956
|
+
//
|
|
957
|
+
// Phase 177-01 (BCH-17): seed the dial DEFAULT from the ignite persona prior
|
|
958
|
+
// before the snapshot. The seed is the floor the dial starts from pre turn-1
|
|
959
|
+
// (a student leans ASK / low, a founder or investor leans TELL / high). The
|
|
960
|
+
// runtime computeInvestmentLevel gradient (framework_invocations + turn_count)
|
|
961
|
+
// can rise ABOVE the seed as the room warms up, but never falls below the
|
|
962
|
+
// persona-default lean -- so the FIRST turn already descends from the right
|
|
963
|
+
// posture. max() biases without erasing accumulated runtime signal. Pure +
|
|
964
|
+
// deterministic; the seed is engine-owned (the model emits no dial).
|
|
965
|
+
const { level: computedLevel } = projections.computeInvestmentLevel(effectiveRoomState);
|
|
966
|
+
// Bias ONLY when an actual persona prior is present. A personaless room keeps
|
|
967
|
+
// its pure runtime gradient (byte-stable with pre-177 behavior); the cold-start
|
|
968
|
+
// neutral seed is never silently injected into a room that declared no role.
|
|
969
|
+
const investment_level = hasIgnitePrior(effectiveRoomState)
|
|
970
|
+
? Math.max(computedLevel, igniteDialSeed(effectiveRoomState))
|
|
971
|
+
: computedLevel;
|
|
972
|
+
|
|
973
|
+
const reg = _loadRegistry();
|
|
974
|
+
const commands = Array.isArray(reg.commands) ? reg.commands : [];
|
|
975
|
+
const scored = [];
|
|
976
|
+
|
|
977
|
+
for (const cmd of commands) {
|
|
978
|
+
if (!cmd || typeof cmd.command !== 'string') continue;
|
|
979
|
+
|
|
980
|
+
// D6 fail-closed: jtbd_summary required.
|
|
981
|
+
const jtbd_summary = (typeof cmd.jtbd_summary === 'string' && cmd.jtbd_summary.length > 0)
|
|
982
|
+
? cmd.jtbd_summary : null;
|
|
983
|
+
if (jtbd_summary === null) continue;
|
|
984
|
+
|
|
985
|
+
// D11 fail-closed: teaching required.
|
|
986
|
+
const teaching = (typeof cmd.teaching === 'string' && cmd.teaching.length > 0)
|
|
987
|
+
? cmd.teaching : null;
|
|
988
|
+
if (teaching === null) continue;
|
|
989
|
+
|
|
990
|
+
// Phase 311 (SEED-052, D-03) fail-closed: admin-visibility filter. Keys
|
|
991
|
+
// on the literal value 'admin', not on presence of a visibility field, so
|
|
992
|
+
// this stays a targeted filter rather than a general visibility gate.
|
|
993
|
+
// The candidate never reaches scored.push(...) below, so it can never
|
|
994
|
+
// appear in the ranked output at any score when the caller has not
|
|
995
|
+
// declared admin.
|
|
996
|
+
if (cmd.visibility === 'admin' && !isAdmin) continue;
|
|
997
|
+
|
|
998
|
+
const jtbd_label = (typeof cmd.jtbd_label === 'string') ? cmd.jtbd_label : '';
|
|
999
|
+
const framework = (Array.isArray(cmd.frameworks) && cmd.frameworks.length > 0)
|
|
1000
|
+
? cmd.frameworks[0] : DEFAULT_SEED;
|
|
1001
|
+
|
|
1002
|
+
const baseScore = _scoreCommand({
|
|
1003
|
+
cmd, packetOptional, roomState: effectiveRoomState, investment_level,
|
|
1004
|
+
});
|
|
1005
|
+
const adjustedScore = _applyDecay(
|
|
1006
|
+
applyDecayWeight, baseScore, cmd.command, effectiveRoomState,
|
|
1007
|
+
);
|
|
1008
|
+
|
|
1009
|
+
const why = selectWhyContent(jtbd_summary, teaching, investment_level);
|
|
1010
|
+
const source = _sourceFor(packetOptional, cmd);
|
|
1011
|
+
|
|
1012
|
+
// Phase 121.5-10 Sub-plan K: optional category + graph_relationship
|
|
1013
|
+
// fields for the locked Brain-suggestion template meta row (audit
|
|
1014
|
+
// Section 5.2.1 Row 2). Non-breaking -- consumers that ignore them get
|
|
1015
|
+
// the same shape they had before; consumers wiring the locked template
|
|
1016
|
+
// (suggest-next, act --chain) read them to compose optionRows[].meta.
|
|
1017
|
+
const category = _categoryFromPacket(packetOptional, cmd);
|
|
1018
|
+
const graph_relationship = _graphRelationshipFromPacket(packetOptional, framework);
|
|
1019
|
+
|
|
1020
|
+
scored.push({
|
|
1021
|
+
command: cmd.command,
|
|
1022
|
+
jtbd_label,
|
|
1023
|
+
jtbd_summary,
|
|
1024
|
+
teaching,
|
|
1025
|
+
framework,
|
|
1026
|
+
score: Math.max(0, Math.min(1, adjustedScore)),
|
|
1027
|
+
why,
|
|
1028
|
+
source,
|
|
1029
|
+
investment_level,
|
|
1030
|
+
category,
|
|
1031
|
+
graph_relationship,
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
// Sort score desc. Stable on ties.
|
|
1036
|
+
scored.sort((a, b) => b.score - a.score);
|
|
1037
|
+
|
|
1038
|
+
// Tier 0 cold-start fallback: when zero eligible commands but k > 0, the
|
|
1039
|
+
// ranker degrades gracefully to []. The HARD PRECONDITION (Phase 104.1
|
|
1040
|
+
// shipped) makes this branch effectively unreachable in production --
|
|
1041
|
+
// every command has the required content. Kept for future-proofing
|
|
1042
|
+
// against registry regressions.
|
|
1043
|
+
if (scored.length === 0) return [];
|
|
1044
|
+
|
|
1045
|
+
// Reference focusNodeId so static linters don't flag it as unused. It is
|
|
1046
|
+
// part of the LOCKED signature for downstream tuning (Phase 117 may pass
|
|
1047
|
+
// it through for hop-depth selection).
|
|
1048
|
+
if (focusNodeId) { /* reserved for future hop-relative scoring */ }
|
|
1049
|
+
|
|
1050
|
+
// Phase 205-05 (item 5): resolve role_level once for the dial-default bias.
|
|
1051
|
+
// null when no signal (cold start) -> the bias is a no-op below.
|
|
1052
|
+
const role_level = _resolveRoleLevel(o, effectiveRoomState);
|
|
1053
|
+
|
|
1054
|
+
// Phase 244 (TRIG-02): fuse cross-family tier candidates against the FULL
|
|
1055
|
+
// pre-slice `scored` list, BEFORE the sens10/slice cut. Fusing after the
|
|
1056
|
+
// slice could never promote a cross-family hit the D4 score buried past
|
|
1057
|
+
// position k. Absent/empty tierCandidates => fused is scored BY REFERENCE
|
|
1058
|
+
// (byte-identical no-op), so the sens10-or-slice branch below lands on
|
|
1059
|
+
// scored.slice(0, k) exactly as it did pre-244.
|
|
1060
|
+
const fused = _applyTierFusion(scored, tierCandidates, k);
|
|
1061
|
+
|
|
1062
|
+
// Phase 244 (TRIG-03): the MMR diversity pass, inserted AFTER fusion and
|
|
1063
|
+
// BEFORE the sens10-or-slice branch -- MMR IS the cut, so it must see the
|
|
1064
|
+
// full fused list before anything removes a candidate from consideration.
|
|
1065
|
+
// Absent multi-family signal (the pre-244 shape, or a fusion pass that
|
|
1066
|
+
// never ran because no tierCandidates were supplied) this is a
|
|
1067
|
+
// byte-identical no-op: `diversified` is `fused` BY REFERENCE, so the
|
|
1068
|
+
// sens10-or-slice branch below lands on exactly the list it did pre-244.
|
|
1069
|
+
const diversified = _applyMmrDiversity(fused, k);
|
|
1070
|
+
|
|
1071
|
+
// Phase 205-03: the SENS-10 anti-circular flip. Runs ONLY when the sensor
|
|
1072
|
+
// fired this turn; otherwise the base slice below is byte-identical to pre-205.
|
|
1073
|
+
// Phase 205-05: the role_level bias is layered ON TOP of whichever list wins
|
|
1074
|
+
// (it does not undo the 205-03 flip; it only stamps the elevation lean).
|
|
1075
|
+
const finalList = (sens10 && sens10.fired === true)
|
|
1076
|
+
? _applySens10Flip(diversified, sens10, k)
|
|
1077
|
+
: diversified.slice(0, k);
|
|
1078
|
+
|
|
1079
|
+
return _applyRoleLevelBias(finalList, role_level);
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
module.exports = {
|
|
1083
|
+
rankForSelector,
|
|
1084
|
+
selectWhyContent,
|
|
1085
|
+
renderInvestmentBadge,
|
|
1086
|
+
renderSliceBadge,
|
|
1087
|
+
renderNoneFitAffordance,
|
|
1088
|
+
// Phase 121.5-10 Sub-plan K: MAX_K constant exported so consumers wiring
|
|
1089
|
+
// the locked Brain-suggestion template know the row-budget cap (audit
|
|
1090
|
+
// Section 5.2.3 anti-pattern enforcement).
|
|
1091
|
+
MAX_K,
|
|
1092
|
+
// Phase 177-01 (BCH-05/06): the behavioral-channel thresholds. Exported so the
|
|
1093
|
+
// test and later-wave seams read the engine-owned numbers; they appear in NO
|
|
1094
|
+
// prompt. CEILING is computed from the Brain floor (>= 15 points above).
|
|
1095
|
+
BEHAVIORAL_CHANNEL_FLOOR,
|
|
1096
|
+
BEHAVIORAL_CHANNEL_CEILING,
|
|
1097
|
+
BEHAVIORAL_CHANNEL_MARGIN,
|
|
1098
|
+
// Phase 177-01 (BCH-17): the deterministic ignite-persona dial seed + its
|
|
1099
|
+
// prior predicate. Exported so the test (and the later-wave Pass-2 prose
|
|
1100
|
+
// injection) read the engine-owned seed. The model emits no dial.
|
|
1101
|
+
igniteDialSeed,
|
|
1102
|
+
hasIgnitePrior,
|
|
1103
|
+
// Phase 205-05 (item 5): the role_level dial-default + elevation-emphasis bias
|
|
1104
|
+
// (no quotas). Exported so consumers + the test read the engine-owned bias.
|
|
1105
|
+
_resolveRoleLevel,
|
|
1106
|
+
_applyRoleLevelBias,
|
|
1107
|
+
// Phase 244 (TRIG-02): the optional cross-family rank-fusion pass + its
|
|
1108
|
+
// dedicated k. Exported (not _test-only, mirroring _applyRoleLevelBias
|
|
1109
|
+
// above) so consumers and tests read the engine-owned values directly.
|
|
1110
|
+
_applyTierFusion,
|
|
1111
|
+
TRIG_RRF_K,
|
|
1112
|
+
// Phase 244 (TRIG-03): the MMR diversity pass + its lambda constant.
|
|
1113
|
+
// Exported (not _test-only, mirroring _applyTierFusion above) so
|
|
1114
|
+
// consumers and tests read the engine-owned values directly.
|
|
1115
|
+
_applyMmrDiversity,
|
|
1116
|
+
MMR_LAMBDA_RELEVANCE,
|
|
1117
|
+
// Test seam (private; consumed only by lib/memory/f-selector-ranker.test.cjs).
|
|
1118
|
+
_test: {
|
|
1119
|
+
_resetCaches,
|
|
1120
|
+
_setRegistry,
|
|
1121
|
+
_setTaxonomy,
|
|
1122
|
+
_scoreCommand,
|
|
1123
|
+
_brainConfidenceFromPacket,
|
|
1124
|
+
_resolveJtbdForCommand,
|
|
1125
|
+
_sourceFor,
|
|
1126
|
+
_applyDecay,
|
|
1127
|
+
_recencyDecay,
|
|
1128
|
+
_problemTypeBind,
|
|
1129
|
+
_categoryFromPacket,
|
|
1130
|
+
_graphRelationshipFromPacket,
|
|
1131
|
+
// Phase 205-03: the SENS-10 anti-circular flip (clarify-vs-reframe).
|
|
1132
|
+
_applySens10Flip,
|
|
1133
|
+
SENS10_DEFAULT_REFRAME_COMMAND,
|
|
1134
|
+
SENS10_REFRAME_FRAMEWORK,
|
|
1135
|
+
DEFAULT_SEED,
|
|
1136
|
+
MAX_K,
|
|
1137
|
+
// Phase 177-01 (BCH-17) ignite-persona seed internals.
|
|
1138
|
+
_topRoleFromBlend,
|
|
1139
|
+
_normalizeRoleKey,
|
|
1140
|
+
igniteDialSeed,
|
|
1141
|
+
hasIgnitePrior,
|
|
1142
|
+
IGNITE_SEED_ASK,
|
|
1143
|
+
IGNITE_SEED_NEUTRAL,
|
|
1144
|
+
IGNITE_SEED_TELL,
|
|
1145
|
+
BEHAVIORAL_CHANNEL_FLOOR,
|
|
1146
|
+
BEHAVIORAL_CHANNEL_CEILING,
|
|
1147
|
+
},
|
|
1148
|
+
};
|