Skip to content

Commit e2e6f95

Browse files
harmjeffclaude
andcommitted
fix(traceability): fix all markdownlint errors in documentation
Fix 1,205 MD060 table alignment errors, MD040 missing code fence languages, MD025 multiple H1 headings, and MD041 missing first-line H1 across all 17 markdown files in scripts/aidlc-traceability/. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent b14ab0a commit e2e6f95

17 files changed

Lines changed: 537 additions & 427 deletions
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# Legal Disclaimer
2+
13
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
35
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
46
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
57
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
6-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

scripts/aidlc-traceability/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Each agent is focused on a specific artifact pair, preventing context pollution
118118

119119
## Project Structure
120120

121-
```
121+
```text
122122
AIDLC-Traceability/
123123
├── src/traceability/ # Main implementation
124124
│ ├── cli.py # Click-based CLI
@@ -175,6 +175,7 @@ uv sync
175175
### Markdown Report
176176

177177
The markdown report includes:
178+
178179
- Summary statistics (artifact counts, coverage percentages)
179180
- Complete traceability matrix showing all relationships
180181
- Gap analysis highlighting orphaned artifacts
@@ -183,6 +184,7 @@ The markdown report includes:
183184
### HTML Report
184185

185186
The HTML report provides:
187+
186188
- Interactive dark mode toggle
187189
- Resizable sidebar for navigation
188190
- Collapsible sections
@@ -199,4 +201,4 @@ This tool generates traceability documentation to support your development and c
199201

200202
## License
201203

202-
This project is licensed under the [MIT License](LICENSE).
204+
This project is licensed under the [MIT License](LICENSE).

scripts/aidlc-traceability/docs/ai-compliance.md

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@ Copyright (c) 2026 AIDLC Traceability Tool Contributors
77

88
## GenAI Use Case Classification
99

10-
| Attribute | Value |
11-
|-----------|-------|
12-
| **Use Case** | Development tooling — automated traceability analysis |
13-
| **Risk Level** | LOW |
14-
| **Domain** | Software engineering documentation |
15-
| **Decision Impact** | Advisory only — generates reports for human review |
16-
| **PII Processing** | None — tool processes code and documentation artifacts |
10+
| Attribute | Value |
11+
| ------------------- | --------------------------------------------------------------------- |
12+
| **Use Case** | Development tooling — automated traceability analysis |
13+
| **Risk Level** | LOW |
14+
| **Domain** | Software engineering documentation |
15+
| **Decision Impact** | Advisory only — generates reports for human review |
16+
| **PII Processing** | None — tool processes code and documentation artifacts |
1717
| **Safety-Critical** | No — tool does not make health, financial, legal, or safety decisions |
1818

1919
### Risk Justification
2020

2121
This is a **low-risk** GenAI use case because:
22+
2223
1. The AI generates suggested relationships between development artifacts (requirements, stories, code)
2324
2. All AI output is validated against known artifact IDs before inclusion in reports
2425
3. Reports are for informational and documentation purposes; no automated decisions are made
@@ -29,59 +30,60 @@ This is a **low-risk** GenAI use case because:
2930

3031
### Amazon Bedrock — Claude Sonnet
3132

32-
| Attribute | Value |
33-
|-----------|-------|
34-
| **Provider** | Anthropic (via Amazon Bedrock marketplace) |
35-
| **Model** | Claude Sonnet 4 (`us.anthropic.claude-sonnet-4-20250514-v1:0`) |
36-
| **Access Method** | Amazon Bedrock API (on-demand) |
37-
| **Data Retention** | None — Amazon Bedrock does not retain customer prompt/completion data |
38-
| **Training Data Usage** | None — customer data is not used for model training |
33+
| Attribute | Value |
34+
| ----------------------- | --------------------------------------------------------------------- |
35+
| **Provider** | Anthropic (via Amazon Bedrock marketplace) |
36+
| **Model** | Claude Sonnet 4 (`us.anthropic.claude-sonnet-4-20250514-v1:0`) |
37+
| **Access Method** | Amazon Bedrock API (on-demand) |
38+
| **Data Retention** | None — Amazon Bedrock does not retain customer prompt/completion data |
39+
| **Training Data Usage** | None — customer data is not used for model training |
3940

4041
### Legal Approval and Right to Use
4142

42-
| Component | License/Terms | Approval Status |
43-
|-----------|--------------|-----------------|
44-
| **Claude Sonnet (via Amazon Bedrock)** | [AWS Service Terms](https://aws.amazon.com/service-terms/) — Amazon Bedrock section | Pre-approved: Amazon Bedrock marketplace models are available to all AWS customers with Amazon Bedrock access. No separate Anthropic license required. |
45-
| **Strands Agents SDK** (`strands-agents`) | Apache License 2.0 ([source](https://github.com/strands-agents/strands-agents)) | Pre-approved: Open-source, permissive license compatible with MIT. No usage restrictions or distribution limitations. |
46-
| **Strands Agents Tools** (`strands-agents-tools`) | Apache License 2.0 | Pre-approved: Same terms as strands-agents SDK. |
47-
| **boto3** (AWS SDK) | Apache License 2.0 | Pre-approved: Official AWS SDK, open source. |
43+
| Component | License/Terms | Approval Status |
44+
| ------------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
45+
| **Claude Sonnet (via Amazon Bedrock)** | [AWS Service Terms](https://aws.amazon.com/service-terms/) — Amazon Bedrock section | Pre-approved: Amazon Bedrock marketplace models are available to all AWS customers with Amazon Bedrock access. No separate Anthropic license required. |
46+
| **Strands Agents SDK** (`strands-agents`) | Apache License 2.0 ([source](https://github.com/strands-agents/strands-agents)) | Pre-approved: Open-source, permissive license compatible with MIT. No usage restrictions or distribution limitations. |
47+
| **Strands Agents Tools** (`strands-agents-tools`) | Apache License 2.0 | Pre-approved: Same terms as strands-agents SDK. |
48+
| **boto3** (AWS SDK) | Apache License 2.0 | Pre-approved: Official AWS SDK, open source. |
4849

4950
**Organizational approval**: Users deploying this tool should verify that their organization's policies permit the use of Amazon Bedrock and the Claude model family. Many organizations pre-approve all Amazon Bedrock marketplace models under their AWS Enterprise Agreement.
5051

5152
## Third-Party Framework Usage
5253

5354
### Strands Agents SDK
5455

55-
| Attribute | Value |
56-
|-----------|-------|
57-
| **Package** | `strands-agents` |
58-
| **License** | Apache License 2.0 |
59-
| **Source** | Open source |
60-
| **Purpose** | Agent orchestration framework for Amazon Bedrock model invocation |
56+
| Attribute | Value |
57+
| ----------------- | ------------------------------------------------------------------------ |
58+
| **Package** | `strands-agents` |
59+
| **License** | Apache License 2.0 |
60+
| **Source** | Open source |
61+
| **Purpose** | Agent orchestration framework for Amazon Bedrock model invocation |
6162
| **Data Handling** | SDK passes prompts to Amazon Bedrock API; no independent data collection |
6263

6364
## Implemented AI Security Controls
6465

6566
The following security controls are implemented in `src/traceability/agent.py` and the pipeline:
6667

67-
| Control | Implementation | File:Line |
68-
|---------|---------------|-----------|
69-
| **Input isolation** | Each of 4 agents receives only its relevant artifact pair; no cross-agent data leakage | `agent.py:86-170` |
70-
| **Static system prompts** | System prompts are hardcoded strings; no user input is injected into system prompts | `agent.py:86-170` |
71-
| **Output format enforcement** | Agents are instructed to respond in JSON only; non-JSON responses are discarded | `agent.py:173-228` |
72-
| **Artifact ID validation** | All `source_id` and `target_id` values validated against known parsed artifact IDs | `agent.py:189-215` |
73-
| **Invalid relationship filtering** | Relationships referencing non-existent artifacts are silently discarded and counted | `agent.py:205-215` |
74-
| **Output sanitization** | AI-generated text is not rendered as raw content; only validated artifact IDs are used to create graph edges. Report generators escape all artifact content via `html.escape()` before rendering | `generators/html.py:116-117` |
75-
| **Graceful degradation** | Amazon Bedrock failures are caught; pipeline falls back to heuristic-only analysis | `pipeline.py:229-234` |
76-
| **Data volume limits** | Source code reading limited to 30 files, 200 lines each | `agent.py:50-65` |
77-
| **No code execution** | No `eval()`, `exec()`, or dynamic code execution of AI responses | Verified by Bandit scan |
78-
| **Configurable opt-out** | AI analysis is fully optional via `--no-ai` flag | `cli.py:26` |
68+
| Control | Implementation | File:Line |
69+
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------- |
70+
| **Input isolation** | Each of 4 agents receives only its relevant artifact pair; no cross-agent data leakage | `agent.py:86-170` |
71+
| **Static system prompts** | System prompts are hardcoded strings; no user input is injected into system prompts | `agent.py:86-170` |
72+
| **Output format enforcement** | Agents are instructed to respond in JSON only; non-JSON responses are discarded | `agent.py:173-228` |
73+
| **Artifact ID validation** | All `source_id` and `target_id` values validated against known parsed artifact IDs | `agent.py:189-215` |
74+
| **Invalid relationship filtering** | Relationships referencing non-existent artifacts are silently discarded and counted | `agent.py:205-215` |
75+
| **Output sanitization** | AI-generated text is not rendered as raw content; only validated artifact IDs are used to create graph edges. Report generators escape all artifact content via `html.escape()` before rendering | `generators/html.py:116-117` |
76+
| **Graceful degradation** | Amazon Bedrock failures are caught; pipeline falls back to heuristic-only analysis | `pipeline.py:229-234` |
77+
| **Data volume limits** | Source code reading limited to 30 files, 200 lines each | `agent.py:50-65` |
78+
| **No code execution** | No `eval()`, `exec()`, or dynamic code execution of AI responses | Verified by Bandit scan |
79+
| **Configurable opt-out** | AI analysis is fully optional via `--no-ai` flag | `cli.py:26` |
7980

8081
For detailed technical documentation of these controls, see [docs/ai-security.md](ai-security.md).
8182

8283
## No Training Data Used
8384

8485
This tool does not:
86+
8587
- Train or fine-tune any AI models
8688
- Create or manage training datasets
8789
- Store AI interaction data for future training
@@ -95,11 +97,11 @@ The AI agents perform **artifact relationship mapping** — connecting requireme
9597

9698
### Potential Bias Vectors
9799

98-
| Vector | Risk | Mitigation |
99-
|--------|------|-----------|
100-
| Naming bias | AI may favor artifacts with descriptive names over terse ones | Heuristic linker provides baseline; AI adds to it |
101-
| Language bias | Non-English artifact names may produce fewer matches | Not applicable — tool targets English-language AI-DLC projects |
102-
| Completeness bias | AI may over-connect well-documented artifacts, under-connect sparse ones | Gap analysis independently identifies unconnected artifacts |
100+
| Vector | Risk | Mitigation |
101+
| ----------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------- |
102+
| Naming bias | AI may favor artifacts with descriptive names over terse ones | Heuristic linker provides baseline; AI adds to it |
103+
| Language bias | Non-English artifact names may produce fewer matches | Not applicable — tool targets English-language AI-DLC projects |
104+
| Completeness bias | AI may over-connect well-documented artifacts, under-connect sparse ones | Gap analysis independently identifies unconnected artifacts |
103105

104106
### Fairness Assessment
105107

scripts/aidlc-traceability/docs/ai-security.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,47 +12,55 @@ This document describes the security controls applied to the AI-powered analysis
1212
## Input Controls
1313

1414
### Prompt Construction
15+
1516
- System prompts are static strings defined in `agent.py`; no user input is injected into system prompts
1617
- User artifact data (IDs, titles, descriptions) is included in the user message portion of the prompt
1718
- Each agent receives only the artifact types relevant to its analysis scope (e.g., the Req→Story agent only sees requirements and stories)
1819

1920
### Data Volume Limits
21+
2022
- Component→Code agent limits source code reading to **30 files** and **200 lines per file**
2123
- Artifact lists are formatted as structured text (ID: Title format), not raw file contents
2224
- Boilerplate files are marked and excluded from detailed analysis
2325

2426
## Output Validation
2527

2628
### JSON Response Parsing
29+
2730
- All agent responses are expected in JSON format with a defined schema
2831
- `_parse_agent_json()` in `agent.py` enforces the expected structure:
2932
- Must contain a `relationships` array with `source_id` and `target_id` fields
3033
- May contain an `insights` array of string observations
3134

3235
### Artifact ID Validation
36+
3337
- Every `source_id` and `target_id` in AI-discovered relationships is validated against the set of known artifact IDs parsed in Stage 2
3438
- Relationships referencing non-existent artifact IDs are silently discarded
3539
- The count of invalid/discarded relationships is tracked and logged
3640
- This prevents the AI from hallucinating artifact IDs or injecting arbitrary nodes into the traceability graph
3741

3842
### Error Handling
43+
3944
- JSON parse failures are caught; the pipeline continues with rule-based results only
4045
- Amazon Bedrock API errors (timeouts, throttling, auth failures) are caught and logged
4146
- No AI error causes the pipeline to fail; it degrades gracefully to heuristic-only analysis
4247

4348
## Prompt Injection Mitigations
4449

4550
### Scope Isolation
51+
4652
- Four separate agents with focused system prompts prevent cross-concern contamination
4753
- Each agent can only produce relationships between its assigned artifact types
4854
- The Req→Story agent cannot create Component→Code relationships, and vice versa
4955

5056
### Output Format Enforcement
57+
5158
- Agents are instructed to respond only in JSON format
5259
- Non-JSON responses are discarded entirely
5360
- The tool does not execute, eval, or interpret any text from AI responses as code
5461

5562
### Read-Only File Access
63+
5664
- The `read_source_code_file` tool available to the Component→Code agent is read-only
5765
- It returns file content as a string; it cannot modify files
5866
- File paths are resolved relative to the project root

scripts/aidlc-traceability/docs/architecture.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ flowchart LR
126126
```
127127

128128
**Key properties:**
129+
129130
- The tool only **reads** project files; it does not modify them
130131
- Reports are written to the local filesystem only
131132
- Amazon Bedrock calls are outbound HTTPS (TLS 1.2+) and only occur when AI is enabled
@@ -184,12 +185,12 @@ graph TB
184185

185186
## Technology Stack
186187

187-
| Component | Technology | Purpose |
188-
|-----------|-----------|---------|
189-
| CLI | Click | Command-line interface |
190-
| Models | Pydantic | Data validation and serialization |
191-
| Graph | NetworkX | Directed graph for traceability relationships |
192-
| AI | Strands Agents + Amazon Bedrock | Optional relationship discovery |
193-
| AWS | boto3 | Amazon Bedrock API access |
194-
| Templates | Jinja2 (available) | Report template rendering |
195-
| Output | Rich | Terminal formatting |
188+
| Component | Technology | Purpose |
189+
| --------- | ------------------------------- | --------------------------------------------- |
190+
| CLI | Click | Command-line interface |
191+
| Models | Pydantic | Data validation and serialization |
192+
| Graph | NetworkX | Directed graph for traceability relationships |
193+
| AI | Strands Agents + Amazon Bedrock | Optional relationship discovery |
194+
| AWS | boto3 | Amazon Bedrock API access |
195+
| Templates | Jinja2 (available) | Report template rendering |
196+
| Output | Rich | Terminal formatting |

scripts/aidlc-traceability/docs/bedrock-security.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ If temporary credentials are not available, use named profiles with access keys
9696

9797
When AI analysis is enabled, the following data is sent to the Amazon Bedrock API:
9898

99-
| Data Type | Content | Volume |
100-
|-----------|---------|--------|
101-
| Artifact summaries | IDs, titles, descriptions from parsed artifacts | All artifacts |
102-
| Source code snippets | File contents for Component→Code linking | Up to 30 files, 200 lines each |
103-
| System prompts | Agent instructions (static, no user data) | 4 prompts per run |
99+
| Data Type | Content | Volume |
100+
| -------------------- | ----------------------------------------------- | ------------------------------ |
101+
| Artifact summaries | IDs, titles, descriptions from parsed artifacts | All artifacts |
102+
| Source code snippets | File contents for Component→Code linking | Up to 30 files, 200 lines each |
103+
| System prompts | Agent instructions (static, no user data) | 4 prompts per run |
104104

105105
### Data Residency
106106

0 commit comments

Comments
 (0)