Repository navigation
refactor: tests, rule packs and housekeeping on traust-core; engine kept for three pending ops (XWING-2440) - #291
Merged
smith-xyz merged 17 commits intoOct 27, 2026
Conversation
…-on-core' into refactor/drop-traust-engine-final # Conflicts: # .ratchet.json # pyproject.toml # tests/test_engine_imports.py # uv.lock
…on-core' into refactor/drop-traust-engine-final # Conflicts: # pyproject.toml # tests/test_engine_imports.py # uv.lock
…re' into refactor/drop-traust-engine-final # Conflicts: # harnessing/3-audit/pqc-readiness/SKILL.md # tests/test_engine_imports.py
…ed scripts (XWING-2440)
…_traust doctor on core (XWING-2440)
…r create the record store (XWING-2440)
… import guard covers contracts and ledger (XWING-2440)
…pack's rules; sweep stages use the one rule pack (XWING-2440)
|
[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 |
…p-traust-engine-final # Conflicts: # pyproject.toml # src/traust/cli/groups/metrics.py # src/traust/cli/session.py # tests/test_validate_report.py # uv.lock
…nto refactor/drop-traust-engine-final # Conflicts: # pyproject.toml # uv.lock
…-on-core' into refactor/drop-traust-engine-final # Conflicts: # pyproject.toml # src/traust/cli/groups/metrics.py # uv.lock
…on-core' into refactor/drop-traust-engine-final # Conflicts: # packs/security/compliance/compliance-mapping.yaml # pyproject.toml # uv.lock
…re' into refactor/drop-traust-engine-final
…opment (past traust-security#113); drop parity tests whose engine side traust-security#113 deleted
…ore#237 merged); pin core and engine development
…ine-ledger promotes into the adopter's own pack (XWING-2440)
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:
plans/traust-standardization/0-continuous-ops/in-review/17-shaun-traust-core-only.md(part)Stacked on lanes a–e; merge those first: #279 (a, loader) → #286 (b, tools), #284 (c, metrics/registry), #285 (d, reporting/sweep), #283 (e, harnessing). This branch is lane (a)'s branch with b–e merged in (conflicts in
pyproject.toml,uv.lock,.ratchet.json,tests/test_engine_imports.pyand the pqc-readiness SKILL.md, each kept both sides). Review the commits afterb08daa5.Chain: traust-core #222, #223, #225, #229 (new, stacked on #223) · traust-engine #112 · this PR.
Core pin:
7598d2conchore/w2-core-doors-combined, a merge-only branch of core #225 + #223 + #222 + #229 (lanes b, c and d each pinned a different core PR head). It has no PR of its own; re-pin to coredevelopmentonce those four merge.Scope, as decided mid-lane
The plan's lane (f) said to drop
traust-engine. It stays a dependency, because three ops are still waiting on a retire-or-port decision from Shaun. The PR keeps "(part)". The final drop is a follow-up once those decisions land.sweepcollect/draft/sweep/emit/benchmark/rule-lane/verify-draftPENDING(decision: sweep stages — retire or port)portfoliograph build/queryPENDING(decision: portfolio graph layers — retire or port)metricshistory/spend/declare-spendPENDING(decision: metrics journal — retire or port to OpsService timeline)What
packs/security/.opengrep-rules/(with its licence note) andgitleaks-rules/gitleaks-default.toml(with its calibration fixtures) are copied from traust-engine7c6aa58; the only edits are the README's location lines. They are the conventional defaults forlocations.opengrep_rulesandlocations.gitleaks_config(traust.paths.OPENGREP_RULES_DIR/GITLEAKS_CONFIG). The bundled pack'spack_versionis traust's version; a configured pack stayslocal:{pack}. BothPENDING(pack: …)branches are deleted, and so issrc/traust/_tools.py. The sweep stages also default toload().rule_pack, so one copy is the only one in use. The single-rule-pack gate (check_docs_consistency) now namespacks/security/. The ruff exclude covers the pack's deliberately vulnerable fixtures, as the engine's did.reporting rate-threatsgetsrisk_ratingfrom coremodels.values(core build(deps): pin traust-core to development 0f3fa0c (XWING-2440) #229).scripts/install_traust --doctorstep 4 now runstraust.context.load().attribute-spendusectx.spend_views, andregistry productsusesctx.product_lookup, so none of them createstraust.dbany more.collect-spend --appendand--reconcilestill record. New test:tests/test_storage_free_views.py.tests/test_engine_imports.pynow coverstraust_engine,traust_contractsandtraust_ledger, static andimportlib.import_module, undersrc/,harnessing/andscripts/. Its baseline holds only the pending engine hits:_registry.py1 (load_engine),portfolio.py1,sweep.py5, each tagged with its decision.ctx.model_catalog.feeds.yamlosv consumers,external-tools.yamltoolchain consumer,*.example.yaml"Schema: contracts … (through traust-core)",sla-policy.example.yaml,config/README.mdrows whose reader is known.compliance-mapping.yamlcomments named retired scripts and failedtest_check_reference_integrityon lane (d)'s branch; they now name the live homes.build-pinned-wheels.pydocstring now says whyPACKAGESkeeps all four: the image installs with--no-deps, core imports contracts and ledger, and the engine stays.packs/security/assets.yaml,ops/router.py(the engine runs the pack), the ledger cosign notes and A18 (load_enginestill exists).Behaviour changes
packs/security/, with content identical to the engine copy. Detection quality'spack_versionfor the bundled pack is traust's version (0.38.0) instead of traust-engine's (0.39.2).adapters govulncheck,osvandosv --sbom:metadata.harness_versionis traust's version instead of traust-engine's._tools.harness_versionwas the engine's version, and that re-export is gone.load().rule_pack;locations.opengrep_rulesstill wins. A pack that isn't a directory exits 2 with the engine's "opengrep rule pack required" message. The engine's separate "no local path form" message for a remote URI is gone.attribute-spendandregistry productsno longer create the record store.install_traust --doctorstep 4 reports signing from core.yaml'sledger.public_key_path, where contracts readledger-signing-key.pub. Required-file gating is step 5 (core's completeness audit).Changed tests
tests/conftest.pyresolve_config_home,Locations.from_hometests/compliance_paths.pycompliance_data_dir/ contractsconfig_path→SECURITY_PACK_DIR/compliance,traust.paths.config_pathtest_compliance_config,test_isolation_review,test_isolation_tagging,test_pqc_wiring,test_llm_app_reviewschema_path/schema_dir→traust.paths(core)test_event_timeTimestampError→ coremodels.valuestest_check_drift::test_argus_pack_is_not_the_default_rules_sourceload().rule_packis the pack's traust-authored rules with no supplementstest_fetch_feeds:…_happy,…_raises_on_missing_key→…_is_unavailable_on_missing_key,…_raises_on_wrong_type→…_is_unavailable_on_wrong_typeValueError→ core's snapshot isunavailable, its detail namingps_modulestest_check_content_licenses::TestValidatorCisTextWarning(3)strict_checks→load().reporting.validate_reports(strict=True)test_security_pack(7)Pack.load→ corevalidate_config("pack")on the YAMLtest_engine_providers:…_resolve_to_the_bundled_file→…_to_the_packs_file,…_bundled_pack_at_the_engine_version→…_packs_rules_at_the_traust_versiontest_default_rule_packs::test_default_opengrep_run_reports_a_current_ruleconfig_pathsnamestraust_engine→ namespacks/security/opengrep-rulestest_docs_consistency::TestSingleRulePacktest_engine_importsscripts/; baseline only the pending hitstest_validate_report,test_validate_report_cloud_config,test_validate_triage,test_validate_vuln_findingscontracts.schema_errorstest_adapters_core_parity,test_context_locations,test_metrics_spend_views,test_registry_doors# delete with the engine (final-drop follow-up)test_p2_hardening::test_p3_sweep_engine_dir_prefix,test_target_attestation,test_sweep_regression_draftsPENDING(decision: sweep stages — retire or port)Deleted tests
Signed off by Shaun, 2026-10-27: tests of code traust doesn't own.
test_validate_report.pyTestCrossValidation9,TestStrictConventions13,TestVerificationCrossChecks14,TestDispositionCrossChecks6,TestConsistencyGates4,TestRenderer5,TestRendererNumbering1,TestDirectoryValidation2, round trips 5)reporting.validate(cross_validate,strict_checks,cross_validate_verification,collect_report_files),reporting.render.render_reporttests/v1/services/reporting/test_checks_audit_report.py,test_checks_families.py,test_checks_review_surfaces.py,test_report_markdown.py,tests/v1/services/test_reporting.py; the reporting parity replay in core #213/#215 (all 862 engine-suite and 139 traust-suite reporting calls, identical)test_validate_report_cloud_config.pydetect_schema_pathtest_checks_families.py::test_cloud_config_current_*,::test_a_cumulative_stamp_routes_to_cloud_config,::test_a_sibling_cloud_config_audit_routes_an_unstamped_cumulative,::test_code_and_container_cumulatives_keep_the_report_routetest_validate_triage.pycross_validate_triage,detect_schema_pathtest_checks_families.py::test_triage_*,::test_file_names_pick_the_schematest_validate_vuln_findings.pycross_validate_vuln_findings, autodetecttest_checks_families.py::test_vuln_findings_errors,::test_a_valid_vuln_findings_passes,::test_file_names_pick_the_schematest_check_fix_propagation.pycross_validate_verification(cross_repo)test_checks_families.py::test_cross_repo_fixes_must_be_consumed_elsewheretest_scan_k8s_hardening.pyadapters.checkov.Scannertests/v1/providers/tools/test_k8s_hardening.py(ported in core #212)test_cloud_config_audit.pycorpus.resolverreport-kind taggingcorpus/is retired; core keeps cloud-config audits their own artifact (CloudConfigAuditArtifact,ResultKind.CLOUD_CONFIG_AUDIT):tests/v1/models/test_cloud_config.py,tests/v1/providers/test_report_files.pytest_p1_hardening.pyadapters.opengrep.resolve_rulestests/v1/providers/tools/test_opengrep.py::test_an_unpinned_or_non_https_rules_source_is_refused,::test_a_git_source_is_pinned_to_a_commit,::test_a_git_source_is_cloned_once_at_its_pintest_security_router_engine.py,test_shadow_run.pytests/test_security_router.pyValidation
Pre-commit and pre-push hooks passed. The done-when ("suite and hooks pass without traust-engine installed; the grep is empty") is not claimed here because the engine stays (see Scope). I didn't watch CI.
Wave 3 must keep (traust-engine)
The engine modules the remaining hits need, once the facade is slimmed to the three ops:
engine.py(HarnessEngine:ctx,sweep,portfolio,metrics;sweep/rule_lane.pybuilds it too),_ops_base.py,locations.py,storage.py,assets.py(harness_version,default_rule_pack_dir) anddata/secure-code-audit/(the default pack thatsweep/mining.pyresolves when given none)sweep/:ops,engine,benchmark,rule_lane,mining,calibrationadapters/opengrep.py(sweep stages,verify-draft),adapters/_contract_bridge.py,adapters/checkov.py(the portfolio graph's K8s scanner)corpus/resolver.py(sweep/engine.py)portfolio/:ops,graph,parsersmetrics/:ops,history,spend,collect_spend,attribute_spend;registry/models.py(what they price with)ops/(the continuous-ops service)Also keep until the final drop: the parity tests tagged
# delete with the engineread_util/safe_exec,_util/elf, the otheradapters/*,registry/products,locations,metrics.What's left (final-drop follow-up)
traust-enginefrompyproject.tomland[tool.uv.sources], and removeload_engine, A18's engine root, the tagged parity and sweep tests and the guard's baseline. Then prove the done-when in a venv without the engine.developmentonce docs(vuln-scan): Step 5 records the scan's findings as findings (XWING-2440) #222, feat(traust-metrics): scoreboard on traust-core's ScoreboardView; retire collect_harness_metrics.py (XWING-2440) #223, feat(refresh-dashboards): dependency exposure as core views; retire build_dependency_exposure.py (XWING-2440) #225 and build(deps): pin traust-core to development 0f3fa0c (XWING-2440) #229 merge.allowed-toolslinestraust_engine.reporting.render/lintandtraust_engine.sweep.mining(cloud-config-audit, secure-container-audit, threat-register, mine-ledger SKILL.md);traust_engine.escaping(track-findings),corpus.resolver(triage),sweep.benchmark(validate-findings);config/README.mdrows for corpus-config, budget-policy, rule-pack-allowlist and ledger-signing-key; thetraust-engine[s3]note inlocations.example.yaml.test_run_opengrep,test_run_gitleaks,test_bundled_rule_packs) should follow the pack into traust before wave 3 deletesadapters/.Quality checklist
traust.pathspack paths)traust_test_w2_f)Updated 2026-10-27 (after #279 merged)
developmentand lanes b–e merged in; pins: core → core#237's head (re-lands build(deps): pin traust-core to development 0f3fa0c (XWING-2440) #229, which had merged into a stale branch), engine → development (past engine#113).tests/test_adapters_core_parity.py(10 tests, 27 cases): engine_util/ adapters vs core's tool doors. Parity was proven when lane (b) landed (27/27 equal); core#225'stests/v1/context/test_tool_reports.pyowns the behaviour.tests/test_registry_doors.py: the 4 products-parity tests (engineregistry/products.py, deleted). Core's product-definition tests own it; the models parity tests stay (engineregistry/models.pyis kept).test_validate_report.pykeeps_canonical_report(development's other tests import it).Layout (2026-10-27, decided with Shaun and Michele)
packs/security/detection/{opengrep-rules,gitleaks-rules}. That's traust's default stack, the baseline every adopter starts from.packs/security/compliance/stays where it is, andassets.yamlstays the ops pack.traust.pathspoint at the new location.packs/security/detection/.0-continuous-ops/20-shaun-rule-mining-adopter-packs.md).packs/security/compliance/, not in traust-engine.