Repository navigation
refactor(metrics): delete the metrics journal and model registry (XWING-2440) - #114
Merged
smith-xyz merged 1 commit intoOct 27, 2026
Conversation
…NG-2440) traust retired `metrics history`, `metrics spend` and the journal row behind `registry models spend` (now a traust-core spend event). Nothing in ops/, sweep/ or portfolio/ reads metrics/ or registry/, so both go with the facade's .metrics and .models; the validation benchmark's journal append (a no-op since history.py lost its __main__) goes too.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: smith-xyz The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
9 of 13 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.
Plan: 17-shaun-traust-core-only.md (part)
Deletes the metrics journal and model registry from the engine. Merge after traust-security/traust#294, which retires
metrics history/metrics spendand movesregistry models spendonto traust-core'sSpendService.record. That PR also freezes traust's parity tests, which usedregistry/models.pyandmetrics/{collect,attribute}_spendas oracles, so nothing in traust imports what this PR deletes.What
src/traust_engine/metrics/(history, spend, collect_spend, attribute_spend, ops) andsrc/traust_engine/registry/(models, ops), along with the facade's.metricsand.models.git grep -nE "traust_engine\.(metrics|registry)|MetricsOps|ModelsOps|\.models\(|h\.metrics" -- src testsis empty).ops/uses core'sSpendServiceand the model registry through core.portfolio/never referenced them. Insweep/,benchmark.py's scorecard ranpython -m traust_engine.metrics.history appendas a subprocess. That was already a no-op, becausehistory.pyhas no__main__(test_no_cli_entrypoints). The call and its docstring line are gone.locations.METRICS_HISTORY_REL/metrics_history()(onlymetrics/ops.pyused them) are deleted. The PENDING lists in the module docstrings drop "metrics journal". README, CODEOWNERS and the ruff per-file ignore forhistory.pyare updated to match..ratchet.jsonshrinks:metrics/history.py(contracts 2),metrics/spend.py(1),registry/models.py(1) andregistry/ops.py(1) are removed.Deleted tests
tests/test_metrics_history.pytests/test_build_spend_dashboard.pytests/test_attribute_session_spend.pySpendService.usage_summary/attribute_by); traust's frozen parity tests keep the engine's outputtests/test_model_pricing.pycost_usd/ long-prompt pricing is deleted; coreModelCatalog.costowns pricingtests/test_model_registry.pyspend_roware deleted; coreModelCatalogowns them, and traust'stest_registry_doorskeeps the engine's outputstests/test_traust_engine.py::test_metrics_journal_follows_configured_progress_tracker,::test_metrics_spend_build_uses_configured_paths,::test_models_registry_and_validate_from_context.metrics/.models, which are deletedChanged tests
tests/test_traust_engine.py::test_two_engines_are_isolated_by_their_contexth1.metrics.appendrows → each engine'ssweep._progress_tracker()follows its own context.metricsis deleted; the property (one context per engine) is unchangedtests/test_traust_engine.py::test_namespace_ops_are_cached_per_engine.metrics/.modelslinesBehaviour changes
HarnessEngine.metricsandHarnessEngine.modelsno longer exist (traust#294 removed the last callers).sweepbenchmarkscoreno longer starts a subprocess that did nothing. Output and exit codes are unchanged.Validation
make lint-fix && make test: 451 passed, 4 skipped (tree-sitter not installed), 5 subtests passed.pkgutil.walk_packages) works.RATCHETpin fromci.yml,--reference=development's.ratchet.jsonin a file): rc 0 after the shrink (it asked for exactly these four).What traust still uses from the engine
load_engine→HarnessEnginewith.sweep(sweep stages),.portfolio(portfolio graph) and.adapters(the rule lane's opengrep config). Tests also uselocations,sweep.engine,sweep.benchmarkandadapters.opengrep. All of these wait onPENDING(decision: sweep stages | portfolio graph layers).