Repository navigation
refactor(action-center): gather the engine's thresholds in one place - #821
Merged
Merged
Conversation
Phase 2.5 of #818. Nineteen numbers decided what the engine counts as worth reporting, and they lived in the five files that happened to read them: how far visibility must fall before it is a drop, how many prompts make an uncited-mentions pattern more than an anecdote, how long a kind rests after a cycle closes, how much a metric must move before a measurement is a result. Survivable at eleven detectors. Phase 3 brings roughly forty, and hunting through detectors to retune the engine does not scale to that. They now live in config/action-engine.js, grouped by the question each answers rather than by the file that reads it — so moving a detector later does not move its threshold. Consumers read through `resolve()` rather than importing constants, which is the seam the specification's definition-level and workspace-level overrides arrive through: when they do, no call site changes. Every value is carried over unchanged; a check confirms all nineteen still hold their previous numbers, and the existing suite passes untouched. This moves thresholds, it does not retune them. Deliberately left behind: retry counts, page sizes, poll intervals, display limits. Those have one right answer rather than a judgement worth tuning, and folding them in would bury the numbers that matter. The GSC suggestion thresholds stay put too — that subsystem produces prompt suggestions, not signals, and pulling it in would widen this past the engine. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01SQ2H6mSd9JDpmqonk2VWBj
33 of 37 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2.5 of #818.
Summary
Nineteen numbers decided what the engine counts as worth reporting, and each lived in whichever file happened to read it:
pulse/metrics.jssignals/record.jsaction-center/generate.jsaction-center/validate.jspage-opportunities.jsSurvivable at eleven detectors. Phase 3 brings roughly forty, and retuning the engine by hunting through detectors does not scale to that — so this moves before that arrives, while it is still half a day's work.
The change
server/src/config/action-engine.jsholds all nineteen, grouped by the question each answers — detection, noise, validation — rather than by the file that currently reads it, so moving a detector later does not move its threshold.Consumers read through
resolve()rather than importing constants. That is the seam the specification's resolution order arrives through:Only the first exists today.
resolve(overrides)merges one group deep, so when per-definition or per-workspace tuning lands, no call site changes.This moves thresholds, it does not retune them
Every value is carried over unchanged. A check compares all nineteen against their previous literals and confirms each still holds its old number; the existing 438-test suite passes untouched, including the detector tests that assert on these exact boundaries.
Deliberately left behind
Tests
Seven, on the config itself:
resolve()with no overrides returns the defaults themselvesRelated issue
Phase 2.5 of #818. Its exit condition — changing a detection threshold means editing configuration, not a detector — is what this implements.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsDatabase
None.
How to test
Behaviour is unchanged by construction, so the meaningful check is that nothing moved: the detector suites pass against the same boundaries they asserted before. To confirm the surface works, change
detection.visibilityDropPointsin the config and watch the drop detector's threshold move with it — one file, no hunting.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/) — 0 errorsyarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)🤖 Generated with Claude Code
https://claude.ai/code/session_01SQ2H6mSd9JDpmqonk2VWBj