Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -365,3 +365,19 @@ crate.from_specs(
],
)
use_repo(crate, "crate_index")

# TRLC dependency for requirements traceability
bazel_dep(name = "trlc", version = "0.0.0", dev_dependency = True)
git_override(
module_name = "trlc",
commit = "3a71fd56001b95dfbb5270a49449ec0a631cd56c", #TRLC 2.0.4
remote = "https://github.com/bmw-software-engineering/trlc.git",
)

# Lobster dependency for requirements traceability
bazel_dep(name = "lobster", version = "0.0.0", dev_dependency = True)
git_override(
module_name = "lobster",
commit = "d528fbdec2cd72ff7967b51546fb0bd935810258",
remote = "https://github.com/bmw-software-engineering/lobster.git",
)
335 changes: 187 additions & 148 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions docs/pastey/docs/requirement/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

load("@trlc//:trlc.bzl", "trlc_requirements")

trlc_requirements(
name = "system_requirements",
srcs = [
"assumed_system_requirements.trlc",
],
visibility = ["//visibility:public"],
)

trlc_requirements(
name = "feature_requirements",
srcs = [
"feature_requirements.trlc",
],
visibility = ["//visibility:public"],
deps = [
":system_requirements",
],
)

trlc_requirements(
name = "component_requirements",
srcs = [
"component_requirements.trlc",
],
visibility = ["//visibility:public"],
deps = [
":system_requirements",
":feature_requirements",
],
)
29 changes: 29 additions & 0 deletions docs/pastey/docs/requirement/assumed_system_requirements.trlc
Comment thread
aschemmel-tech marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/********************************************************************************
* Copyright (c) 2026 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
package PasteySysReq

import ScoreReq

ScoreReq.AssumedSystemReq ASR_PASTEY_001 {
description = "The Rust toolchain shall provide the proc_macro crate API, making TokenStream, Ident, Punct, and Literal types available to procedural macro crates during compilation"
safety = ScoreReq.Asil.B
version = 1
rationale = "pastey is built as a proc-macro crate, the entire token-stream processing and identifier-synthesis mechanism depends on the proc_macro API being present and stable in any Rust toolchain used to compile pastey"
}

ScoreReq.AssumedSystemReq ASR_PASTEY_002 {
description = "The Rust build environment shall make the values of host environment variables accessible to procedural macros during macro-expansion time"
safety = ScoreReq.Asil.B
version = 1
rationale = "pastey reads host environment variables when processing env!(\"VAR_NAME\") expressions inside paste! interpolation blocks (the [< ... >] syntax), this requires the compiler proc_macro execution context to have read access to the build environment variables"
}
92 changes: 92 additions & 0 deletions docs/pastey/docs/requirement/component_requirements.trlc
Comment thread
aschemmel-tech marked this conversation as resolved.
Comment thread
aschemmel-tech marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/********************************************************************************
* Copyright (c) 2026 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
package PasteyComReq

import ScoreReq

ScoreReq.CompReq REQ_COMP_PASTEY_001 {
description = "The pastey component shall collect all tokens inside a paste! interpolation block (the [< ... >] syntax) and shall discard whitespace tokens between them before performing identifier concatenation"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_001@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_002 {
description = "The pastey component shall convert the accumulated identifier string to lowercase when the :lower modifier is present"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_002@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_003 {
description = "The pastey component shall convert the accumulated identifier string to uppercase when the :upper modifier is present"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_002@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_004 {
description = "The pastey component shall convert the accumulated identifier string to snake_case when the :snake modifier is present"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_002@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_005 {
description = "The pastey component shall convert the accumulated identifier string to UpperCamelCase when the :camel or :upper_camel modifier is present"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_002@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_006 {
description = "The pastey component shall convert the accumulated identifier string to lowerCamelCase when the :lower_camel modifier is present"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_002@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_007 {
description = "The pastey component shall convert the accumulated identifier string to UpperCamelCase while preserving edge-case boundaries such as consecutive uppercase letter sequences when the :camel_edge modifier is present"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_002@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_008 {
description = "The pastey component shall accept exactly one token for each of the from and to arguments of the :replace(from, to) modifier and shall emit a compile error when more than one token is supplied for either argument, when the preceding value is absent, or when the modifier syntax is malformed"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_003@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_009 {
description = "If the first token inside a paste! interpolation block (the [< ... >] syntax) is #, the pastey component shall produce a raw identifier (r#ident) from the remaining concatenated tokens; if # appears at any position other than the first, the pastey component shall emit a compile error"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_001@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_010 {
description = "The pastey component shall collect the string values of all #[doc = ...] attribute arguments within a pastey invocation and shall concatenate them in order into a single documentation string"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_004@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_011 {
description = "The pastey component shall look up the named variable in the compile-time environment, shall replace all hyphens in the resolved string with underscores, and shall emit a compile error when the variable is absent from the build environment"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_005@1]
version = 1
}
52 changes: 52 additions & 0 deletions docs/pastey/docs/requirement/feature_requirements.trlc
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed in meeting: our preferred solution was to have one feature collecting several crates (components) - which would mean that the feature level requirements could be even more abstract. Folder structure can be kept.

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/********************************************************************************
* Copyright (c) 2026 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
package PasteyFeatReq

import ScoreReq

ScoreReq.FeatReq FEAT_PASTEY_001 {
description = "The pastey crate shall provide compile-time identifier synthesis by concatenating one or more tokens specified inside a paste! interpolation block (the [< ... >] syntax), ignoring any whitespace between tokens, and shall support a raw-identifier prefix (# as the first token) to produce a raw identifier (r#ident)"
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_001@1]
version = 1
note = "Assumption of Use: the invoker shall only use pastey in Rust source positions where an identifier or item is syntactically valid, as the crate emits raw tokens into the surrounding code without additional context checks"
}

ScoreReq.FeatReq FEAT_PASTEY_002 {
description = "The pastey crate shall support case-transformation modifiers (:lower, :upper, :snake, :camel, :upper_camel, :lower_camel, :camel_edge) that convert a synthesized identifier to the casing style associated with the applied modifier"
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_001@1]
version = 1
}

ScoreReq.FeatReq FEAT_PASTEY_003 {
description = "The pastey crate shall support a string-replacement modifier (:replace(from, to)) that performs substring replacement on a synthesized identifier value and shall produce a compile error when more than one token is supplied for either argument, when the preceding value is absent, or when the modifier syntax is malformed"
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_001@1]
version = 1
}

ScoreReq.FeatReq FEAT_PASTEY_004 {
description = "The pastey crate shall support assembly of documentation strings by concatenating the argument values of all #[doc = ...] attributes present within a single pastey invocation into one documentation string"
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_001@1]
version = 1
}

ScoreReq.FeatReq FEAT_PASTEY_005 {
description = "The pastey crate shall support compile-time expansion of build-environment variables via env!(\"VAR_NAME\") inside a paste! interpolation block (the [< ... >] syntax), replacing hyphens in the resolved value with underscores, and shall produce a compile error when the named variable is not defined in the build environment"
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_002@1]
version = 1
note = "Assumption of Use: the invoker shall ensure that any environment variable referenced via env!(\"VAR_NAME\") inside a paste! interpolation block is defined in the build environment at compile time, since an absent variable causes a compile error that cannot be recovered from at the call site"
}
Loading