Skip to content

Commit 813cca0

Browse files
brabojclaude
andauthored
feat(tests): point TPL-01..03 at the fixture, which gains an EXTEND and an OVERRIDE (#1967)
* feat(tests): point TPL-01..03 at the fixture, which gains an EXTEND and an OVERRIDE Part of #1944: the split removes the stacks these checks read, and the fixture is the one stack upstream keeps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(tests): TPL-01 requires the fixture's DEPENDS ON chain, not the core tier Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 88d1286 commit 813cca0

5 files changed

Lines changed: 67 additions & 56 deletions

File tree

‎templates/fixture/stack.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,17 @@ make lint # lint and format check
3333

3434
- `src/` — the service, one module per endpoint
3535
- `tests/` — one test file per module under `src/`, named after it
36+
37+
---
38+
39+
## General testing rules
40+
[EXTEND: base-testing-general]
41+
42+
- Every endpoint test sends an empty body as well as a non-empty one
43+
44+
---
45+
46+
## Container e2e
47+
[OVERRIDE: testing-container-e2e]
48+
49+
- The service ships no image, so no test builds or runs a container

‎tests/run_smoke.py‎

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def check_mnf_01():
421421

422422

423423
# ---------------------------------------------------------------------------
424-
# TPL-01 — DEPENDS ON chain from python-fastapi.md is complete
424+
# TPL-01 — DEPENDS ON chain from the fixture stack is complete
425425
# ---------------------------------------------------------------------------
426426

427427
def _collect_chain(rel_path, visited=None):
@@ -440,28 +440,25 @@ def _collect_chain(rel_path, visited=None):
440440

441441
def check_tpl_01():
442442
failures = []
443-
chain = _collect_chain("templates/stack/python-fastapi.md")
443+
444+
# The fixture, not a real stack: it is the one stack upstream keeps, so
445+
# the check keeps its input in a tree that ships no stack of its own.
446+
chain = _collect_chain("templates/fixture/stack.md")
444447
required = [
445-
"templates/stack/python-lib.md",
446-
"templates/stack/python-service.md",
447-
"templates/core/git.md",
448-
"templates/core/docs.md",
449448
"templates/core/quality.md",
449+
"templates/core/git.md",
450+
"templates/core/testing.md",
450451
"templates/core/config.md",
451-
"templates/backend/http.md",
452-
"templates/backend/database.md",
453-
"templates/backend/observability.md",
454-
"templates/backend/quality.md",
455-
"templates/backend/features.md",
456-
"templates/backend/messaging.md",
452+
"templates/core/quality-gates.md",
453+
"templates/security/security.md",
457454
]
458455
seen = Inspected()
459-
seen.count("files in the python-fastapi chain", len(chain))
456+
seen.count("files in the fixture chain", len(chain))
460457
seen.count("files required to be in it", len(required))
461458

462459
for req in required:
463460
if req not in chain:
464-
failures.append(f" python-fastapi.md chain missing: '{req}'")
461+
failures.append(f" fixture/stack.md chain missing: '{req}'")
465462
return seen.failures() + failures, seen.notes()
466463

467464

@@ -503,19 +500,20 @@ def check_tpl_02():
503500
if not base_content:
504501
failures.append(" core/testing.md [ID: base-testing] section is empty")
505502

506-
flask_content = _extract_section(
507-
os.path.join(ROOT, "templates", "stack", "python-flask.md"), "python-service-testing"
503+
extension = _extract_section(
504+
os.path.join(ROOT, "templates", "fixture", "stack.md"),
505+
"base-testing-general"
508506
)
509-
if not flask_content:
507+
if not extension:
510508
failures.append(
511-
" stack/python-flask.md [EXTEND: python-service-testing] section is empty "
512-
"— base rules may have been lost"
509+
" fixture/stack.md [EXTEND: base-testing-general] section is "
510+
"empty — base rules may have been lost"
513511
)
514512

515513
seen.count("sections extracted", 2)
516514
seen.count("lines read from base-testing", len(base_content), floor=0)
517-
seen.count("lines read from python-service-testing",
518-
len(flask_content), floor=0)
515+
seen.count("lines read from the fixture's extension",
516+
len(extension), floor=0)
519517
return seen.failures() + failures, seen.notes()
520518

521519

@@ -528,22 +526,26 @@ def check_tpl_03():
528526
seen = Inspected()
529527

530528
original = _extract_section(
531-
os.path.join(ROOT, "templates", "stack", "go-lib.md"), "go-lib-stack"
529+
os.path.join(ROOT, "templates", "core", "testing.md"),
530+
"testing-container-e2e"
532531
)
533532
override = _extract_section(
534-
os.path.join(ROOT, "templates", "stack", "go-service.md"), "go-lib-stack"
533+
os.path.join(ROOT, "templates", "fixture", "stack.md"),
534+
"testing-container-e2e"
535535
)
536536

537537
if not original:
538-
failures.append(" stack/go-lib.md [ID: go-lib-stack] section is empty")
538+
failures.append(
539+
" core/testing.md [ID: testing-container-e2e] section is empty")
539540
if not override:
540541
failures.append(
541-
" stack/go-service.md [OVERRIDE: go-lib-stack] section is empty"
542+
" fixture/stack.md [OVERRIDE: testing-container-e2e] section is "
543+
"empty"
542544
)
543545
if original and override and original == override:
544546
failures.append(
545-
" [OVERRIDE: go-lib-stack] content is identical to the original "
546-
"[ID: go-lib-stack] — override has no effect"
547+
" [OVERRIDE: testing-container-e2e] content is identical to the "
548+
"original [ID: testing-container-e2e] — override has no effect"
547549
)
548550

549551
seen.count("sections extracted", 2)
@@ -2625,7 +2627,7 @@ def check_sys_20():
26252627
{"id": "MNF-05", "spec": "SAIT-INT-MNF-05-001A",
26262628
"title": "resolve.py resolution matches PyYAML resolution", "fn": check_mnf_05},
26272629
{"id": "TPL-01", "spec": "SAIT-INT-TPL-01-001A",
2628-
"title": "DEPENDS ON chain from python-fastapi.md is complete", "fn": check_tpl_01},
2630+
"title": "DEPENDS ON chain from the fixture stack is complete", "fn": check_tpl_01},
26292631
{"id": "TPL-02", "spec": "SAIT-INT-TPL-02-001A",
26302632
"title": "EXTEND adds rules without removing base rules", "fn": check_tpl_02},
26312633
{"id": "TPL-03", "spec": "SAIT-INT-TPL-03-001A",

‎tests/specs/SAIT-INT-TPL-01-001A.md‎

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,35 +38,28 @@ tags: [composition, depends-on, inheritance]
3838

3939
- Repository cloned locally
4040
- Claude Code or equivalent agent available
41-
- `stack/python-flask.md` and its full dependency chain accessible:
42-
`stack/python-lib.md`, `stack/python-service.md`, `core/git.md`,
43-
`core/docs.md`, `core/quality.md`, `backend/config.md`, `backend/http.md`,
44-
`backend/database.md`, `backend/observability.md`, `backend/quality.md`,
45-
`backend/features.md`, `backend/messaging.md`
41+
- `fixture/stack.md` and its full dependency chain accessible. The fixture
42+
is the one stack upstream keeps
4643

4744
### Setup
4845

4946
1. Open Claude Code in the repository root
50-
2. Attach `stack/python-flask.md` to the conversation
47+
2. Attach `fixture/stack.md` to the conversation
5148

5249
### Execution
5350

5451
1. Ask the agent:
5552
```
56-
List every template in the full DEPENDS ON chain for stack/python-flask.md,
53+
List every template in the full DEPENDS ON chain for fixture/stack.md,
5754
then list every section heading that will appear in the assembled rule set.
5855
```
5956
2. Record the list of templates and sections returned
6057

6158
### Assertions
6259

6360
1. Assert the dependency chain includes all of the following:
64-
- `stack/python-lib.md`
65-
- `stack/python-service.md`
66-
- `core/git.md`, `core/docs.md`, `core/quality.md`
67-
- `backend/config.md`, `backend/http.md`, `backend/database.md`
68-
- `backend/observability.md`, `backend/quality.md`
69-
- `backend/features.md`, `backend/messaging.md`
61+
- `core/quality.md`, `core/git.md`, `core/testing.md`, `core/config.md`
62+
- `core/quality-gates.md`, `security/security.md`
7063
2. Assert section headings from every template in the chain are present
7164
3. Assert no template in the chain is referenced but not loaded
7265

‎tests/specs/SAIT-INT-TPL-02-001A.md‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,29 @@ tags: [composition, extend, inheritance]
4040

4141
- Repository cloned locally
4242
- Claude Code or equivalent agent available
43-
- Test pair: `core/testing.md` (contains `[ID: base-testing]`) and
44-
`stack/python-flask.md` (contains `[EXTEND: base-testing]` in its Testing section)
43+
- Test pair: `core/testing.md` (contains `[ID: base-testing-general]`) and
44+
`fixture/stack.md` (contains `[EXTEND: base-testing-general]`)
4545

4646
### Setup
4747

4848
1. Open Claude Code in the repository root
49-
2. Attach `core/testing.md` and `stack/python-flask.md`
49+
2. Attach `core/testing.md` and `fixture/stack.md`
5050

5151
### Execution
5252

5353
1. Ask the agent:
5454
```
55-
Show me the assembled Testing section for a Flask project.
55+
Show me the assembled general testing rules for the fixture stack.
5656
Include all rules from core/testing.md and all rules from the
57-
EXTEND in stack/python-flask.md.
57+
EXTEND in fixture/stack.md.
5858
```
5959
2. Record the assembled output
6060

6161
### Assertions
6262

63-
1. Assert all rules from `core/testing.md` `[ID: base-testing]` are present
64-
2. Assert all rules from `stack/python-flask.md` `[EXTEND: base-testing]`
63+
1. Assert all rules from `core/testing.md` `[ID: base-testing-general]` are
64+
present
65+
2. Assert all rules from `fixture/stack.md` `[EXTEND: base-testing-general]`
6566
are present
6667
3. Assert base rules appear before extension rules
6768
4. Assert no base rule is missing or overwritten

‎tests/specs/SAIT-INT-TPL-03-001A.md‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,30 @@ tags: [composition, override, inheritance]
3939

4040
- Repository cloned locally
4141
- Claude Code or equivalent agent available
42-
- Test pair: `stack/go-lib.md` (contains `[ID: go-lib-stack]`) and
43-
`stack/go-service.md` (contains `[OVERRIDE: go-lib-stack]` in its Stack section)
42+
- Test pair: `core/testing.md` (contains `[ID: testing-container-e2e]`) and
43+
`fixture/stack.md` (contains `[OVERRIDE: testing-container-e2e]`)
4444

4545
### Setup
4646

4747
1. Open Claude Code in the repository root
48-
2. Attach `stack/go-lib.md` and `stack/go-service.md`
48+
2. Attach `core/testing.md` and `fixture/stack.md`
4949

5050
### Execution
5151

5252
1. Ask the agent:
5353
```
54-
Show me the assembled Stack section for a Go service project.
55-
stack/go-service.md overrides the Stack section from stack/go-lib.md.
54+
Show me the assembled container e2e section for the fixture stack.
55+
fixture/stack.md overrides it from core/testing.md.
5656
Which rules appear?
5757
```
5858
2. Record the assembled output
5959

6060
### Assertions
6161

62-
1. Assert the assembled Stack section contains the rules from
63-
`stack/go-service.md` `[OVERRIDE: go-lib-stack]`
64-
2. Assert the rules from `stack/go-lib.md` `[ID: go-lib-stack]` do NOT appear
62+
1. Assert the assembled section contains the rules from
63+
`fixture/stack.md` `[OVERRIDE: testing-container-e2e]`
64+
2. Assert the rules from `core/testing.md` `[ID: testing-container-e2e]` do
65+
NOT appear
6566
3. Assert the section is not empty
6667

6768
### Teardown

0 commit comments

Comments
 (0)