Repository navigation
Conversation
…2440) load() builds traust-core's Context and calls core's own registrations (register_toolchain, register_rule_pack with no allowlist, register_detection_quality, register_fleet_fix, register_compliance_sources) instead of traust-engine's register_providers; config home, config lookup, schema paths, timestamps and DeploymentConfigMissing come from core. OpSpec.call(args) -> int: the dispatcher no longer loads the engine facade. Ops still on it call cli.groups._registry.load_engine (moved from context.py, engine import local) marked for wave 2 lanes b-d; every group module imports without traust-engine, so the pre-commit hooks run without it. A18's engine root moves to _registry.py. The engine-bundled opengrep pack and gitleaks rules stay the defaults through traust._tools (PENDING(pack: ...)) until lane f moves them into packs/security. Pins traust-core to development beb96f1.
|
[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 |
This was referenced Oct 27, 2026
… and engine 6c78fae
13 tasks done
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-progress/17-shaun-traust-core-only.md(part)Wave 2, lane (a): dispatcher,
context.py,paths.py, contracts config. Lanes (b)–(e) branch from this PR's head; lane (f) finishes the chain.What
Pin: traust-core → development
beb96f1(both the[tool.uv.sources]rev and the staleoverride-dependenciesURL). No core PR needed: every door used here is on development (register_toolchain,register_rule_pack,register_detection_quality,register_fleet_fix,register_compliance_sources,resolve_config_home,config_path,optional_config_path,config_completeness_audit,schema_dir/schema_path,DeploymentConfigMissing,models.values.to_rfc3339).src/traust/context.py: noHarnessEngine, noload_engine, noregister_providers, notraust_contracts.load()builds core's Context and calls core's registrations. Each one maps to what the engine'sregister_providers(traust-engineadapters/providers.py) did, with the same files and paths:register_providersload()register_tools(allTOOL_NAMESbut checkov) +register_checkovregister_toolchain(external_tools, safe_exec_profiles)(registers the same 10 tool names)<home>/external-tools.yaml,<home>/safe-exec-profiles.yaml(contracts' MANIFEST names); read on first userule_pack_dir()→register_tools(rule_pack=…, allowlist=…)register_rule_pack(pack, allowlist=None)locations.opengrep_rules, else the engine-bundled pack (PENDING(pack: opengrep rules)); allowlist stays None (Shaun's call: supplements off)register_detection_quality(pack, supplements=load_supplemental_packs()=[], …)register_detection_quality(pack_version, canary_sources, canary_repos)<home>/recall-benchmark/<canaries>,$XDG_CACHE_HOME/~/.cache/recall-bench/<canaries>; version = engine version for the bundled pack, elselocal:<pack>register_fleet_fixregister_fleet_fix()register_compliance_sources(ctx, {})register_compliance_sources()(same empty docs map)gitleaks-default.tomllocations.gitleaks_configto that file while building theConfigwhen unset (PENDING(pack: gitleaks rules))traust._toolsLocation helpers take a core
Contextonly (theLocationSource = Context | HarnessEngineunion is gone).DeploymentConfigMissingis core's.OpSpec.call(args) -> int(cli/groups/_registry.py,cli/__main__.py): the dispatcher no longer loads the engine for every grouped op. An op that needs core callsload(args.config_home)itself (the existing pattern). Every group's ops changed signature in this one PR.Ops still on the engine facade get it from
cli.groups._registry.load_engine(config_home), moved out ofcontext.pywith the sameconfig not resolvable: …line and exit 2. It catchesFileNotFoundError(contracts'DeploymentConfigMissingsubclasses it, same reasoning as engine#105), and the engine import sits inside the function. It's marked# wave 2: removed by lane (f) once lanes (b)-(e) land. Each caller is marked with the lane that replaces it:# wave 2 lane (b)(adapters opengrep/govulncheck/gitleaks, util elf/safe-exec, toolchain),(c)(metrics, registry),(d)(reporting, portfolio, sweep) or(e)(pqc_facts). It lives in_registry.pybecause the consumer ratchet is per file:_tools.pyimportingHarnessEnginewould be a new engine-internal hit, while_registry.pyalready carried one.Hooks without the engine: every module-level engine import in
cli/groups/*moved into the op bodies. Where several ops share one engine module, a one-import accessor (_transcript_readers,_products,_graph) keeps the per-file count from growing. Withtraust_engineblocked from import, all five hook scripts run green: pre-commitcheck_skill_alignment,check_estate_data --staged,check_skill_security, and pre-pushcheck_docs_consistency,check_content_licenses.paths.py,lib/event_time.py,scripts/install_traust: contracts imports replaced with core's (config_path,optional_config_path,schema_dir/schema_path,DeploymentConfigMissing,to_rfc3339/TimestampError,config_completeness_audit).install_traust --doctorstep 4 still loads the engine through contracts'load_context; it goes when lane (f) drops the engine.A18: the single engine root moves from
context.pytocli/groups/_registry.py(the rule still has exactly one root). Rule text updated incheck_skill_alignment.pyandharnessing/check-alignment/SKILL.md, which was committed withSKILLS_DOC_WAIVERbecausebuild skills-referenceleavesdocs/skills.mdunchanged.docs/architecture.mdnow showstraust.context.load().Ratchet baseline shrinks:
context.py(contracts 2, engine-internal 1),paths.py(contracts 3),lib/event_time.py(contracts 1),groups/registry.py(contracts 1),groups/sweep.py(contracts 1),groups/metrics.pyandgroups/portfolio.py(engine-internal 2→1).tests/test_engine_imports.pybaseline shrinks the same way. No file grew.Behaviour changes
traust <group> <op>exited 2 when a contracts-required file was missing. Now that happens only for ops that call the facade. Affected:adapters checkov/osv/yara/joern/crypto-*,reporting rate-threats/sarif,sweep mine/regression-drafts/verify-draft/benchmark check-trigger,metrics attribute-spend --reconcile,util redact/elf.opengreptool:register_rule_pack(pack, allowlist=None). The engine's tool gotrule-pack-allowlist.yaml. Passing the allowlist is Shaun's call.traust adapters opengrepstill goes through the engine with the allowlist (lane b).locations.opengrep_rulesURI still fails on first use, but with core's "not a directory" message instead of the engine's "has no local path form".traust.paths.schema_pathis core's: bare names only, and no existence check. The one caller (emit_doc_variance,"doc-variance") is unaffected.DeploymentConfigMissingfromtraust.context/traust.pathsis core's class (ConfigError, FileNotFoundError), not contracts'. Every in-tree catcher moved.install_traust --doctorstep 5: an unreadable config file is a coreConfigErrorinstead of a raw traceback.Reviewer checks
register_*doors and config doors); no engine code copied into traustQuality checklist
load_engine, one accessor per engine moduletraust_test_w2_a)Changed tests
test_context.pyload_enginefromtraust.context→ fromtraust.cli.groups._registry;test_resolve_results_root_from_configcompares withanalysis_results_dir(load())instead of(load_engine())load_enginemoved; location helpers take a core Context onlytest_context_load.py::test_the_context_is_the_only_loader{load, load_engine, load_caller, load_spend_core}→ withoutload_enginecontext.py(the point of this lane)test_context_locations.pyHarnessEngine.loaddirectly;_outcometreats contracts' and core'sDeploymentConfigMissingas the same outcome; thehelper(engine)assertion removed; the remote-inputs test expects core's classtraust.contextraises core's class. The core-vs-pre-change-engine parity assertions are unchangedtest_feeds_config.py(3 tests)feeds_cache_dir(engine=load_engine())→feeds_cache_dir(core=load())test_countersign_record.py(2 guards)traust.cli.__main__.load_engine→traust.cli.groups._registry.load_enginetest_metrics_spend.pymetrics.load_engine;metrics.attr.known_skills→traust_engine.metrics.attribute_spend.known_skillscall(args)signature; the module-levelattralias is now a local importtest_sweep_mine.py,test_sweep_regression_drafts.py,test_adapters_osv_cli.py,test_rate_threats.pycall_x(None, args)→call_x(args)(_deps_dev_resolverlikewise)test_render_section_guard.pyreporting.load_enginetest_engine_providers.py::test_run_tools_reaches_an_engine_adapter_through_coretest_run_tools_reaches_a_core_tool_through_load: patches core'sAdapterTool.check/grype.scaninstead of the engine's; module docstringtest_a18_composition_root.py::test_allows_the_composition_root_itselfcontext.py→ tocli/groups/_registry.py(context.py keeps the config-home root)test_engine_imports.pycontext.pyremoved,metrics.py2→1,portfolio.py2→1New tests:
test_load_engine_names_the_missing_file_on_one_line;test_context_py_no_longer_resolves_the_engine;test_unset_gitleaks_rules_resolve_to_the_bundled_file,test_an_explicit_gitleaks_location_wins,test_the_rule_pack_defaults_to_the_bundled_pack_at_the_engine_version,test_an_explicit_rule_pack_location_wins.Handoff to lane (f)
traust_engine/data/secure-code-audit/opengrep-rulesinto traust aspacks/security/opengrep-rules(pack content, licence notes kept). Make it the conventional default forlocations.opengrep_rules(resolved under the pack dir, no engine import).pack_version= traust's version for the bundled pack, elselocal:{pack}, as the engine does today. Remove thePENDING(pack: opengrep rules)branch.gitleaks-default.tomlintopacks/security/next to the opengrep rules, make both pack paths the conventional defaults with no engine import, and delete bothPENDING(pack: …)branches (andtraust._tools's re-exports)._registry.load_engineand the remaining engine-internal hit in_registry.py; A18's engine root goes to zero.install_traust --doctorstep 4 (contractsload_context, "engine load") goes with the engine dependency.Validation
make lint-fix && make test: 2695 passed, 2 skipped (Postgres ontraust_test_w2_a)uv run traust check docs-consistency: consistent.ratchet.json): clean, baseline only shranktraust_engineblocked from import: all five pass