Repository navigation
refactor(harnessing): skill scripts on traust-core: pqc_facts census, validate-findings safe-exec, dead dashboard blocks retired (XWING-2440) - #283
Merged
smith-xyz merged 5 commits intoOct 27, 2026
Conversation
… validate-findings safe-exec, dead dashboard blocks retired (XWING-2440) - pqc_facts.py: the crypto census is traust-core's code_facts.crypto / .packages for the commit (new --sha, --sbom, --public); schema_path from traust.paths. The engine import never bound crypto_probe, so both modes failed with NameError before. sbom-only coverage now carries the null scan fields its schema requires. - validate-findings adapters: string steps vet and run on core's SafeExec (load().safe_exec); the config home's safe-exec-profiles.yaml is required. - validation-fuzz-dashboard: population block and metrics-history trend banner retired (load_config() and ledger_path(None) always raised). - check_docs_consistency: schema_dir from traust.paths. - .ratchet.json and test_engine_imports baseline shrink.
|
[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 11 tasks
…gine-import allowlist: lanes d and e both removed their entries)
smith-xyz
added a commit
to smith-xyz/traust
that referenced
this pull request
Oct 27, 2026
…ore#237 merged); pin core and engine development
1 task
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 (e): harnessing scripts. Stacked on traust#279 (lane (a),
refactor/traust-core-loader@9189e08). Review and merge that one first; until then this diff includes its commit. Chain: traust#279 (a) → lanes (b)–(e) → lane (f).What
harnessing/3-audit/pqc-readiness/scripts/pqc_facts.py. It no longer imports the engine or contracts: notraust_engine.adapters.crypto_probe, notraust_contracts.paths, noload_engine.traust adapters crypto-source. The script registers the repository and commit (new--sha, plus--public), ingests the manifest SBOM (new--sbom;--from-sbomin SBOM mode), then callscode_facts.crypto(ref, ToolRequest(checkout))in source mode orcode_facts.packages(ref)in SBOM mode.schema_pathnow comes fromtraust.paths(core's, same directory).long_validityis a provider and the consumer ratchet blocks it.developmentand onmain:from traust_engine.adapters.crypto_probe import *never binds the namecrypto_probe. Socrypto_probe.probe_repo(...)andcrypto_probe.probe_sbom(...)both raisedNameError, in both modes. Separately, the SBOM-mode document always failed its own write-time schema gate (coveragelacked the requiredscanned_files/skipped_files/rules_in_pack). This PR makes both modes work, on core.harnessing/5-validate/validate-findings/adapters/base.py. String (PoC-derived) steps used to go through a dynamicimportlib.import_module("traust_engine._util.safe_exec"). They are now vetted and run by core'sSafeExecfromtraust.context.load().safe_exec, cached on the class (profile,vet_command_string,run_segments). The profiles come from the config home'ssafe-exec-profiles.yamland are required: no embedded fallback.harnessing/validation-fuzz-dashboard/scripts/build_validation_fuzz_dashboard.py. Both dynamic engine imports guarded features that never ran, and both are deleted:corpus.resolver;metrics.history.Evidence is under Behaviour changes.
build()loses its now-unusedconfig_homeparameter. Thecorpus.resolveruse was never URL normalisation, soHttpsRepoUrldoesn't apply.src/traust/cli/check_docs_consistency.py:schema_dirnow comes fromtraust.paths(core's) instead oftraust_contracts.paths. It's the same plan row aspqc_facts.py;apply_fleet_fix.py, also named in that row, no longer exists.Ratchet:
.ratchet.jsononly shrinks:pqc_facts.py(contracts 1) andcheck_docs_consistency.py(contracts 1) are gone.tests/test_engine_imports.pydropspqc_facts.pyfrom its baseline.Not in this PR:
scripts/install_traustdoctor step 4 (traust_contracts.load_context) is the last hit inharnessing scripts bin. Lane (a) handed it to lane (f).git grep -nE '(from|import) traust_(engine|contracts|ledger)|import_module\("traust_(engine|contracts|ledger)' -- harnessing scripts bin→ onlyscripts/install_traust:325(lane f).Legacy files
traust_engine.adapters.crypto_probe(probe_repo,probe_sbom), aspqc_facts.pyused itCodeFactsService.crypto/.packages, per the wave 1 crypto gap table (rows 1–20)traust_engine._util.safe_exec, as validate-findings adapters used itContext.safe_exec(SafeExec)traust_engine.corpus.resolverpopulation block in the dashboardload_config()always raises (evidence below)traust_engine.metrics.historytrend banner in the dashboardtraust_contracts.paths.schema_path/schema_dirtraust.pathsBehaviour changes
pqc_facts.pynow works, on core, and needs a commit and an SBOM. It never ran before (theNameErrorabove).--repo-urland--shaare required. The run records the repository, the commit and the SBOM in the core store, asadapters crypto-sourcedoes.--sbomor recorded earlier. Without one it exits:pqc_facts: commit <sha> has no manifest SBOM recorded: runsyft dir: -o cyclonedx-jsonand pass it as --sbom.PqcService.prescandrops them. The legacyprobe_reponever produced them.CryptoPackagePolicyfinds asHP_SBOM_CRYPTO_COMPONENT. That includes family names the legacy keyword list missed (e.g.pyjwt), andfileis""instead ofsbom:<purl>, withlinenull instead of 0. This is what core's ownpqc.facts.sbom_factsdoes (gap table rows 20/24).sbom-onlycoverage block now carriesscanned_files/skipped_files/rules_in_packas null, which the schema requires. The source-mode document keeps its shape and key order.safe-exec-profiles.yamlin the config home. The config home is$TRAUST_CONFIG_HOME, or the default. When the file is missing, the first string step raises core'sConfigError, which names the file. The engine fell back to embedded profiles.run.py --config-homeisn't threaded into the adapters, because they are import-time singletons.BASE_KEEP_ENV+ profilekeep_env), core's reason wording. The existing reason-fragment assertions pass unchanged.[!] population block omitted.previous()only whenworkspace_dir(load())resolved, and there the error was uncaught. So a configured run crashed after writing both outputs; any other run skipped it.Prose changes
syft dir:<checkout>first;pqc_facts.pygains--sha <commit> --sbom <slug>-sbom.jsonpqc_facts.pyreads is core's (whattraust adapters crypto-sourceexposes), notcrypto-probepqc_facts.pyrowThe
adapters crypto-probe/crypto-auditrows in the pqc-readiness and crypto-analysis skills belong to lane (b), which owns those adapters, and change with that code.docs/skills.md:traust build skills-referenceproduces no diff (body-only edits), so the commit usesSKILLS_DOC_WAIVER.Pins
The traust-core pin stays at lane (a)'s
beb96f1. Coredevelopmentis nowe5b75ba, but bumping to it breaks 27 tests unrelated to this lane:test_validation_record(20 errors),test_validation_doors(1 error) andtest_assessment_record(6 failures). The likely cause is the validation-reads and classifier-gate changes in core #217–#221. That bump belongs in its own PR or the lane that owns validation and assessment.Reviewer checks
CodeFactsServicecrypto census,Context.safe_exec, core contracts paths); no engine code copied into traustQuality checklist
_doors.register_commit, core's census doors,traust.pathsschema helpers--sha(exit 2), missing safe-exec profiles (ConfigError)test_pqc_facts.pyruns on SQLite and Postgres (lane DBtraust_test_w2_e) against the sanitized crypto fixtures already intests/fixtures/crypto/Changed tests
tests/test_engine_imports.pyBASELINE"harnessing/3-audit/pqc-readiness/scripts/pqc_facts.py": 1→ removedtests/test_p2_hardening.pybase.pydelegates to core nowNew:
tests/test_pqc_facts.py(source mode, source mode without an SBOM, SBOM mode, each on SQLite and Postgres; plus--sharequired) andtest_p2_hardening.py::test_string_steps_need_the_config_homes_safe_exec_profiles.Validation (local)
make lint-fix && make test: 2703 passed, 2 skipped. Postgres ontraust_test_w2_e; lane (a) was 2695, and this PR adds 8 cases.uv run traust check docs-consistency: consistent.traust-core@e0b2ddd,--reference= upstream/development.ratchet.json): clean.