Skip to content

Commit 411b704

Browse files
xiangu-batwhoe-jo
authored andcommitted
validation framework
1 parent d0016f1 commit 411b704

28 files changed

Lines changed: 1805 additions & 719 deletions

bazel/rules/rules_score/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ architectural_design(
8787
```
8888

8989
**`bazel build`** — runs `puml_parser` on every `.puml` file, producing:
90-
- a `.fbs.bin` FlatBuffers binary (diagram AST) — consumed by archver validation
90+
- a `.fbs.bin` FlatBuffers binary (diagram AST) — consumed by validation/core checks
9191
- a `.lobster` traceability file (Interface elements only) — consumed by LOBSTER
9292
- a `plantuml_links.json` — consumed by the `clickable_plantuml` Sphinx extension
9393

@@ -195,7 +195,7 @@ dependable_element(
195195
**`bazel build`** — generates a complete HTML documentation zip via Sphinx.
196196
Internally:
197197
1. `_dependable_element_index` generates an `index.rst` aggregating all
198-
artifacts, runs archver architecture validation as a subrule, and
198+
artifacts, runs validation/core architecture checks as a subrule, and
199199
produces a DE-level LOBSTER report (`lobster_de.conf` template covering
200200
Feature Req → Component Req → Architecture → Public API → Failure Modes).
201201
2. `sphinx_module` compiles all RST sources + diagrams into an HTML zip.

bazel/rules/rules_score/private/dependable_element.bzl

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ def _collect_architecture_components(ctx):
622622

623623
return all_components
624624

625-
def _run_archver_validation(ctx, arch_json, static_fbs_files):
625+
def _run_validation(ctx, arch_json, static_fbs_files):
626626
"""Run the architecture verifier tool against a pre-built JSON file.
627627
628628
Args:
@@ -631,27 +631,27 @@ def _run_archver_validation(ctx, arch_json, static_fbs_files):
631631
static_fbs_files: List of static FlatBuffer files to verify against
632632
633633
Returns:
634-
archver_log File object
634+
validation_log File object
635635
"""
636636

637-
archver_log = ctx.actions.declare_file(ctx.label.name + "/archver.log")
637+
validation_log = ctx.actions.declare_file(ctx.label.name + "/validation.log")
638638

639-
archver_args = ctx.actions.args()
640-
archver_args.add("--architecture-json", arch_json)
641-
archver_args.add_all("--static-fbs", static_fbs_files)
642-
archver_args.add("--output", archver_log)
639+
validation_args = ctx.actions.args()
640+
validation_args.add("--architecture-json", arch_json)
641+
validation_args.add_all("--component-fbs", static_fbs_files)
642+
validation_args.add("--output", validation_log)
643643

644-
# ctx.actions.run will fail the build if archver returns non-zero exit code
644+
# ctx.actions.run will fail the build if validation_cli returns non-zero exit code
645645
ctx.actions.run(
646646
inputs = [arch_json] + static_fbs_files,
647-
outputs = [archver_log],
648-
executable = ctx.executable._archver,
649-
arguments = [archver_args],
650-
progress_message = "Verifying architecture: %s" % ctx.label.name,
651-
mnemonic = "ArchVerify",
647+
outputs = [validation_log],
648+
executable = ctx.executable._validation_cli,
649+
arguments = [validation_args],
650+
progress_message = "Running validation: %s" % ctx.label.name,
651+
mnemonic = "ArchitectureValidate",
652652
)
653653

654-
return archver_log
654+
return validation_log
655655

656656
# ============================================================================
657657
# Index Generation Rule Implementation
@@ -780,7 +780,7 @@ def _dependable_element_index_impl(ctx):
780780
)
781781

782782
# =========================================================================
783-
# Architecture Verification: build current-architecture JSON and run archver
783+
# Architecture Verification: build current-architecture JSON and run validation
784784
# =========================================================================
785785

786786
# Collect the current architecture from all components (via aspect) and
@@ -800,13 +800,13 @@ def _dependable_element_index_impl(ctx):
800800
if ArchitecturalDesignInfo in ad:
801801
static_fbs_files.extend(ad[ArchitecturalDesignInfo].static.to_list())
802802

803-
# Run architecture verifier; build fails automatically on non-zero exit
804-
archver_log = _run_archver_validation(ctx, arch_json, static_fbs_files)
803+
# Run validation; build fails automatically on non-zero exit
804+
validation_log = _run_validation(ctx, arch_json, static_fbs_files)
805805

806-
# Both outputs are included so archver always runs in a default build.
807-
# archver_log is also exposed in the debug output group for explicit access.
806+
# Both outputs are included so validation always runs in a default build.
807+
# validation_log is also exposed in the debug output group for explicit access.
808808
output_files.append(arch_json)
809-
output_files.append(archver_log)
809+
output_files.append(validation_log)
810810

811811
# =========================================================================
812812
# Safety Certification Validation: certified scope and integrity level checks
@@ -961,7 +961,7 @@ def _dependable_element_index_impl(ctx):
961961
lobster_report = lobster_report_file,
962962
lobster_html_report = lobster_html_report,
963963
),
964-
OutputGroupInfo(debug = depset([archver_log])),
964+
OutputGroupInfo(debug = depset([validation_log])),
965965
]
966966

967967
_dependable_element_index = rule(
@@ -1024,11 +1024,11 @@ _dependable_element_index = rule(
10241024
values = _INTEGRITY_LEVELS,
10251025
doc = "Integrity level of the dependable element. Allowed values: 'A', 'B', 'C', 'D' (D > C > B > A).",
10261026
),
1027-
"_archver": attr.label(
1028-
default = Label("//validation/archver"),
1027+
"_validation_cli": attr.label(
1028+
default = Label("//validation/core:validation_cli"),
10291029
executable = True,
10301030
cfg = "exec",
1031-
doc = "Architecture verifier tool",
1031+
doc = "Validation CLI tool",
10321032
),
10331033
"_lobster_de_template": attr.label(
10341034
default = Label("//bazel/rules/rules_score/lobster/config:lobster_de_template"),
@@ -1201,7 +1201,7 @@ def dependable_element(
12011201
processed_deps.append("{}_index".format(dep))
12021202

12031203
# Step 1: Generate index.rst and collect all artifacts
1204-
# Note: archver validation runs as a subrule within the index generation
1204+
# Note: validation runs as a subrule within the index generation
12051205
_dependable_element_index(
12061206
name = name + "_index",
12071207
module_name = name,

plantuml/parser/puml_serializer/src/fbs/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ rust_library(
7272
],
7373
visibility = [
7474
"//plantuml/parser:__subpackages__",
75+
"//validation/core:__subpackages__",
7576
],
7677
deps = [
7778
"@crates//:flatbuffers",

validation/archver/BUILD

Lines changed: 0 additions & 38 deletions
This file was deleted.

validation/archver/README.md

Lines changed: 0 additions & 82 deletions
This file was deleted.

validation/archver/design/static_design.puml

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)