waterplane 0.1.6 → 0.1.14
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/CHANGELOG.md +146 -1
- package/README.md +47 -24
- package/SECURITY.md +11 -3
- package/deploy/node-version +1 -1
- package/node_modules/@waterplane/shared/dist/agentfiles.d.ts +17 -0
- package/node_modules/@waterplane/shared/dist/agentfiles.js +60 -5
- package/node_modules/@waterplane/shared/dist/agentfiles.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/alwaysonwords.d.ts +83 -0
- package/node_modules/@waterplane/shared/dist/alwaysonwords.js +215 -0
- package/node_modules/@waterplane/shared/dist/alwaysonwords.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/assess/sasswords.js +4 -0
- package/node_modules/@waterplane/shared/dist/assess/sasswords.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/autocompact.js +3 -2
- package/node_modules/@waterplane/shared/dist/autocompact.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/backendsources.d.ts +11 -1
- package/node_modules/@waterplane/shared/dist/backendsources.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/branchmode.d.ts +33 -0
- package/node_modules/@waterplane/shared/dist/branchmode.js +88 -0
- package/node_modules/@waterplane/shared/dist/branchmode.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/budget.d.ts +7 -1
- package/node_modules/@waterplane/shared/dist/budget.js +11 -3
- package/node_modules/@waterplane/shared/dist/budget.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/buildstamp.d.ts +37 -0
- package/node_modules/@waterplane/shared/dist/buildstamp.js +95 -0
- package/node_modules/@waterplane/shared/dist/buildstamp.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/burn.d.ts +16 -1
- package/node_modules/@waterplane/shared/dist/burn.js +30 -0
- package/node_modules/@waterplane/shared/dist/burn.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/calday.d.ts +4 -0
- package/node_modules/@waterplane/shared/dist/calday.js +25 -0
- package/node_modules/@waterplane/shared/dist/calday.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/changebrief.d.ts +77 -0
- package/node_modules/@waterplane/shared/dist/changebrief.js +70 -0
- package/node_modules/@waterplane/shared/dist/changebrief.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/clihealth/healthrecord.js +1 -0
- package/node_modules/@waterplane/shared/dist/clihealth/healthrecord.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/costwindow.d.ts +24 -5
- package/node_modules/@waterplane/shared/dist/costwindow.js +35 -15
- package/node_modules/@waterplane/shared/dist/costwindow.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/desktopfiles.d.ts +100 -0
- package/node_modules/@waterplane/shared/dist/desktopfiles.js +192 -0
- package/node_modules/@waterplane/shared/dist/desktopfiles.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/exposure.d.ts +175 -0
- package/node_modules/@waterplane/shared/dist/exposure.js +357 -0
- package/node_modules/@waterplane/shared/dist/exposure.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/exposurepush.d.ts +60 -0
- package/node_modules/@waterplane/shared/dist/exposurepush.js +103 -0
- package/node_modules/@waterplane/shared/dist/exposurepush.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/commits.d.ts +26 -0
- package/node_modules/@waterplane/shared/dist/healthindex/commits.js +57 -0
- package/node_modules/@waterplane/shared/dist/healthindex/commits.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/move.d.ts +25 -0
- package/node_modules/@waterplane/shared/dist/healthindex/move.js +79 -0
- package/node_modules/@waterplane/shared/dist/healthindex/move.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/readings.d.ts +53 -0
- package/node_modules/@waterplane/shared/dist/healthindex/readings.js +154 -0
- package/node_modules/@waterplane/shared/dist/healthindex/readings.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/repoindex.d.ts +41 -0
- package/node_modules/@waterplane/shared/dist/healthindex/repoindex.js +19 -0
- package/node_modules/@waterplane/shared/dist/healthindex/repoindex.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/score.d.ts +26 -0
- package/node_modules/@waterplane/shared/dist/healthindex/score.js +156 -0
- package/node_modules/@waterplane/shared/dist/healthindex/score.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/types.d.ts +206 -0
- package/node_modules/@waterplane/shared/dist/healthindex/types.js +58 -0
- package/node_modules/@waterplane/shared/dist/healthindex/types.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/vs.d.ts +26 -0
- package/node_modules/@waterplane/shared/dist/healthindex/vs.js +38 -0
- package/node_modules/@waterplane/shared/dist/healthindex/vs.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex/words.d.ts +28 -0
- package/node_modules/@waterplane/shared/dist/healthindex/words.js +124 -0
- package/node_modules/@waterplane/shared/dist/healthindex/words.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/healthindex.d.ts +15 -411
- package/node_modules/@waterplane/shared/dist/healthindex.js +8 -602
- package/node_modules/@waterplane/shared/dist/healthindex.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/hints.js +15 -0
- package/node_modules/@waterplane/shared/dist/hints.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/index.d.ts +37 -0
- package/node_modules/@waterplane/shared/dist/index.js +37 -0
- package/node_modules/@waterplane/shared/dist/index.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/intent/clean.d.ts +87 -0
- package/node_modules/@waterplane/shared/dist/intent/clean.js +51 -3
- package/node_modules/@waterplane/shared/dist/intent/clean.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/intent/kind.d.ts +40 -1
- package/node_modules/@waterplane/shared/dist/intent/kind.js +36 -3
- package/node_modules/@waterplane/shared/dist/intent/kind.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/intent/types.d.ts +13 -0
- package/node_modules/@waterplane/shared/dist/intent/types.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/intent/verdict.js +9 -16
- package/node_modules/@waterplane/shared/dist/intent/verdict.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/intent/words.js +5 -0
- package/node_modules/@waterplane/shared/dist/intent/words.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/intent.d.ts +2 -2
- package/node_modules/@waterplane/shared/dist/intent.js +2 -2
- package/node_modules/@waterplane/shared/dist/intent.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/launchmodes.d.ts +2 -0
- package/node_modules/@waterplane/shared/dist/launchmodes.js +12 -0
- package/node_modules/@waterplane/shared/dist/launchmodes.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/ledgerspan.d.ts +106 -0
- package/node_modules/@waterplane/shared/dist/ledgerspan.js +196 -0
- package/node_modules/@waterplane/shared/dist/ledgerspan.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/naming.d.ts +3 -1
- package/node_modules/@waterplane/shared/dist/naming.js +6 -2
- package/node_modules/@waterplane/shared/dist/naming.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/netfuse.d.ts +5 -0
- package/node_modules/@waterplane/shared/dist/netfuse.js +6 -1
- package/node_modules/@waterplane/shared/dist/netfuse.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/netretry.d.ts +78 -0
- package/node_modules/@waterplane/shared/dist/netretry.js +85 -0
- package/node_modules/@waterplane/shared/dist/netretry.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/netretrycfg.d.ts +12 -0
- package/node_modules/@waterplane/shared/dist/netretrycfg.js +27 -0
- package/node_modules/@waterplane/shared/dist/netretrycfg.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/nodemin.d.ts +6 -4
- package/node_modules/@waterplane/shared/dist/nodemin.js +6 -4
- package/node_modules/@waterplane/shared/dist/nodemin.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/optins.d.ts +35 -1
- package/node_modules/@waterplane/shared/dist/optins.js +39 -1
- package/node_modules/@waterplane/shared/dist/optins.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/pairing.js +4 -0
- package/node_modules/@waterplane/shared/dist/pairing.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/passive.js +3 -0
- package/node_modules/@waterplane/shared/dist/passive.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/plugin/api.d.ts +394 -0
- package/node_modules/@waterplane/shared/dist/plugin/api.js +2 -0
- package/node_modules/@waterplane/shared/dist/plugin/api.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/plugin/backend.d.ts +197 -0
- package/node_modules/@waterplane/shared/dist/plugin/backend.js +9 -0
- package/node_modules/@waterplane/shared/dist/plugin/backend.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/plugin/manifest.d.ts +160 -0
- package/node_modules/@waterplane/shared/dist/plugin/manifest.js +98 -0
- package/node_modules/@waterplane/shared/dist/plugin/manifest.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/plugin/module.d.ts +98 -0
- package/node_modules/@waterplane/shared/dist/plugin/module.js +13 -0
- package/node_modules/@waterplane/shared/dist/plugin/module.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/plugin/version.d.ts +66 -0
- package/node_modules/@waterplane/shared/dist/plugin/version.js +86 -0
- package/node_modules/@waterplane/shared/dist/plugin/version.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/plugin.d.ts +5 -867
- package/node_modules/@waterplane/shared/dist/plugin.js +27 -186
- package/node_modules/@waterplane/shared/dist/plugin.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/pluginlaunch.d.ts +7 -0
- package/node_modules/@waterplane/shared/dist/prview.d.ts +23 -0
- package/node_modules/@waterplane/shared/dist/prview.js +107 -0
- package/node_modules/@waterplane/shared/dist/prview.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/queue/queueserial.d.ts +11 -2
- package/node_modules/@waterplane/shared/dist/queue/queueserial.js +13 -4
- package/node_modules/@waterplane/shared/dist/queue/queueserial.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/queue/queuewords.js +1 -0
- package/node_modules/@waterplane/shared/dist/queue/queuewords.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/repohealth.d.ts +4 -0
- package/node_modules/@waterplane/shared/dist/repohealth.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/repotwins.d.ts +31 -0
- package/node_modules/@waterplane/shared/dist/repotwins.js +52 -0
- package/node_modules/@waterplane/shared/dist/repotwins.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/requirements.js +4 -1
- package/node_modules/@waterplane/shared/dist/requirements.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/schedule/schedaction.d.ts +29 -0
- package/node_modules/@waterplane/shared/dist/schedule/schedaction.js +22 -0
- package/node_modules/@waterplane/shared/dist/schedule/schedaction.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/schedule/schedclean.js +26 -0
- package/node_modules/@waterplane/shared/dist/schedule/schedclean.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/schedule/schedhorizon.d.ts +1 -0
- package/node_modules/@waterplane/shared/dist/schedule/schedhorizon.js +1 -0
- package/node_modules/@waterplane/shared/dist/schedule/schedhorizon.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/schedule.d.ts +1 -1
- package/node_modules/@waterplane/shared/dist/schedule.js +1 -1
- package/node_modules/@waterplane/shared/dist/schedule.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/sessionbudget.d.ts +34 -7
- package/node_modules/@waterplane/shared/dist/sessionbudget.js +59 -21
- package/node_modules/@waterplane/shared/dist/sessionbudget.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/sweep.d.ts +2 -1
- package/node_modules/@waterplane/shared/dist/sweep.js +2 -1
- package/node_modules/@waterplane/shared/dist/sweep.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/tokens.d.ts +4 -3
- package/node_modules/@waterplane/shared/dist/tokens.js +9 -7
- package/node_modules/@waterplane/shared/dist/tokens.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/weekburn.d.ts +144 -0
- package/node_modules/@waterplane/shared/dist/weekburn.js +250 -0
- package/node_modules/@waterplane/shared/dist/weekburn.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/wire/alwayson.d.ts +64 -0
- package/node_modules/@waterplane/shared/dist/wire/alwayson.js +7 -0
- package/node_modules/@waterplane/shared/dist/wire/alwayson.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/wire/backend.d.ts +4 -0
- package/node_modules/@waterplane/shared/dist/wire/backendtokens.d.ts +6 -0
- package/node_modules/@waterplane/shared/dist/wire/backendtokens.js +0 -9
- package/node_modules/@waterplane/shared/dist/wire/backendtokens.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/wire/costwindow.d.ts +25 -0
- package/node_modules/@waterplane/shared/dist/wire/messages/clienthost.d.ts +15 -1
- package/node_modules/@waterplane/shared/dist/wire/messages/clientsession.d.ts +24 -0
- package/node_modules/@waterplane/shared/dist/wire/messages/hosttools.d.ts +12 -2
- package/node_modules/@waterplane/shared/dist/wire/notify.d.ts +194 -1
- package/node_modules/@waterplane/shared/dist/wire/notify.js +139 -1
- package/node_modules/@waterplane/shared/dist/wire/notify.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/wire/pullrequest.d.ts +42 -0
- package/node_modules/@waterplane/shared/dist/wire/pullrequest.js +2 -0
- package/node_modules/@waterplane/shared/dist/wire/pullrequest.js.map +1 -0
- package/node_modules/@waterplane/shared/dist/wire/repo.d.ts +131 -0
- package/node_modules/@waterplane/shared/dist/wire/repo.js +8 -3
- package/node_modules/@waterplane/shared/dist/wire/repo.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/wire/sent.d.ts +3 -1
- package/node_modules/@waterplane/shared/dist/wire/session/contextspark.d.ts +7 -0
- package/node_modules/@waterplane/shared/dist/wire/session/info.d.ts +4 -1
- package/node_modules/@waterplane/shared/dist/wire/session/launch.d.ts +36 -0
- package/node_modules/@waterplane/shared/dist/wire/session.d.ts +1 -1
- package/node_modules/@waterplane/shared/dist/wire/telemetry.d.ts +30 -0
- package/node_modules/@waterplane/shared/dist/wire/work.d.ts +13 -0
- package/node_modules/@waterplane/shared/dist/wire/work.js.map +1 -1
- package/node_modules/@waterplane/shared/dist/wordof.d.ts +11 -0
- package/node_modules/@waterplane/shared/dist/wordof.js +14 -0
- package/node_modules/@waterplane/shared/dist/wordof.js.map +1 -0
- package/npm-shrinkwrap.json +3 -3
- package/package.json +2 -2
- package/packages/extensions/scorecard/waterplane-plugin.json +10 -0
- package/packages/host/dist/agentexposure.d.ts +13 -0
- package/packages/host/dist/agentexposure.js +90 -0
- package/packages/host/dist/agentexposure.js.map +1 -0
- package/packages/host/dist/agentintents.js +7 -8
- package/packages/host/dist/agentintents.js.map +1 -1
- package/packages/host/dist/agentwatch.d.ts +3 -7
- package/packages/host/dist/agentwatch.js.map +1 -1
- package/packages/host/dist/alwayson.d.ts +18 -0
- package/packages/host/dist/alwayson.js +159 -0
- package/packages/host/dist/alwayson.js.map +1 -0
- package/packages/host/dist/answergate.d.ts +3 -7
- package/packages/host/dist/answergate.js.map +1 -1
- package/packages/host/dist/attentionstore.d.ts +94 -0
- package/packages/host/dist/attentionstore.js +232 -0
- package/packages/host/dist/attentionstore.js.map +1 -0
- package/packages/host/dist/backends/claude-sources.d.ts +2 -0
- package/packages/host/dist/backends/claude-sources.js +12 -0
- package/packages/host/dist/backends/claude-sources.js.map +1 -1
- package/packages/host/dist/backends/claude.js +3 -2
- package/packages/host/dist/backends/claude.js.map +1 -1
- package/packages/host/dist/backends/derive.js +1 -0
- package/packages/host/dist/backends/derive.js.map +1 -1
- package/packages/host/dist/backends/overhead.d.ts +7 -5
- package/packages/host/dist/backends/overhead.js +15 -13
- package/packages/host/dist/backends/overhead.js.map +1 -1
- package/packages/host/dist/backends/registry.js +4 -1
- package/packages/host/dist/backends/registry.js.map +1 -1
- package/packages/host/dist/backends/types.d.ts +2 -0
- package/packages/host/dist/besidespend.d.ts +22 -0
- package/packages/host/dist/besidespend.js +65 -0
- package/packages/host/dist/besidespend.js.map +1 -0
- package/packages/host/dist/boxkit.d.ts +19 -0
- package/packages/host/dist/boxkit.js +38 -0
- package/packages/host/dist/boxkit.js.map +1 -0
- package/packages/host/dist/branchrules.d.ts +14 -0
- package/packages/host/dist/branchrules.js +47 -0
- package/packages/host/dist/branchrules.js.map +1 -0
- package/packages/host/dist/budget.d.ts +3 -2
- package/packages/host/dist/budget.js +5 -3
- package/packages/host/dist/budget.js.map +1 -1
- package/packages/host/dist/builds.d.ts +31 -1
- package/packages/host/dist/builds.js +55 -3
- package/packages/host/dist/builds.js.map +1 -1
- package/packages/host/dist/buildversions.d.ts +2 -0
- package/packages/host/dist/buildversions.js +36 -0
- package/packages/host/dist/buildversions.js.map +1 -0
- package/packages/host/dist/burnwatch.d.ts +23 -11
- package/packages/host/dist/burnwatch.js +57 -3
- package/packages/host/dist/burnwatch.js.map +1 -1
- package/packages/host/dist/changebrief.d.ts +37 -0
- package/packages/host/dist/changebrief.js +157 -0
- package/packages/host/dist/changebrief.js.map +1 -0
- package/packages/host/dist/cli/index.js +1 -1
- package/packages/host/dist/cli/index.js.map +1 -1
- package/packages/host/dist/clihealth.d.ts +2 -0
- package/packages/host/dist/clihealth.js +11 -2
- package/packages/host/dist/clihealth.js.map +1 -1
- package/packages/host/dist/compliance.d.ts +5 -1
- package/packages/host/dist/compliance.js +70 -31
- package/packages/host/dist/compliance.js.map +1 -1
- package/packages/host/dist/composer.d.ts +3 -1
- package/packages/host/dist/composer.js +3 -1
- package/packages/host/dist/composer.js.map +1 -1
- package/packages/host/dist/context.js +29 -4
- package/packages/host/dist/context.js.map +1 -1
- package/packages/host/dist/convlog.d.ts +1 -1
- package/packages/host/dist/convlog.js +1 -1
- package/packages/host/dist/costwindow.d.ts +25 -0
- package/packages/host/dist/costwindow.js +63 -1
- package/packages/host/dist/costwindow.js.map +1 -1
- package/packages/host/dist/ctxlog/ctxagents.js +16 -25
- package/packages/host/dist/ctxlog/ctxagents.js.map +1 -1
- package/packages/host/dist/ctxlog/ctxcursor.d.ts +36 -1
- package/packages/host/dist/ctxlog/ctxcursor.js +96 -2
- package/packages/host/dist/ctxlog/ctxcursor.js.map +1 -1
- package/packages/host/dist/ctxlog/ctxproject.js +2 -1
- package/packages/host/dist/ctxlog/ctxproject.js.map +1 -1
- package/packages/host/dist/ctxlog/ctxupdate.js +30 -24
- package/packages/host/dist/ctxlog/ctxupdate.js.map +1 -1
- package/packages/host/dist/ctxlog/usagerecord.d.ts +28 -0
- package/packages/host/dist/ctxlog/usagerecord.js +81 -0
- package/packages/host/dist/ctxlog/usagerecord.js.map +1 -0
- package/packages/host/dist/diskwatch.d.ts +4 -6
- package/packages/host/dist/diskwatch.js +3 -1
- package/packages/host/dist/diskwatch.js.map +1 -1
- package/packages/host/dist/eraseen.d.ts +6 -0
- package/packages/host/dist/eraseen.js +100 -0
- package/packages/host/dist/eraseen.js.map +1 -0
- package/packages/host/dist/explainjob.d.ts +24 -0
- package/packages/host/dist/explainjob.js +80 -0
- package/packages/host/dist/explainjob.js.map +1 -0
- package/packages/host/dist/exposure.d.ts +56 -0
- package/packages/host/dist/exposure.js +371 -0
- package/packages/host/dist/exposure.js.map +1 -0
- package/packages/host/dist/exposurepush.d.ts +28 -0
- package/packages/host/dist/exposurepush.js +136 -0
- package/packages/host/dist/exposurepush.js.map +1 -0
- package/packages/host/dist/exposurerun.d.ts +18 -0
- package/packages/host/dist/exposurerun.js +126 -0
- package/packages/host/dist/exposurerun.js.map +1 -0
- package/packages/host/dist/exposurewatch.d.ts +29 -0
- package/packages/host/dist/exposurewatch.js +127 -0
- package/packages/host/dist/exposurewatch.js.map +1 -0
- package/packages/host/dist/extensions/scorecard/host/engine.d.mts +54 -0
- package/packages/host/dist/extensions/scorecard/host/engine.mjs +303 -0
- package/packages/host/dist/extensions/scorecard/host/engine.mjs.map +1 -0
- package/packages/host/dist/extensions/scorecard/host/gitslug.d.mts +5 -0
- package/packages/host/dist/extensions/scorecard/host/gitslug.mjs +45 -0
- package/packages/host/dist/extensions/scorecard/host/gitslug.mjs.map +1 -0
- package/packages/host/dist/extensions/scorecard/host/index.d.mts +15 -0
- package/packages/host/dist/extensions/scorecard/host/index.mjs +47 -0
- package/packages/host/dist/extensions/scorecard/host/index.mjs.map +1 -0
- package/packages/host/dist/extensions/scorecard/host/store.d.mts +12 -0
- package/packages/host/dist/extensions/scorecard/host/store.mjs +91 -0
- package/packages/host/dist/extensions/scorecard/host/store.mjs.map +1 -0
- package/packages/host/dist/extensions/scorecard/shared/logic.d.mts +42 -0
- package/packages/host/dist/extensions/scorecard/shared/logic.mjs +170 -0
- package/packages/host/dist/extensions/scorecard/shared/logic.mjs.map +1 -0
- package/packages/host/dist/extensions/scorecard/shared/wire.d.mts +140 -0
- package/packages/host/dist/extensions/scorecard/shared/wire.mjs +29 -0
- package/packages/host/dist/extensions/scorecard/shared/wire.mjs.map +1 -0
- package/packages/host/dist/files.d.ts +14 -12
- package/packages/host/dist/files.js +64 -94
- package/packages/host/dist/files.js.map +1 -1
- package/packages/host/dist/forge/github.d.ts +3 -0
- package/packages/host/dist/forge/github.js +96 -0
- package/packages/host/dist/forge/github.js.map +1 -0
- package/packages/host/dist/forge/index.d.ts +14 -0
- package/packages/host/dist/forge/index.js +32 -0
- package/packages/host/dist/forge/index.js.map +1 -0
- package/packages/host/dist/forge/types.d.ts +58 -0
- package/packages/host/dist/forge/types.js +2 -0
- package/packages/host/dist/forge/types.js.map +1 -0
- package/packages/host/dist/git.d.ts +41 -16
- package/packages/host/dist/git.js +162 -101
- package/packages/host/dist/git.js.map +1 -1
- package/packages/host/dist/gitnotify.d.ts +54 -0
- package/packages/host/dist/gitnotify.js +167 -0
- package/packages/host/dist/gitnotify.js.map +1 -0
- package/packages/host/dist/healthwatch.d.ts +2 -1
- package/packages/host/dist/healthwatch.js +4 -2
- package/packages/host/dist/healthwatch.js.map +1 -1
- package/packages/host/dist/hoststore.js +2 -2
- package/packages/host/dist/hoststore.js.map +1 -1
- package/packages/host/dist/intents/adapters.js +68 -19
- package/packages/host/dist/intents/adapters.js.map +1 -1
- package/packages/host/dist/intents/clock.d.ts +6 -3
- package/packages/host/dist/intents/clock.js +19 -5
- package/packages/host/dist/intents/clock.js.map +1 -1
- package/packages/host/dist/intents/contract.d.ts +15 -5
- package/packages/host/dist/intents/contract.js.map +1 -1
- package/packages/host/dist/intents/disk.d.ts +16 -0
- package/packages/host/dist/intents/disk.js +26 -1
- package/packages/host/dist/intents/disk.js.map +1 -1
- package/packages/host/dist/intents/fire.js +7 -1
- package/packages/host/dist/intents/fire.js.map +1 -1
- package/packages/host/dist/intents/ladder.js +3 -1
- package/packages/host/dist/intents/ladder.js.map +1 -1
- package/packages/host/dist/intents/manager.d.ts +3 -3
- package/packages/host/dist/intents/manager.js +2 -2
- package/packages/host/dist/intents/manager.js.map +1 -1
- package/packages/host/dist/intents/watch.d.ts +27 -3
- package/packages/host/dist/intents/watch.js +70 -9
- package/packages/host/dist/intents/watch.js.map +1 -1
- package/packages/host/dist/intents/write.d.ts +28 -1
- package/packages/host/dist/intents/write.js +87 -2
- package/packages/host/dist/intents/write.js.map +1 -1
- package/packages/host/dist/localcistatus.d.ts +22 -0
- package/packages/host/dist/localcistatus.js +105 -0
- package/packages/host/dist/localcistatus.js.map +1 -0
- package/packages/host/dist/main.js +45 -12
- package/packages/host/dist/main.js.map +1 -1
- package/packages/host/dist/net.d.ts +2 -0
- package/packages/host/dist/net.js +11 -2
- package/packages/host/dist/net.js.map +1 -1
- package/packages/host/dist/netlog.d.ts +40 -0
- package/packages/host/dist/netlog.js +165 -0
- package/packages/host/dist/netlog.js.map +1 -0
- package/packages/host/dist/netretrycfg.d.ts +7 -0
- package/packages/host/dist/netretrycfg.js +51 -0
- package/packages/host/dist/netretrycfg.js.map +1 -0
- package/packages/host/dist/notifyprefs.d.ts +6 -2
- package/packages/host/dist/notifyprefs.js +20 -5
- package/packages/host/dist/notifyprefs.js.map +1 -1
- package/packages/host/dist/notifytypes.d.ts +63 -0
- package/packages/host/dist/notifytypes.js +2 -0
- package/packages/host/dist/notifytypes.js.map +1 -0
- package/packages/host/dist/opendeliveries.js +24 -0
- package/packages/host/dist/opendeliveries.js.map +1 -1
- package/packages/host/dist/optins.d.ts +28 -1
- package/packages/host/dist/optins.js +96 -4
- package/packages/host/dist/optins.js.map +1 -1
- package/packages/host/dist/peers/agentpeer.js +1 -1
- package/packages/host/dist/peers/agentpeer.js.map +1 -1
- package/packages/host/dist/peers/jobs.d.ts +2 -4
- package/packages/host/dist/peers/jobs.js +6 -1
- package/packages/host/dist/peers/jobs.js.map +1 -1
- package/packages/host/dist/periodspend.d.ts +22 -3
- package/packages/host/dist/periodspend.js +44 -4
- package/packages/host/dist/periodspend.js.map +1 -1
- package/packages/host/dist/plugins/pluginapi.js +40 -10
- package/packages/host/dist/plugins/pluginapi.js.map +1 -1
- package/packages/host/dist/plugins/pluginregistry.d.ts +3 -8
- package/packages/host/dist/plugins/pluginregistry.js +1 -1
- package/packages/host/dist/plugins/pluginregistry.js.map +1 -1
- package/packages/host/dist/plugins/plugintoolkit/sessionof.d.ts +47 -0
- package/packages/host/dist/plugins/plugintoolkit/sessionof.js +136 -0
- package/packages/host/dist/plugins/plugintoolkit/sessionof.js.map +1 -0
- package/packages/host/dist/prmergestore.d.ts +31 -0
- package/packages/host/dist/prmergestore.js +106 -0
- package/packages/host/dist/prmergestore.js.map +1 -0
- package/packages/host/dist/protectmain.d.ts +35 -0
- package/packages/host/dist/protectmain.js +73 -0
- package/packages/host/dist/protectmain.js.map +1 -0
- package/packages/host/dist/prpush.d.ts +38 -0
- package/packages/host/dist/prpush.js +351 -0
- package/packages/host/dist/prpush.js.map +1 -0
- package/packages/host/dist/prs.d.ts +118 -0
- package/packages/host/dist/prs.js +681 -0
- package/packages/host/dist/prs.js.map +1 -0
- package/packages/host/dist/push.d.ts +85 -1
- package/packages/host/dist/push.js +238 -8
- package/packages/host/dist/push.js.map +1 -1
- package/packages/host/dist/pushlanded.d.ts +29 -0
- package/packages/host/dist/pushlanded.js +61 -0
- package/packages/host/dist/pushlanded.js.map +1 -0
- package/packages/host/dist/pushreach.d.ts +9 -0
- package/packages/host/dist/pushreach.js +102 -0
- package/packages/host/dist/pushreach.js.map +1 -0
- package/packages/host/dist/pushverdict.d.ts +42 -0
- package/packages/host/dist/pushverdict.js +110 -0
- package/packages/host/dist/pushverdict.js.map +1 -0
- package/packages/host/dist/render.d.ts +57 -0
- package/packages/host/dist/render.js +57 -39
- package/packages/host/dist/render.js.map +1 -1
- package/packages/host/dist/repohealth.js +5 -2
- package/packages/host/dist/repohealth.js.map +1 -1
- package/packages/host/dist/repohealthapproval.d.ts +3 -0
- package/packages/host/dist/repohealthapproval.js +92 -2
- package/packages/host/dist/repohealthapproval.js.map +1 -1
- package/packages/host/dist/repos.d.ts +7 -1
- package/packages/host/dist/repos.js +30 -3
- package/packages/host/dist/repos.js.map +1 -1
- package/packages/host/dist/reposkill.d.ts +8 -5
- package/packages/host/dist/reposkill.js +16 -11
- package/packages/host/dist/reposkill.js.map +1 -1
- package/packages/host/dist/reposkilltext.d.ts +8 -1
- package/packages/host/dist/reposkilltext.js +85 -12
- package/packages/host/dist/reposkilltext.js.map +1 -1
- package/packages/host/dist/routes/apigitspend.d.ts +2 -0
- package/packages/host/dist/routes/apigitspend.js +40 -0
- package/packages/host/dist/routes/apigitspend.js.map +1 -0
- package/packages/host/dist/routes/apihost.js +17 -0
- package/packages/host/dist/routes/apihost.js.map +1 -1
- package/packages/host/dist/routes/apiprs.d.ts +2 -0
- package/packages/host/dist/routes/apiprs.js +47 -0
- package/packages/host/dist/routes/apiprs.js.map +1 -0
- package/packages/host/dist/routes/apirepofiles.js +13 -1
- package/packages/host/dist/routes/apirepofiles.js.map +1 -1
- package/packages/host/dist/routes/apirepowork.d.ts +6 -0
- package/packages/host/dist/routes/apirepowork.js +42 -33
- package/packages/host/dist/routes/apirepowork.js.map +1 -1
- package/packages/host/dist/routes/apiroutes.js +2 -1
- package/packages/host/dist/routes/apiroutes.js.map +1 -1
- package/packages/host/dist/routes/apisession.js +24 -0
- package/packages/host/dist/routes/apisession.js.map +1 -1
- package/packages/host/dist/routes/apistats.js +12 -7
- package/packages/host/dist/routes/apistats.js.map +1 -1
- package/packages/host/dist/routes/apisystem.js +23 -1
- package/packages/host/dist/routes/apisystem.js.map +1 -1
- package/packages/host/dist/routes/apitable.d.ts +10 -0
- package/packages/host/dist/routes/apitable.js.map +1 -1
- package/packages/host/dist/routes/apiweekburn.d.ts +2 -0
- package/packages/host/dist/routes/apiweekburn.js +30 -0
- package/packages/host/dist/routes/apiweekburn.js.map +1 -0
- package/packages/host/dist/routes/session.js +10 -0
- package/packages/host/dist/routes/session.js.map +1 -1
- package/packages/host/dist/routes/system.js +34 -6
- package/packages/host/dist/routes/system.js.map +1 -1
- package/packages/host/dist/routes/types.d.ts +29 -21
- package/packages/host/dist/routes/work/workbuild.js +3 -2
- package/packages/host/dist/routes/work/workbuild.js.map +1 -1
- package/packages/host/dist/routes/work/workintent.js +6 -2
- package/packages/host/dist/routes/work/workintent.js.map +1 -1
- package/packages/host/dist/routes/work/workschedule.js +33 -3
- package/packages/host/dist/routes/work/workschedule.js.map +1 -1
- package/packages/host/dist/screenlog.d.ts +20 -0
- package/packages/host/dist/screenlog.js +40 -0
- package/packages/host/dist/screenlog.js.map +1 -1
- package/packages/host/dist/server/billingwire.d.ts +3 -1
- package/packages/host/dist/server/billingwire.js +4 -2
- package/packages/host/dist/server/billingwire.js.map +1 -1
- package/packages/host/dist/server/clients.d.ts +14 -24
- package/packages/host/dist/server/clients.js +81 -11
- package/packages/host/dist/server/clients.js.map +1 -1
- package/packages/host/dist/server/ctx.d.ts +2 -0
- package/packages/host/dist/server/ctxseal.d.ts +1 -1
- package/packages/host/dist/server/ctxseal.js +6 -6
- package/packages/host/dist/server/ctxseal.js.map +1 -1
- package/packages/host/dist/server/deliveries.js +4 -2
- package/packages/host/dist/server/deliveries.js.map +1 -1
- package/packages/host/dist/server/http.js +2 -2
- package/packages/host/dist/server/http.js.map +1 -1
- package/packages/host/dist/server/intentDeps.js +13 -6
- package/packages/host/dist/server/intentDeps.js.map +1 -1
- package/packages/host/dist/server/intentEvents.js +9 -4
- package/packages/host/dist/server/intentEvents.js.map +1 -1
- package/packages/host/dist/server/scan.js +23 -1
- package/packages/host/dist/server/scan.js.map +1 -1
- package/packages/host/dist/server/sessionEvents.js +40 -15
- package/packages/host/dist/server/sessionEvents.js.map +1 -1
- package/packages/host/dist/server/shutdown.d.ts +3 -1
- package/packages/host/dist/server/shutdown.js +9 -1
- package/packages/host/dist/server/shutdown.js.map +1 -1
- package/packages/host/dist/sessionbudget.d.ts +2 -0
- package/packages/host/dist/sessionbudget.js +17 -6
- package/packages/host/dist/sessionbudget.js.map +1 -1
- package/packages/host/dist/sessions/agentpoll.d.ts +42 -0
- package/packages/host/dist/sessions/agentpoll.js +193 -0
- package/packages/host/dist/sessions/agentpoll.js.map +1 -0
- package/packages/host/dist/sessions/apiretry.d.ts +106 -0
- package/packages/host/dist/sessions/apiretry.js +387 -0
- package/packages/host/dist/sessions/apiretry.js.map +1 -0
- package/packages/host/dist/sessions/askwatch.d.ts +62 -0
- package/packages/host/dist/sessions/askwatch.js +169 -0
- package/packages/host/dist/sessions/askwatch.js.map +1 -0
- package/packages/host/dist/sessions/boxes.d.ts +2 -23
- package/packages/host/dist/sessions/boxes.js +10 -664
- package/packages/host/dist/sessions/boxes.js.map +1 -1
- package/packages/host/dist/sessions/boxread.d.ts +47 -0
- package/packages/host/dist/sessions/boxread.js +628 -0
- package/packages/host/dist/sessions/boxread.js.map +1 -0
- package/packages/host/dist/sessions/core.d.ts +22 -1
- package/packages/host/dist/sessions/ctxseries.js +3 -0
- package/packages/host/dist/sessions/ctxseries.js.map +1 -1
- package/packages/host/dist/sessions/drive.d.ts +20 -6
- package/packages/host/dist/sessions/drive.js +45 -12
- package/packages/host/dist/sessions/drive.js.map +1 -1
- package/packages/host/dist/sessions/endsession.d.ts +11 -0
- package/packages/host/dist/sessions/endsession.js +71 -0
- package/packages/host/dist/sessions/endsession.js.map +1 -0
- package/packages/host/dist/sessions/haltall.d.ts +14 -0
- package/packages/host/dist/sessions/haltall.js +32 -1
- package/packages/host/dist/sessions/haltall.js.map +1 -1
- package/packages/host/dist/sessions/knobs.d.ts +11 -0
- package/packages/host/dist/sessions/knobs.js +12 -0
- package/packages/host/dist/sessions/knobs.js.map +1 -1
- package/packages/host/dist/sessions/record.js +7 -2
- package/packages/host/dist/sessions/record.js.map +1 -1
- package/packages/host/dist/sessions/resume.d.ts +17 -0
- package/packages/host/dist/sessions/resume.js +65 -11
- package/packages/host/dist/sessions/resume.js.map +1 -1
- package/packages/host/dist/sessions/roster.js +3 -0
- package/packages/host/dist/sessions/roster.js.map +1 -1
- package/packages/host/dist/sessions/sidechannel.d.ts +1 -1
- package/packages/host/dist/sessions/sidechannel.js +2 -2
- package/packages/host/dist/sessions/tmux.js +21 -2
- package/packages/host/dist/sessions/tmux.js.map +1 -1
- package/packages/host/dist/sessions/turn.d.ts +15 -58
- package/packages/host/dist/sessions/turn.js +19 -358
- package/packages/host/dist/sessions/turn.js.map +1 -1
- package/packages/host/dist/sessions.d.ts +10 -7
- package/packages/host/dist/sessions.js +31 -79
- package/packages/host/dist/sessions.js.map +1 -1
- package/packages/host/dist/settle.d.ts +30 -2
- package/packages/host/dist/settle.js +94 -49
- package/packages/host/dist/settle.js.map +1 -1
- package/packages/host/dist/setupprefs.d.ts +26 -1
- package/packages/host/dist/setupprefs.js +49 -1
- package/packages/host/dist/setupprefs.js.map +1 -1
- package/packages/host/dist/setupwatch.d.ts +10 -8
- package/packages/host/dist/setupwatch.js +19 -16
- package/packages/host/dist/setupwatch.js.map +1 -1
- package/packages/host/dist/sidecar/sidecarname.d.ts +2 -0
- package/packages/host/dist/sidecar/sidecarname.js +5 -1
- package/packages/host/dist/sidecar/sidecarname.js.map +1 -1
- package/packages/host/dist/sidecar/sidecarroute.d.ts +1 -1
- package/packages/host/dist/sidecar/sidecarroute.js +5 -0
- package/packages/host/dist/sidecar/sidecarroute.js.map +1 -1
- package/packages/host/dist/sidecar.d.ts +1 -1
- package/packages/host/dist/sidecar.js +1 -1
- package/packages/host/dist/sidecar.js.map +1 -1
- package/packages/host/dist/tokenscan.d.ts +4 -4
- package/packages/host/dist/tokenscan.js +18 -37
- package/packages/host/dist/tokenscan.js.map +1 -1
- package/packages/host/dist/tokenstats.js +16 -18
- package/packages/host/dist/tokenstats.js.map +1 -1
- package/packages/host/dist/transcript/transcriptparse.js +17 -26
- package/packages/host/dist/transcript/transcriptparse.js.map +1 -1
- package/packages/host/dist/transcript/transcriptturns.d.ts +29 -0
- package/packages/host/dist/transcript/transcriptturns.js +27 -0
- package/packages/host/dist/transcript/transcriptturns.js.map +1 -1
- package/packages/host/dist/transcript.d.ts +1 -1
- package/packages/host/dist/transcript.js +1 -1
- package/packages/host/dist/transcript.js.map +1 -1
- package/packages/host/dist/usagesources.d.ts +1 -1
- package/packages/host/dist/usagesources.js +7 -2
- package/packages/host/dist/usagesources.js.map +1 -1
- package/packages/host/dist/visualskill.js +2 -2
- package/packages/host/dist/weekburn.d.ts +79 -0
- package/packages/host/dist/weekburn.js +276 -0
- package/packages/host/dist/weekburn.js.map +1 -0
- package/packages/host/dist/worktreeleftover.d.ts +9 -0
- package/packages/host/dist/worktreeleftover.js +17 -1
- package/packages/host/dist/worktreeleftover.js.map +1 -1
- package/packages/web/dist/assets/demo-DsZGy-MC.js +24 -0
- package/packages/web/dist/assets/icons-eqlvjswV.js +1 -0
- package/packages/web/dist/assets/index-GHwJuQb3.js +169 -0
- package/packages/web/dist/assets/index-VzDSZwwH.css +1 -0
- package/packages/web/dist/assets/shared-BWk5jXWb.js +49 -0
- package/packages/web/dist/assets/sheets-Dj-0m0DB.js +232 -0
- package/packages/web/dist/assets/{sheets-Bjv2L-cG.css → sheets-DoUhPGK0.css} +1 -1
- package/packages/web/dist/build-id.txt +1 -1
- package/packages/web/dist/buildstamp.json +1 -0
- package/packages/web/dist/index.html +7 -7
- package/packages/web/dist/sw.js +18 -3
- package/release.json +7 -4
- package/scripts/windows/wsl-setup.sh +10 -1
- package/tools/repohealth/constants.mjs +21 -1
- package/tools/repohealth/fixture.json +493 -30
- package/tools/repohealth/lang/typescript-resolve.mjs +354 -0
- package/tools/repohealth/metrics/graph.mjs +258 -0
- package/tools/repohealth/metrics/size.mjs +1 -1
- package/tools/repohealth/own.mjs +4 -4
- package/tools/repohealth/packs/c.mjs +4 -0
- package/tools/repohealth/packs/common.mjs +4 -0
- package/tools/repohealth/packs/dart.mjs +4 -0
- package/tools/repohealth/packs/kotlin.mjs +8 -0
- package/tools/repohealth/packs/python.mjs +8 -0
- package/tools/repohealth/packs/shell.mjs +4 -0
- package/tools/repohealth/packs/typescript.mjs +278 -7
- package/tools/repohealth/readings.mjs +39 -0
- package/tools/repohealth/series.mjs +1 -0
- package/tools/repohealth/snapshot.mjs +14 -0
- package/tools/repohealth/types.mjs +12 -0
- package/tools/repohealth.mjs +2 -0
- package/packages/web/dist/assets/demo-CXlqlYE4.js +0 -23
- package/packages/web/dist/assets/icons-BbqDBVjw.js +0 -1
- package/packages/web/dist/assets/index-CgPoyb3Y.css +0 -1
- package/packages/web/dist/assets/index-D5JKj8DK.js +0 -169
- package/packages/web/dist/assets/shared-eyaskl5l.js +0 -47
- package/packages/web/dist/assets/sheets-BzzL2re1.js +0 -204
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// healthindex/score: The absolute score: per-entry scores, alerts, the capped headline, the weekly series. Barrel: ../healthindex.ts (read the header there).
|
|
2
|
+
import { HEALTH_ENTRIES, HEALTH_GOOD, HEALTH_SCORE_CAP_GAP, HEALTH_ALERT_WARN, HEALTH_ALERT_SEVERE } from "./types.js";
|
|
3
|
+
import { healthScore, healthWeeks, healthContextGood, healthEntryReadings, centralOf, treeOf, DAY_MS } from "./readings.js";
|
|
4
|
+
import { wordOf } from "../wordof.js";
|
|
5
|
+
const daysBetween = (a, b) => Math.round((Date.parse(`${b}T00:00:00Z`) - Date.parse(`${a}T00:00:00Z`)) / DAY_MS);
|
|
6
|
+
// ── words: one wording for the phone and VS Code ────────────────────────────
|
|
7
|
+
/** A whole number with thousands separators, locale-free: `8,397`. */
|
|
8
|
+
const commas = (n) => Math.round(n).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
9
|
+
const pct = (x) => `${Math.round(x * 100)}%`;
|
|
10
|
+
const oneDp = (x) => (Math.round(x * 10) / 10).toFixed(1);
|
|
11
|
+
/** Plain names for an entry, as the cap sentence names it. */
|
|
12
|
+
export const HEALTH_ENTRY_LABEL = {
|
|
13
|
+
size: "file length",
|
|
14
|
+
retouch: "re-touches",
|
|
15
|
+
hatches: "escape hatches",
|
|
16
|
+
context: "CLAUDE.md + skill descriptions",
|
|
17
|
+
untested: "untested modules",
|
|
18
|
+
};
|
|
19
|
+
function alertText(level, subject, value, good, path) {
|
|
20
|
+
const body = (() => {
|
|
21
|
+
// closed: the subject comes from this file's own `alertOf` literals
|
|
22
|
+
switch (subject) {
|
|
23
|
+
case "max":
|
|
24
|
+
return `${path ?? "the longest file"} is ${commas(value)} lines (good: under ${commas(good)})`;
|
|
25
|
+
case "lineMean":
|
|
26
|
+
return `the average line sits in a file of ${commas(value)} lines (good: under ${commas(good)})`;
|
|
27
|
+
case "retouch":
|
|
28
|
+
return `${pct(value)} of recent file edits rework the edit before (good: under ${pct(good)})`;
|
|
29
|
+
case "hatches":
|
|
30
|
+
return `${oneDp(value)} unexplained escape hatches per 1,000 lines (good: under ${oneDp(good)})`;
|
|
31
|
+
case "context":
|
|
32
|
+
return `CLAUDE.md + skill descriptions are ${commas(value)} chars (good: under ${commas(good)})`;
|
|
33
|
+
case "untested":
|
|
34
|
+
return `${pct(value)} of source files have no test reaching them (good: under ${pct(good)})`;
|
|
35
|
+
}
|
|
36
|
+
})();
|
|
37
|
+
return `${level}: ${body}`;
|
|
38
|
+
}
|
|
39
|
+
function alertOf(entry, subject, value, good, path) {
|
|
40
|
+
const score = healthScore(value, good);
|
|
41
|
+
if (!(score < HEALTH_ALERT_WARN))
|
|
42
|
+
return null;
|
|
43
|
+
const level = score < HEALTH_ALERT_SEVERE ? "severe" : "warn";
|
|
44
|
+
const p = path ?? undefined;
|
|
45
|
+
return { level, entry, subject, value, good, score, ...(p ? { path: p } : {}), text: alertText(level, subject, value, good, p) };
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The cap, said once: `null` when the cap did not set the number. The worst
|
|
49
|
+
* entry's score is derived (`value − HEALTH_SCORE_CAP_GAP`), so the wire
|
|
50
|
+
* summary can be worded from its three fields alone.
|
|
51
|
+
*/
|
|
52
|
+
export function healthCapWords(s) {
|
|
53
|
+
if (!s.cappedBy || !(s.value < s.mean))
|
|
54
|
+
return null;
|
|
55
|
+
const worst = Math.round(s.value - HEALTH_SCORE_CAP_GAP);
|
|
56
|
+
return `Capped at ${Math.round(s.value)} by ${wordOf(HEALTH_ENTRY_LABEL, s.cappedBy, "an entry this app version cannot name")} (${worst} of 100): the entries average ${Math.round(s.mean)}, and the score stays within ${HEALTH_SCORE_CAP_GAP} of its worst entry.`;
|
|
57
|
+
}
|
|
58
|
+
/** One week's score from its readings; null when any enabled entry is absent, or none is enabled. */
|
|
59
|
+
function scoreWeek(r, disabled, contextWarnChars) {
|
|
60
|
+
const enabled = HEALTH_ENTRIES.filter((e) => !disabled.includes(e));
|
|
61
|
+
if (enabled.length === 0 || enabled.some((e) => r.values[e] === undefined))
|
|
62
|
+
return null;
|
|
63
|
+
const ctxGood = healthContextGood(contextWarnChars);
|
|
64
|
+
const scores = {};
|
|
65
|
+
let sizeParts = null;
|
|
66
|
+
const alerts = [];
|
|
67
|
+
for (const e of enabled) {
|
|
68
|
+
const v = r.values[e];
|
|
69
|
+
if (e === "size") {
|
|
70
|
+
const m = r.max;
|
|
71
|
+
sizeParts = {
|
|
72
|
+
lineMean: { value: v, score: healthScore(v, HEALTH_GOOD.lineMean) },
|
|
73
|
+
max: { value: m.value, score: healthScore(m.value, HEALTH_GOOD.max), path: m.path },
|
|
74
|
+
};
|
|
75
|
+
scores.size = Math.sqrt(sizeParts.lineMean.score * sizeParts.max.score);
|
|
76
|
+
// Size alerts on its sub-readings: the blend is under a line only if one
|
|
77
|
+
// of them is, and the sub-reading is what can be named.
|
|
78
|
+
const a1 = alertOf("size", "lineMean", v, HEALTH_GOOD.lineMean);
|
|
79
|
+
const a2 = alertOf("size", "max", m.value, HEALTH_GOOD.max, m.path);
|
|
80
|
+
if (a1)
|
|
81
|
+
alerts.push(a1);
|
|
82
|
+
if (a2)
|
|
83
|
+
alerts.push(a2);
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
const good = e === "context" ? ctxGood : HEALTH_GOOD[e];
|
|
87
|
+
scores[e] = healthScore(v, good);
|
|
88
|
+
const a = alertOf(e, e, v, good);
|
|
89
|
+
if (a)
|
|
90
|
+
alerts.push(a);
|
|
91
|
+
}
|
|
92
|
+
const n = enabled.length;
|
|
93
|
+
// A score of 0 cannot occur (good > 0, value finite), so ln is finite.
|
|
94
|
+
const mean = Math.exp(enabled.reduce((s, e) => s + Math.log(scores[e]), 0) / n);
|
|
95
|
+
let worst = enabled[0];
|
|
96
|
+
for (const e of enabled)
|
|
97
|
+
if (scores[e] < scores[worst])
|
|
98
|
+
worst = e;
|
|
99
|
+
const capped = scores[worst] + HEALTH_SCORE_CAP_GAP;
|
|
100
|
+
const index = Math.min(mean, capped);
|
|
101
|
+
alerts.sort((a, b) => a.score - b.score);
|
|
102
|
+
return { index, mean, scores, sizeParts, cappedBy: capped < mean ? worst : null, alerts, enabled };
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The scored series. `null` when no week has every enabled entry — no score
|
|
106
|
+
* is no series, never a number nobody measured.
|
|
107
|
+
*/
|
|
108
|
+
export function healthIndex(rows, contextWarnChars) {
|
|
109
|
+
const points = [];
|
|
110
|
+
for (const { week, row } of healthWeeks(rows)) {
|
|
111
|
+
const c = centralOf(row);
|
|
112
|
+
const readings = healthEntryReadings(row);
|
|
113
|
+
const s = scoreWeek(readings, c.disabled, contextWarnChars);
|
|
114
|
+
if (!s)
|
|
115
|
+
continue;
|
|
116
|
+
const prereg = typeof row.prereg === "string" ? row.prereg : null;
|
|
117
|
+
const prev = points[points.length - 1];
|
|
118
|
+
const base = {
|
|
119
|
+
week, index: s.index, mean: s.mean, scores: s.scores, sizeParts: s.sizeParts,
|
|
120
|
+
cappedBy: s.cappedBy, alerts: s.alerts, values: readings.values, prereg,
|
|
121
|
+
central: c.fp, disabled: c.disabled, overridden: c.overridden, tree: treeOf(row),
|
|
122
|
+
};
|
|
123
|
+
if (!prev) {
|
|
124
|
+
points.push({ ...base, gap: false, lnLink: null, comparable: 0, contributions: {}, spanDays: null });
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const spanDays = daysBetween(prev.week, week);
|
|
128
|
+
const gapReason = prev.prereg !== prereg ? "prereg" : prev.central !== c.fp ? "central" : null;
|
|
129
|
+
if (gapReason) {
|
|
130
|
+
points.push({ ...base, gap: true, lnLink: null, comparable: 0, contributions: {}, spanDays, gapReason });
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
// Same fingerprint ⇒ same enabled set, so every entry is in both weeks.
|
|
134
|
+
const n = s.enabled.length;
|
|
135
|
+
const contributions = {};
|
|
136
|
+
for (const e of s.enabled) {
|
|
137
|
+
const a = prev.scores[e];
|
|
138
|
+
const b = s.scores[e];
|
|
139
|
+
if (a !== undefined && b !== undefined)
|
|
140
|
+
contributions[e] = (prev.mean * (Math.log(b) - Math.log(a))) / n;
|
|
141
|
+
}
|
|
142
|
+
points.push({
|
|
143
|
+
...base, gap: false, lnLink: Math.log(s.index / prev.index), comparable: n, contributions, spanDays,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (points.length === 0)
|
|
147
|
+
return null;
|
|
148
|
+
return { baselineWeek: points[0].week, points };
|
|
149
|
+
}
|
|
150
|
+
/** One row by the SAME formula a week uses (`scoreWeek`); null when an enabled entry is absent. */
|
|
151
|
+
export function healthRowScore(row, contextWarnChars) {
|
|
152
|
+
const s = scoreWeek(healthEntryReadings(row), centralOf(row).disabled, contextWarnChars);
|
|
153
|
+
return s ? { index: s.index, mean: s.mean, scores: s.scores, cappedBy: s.cappedBy } : null;
|
|
154
|
+
}
|
|
155
|
+
/** One scored commit (a series row) for the phone's commits axis. No lnLink, contributions or move. */
|
|
156
|
+
//# sourceMappingURL=score.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"score.js","sourceRoot":"","sources":["../../src/healthindex/score.ts"],"names":[],"mappings":"AAAA,8JAA8J;AAC9J,OAAO,EAAE,cAAc,EAAoB,WAAW,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,mBAAmB,EAAwI,MAAM,YAAY,CAAC;AAC/Q,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAA4B,mBAAmB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACtJ,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,CAAS,EAAU,EAAE,CACnD,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;AAErF,+EAA+E;AAE/E,sEAAsE;AACtE,MAAM,MAAM,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;AACrG,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC;AAC7D,MAAM,KAAK,GAAG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C,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7F,CAAC;AAED,uGAAuG"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
export declare const HEALTH_ENTRIES: readonly ["size", "retouch", "hatches", "context", "untested"];
|
|
2
|
+
export type HealthEntry = (typeof HEALTH_ENTRIES)[number];
|
|
3
|
+
/**
|
|
4
|
+
* The GOOD value of each reading — at or under it, the entry scores 100.
|
|
5
|
+
* Opinion, and PROVISIONAL: picked by the owner from the repos on this
|
|
6
|
+
* desktop on 2026-10-17, not a published standard. `retouch` most of all (a
|
|
7
|
+
* fortnight's rework rate has no long record behind it yet). A repo that
|
|
8
|
+
* disagrees overrides the value it is compared with (`central`), never these.
|
|
9
|
+
* `context` has none here: its good line IS the repo's own warn line
|
|
10
|
+
* (`contextweight.ts`): the setup sheet calls a repo lean under it, so the index
|
|
11
|
+
* must not call the same repo unhealthy.
|
|
12
|
+
*/
|
|
13
|
+
export declare const HEALTH_GOOD: {
|
|
14
|
+
/** Line-weighted mean file length, lines. */
|
|
15
|
+
readonly lineMean: 500;
|
|
16
|
+
/** Longest source file, lines. */
|
|
17
|
+
readonly max: 1000;
|
|
18
|
+
/** Share of source-file edits that rework the previous edit. Provisional. */
|
|
19
|
+
readonly retouch: 0.15;
|
|
20
|
+
/** UNEXPLAINED escape hatches per 1,000 source lines. */
|
|
21
|
+
readonly hatches: 2;
|
|
22
|
+
/** Share of source files no test reaches. */
|
|
23
|
+
readonly untested: 0.2;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Context's good line, as a share of the repo's warn line: all of it. The setup
|
|
27
|
+
* sheet calibrated that line so a well-organised repo is NOT flagged; a good
|
|
28
|
+
* line at half of it made the two instruments disagree about one number.
|
|
29
|
+
*/
|
|
30
|
+
export declare const HEALTH_CONTEXT_GOOD_SHARE = 1;
|
|
31
|
+
/** The headline never sits more than this many points above its worst entry. */
|
|
32
|
+
export declare const HEALTH_SCORE_CAP_GAP = 30;
|
|
33
|
+
/** An entry scoring under this is a `warn` alert… */
|
|
34
|
+
export declare const HEALTH_ALERT_WARN = 50;
|
|
35
|
+
/** …and under this a `severe` one. */
|
|
36
|
+
export declare const HEALTH_ALERT_SEVERE = 25;
|
|
37
|
+
/** Links of history needed before a move is called at all. */
|
|
38
|
+
export declare const HEALTH_INDEX_MIN_WEEKS = 8;
|
|
39
|
+
/** Prior rolling four-week windows needed before a MONTH move is called. */
|
|
40
|
+
export declare const HEALTH_INDEX_MIN_MONTH_WINDOWS = 4;
|
|
41
|
+
/** Width of the month horizon, in weekly points. */
|
|
42
|
+
export declare const HEALTH_INDEX_MONTH_WEEKS = 4;
|
|
43
|
+
/** A move must sit below this percentile of its own past to be a drop… */
|
|
44
|
+
export declare const HEALTH_INDEX_LOW_PCT = 10;
|
|
45
|
+
/** …or above this one to be a rise. */
|
|
46
|
+
export declare const HEALTH_INDEX_HIGH_PCT = 90;
|
|
47
|
+
/** …AND move the score by at least this many points. */
|
|
48
|
+
export declare const HEALTH_INDEX_MIN_POINTS = 2;
|
|
49
|
+
/**
|
|
50
|
+
* The context-weight warn line when the repo has none of its own: the setup
|
|
51
|
+
* checklist's `DEFAULT_CONTEXT_LIMITS.maxChars` (`contextweight.ts`), restated
|
|
52
|
+
* as a literal so this module carries no import cycle through the index.
|
|
53
|
+
* Pinned equal to it by the test.
|
|
54
|
+
*/
|
|
55
|
+
export declare const HEALTH_INDEX_DEFAULT_WARN_CHARS = 16000;
|
|
56
|
+
/** The engine's `context.reason` for a tree with no CLAUDE.md (`metrics/context.mjs`; a tools test pins the two equal). */
|
|
57
|
+
export declare const HEALTH_NO_CLAUDE_MD = "no CLAUDE.md at this commit";
|
|
58
|
+
/**
|
|
59
|
+
* The fields of one series row this module reads. Everything is optional
|
|
60
|
+
* because a row is parsed JSON: a family can be absent (`{value: null,
|
|
61
|
+
* reason}`) or missing outright, and either way that entry is absent.
|
|
62
|
+
*/
|
|
63
|
+
export interface HealthSeriesRow {
|
|
64
|
+
sha?: string;
|
|
65
|
+
day: string;
|
|
66
|
+
ts: number;
|
|
67
|
+
batch?: boolean;
|
|
68
|
+
prereg?: string;
|
|
69
|
+
size?: {
|
|
70
|
+
value?: {
|
|
71
|
+
p95?: unknown;
|
|
72
|
+
max?: unknown;
|
|
73
|
+
maxPath?: unknown;
|
|
74
|
+
lineMean?: unknown;
|
|
75
|
+
} | null;
|
|
76
|
+
} | null;
|
|
77
|
+
retouch?: {
|
|
78
|
+
value?: {
|
|
79
|
+
rate?: unknown;
|
|
80
|
+
} | null;
|
|
81
|
+
} | null;
|
|
82
|
+
hatches?: {
|
|
83
|
+
value?: Record<string, unknown> | null;
|
|
84
|
+
} | null;
|
|
85
|
+
context?: {
|
|
86
|
+
value?: {
|
|
87
|
+
claudeMdChars?: unknown;
|
|
88
|
+
descChars?: unknown;
|
|
89
|
+
} | null;
|
|
90
|
+
reason?: unknown;
|
|
91
|
+
} | null;
|
|
92
|
+
untested?: {
|
|
93
|
+
value?: unknown[] | null;
|
|
94
|
+
} | null;
|
|
95
|
+
classics?: {
|
|
96
|
+
value?: {
|
|
97
|
+
loc?: unknown;
|
|
98
|
+
files?: unknown;
|
|
99
|
+
} | null;
|
|
100
|
+
} | null;
|
|
101
|
+
/** The repo's disables and overrides in force on this row; absent = none. */
|
|
102
|
+
central?: HealthRowCentral | null;
|
|
103
|
+
}
|
|
104
|
+
/** `row.central` — written by the engine's `central.mjs`. */
|
|
105
|
+
export interface HealthRowCentral {
|
|
106
|
+
/** Fingerprint of what was APPLIED on this row; "" (or absent) = nothing. */
|
|
107
|
+
fp?: unknown;
|
|
108
|
+
disabled?: Record<string, {
|
|
109
|
+
why?: unknown;
|
|
110
|
+
} | null> | null;
|
|
111
|
+
override?: Record<string, {
|
|
112
|
+
value?: unknown;
|
|
113
|
+
why?: unknown;
|
|
114
|
+
} | null> | null;
|
|
115
|
+
}
|
|
116
|
+
/** Size's two sub-readings, each with its value and score. */
|
|
117
|
+
export interface HealthSizeParts {
|
|
118
|
+
lineMean: {
|
|
119
|
+
value: number;
|
|
120
|
+
score: number;
|
|
121
|
+
};
|
|
122
|
+
max: {
|
|
123
|
+
value: number;
|
|
124
|
+
score: number;
|
|
125
|
+
path: string | null;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/** Which reading an alert is about: an entry, or one of size's two sub-readings. */
|
|
129
|
+
export type HealthAlertSubject = Exclude<HealthEntry, "size"> | "lineMean" | "max";
|
|
130
|
+
export interface HealthAlert {
|
|
131
|
+
level: "warn" | "severe";
|
|
132
|
+
/** The entry the alert counts against (`size` for both sub-readings). */
|
|
133
|
+
entry: HealthEntry;
|
|
134
|
+
subject: HealthAlertSubject;
|
|
135
|
+
/** The value read (after any override) and its good line. */
|
|
136
|
+
value: number;
|
|
137
|
+
good: number;
|
|
138
|
+
score: number;
|
|
139
|
+
/** The longest file's path, on a `max` alert where the engine named it. */
|
|
140
|
+
path?: string;
|
|
141
|
+
/** One sentence: `severe: lib/a.dart is 8,397 lines (good: under 1,000)`. */
|
|
142
|
+
text: string;
|
|
143
|
+
}
|
|
144
|
+
export interface HealthIndexPoint {
|
|
145
|
+
/** The ISO week's Monday, `YYYY-MM-DD` (UTC). */
|
|
146
|
+
week: string;
|
|
147
|
+
/** The headline SCORE, 0–100: `min(mean, worst + HEALTH_SCORE_CAP_GAP)`. */
|
|
148
|
+
index: number;
|
|
149
|
+
/** Geometric mean of the enabled entries' scores, before the cap. */
|
|
150
|
+
mean: number;
|
|
151
|
+
/** Each enabled entry's score, 0–100. */
|
|
152
|
+
scores: Partial<Record<HealthEntry, number>>;
|
|
153
|
+
/** Size's two sub-readings; null where size is disabled. */
|
|
154
|
+
sizeParts: HealthSizeParts | null;
|
|
155
|
+
/** The worst entry when the cap set the headline (`index < mean`), else null. */
|
|
156
|
+
cappedBy: HealthEntry | null;
|
|
157
|
+
/** Every entry or size sub-reading under `HEALTH_ALERT_WARN`, worst first. */
|
|
158
|
+
alerts: HealthAlert[];
|
|
159
|
+
/** A prereg or `central` change since the previous scored week: the score
|
|
160
|
+
* stands as measured, but the link is not used to call a move. */
|
|
161
|
+
gap: boolean;
|
|
162
|
+
/** `ln(index / previous index)`; `null` on the first scored week and on a gap. */
|
|
163
|
+
lnLink: number | null;
|
|
164
|
+
/** How many entries the contributions split the mean's move over (0 on the first week and a gap). */
|
|
165
|
+
comparable: number;
|
|
166
|
+
/**
|
|
167
|
+
* Each entry's share of the MEAN's move, in LOG POINTS:
|
|
168
|
+
* `prevMean · (ln s_cur − ln s_prev) / n`. Log points are what is additive —
|
|
169
|
+
* the terms of a geometric mean add in log space — so these sum EXACTLY to
|
|
170
|
+
* `prevMean · ln(mean / prevMean)`. Negative = that entry's score fell
|
|
171
|
+
* (its metric rose). The cap is explained apart, by `cappedBy`.
|
|
172
|
+
*/
|
|
173
|
+
contributions: Partial<Record<HealthEntry, number>>;
|
|
174
|
+
/** The values read this week (after any override); size's is `lineMean`. */
|
|
175
|
+
values: Partial<Record<HealthEntry, number>>;
|
|
176
|
+
prereg: string | null;
|
|
177
|
+
/**
|
|
178
|
+
* Days since the previous SCORED week (Monday to Monday, so a multiple of
|
|
179
|
+
* 7); null on the first. A week with no commit has no row, and a week with a
|
|
180
|
+
* partial basket has no score, so a link over 7 days spans weeks with no
|
|
181
|
+
* score — a reader should be told before reading it as one week's move.
|
|
182
|
+
*/
|
|
183
|
+
spanDays: number | null;
|
|
184
|
+
/** Why a gap was marked: the engine's definition moved, or the repo's own
|
|
185
|
+
* `central` config moved. (`nothing` is no longer produced: every scored
|
|
186
|
+
* week has every enabled entry.) */
|
|
187
|
+
gapReason?: "prereg" | "central" | "nothing";
|
|
188
|
+
/** The repo's `central` fingerprint this week; "" = none applied. */
|
|
189
|
+
central: string;
|
|
190
|
+
/** Entries the repo disabled this week — out of the mean, not absent readings. */
|
|
191
|
+
disabled: HealthEntry[];
|
|
192
|
+
/** Entries whose value this week is the repo's override, not the engine's. */
|
|
193
|
+
overridden: HealthEntry[];
|
|
194
|
+
/** Source files and lines this week (`classics`), so growth can be stated;
|
|
195
|
+
* null where that reading was absent. */
|
|
196
|
+
tree: {
|
|
197
|
+
files: number;
|
|
198
|
+
loc: number;
|
|
199
|
+
} | null;
|
|
200
|
+
}
|
|
201
|
+
export interface HealthIndexSeries {
|
|
202
|
+
/** The first SCORED week — no longer a "100", just where the line starts. */
|
|
203
|
+
baselineWeek: string;
|
|
204
|
+
/** One point per scored week, oldest first. */
|
|
205
|
+
points: HealthIndexPoint[];
|
|
206
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// healthindex/types: The vocabulary: entries, GOOD values and thresholds, the row and point DTOs. Barrel: ../healthindex.ts (read the header there).
|
|
2
|
+
export const HEALTH_ENTRIES = ["size", "retouch", "hatches", "context", "untested"];
|
|
3
|
+
/**
|
|
4
|
+
* The GOOD value of each reading — at or under it, the entry scores 100.
|
|
5
|
+
* Opinion, and PROVISIONAL: picked by the owner from the repos on this
|
|
6
|
+
* desktop on 2026-10-17, not a published standard. `retouch` most of all (a
|
|
7
|
+
* fortnight's rework rate has no long record behind it yet). A repo that
|
|
8
|
+
* disagrees overrides the value it is compared with (`central`), never these.
|
|
9
|
+
* `context` has none here: its good line IS the repo's own warn line
|
|
10
|
+
* (`contextweight.ts`): the setup sheet calls a repo lean under it, so the index
|
|
11
|
+
* must not call the same repo unhealthy.
|
|
12
|
+
*/
|
|
13
|
+
export const HEALTH_GOOD = {
|
|
14
|
+
/** Line-weighted mean file length, lines. */
|
|
15
|
+
lineMean: 500,
|
|
16
|
+
/** Longest source file, lines. */
|
|
17
|
+
max: 1_000,
|
|
18
|
+
/** Share of source-file edits that rework the previous edit. Provisional. */
|
|
19
|
+
retouch: 0.15,
|
|
20
|
+
/** UNEXPLAINED escape hatches per 1,000 source lines. */
|
|
21
|
+
hatches: 2.0,
|
|
22
|
+
/** Share of source files no test reaches. */
|
|
23
|
+
untested: 0.2,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Context's good line, as a share of the repo's warn line: all of it. The setup
|
|
27
|
+
* sheet calibrated that line so a well-organised repo is NOT flagged; a good
|
|
28
|
+
* line at half of it made the two instruments disagree about one number.
|
|
29
|
+
*/
|
|
30
|
+
export const HEALTH_CONTEXT_GOOD_SHARE = 1.0;
|
|
31
|
+
/** The headline never sits more than this many points above its worst entry. */
|
|
32
|
+
export const HEALTH_SCORE_CAP_GAP = 30;
|
|
33
|
+
/** An entry scoring under this is a `warn` alert… */
|
|
34
|
+
export const HEALTH_ALERT_WARN = 50;
|
|
35
|
+
/** …and under this a `severe` one. */
|
|
36
|
+
export const HEALTH_ALERT_SEVERE = 25;
|
|
37
|
+
/** Links of history needed before a move is called at all. */
|
|
38
|
+
export const HEALTH_INDEX_MIN_WEEKS = 8;
|
|
39
|
+
/** Prior rolling four-week windows needed before a MONTH move is called. */
|
|
40
|
+
export const HEALTH_INDEX_MIN_MONTH_WINDOWS = 4;
|
|
41
|
+
/** Width of the month horizon, in weekly points. */
|
|
42
|
+
export const HEALTH_INDEX_MONTH_WEEKS = 4;
|
|
43
|
+
/** A move must sit below this percentile of its own past to be a drop… */
|
|
44
|
+
export const HEALTH_INDEX_LOW_PCT = 10;
|
|
45
|
+
/** …or above this one to be a rise. */
|
|
46
|
+
export const HEALTH_INDEX_HIGH_PCT = 90;
|
|
47
|
+
/** …AND move the score by at least this many points. */
|
|
48
|
+
export const HEALTH_INDEX_MIN_POINTS = 2;
|
|
49
|
+
/**
|
|
50
|
+
* The context-weight warn line when the repo has none of its own: the setup
|
|
51
|
+
* checklist's `DEFAULT_CONTEXT_LIMITS.maxChars` (`contextweight.ts`), restated
|
|
52
|
+
* as a literal so this module carries no import cycle through the index.
|
|
53
|
+
* Pinned equal to it by the test.
|
|
54
|
+
*/
|
|
55
|
+
export const HEALTH_INDEX_DEFAULT_WARN_CHARS = 16_000;
|
|
56
|
+
/** The engine's `context.reason` for a tree with no CLAUDE.md (`metrics/context.mjs`; a tools test pins the two equal). */
|
|
57
|
+
export const HEALTH_NO_CLAUDE_MD = "no CLAUDE.md at this commit";
|
|
58
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/healthindex/types.ts"],"names":[],"mappings":"AAAA,qJAAqJ;AACrJ,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAG7F;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,6CAA6C;IAC7C,QAAQ,EAAE,GAAG;IACb,kCAAkC;IAClC,GAAG,EAAE,KAAK;IACV,6EAA6E;IAC7E,OAAO,EAAE,IAAI;IACb,yDAAyD;IACzD,OAAO,EAAE,GAAG;IACZ,6CAA6C;IAC7C,QAAQ,EAAE,GAAG;CACL,CAAC;AACX;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAC7C,gFAAgF;AAChF,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,qDAAqD;AACrD,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AACpC,sCAAsC;AACtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACxC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC;AAChD,oDAAoD;AACpD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAC1C,0EAA0E;AAC1E,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,uCAAuC;AACvC,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACxC,wDAAwD;AACxD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AACzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAC;AACtD,2HAA2H;AAC3H,MAAM,CAAC,MAAM,mBAAmB,GAAG,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type HealthIndexPoint } from "./types.js";
|
|
2
|
+
/** How far back "vs 12 weeks ago" looks, in weeks. */
|
|
3
|
+
export declare const HEALTH_INDEX_VS_WEEKS = 12;
|
|
4
|
+
export interface HealthIndexVs {
|
|
5
|
+
/** `now.index / then.index` — 1.05 is five percent healthier. */
|
|
6
|
+
ratio: number;
|
|
7
|
+
/** Score points between the two (`now − then`). */
|
|
8
|
+
delta: number;
|
|
9
|
+
then: HealthIndexPoint;
|
|
10
|
+
now: HealthIndexPoint;
|
|
11
|
+
/** Weeks actually between the two points — `weeks` asked or more, since a
|
|
12
|
+
* week nobody measured has no point. The UI names `then.week`. */
|
|
13
|
+
weeks: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* "Vs 12 weeks ago": the score at `points[at]` (default the latest) against
|
|
17
|
+
* the LATEST measured point at least `weeks` earlier — however much further
|
|
18
|
+
* back that is, because a week with no commit has no row and the honest
|
|
19
|
+
* comparison names the week it actually used (`then.week`, `weeks`). Null
|
|
20
|
+
* only when no point sits that far back (a series younger than the horizon).
|
|
21
|
+
*
|
|
22
|
+
* Both ends are absolute scores, so the ratio is simply the two numbers —
|
|
23
|
+
* including any prereg or `central` change between them (the point's `gap`
|
|
24
|
+
* says one happened; the caller decides whether to say so).
|
|
25
|
+
*/
|
|
26
|
+
export declare function healthIndexVs(points: readonly HealthIndexPoint[], weeks?: number, at?: number): HealthIndexVs | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DAY_MS } from "./readings.js";
|
|
2
|
+
/** How far back "vs 12 weeks ago" looks, in weeks. */
|
|
3
|
+
export const HEALTH_INDEX_VS_WEEKS = 12;
|
|
4
|
+
/**
|
|
5
|
+
* "Vs 12 weeks ago": the score at `points[at]` (default the latest) against
|
|
6
|
+
* the LATEST measured point at least `weeks` earlier — however much further
|
|
7
|
+
* back that is, because a week with no commit has no row and the honest
|
|
8
|
+
* comparison names the week it actually used (`then.week`, `weeks`). Null
|
|
9
|
+
* only when no point sits that far back (a series younger than the horizon).
|
|
10
|
+
*
|
|
11
|
+
* Both ends are absolute scores, so the ratio is simply the two numbers —
|
|
12
|
+
* including any prereg or `central` change between them (the point's `gap`
|
|
13
|
+
* says one happened; the caller decides whether to say so).
|
|
14
|
+
*/
|
|
15
|
+
export function healthIndexVs(points, weeks = HEALTH_INDEX_VS_WEEKS, at = points.length - 1) {
|
|
16
|
+
const now = points[at];
|
|
17
|
+
if (!now || !(weeks > 0) || !Number.isFinite(now.index))
|
|
18
|
+
return null;
|
|
19
|
+
const nowT = Date.parse(`${now.week}T00:00:00Z`);
|
|
20
|
+
const target = nowT - weeks * 7 * DAY_MS;
|
|
21
|
+
for (let i = at - 1; i >= 0; i--) {
|
|
22
|
+
const t = Date.parse(`${points[i].week}T00:00:00Z`);
|
|
23
|
+
if (t > target)
|
|
24
|
+
continue;
|
|
25
|
+
const then = points[i];
|
|
26
|
+
if (!(then.index > 0))
|
|
27
|
+
return null;
|
|
28
|
+
return {
|
|
29
|
+
ratio: now.index / then.index,
|
|
30
|
+
delta: now.index - then.index,
|
|
31
|
+
then,
|
|
32
|
+
now,
|
|
33
|
+
weeks: Math.round((nowT - t) / (7 * DAY_MS)),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=vs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vs.js","sourceRoot":"","sources":["../../src/healthindex/vs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,sDAAsD;AACtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAcxC;;;;;;;;;;GAUG;AACH,MAA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ndexPoint } from "./types.js";
|
|
2
|
+
import { type HealthMove } from "./move.js";
|
|
3
|
+
/** A signed whole number with a real minus sign: `−4`, `+3`, `±0`. */
|
|
4
|
+
export declare function signedPoints(n: number): string;
|
|
5
|
+
export interface HealthWords {
|
|
6
|
+
/** Short label for the repo row: `Health 94 −4`. */
|
|
7
|
+
chip: string;
|
|
8
|
+
/** `Health score 94 (−4 this week)`. */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Names the (at most two) metrics — or the cap — that carried the move, plus a split-up note where a rise is mostly files multiplying; "" when none can be named. */
|
|
11
|
+
body: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* When the latest measured week happened, worded against the week it is now:
|
|
15
|
+
* `this week` only when they are the same ISO week — a week with no commit has
|
|
16
|
+
* no point, so the newest one can be months old — else `in the week of <Monday>`.
|
|
17
|
+
* `currentWeek` absent = the caller did not say, and the claim falls back to
|
|
18
|
+
* naming the week (never a `this week` nobody checked).
|
|
19
|
+
*/
|
|
20
|
+
export declare function healthWeekWhen(week: string, currentWeek?: string | null): string;
|
|
21
|
+
/**
|
|
22
|
+
* The notification and chip wording for a called move. `null` when there is
|
|
23
|
+
* nothing to say (no move called, or no points) — a sentence is never written
|
|
24
|
+
* around a null. `currentWeek` (the ISO week's Monday, `isoWeekOf(today)`)
|
|
25
|
+
* decides whether the latest point may be called "this week".
|
|
26
|
+
*/
|
|
27
|
+
export declare function healthMoveWords(points: readonly HealthIndexPoint[], move: HealthMove, currentWeek?: string | null): HealthWords | null;
|
|
28
|
+
/** What `RepoTarget.healthIndex` carries. */
|