ctxtop 4.1.0 โ 4.1.1
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/.antigravity-plugin/plugin.json +1 -1
- package/.claude-plugin/plugin.json +21 -18
- package/CHECKSUMS.sha256 +51 -44
- package/LICENSE +27 -27
- package/README.md +90 -56
- package/SECURITY.md +7 -1
- package/assets/hero-demo.svg +1 -1
- package/bin/ctxtop.mjs +267 -54
- package/config/modelCatalog.json +847 -273
- package/hooks/handlers/hookIpcClient.mjs +8 -4
- package/hooks/handlers/post-model-switch.mjs +39 -2
- package/hooks/handlers/post-tool-use-core.mjs +394 -0
- package/hooks/handlers/post-tool-use.mjs +54 -321
- package/hooks/handlers/pre-model-switch.mjs +115 -5
- package/hooks/handlers/pre-tool-use-core.mjs +680 -0
- package/hooks/handlers/pre-tool-use.mjs +61 -571
- package/hooks/handlers/stop-gate.mjs +20 -8
- package/hooks/handlers/user-prompt-submit.mjs +111 -2
- package/hooks/post_tool_use.mjs +17 -4
- package/hooks/pre_tool_use.mjs +84 -54
- package/hooks.json +56 -56
- package/package.json +4 -3
- package/packages/antigravity/package.json +10 -3
- package/packages/antigravity/src/adapter.mjs +109 -0
- package/packages/antigravity/src/index.mjs +7 -1
- package/packages/claude-code/package.json +10 -3
- package/packages/claude-code/src/adapter.mjs +194 -0
- package/packages/claude-code/src/index.mjs +8 -2
- package/packages/claude-code/src/register.js +726 -0
- package/packages/core/package.json +6 -2
- package/packages/core/src/catalog/detectorCatalog.mjs +558 -0
- package/packages/core/src/catalog/index.mjs +1 -0
- package/packages/core/src/catalog/safeguardGuide.mjs +412 -0
- package/packages/core/src/coach/cacheGravityRouter.mjs +1547 -0
- package/packages/core/src/coach/effortShiftDetector.mjs +316 -0
- package/packages/core/src/coach/microSkills.mjs +1 -0
- package/packages/core/src/coach/promptHygieneGovernor.mjs +1 -0
- package/packages/core/src/coach/repoCalibration.mjs +254 -0
- package/packages/core/src/coach/resumeToolsetAuditor.mjs +321 -0
- package/packages/core/src/coach/savedQuotaLedger.mjs +527 -0
- package/packages/core/src/coach/smartCompactAdvisor.mjs +339 -0
- package/packages/core/src/coach/stateBatonHydrator.mjs +810 -0
- package/packages/core/src/coach/ttlWatchdog.mjs +464 -0
- package/packages/core/src/config/anthropicModelCatalog.json +607 -0
- package/packages/core/src/config/catalogLoader.mjs +1271 -0
- package/packages/core/src/config/horizonConfig.mjs +1055 -0
- package/packages/core/src/control/callTree.mjs +338 -0
- package/packages/core/src/control/coachLatches.mjs +126 -0
- package/packages/core/src/control/controlStateMachine.mjs +205 -0
- package/packages/core/src/control/index.mjs +49 -0
- package/packages/core/src/control/swarmWorktree.mjs +109 -0
- package/packages/core/src/control/toolSuspension.mjs +197 -0
- package/packages/core/src/diagnostics/drift_guard.mjs +382 -0
- package/packages/core/src/diagnostics/index.mjs +9 -0
- package/packages/core/src/diagnostics/micro_skills.mjs +471 -0
- package/packages/core/src/diagnostics/prompt_hygiene_governor.mjs +888 -0
- package/packages/core/src/economics/billingBlocks.mjs +251 -0
- package/packages/core/src/economics/cacheGravity.mjs +371 -0
- package/packages/core/src/economics/cliffBreaker.mjs +256 -0
- package/packages/core/src/economics/driftLatency.mjs +433 -0
- package/packages/core/src/economics/dualTtl.mjs +198 -0
- package/packages/core/src/economics/index.mjs +47 -0
- package/packages/core/src/economics/retentionRadar.mjs +348 -0
- package/packages/core/src/economics/shadowAutoModel.mjs +228 -0
- package/packages/core/src/guards/bucketBAlphaBeta.mjs +860 -0
- package/packages/core/src/guards/bucketBGamma.mjs +442 -0
- package/packages/core/src/guards/bucketBHeuristics.mjs +37 -0
- package/packages/core/src/guards/circuitBreakers.mjs +1202 -0
- package/packages/core/src/guards/det01_03_shell_secret.mjs +1184 -0
- package/packages/core/src/guards/det04_12_thrash_rot.mjs +572 -0
- package/packages/core/src/guards/det13_20_mcp_scope.mjs +913 -0
- package/packages/core/src/guards/docIndexCore.mjs +446 -0
- package/packages/core/src/guards/losslessPostSanitizer.mjs +317 -0
- package/packages/core/src/guards/slopsquatGate.mjs +551 -0
- package/packages/core/src/index.js +27 -0
- package/packages/core/src/index.mjs +25 -1
- package/packages/core/src/telemetry/otelExporter.mjs +187 -0
- package/packages/core/src/telemetry/scopeLockRegistry.mjs +522 -0
- package/packages/core/src/telemetry/sprintMetrics.mjs +327 -0
- package/packages/core/src/telemetry/swarmTopology.mjs +152 -0
- package/packages/core/src/telemetry/telemetryBridge.mjs +1232 -0
- package/packages/core/src/ui/brailleSparkline.mjs +142 -0
- package/packages/core/src/ui/costRadarSvg.mjs +276 -0
- package/packages/core/src/ui/horizonGrid.mjs +475 -0
- package/packages/core/src/ui/horizonPanelHtml.mjs +1502 -0
- package/packages/core/src/ui/modViews.mjs +1558 -0
- package/packages/core/src/ui/pdfReceiptGenerator.mjs +329 -0
- package/packages/core/src/ustf/index.mjs +7 -0
- package/packages/core/src/ustf/normalizer.mjs +512 -0
- package/packages/core/src/ustf/schema.mjs +186 -0
- package/packages/core/src/utils/runtime.mjs +962 -0
- package/packages/engine-node/package.json +6 -2
- package/packages/engine-node/src/db/index.mjs +58 -0
- package/packages/engine-node/src/db/jsonl_fallback.mjs +184 -0
- package/packages/engine-node/src/db/probe.mjs +342 -0
- package/packages/engine-node/src/db/sqlite_wrapper.mjs +122 -0
- package/packages/engine-node/src/index.mjs +11 -1
- package/packages/engine-node/src/ipc/client.mjs +447 -0
- package/packages/engine-node/src/ipc/fast_client.mjs +191 -0
- package/packages/engine-node/src/ipc/index.mjs +24 -0
- package/packages/engine-node/src/ipc/protocol.mjs +177 -0
- package/packages/engine-node/src/ipc/server.mjs +445 -0
- package/packages/engine-node/src/multi_host_mcp.mjs +168 -0
- package/packages/engine-node/src/offloader/index.mjs +6 -0
- package/packages/engine-node/src/offloader/tool_offloader.mjs +241 -0
- package/packages/engine-node/src/rsl/index.mjs +3 -0
- package/packages/engine-node/src/sensors/blindspots.mjs +376 -0
- package/packages/engine-node/src/sensors/git_merge_tree.mjs +223 -0
- package/packages/engine-node/src/sensors/index.mjs +7 -0
- package/packages/engine-node/src/vendor/config/default_flightcheck.json +133 -0
- package/packages/engine-node/src/vendor/config/modelCatalog.json +1359 -0
- package/packages/engine-node/src/vendor/config/platformQuirks.json +19 -0
- package/packages/engine-node/src/vendor/core/atomic_io.mjs +124 -0
- package/packages/engine-node/src/vendor/core/constants.mjs +2150 -0
- package/packages/engine-node/src/vendor/core/doc_indexer.mjs +338 -0
- package/packages/engine-node/src/vendor/core/rsl_clash_auditor.mjs +423 -0
- package/packages/engine-node/src/vendor/core/rsl_distiller.mjs +394 -0
- package/packages/engine-node/src/vendor/core/rsl_ledger.mjs +1029 -0
- package/packages/engine-node/src/vendor/core/rsl_triage.mjs +1051 -0
- package/packages/engine-node/src/vendor/core/shield_manager.mjs +1417 -0
- package/packages/engine-node/src/vendor/core-isomorphic/catalog/detectorCatalog.mjs +558 -0
- package/packages/engine-node/src/vendor/core-isomorphic/catalog/index.mjs +1 -0
- package/packages/engine-node/src/vendor/core-isomorphic/catalog/safeguardGuide.mjs +412 -0
- package/packages/engine-node/src/vendor/core-isomorphic/coach/cacheGravityRouter.mjs +1547 -0
- package/packages/engine-node/src/vendor/core-isomorphic/coach/effortShiftDetector.mjs +316 -0
- package/packages/engine-node/src/vendor/core-isomorphic/coach/microSkills.mjs +1 -0
- package/packages/engine-node/src/vendor/core-isomorphic/coach/promptHygieneGovernor.mjs +1 -0
- package/packages/engine-node/src/vendor/core-isomorphic/coach/repoCalibration.mjs +254 -0
- package/packages/engine-node/src/vendor/core-isomorphic/coach/resumeToolsetAuditor.mjs +321 -0
- package/packages/engine-node/src/vendor/core-isomorphic/coach/savedQuotaLedger.mjs +527 -0
- package/packages/engine-node/src/vendor/core-isomorphic/coach/smartCompactAdvisor.mjs +339 -0
- package/packages/engine-node/src/vendor/core-isomorphic/coach/stateBatonHydrator.mjs +810 -0
- package/packages/engine-node/src/vendor/core-isomorphic/coach/ttlWatchdog.mjs +464 -0
- package/packages/engine-node/src/vendor/core-isomorphic/config/anthropicModelCatalog.json +607 -0
- package/packages/engine-node/src/vendor/core-isomorphic/config/catalogLoader.mjs +1271 -0
- package/packages/engine-node/src/vendor/core-isomorphic/config/horizonConfig.mjs +1055 -0
- package/packages/engine-node/src/vendor/core-isomorphic/control/callTree.mjs +338 -0
- package/packages/engine-node/src/vendor/core-isomorphic/control/coachLatches.mjs +126 -0
- package/packages/engine-node/src/vendor/core-isomorphic/control/controlStateMachine.mjs +205 -0
- package/packages/engine-node/src/vendor/core-isomorphic/control/index.mjs +49 -0
- package/packages/engine-node/src/vendor/core-isomorphic/control/swarmWorktree.mjs +109 -0
- package/packages/engine-node/src/vendor/core-isomorphic/control/toolSuspension.mjs +197 -0
- package/packages/engine-node/src/vendor/core-isomorphic/diagnostics/drift_guard.mjs +382 -0
- package/packages/engine-node/src/vendor/core-isomorphic/diagnostics/index.mjs +9 -0
- package/packages/engine-node/src/vendor/core-isomorphic/diagnostics/micro_skills.mjs +471 -0
- package/packages/engine-node/src/vendor/core-isomorphic/diagnostics/prompt_hygiene_governor.mjs +888 -0
- package/packages/engine-node/src/vendor/core-isomorphic/economics/billingBlocks.mjs +251 -0
- package/packages/engine-node/src/vendor/core-isomorphic/economics/cacheGravity.mjs +371 -0
- package/packages/engine-node/src/vendor/core-isomorphic/economics/cliffBreaker.mjs +256 -0
- package/packages/engine-node/src/vendor/core-isomorphic/economics/driftLatency.mjs +433 -0
- package/packages/engine-node/src/vendor/core-isomorphic/economics/dualTtl.mjs +198 -0
- package/packages/engine-node/src/vendor/core-isomorphic/economics/index.mjs +47 -0
- package/packages/engine-node/src/vendor/core-isomorphic/economics/retentionRadar.mjs +348 -0
- package/packages/engine-node/src/vendor/core-isomorphic/economics/shadowAutoModel.mjs +228 -0
- package/packages/engine-node/src/vendor/core-isomorphic/guards/bucketBAlphaBeta.mjs +860 -0
- package/packages/engine-node/src/vendor/core-isomorphic/guards/bucketBGamma.mjs +442 -0
- package/packages/engine-node/src/vendor/core-isomorphic/guards/bucketBHeuristics.mjs +37 -0
- package/packages/engine-node/src/vendor/core-isomorphic/guards/circuitBreakers.mjs +1202 -0
- package/packages/engine-node/src/vendor/core-isomorphic/guards/det01_03_shell_secret.mjs +1184 -0
- package/packages/engine-node/src/vendor/core-isomorphic/guards/det04_12_thrash_rot.mjs +572 -0
- package/packages/engine-node/src/vendor/core-isomorphic/guards/det13_20_mcp_scope.mjs +913 -0
- package/packages/engine-node/src/vendor/core-isomorphic/guards/docIndexCore.mjs +446 -0
- package/packages/engine-node/src/vendor/core-isomorphic/guards/losslessPostSanitizer.mjs +317 -0
- package/packages/engine-node/src/vendor/core-isomorphic/guards/slopsquatGate.mjs +551 -0
- package/packages/engine-node/src/vendor/core-isomorphic/index.js +27 -0
- package/packages/engine-node/src/vendor/core-isomorphic/telemetry/otelExporter.mjs +187 -0
- package/packages/engine-node/src/vendor/core-isomorphic/telemetry/scopeLockRegistry.mjs +522 -0
- package/packages/engine-node/src/vendor/core-isomorphic/telemetry/sprintMetrics.mjs +327 -0
- package/packages/engine-node/src/vendor/core-isomorphic/telemetry/swarmTopology.mjs +152 -0
- package/packages/engine-node/src/vendor/core-isomorphic/telemetry/telemetryBridge.mjs +1232 -0
- package/packages/engine-node/src/vendor/core-isomorphic/ui/brailleSparkline.mjs +142 -0
- package/packages/engine-node/src/vendor/core-isomorphic/ui/costRadarSvg.mjs +276 -0
- package/packages/engine-node/src/vendor/core-isomorphic/ui/horizonGrid.mjs +475 -0
- package/packages/engine-node/src/vendor/core-isomorphic/ui/horizonPanelHtml.mjs +1502 -0
- package/packages/engine-node/src/vendor/core-isomorphic/ui/modViews.mjs +1558 -0
- package/packages/engine-node/src/vendor/core-isomorphic/ui/pdfReceiptGenerator.mjs +329 -0
- package/packages/engine-node/src/vendor/core-isomorphic/ustf/index.mjs +7 -0
- package/packages/engine-node/src/vendor/core-isomorphic/ustf/normalizer.mjs +512 -0
- package/packages/engine-node/src/vendor/core-isomorphic/ustf/schema.mjs +186 -0
- package/packages/engine-node/src/vendor/core-isomorphic/utils/runtime.mjs +962 -0
- package/packages/mcp/package.json +7 -3
- package/packages/mcp/src/server.mjs +115 -14
- package/packages/mcp/src/vendor/config/default_flightcheck.json +133 -0
- package/packages/mcp/src/vendor/config/modelCatalog.json +1359 -0
- package/packages/mcp/src/vendor/config/platformQuirks.json +19 -0
- package/packages/mcp/src/vendor/core/atomic_io.mjs +124 -0
- package/packages/mcp/src/vendor/core/coach/saved_quota_ledger.mjs +615 -0
- package/packages/mcp/src/vendor/core/constants.mjs +2150 -0
- package/packages/mcp/src/vendor/core/doc_indexer.mjs +338 -0
- package/packages/mcp/src/vendor/core/fts5_output_compressor.mjs +596 -0
- package/packages/mcp/src/vendor/core/hook_diagnostics.mjs +158 -0
- package/packages/mcp/src/vendor/core/paths.mjs +311 -0
- package/packages/mcp/src/vendor/core/session_auditor.mjs +1109 -0
- package/packages/mcp/src/vendor/core/sqlite_client.mjs +289 -0
- package/packages/mcp/src/vendor/core/telemetry/scope_lock_registry.mjs +578 -0
- package/packages/mcp/src/vendor/core-isomorphic/catalog/detectorCatalog.mjs +558 -0
- package/packages/mcp/src/vendor/core-isomorphic/catalog/index.mjs +1 -0
- package/packages/mcp/src/vendor/core-isomorphic/catalog/safeguardGuide.mjs +412 -0
- package/packages/mcp/src/vendor/core-isomorphic/coach/cacheGravityRouter.mjs +1547 -0
- package/packages/mcp/src/vendor/core-isomorphic/coach/effortShiftDetector.mjs +316 -0
- package/packages/mcp/src/vendor/core-isomorphic/coach/microSkills.mjs +1 -0
- package/packages/mcp/src/vendor/core-isomorphic/coach/promptHygieneGovernor.mjs +1 -0
- package/packages/mcp/src/vendor/core-isomorphic/coach/repoCalibration.mjs +254 -0
- package/packages/mcp/src/vendor/core-isomorphic/coach/resumeToolsetAuditor.mjs +321 -0
- package/packages/mcp/src/vendor/core-isomorphic/coach/savedQuotaLedger.mjs +527 -0
- package/packages/mcp/src/vendor/core-isomorphic/coach/smartCompactAdvisor.mjs +339 -0
- package/packages/mcp/src/vendor/core-isomorphic/coach/stateBatonHydrator.mjs +810 -0
- package/packages/mcp/src/vendor/core-isomorphic/coach/ttlWatchdog.mjs +464 -0
- package/packages/mcp/src/vendor/core-isomorphic/config/anthropicModelCatalog.json +607 -0
- package/packages/mcp/src/vendor/core-isomorphic/config/catalogLoader.mjs +1271 -0
- package/packages/mcp/src/vendor/core-isomorphic/config/horizonConfig.mjs +1055 -0
- package/packages/mcp/src/vendor/core-isomorphic/control/callTree.mjs +338 -0
- package/packages/mcp/src/vendor/core-isomorphic/control/coachLatches.mjs +126 -0
- package/packages/mcp/src/vendor/core-isomorphic/control/controlStateMachine.mjs +205 -0
- package/packages/mcp/src/vendor/core-isomorphic/control/index.mjs +49 -0
- package/packages/mcp/src/vendor/core-isomorphic/control/swarmWorktree.mjs +109 -0
- package/packages/mcp/src/vendor/core-isomorphic/control/toolSuspension.mjs +197 -0
- package/packages/mcp/src/vendor/core-isomorphic/diagnostics/drift_guard.mjs +382 -0
- package/packages/mcp/src/vendor/core-isomorphic/diagnostics/index.mjs +9 -0
- package/packages/mcp/src/vendor/core-isomorphic/diagnostics/micro_skills.mjs +471 -0
- package/packages/mcp/src/vendor/core-isomorphic/diagnostics/prompt_hygiene_governor.mjs +888 -0
- package/packages/mcp/src/vendor/core-isomorphic/economics/billingBlocks.mjs +251 -0
- package/packages/mcp/src/vendor/core-isomorphic/economics/cacheGravity.mjs +371 -0
- package/packages/mcp/src/vendor/core-isomorphic/economics/cliffBreaker.mjs +256 -0
- package/packages/mcp/src/vendor/core-isomorphic/economics/driftLatency.mjs +433 -0
- package/packages/mcp/src/vendor/core-isomorphic/economics/dualTtl.mjs +198 -0
- package/packages/mcp/src/vendor/core-isomorphic/economics/index.mjs +47 -0
- package/packages/mcp/src/vendor/core-isomorphic/economics/retentionRadar.mjs +348 -0
- package/packages/mcp/src/vendor/core-isomorphic/economics/shadowAutoModel.mjs +228 -0
- package/packages/mcp/src/vendor/core-isomorphic/guards/bucketBAlphaBeta.mjs +860 -0
- package/packages/mcp/src/vendor/core-isomorphic/guards/bucketBGamma.mjs +442 -0
- package/packages/mcp/src/vendor/core-isomorphic/guards/bucketBHeuristics.mjs +37 -0
- package/packages/mcp/src/vendor/core-isomorphic/guards/circuitBreakers.mjs +1202 -0
- package/packages/mcp/src/vendor/core-isomorphic/guards/det01_03_shell_secret.mjs +1184 -0
- package/packages/mcp/src/vendor/core-isomorphic/guards/det04_12_thrash_rot.mjs +572 -0
- package/packages/mcp/src/vendor/core-isomorphic/guards/det13_20_mcp_scope.mjs +913 -0
- package/packages/mcp/src/vendor/core-isomorphic/guards/docIndexCore.mjs +446 -0
- package/packages/mcp/src/vendor/core-isomorphic/guards/losslessPostSanitizer.mjs +317 -0
- package/packages/mcp/src/vendor/core-isomorphic/guards/slopsquatGate.mjs +551 -0
- package/packages/mcp/src/vendor/core-isomorphic/index.js +27 -0
- package/packages/mcp/src/vendor/core-isomorphic/telemetry/otelExporter.mjs +187 -0
- package/packages/mcp/src/vendor/core-isomorphic/telemetry/scopeLockRegistry.mjs +522 -0
- package/packages/mcp/src/vendor/core-isomorphic/telemetry/sprintMetrics.mjs +327 -0
- package/packages/mcp/src/vendor/core-isomorphic/telemetry/swarmTopology.mjs +152 -0
- package/packages/mcp/src/vendor/core-isomorphic/telemetry/telemetryBridge.mjs +1232 -0
- package/packages/mcp/src/vendor/core-isomorphic/ui/brailleSparkline.mjs +142 -0
- package/packages/mcp/src/vendor/core-isomorphic/ui/costRadarSvg.mjs +276 -0
- package/packages/mcp/src/vendor/core-isomorphic/ui/horizonGrid.mjs +475 -0
- package/packages/mcp/src/vendor/core-isomorphic/ui/horizonPanelHtml.mjs +1502 -0
- package/packages/mcp/src/vendor/core-isomorphic/ui/modViews.mjs +1558 -0
- package/packages/mcp/src/vendor/core-isomorphic/ui/pdfReceiptGenerator.mjs +329 -0
- package/packages/mcp/src/vendor/core-isomorphic/ustf/index.mjs +7 -0
- package/packages/mcp/src/vendor/core-isomorphic/ustf/normalizer.mjs +512 -0
- package/packages/mcp/src/vendor/core-isomorphic/ustf/schema.mjs +186 -0
- package/packages/mcp/src/vendor/core-isomorphic/utils/runtime.mjs +962 -0
- package/packages/mcp/src/vendor/engine-node/db/probe.mjs +342 -0
- package/packages/mcp/src/vendor/pro/pro_license.mjs +547 -0
- package/packages/pro/package.json +23 -16
- package/packages/pro/src/index.mjs +9 -3
- package/packages/pro/src/pro_license.mjs +547 -0
- package/packages/pro/src/team_finops_pack.mjs +241 -241
- package/packages/pro/workers/polar_webhook_worker.mjs +219 -215
- package/plugin.json +1 -1
- package/sidecars/horizon-daemon/server.mjs +482 -44
- package/src/cli/doctor.mjs +11 -2
- package/src/cli/horizon_hud.mjs +31 -15
- package/src/cli/init.mjs +46 -13
- package/src/config/modelCatalog.json +886 -231
- package/src/core/classifier.mjs +25 -11
- package/src/core/coach/circuit_breakers.mjs +84 -6
- package/src/core/coach/task_quota_router.mjs +8 -0
- package/src/core/code_fold_lite.mjs +169 -0
- package/src/core/config.mjs +44 -0
- package/src/core/constants.mjs +175 -12
- package/src/core/detectors_det01_to_16.mjs +44 -3
- package/src/core/fts5_output_compressor.mjs +272 -35
- package/src/core/horizon_config.mjs +42 -0
- package/src/core/parser.mjs +86 -11
- package/src/core/pro_license.mjs +174 -12
- package/src/core/pruner.mjs +7 -146
- package/src/core/quota.mjs +14 -2
- package/src/core/rsl_distiller.mjs +31 -9
- package/src/core/rsl_ledger.mjs +66 -6
- package/src/core/rsl_triage.mjs +159 -17
- package/src/core/session_auditor.mjs +476 -25
- package/src/core/shadow_auto_ledger.mjs +205 -0
- package/src/core/sqlite_client.mjs +10 -4
- package/src/core/subagents.mjs +18 -2
- package/src/core/task_quota_router.mjs +61 -4
- package/src/core-isomorphic/catalog/safeguardGuide.mjs +412 -0
- package/src/core-isomorphic/coach/effortShiftDetector.mjs +316 -0
- package/src/core-isomorphic/coach/smartCompactAdvisor.mjs +54 -20
- package/src/core-isomorphic/config/anthropicModelCatalog.json +1 -0
- package/src/core-isomorphic/config/catalogLoader.mjs +6 -3
- package/src/core-isomorphic/config/horizonConfig.mjs +1 -1
- package/src/core-isomorphic/economics/cacheGravity.mjs +3 -1
- package/src/core-isomorphic/economics/shadowAutoModel.mjs +228 -0
- package/src/core-isomorphic/guards/bucketBGamma.mjs +1 -1
- package/src/core-isomorphic/telemetry/telemetryBridge.mjs +77 -1
- package/src/core-isomorphic/ui/horizonPanelHtml.mjs +395 -130
- package/src/core-isomorphic/ui/modViews.mjs +62 -8
- package/src/diagnostics/claudeHookCapabilities.mjs +32 -2
- package/src/diagnostics/doctorEngine.mjs +28 -2
- package/src/engine-node/ipc/fast_client.mjs +191 -0
- package/src/engine-node/ipc/index.mjs +2 -0
- package/src/engine-node/multi_host_mcp.mjs +168 -0
- package/src/hooks/antigravity_rsl_hook.mjs +24 -2
- package/src/hooks/claude_rsl_hook.mjs +22 -2
- package/src/hooks/daemon_hook_bridge.mjs +256 -0
- package/src/hooks/fast_hook_ipc.mjs +295 -0
- package/src/hooks/post_invocation.mjs +37 -597
- package/src/hooks/post_invocation_core.mjs +623 -0
- package/src/hooks/pre_invocation.mjs +103 -1668
- package/src/hooks/pre_invocation_core.mjs +1830 -0
- package/src/utils/sessionCalibration.mjs +52 -5
- package/src/webview/advanced_view.html +34 -18
- package/src/webview/horizon_panel.html +3233 -675
- package/src/webview/simple_view.html +1 -1
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
# Highbeam (ctxtop v4.
|
|
3
|
+
# Highbeam (`ctxtop` v4.1) โ Active Context Surgeon, KV-Cache Shield & Token FinOps for Claude Code, Google Antigravity & MCP Hosts
|
|
4
4
|
|
|
5
|
-
**Local Context Window Profiler, KV-Cache TTL Monitor & Deterministic PreInvocation / PreToolUse Surgeon (`~0.
|
|
5
|
+
**Local Context Window Profiler, KV-Cache TTL Monitor, Multi-Family FTS5 Output Compressor & Deterministic PreInvocation / PreToolUse Surgeon (`~0.1โ2.9ms` avg Tier-1 In-Process ยท `~58ms` Warm IPC / `~105ms` Cold Windows Tier-2 Hook) across Google Antigravity, Claude Code, Codex CLI, Gemini CLI & Cursor**
|
|
6
6
|
|
|
7
7
|
[](#systems-architecture--zero-trust-security)
|
|
8
|
-
[](#
|
|
8
|
+
[](#deterministic-preinvocation-router--6-local-sensors)
|
|
9
|
+
[](#try-in-10-seconds-zero-hooks--zero-writes)
|
|
10
10
|
[](LICENSE)
|
|
11
|
-
[](#-installation--quick-start)
|
|
12
12
|
|
|
13
|
-
[**Live Interactive Demo**](https://gizzant.github.io/attention-horizon-antigravity/) โข [**Quick Start**](#-installation--quick-start) โข [**Cookbook
|
|
13
|
+
[**Live Interactive Demo**](https://gizzant.github.io/attention-horizon-antigravity/) โข [**10-Second 5-Host Audit**](#try-in-10-seconds-zero-hooks--zero-writes) โข [**Quick Start**](#-installation--quick-start) โข [**Cookbook**](docs/COOKBOOK.md) โข [**Benchmarks**](docs/ANTIGRAVITY_AND_COMPRESSION_BENCHMARK.md) โข [**Enterprise MDM**](docs/ENTERPRISE_MDM.md)
|
|
14
14
|
|
|
15
15
|
<br/>
|
|
16
16
|
|
|
@@ -20,33 +20,52 @@
|
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
## โก
|
|
23
|
+
## โก Try in 10 Seconds (Zero Hooks / Zero Writes)
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
Before installing any hooks or modifying config files, scan your last 7 days of local **Google Antigravity**, **Claude Code**, **OpenAI Codex CLI**, **Gemini CLI**, and **Cursor** sessions strictly read-only to measure preventable token waste, cold-cache spikes, and oversized tool dumps:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx ctxtop audit --days 7
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
[Highbeam Session ROI Audit] Window: 7d | Platform: all | Sessions: 12
|
|
33
|
+
Sludge Tax Preventable : 1,420,850 tok ($2.84 USD)
|
|
34
|
+
Cold-Cache Spikes (>5m): 14 | 3x Thrash Loops: 4
|
|
35
|
+
Un-Sliced Large Reads : 11 | Oversized Tool Dumps: 38
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## ๐ Installation & Quick Start
|
|
41
|
+
|
|
42
|
+
| **Google Antigravity** *(1-Line Install)* | **Claude Code** *(1-Line Install)* | **Cursor / Windsurf / Codex / Gemini CLI** |
|
|
43
|
+
| :--- | :--- | :--- |
|
|
27
44
|
| ```bash
|
|
28
45
|
npx ctxtop init
|
|
29
46
|
``` | ```bash
|
|
30
|
-
npx ctxtop install --
|
|
47
|
+
npx ctxtop install --global
|
|
48
|
+
``` | ```bash
|
|
49
|
+
npx ctxtop init --cursor --windsurf --codex --gemini-cli
|
|
31
50
|
``` |
|
|
32
|
-
| *Workspace-only*: `npx ctxtop init --workspace`<br/>*Health check*: `npx ctxtop doctor` | *StatusLine HUD*: `npx
|
|
51
|
+
| *Workspace-only*: `npx ctxtop init --workspace`<br/>*Health check*: `npx ctxtop doctor` | *StatusLine HUD*: `npx ctxtop statusline --demo`<br/>*In-chat pane*: `/horizon` ยท `/cost-radar` ยท `/handoff` | *Universal `.mcp.json`*: `npx ctxtop init --all-hosts`<br/>*FTS5 search*: `npx ctxtop search "<keyword>"` |
|
|
33
52
|
|
|
34
53
|
### Your First 5 Minutes After Installing
|
|
35
54
|
|
|
36
55
|
#### 1. Google Antigravity Workflow
|
|
37
56
|
1. **Install hooks & sidecar**: Run `npx ctxtop init` in your project root (or globally).
|
|
38
|
-
2. **Open the Highbeam Sidepane**: Launch the local telemetry WebView (`npx ctxtop
|
|
57
|
+
2. **Open the Highbeam Sidepane**: Launch the local telemetry WebView (`npx ctxtop ui` or via the Antigravity sidepane) to view real-time context health:
|
|
39
58
|
- **Simple View (Default)**: 4 glanceable zonesโ**Zone A** (Safe Headroom & Warm KV Cache TTL), **Zone B** (`DO / AVOID / HOLD` Model & Effort switch guidance), **Zone C** (Live automated interventions), and **Zone D** (Verified tokens/USD saved + 1-click `/compact`).
|
|
40
|
-
- **Advanced View (1-Click Toggle)**: Expands the **40-Cell Chrono-Positional Recall Grid** (`Primacy 0โ30%`, `Mid-Trough 30โ70%`, `Recency 70โ100%`), top token consumer file table, `Off / Coach / Auto
|
|
59
|
+
- **Advanced View (1-Click Toggle)**: Expands the **40-Cell Chrono-Positional Recall Grid** (`Primacy 0โ30%`, `Mid-Trough 30โ70%`, `Recency 70โ100%`), top token consumer file table, `Off / Coach / Auto` mode switcher, and the full `DET-01..32` guard log.
|
|
41
60
|
3. **Code normally**: Highbeam runs in **`COACH` mode** by defaultโautomatically compressing verbose CLI test dumps via SQLite FTS5 and folding repeat file reads without interrupting your prompts.
|
|
42
61
|
|
|
43
62
|
#### 2. Claude Code Workflow
|
|
44
|
-
1. **Install plugin & hooks**: Run `npx ctxtop install --claude` to wire `.claude-plugin/plugin.json`, `hooks/hooks.json`, and the live terminal `statusLine`.
|
|
63
|
+
1. **Install plugin & hooks**: Run `npx ctxtop install --global` (or `npx ctxtop init --claude`) to wire `.claude-plugin/plugin.json`, `hooks/hooks.json`, and the live terminal `statusLine`.
|
|
45
64
|
2. **Watch the Live Terminal `statusLine`**: At the bottom of your terminal, Highbeam renders an auto-adapting (`80 / 110 / 144` col) telemetry bar:
|
|
46
65
|
```text
|
|
47
66
|
AH [SCCCCCCC................] sonnet-5-5 64k/200k (32%) ยท Cache 88% (4m12s) ยท COACH ยท Saved $1.84
|
|
48
67
|
```
|
|
49
|
-
3. **Open the In-Chat Docked HUD**: Type `/horizon` in chat (or run `npx
|
|
68
|
+
3. **Open the In-Chat Docked HUD**: Type `/horizon` in chat (or run `npx ctxtop panel` for the standalone HTML workbench) to inspect cache gravity, active guards, and reclaimable tokens.
|
|
50
69
|
|
|
51
70
|
---
|
|
52
71
|
|
|
@@ -70,7 +89,7 @@ All 6 slash skills are registered identically in both **Google Antigravity** (`p
|
|
|
70
89
|
|
|
71
90
|
---
|
|
72
91
|
|
|
73
|
-
## ๐ก๏ธ
|
|
92
|
+
## ๐ก๏ธ Example Session Receipt: `+164.0k` Tokens Saved in One 4-Step Loop
|
|
74
93
|
|
|
75
94
|
Most CLI trackers passively count tokens *after* your quota is already burned. Highbeam intercepts redundant reads, compresses noisy test dumps via local SQLite FTS5, and shields warm KV prefixes **before** they hit your billing meter:
|
|
76
95
|
|
|
@@ -78,12 +97,14 @@ Most CLI trackers passively count tokens *after* your quota is already burned. H
|
|
|
78
97
|
<img src="assets/zone_c_step3_shield_full.png" alt="Highbeam Zone C Active Protection & Verified Token Receipt (+164.0k tokens saved)" width="460" />
|
|
79
98
|
</div>
|
|
80
99
|
|
|
81
|
-
| Step in Coding Loop | Developer / Agent Action | Highbeam Active Intervention (Zone C) | Verified Savings |
|
|
100
|
+
| Step in Coding Loop | Developer / Agent Action | Highbeam Active Intervention (Zone C) | Verified Incident Savings |
|
|
82
101
|
| :--- | :--- | :--- | :---: |
|
|
83
102
|
| **1. Warm KV Cache + Repeat Read** | Agent re-reads an unmodified 800-line source file on a `100k` warm cache | **GUARD-4** intercepts the duplicate read (`AST signature stub`) and preserves the `95%` warm KV cache discount | **`+95.0k` tok** *(KV cache)*<br/>**`+800` tok** *(deduped read)* |
|
|
84
103
|
| **2. Failing Test Suite Dump** | `npm test` dumps `120+` lines of verbose stdout (`~11.4k` tokens) | **SQLite FTS5 BM25 Compressor** indexes raw stdout locally and injects only the 160-token failing assertion digest | **`+11.2k` tok** |
|
|
85
104
|
| **3. Mid-Session Rule Edit** | Agent updates `AGENTS.md` / `CLAUDE.md` while `60k` prefix is warm (`2m 55s` TTL left) | **PrefixCacheShield** queues the rule delta until TTL expiry or `/compact`, preventing a cold prefix rebuild | **`+57.0k` tok** |
|
|
86
|
-
| **
|
|
105
|
+
| **Example Incident Receipt** | **4-Step Feature / Bugfix Loop** | **Zero context dilution ยท 100% critical error retention** | **`+164.0k` tok (`~$0.33`)** |
|
|
106
|
+
|
|
107
|
+
> **Reconciled Monthly Expectation:** Across normal coding weeks without deliberate cache-busting, our bottom-up benchmark model estimates **`~$9.42/wk` (`~$40.79/mo`, `~6%โ11%` of raw API spend)** saved for a full-time agentic developer, alongside **`30%โ50%` longer 5-hour subscription sprints** by cutting `O(Nยฒ)` tool-log compounding.
|
|
87
108
|
|
|
88
109
|
---
|
|
89
110
|
|
|
@@ -93,47 +114,40 @@ In agentic coding, every turn re-sends the entire prior conversation history. A
|
|
|
93
114
|
|
|
94
115
|
1. **For Fixed-Subscription Users (`Claude Pro / Max`, `Antigravity OAuth Seats`) โ Stop 2:00 PM Quota Lockouts & Context Rot**:
|
|
95
116
|
- Compressing noisy tool outputs and duplicate file reads on early turns prevents `O(Nยฒ)` history compounding, **stretching 5-hour sprint quotas by `30%โ50%`**.
|
|
96
|
-
-
|
|
117
|
+
- Staying below the **70% Safe Horizon** prevents **Context Rot** (middle-window attention decay where the model starts overlooking `AGENTS.md`/`CLAUDE.md` rules or hallucinating imports).
|
|
97
118
|
2. **For Metered API & Enterprise Teams โ Self-Expensing FinOps ROI**:
|
|
98
|
-
- Preventing
|
|
119
|
+
- Preventing accidental warm-cache busts plus automatic FTS5 log compression saves **`~$40.79/mo` (`$9.42/wk`)** for average full-time API devs (`~$149/mo` for heavy 100kโ200k Opus swarm users).
|
|
99
120
|
3. **Daily Cockpit Decisions No Human Can Calculate in Their Head (Zone B)**:
|
|
100
|
-
- *"If I downshift from Opus
|
|
121
|
+
- *"If I downshift from Opus to Sonnet right now, will I save quota or pay a 10x cold-prefill penalty?"* โ Highbeam computes the horizon-aware KV-cache break-even limit (`C_max`) and post-switch warm-request payback in real time and displays a 1-line verdict: **`Model: Hold (03:34) โ switching busts warm cache`**.
|
|
101
122
|
|
|
102
123
|
---
|
|
103
124
|
|
|
104
|
-
## โ๏ธ What Runs Automatically (
|
|
125
|
+
## โ๏ธ What Runs Automatically (100% Free `COACH` Default)
|
|
105
126
|
|
|
106
|
-
Highbeam defaults to **`COACH` mode**โperforming lossless token surgery silently in the background while never blocking your chat prompt unless a
|
|
127
|
+
Highbeam defaults to **`COACH` mode**โperforming lossless token surgery silently in the background while never blocking your chat prompt unless a 3-strike identical failure loop or destructive git command occurs:
|
|
107
128
|
|
|
108
129
|
| Automated Feature | How It Works Under the Hood | Developer Experience |
|
|
109
130
|
| :--- | :--- | :--- |
|
|
110
131
|
| **1. SQLite FTS5 CLI & Test Output Compression** (`PostToolUse`) | Strips ANSI/progress noise, indexes full stdout in local SQLite FTS5 (`porter unicode61`), and injects only the compact failing assertion digest | **100% automatic** โ saves `50%โ90%` of test/build log tokens with zero lost stack traces |
|
|
111
132
|
| **2. Post-Edit Delta Diffs & 3rd-Read AST Stubs** (`GUARD-4` in `PreToolUse`) | When the agent re-reads a file after editing 5 lines (or reads the same unclipped file `>=3` times), returns a unified line diff or function-signature AST stub | **100% automatic** โ cuts repeat-read token burn by `80%+` without interrupting the agent |
|
|
112
|
-
| **3. `PrefixCacheShield` Warm Rule & Effort Deferral** (`DET-09`) | Intercepts mid-session edits to `AGENTS.md` / `CLAUDE.md` while a KV cache is warm, and checks `MODEL_EFFORT_CACHE_CAPABILITIES` on effort changes
|
|
133
|
+
| **3. `PrefixCacheShield` Warm Rule & Effort Deferral** (`DET-09`) | Intercepts mid-session edits to `AGENTS.md` / `CLAUDE.md` while a KV cache is warm, and checks `MODEL_EFFORT_CACHE_CAPABILITIES` on effort changes (defers on `4.6`, silent on cache-preserving `5.5` models, warns on untested models) | **Model-aware cache protection** โ prevents silent cold prefix rebuilds without false-positiving on `5.5` effort |
|
|
113
134
|
| **4. Live Model & Effort Switch Verdict** (`Zone B`) | Evaluates remaining KV cache TTL (`5m`/`1h`) and horizon break-even (`C_max` & warm-request payback) across `MODEL / HOLD / SWITCH / LOCK` states | **Instant visual guidance** โ tells you when to hold vs. switch models or lower thinking effort |
|
|
114
|
-
| **5. Held Downshift & Boundary Lifecycle** (`SessionStart:compact` / `Stop`) | Surfaces held `pending_downshift` after compaction via `SessionStart:compact` `systemMessage` (
|
|
135
|
+
| **5. Held Downshift & Boundary Lifecycle** (`SessionStart:compact` / `Stop`) | Surfaces held `pending_downshift` after compaction via a zero-token `SessionStart:compact` `systemMessage` reminder (`/model <target>`), with optional boundary prompts disabled by default | **Post-compact downshift handoff** โ reminds `/model <target>` cleanly right after compaction |
|
|
115
136
|
| **6. Git Hook-Bypass & Destructive Shell Guard** (`DET-18` / `DET-19`) | Blocks `git commit --no-verify`, `-n`, `core.hooksPath` tampering, and unconfirmed `git reset --hard` | **Zero-config repo safety** โ keeps frustrated agents from bypassing your pre-commit linters |
|
|
116
|
-
| **7. `PreModelSwitch` Warm KV-Cache Guard** (`DET-08`) |
|
|
137
|
+
| **7. `PreModelSwitch` Warm KV-Cache Guard** (`DET-08`) | Computes break-even (`C*`, `C_max`), cold-write penalties, and warm-request paybacks directly from `anthropicModelCatalog.json` using rolling session turns (`R`, `g`), returning explicit `unknownModel: true` without fallback price guesses | **Protects mid-session switches** โ prevents losing money on short-horizon downgrades while allowing profitable early switches |
|
|
117
138
|
|
|
118
139
|
---
|
|
119
140
|
|
|
120
|
-
##
|
|
121
|
-
|
|
122
|
-
Empirical findings from the suite (every item cites its source file; unmeasured behaviors are labeled **unverified**):
|
|
123
|
-
|
|
124
|
-
- Editing `CLAUDE.md` before `--resume` does not invalidate the cache; the old and new versions both stay in context (`T6 CC-M`, `t6_layers.csv`).
|
|
125
|
-
- `--append-system-prompt` is ignored on `--resume` (`T6 CC-S`, `t6_layers.csv`).
|
|
126
|
-
- Changing MCP servers or the tool list on resume wipes the cache (`T6 CC-T`, `t6_layers.csv`).
|
|
127
|
-
- `PreCompact` instructions must be plain text on stdout; JSON is dropped (`Phase 0`, `$0` binary & mock-SSE audit; Highbeam emits zero custom `PreCompact` or `SessionStart` preservation templates since `summary_smart_compact.md` found `0/6` violations up to `28.10x` compression without them).
|
|
128
|
-
- Auto-memory added about `23.5%` to session cost in the smart-compact fixture (`n = 2 vs 2`, `summary_smart_compact.md`); this is a cost note, not a recommendation to disable it.
|
|
129
|
-
- On OpenRouter, `max_tokens: 0` still generates output; cache pre-warming with 0 output works on the direct API only (`Phase 0`, `T3b`).
|
|
130
|
-
- A 1-hour cache costs `2x` on writes and wins once a `5โ60` minute pause occurs (`T3a`).
|
|
141
|
+
## ๐ Empirical Wire Highlights (Claude Code `2.1.325`)
|
|
131
142
|
|
|
132
|
-
|
|
143
|
+
Highbeam's cache-economics engine is backed by **45 pre-registered randomized runs (`540` live wire-reconciled turns)** and **6 live 30-turn compaction studies** against first-party Anthropic via OpenRouter:
|
|
133
144
|
|
|
134
|
-
**
|
|
145
|
+
- **Downgrading Mid-Chat Can Cost More Than Staying on Opus:** At `~58k` context, switching `Opus 4.6 -> Sonnet 4.6` at Turn 6 produced a `0.0%` cache hit (`+$0.1783` spike) and increased 12-turn session cost (`$0.8611` vs `$0.7789` Opus control).
|
|
146
|
+
- **Changing `--effort` Busted `4.6` Caches (`+$0.0853`), Fixed in `5.5`:** Wire diffs caught `output_config.effort` invalidating `4.6` prompt caches while `claude-sonnet-5-5` preserved warm cache hits (`n = 3`).
|
|
147
|
+
- **Stock `/compact` Scored `0/6` Violations Up to `28.10x` Compression:** Because default compaction preserved constraints cleanly without custom templates, Highbeam emits zero `PreCompact` bloat.
|
|
148
|
+
- **MCP / Tool-List Swaps on `--resume` Wipe Cache; `CLAUDE.md` Edits Do Not:** Highbeam hashes `.mcp.json` / `.claude/settings*.json` across resumes and warns before uncached rebuilds.
|
|
135
149
|
|
|
136
|
-
|
|
150
|
+
๐ See full methodology, per-arm datasets, SDK `stream-json` `set_model` patterns, and explicit unverified boundaries in [**`docs/EMPIRICAL_BENCHMARKS.md`**](docs/EMPIRICAL_BENCHMARKS.md).
|
|
137
151
|
|
|
138
152
|
---
|
|
139
153
|
|
|
@@ -272,26 +286,43 @@ npx ctxtop config DET-19 block
|
|
|
272
286
|
- **`"AUTO_PILOT"`**: Enforces strict pre-turn & stop-gate verification locks (e.g., requiring tests to run after source edits before session completion).
|
|
273
287
|
- **`"SILENT"` / `"OFF"`**: Passive telemetry collection only.
|
|
274
288
|
|
|
275
|
-
### 2. Using Highbeam as an MCP Server (`ctxtop
|
|
276
|
-
Any MCP-compatible client (**Google Antigravity**, **Claude Code**, **Cursor**, **Windsurf**, or **Claude Desktop**) can
|
|
289
|
+
### 2. Using Highbeam as an MCP Server (`npx ctxtop mcp`)
|
|
290
|
+
Any MCP-compatible client (**Google Antigravity**, **Claude Code**, **OpenAI Codex CLI**, **Gemini CLI**, **Cursor**, **Windsurf**, or **Claude Desktop**) can auto-configure Highbeam via `npx ctxtop init --cursor --windsurf --codex --gemini-cli` or run standard JSON-RPC stdio directly:
|
|
277
291
|
|
|
278
292
|
```json
|
|
279
293
|
{
|
|
280
294
|
"mcpServers": {
|
|
281
295
|
"highbeam": {
|
|
282
296
|
"command": "npx",
|
|
283
|
-
"args": ["-y", "ctxtop
|
|
297
|
+
"args": ["-y", "ctxtop", "mcp"]
|
|
284
298
|
}
|
|
285
299
|
}
|
|
286
300
|
}
|
|
287
301
|
```
|
|
288
|
-
Exposes
|
|
302
|
+
Exposes **7 standalone zero-network MCP tools** (`<5ms` response): `horizon_status`, `cache_gravity_check`, `scope_lock_claim`, `export_receipt_pdf`, `horizon_compress_cli`, `horizon_search_logs`, and `horizon_audit_sessions`.
|
|
303
|
+
|
|
304
|
+
For centralized organization deployment (Jamf / Intune / GPO), `CHECKSUMS.sha256` verification, and BYO-Grafana OpenTelemetry telemetry, see [**Enterprise & MDM Deployment Guide**](docs/ENTERPRISE_MDM.md).
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## ๐ฆ Editions: Free (`MIT` Core + `COACH`) vs. Pro & Team
|
|
309
|
+
|
|
310
|
+
| Feature / Capability | Free Core (`MIT`) | Highbeam Pro (`$15/mo` ยท 14d Trial) | Team / FinOps (`$39/seat/mo`) |
|
|
311
|
+
| :--- | :---: | :---: | :---: |
|
|
312
|
+
| Simple & Advanced 40-Cell HUD + `5m/1h` Live TTL Timer | โ
| โ
| โ
|
|
|
313
|
+
| Multi-Family FTS5 Compression (`test`, `lint`, `git`, `docker`/`kubectl`) & `ctxtop search` | โ
| โ
| โ
|
|
|
314
|
+
| Automated Repeat-Read Delta Diffs & AST Stubs (`GUARD-4`) | โ
| โ
| โ
|
|
|
315
|
+
| `COACH` Non-Blocking Advisories & 32 Auditable Guards across 5 Hosts | โ
| โ
| โ
|
|
|
316
|
+
| `AUTO_PILOT` Hands-Free Enforcement & Horizon `C_max` Holds | Preview | โ
| โ
|
|
|
317
|
+
| 30-Day Chronic Offender Memory & Workspace Savings Ledger | โ | โ
| โ
|
|
|
318
|
+
| Signed Corporate PDF 1.4 FinOps + GreenOps Receipt (`ctxtop receipt --pdf`) | โ | โ
| โ
|
|
|
319
|
+
| Shared `.agents/rules/` Governance, MDM Policy & OTel / Grafana Pack | โ | โ | โ
|
|
|
289
320
|
|
|
290
321
|
---
|
|
291
322
|
|
|
292
323
|
## Deterministic `PreInvocation` Router & 6 Local Sensors
|
|
293
324
|
|
|
294
|
-
When registered in `hooks.json`, `src/hooks/pre_invocation.mjs` evaluates incoming prompts across 8 deterministic router states (**Tier-1 In-Process
|
|
325
|
+
When registered in `hooks.json`, `src/hooks/pre_invocation.mjs` evaluates incoming prompts across 8 deterministic router states (**Tier-1 In-Process `PreInvocation`: `~0.1โ2.9ms` avg / `~3.4ms` p95** inside a warm V8 isolate; **Tier-2 CLI Hook End-to-End Wall Time on Windows: `~58ms` p50 warm daemon IPC / `~105ms` avg cold fallback (`~25โ60ms` POSIX)** including Node process startup):
|
|
295
326
|
|
|
296
327
|
1. `ALLOW_SILENT`: Immediate pass-through (`{}`) on `!` bypass prefix or healthy turns.
|
|
297
328
|
2. `ALLOW_ACTIVE_SET`: Silent pass-through when referenced files are already warm in the last 5 turns.
|
|
@@ -308,27 +339,30 @@ When registered in `hooks.json`, `src/hooks/pre_invocation.mjs` evaluates incomi
|
|
|
308
339
|
|
|
309
340
|
| Command | Description |
|
|
310
341
|
| :--- | :--- |
|
|
311
|
-
| `npx ctxtop
|
|
312
|
-
| `npx ctxtop
|
|
313
|
-
| `npx ctxtop
|
|
342
|
+
| `npx ctxtop audit [--platform all\|antigravity\|claude\|codex\|gemini\|cursor] [--days 7] [--json]` | Zero-write, hookless 5-host audit of Sludge Tax, cold-cache spikes, and oversized tool dumps. |
|
|
343
|
+
| `npx ctxtop init [--cursor \| --windsurf \| --codex \| --gemini-cli \| --all-hosts]` | Installs Google Antigravity, Claude Code, and 1-command MCP configurations across editors & CLIs. |
|
|
344
|
+
| `npx ctxtop search [<turn-id>] "<keyword>" [--json]` | Searches local SQLite FTS5 offloaded CLI dumps and artifacts via BM25 matching. |
|
|
345
|
+
| `npx ctxtop install --global` | Installs Claude Code `.claude-plugin` manifest, Tier-1/Tier-2 hooks, and terminal `statusLine`. |
|
|
346
|
+
| `npx ctxtop ui [--demo]` | Launches the local HTTP/SSE telemetry daemon (`127.0.0.1`) and interactive WebView (`/` Simple, `/advanced` Advanced). |
|
|
347
|
+
| `npx ctxtop mcp` | Starts the standalone zero-network 7-tool JSON-RPC stdio MCP server (`@ctxtop/mcp`). |
|
|
348
|
+
| `npx ctxtop doctor [--diagnostic]` | Validates hook registration, FTS5 offload readiness, warm-IPC path, model ceilings, 3-way SHA-256 parity, and SQLite health. |
|
|
314
349
|
| `npx ctxtop postmortem [--last N] [--json]` | Scans the last `N` local sessions, classifies root causes (`CONTEXT_ROT_DECAY`, `VERIFICATION_CHURN`, `SPEC_AMBIGUITY`, `CLEAN`), lists top duplicate-read files, and audits Turn-0 MCP schema overhead. |
|
|
315
350
|
| `npx ctxtop receipt [--markdown \| --pdf]` | Exports a SHA-256 verified FinOps + GreenOps token/USD savings receipt for the active workspace. |
|
|
316
|
-
| `npx ctxtop verify [--json]` | Verifies cryptographic SHA-256 integrity of all
|
|
351
|
+
| `npx ctxtop verify [--json]` | Verifies cryptographic SHA-256 integrity of all tracked release files against `CHECKSUMS.sha256`. |
|
|
317
352
|
| `npx ctxtop --roast` | Prints a terminal forensic summary of recent sessions with top duplicate-read file offenders and copy-pasteable remediations. |
|
|
318
|
-
| `npx ctxtop --serve` | Launches the local HTTP/SSE telemetry daemon (`127.0.0.1`) and interactive WebView (`/` Simple, `/advanced` Advanced). |
|
|
319
353
|
| `npx ctxtop --demo-animate` | Plays the 5-stage terminal crisis simulation across synthetic fixtures. |
|
|
320
354
|
|
|
321
355
|
---
|
|
322
356
|
|
|
323
357
|
## Verification & Benchmarks
|
|
324
358
|
|
|
325
|
-
Run the full zero-dependency test and verification
|
|
359
|
+
Run the full zero-dependency test and verification suites (**1,060+ tests across 215+ suites** โ see [**Empirical Benchmarks**](docs/EMPIRICAL_BENCHMARKS.md) & [**Compression & Antigravity Parity Report**](docs/ANTIGRAVITY_AND_COMPRESSION_BENCHMARK.md)):
|
|
326
360
|
|
|
327
361
|
```bash
|
|
328
|
-
# Full Coach, UI, & 360ยฐ Capability-Proof suite
|
|
362
|
+
# Full Coach, UI, & 360ยฐ Capability-Proof suite
|
|
329
363
|
npm run test:coach
|
|
330
364
|
|
|
331
|
-
# Claude Code dual-tier Mod, CLI hooks, statusLine, and 5-category ledger suite (
|
|
365
|
+
# Claude Code dual-tier Mod, CLI hooks, statusLine, and 5-category ledger suite (195 tests)
|
|
332
366
|
npm run test:claude
|
|
333
367
|
|
|
334
368
|
# Unit & Multi-Harness Wedge suite (89 tests across 31 suites)
|
|
@@ -337,10 +371,10 @@ npm run test:unit
|
|
|
337
371
|
# Architectural verification suite (Gates 0-6 & Phases 1-7: SQLite read-only locks, JSDOM UI, MCP audit)
|
|
338
372
|
npm run test:gates && npm run test:phases
|
|
339
373
|
|
|
340
|
-
#
|
|
341
|
-
npm run
|
|
374
|
+
# Reproducible 10-family CLI compression + 12-session Antigravity & 5-host parity benchmark
|
|
375
|
+
npm run bench:parity
|
|
342
376
|
|
|
343
|
-
# Latency benchmark (200 iterations/path: Tier-1 ~
|
|
377
|
+
# Latency benchmark (200 iterations/path: Tier-1 ~2.9ms avg, Tier-2 ~58ms warm IPC / ~105ms cold Windows, ~5.4ms HUD)
|
|
344
378
|
npm run bench
|
|
345
379
|
```
|
|
346
380
|
|
package/SECURITY.md
CHANGED
|
@@ -17,6 +17,12 @@ To eliminate any risk of database lock contention or corruption while Google Ant
|
|
|
17
17
|
2. **Read-Only JSONL File Descriptors (`'r'`):** Incremental transcript slicing (`transcript_full.jsonl` and `transcript.jsonl`) opens log files strictly with read-only flag `'r'` (`fs.openSync(filePath, 'r')`) and never acquires write locks on active Antigravity session databases.
|
|
18
18
|
3. **Atomic Sidecar & Backup I/O:** Any optional user-triggered state (such as `docs/HANDOFF_<timestamp>.md` generation or `.bak` transcript backups prior to surgical pruning) is written atomically via PID-scoped temporary files and rename operations.
|
|
19
19
|
|
|
20
|
-
## 3.
|
|
20
|
+
## 3. Multi-Host Read-Only Scoping & Open-Core Cryptographic Model
|
|
21
|
+
|
|
22
|
+
1. **5-Host Read-Only Transcript Scoping (`ctxtop audit` & `horizon_audit_sessions`)**: When auditing sessions across Antigravity, Claude Code, Codex CLI, Gemini CLI, and Cursor, `ctxtop` reads solely completed/active conversation transcript files (e.g. Gemini CLI `~/.gemini/tmp/**/chats/session-*.json`). Highbeam never reads OAuth credential files (`~/.gemini/oauth_creds.json`, Keychain/Credential Manager tokens) and never spawns host CLIs against interactive OAuth seats.
|
|
23
|
+
2. **Release Checksums & npm Provenance**: Tracked runtime files can be verified offline anytime via `npx ctxtop verify --json` (`CHECKSUMS.sha256`), and CI releases publish with `--provenance` OIDC attestation.
|
|
24
|
+
3. **Offline Ed25519 Entitlement Verification (`@ctxtop/pro`)**: License verification runs locally using Node.js native `node:crypto` Ed25519 signature checks with zero license phone-home pings; enterprises may pin their own SPKI key via `CTXTOP_ED25519_PUBLIC_KEY_PEM`. For central MDM policy deployment see [docs/ENTERPRISE_MDM.md](docs/ENTERPRISE_MDM.md).
|
|
25
|
+
|
|
26
|
+
## 4. Reporting a Vulnerability
|
|
21
27
|
|
|
22
28
|
If you discover a security or path-handling issue, please open a GitHub Security Advisory on the repository or contact `frankmiller@gmail.com`. We respond to security reports within 48 hours.
|
package/assets/hero-demo.svg
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<circle cx="42" cy="20" r="6" fill="#f59e0b"/>
|
|
32
32
|
<circle cx="62" cy="20" r="6" fill="#22c55e"/>
|
|
33
33
|
<text x="480" y="25" text-anchor="middle" fill="#94a3b8" font-size="13" font-weight="600" class="mono">
|
|
34
|
-
Highbeam (ctxtop
|
|
34
|
+
Highbeam (ctxtop v4.1.0) โ 40-Cell Context Telemetry HUD & PreInvocation Flight Check
|
|
35
35
|
</text>
|
|
36
36
|
|
|
37
37
|
<!-- Section 1: Turn 50 Prefix Amputation & Sludge Crisis -->
|