chore: replace every remaining "tramiton" with Firmwerk
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 6m45s

The firmware engine was renamed to Firmwerk (git deps and crate names already
moved in #240/#245), but 65 references to the old name were left across 15
files. None remain now.

- Code: `TramitonNative` -> `FirmwerkNative`, `ExternalSystem::Tramiton` ->
  `ExternalSystem::Firmwerk` (serialized as `firmwerk`), a local flag.
- Values the classifier writes: fact `source` and `detected_by` now say
  `firmwerk`. These are free-form strings nothing matches on; stored targets
  pick up the new value on their next classification.
- Prose (doc comments, docs, the demo fixture's description) says "Firmwerk";
  identifiers, stored values, log text and CLI commands say `firmwerk`.

No serde alias is kept for the enum: `external_refs` is only ever created
empty and nothing writes an `ExternalRef`, so no stored document can hold the
old value.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
This commit is contained in:
Sharang ParnerkarandClaude Opus 5 committed 2026-09-21 13:25:06 +02:00
1 parent 55da128a3c
commit 832729b61d
15 files changed
+65 -65

No files matched your search

+2 -2
View File
@@ -16,8 +16,8 @@ compliance-dast = { path = "../compliance-dast" }
werkbank-exec = { path = "../werkbank-exec" }
# Native firmware build/target detection for bare-metal & RTOS artifacts.
# Same-company IP, used directly (not via CLI) so the whole firmwerk suite is
# available to the onboarding classifier. Repo: git.breakpilot.com/platform/firmwerk
# (formerly sharang/tramiton); crates are firmwerk-* from tag v0.4.2.
# available to the onboarding classifier. Repo: git.breakpilot.com/platform/firmwerk;
# crates are firmwerk-* from tag v0.4.2.
# NOTE: CI must be able to fetch this
# private repo (see the git-auth step in .gitea/workflows/ci.yml).
firmwerk-core = { git = "ssh://git@git.breakpilot.com:22222/platform/firmwerk.git", tag = "v0.4.2" }
@@ -526,7 +526,7 @@ pub async fn applicable_scans_for_target(
///
/// This is the lightweight pass: it classifies from artifact kinds without
/// ingesting (cloning) sources, so it returns immediately. Deep detection (after
/// ingest, with tramiton firmware analysis) is a follow-up background step.
/// ingest, with Firmwerk firmware analysis) is a follow-up background step.
#[tracing::instrument(skip_all, fields(target_id = %id))]
pub async fn detect_target(
Extension(agent): AgentExt,
+21 -21
View File
@@ -1,11 +1,11 @@
//! Firmware classification via tramiton.
//! Firmware classification via Firmwerk.
//!
//! tramiton is the company's firmware build/repro engine; we do not re-implement
//! Firmwerk is the company's firmware build/repro engine; we do not re-implement
//! its detection. We depend on `firmwerk-core` directly (same-company IP) and run
//! its provider analysis in-process behind a [`FirmwareDetector`] port, mapping
//! tramiton's `BuildPlan` onto a [`TargetType`]. A deterministic
//! Firmwerk's `BuildPlan` onto a [`TargetType`]. A deterministic
//! [`MockFirmwareDetector`] backs the tests so CI unit tests need neither the
//! tramiton sources nor a real firmware tree.
//! Firmwerk sources nor a real firmware tree.
use std::path::Path;
@@ -13,9 +13,9 @@ use compliance_core::error::CoreError;
use compliance_core::models::{DetectedFact, TargetType};
use compliance_core::traits::ClassifierVerdict;
/// A minimal firmware-detection summary, mapped from tramiton's `BuildPlan`.
/// Kept small and tramiton-independent so the classifier and the test mock don't
/// need to construct a full tramiton plan.
/// A minimal firmware-detection summary, mapped from Firmwerk's `BuildPlan`.
/// Kept small and Firmwerk-independent so the classifier and the test mock don't
/// need to construct a full Firmwerk plan.
#[derive(Debug, Clone, Default)]
pub struct FirmwareDetection {
/// The detecting provider (e.g. `zephyr`, `cmake`, `source-archaeology`).
@@ -43,10 +43,10 @@ pub struct FirmwareTarget {
pub arch: Option<String>,
}
/// A source of tramiton firmware detection.
/// A source of Firmwerk firmware detection.
#[allow(async_fn_in_trait)]
pub trait FirmwareDetector: Send + Sync {
/// Run detection over a path, returning a firmware detection if tramiton
/// Run detection over a path, returning a firmware detection if Firmwerk
/// could form a build plan.
async fn detect(&self, path: &Path) -> Result<Option<FirmwareDetection>, CoreError>;
}
@@ -54,9 +54,9 @@ pub trait FirmwareDetector: Send + Sync {
/// Uses `firmwerk-core` in-process. The analysis is blocking (filesystem walk),
/// so it runs on a blocking thread to avoid stalling the async runtime. A path
/// with no recognizable build system yields `Ok(None)`.
pub struct TramitonNative;
pub struct FirmwerkNative;
impl FirmwareDetector for TramitonNative {
impl FirmwareDetector for FirmwerkNative {
async fn detect(&self, path: &Path) -> Result<Option<FirmwareDetection>, CoreError> {
let path = path.to_path_buf();
let plan = tokio::task::spawn_blocking(move || {
@@ -64,13 +64,13 @@ impl FirmwareDetector for TramitonNative {
firmwerk_core::provider::analyze(&repo)
})
.await
.map_err(|e| CoreError::Other(format!("tramiton detect task join error: {e}")))?
.map_err(|e| CoreError::Other(format!("tramiton analyze error: {e}")))?;
.map_err(|e| CoreError::Other(format!("firmwerk detect task join error: {e}")))?
.map_err(|e| CoreError::Other(format!("firmwerk analyze error: {e}")))?;
Ok(plan.map(|bp| detection_from_build_plan(&bp)))
}
}
/// Map tramiton's `BuildPlan` onto our minimal detection summary.
/// Map Firmwerk's `BuildPlan` onto our minimal detection summary.
fn detection_from_build_plan(bp: &firmwerk_core::BuildPlan) -> FirmwareDetection {
FirmwareDetection {
provider: bp.provider.clone(),
@@ -103,7 +103,7 @@ pub fn detection_to_target_type(det: &FirmwareDetection) -> TargetType {
}
}
/// Map tramiton's confidence label to a `[0,1]` score.
/// Map Firmwerk's confidence label to a `[0,1]` score.
fn confidence_score(label: &str) -> f32 {
match label.to_lowercase().as_str() {
"high" => 0.9,
@@ -120,26 +120,26 @@ pub fn detection_to_verdict(det: &FirmwareDetection) -> ClassifierVerdict {
let mut facts = vec![DetectedFact::new(
"build_system",
det.build_system.clone(),
"tramiton",
"firmwerk",
)];
if let Some(fw) = &det.framework {
facts.push(DetectedFact::new("framework", fw.clone(), "tramiton"));
facts.push(DetectedFact::new("framework", fw.clone(), "firmwerk"));
}
if let Some(mcu) = &det.target.mcu {
facts.push(DetectedFact::new("mcu", mcu.clone(), "tramiton"));
facts.push(DetectedFact::new("mcu", mcu.clone(), "firmwerk"));
}
if let Some(board) = &det.target.board {
facts.push(DetectedFact::new("board", board.clone(), "tramiton"));
facts.push(DetectedFact::new("board", board.clone(), "firmwerk"));
}
if let Some(arch) = &det.target.arch {
facts.push(DetectedFact::new("arch", arch.clone(), "tramiton"));
facts.push(DetectedFact::new("arch", arch.clone(), "firmwerk"));
}
ClassifierVerdict {
target_type,
confidence: confidence_score(&det.confidence),
facts,
rationale: format!(
"tramiton detected build system '{}'{}",
"firmwerk detected build system '{}'{}",
det.build_system,
det.framework
.as_ref()
+2 -2
View File
@@ -1,6 +1,6 @@
//! Heuristic target-type classification from artifact kinds and source markers.
//!
//! Complements the tramiton firmware detector: this handles web / backend /
//! Complements the Firmwerk firmware detector: this handles web / backend /
//! mobile / desktop / PLC by sniffing manifest files and file extensions in the
//! ingested code trees, plus strong priors from the artifact kinds themselves
//! (a PLC-project artifact is a PLC target; an `.ipa` is an iOS app).
@@ -108,7 +108,7 @@ impl HeuristicClassifier {
ArtifactKind::FirmwareImage => out.push(verdict(
TargetType::FirmwareBareMetal,
0.35,
"firmware image (pending tramiton detection)",
"firmware image (pending firmwerk detection)",
vec![],
)),
ArtifactKind::LiveUrl if input.artifacts.len() == 1 => {
+10 -10
View File
@@ -3,13 +3,13 @@
//! Runs the classifier registry over a target's artifacts and their ingested
//! working paths, then merges and ranks the verdicts into a [`Classification`].
//! The registry is the heuristic classifier (artifact kinds + source markers)
//! plus the tramiton firmware detector (behind a [`FirmwareDetector`] port).
//! plus the Firmwerk firmware detector (behind a [`FirmwareDetector`] port).
mod firmware;
mod language;
pub use firmware::{
FirmwareDetection, FirmwareDetector, FirmwareTarget, MockFirmwareDetector, TramitonNative,
FirmwareDetection, FirmwareDetector, FirmwareTarget, FirmwerkNative, MockFirmwareDetector,
};
pub use language::HeuristicClassifier;
@@ -25,7 +25,7 @@ use compliance_core::traits::{ClassificationInput, ClassifierVerdict, TargetClas
use firmware::detection_to_verdict;
/// Classify a target from its artifacts and their ingested working paths, using
/// the heuristic classifier plus the tramiton firmware detector. Verdicts are
/// the heuristic classifier plus the Firmwerk firmware detector. Verdicts are
/// merged (max confidence per target type) and ranked into a [`Classification`].
pub async fn classify_target<D: FirmwareDetector>(
target: &OnboardedTarget,
@@ -47,8 +47,8 @@ pub async fn classify_target<D: FirmwareDetector>(
}
verdicts.extend(heuristic);
// Tramiton firmware detection over firmware / code working paths.
let mut tramiton_used = false;
// Firmwerk firmware detection over firmware / code working paths.
let mut firmwerk_used = false;
for artifact in &target.artifacts {
if !matches!(
artifact.kind,
@@ -61,11 +61,11 @@ pub async fn classify_target<D: FirmwareDetector>(
};
if let Some(detection) = firmware_detector.detect(path).await? {
verdicts.push(detection_to_verdict(&detection));
tramiton_used = true;
firmwerk_used = true;
}
}
if tramiton_used {
detected_by.push("tramiton".to_string());
if firmwerk_used {
detected_by.push("firmwerk".to_string());
}
Ok(rank(verdicts, detected_by, target.target_type))
@@ -205,9 +205,9 @@ mod tests {
let c = classify_target(&target, &wp, &detector)
.await
.expect("classify");
// tramiton's high-confidence RTOS verdict beats the weak firmware prior.
// Firmwerk's high-confidence RTOS verdict beats the weak firmware prior.
assert_eq!(c.suggested, TargetType::FirmwareRtos);
assert!(c.detected_by.contains(&"tramiton".to_string()));
assert!(c.detected_by.contains(&"firmwerk".to_string()));
assert!(c.facts.iter().any(|f| f.key == "mcu"));
}
+1 -1
View File
@@ -4,7 +4,7 @@
//! path plus recorded metadata (content hash, size, discovered facts) that the
//! classifier and scanners consume. Every blob is SHA-256 hashed — that digest
//! is also the reconciliation key against sibling products (a firmware sha256
//! matches tramiton's `Artifact.sha256`).
//! matches Firmwerk's `Artifact.sha256`).
pub(crate) mod blob;
@@ -1,11 +1,11 @@
//! Firmware SBOM via tramiton.
//! Firmware SBOM via Firmwerk.
//!
//! Phase 2 (full, the default): drive a **reproducible build** with tramiton's
//! Phase 2 (full, the default): drive a **reproducible build** with Firmwerk's
//! `NixBackend` — `analyze` → `seal_and_build` → a sealed lock whose libraries
//! are pinned and whose firmware artifact carries a content hash — then render
//! the SBOM from the lock plus deep binary SCA of pre-compiled inputs. This is
//! the complete bill of materials (toolchain + every fetched library + the
//! firmware image), the same one `tramiton sbom` produces.
//! firmware image), the same one `firmwerk sbom` produces.
//!
//! Phase 1 fallback (analysis-only): when no nix backend is available or the
//! build fails, fall back to the resolvable libraries + toolchain from the build
@@ -29,7 +29,7 @@ pub fn is_firmware_target(target_type: TargetType) -> bool {
/// Build SBOM entries for a firmware target from its source tree. Prefers a full
/// reproducible build (sealed lock); falls back to analysis-only. Returns an
/// empty vector when tramiton cannot even form a build plan.
/// empty vector when Firmwerk cannot even form a build plan.
pub async fn firmware_sbom_entries(path: &Path, repo_id: &str, exec: ExecPolicy) -> Vec<SbomEntry> {
let p = path.to_path_buf();
let repo = repo_id.to_string();
@@ -57,7 +57,7 @@ fn build_sbom_blocking(path: &Path, repo_id: &str, allow_build: bool) -> Vec<Sbo
Ok(Some(bp)) => bp,
Ok(None) => return Vec::new(),
Err(e) => {
tracing::warn!(repo_id, error = %e, "Firmware SBOM: tramiton analyze failed");
tracing::warn!(repo_id, error = %e, "Firmware SBOM: firmwerk analyze failed");
return Vec::new();
}
};
@@ -475,7 +475,7 @@ impl PipelineOrchestrator {
"Unified pipeline: scan plan built"
);
// Ingest + classify (tramiton for firmware) and store the detected type.
// Ingest + classify (Firmwerk for firmware) and store the detected type.
self.classify_and_store(target, &target_id, scan_run_id)
.await;
// Provision a DAST target from a LiveUrl artifact so DAST fires for
@@ -972,7 +972,7 @@ impl PipelineOrchestrator {
Ok(new_notif)
}
/// Ingest the target's artifacts, classify (tramiton for firmware/RTOS/Yocto,
/// Ingest the target's artifacts, classify (Firmwerk for firmware/RTOS/Yocto,
/// heuristics otherwise), and store the detected classification on the target.
/// Best-effort — never fails the scan.
async fn classify_and_store(
@@ -995,7 +995,7 @@ impl PipelineOrchestrator {
match crate::classify::classify_target(
target,
&working_paths,
&crate::classify::TramitonNative,
&crate::classify::FirmwerkNative,
)
.await
{
@@ -1023,7 +1023,7 @@ impl PipelineOrchestrator {
}
// Analysis-based firmware SBOM: for embedded targets, derive components
// (resolved libraries + cross-toolchain) from tramiton's build-plan
// (resolved libraries + cross-toolchain) from Firmwerk's build-plan
// analysis over the already-ingested source — no build, no binary
// upload. Best-effort; empty when no build plan forms.
if crate::pipeline::firmware_sbom::is_firmware_target(target.target_type) {
@@ -1059,7 +1059,7 @@ impl PipelineOrchestrator {
tracing::info!(
target_id,
count = entries.len(),
"Firmware SBOM: stored components from tramiton analysis"
"Firmware SBOM: stored components from firmwerk analysis"
);
}
}
+10 -10
View File
@@ -227,7 +227,7 @@ pub struct DetectedFact {
pub key: String,
/// The fact value.
pub value: String,
/// What produced the fact (e.g. `tramiton`, `language-fingerprint`).
/// What produced the fact (e.g. `firmwerk`, `language-fingerprint`).
pub source: String,
}
@@ -369,7 +369,7 @@ pub struct Classification {
/// Facts gathered during classification.
#[serde(default)]
pub facts: Vec<DetectedFact>,
/// Which classifiers contributed (e.g. `["tramiton", "language-fingerprint"]`).
/// Which classifiers contributed (e.g. `["firmwerk", "language-fingerprint"]`).
#[serde(default)]
pub detected_by: Vec<String>,
/// When classification ran.
@@ -427,7 +427,7 @@ pub struct TargetScanConfig {
pub enum ExternalSystem {
/// Reproducible-build & firmware compliance engine (build plan, SBOM, VEX,
/// attestation).
Tramiton,
Firmwerk,
/// Code assistant (downstream remediation consumer).
Werkpilot,
/// Compliance-controls RAG (atomic controls derived from laws).
@@ -437,7 +437,7 @@ pub enum ExternalSystem {
impl std::fmt::Display for ExternalSystem {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Tramiton => write!(f, "tramiton"),
Self::Firmwerk => write!(f, "firmwerk"),
Self::Werkpilot => write!(f, "werkpilot"),
Self::BreakpilotCompliance => write!(f, "breakpilot_compliance"),
}
@@ -447,9 +447,9 @@ impl std::fmt::Display for ExternalSystem {
/// A link from this target to a record in a sibling product, used to reconcile
/// existing evidence instead of recomputing it.
///
/// For tramiton, `project_id` is the shared cross-product key and
/// For Firmwerk, `project_id` is the shared cross-product key and
/// `subject_sha256` matches a firmware artifact's [`Artifact::content_hash`]
/// (which equals tramiton's `Artifact.sha256`).
/// (which equals Firmwerk's `Artifact.sha256`).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ExternalRef {
/// Which sibling product this reference points at.
@@ -461,7 +461,7 @@ pub struct ExternalRef {
/// Reconciliation status: `linked` | `reconciled` | `unavailable`.
#[serde(default)]
pub status: String,
/// Opaque, offline-verifiable entitlement grant (e.g. tramiton's signed
/// Opaque, offline-verifiable entitlement grant (e.g. Firmwerk's signed
/// `LicenseGrant`), if the tenant provided one.
pub license_grant: Option<String>,
/// When evidence was last reconciled from this system.
@@ -573,7 +573,7 @@ pub struct OnboardedTarget {
/// The compliance scope (applicable frameworks / jurisdiction).
#[serde(default)]
pub compliance_profile: ComplianceProfile,
/// Links to sibling products (tramiton, ...) holding reconcilable evidence.
/// Links to sibling products (Firmwerk, ...) holding reconcilable evidence.
#[serde(default)]
pub external_refs: Vec<ExternalRef>,
/// Cron schedule for recurring scans, if any.
@@ -752,8 +752,8 @@ mod tests {
#[test]
fn external_ref_linked_defaults() {
let r = ExternalRef::linked(ExternalSystem::Tramiton);
assert_eq!(r.system, ExternalSystem::Tramiton);
let r = ExternalRef::linked(ExternalSystem::Firmwerk);
assert_eq!(r.system, ExternalSystem::Firmwerk);
assert_eq!(r.status, "linked");
assert!(r.project_id.is_none());
assert!(r.last_reconciled_at.is_none());
+1 -1
View File
@@ -172,7 +172,7 @@ pub fn rules_for(target_type: TargetType) -> Vec<ScanRule> {
r.push(ScanRule::new(
ScanType::Sbom,
true,
"SBOM from the firmware image (binwalk / tramiton)",
"SBOM from the firmware image (binwalk / firmwerk)",
Firmware,
));
r.push(ScanRule::new(
+1 -1
View File
@@ -4,7 +4,7 @@
//! ingested working directories) and proposes one or more [`ClassifierVerdict`]s
//! — a target type, a confidence, and the facts the decision rested on. Concrete
//! classifiers live in the agent (language/build-system fingerprinting, a
//! firmware detector backed by tramiton, etc.); a registry merges and ranks
//! firmware detector backed by Firmwerk, etc.); a registry merges and ranks
//! their verdicts. This mirrors the [`crate::traits::Scanner`] port so the two
//! read the same way.
+3 -3
View File
@@ -1,13 +1,13 @@
//! The external-evidence provider port.
//!
//! A sibling product (tramiton, for firmware) may already hold authoritative
//! A sibling product (Firmwerk, for firmware) may already hold authoritative
//! analysis for an artifact. An [`EvidenceProvider`] lets compliance-scanner
//! *reconcile* that evidence — a build plan, an SBOM, a VEX document, a
//! reproducible-build lock, an attestation — instead of recomputing it. The key
//! used to match is the artifact content digest (a firmware sha256, which equals
//! [`crate::models::Artifact::content_hash`]).
//!
//! Concrete providers live in the agent (a tramiton CLI shell-out today, a cloud
//! Concrete providers live in the agent (a Firmwerk CLI shell-out today, a cloud
//! client later) plus a deterministic mock for tests, so nothing here depends on
//! an external binary.
@@ -45,7 +45,7 @@ pub trait EvidenceProvider: Send + Sync {
fn system(&self) -> ExternalSystem;
/// Whether this provider can handle the given artifact + working path
/// (e.g. tramiton handles firmware images / embedded source trees).
/// (e.g. Firmwerk handles firmware images / embedded source trees).
fn handles(&self, artifact: &Artifact, working_path: Option<&Path>) -> bool;
/// Reconcile existing evidence for the artifact, keyed by its content digest.
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Seed the nix store on first start, then run the agent.
#
# The firmware-SBOM pipeline drives a real `nix` build (tramiton NixBackend).
# The firmware-SBOM pipeline drives a real `nix` build (Firmwerk NixBackend).
# The image ships the store as a bootstrap tarball rather than baking /nix, so a
# persistent /nix volume (mounted empty on first deploy) gets populated once and
# then survives redeploys. Seeding is best-effort: if it fails, the agent still
+1 -1
View File
@@ -20,7 +20,7 @@ it any more.
| `plc-pump-station` | PLC / SPS (composite) | `pump_station.st`, `pump_fbd.xml`, optional Modbus live URL, optional firmware image | PLC control-logic SAST (ST **and** FBD-as-XML), ICS probe, semantic CRA/master-control mapping |
| `plc-conveyor-line` | PLC / SPS | `conveyor.xml`, `traffic_light.st` | Pure control-logic SAST on a PLCopen-XML program plus a realistic OpenPLC-style sample with three planted defects |
| `git-cra-vuln-demo` | Backend service | git `sharang/cra-vuln-demo` | Plain git SAST: Semgrep → CWE → CRA control refs (`cra-ai-8/13/20`) |
| `firmware-zephyr-example` | Firmware (RTOS) | git `zephyrproject-rtos/example-application` | Tramiton detect handoff (`build_system = zephyr`), firmware source SBOM |
| `firmware-zephyr-example` | Firmware (RTOS) | git `zephyrproject-rtos/example-application` | Firmwerk detect handoff (`build_system = zephyr`), firmware source SBOM |
The PLC files are the same ones under `examples/plc-demo/` that the PLC rule
tests already run against, so their expected rule ids are enforced offline on
+1 -1
View File
@@ -109,7 +109,7 @@
"key": "firmware-zephyr-example",
"name": "Firmware RTOS · Zephyr example-application",
"target_type": "firmware_rtos",
"description": "Upstream Zephyr example application (Apache-2.0). Exercises the tramiton detect handoff (build system = zephyr) and the firmware source SBOM path.",
"description": "Upstream Zephyr example application (Apache-2.0). Exercises the Firmwerk detect handoff (build system = zephyr) and the firmware source SBOM path.",
"artifacts": [
{
"kind": "git_repo",