Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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 compiler shall support procedural macro invocation that transforms token streams at compile time, including accepting raw identifiers (r#ident) and #[doc = ...] attribute tokens emitted from a procedural macro as syntactically valid output"
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.

Wrong understanding of assumed System Requirements: it does not describe the assumption of what the system (here the Rust compiler, which is not part of our SW platform) would provide for your component/crate but what you think the system expects from "paste! macro". These would be "Assumptions of Use" and I think be documented in the feature requirements trlc. And it should be on a level like https://eclipse-score.github.io/score/main/requirements/stakeholder/index.html#stkh_req__dev_experience__prog_languages (from user of the platform perspective).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have updated system requirement in term of Rust toolchain which is kind of external system.

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.

need to discuss this

Copy link
Copy Markdown
Contributor

@aschemmel-tech aschemmel-tech May 12, 2026

Choose a reason for hiding this comment

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

Agreed in meeting to replace these by a assumed system requirment like https://eclipse-score.github.io/score/main/requirements/stakeholder/index.html#stkh_req__dev_experience__prog_languages and to create an AoU on feature level stating that pastey crate expects "qualified Rust compiler including macro infrastructure". AoU in trlc: see https://github.com/eclipse-score/communication/blob/main/score/mw/com/dependability/safety_analysis/aou.trlc

safety = ScoreReq.Asil.B
version = 1
rationale = "The paste! macro relies on the Rust procedural macro system to perform compile-time identifier synthesis inside [< ... >] blocks, this single capability covers identifier concatenation, case modifiers, the replace modifier, raw identifier generation, and documentation string assembly"
}

ScoreReq.AssumedSystemReq ASR_PASTEY_002 {
description = "The Rust build environment shall expose named environment variables to procedural macros at compile time so that their values can be incorporated into generated identifiers"
safety = ScoreReq.Asil.B
version = 1
rationale = "pastey supports env!(\"VAR_NAME\") inside [< ... >] which requires compile-time read access to the host 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 token parser component shall collect all tokens inside [< ... >] and shall discard whitespace tokens between them before performing identifier concatenation"
Comment thread
aschemmel-tech marked this conversation as resolved.
Outdated
Comment thread
aschemmel-tech marked this conversation as resolved.
Outdated
safety = ScoreReq.Asil.B
derived_from = [PasteyFeaReq.FEAT_PASTEY_001@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_002 {
description = "The case conversion component shall apply str::to_lowercase to the accumulated identifier string when the :lower modifier is present"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeaReq.FEAT_PASTEY_002@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_003 {
description = "The case conversion component shall apply str::to_uppercase to the accumulated identifier string when the :upper modifier is present"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeaReq.FEAT_PASTEY_003@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_004 {
description = "The case conversion component shall convert the accumulated identifier string to snake_case when the :snake modifier is present"
Comment thread
aschemmel-tech marked this conversation as resolved.
Outdated
safety = ScoreReq.Asil.B
derived_from = [PasteyFeaReq.FEAT_PASTEY_004@1]
version = 1
}

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

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

ScoreReq.CompReq REQ_COMP_PASTEY_007 {
description = "The case conversion 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 = [PasteyFeaReq.FEAT_PASTEY_007@1]
version = 1
}

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

ScoreReq.CompReq REQ_COMP_PASTEY_009 {
description = "The raw identifier component shall detect a leading # token as the very first token inside [< ... >], shall set raw mode and produce an r#ident output token, and shall emit a compile error if # appears at any position other than the first"
Comment thread
aschemmel-tech marked this conversation as resolved.
Outdated
safety = ScoreReq.Asil.B
derived_from = [PasteyFeaReq.FEAT_PASTEY_009@1]
version = 1
}

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

ScoreReq.CompReq REQ_COMP_PASTEY_011 {
description = "The environment expansion 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 = [PasteyFeaReq.FEAT_PASTEY_011@1]
version = 1
}
92 changes: 92 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,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 PasteyFeatReq

import ScoreReq

ScoreReq.FeatReq FEAT_PASTEY_001 {
description = "The paste! macro shall concatenate all identifier tokens listed inside [< ... >] into a single identifier and shall ignore any whitespace tokens between them"
Comment thread
aschemmel-tech marked this conversation as resolved.
Outdated
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_001@1]
version = 1
}

ScoreReq.FeatReq FEAT_PASTEY_002 {
description = "The paste! macro shall support the :lower modifier, which shall convert the pasted identifier value to lowercase"
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_001@1]
version = 1
}

ScoreReq.FeatReq FEAT_PASTEY_003 {
description = "The paste! macro shall support the :upper modifier, which shall convert the pasted identifier value to uppercase"
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_001@1]
version = 1
}

ScoreReq.FeatReq FEAT_PASTEY_004 {
description = "The paste! macro shall support the :snake modifier, which shall convert the pasted identifier value to snake_case"
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_001@1]
version = 1
}

ScoreReq.FeatReq FEAT_PASTEY_005 {
description = "The paste! macro shall support the :camel and :upper_camel modifiers, which shall convert the pasted identifier value to UpperCamelCase"
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_001@1]
version = 1
}

ScoreReq.FeatReq FEAT_PASTEY_006 {
description = "The paste! macro shall support the :lower_camel modifier, which shall convert the pasted identifier value to lowerCamelCase"
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_001@1]
version = 1
}

ScoreReq.FeatReq FEAT_PASTEY_007 {
description = "The paste! macro shall support the :camel_edge modifier, which shall convert the pasted identifier value to UpperCamelCase while preserving edge-case boundaries such as sequences of consecutive uppercase letters"
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_001@1]
version = 1
}

ScoreReq.FeatReq FEAT_PASTEY_008 {
description = "The paste! macro shall support the :replace(from, to) modifier, which shall perform string replacement on the preceding pasted value using str::replace semantics, 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_009 {
description = "The paste! macro shall produce a raw identifier (r#ident) when the first and only prefix token inside [< ... >] is # and shall produce a compile error if # appears at any position other than the first"
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_001@1]
version = 1
}

ScoreReq.FeatReq FEAT_PASTEY_010 {
description = "The paste! macro shall implicitly concatenate all argument values of #[doc = ...] attributes within a paste! invocation into a single documentation string"
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_001@1]
version = 1
}

ScoreReq.FeatReq FEAT_PASTEY_011 {
description = "The paste! macro shall resolve env!(\"VAR_NAME\") expressions inside [< ... >] to the named environment variable value at compile time, shall replace hyphens in the resolved value with underscores, and shall produce a compile error when the named variable is not defined"
safety = ScoreReq.Asil.B
derived_from = [PasteySysReq.ASR_PASTEY_002@1]
version = 1
}
Loading