Configuration#
jamb uses a two-level configuration model. Project-wide settings live in pyproject.toml under the [tool.jamb] section, controlling behavior like which documents require test coverage, matrix output format, and CI enforcement options. Per-document settings live in a .jamb.yml file inside each document directory, defining the document’s prefix, parent relationships, and UID formatting. The sections below describe both levels in detail.
Project Configuration (pyproject.toml)#
jamb is configured in pyproject.toml under the [tool.jamb] section:
[tool.jamb]
test_documents = ["SRS"]
fail_uncovered = false
require_all_pass = true
software_version = "1.0.0"
exclude_patterns = []
trace_to_ignore = []
# Matrix output options (format inferred from extension)
test_matrix_output = "test-records.html"
trace_matrix_output = "traceability.html"
trace_from = "UN"
include_ancestors = true
Options Reference#
test_documentsList of document prefixes that represent test specifications. These are the documents checked for test coverage.
Type:
list[str]Default:
[]fail_uncoveredFail the pytest session if any items in
test_documentslack test coverage.Type:
boolDefault:
falserequire_all_passRequire all linked tests to pass (not just exist) for an item to be considered covered.
Type:
boolDefault:
truetest_matrix_outputOutput path for the test records matrix (test-centric view). Can be overridden with
--jamb-test-matrix. Format is inferred from the file extension.Type:
str | nullDefault:
nulltrace_matrix_outputOutput path for the traceability matrix (requirement-centric view). Can be overridden with
--jamb-trace-matrix. Format is inferred from the file extension.Type:
str | nullDefault:
nullexclude_patternsGlob patterns for documents or items to exclude from processing.
Type:
list[str]Default:
[]trace_to_ignoreDocument prefixes to exclude from the “Traces To” column in the traceability matrix.
Type:
list[str]Default:
[]software_versionSoftware version to display in the traceability matrix metadata. If not set, jamb auto-detects the version from
[project].versionin pyproject.toml, or from dynamic version files (hatch-vcs, setuptools_scm). Can be overridden at runtime with--jamb-software-version.Type:
str | nullDefault:
null(auto-detected)trace_fromStarting document prefix for full chain trace matrix. When set, the trace matrix starts from this document and traces down through the hierarchy.
Type:
str | nullDefault:
null(auto-detect root document)include_ancestorsInclude a “Traces To” column showing ancestor UIDs in the trace matrix.
Type:
boolDefault:
falsetc_id_prefixPrefix for auto-generated test case IDs. When tests are run with
pytest --jamb, each test receives a unique TC ID likeTC001,TC002. This option customizes the prefix portion.Type:
strDefault:
"TC"Constraints: Only alphanumeric characters, hyphens (
-), and underscores (_) are allowed. Invalid characters will cause a validation error.Example:
tc_id_prefix = "TEST-"produces IDs likeTEST-001,TEST-002
!!! note “Changing the prefix”
Changing tc_id_prefix only affects newly generated TC IDs. Existing IDs in test files (from @pytest.mark.tc_id) and the .jamb coverage file must be updated manually.
matrix_columnsExtra columns to display in the full chain traceability matrix. Each entry defines a column sourced from an item’s custom attributes. The built-in Review Status column is always present (you do not need to configure it).
Type:
listof tables with keyskey,header,source,defaultDefault:
[]
Each [[tool.jamb.matrix_columns]] entry supports:
Key |
Description |
Default |
|---|---|---|
|
Custom attribute name to read from the item YAML |
(required) |
|
Column header displayed in the matrix |
same as |
|
|
|
|
Value shown when the attribute is missing |
|
Example Configurations#
Minimal (most projects):
[tool.jamb]
test_documents = ["SRS"]
Strict CI enforcement:
[tool.jamb]
test_documents = ["SRS", "SYS"]
fail_uncovered = true
require_all_pass = true
trace_matrix_output = "matrix.html"
trace_to_ignore = ["PRJ"]
Custom TC ID prefix:
[tool.jamb]
test_documents = ["SRS"]
tc_id_prefix = "PROJ-TC-"
Dual-matrix output (trace + test records):
[tool.jamb]
test_documents = ["SRS"]
trace_matrix_output = "docs/traceability.html"
test_matrix_output = "docs/test-records.html"
trace_from = "UN"
include_ancestors = true
trace_to_ignore = ["PRJ", "HAZ"]
Extra columns in the trace matrix:
[tool.jamb]
test_documents = ["SRS"]
trace_from = "UN"
[[tool.jamb.matrix_columns]]
key = "safety_class"
header = "Safety Class"
[[tool.jamb.matrix_columns]]
key = "verification_method"
header = "Verification Method"
default = "test"
With this configuration, items with safety_class: B in their YAML will display “B” in the Safety Class column. Items without the attribute display the default (“-“). The Review Status column is always included automatically.
Document Configuration (.jamb.yml)#
Each document directory contains a .jamb.yml file that configures the document:
settings:
prefix: SRS
parents:
- SYS
digits: 3
sep: ""
All fields are nested under a settings key.
Fields#
prefixThe document identifier used in item UIDs (e.g.,
SRS→SRS001).Required
parentsList of parent document prefixes. Defines where items in this document should link to.
Default:
[](root document)digitsNumber of digits in the sequential part of item UIDs.
Default:
3Range:
1to10Example:
digits: 3→SRS001,digits: 4→SRS0001sepSeparator between prefix and number in UIDs.
Default:
""(no separator)Constraint: Cannot start with an alphanumeric character (would create ambiguous UIDs like
SRSX001)Example:
sep: "-"→SRS-001
Creating Documents#
Documents are created with jamb doc create, which generates the .jamb.yml file:
jamb doc create SRS reqs/srs --parent SYS --digits 3
See Command Reference for all document management commands.